From e8d8f2f0b311bbf3c36c63ed239870fc5bef4344 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:58:48 -0400 Subject: [PATCH 01/90] fix(deps): take Electron 43.7.5 so detached webviews stop blanking browser tabs (#23586) Electron 43.7.0 threw 'Invalid guestInstanceId' from 's disconnectedCallback for a loaded guest (electron/electron#53989), so a webview React removed and re-inserted kept a dead guest id: the tab went blank, reload did nothing, and the destroyed listener never fired. 43.7.4 (electron/electron#54097) returns early when the guest is gone. Raises the runtime floor test to 43.7.4 so a downgrade cannot re-ship it. Fixes STA-8757 --- config/scripts/electron-runtime-floor.test.ts | 16 ++++++++++------ package.json | 2 +- pnpm-lock.yaml | 16 ++++++++-------- pnpm-workspace.yaml | 1 - 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/config/scripts/electron-runtime-floor.test.ts b/config/scripts/electron-runtime-floor.test.ts index 77a1d4741e01..3506b736398e 100644 --- a/config/scripts/electron-runtime-floor.test.ts +++ b/config/scripts/electron-runtime-floor.test.ts @@ -7,10 +7,12 @@ import { describe, expect, it } from 'vitest' * around `gtk_init()` while FontConfig warmed up on a pool thread, and below * glibc 2.41 that frees `environ` under a concurrent `getenv()` — a launch-time * use-after-free on every Ubuntu we support (stablyai/orca#20081). 43.7.0 stops - * freeing the published `environ`. A downgrade past it re-ships that crash, and - * nothing else in the tree would notice. + * freeing the published `environ`. 43.7.0 itself threw `Invalid guestInstanceId` when a + * loaded `` left the DOM, which blanked browser tabs React re-inserted + * (electron/electron#53989); 43.7.4 fixes it. A downgrade past either re-ships the bug, + * and nothing else in the tree would notice. */ -const MINIMUM_ELECTRON_VERSION = '43.7.0' +const MINIMUM_ELECTRON_VERSION = '43.7.4' function parseVersion(specifier: string): [number, number, number] { const match = /(\d+)\.(\d+)\.(\d+)/.exec(specifier) @@ -35,15 +37,17 @@ describe('electron runtime floor', () => { it.each([ ['42.9.0', false], ['43.6.0', false], - ['43.7.0', true], - ['43.7.1', true], + ['43.7.0', false], + ['43.7.3', false], + ['43.7.4', true], + ['43.7.5', true], ['43.8.0', true], ['44.0.0', true] ])('reads %s as meeting the floor: %s', (specifier, expected) => { expect(meetsRuntimeFloor(specifier)).toBe(expected) }) - it('pins Electron at or above the glibc environ-race fix', () => { + it('pins Electron at or above the glibc environ-race and webview-detach fixes', () => { const packageJson = JSON.parse( readFileSync(join(__dirname, '../../package.json'), 'utf-8') ) as { devDependencies: Record } diff --git a/package.json b/package.json index 9ba088dcc4e6..feec79fee07e 100644 --- a/package.json +++ b/package.json @@ -256,7 +256,7 @@ "cmdk": "^1.1.1", "diff": "8.0.4", "dompurify": "3.4.15", - "electron": "43.7.0", + "electron": "43.7.5", "electron-builder": "^26.15.3", "electron-builder-squirrel-windows": "^26.15.3", "electron-vite": "^5.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d2fe31772f3..3d82edc51bfc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,7 +128,7 @@ importers: version: 0.3.251(@anthropic-ai/sdk@0.122.0(zod@4.6.5))(@modelcontextprotocol/sdk@1.30.0(supports-color@7.2.0)(zod@4.6.5))(zod@4.6.5) '@electron-toolkit/utils': specifier: ^4.0.0 - version: 4.0.0(electron@43.7.0(supports-color@7.2.0)) + version: 4.0.0(electron@43.7.5(supports-color@7.2.0)) '@floating-ui/dom': specifier: 1.8.0 version: 1.8.0 @@ -365,8 +365,8 @@ importers: specifier: 3.4.15 version: 3.4.15 electron: - specifier: 43.7.0 - version: 43.7.0(supports-color@7.2.0) + specifier: 43.7.5 + version: 43.7.5(supports-color@7.2.0) electron-builder: specifier: ^26.15.3 version: 26.15.3(electron-builder-squirrel-windows@26.15.3) @@ -4770,8 +4770,8 @@ packages: resolution: {integrity: sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==} engines: {node: '>=8.0.0'} - electron@43.7.0: - resolution: {integrity: sha512-m98FUehwnoo6q2D9Mr+n602Natb2CRFeKD81GhTdJlKh/Iyud0R1X8hChjpaMBLSsIX9r2ZEFnz0sdIALiO9ZQ==} + electron@43.7.5: + resolution: {integrity: sha512-AR+OLH/8QAwx6Lz6mhaDQhesbjC/Xh2WOiFSI/CDFU6FKX/qJdBg65bEUn+MLvbvIi/LlaRQeLljnUcKb1KS0A==} engines: {node: '>= 22.12.0'} hasBin: true @@ -7965,9 +7965,9 @@ snapshots: dependencies: '@types/node': 25.9.5 - '@electron-toolkit/utils@4.0.0(electron@43.7.0(supports-color@7.2.0))': + '@electron-toolkit/utils@4.0.0(electron@43.7.5(supports-color@7.2.0))': dependencies: - electron: 43.7.0(supports-color@7.2.0) + electron: 43.7.5(supports-color@7.2.0) '@electron/asar@3.4.1': dependencies: @@ -11628,7 +11628,7 @@ snapshots: transitivePeerDependencies: - supports-color - electron@43.7.0(supports-color@7.2.0): + electron@43.7.5(supports-color@7.2.0): dependencies: '@electron-internal/extract-zip': 1.0.4 '@electron/get': 5.0.0(supports-color@7.2.0) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1cf678294784..e8a845e1975e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -16,7 +16,6 @@ minimumReleaseAge: 4320 minimumReleaseAgeExclude: - pdfjs-dist@6.3.289 - zod@4.5.4 - - electron@43.7.0 - '@shadcn/lint@0.1.0' shamefullyHoist: true From 9c1f9b514ea3b2a5cf72131a4582f607d8cfb9f2 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:00:21 -0400 Subject: [PATCH 02/90] docs(readme): remove the TestFlight link (#23660) --- README.md | 4 ++-- docs/readme/README.fr.md | 4 ++-- docs/readme/README.ko.md | 4 ++-- docs/readme/README.pt.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e8722108c200..0f337f9e677e 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Monitor and steer your agents from your phone — get notified when an agent finishes and send follow-ups from anywhere. -[iOS App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) · [TestFlight](https://testflight.apple.com/join/YjeGMQBA) · [Android APK 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [Docs →](https://www.onorca.dev/docs/mobile) +[iOS App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) · [Android APK 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [Docs →](https://www.onorca.dev/docs/mobile) @@ -233,7 +233,7 @@ yay -S stably-orca-bin Pair with your desktop app to monitor and steer your agents from your phone. -- **iOS:** [Download on the App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) or [join TestFlight](https://testflight.apple.com/join/YjeGMQBA) +- **iOS:** [Download on the App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) - **Android:** [Download APK 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [Install guide](https://www.onorca.dev/docs/android-apk) --- diff --git a/docs/readme/README.fr.md b/docs/readme/README.fr.md index 1c7713bffd7d..d2757d919b2f 100644 --- a/docs/readme/README.fr.md +++ b/docs/readme/README.fr.md @@ -40,7 +40,7 @@ Surveillez et pilotez vos agents depuis votre téléphone — soyez notifié quand un agent termine, et envoyez des instructions de suivi où que vous soyez. -[App Store iOS](https://apps.apple.com/us/app/orca-ide/id6766130217) · [TestFlight](https://testflight.apple.com/join/YjeGMQBA) · [APK Android 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [Docs →](https://www.onorca.dev/docs/mobile) +[App Store iOS](https://apps.apple.com/us/app/orca-ide/id6766130217) · [APK Android 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [Docs →](https://www.onorca.dev/docs/mobile) @@ -238,7 +238,7 @@ yay -S stably-orca-bin Associez-la à l'app de bureau pour surveiller et piloter vos agents depuis votre téléphone. -- **iOS :** [Télécharger sur l'App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) ou [rejoindre TestFlight](https://testflight.apple.com/join/YjeGMQBA) +- **iOS :** [Télécharger sur l'App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) - **Android :** [Télécharger l'APK 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) --- diff --git a/docs/readme/README.ko.md b/docs/readme/README.ko.md index ab6d5c50eba6..25e20764c37a 100644 --- a/docs/readme/README.ko.md +++ b/docs/readme/README.ko.md @@ -36,7 +36,7 @@ 휴대폰에서 에이전트를 모니터링하고 조종하세요 — 에이전트가 완료되면 알림을 받고 어디서든 후속 지시를 보낼 수 있습니다. -[iOS App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) · [TestFlight](https://testflight.apple.com/join/YjeGMQBA) · [Android APK 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [문서 →](https://www.onorca.dev/docs/mobile) +[iOS App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) · [Android APK 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [문서 →](https://www.onorca.dev/docs/mobile) @@ -233,7 +233,7 @@ yay -S stably-orca-bin 데스크톱 앱과 페어링해 휴대폰에서 에이전트를 모니터링하고 조종하세요. -- **iOS:** [App Store에서 다운로드](https://apps.apple.com/us/app/orca-ide/id6766130217) 또는 [TestFlight 참여](https://testflight.apple.com/join/YjeGMQBA) +- **iOS:** [App Store에서 다운로드](https://apps.apple.com/us/app/orca-ide/id6766130217) - **Android:** [APK 0.0.50 다운로드](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [설치 가이드](https://www.onorca.dev/docs/android-apk) --- diff --git a/docs/readme/README.pt.md b/docs/readme/README.pt.md index 4ade6ad6e41f..baa17f95955f 100644 --- a/docs/readme/README.pt.md +++ b/docs/readme/README.pt.md @@ -36,7 +36,7 @@ Monitore e conduza seus agentes pelo celular — receba uma notificação quando um agente terminar e envie instruções de acompanhamento de qualquer lugar. -[App Store para iOS](https://apps.apple.com/us/app/orca-ide/id6766130217) · [TestFlight](https://testflight.apple.com/join/YjeGMQBA) · [APK Android 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [Docs →](https://www.onorca.dev/docs/mobile) +[App Store para iOS](https://apps.apple.com/us/app/orca-ide/id6766130217) · [APK Android 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) · [Docs →](https://www.onorca.dev/docs/mobile) @@ -233,7 +233,7 @@ yay -S stably-orca-bin Conecte ao app desktop para monitorar e conduzir seus agentes pelo celular. -- **iOS:** [Baixar na App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) ou [entrar no TestFlight](https://testflight.apple.com/join/YjeGMQBA) +- **iOS:** [Baixar na App Store](https://apps.apple.com/us/app/orca-ide/id6766130217) - **Android:** [Baixar APK 0.0.50](https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk) --- From a9195eedfa0b306310b573ff05b854058b80e0dc Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:03:01 -0400 Subject: [PATCH 03/90] docs: update GitHub star history chart (#23661) --- docs/assets/star-history.png | Bin 140054 -> 393689 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/docs/assets/star-history.png b/docs/assets/star-history.png index f069eb9059ca83019b1339ecc29f4735793c5e55..2de5029eee2f17947e43ea6a92f4fb56b77f6322 100644 GIT binary patch literal 393689 zcmbqcc|4Ts7mw0LtFmw97HNveQr6q1QmBNnmo=2EV`pynwh1kgoziN}nw?6>UfHu{ z8=;vjV~q88-eDNsdw<3K-5RYgTitUb1A#nqx-~onEqJ zt?H5`t4CH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{wxv866+;rbc_PWa;eM|M!tC-4fXNFNV*W%xZ75l<9nkrEiaTx_pt|k?FikG6 zg?E=ku#uO>esZ?u0A43<1&GMJpSut0-aj7yXCx*#isZ%F_;26nZgTuFmW2{=;Qk$e zpRoJ*E_a;u9zM}8_J^h&+Y{Cy#72N4Z*kXZGgze-LbT-x?Y(LD`e1cHFJFc*`;i@4 z9AhH3+DHB7eVdZY3IYS;)$cIvBRGDD^y(jOi!LFyq*5o#y6;kgL=I>f(QjNzOloz? zc$dk$#%Fh_6EtWKE(I3uFPPy$CEj&&|HP%RcoxXj?P9Mz%pi;}_^-H>hy-A9o*l+) z5d?7QvG{L~wb0pt+r@f&)NBvr-=ym|FeUPSK%qwe|1o0|n8q%Ybf#tUaQge?95s&}-j{Td3 zdq67iRJcC;{9`}Zfds(N9|Wn#(sGFY^M(T;^?(nyX(Yfu)n~jnsELR+HdN{D{fLN& e4ingSh-kpr-e9rx?N9Ixk-Ut`b@Vl3pZ^0Oxwm`( From b1d6fdf9ac34bd7813183c3ae27ebcebf86498e0 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 11:41:09 -0700 Subject: [PATCH 04/90] fix(claude): withdraw a follow-up queued behind a stopped turn instead of dropping it silently (#23553) * fix(claude): withdraw a follow-up queued behind a stopped turn instead of dropping it silently Orca's SessionStart hook proves most Claude starts before the turn's system/init, the only frame that advertises interrupt_cancel_queued_v1. Capabilities were read once from the start proof, so they stayed empty: Stop never asked Claude to cancel its queue, and the one-at-a-time fallback withdrew the follow-up without settling it. The send stayed pending and the chat read Working until the child exited. Capabilities are now one derived value, taken from whichever report names any and never cleared by one that names none. The fallback settles each send the CLI confirms it withdrew. * test(claude): pin that only a confirmed cancel_async_message counts as withdrawn * test(native-chat): await the async journal snapshot in the queued-stop test * test(native-chat): wait for the queued-stop states instead of sleeping A fixed 20 ms sleep does not cover the host's asynchronous journal writes on a loaded runner. --- .../claude-agent-sdk-control-requests.test.ts | 26 +++ .../claude-agent-sdk-control-requests.ts | 7 +- .../claude-structured-control-actions.test.ts | 50 ++++- .../claude-structured-control-actions.ts | 11 +- .../claude/claude-structured-init-proof.ts | 26 ++- .../claude-structured-queued-stop.test.ts | 204 ++++++++++++++++++ .../claude/claude-structured-real-cli.test.ts | 85 +++++++- ...ed-session-acquisition-processless.test.ts | 2 +- .../claude-structured-session-acquisition.ts | 9 +- .../claude-structured-session-startup.ts | 2 +- .../claude-structured-session-test-support.ts | 2 +- ...d-agent-session-claude-queued-stop.test.ts | 196 +++++++++++++++++ ...structured-fake-connection-test-fixture.ts | 2 +- ...ed-claude-scripted-runtime-test-support.ts | 2 +- 14 files changed, 601 insertions(+), 23 deletions(-) create mode 100644 src/main/claude/claude-structured-queued-stop.test.ts create mode 100644 src/main/native-chat/agent-session-wire/structured-agent-session-claude-queued-stop.test.ts diff --git a/src/main/claude/claude-agent-sdk-control-requests.test.ts b/src/main/claude/claude-agent-sdk-control-requests.test.ts index f76650d81515..01e822063e2a 100644 --- a/src/main/claude/claude-agent-sdk-control-requests.test.ts +++ b/src/main/claude/claude-agent-sdk-control-requests.test.ts @@ -24,3 +24,29 @@ describe('createClaudeControlSurface stopTask', () => { expect(stopTask).toHaveBeenCalledTimes(2) }) }) + +/** A query exposing only the cancel method, as the surface reads nothing else for it. */ +function queryWithCancel(cancelAsyncMessage?: (uuid: string) => Promise): Query { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: cancelAsyncMessage reads only this member. + return (cancelAsyncMessage ? { cancelAsyncMessage } : {}) as unknown as Query +} + +describe('createClaudeControlSurface cancelAsyncMessage', () => { + it('reports a withdrawal only when the CLI answers cancelled: true', async () => { + // An older CLI answers with an empty success, which carries no `cancelled`. + const cancelAsyncMessage = vi + .fn<(uuid: string) => Promise>() + .mockResolvedValueOnce(true) + .mockResolvedValueOnce(false) + .mockResolvedValueOnce(undefined) + const controls = createClaudeControlSurface(queryWithCancel(cancelAsyncMessage)) + + await expect(controls.cancelAsyncMessage('queued-1')).resolves.toBe(true) + await expect(controls.cancelAsyncMessage('queued-2')).resolves.toBe(false) + await expect(controls.cancelAsyncMessage('queued-3')).resolves.toBe(false) + expect(cancelAsyncMessage.mock.calls).toEqual([['queued-1'], ['queued-2'], ['queued-3']]) + await expect( + createClaudeControlSurface(queryWithCancel()).cancelAsyncMessage('queued-4') + ).resolves.toBe(false) + }) +}) diff --git a/src/main/claude/claude-agent-sdk-control-requests.ts b/src/main/claude/claude-agent-sdk-control-requests.ts index f165822c9379..d33131471021 100644 --- a/src/main/claude/claude-agent-sdk-control-requests.ts +++ b/src/main/claude/claude-agent-sdk-control-requests.ts @@ -94,7 +94,8 @@ export type ClaudeControlSurface = { interrupt: ( options?: ClaudeControlOptions & { cancelQueued?: boolean } ) => Promise - cancelAsyncMessage: (uuid: string, options?: ClaudeControlOptions) => Promise + /** True only when the CLI confirms it withdrew that message before it ran. */ + cancelAsyncMessage: (uuid: string, options?: ClaudeControlOptions) => Promise setModel: (model: string | undefined, options?: ClaudeControlOptions) => Promise setPermissionMode: (mode: PermissionMode, options?: ClaudeControlOptions) => Promise applyFlagSettings: ( @@ -131,9 +132,9 @@ export function createClaudeControlSurface(query: Query): ClaudeControlSurface { const cancel = claudeQueryAsyncCanceller(query) return cancel ? runClaudeControl('cancel_async_message', () => cancel(uuid), options?.timeoutMs).then( - () => {} + (cancelled) => cancelled === true ) - : Promise.resolve() + : Promise.resolve(false) }, setModel: (model, options) => runClaudeControl('set_model', () => query.setModel(model), options?.timeoutMs).then(() => {}), diff --git a/src/main/claude/claude-structured-control-actions.test.ts b/src/main/claude/claude-structured-control-actions.test.ts index 4aaf57bf54ca..5c5db2f01121 100644 --- a/src/main/claude/claude-structured-control-actions.test.ts +++ b/src/main/claude/claude-structured-control-actions.test.ts @@ -16,7 +16,7 @@ type InterruptResult = Awaited Promise - cancelAsyncMessage?: (uuid: string) => Promise + cancelAsyncMessage?: (uuid: string) => Promise prompts?: ClaudePromptRegistry }): { session: ClaudeSession @@ -24,7 +24,7 @@ function sessionWith(input: { cancelAsyncMessage: ReturnType } { const interrupt = vi.fn(input.interrupt) - const cancelAsyncMessage = vi.fn(input.cancelAsyncMessage ?? (async () => {})) + const cancelAsyncMessage = vi.fn(input.cancelAsyncMessage ?? (async () => false)) const session = sessionFor() session.capabilities = input.capabilities ?? [] session.prompts = input.prompts ?? new ClaudePromptRegistry() @@ -56,6 +56,52 @@ describe('cancelClaudeTurn', () => { expect(cancelAsyncMessage.mock.calls.map((call) => call[0])).toEqual(['queued-1', 'queued-2']) }) + it('settles each still-queued send the CLI confirms it withdrew, and only those', async () => { + const { session, cancelAsyncMessage } = sessionWith({ + capabilities: ['interrupt_receipt_v1'], + interrupt: async () => ({ still_queued: ['queued-1', 'queued-2', 'queued-3'] }), + // queued-2 already ran; queued-3's answer never arrived. + cancelAsyncMessage: async (uuid) => { + if (uuid === 'queued-3') { + throw new ClaudeControlRequestError('cancel_async_message', 'timed out') + } + return uuid === 'queued-1' + } + }) + const resolutions = [vi.fn(), vi.fn(), vi.fn()] + session.dispatchWaiters = ['queued-1', 'queued-2', 'queued-3'].map( + (sentUuid, index): ClaudeDispatchWaiter => ({ + acceptsResult: false, + clientMessageId: `client-${index + 1}`, + sentUuid, + dispatchSequence: index + 1, + requestedAt: null, + replayContentKey: `content-${index}`, + resolve: resolutions[index]! + }) + ) + const settled = vi.fn() + + await expect(cancelClaudeTurn(session, 5_000, () => true, settled)).resolves.toEqual({ + cancelled: true + }) + expect(cancelAsyncMessage).toHaveBeenCalledTimes(3) + expect(settled.mock.calls).toEqual([ + [ + { + clientMessageId: 'client-1', + state: 'rejected', + reason: 'provider_cancelled_before_start' + } + ] + ]) + expect(resolutions[0]).toHaveBeenCalledWith(null) + expect(session.dispatchWaiters.map((waiter) => waiter.sentUuid)).toEqual([ + 'queued-2', + 'queued-3' + ]) + }) + it('settles every cancelled queued waiter when the CLI advertises the capability', async () => { const cancelled = Array.from({ length: 64 }, (_, index) => `queued-${index}`) const { session, interrupt, cancelAsyncMessage } = sessionWith({ diff --git a/src/main/claude/claude-structured-control-actions.ts b/src/main/claude/claude-structured-control-actions.ts index 5e5906c4216c..8c1a6462e9c7 100644 --- a/src/main/claude/claude-structured-control-actions.ts +++ b/src/main/claude/claude-structured-control-actions.ts @@ -19,8 +19,9 @@ export type ClaudeTurnCancellationGuard = () => boolean * Interrupt the running turn, then make sure no queued async user message survives to spawn a * later unexpected turn. On a CLI advertising `interrupt_cancel_queued_v1` one round trip * cancels the queue alongside the abort; otherwise the interrupt receipt lists `still_queued` - * uuids, and each is withdrawn best-effort with `cancel_async_message`. Older CLIs resolve no - * receipt, so there is nothing to sweep. + * uuids, and each is withdrawn best-effort with `cancel_async_message`. Either way, every send + * the CLI confirms it withdrew settles as cancelled. Older CLIs resolve no receipt, so there is + * nothing to sweep. */ export async function cancelClaudeTurn( session: ClaudeSession, @@ -42,9 +43,13 @@ export async function cancelClaudeTurn( if (cancelQueued) { settleCancelledClaudeDispatchWaiters(session, receipt?.cancelled ?? [], onDispatchSettledLate) } else { + const withdrawn: string[] = [] for (const uuid of receipt?.still_queued ?? []) { - await session.connection.cancelAsyncMessage(uuid, { timeoutMs }).catch(() => {}) + if (await session.connection.cancelAsyncMessage(uuid, { timeoutMs }).catch(() => false)) { + withdrawn.push(uuid) + } } + settleCancelledClaudeDispatchWaiters(session, withdrawn, onDispatchSettledLate) } return { cancelled: true } } catch (error) { diff --git a/src/main/claude/claude-structured-init-proof.ts b/src/main/claude/claude-structured-init-proof.ts index 0d4af831ea99..ae2ee5896a8b 100644 --- a/src/main/claude/claude-structured-init-proof.ts +++ b/src/main/claude/claude-structured-init-proof.ts @@ -46,15 +46,25 @@ export function readClaudeModels(initialization: unknown): unknown[] { : [] } -/** CLI capabilities advertised on the initialize result or the yielded system/init frame. */ +/** + * The capabilities this CLI advertises: the first report given that names any, else `observed`. + * A SessionStart proof and the 2.1.280 initialize result name none, so only a turn's system/init + * may say what the binary supports, and a report naming none never retracts that. + */ export function readClaudeCapabilities( - init: ClaudeInitObservation, - initialization: unknown -): string[] { - const fromResult = isRecord(initialization) ? initialization.capabilities : undefined - const fromFrame = init.message.capabilities - const source = Array.isArray(fromResult) ? fromResult : Array.isArray(fromFrame) ? fromFrame : [] - return source.filter((value): value is string => typeof value === 'string') + observed: readonly string[], + ...reports: unknown[] +): readonly string[] { + for (const report of reports) { + const advertised = isRecord(report) ? report.capabilities : undefined + const capabilities = Array.isArray(advertised) + ? advertised.filter((value): value is string => typeof value === 'string') + : [] + if (capabilities.length > 0) { + return capabilities + } + } + return observed } export function claudeInitializationAuthError( diff --git a/src/main/claude/claude-structured-queued-stop.test.ts b/src/main/claude/claude-structured-queued-stop.test.ts new file mode 100644 index 000000000000..0c4b6ed6e728 --- /dev/null +++ b/src/main/claude/claude-structured-queued-stop.test.ts @@ -0,0 +1,204 @@ +// A send Claude queued behind the running turn is dropped by Stop, so it must settle as withdrawn. +// Orca's SessionStart hook proves most starts before the turn's system/init, which is the only +// frame that says whether the CLI can cancel its queue. + +import { describe, expect, it, vi } from 'vitest' +import type { AgentJournalItemBody } from '../../shared/agent-session-journal-types' +import { agentJournalItemKey } from '../../shared/agent-session-journal-item-key' +import { readAgentJournalTurn } from '../../shared/agent-session-turn-record' +import { DISPATCH_REJECTED_CANCELLED } from '../../shared/structured-agent-session-dispatch-rejection' +import type { ClaudeStructuredSessionAdapterDeps } from './claude-structured-session-state' +import { CLAUDE_DISPATCH_ADMISSION_TIMEOUT_MS } from './claude-structured-prompt-ownership' +import { + PROVIDER_SESSION_ID, + USER_MESSAGE, + adapterFor, + fakeClaude, + identityFor, + type FakeConnection +} from './claude-structured-session-test-support' + +// As Claude Code 2.1.280 advertises them on a turn's system/init frame. +const CAPABILITIES = ['interrupt_receipt_v1', 'interrupt_cancel_queued_v1', 'msg_lifecycle_v1'] + +type Settlement = Parameters< + NonNullable +>[0] + +/** Answers the way the real CLI does: cancel_queued cancels the queue, a plain interrupt keeps it. */ +function claudeCli(options: Parameters[0] = {}) { + let queued: string[] = [] + const claude = fakeClaude({ + replayUuid: null, + ...options, + routes: { + interrupt: (params) => + params?.cancelQueued + ? { still_queued: [], cancelled: queued.splice(0) } + : { still_queued: [...queued] }, + cancel_async_message: (params) => { + const before = queued.length + queued = queued.filter((uuid) => uuid !== params?.uuid) + return queued.length < before + } + } + }) + return { claude, queue: (uuid: string) => queued.push(uuid) } +} + +function turnInit(capabilities?: string[]): Record { + return { + type: 'system', + subtype: 'init', + session_id: PROVIDER_SESSION_ID, + uuid: 'turn-init', + model: 'claude-sonnet-5', + ...(capabilities ? { capabilities } : {}) + } +} + +async function acquired( + claude: ReturnType, + settlements: Settlement[] = [] +): Promise<{ + adapter: ReturnType + bodies: Map + connection: FakeConnection +}> { + const bodies = new Map() + const adapter = adapterFor(claude, {}, [], [], undefined, undefined, undefined, (settlement) => + settlements.push(settlement) + ) + await adapter.acquire({ + identity: identityFor(), + fence: 7, + spawnToken: 'spawn-9', + events: { + appendItem: (identity, body) => bodies.set(agentJournalItemKey(identity), body), + appendTombstone: (identity) => bodies.delete(agentJournalItemKey(identity)), + publish: vi.fn() + } + }) + return { adapter, bodies, connection: claude.connections[0]! } +} + +function runningTurnId(bodies: Map): string { + for (const body of bodies.values()) { + const turn = readAgentJournalTurn(body) + if (turn?.state === 'running') { + return turn.turnId + } + } + throw new Error('expected a running turn') +} + +/** Sends A and opens its turn, queues B behind it, then Stops A as the host does. */ +async function stopWithQueuedFollowUp( + cli: ReturnType, + openTurn: (connection: FakeConnection) => void +): Promise<{ interrupt: unknown; settlements: Settlement[] }> { + const settlements: Settlement[] = [] + const { adapter, bodies, connection } = await acquired(cli.claude, settlements) + const send = (clientMessageId: string) => + adapter.dispatch({ sessionId: 'session-1', clientMessageId, body: USER_MESSAGE, fence: 7 }) + await send('client-a') + openTurn(connection) + // Claude adopts the client uuid for the echo that opens the turn. + connection.handlers.onMessage?.({ + ...connection.sent.at(-1)!, + uuid: connection.sent.at(-1)!.uuid + }) + await send('client-b') + cli.queue(String(connection.sent.at(-1)!.uuid)) + + vi.useFakeTimers() + try { + const stopped = adapter.cancelTurn({ + sessionId: 'session-1', + turnId: runningTurnId(bodies), + fence: 7, + // The host reads B's handover from the journal, and it is still pending. + dispatchStatus: { state: 'pending', recovered: false } + }) + await vi.advanceTimersByTimeAsync(CLAUDE_DISPATCH_ADMISSION_TIMEOUT_MS) + await expect(stopped).resolves.toEqual({ cancelled: true }) + } finally { + vi.useRealTimers() + } + return { + interrupt: connection.calls.find((call) => call.subtype === 'interrupt')?.params, + settlements: settlements.filter((settlement) => settlement.clientMessageId === 'client-b') + } +} + +const WITHDRAWN = [ + { + sessionId: 'session-1', + clientMessageId: 'client-b', + state: 'rejected', + reason: DISPATCH_REJECTED_CANCELLED + } +] + +describe('Stop with a follow-up Claude queued behind the running turn', () => { + it('withdraws it the same way whether system/init or a SessionStart hook proved the start', async () => { + const byInit = await stopWithQueuedFollowUp( + claudeCli({ initProof: 'init', capabilities: CAPABILITIES }), + () => {} + ) + const bySessionStart = await stopWithQueuedFollowUp( + claudeCli({ initProof: 'session-start' }), + (connection) => connection.handlers.onMessage?.(turnInit(CAPABILITIES)) + ) + + expect(byInit).toEqual({ interrupt: { cancelQueued: true }, settlements: WITHDRAWN }) + expect(bySessionStart).toEqual(byInit) + }) + + it('keeps what a turn advertised when a later frame names nothing', async () => { + const result = await stopWithQueuedFollowUp( + claudeCli({ initProof: 'session-start' }), + (connection) => { + connection.handlers.onMessage?.(turnInit(CAPABILITIES)) + connection.handlers.onMessage?.(turnInit()) + connection.handlers.onMessage?.({ + type: 'system', + subtype: 'hook_response', + hook_name: 'SessionStart:resume', + session_id: PROVIDER_SESSION_ID + }) + } + ) + + expect(result).toEqual({ interrupt: { cancelQueued: true }, settlements: WITHDRAWN }) + }) + + it('keeps what a turn advertised when the start is read after it', async () => { + const cli = claudeCli({ initProof: 'session-start' }) + const open = cli.claude.openConnection + // The turn's init lands while startup still waits on get_settings, as a send that starts the + // agent allows. + cli.claude.openConnection = async (launch, handlers) => { + const connection = await open(launch, handlers) + const getSettings = connection.getSettings + connection.getSettings = async (options) => { + handlers?.onMessage?.(turnInit(CAPABILITIES)) + return getSettings(options) + } + return connection + } + + const result = await stopWithQueuedFollowUp(cli, () => {}) + + expect(result).toEqual({ interrupt: { cancelQueued: true }, settlements: WITHDRAWN }) + }) + + it('settles a follow-up withdrawn one at a time on a CLI without cancel_queued', async () => { + const result = await stopWithQueuedFollowUp( + claudeCli({ initProof: 'init', capabilities: ['interrupt_receipt_v1'] }), + () => {} + ) + + expect(result).toEqual({ interrupt: {}, settlements: WITHDRAWN }) + }) +}) diff --git a/src/main/claude/claude-structured-real-cli.test.ts b/src/main/claude/claude-structured-real-cli.test.ts index c117e3e863f1..7fcd9a51de20 100644 --- a/src/main/claude/claude-structured-real-cli.test.ts +++ b/src/main/claude/claude-structured-real-cli.test.ts @@ -13,6 +13,7 @@ import { ClaudeStructuredSessionAdapter, type ClaudeStructuredSessionEvent } from './claude-structured-session-adapter' +import type { ClaudeStructuredSessionAdapterDeps } from './claude-structured-session-state' const command = resolveClaudeCommand() const versionLaunch = getSpawnArgsForWindows(command, ['--version']) @@ -49,7 +50,8 @@ function realAdapter( providerSessionId: string, claudeConfigDir: string, events: ClaudeStructuredSessionEvent[] = [], - cwd = process.cwd() + cwd = process.cwd(), + onDispatchSettledLate?: ClaudeStructuredSessionAdapterDeps['onDispatchSettledLate'] ): ClaudeStructuredSessionAdapter { const adapter = new ClaudeStructuredSessionAdapter({ resolveLaunch: async () => ({ @@ -63,6 +65,7 @@ function realAdapter( continuesChain: false }), onEvent: (event) => events.push(event), + ...(onDispatchSettledLate ? { onDispatchSettledLate } : {}), readProcessStartTime: async () => 1, now: () => 2 }) @@ -302,6 +305,86 @@ describe.skipIf(!realClaudeAvailable)('Claude structured real CLI handshake', () 90_000 ) + // Orca installs a SessionStart hook, so its frame proves most real starts before the turn's + // system/init, the only frame that says this CLI can cancel what it queued. + it.skipIf(!realClaudeAuthenticated)( + 'withdraws a follow-up queued behind a turn that is stopped, behind a SessionStart hook', + async () => { + const providerSessionId = randomUUID() + const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR?.trim() || join(homedir(), '.claude') + const cwd = await mkdtemp(join(tmpdir(), 'orca-queued-stop-')) + await mkdir(join(cwd, '.claude'), { recursive: true }) + await writeFile( + join(cwd, '.claude', 'settings.json'), + JSON.stringify({ + hooks: { SessionStart: [{ hooks: [{ type: 'command', command: 'true' }] }] } + }) + ) + const events: ClaudeStructuredSessionEvent[] = [] + const settlements: unknown[] = [] + const adapter = realAdapter(providerSessionId, claudeConfigDir, events, cwd, (settlement) => + settlements.push(settlement) + ) + const send = (clientMessageId: string, text: string) => + adapter.dispatch({ + sessionId: 'real-cli-handshake', + clientMessageId, + body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text }] }, + fence: 1 + }) + const waitFor = async (found: () => boolean): Promise => { + const deadline = Date.now() + 60_000 + while (!found() && Date.now() < deadline) { + await new Promise((resolve) => setTimeout(resolve, 100)) + } + return found() + } + + try { + await adapter.acquire({ + identity: identity(providerSessionId), + fence: 1, + spawnToken: 'real-cli-queued-stop' + }) + await send('real-cli-queued-stop-a', 'Count from 1 to 400, one number per line.') + // A's reply is streaming, so the next send queues behind its turn. + await expect( + waitFor(() => + events.some( + (event) => + event.type === 'message' && + event.message.type === 'stream_event' && + JSON.stringify(event.message).includes('text_delta') + ) + ) + ).resolves.toBe(true) + await send('real-cli-queued-stop-b', 'Say the word banana.') + + await expect( + adapter.cancelTurn({ + sessionId: 'real-cli-handshake', + turnId: 'turn-a', + fence: 1, + resolveLiveTurnId: () => 'turn-a', + // What the host reads for B: handed over, not yet answered. + dispatchStatus: { state: 'pending', recovered: false } + }) + ).resolves.toEqual({ cancelled: true }) + + expect(settlements).toContainEqual({ + sessionId: 'real-cli-handshake', + clientMessageId: 'real-cli-queued-stop-b', + state: 'rejected', + reason: 'provider_cancelled_before_start' + }) + } finally { + await adapter.closeAll() + await rm(cwd, { recursive: true, force: true }) + } + }, + 150_000 + ) + it('turns a real silent unauthenticated startup into sign-in guidance', async () => { const claudeConfigDir = await mkdtemp(join(tmpdir(), 'orca-claude-no-auth-')) const providerSessionId = randomUUID() diff --git a/src/main/claude/claude-structured-session-acquisition-processless.test.ts b/src/main/claude/claude-structured-session-acquisition-processless.test.ts index 85de77bbbd89..eb4babdb9aca 100644 --- a/src/main/claude/claude-structured-session-acquisition-processless.test.ts +++ b/src/main/claude/claude-structured-session-acquisition-processless.test.ts @@ -37,7 +37,7 @@ describe('Claude structured processless acquisition', () => { getContextUsage: async () => ({}), supportedModels: async () => [], interrupt: async () => undefined, - cancelAsyncMessage: async () => {}, + cancelAsyncMessage: async () => false, setModel: async () => {}, setPermissionMode: async () => {}, applyFlagSettings: async () => {}, diff --git a/src/main/claude/claude-structured-session-acquisition.ts b/src/main/claude/claude-structured-session-acquisition.ts index 372e1f8eb945..ac8d65ba107b 100644 --- a/src/main/claude/claude-structured-session-acquisition.ts +++ b/src/main/claude/claude-structured-session-acquisition.ts @@ -8,7 +8,11 @@ import { isClaudeAuthSwitchInProgress } from '../claude-accounts/live-pty-gate' import { openClaudeStreamJsonConnection } from './claude-stream-json-connection' import { buildClaudePermissionCallbacks } from './claude-structured-inbound-control' import { resolveClaudeReplayTurn } from './claude-structured-dispatch' -import { readClaudeFrameString, readClaudeInit } from './claude-structured-init-proof' +import { + readClaudeCapabilities, + readClaudeFrameString, + readClaudeInit +} from './claude-structured-init-proof' import { claudeConfigDirEnvPatch } from './claude-config-dir-pin' import { CLAUDE_SPAWN_TOKEN_ENV, claudeProcessIdentity } from './claude-structured-owner-identity' import { ClaudePromptRegistry } from './claude-structured-prompt-replies' @@ -101,6 +105,9 @@ export async function acquireClaudeSession({ liveSession.reportedOptions.model = init.model liveSession.reportedModelMutation = liveSession.optionMutationSequence } + if (liveSession) { + liveSession.capabilities = readClaudeCapabilities(liveSession.capabilities, init.message) + } } observedLeafUuid = readClaudeTranscriptEntryUuid(message) ?? observedLeafUuid if (liveSession) { diff --git a/src/main/claude/claude-structured-session-startup.ts b/src/main/claude/claude-structured-session-startup.ts index d486a670a13e..ce14a64dd2cf 100644 --- a/src/main/claude/claude-structured-session-startup.ts +++ b/src/main/claude/claude-structured-session-startup.ts @@ -138,7 +138,7 @@ function applyClaudeStartupFacts(session: ClaudeSession, facts: ClaudeStartupFac session.fastModeState ??= published.fastModeState session.fastModeDisabledReason ??= published.fastModeDisabledReason session.options = prepared.options - session.capabilities = readClaudeCapabilities(init, initialization) + session.capabilities = readClaudeCapabilities(session.capabilities, initialization, init.message) // A catalog frame that streamed in after publish is newer than the initialize answer. if (session.commands.commands === undefined) { session.commands = new ClaudeSlashCommandCatalog(init.message, initialization) diff --git a/src/main/claude/claude-structured-session-test-support.ts b/src/main/claude/claude-structured-session-test-support.ts index c8e3d86b0e86..51c7c1c8fff7 100644 --- a/src/main/claude/claude-structured-session-test-support.ts +++ b/src/main/claude/claude-structured-session-test-support.ts @@ -173,7 +173,7 @@ export function fakeClaude( }, cancelAsyncMessage: async (uuid) => { connection.calls.push({ subtype: 'cancel_async_message', params: { uuid } }) - routed('cancel_async_message', { uuid }) + return routed('cancel_async_message', { uuid }) === true }, stopTask: async (taskId) => { connection.calls.push({ subtype: 'stop_task', params: { taskId } }) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-claude-queued-stop.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-claude-queued-stop.test.ts new file mode 100644 index 000000000000..e8b8d0f00442 --- /dev/null +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-claude-queued-stop.test.ts @@ -0,0 +1,196 @@ +// A follow-up Claude queued behind the running turn is dropped by Stop, so the chat must record it +// as withdrawn and stop reading as working — under the SessionStart hook Orca installs, whose frame +// proves the start before the turn's system/init says the CLI can cancel its queue. + +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, expect, it, vi } from 'vitest' +import { computeAgentSessionPayloadFingerprint } from '../../../shared/agent-session-mutation-envelope' +import { DISPATCH_REJECTED_CANCELLED } from '../../../shared/structured-agent-session-dispatch-rejection' +import { activeStructuredAgentSessionTurnId } from '../../../shared/structured-agent-session-live-turn' +import { projectStructuredAgentSessionStatus } from '../../../shared/structured-agent-session-projection' +import { ClaudeStructuredSessionAdapter } from '../../claude/claude-structured-session-adapter' +import { + fakeClaude, + PROVIDER_SESSION_ID +} from '../../claude/claude-structured-session-test-support' +import { AgentSessionRecordStore } from '../../runtime/agent-session-record-store' +import { structuredClaudeLifecycleEvent } from '../../runtime/structured-claude-runtime-adapter' +import { StructuredAgentSessionHost } from './structured-agent-session-host' +import { + HOST_TEST_NOW as NOW, + HOST_TEST_SESSION as SESSION, + hostTestAttachParams, + hostTestMessage, + hostTestOperationId, + resetHostTestOperationIds +} from './structured-agent-session-host-test-data' + +const CALLER = { callerKey: 'client-1' } +// As Claude Code 2.1.280 advertises them on a turn's system/init frame. +const CAPABILITIES = ['interrupt_receipt_v1', 'interrupt_cancel_queued_v1', 'msg_lifecycle_v1'] + +let root: string +let host: StructuredAgentSessionHost +let adapter: ClaudeStructuredSessionAdapter +let store: AgentSessionRecordStore +let queued: string[] +let claude: ReturnType + +beforeEach(async () => { + root = await mkdtemp(join(tmpdir(), 'orca-claude-queued-stop-')) + resetHostTestOperationIds() + queued = [] + claude = fakeClaude({ + replayUuid: null, + initProof: 'session-start', + // What the real CLI answers: cancel_queued cancels the queue, a plain interrupt keeps it. + routes: { + interrupt: (params) => + params?.cancelQueued + ? { still_queued: [], cancelled: queued.splice(0) } + : { still_queued: [...queued] } + } + }) + const lifecycle: Promise[] = [] + adapter = new ClaudeStructuredSessionAdapter({ + resolveLaunch: async () => ({ + pathToClaudeCodeExecutable: 'claude', + options: {}, + cwd: root, + claudeConfigDir: join(root, 'claude-home'), + providerSessionId: PROVIDER_SESSION_ID, + resumeLeafUuid: null, + resumesTranscript: false, + continuesChain: false + }), + onEvent: (event) => { + const mapped = structuredClaudeLifecycleEvent(event) + if (mapped) { + lifecycle.push(host.handleAdapterEvent(mapped)) + } + }, + // As the runtime wires it. + onDispatchSettledLate: (settlement) => void host.settleLateDispatch(settlement), + openConnection: claude.openConnection, + readProcessStartTime: async () => 1_700_000_000_000, + now: () => NOW + }) + store = await AgentSessionRecordStore.open({ directory: join(root, 'store'), hostId: 'local' }) + host = new StructuredAgentSessionHost({ + store, + adapter: Object.assign(adapter, { supportsCreate: () => true }), + journalRoot: root, + claimKeyId: 'key-1', + mintSpawnToken: () => 'spawn-a', + now: () => NOW + }) + const params = hostTestAttachParams(null, { + provider: 'claude', + agent: 'claude', + accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: join(root, 'claude-home') }, + providerHandle: { kind: 'claude', sessionId: PROVIDER_SESSION_ID, leafUuid: null } + }) + expect(await host.attach(CALLER, params)).toMatchObject({ ok: true }) + await adapter.awaitStarted(SESSION) + await Promise.all(lifecycle) +}) + +afterEach(async () => { + await adapter.closeAll() + await host.flushAllStreamedEvents() + await rm(root, { recursive: true, force: true }) +}) + +function eventually(assertion: () => unknown): Promise { + return vi.waitFor(assertion, { timeout: 10_000 }) +} + +function envelope( + method: 'agentSession.send' | 'agentSession.cancel', + fields: Record +) { + return { + sessionId: SESSION, + clientOperationId: hostTestOperationId(), + expectedRuntimeFence: store.getRecord(SESSION)!.lease.runtimeFence, + payloadFingerprint: computeAgentSessionPayloadFingerprint({ + method, + sessionId: SESSION, + fields + }) + } +} + +async function send(text: string): Promise { + const body = hostTestMessage(text) + const sent = await host.send(CALLER, { envelope: envelope('agentSession.send', { body }), body }) + if (!sent.ok) { + throw new Error('send refused') + } + return sent.value.clientMessageId +} + +async function dispatch(clientMessageId: string) { + const submission = (await host.journalSnapshot(SESSION)).submissions.find( + (entry) => entry.clientMessageId === clientMessageId + ) + return { state: submission?.dispatchState, reason: submission?.reason } +} + +async function status(): Promise { + const snapshot = await host.journalSnapshot(SESSION) + return projectStructuredAgentSessionStatus( + snapshot.items, + snapshot.submissions, + store.getRecord(SESSION)!.lease.runtimeFence + ) +} + +it('withdraws a follow-up Claude queued behind the running turn when that turn is stopped', async () => { + const connection = claude.connections[0]! + const first = await send('Write a long reply.') + await eventually(() => expect(connection.sent).toHaveLength(1)) + // Claude opens the turn: its system/init, then the echo of the message it runs. + connection.handlers.onMessage?.({ + type: 'system', + subtype: 'init', + session_id: PROVIDER_SESSION_ID, + uuid: 'turn-init', + model: 'claude-sonnet-5', + capabilities: CAPABILITIES + }) + connection.handlers.onMessage?.({ + ...connection.sent.at(-1)!, + uuid: connection.sent.at(-1)!.uuid + }) + await eventually(async () => expect((await dispatch(first)).state).toBe('accepted')) + const turnId = activeStructuredAgentSessionTurnId((await host.journalSnapshot(SESSION)).items) + expect(turnId).not.toBeNull() + + const followUp = await send('And then this.') + await eventually(() => expect(connection.sent).toHaveLength(2)) + queued.push(String(connection.sent.at(-1)!.uuid)) + await eventually(async () => expect((await dispatch(followUp)).state).toBe('pending')) + + const stopped = await host.cancel(CALLER, { + envelope: envelope('agentSession.cancel', { turnId }), + turnId: turnId! + }) + expect(stopped).toMatchObject({ ok: true, value: { cancelled: true } }) + // The interrupted turn closes as the CLI ends it. + connection.handlers.onMessage?.({ + type: 'result', + subtype: 'error_during_execution', + session_id: PROVIDER_SESSION_ID, + uuid: 'interrupted-result' + }) + await eventually(async () => + expect(await dispatch(followUp)).toEqual({ + state: 'rejected', + reason: DISPATCH_REJECTED_CANCELLED + }) + ) + await eventually(async () => expect(await status()).toBe('idle')) +}, 15_000) diff --git a/src/main/runtime/claude-structured-fake-connection-test-fixture.ts b/src/main/runtime/claude-structured-fake-connection-test-fixture.ts index b64f6980689d..3404bcbf283c 100644 --- a/src/main/runtime/claude-structured-fake-connection-test-fixture.ts +++ b/src/main/runtime/claude-structured-fake-connection-test-fixture.ts @@ -76,7 +76,7 @@ export function fakeClaude(providerSession: string) { connection.calls.push({ subtype: 'interrupt', params: {} }) return undefined }, - cancelAsyncMessage: async () => {}, + cancelAsyncMessage: async () => false, stopTask: async (taskId) => { connection.calls.push({ subtype: 'stop_task', params: { taskId } }) }, diff --git a/src/main/runtime/structured-claude-scripted-runtime-test-support.ts b/src/main/runtime/structured-claude-scripted-runtime-test-support.ts index 33aa18f05706..07de5e58761a 100644 --- a/src/main/runtime/structured-claude-scripted-runtime-test-support.ts +++ b/src/main/runtime/structured-claude-scripted-runtime-test-support.ts @@ -172,7 +172,7 @@ export function createScriptedClaudeRuntime(sessionIds: readonly string[]) { setPermissionMode: () => optionWrite('set_permission_mode'), applyFlagSettings: () => optionWrite('apply_flag_settings'), interrupt: async () => undefined, - cancelAsyncMessage: async () => {}, + cancelAsyncMessage: async () => false, stopTask: async () => {}, send: async () => { child.calls.push('send') From d691486b3fc2dc6cbc916647d3deef2c796938f9 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 11:42:03 -0700 Subject: [PATCH 05/90] fix(codex): a message whose turn was stopped before Codex took it is withdrawn, not stuck (#23618) * fix(native-chat): land a late settlement from a streamed turn's end after that turn's rows A settlement that says a streamed turn ended waits for the session's event sink to drain before writing its dispatch row. The journal reducer still refuses to overwrite an accepted or rejected send. * fix(codex): settle a send from the end of the turn Codex answered it into The turn/start answer names the turn that holds a send. The send's echo entry now keeps that binding, in memory only. If the bound turn is interrupted without echoing the send, the send is withdrawn: Codex clears a turn's pending input on interrupt, so the model never saw it. If the turn fails first, the send is rejected in Codex's words. A completed turn settles nothing, since Codex records pending input when it finishes and the echo is still due. An answer read after its turn already ended is settled by that end. The echo is still the acceptance and carries the item key. * test(codex): a send settles from the end of the turn Codex answered it into The fake Codex keeps 0.157's turn bookkeeping, and can deliver the turn/start answer after turn/started or after turn/completed. The tests cover: - a Stop before any echo withdraws the send, and the working rule reads idle; - a steered follow-up is withdrawn when the turn is interrupted; - a failed turn rejects the send in Codex's words; - a completed turn leaves the send to its echo; - a normal echo and a late echo; - two steered sends in one turn; - an answer read after the turn ended; - a timed-out answer; - child-thread turns; - how a binding dies. * refactor(native-chat): drop the stream flush before a late turn-end settlement Nothing reads the order of a dispatch row against the turn's terminal row: the reducer keeps a settled send terminal and the working state is derived from both. The echo acceptance on the same path never waited either, and the wait could drop the settlement on a failed sink barrier. * fix(codex): settle a failed turn's sends at its end, not at its error Codex keeps a failed turn's pending input and records it after the error frame, before turn/completed. Settling at the error rejected a steered follow-up the model had in fact received, so a Retry would send it twice. * docs(codex): say a completed turn echoes what it took before it ends Codex records a completed turn's pending input before `turn/completed`, so a bound send that turn never echoed is left for recovery, not awaiting an echo. The comments and one test title said the echo was still due. * test(codex): settle a send whose answer is read after its turn failed or completed A failed turn that ended before the answer rejects the send in Codex's words, once; a completed one leaves it admitted and still armed for its echo. * refactor(codex): read a failed turn's reason with the typed thread-fact reader --- .../codex/codex-structured-dispatch-echo.ts | 63 +++- .../codex-structured-dispatch-test-support.ts | 9 +- .../codex/codex-structured-session-adapter.ts | 5 + .../codex/codex-structured-session-state.ts | 15 +- .../codex/codex-structured-thread-facts.ts | 5 + ...dex-structured-turn-end-settlement.test.ts | 322 ++++++++++++++++++ .../codex-structured-turn-end-settlement.ts | 96 ++++++ src/main/codex/codex-structured-turn-start.ts | 47 ++- src/main/codex/codex-turn-lifecycle-fake.ts | 112 ++++++ ...-session-codex-turn-end-settlement.test.ts | 217 ++++++++++++ 10 files changed, 852 insertions(+), 39 deletions(-) create mode 100644 src/main/codex/codex-structured-turn-end-settlement.test.ts create mode 100644 src/main/codex/codex-structured-turn-end-settlement.ts create mode 100644 src/main/codex/codex-turn-lifecycle-fake.ts create mode 100644 src/main/runtime/structured-agent-session-codex-turn-end-settlement.test.ts diff --git a/src/main/codex/codex-structured-dispatch-echo.ts b/src/main/codex/codex-structured-dispatch-echo.ts index 4ecfcf2da01a..c1a020b2c1f8 100644 --- a/src/main/codex/codex-structured-dispatch-echo.ts +++ b/src/main/codex/codex-structured-dispatch-echo.ts @@ -1,8 +1,17 @@ +import type { ProviderDiagnostic } from '../../shared/agent-session-failure' import type { AgentJournalItemIdentity } from '../../shared/agent-session-journal-types' -/** Sends awaiting their echo. A send whose echo never arrives is - * retired by the journal's pending-submission recovery on exit, not from here. */ +/** Sends awaiting their echo. One bound to a turn that ended without taking it settles from that + * end; any other whose echo never arrives is retired by the journal's recovery on exit. */ export const MAX_CODEX_PENDING_DISPATCH_ECHOES = 256 +/** Turn ends kept for an answer read after the turn it names had already ended. */ +export const MAX_CODEX_RECORDED_TURN_ENDS = 64 + +/** How a primary-thread turn ended, as Codex reported it. */ +export type CodexTurnEnd = + | { status: 'completed' } + | { status: 'interrupted' } + | { status: 'failed'; detail?: ProviderDiagnostic } export type CodexDispatchRequestOrigin = { requestedAt: number @@ -24,6 +33,16 @@ export type CodexDispatchEchoes = { settle: (clientMessageId: string) => boolean /** Drops an armed send whose write never reached the provider. */ disarm: (clientMessageId: string) => void + /** + * Binds a send to the turn Codex answered it into. Returns that turn's end when the answer is + * read after it; a send that end settles is no longer armed. + */ + bindTurn: (clientMessageId: string, threadId: string, turnId: string) => CodexTurnEnd | null + /** + * Records a turn's end and returns the sends bound to it that it settles: all of them unless it + * completed, which echoes its pending input first, so one it never echoed waits for recovery. + */ + endTurn: (threadId: string, turnId: string, end: CodexTurnEnd) => string[] /** Submission origin for this exact send, retained until its echo settles it. */ requestOrigin: (clientMessageId: string) => CodexDispatchRequestOrigin | null /** Highest causal sequence assigned to a dispatch in this session. */ @@ -33,8 +52,11 @@ export type CodexDispatchEchoes = { } export function createCodexDispatchEchoes(): CodexDispatchEchoes { - const armed = new Map() + const armed = new Map() + const endedTurns = new Map() let nextSequence = 0 + const turnKey = (threadId: string, turnId: string): string => JSON.stringify([threadId, turnId]) + const settles = (end: CodexTurnEnd): boolean => end.status !== 'completed' return { arm(clientMessageId, requestedAt) { const existing = armed.get(clientMessageId) @@ -52,6 +74,40 @@ export function createCodexDispatchEchoes(): CodexDispatchEchoes { }, settle: (clientMessageId) => armed.delete(clientMessageId), disarm: (clientMessageId) => void armed.delete(clientMessageId), + bindTurn: (clientMessageId, threadId, turnId) => { + const entry = armed.get(clientMessageId) + if (!entry) { + return null + } + const turn = turnKey(threadId, turnId) + entry.turn = turn + const end = endedTurns.get(turn) ?? null + if (end && settles(end)) { + armed.delete(clientMessageId) + } + return end + }, + endTurn: (threadId, turnId, end) => { + const turn = turnKey(threadId, turnId) + endedTurns.delete(turn) + endedTurns.set(turn, end) + for (const oldest of endedTurns.keys()) { + if (endedTurns.size <= MAX_CODEX_RECORDED_TURN_ENDS) { + break + } + endedTurns.delete(oldest) + } + if (!settles(end)) { + return [] + } + const settled = [...armed].flatMap(([clientMessageId, entry]) => + entry.turn === turn ? [clientMessageId] : [] + ) + for (const clientMessageId of settled) { + armed.delete(clientMessageId) + } + return settled + }, requestOrigin: (clientMessageId) => { const origin = armed.get(clientMessageId) return origin?.requestedAt === null || origin === undefined @@ -61,6 +117,7 @@ export function createCodexDispatchEchoes(): CodexDispatchEchoes { latestSequence: () => nextSequence - 1, clear: () => { armed.clear() + endedTurns.clear() nextSequence = 0 }, get size() { diff --git a/src/main/codex/codex-structured-dispatch-test-support.ts b/src/main/codex/codex-structured-dispatch-test-support.ts index 42efd57bab49..566922d74221 100644 --- a/src/main/codex/codex-structured-dispatch-test-support.ts +++ b/src/main/codex/codex-structured-dispatch-test-support.ts @@ -1,5 +1,4 @@ import type { - AgentJournalItemIdentity, AgentJournalMessageItem, AgentSessionJournalIdentity } from '../../shared/agent-session-journal-types' @@ -30,11 +29,9 @@ type FakeConnection = Omit & { calls: { method: string; params?: Record }[] } -export type LateSettlement = { - sessionId: string - clientMessageId: string - providerIdentity: AgentJournalItemIdentity -} +export type LateSettlement = Parameters< + NonNullable +>[0] /** A `codex app-server` whose turn traffic the test drives by hand. */ export function fakeCodexAppServer(routes: Record = {}): { diff --git a/src/main/codex/codex-structured-session-adapter.ts b/src/main/codex/codex-structured-session-adapter.ts index 68cdbd593298..0b1b8145fcc5 100644 --- a/src/main/codex/codex-structured-session-adapter.ts +++ b/src/main/codex/codex-structured-session-adapter.ts @@ -34,6 +34,7 @@ import { translateCodexNotification } from './codex-structured-provider-events' import { CodexStructuredTurnCancellation } from './codex-structured-turn-cancellation' +import { settleCodexSendsInEndedTurn } from './codex-structured-turn-end-settlement' import { createCodexStructuredNotificationRetry } from './codex-structured-notification-retry' import { acquireCodexStructuredSession } from './codex-structured-session-acquire' import { changeCodexThreadGoal } from './codex-structured-thread-goal' @@ -154,6 +155,10 @@ export class CodexStructuredSessionAdapter implements StructuredAgentSessionAdap } if (event.type === 'notification') { this.compactions.codex(event.sessionId, event.method, event.params) + // Only an admitted turn end settles; a refused one settles on the retry that lands. + settleCodexSendsInEndedTurn(session, event.method, event.params, (settlement) => + this.deps.onDispatchSettledLate?.({ sessionId: event.sessionId, ...settlement }) + ) // After the admission check, so a refused frame is observed by the strip // only on the retry that also reaches the journal. if (session.backgroundTasks.observe(event)) { diff --git a/src/main/codex/codex-structured-session-state.ts b/src/main/codex/codex-structured-session-state.ts index f4828b7df682..4fff94431e56 100644 --- a/src/main/codex/codex-structured-session-state.ts +++ b/src/main/codex/codex-structured-session-state.ts @@ -3,6 +3,7 @@ import type { AgentSessionJournalIdentity } from '../../shared/agent-session-journal-types' import { randomUUID } from 'node:crypto' +import type { AgentJournalDispatchRejection } from '../../shared/agent-session-failure-words' import { cancelProcessAcquisition } from '../../shared/child-process/cancel-process-acquisition' import type { CodexAppServerConnection, @@ -77,12 +78,14 @@ export type CodexStructuredSessionAdapterDeps = { sessionId: string, state: AgentSessionBackgroundTaskState | null ) => void - /** Identity for a send admitted earlier, once Codex echoes the user message. */ - onDispatchSettledLate?: (input: { - sessionId: string - clientMessageId: string - providerIdentity: AgentJournalItemIdentity - }) => void + /** A send admitted earlier: its identity once Codex echoes it, or its rejection when the turn + * Codex answered it into ended without taking it. */ + onDispatchSettledLate?: ( + input: { sessionId: string; clientMessageId: string } & ( + | { providerIdentity: AgentJournalItemIdentity } + | ({ state: 'rejected' } & AgentJournalDispatchRejection) + ) + ) => void /** Codex reported its thread not running with no turn open: a send whose * dispatch was never answered is owed nothing after this. */ onPrimaryThreadStoppedRunning?: (input: { sessionId: string }) => void diff --git a/src/main/codex/codex-structured-thread-facts.ts b/src/main/codex/codex-structured-thread-facts.ts index 7422d7e44ff3..8db0bbeec612 100644 --- a/src/main/codex/codex-structured-thread-facts.ts +++ b/src/main/codex/codex-structured-thread-facts.ts @@ -47,6 +47,11 @@ export function readCodexTurnStatus(payload: unknown): string | null { return nonEmptyString(record(root.turn)?.status) ?? nonEmptyString(root.status) } +/** A failed `turn/completed` carries Codex's reason as `turn.error.message`. */ +export function readCodexTurnErrorMessage(payload: unknown): string | null { + return nonEmptyString(record(record(record(payload)?.turn)?.error)?.message) +} + /** Codex's own turn duration, already in milliseconds; absent or malformed reads as null. */ export function readCodexTurnDurationMs(payload: unknown): number | null { const root = record(payload) diff --git a/src/main/codex/codex-structured-turn-end-settlement.test.ts b/src/main/codex/codex-structured-turn-end-settlement.test.ts new file mode 100644 index 000000000000..60f5a3c5f38e --- /dev/null +++ b/src/main/codex/codex-structured-turn-end-settlement.test.ts @@ -0,0 +1,322 @@ +import { describe, expect, it, vi } from 'vitest' +import type { AgentJournalItemBody } from '../../shared/agent-session-journal-types' +import { classifyDispatchRejection } from '../../shared/structured-agent-session-dispatch-rejection' +import { createCodexDispatchEchoes } from './codex-structured-dispatch-echo' +import { + acquiredCodexAdapter, + CODEX_TEST_THREAD_ID, + CODEX_TEST_USER_MESSAGE, + fakeCodexAppServer, + type LateSettlement +} from './codex-structured-dispatch-test-support' +import { codexTurnLifecycleFake } from './codex-turn-lifecycle-fake' + +async function turnEndRig() { + const codex = fakeCodexAppServer() + const turns = codexTurnLifecycleFake(CODEX_TEST_THREAD_ID, () => { + const handlers = codex.connections.at(-1)?.handlers + return (method, params) => handlers?.onNotification?.(method, params) + }) + Object.assign(codex.routes, turns.routes) + const settlements: LateSettlement[] = [] + const bodies: AgentJournalItemBody[] = [] + const adapter = await acquiredCodexAdapter({ + codex, + settlements, + sink: { + appendItem: (_identity, body) => bodies.push(body), + appendTombstone: () => {}, + publish: () => {} + } + }) + const send = (clientMessageId: string) => + adapter.dispatch({ + sessionId: 'session-1', + clientMessageId, + body: CODEX_TEST_USER_MESSAGE, + fence: 7 + }) + const settledIds = () => settlements.map(({ clientMessageId }) => clientMessageId) + const categoryOf = (settlement: LateSettlement | undefined) => + settlement && 'state' in settlement ? classifyDispatchRejection(settlement).category : null + return { codex, turns, adapter, send, settlements, settledIds, categoryOf, bodies } +} + +describe('a Codex send its turn ended without echoing', () => { + it('is withdrawn when the turn is interrupted, once', async () => { + const rig = await turnEndRig() + await expect(rig.send('client-1')).resolves.toEqual({ state: 'admitted' }) + rig.turns.start() + + rig.turns.end('interrupted') + + expect(rig.settlements).toEqual([ + expect.objectContaining({ + sessionId: 'session-1', + clientMessageId: 'client-1', + state: 'rejected' + }) + ]) + expect(rig.categoryOf(rig.settlements[0])).toBe('withdrawn') + }) + + it('is rejected in Codex words when its failed turn ends without echoing it', async () => { + const rig = await turnEndRig() + await rig.send('client-1') + rig.turns.start() + + rig.codex.connections[0]!.handlers.onNotification?.('error', { + threadId: CODEX_TEST_THREAD_ID, + turnId: 'turn-1', + willRetry: false, + error: { message: 'usage limit reached' } + }) + rig.turns.end('failed', 'usage limit reached') + + expect(rig.settlements).toEqual([ + expect.objectContaining({ + clientMessageId: 'client-1', + state: 'rejected', + rejection: { + kind: 'providerRejected', + detail: { text: 'usage limit reached', audience: 'person' } + } + }) + ]) + }) + + it('is accepted when Codex records it after the error that fails its turn', async () => { + const rig = await turnEndRig() + await rig.send('client-1') + rig.turns.start() + rig.turns.echo('client-1') + await rig.send('client-2') + + // A failed turn keeps its steered input: Codex records it after the error, before the end. + rig.codex.connections[0]!.handlers.onNotification?.('error', { + threadId: CODEX_TEST_THREAD_ID, + turnId: 'turn-1', + willRetry: false, + error: { message: 'usage limit reached' } + }) + rig.turns.echo('client-2') + rig.turns.end('failed', 'usage limit reached') + + expect(rig.settlements).toEqual([ + expect.objectContaining({ clientMessageId: 'client-1', providerIdentity: expect.anything() }), + expect.objectContaining({ + clientMessageId: 'client-2', + providerIdentity: expect.objectContaining({ turnId: 'turn-1' }) + }) + ]) + }) + + it('stays pending, still armed, when its turn completes without echoing it', async () => { + const rig = await turnEndRig() + await rig.send('client-1') + rig.turns.start() + + rig.turns.end('completed') + expect(rig.settlements).toEqual([]) + + // Codex echoes before a completed end; this late one only proves the send is still armed. + rig.turns.echo('client-1') + expect(rig.settlements).toEqual([ + expect.objectContaining({ + clientMessageId: 'client-1', + providerIdentity: expect.objectContaining({ turnId: 'turn-1' }) + }) + ]) + }) + + it('accepts a send its turn echoed, with its key, exactly once', async () => { + const rig = await turnEndRig() + await rig.send('client-1') + rig.turns.start() + rig.turns.echo('client-1') + + rig.turns.end('interrupted') + + expect(rig.settlements).toEqual([ + { + sessionId: 'session-1', + clientMessageId: 'client-1', + providerIdentity: { + provider: 'codex', + threadId: CODEX_TEST_THREAD_ID, + turnId: 'turn-1', + ordinal: 0 + } + } + ]) + }) + + it('ignores an echo that arrives after the withdrawal', async () => { + const rig = await turnEndRig() + await rig.send('client-1') + rig.turns.start() + rig.turns.end('interrupted') + + rig.turns.echo('client-1') + + expect(rig.settledIds()).toEqual(['client-1']) + expect(rig.categoryOf(rig.settlements[0])).toBe('withdrawn') + }) + + it('settles each of two sends steered into one interrupted turn once', async () => { + const rig = await turnEndRig() + await rig.send('client-1') + rig.turns.start() + await rig.send('client-2') + expect(rig.turns.turnId).toBe('turn-1') + + rig.turns.end('interrupted') + + expect(rig.settledIds().sort()).toEqual(['client-1', 'client-2']) + }) + + it('settles a send whose answer arrived after turn/started when the turn is interrupted', async () => { + const rig = await turnEndRig() + const release = rig.turns.holdNextAnswer() + const sending = rig.send('client-1') + await vi.waitFor(() => expect(rig.turns.turnId).toBe('turn-1')) + rig.turns.start() + release() + await expect(sending).resolves.toEqual({ state: 'admitted' }) + + rig.turns.end('interrupted') + + expect(rig.settledIds()).toEqual(['client-1']) + }) + + it('settles a send by the recorded end of a turn that finished before its answer arrived', async () => { + const rig = await turnEndRig() + const release = rig.turns.holdNextAnswer() + const sending = rig.send('client-1') + await vi.waitFor(() => expect(rig.turns.turnId).toBe('turn-1')) + rig.turns.start() + rig.turns.end('interrupted') + const rowsAtEnd = rig.bodies.filter((body) => body.kind === 'turn').length + release() + + const outcome = await sending + expect(outcome.state === 'rejected' && classifyDispatchRejection(outcome).category).toBe( + 'withdrawn' + ) + expect(rig.settlements).toEqual([]) + // The answer opens nothing: the turn keeps its terminal row. + expect(rig.bodies.filter((body) => body.kind === 'turn')).toHaveLength(rowsAtEnd) + expect(rig.bodies.findLast((body) => body.kind === 'turn')).toMatchObject({ + state: 'interrupted' + }) + }) + + it('rejects a send in Codex words by the recorded end of a failed turn that finished before its answer', async () => { + const rig = await turnEndRig() + const release = rig.turns.holdNextAnswer() + const sending = rig.send('client-1') + await vi.waitFor(() => expect(rig.turns.turnId).toBe('turn-1')) + rig.turns.start() + rig.turns.end('failed', 'usage limit reached') + release() + + await expect(sending).resolves.toMatchObject({ + state: 'rejected', + rejection: { + kind: 'providerRejected', + detail: { text: 'usage limit reached', audience: 'person' } + } + }) + // Settled once, by the answer: a late echo is no longer owed anything. + rig.turns.echo('client-1') + expect(rig.settlements).toEqual([]) + }) + + it('leaves a send pending, still armed, when its answer is read after its turn completed', async () => { + const rig = await turnEndRig() + const release = rig.turns.holdNextAnswer() + const sending = rig.send('client-1') + await vi.waitFor(() => expect(rig.turns.turnId).toBe('turn-1')) + rig.turns.start() + rig.turns.end('completed') + release() + + await expect(sending).resolves.toEqual({ state: 'admitted' }) + expect(rig.settlements).toEqual([]) + rig.turns.echo('client-1') + expect(rig.settledIds()).toEqual(['client-1']) + expect(rig.settlements[0]).toHaveProperty('providerIdentity') + }) + + it('leaves a send whose answer timed out to its echo', async () => { + const rig = await turnEndRig() + rig.codex.routes['turn/start'] = () => { + throw new Error('codex app-server turn/start exceeded 30000ms') + } + await expect(rig.send('client-1')).rejects.toThrow('exceeded') + + rig.codex.connections[0]!.handlers.onNotification?.('turn/started', { + threadId: CODEX_TEST_THREAD_ID, + turn: { id: 'turn-9' } + }) + rig.codex.connections[0]!.handlers.onNotification?.('item/completed', { + threadId: CODEX_TEST_THREAD_ID, + turn: { id: 'turn-9' }, + item: { type: 'userMessage', id: 'item-9', clientId: 'client-1', content: [] } + }) + + expect(rig.settlements).toEqual([ + expect.objectContaining({ + clientMessageId: 'client-1', + providerIdentity: expect.objectContaining({ turnId: 'turn-9' }) + }) + ]) + }) + + it('ignores a turn end on a child thread', async () => { + const rig = await turnEndRig() + await rig.send('client-1') + rig.turns.start() + + rig.codex.connections[0]!.handlers.onNotification?.('turn/completed', { + threadId: 'thread-child', + turn: { id: 'turn-1', status: 'interrupted' } + }) + + expect(rig.settlements).toEqual([]) + }) +}) + +describe('a send bound to a turn', () => { + it('dies with the settlement its turn end makes', () => { + const echoes = createCodexDispatchEchoes() + echoes.arm('client-1') + echoes.bindTurn('client-1', 'thread-1', 'turn-1') + + expect(echoes.endTurn('thread-1', 'turn-1', { status: 'interrupted' })).toEqual(['client-1']) + expect(echoes.size).toBe(0) + expect(echoes.settle('client-1')).toBe(false) + }) + + it('dies with its child, which forgets recorded turn ends too', () => { + const echoes = createCodexDispatchEchoes() + echoes.arm('client-1') + echoes.bindTurn('client-1', 'thread-1', 'turn-1') + echoes.endTurn('thread-2', 'turn-2', { status: 'interrupted' }) + + echoes.clear() + + expect(echoes.size).toBe(0) + echoes.arm('client-2') + expect(echoes.bindTurn('client-2', 'thread-2', 'turn-2')).toBeNull() + }) + + it('is matched by thread as well as turn id', () => { + const echoes = createCodexDispatchEchoes() + echoes.arm('client-1') + echoes.bindTurn('client-1', 'thread-1', 'turn-1') + + expect(echoes.endTurn('thread-2', 'turn-1', { status: 'interrupted' })).toEqual([]) + expect(echoes.size).toBe(1) + }) +}) diff --git a/src/main/codex/codex-structured-turn-end-settlement.ts b/src/main/codex/codex-structured-turn-end-settlement.ts new file mode 100644 index 000000000000..5187aabf45aa --- /dev/null +++ b/src/main/codex/codex-structured-turn-end-settlement.ts @@ -0,0 +1,96 @@ +// A send Codex answered into a turn that then ended without echoing it. Codex clears +// a turn's pending input when it is interrupted, so that send never reached the model +// and is withdrawn, as a Stop's host-side withdrawal is. Any other end records pending +// input before `turn/completed`, a failed turn after its `error` frame, so only that +// frame settles: a failed turn that never echoed the send refused it, in Codex's words, +// and a completed one leaves it pending for the journal's recovery on exit. + +import { + agentSessionFailureFact, + providerDiagnostic, + type ProviderDiagnostic, + type SubmissionRejectionFact +} from '../../shared/agent-session-failure' +import { + agentSessionFailureWords, + type AgentJournalDispatchRejection +} from '../../shared/agent-session-failure-words' +import type { CodexTurnEnd } from './codex-structured-dispatch-echo' +import type { CodexSession } from './codex-structured-session-state' +import { + readCodexThreadId, + readCodexTurnErrorMessage, + readCodexTurnId, + readCodexTurnStatus +} from './codex-structured-thread-facts' +import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/tui-agent-display-names' + +/** A message Codex rejected, in the words that name Codex and its legacy markers. */ +export function codexDispatchRejection( + failure: SubmissionRejectionFact +): AgentJournalDispatchRejection { + return agentSessionFailureWords(failure, { + surface: 'rejection', + agentName: TUI_AGENT_DISPLAY_NAMES.codex, + provider: 'codex' + }) +} + +export type CodexTurnEndSettlement = { + clientMessageId: string + state: 'rejected' +} & AgentJournalDispatchRejection + +function errorDetail(params: unknown): ProviderDiagnostic | undefined { + const message = readCodexTurnErrorMessage(params) + return message ? providerDiagnostic(message, 'person') : undefined +} + +/** The end a primary-thread notification reports for its turn, or null for any other frame. */ +export function readCodexTurnEnd(method: string, params: unknown): CodexTurnEnd | null { + if (method !== 'turn/completed') { + return null + } + const status = readCodexTurnStatus(params) + if (status === 'interrupted') { + return { status: 'interrupted' } + } + if (status === 'failed') { + const detail = errorDetail(params) + return { status: 'failed', ...(detail ? { detail } : {}) } + } + return { status: 'completed' } +} + +/** How an ended turn settles a send it never echoed; null leaves the send to its echo. */ +export function codexTurnEndRejection(end: CodexTurnEnd): AgentJournalDispatchRejection | null { + if (end.status === 'interrupted') { + return agentSessionFailureWords(agentSessionFailureFact('cancelled'), { surface: 'rejection' }) + } + if (end.status === 'failed') { + return codexDispatchRejection( + agentSessionFailureFact('providerRejected', end.detail ? { detail: end.detail } : {}) + ) + } + return null +} + +/** Settles the sends bound to the turn this admitted notification ended. */ +export function settleCodexSendsInEndedTurn( + session: Pick, + method: string, + params: unknown, + settle: (settlement: CodexTurnEndSettlement) => void +): void { + const turnId = readCodexTurnId(params) + const end = readCodexTurnEnd(method, params) + if (!turnId || !end || (readCodexThreadId(params) ?? session.threadId) !== session.threadId) { + return + } + const rejection = codexTurnEndRejection(end) + for (const clientMessageId of session.dispatchEchoes.endTurn(session.threadId, turnId, end)) { + if (rejection) { + settle({ clientMessageId, state: 'rejected', ...rejection }) + } + } +} diff --git a/src/main/codex/codex-structured-turn-start.ts b/src/main/codex/codex-structured-turn-start.ts index 0c46969d62f8..825a6c3c3752 100644 --- a/src/main/codex/codex-structured-turn-start.ts +++ b/src/main/codex/codex-structured-turn-start.ts @@ -1,10 +1,4 @@ import { agentSessionFailureFact, providerDiagnosticOf } from '../../shared/agent-session-failure' -import { - agentSessionFailureWords, - type AgentJournalDispatchRejection -} from '../../shared/agent-session-failure-words' -import type { SubmissionRejectionFact } from '../../shared/agent-session-failure' -import { TUI_AGENT_DISPLAY_NAMES } from '../../shared/tui-agent-display-names' import type { AgentJournalMessageItem } from '../../shared/agent-session-journal-types' import type { NativeChatBlock } from '../../shared/native-chat-types' import type { AgentSessionDispatchOutcome } from '../native-chat/agent-session-wire/structured-agent-session-adapter' @@ -14,6 +8,11 @@ import { } from './codex-app-server-connection' import { isCodexAppServerUnsupportedError } from './codex-app-server-session' import type { CodexDispatchEchoes } from './codex-structured-dispatch-echo' +import { readCodexTurnId } from './codex-structured-thread-facts' +import { + codexDispatchRejection, + codexTurnEndRejection +} from './codex-structured-turn-end-settlement' import { decodeStructuredAgentSessionOptionValue } from '../../shared/structured-agent-session-option-codec' // Writing a Codex turn and learning which message landed where, which are not @@ -21,7 +20,8 @@ import { decodeStructuredAgentSessionOptionValue } from '../../shared/structured // message issued while a turn is running is COALESCED into that turn: the same // turn id comes back, no second `turn/started` fires, and the user message is // echoed only when the running turn reaches it. So the response proves -// admission and nothing about identity, which the echo settles later. +// admission and nothing about identity, which the echo settles later. The turn +// it names is kept with the send, so that turn's end can settle it. /** Keys Codex accepts as per-turn overrides. An unlisted key would otherwise * become an arbitrary client-controlled `turn/start` parameter. Permission posture is owned by @@ -92,7 +92,8 @@ function codexTurnOptions(host: CodexTurnHost): Record { /** * Hands one submission to Codex. False means the bounded correlation window - * refused it before the write; otherwise resolves when Codex has taken it. + * refused it before the write; otherwise resolves with the turn Codex answered + * it into, or null when the answer named none. */ export async function startCodexTurn( host: CodexTurnHost, @@ -102,13 +103,13 @@ export async function startCodexTurn( requestedAt?: number timeoutMs?: number } -): Promise { +): Promise<{ turnId: string | null } | false> { // Armed before the write: the echo and `turn/started` can both land while the // response is in flight, and the start must snapshot this send in its frontier. if (!host.dispatchEchoes.arm(input.clientMessageId, input.requestedAt)) { return false } - await host.connection.request( + const answer = await host.connection.request( 'turn/start', { threadId: host.threadId, @@ -118,16 +119,7 @@ export async function startCodexTurn( }, { timeoutMs: input.timeoutMs } ) - return true -} - -/** A message Codex rejected, in the words that name Codex and its legacy markers. */ -function codexDispatchRejection(failure: SubmissionRejectionFact): AgentJournalDispatchRejection { - return agentSessionFailureWords(failure, { - surface: 'rejection', - agentName: TUI_AGENT_DISPLAY_NAMES.codex, - provider: 'codex' - }) + return { turnId: readCodexTurnId(answer) } } /** @@ -141,10 +133,9 @@ export async function dispatchCodexTurn( input: { clientMessageId: string; body: AgentJournalMessageItem; requestedAt?: number }, timeoutMs: number | undefined ): Promise { + let answer: { turnId: string | null } | false try { - if (!(await startCodexTurn(session, { ...input, timeoutMs }))) { - return { state: 'rejected', ...codexDispatchRejection(agentSessionFailureFact('queueFull')) } - } + answer = await startCodexTurn(session, { ...input, timeoutMs }) } catch (error) { if (isCodexAppServerRequestError(error) || isCodexAppServerUnsupportedError(error)) { // Codex answered and declined, so no echo for this write can arrive. @@ -161,5 +152,13 @@ export async function dispatchCodexTurn( // Keep the correlation armed so a later echo can prove delivery. throw error } - return { state: 'admitted' } + if (!answer) { + return { state: 'rejected', ...codexDispatchRejection(agentSessionFailureFact('queueFull')) } + } + // An answer read after the turn it names already ended is settled by that end. + const endedFirst = answer.turnId + ? session.dispatchEchoes.bindTurn(input.clientMessageId, session.threadId, answer.turnId) + : null + const rejection = endedFirst ? codexTurnEndRejection(endedFirst) : null + return rejection ? { state: 'rejected', ...rejection } : { state: 'admitted' } } diff --git a/src/main/codex/codex-turn-lifecycle-fake.ts b/src/main/codex/codex-turn-lifecycle-fake.ts new file mode 100644 index 000000000000..4ed2507640ba --- /dev/null +++ b/src/main/codex/codex-turn-lifecycle-fake.ts @@ -0,0 +1,112 @@ +// Codex 0.157's turn bookkeeping as `turn/start` and `turn/interrupt` see it, for +// tests. From app-server `turn_processor.rs`: `turn/start` picks the turn before it +// answers, a send while a turn is open is steered into it under the same id with no +// second `turn/started`, and `turn_interrupt_inner` refuses with -32600 until the +// turn has started. The answer can be held, so a test can deliver it after the +// turn's own frames, as the wire allows. + +import { CodexAppServerRequestError } from './codex-app-server-connection' + +type Notify = (method: string, params: unknown) => void + +export type CodexTurnLifecycleFake = { + routes: { + 'turn/start': () => unknown + 'turn/interrupt': (params: Record | undefined) => unknown + } + /** The next `turn/start` answer waits until the returned release runs. */ + holdNextAnswer: () => () => void + /** Codex emits `turn/started` for the turn it picked last. */ + start: () => void + /** Codex ends the picked or running turn on its own. */ + end: (status: 'completed' | 'interrupted' | 'failed', errorMessage?: string) => void + /** Codex echoes a user message it recorded in the current turn. */ + echo: (clientId: string) => void + readonly turnId: string | null +} + +function refusal(message: string): CodexAppServerRequestError { + return new CodexAppServerRequestError( + 'turn/interrupt', + -32600, + `codex app-server turn/interrupt failed: ${message}`, + message + ) +} + +export function codexTurnLifecycleFake( + threadId: string, + notify: () => Notify +): CodexTurnLifecycleFake { + let minted = 0 + let echoes = 0 + let picked: string | null = null + let active: string | null = null + let lastTurn: string | null = null + let held: Promise | null = null + const finish = (turnId: string, status: string, errorMessage?: string): void => { + picked = null + active = null + notify()('turn/completed', { + threadId, + turn: { id: turnId, status, ...(errorMessage ? { error: { message: errorMessage } } : {}) } + }) + } + return { + routes: { + 'turn/start': () => { + const turnId = active ?? picked ?? `turn-${++minted}` + picked ??= active ? null : turnId + lastTurn = turnId + const answer = { turn: { id: turnId, status: 'inProgress' } } + const wait = held + held = null + return wait ? wait.then(() => answer) : answer + }, + 'turn/interrupt': (params) => { + const turnId = params?.turnId + if (!active) { + throw refusal('no active turn to interrupt') + } + if (active !== turnId) { + throw refusal(`expected active turn id ${String(turnId)} but found ${active}`) + } + // Codex answers the interrupt once the turn has aborted. + finish(active, 'interrupted') + return {} + } + }, + holdNextAnswer: () => { + let release!: () => void + held = new Promise((resolve) => { + release = resolve + }) + return () => release() + }, + start: () => { + if (!picked) { + throw new Error('no picked turn to start') + } + active = picked + notify()('turn/started', { threadId, turn: { id: active, status: 'inProgress' } }) + }, + end: (status, errorMessage) => { + const turnId = active ?? picked + if (!turnId) { + throw new Error('no turn to end') + } + finish(turnId, status, errorMessage) + }, + echo: (clientId) => { + const turnId = active ?? picked ?? lastTurn + notify()('item/completed', { + threadId, + turn: { id: turnId }, + item: { type: 'userMessage', id: `item-user-${++echoes}`, clientId, content: [] } + }) + }, + get turnId() { + return active ?? picked + } + } +} diff --git a/src/main/runtime/structured-agent-session-codex-turn-end-settlement.test.ts b/src/main/runtime/structured-agent-session-codex-turn-end-settlement.test.ts new file mode 100644 index 000000000000..fc06a2a782be --- /dev/null +++ b/src/main/runtime/structured-agent-session-codex-turn-end-settlement.test.ts @@ -0,0 +1,217 @@ +// A Codex send the turn it went into never took: the Stop that interrupts that turn +// withdraws it, and nothing reads as working after. Driven through the shipped host, +// journal and Codex adapter; only the Codex child is fake, keeping Codex 0.157's +// turn bookkeeping. + +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import type { + CodexAppServerConnection, + CodexAppServerConnectionHandlers, + openCodexAppServerConnection +} from '../codex/codex-app-server-connection' +import { codexTurnLifecycleFake } from '../codex/codex-turn-lifecycle-fake' +import { computeAgentSessionPayloadFingerprint } from '../../shared/agent-session-mutation-envelope' +import type { AgentJournalSubmission } from '../../shared/agent-session-journal-types' +import { classifyDispatchRejection } from '../../shared/structured-agent-session-dispatch-rejection' +import { owesStructuredAgentSessionWork } from '../../shared/structured-agent-session-owed-work' +import { + HOST_TEST_SESSION as SESSION, + HOST_TEST_THREAD as THREAD, + hostTestAttachParams, + hostTestMessage +} from '../native-chat/agent-session-wire/structured-agent-session-host-test-data' +import type { StructuredAgentSessionHost } from '../native-chat/agent-session-wire/structured-agent-session-host' +import { + ensureStructuredAgentSessionHost, + stopStructuredAgentSessionRuntime +} from './structured-agent-session-runtime' + +// A Stop must never reach for real processes on this machine under a made-up pid. +vi.mock('../codex/codex-structured-turn-processes', () => ({ + captureCodexTurnProcesses: async () => null, + terminateCodexTurnProcesses: async () => true +})) + +const CALLER = { callerKey: 'codex-turn-end-test' } +const MODEL = { + model: 'gpt-test', + displayName: 'GPT Test', + hidden: false, + supportedReasoningEfforts: [], + defaultReasoningEffort: null, + isDefault: true +} + +let root: string +let host: StructuredAgentSessionHost +let fence: number +let handlers: CodexAppServerConnectionHandlers | undefined +let answers: number +let turns: ReturnType +let operations = 0 + +/** The durable ledger stamps its own clock and refuses an id far from it. */ +const operationId = (): string => `${Date.now()}-${(++operations).toString(16).padStart(32, '0')}` + +function envelope(method: string, fields: Record) { + return { + sessionId: SESSION, + clientOperationId: operationId(), + expectedRuntimeFence: fence, + payloadFingerprint: computeAgentSessionPayloadFingerprint({ + method, + sessionId: SESSION, + fields + }) + } +} + +async function send(text: string): Promise { + const body = hostTestMessage(text) + const sent = await host.send(CALLER, { envelope: envelope('agentSession.send', { body }), body }) + if (!sent.ok) { + throw new Error(JSON.stringify(sent.refusal)) + } + return sent.value.clientMessageId +} + +async function stop(turnId: string): Promise { + const stopped = await host.cancel(CALLER, { + envelope: envelope('agentSession.cancel', { turnId }), + turnId + }) + if (!stopped.ok) { + throw new Error(JSON.stringify(stopped.refusal)) + } +} + +async function settled(): Promise<{ + submissions: readonly AgentJournalSubmission[] + owesWork: boolean +}> { + await host.flushStreamedEvents(SESSION) + const snapshot = await host.journalSnapshot(SESSION) + return { + submissions: snapshot.submissions, + // The shared rule every surface reads "working" from. + owesWork: owesStructuredAgentSessionWork(snapshot.items, snapshot.submissions, fence) + } +} + +function verdictOf(submissions: readonly AgentJournalSubmission[], clientMessageId: string) { + const submission = submissions.find((entry) => entry.clientMessageId === clientMessageId) + return submission?.dispatchState === 'rejected' + ? classifyDispatchRejection(submission).category + : submission?.dispatchState +} + +beforeEach(async () => { + root = await mkdtemp(join(tmpdir(), 'orca-codex-turn-end-')) + answers = 0 + turns = codexTurnLifecycleFake( + THREAD, + () => (method, params) => handlers?.onNotification?.(method, params) + ) + const openConnection: typeof openCodexAppServerConnection = async ( + _launch, + connectionHandlers = {} + ) => { + handlers = connectionHandlers + const connection: CodexAppServerConnection = { + pid: 4321, + closed: false, + request: async (method, params) => { + if (method === 'thread/start' || method === 'thread/resume') { + return { thread: { id: THREAD } } + } + if (method === 'model/list') { + return { data: [MODEL], nextCursor: null } + } + if (method === 'turn/start') { + answers += 1 + return turns.routes['turn/start']() + } + if (method === 'turn/interrupt') { + return turns.routes['turn/interrupt'](params) + } + return {} + }, + notify: () => {}, + respond: () => {}, + respondWithError: () => {}, + close: async () => true + } + return connection + } + host = await ensureStructuredAgentSessionHost({ + stateDirectory: root, + hostId: 'local', + claimKeyId: 'key-1', + resolveWorkspacePath: async () => root, + resolveClaudeAuthPolicy: () => ({ stripAuthEnv: true }), + resolveCodexCommand: () => 'codex', + resolveEnvironment: async () => ({ PATH: process.env.PATH }), + openCodexConnection: openConnection, + readProcessStartTime: async () => 1_700_000_000_000 + }) + const attachParams = hostTestAttachParams(null, { providerHandle: undefined }) + attachParams.envelope.clientOperationId = operationId() + const attached = await host.attach(CALLER, attachParams) + if (!attached.ok) { + throw new Error(JSON.stringify(attached.refusal)) + } + fence = attached.value.fence +}) + +afterEach(async () => { + await stopStructuredAgentSessionRuntime() + await rm(root, { recursive: true, force: true }) +}) + +describe('a Codex send its turn ended without taking it', () => { + it('is withdrawn by a Stop before any echo, and nothing reads as working after', async () => { + const sent = await send('look around') + await vi.waitFor(() => expect(answers).toBe(1)) + turns.start() + + await stop('turn-1') + + await vi.waitFor(async () => + expect(verdictOf((await settled()).submissions, sent)).not.toBe('pending') + ) + const after = await settled() + expect(verdictOf(after.submissions, sent)).toBe('withdrawn') + expect(after.owesWork).toBe(false) + + // Codex echoing it late changes nothing: a settled answer stands. + await host.settleLateDispatch({ + sessionId: SESSION, + clientMessageId: sent, + providerIdentity: { provider: 'codex', threadId: THREAD, turnId: 'turn-1', ordinal: 0 } + }) + expect(verdictOf((await settled()).submissions, sent)).toBe('withdrawn') + }) + + it('withdraws a follow-up Codex steered into the turn a Stop ends, with no working latch', async () => { + const opening = await send('look around') + await vi.waitFor(() => expect(answers).toBe(1)) + turns.start() + turns.echo(opening) + const followUp = await send('and check the tests') + // Steered: Codex answers with the running turn, and fires no second turn/started. + await vi.waitFor(() => expect(answers).toBe(2)) + + await stop('turn-1') + + await vi.waitFor(async () => + expect(verdictOf((await settled()).submissions, followUp)).not.toBe('pending') + ) + const after = await settled() + expect(verdictOf(after.submissions, opening)).toBe('accepted') + expect(verdictOf(after.submissions, followUp)).toBe('withdrawn') + expect(after.owesWork).toBe(false) + }) +}) From 504e7498d986549767ecb32ad9772a4a2bfddc0c Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 11:58:47 -0700 Subject: [PATCH 06/90] Show a resting Claude chat's effort instead of a blank picker (#23106) * refactor(native-chat): remove the unused terminal handoff No client ever called agentSession.requestHandoff or mounted the handoff chrome. Delete the handoff coordinator, the terminal-owner runtime, the proof write path and the unmounted UI. Keep agentSession.handoffStatus, which released desktop clients read for worktree activation, and let records an older build left mid handoff reconcile through the ordinary restart and recovery paths. * fix(native-chat): never let the pre-stop snapshot hold a chat's stop Eviction now drains delivered events before quit's resume-offer snapshot. An unbounded wait there sits ahead of the provider stop, so a sink whose journal write stalls kept the child running until the step deadline aborted the eviction. The offer is advisory: bound the drain and stop the child regardless. Co-Authored-By: Claude * refactor(native-chat): drop helpers only the terminal handoff called `claudeAuthEnvCarriedForward`, `isPathWithinDirectory` and `queryWindowsProcessRowsFresh` lost their last caller with the handoff. The fresh-scan tests now go through `queryWindowsProcessDescendants({ fresh: true })`, the teardown path that still depends on that contract. Co-Authored-By: Claude * docs(native-chat): stop citing the removed handoff in lifecycle comments Six comments still named the handoff coordinator, a handoff suspend, or a terminal-owned session as live participants in the flows they describe. Co-Authored-By: Claude * test(native-chat): type the stalled snapshot drain without a cast Co-Authored-By: Claude * test(native-chat): pin that a start dead before proving owes no settlement The removed restart handoff test pinned this branch; nothing else did. Co-Authored-By: Claude * fix(native-chat): keep the owner-status read behind an in-flight attach The handoff removal dropped the per-session queue from `handoffStatus`, so a read landing mid-start reported the reservation (no owner) instead of the settled chat owner, and shipped desktop clients blocked worktree activation on it. The read is queued again, as it was before the removal. Co-Authored-By: Claude * refactor(terminal): remove the agent-session PTY write gate The gate only refused a write when a PTY had been bound to a chat session, and the only code that ever bound one was the terminal handoff this branch removes. With it gone, every admit/readmit returned "admitted" unconditionally, so the checks on the renderer write path, the runtime controller backstop, terminal.send, agent prompts, preview input and orchestration pointers, the refusal fields on terminal.send and worker-start receipts, the plugin and CLI refusal copy, and the adopted-pane orchestration routing could no longer run. Ordinary writes take the same path in the same order as before. Co-Authored-By: Claude * refactor(native-chat): drop the transcript helpers only the handoff called appendLegacyTranscriptMessages fed the terminal transcript catch-up and proveClaudeTranscriptBranch backed the terminal owner's exit proof. Both lost their last caller with the handoff. Their tests now go through the live entry points instead: the roster bounds through the legacy import, the pinned-read and growth tests through the ancestry replay the history window uses, and the marker rules through the string proof in their own file rather than the session-file resolver's. Co-Authored-By: Claude * fix(native-chat): stop calling a starting chat "mid-handoff" A send refused because the chat's owner is not settled showed "The session is mid-handoff ()." in the composer. With the handoff gone, the stages that reach it are a chat that is still starting, or one whose previous agent process has not yet been confirmed stopped. The message now says which of the two it is. The refusal code is unchanged. Co-Authored-By: Claude * test(native-chat): type the stand-in roster decoder without a cast Co-Authored-By: Claude * refactor(codex): name the pinned rollout lookup for what it does With the terminal handoff gone, the module named codex-tui-rollout-proof holds only the pinned rollout lookup that structured Codex launches use to resume a thread, so the name described code that no longer exists. Rename the module and its options type. Also drop a mobile allowlist assertion that pinned the removed agentSession.requestHandoff method, which no longer exists to allow. * refactor(native-chat): type the owner-status reply as the host sends it The handoffStatus reply type still listed the terminal handoff's fields and states (terminal placement, host label, proof retry, queued and waiting phases, the to-terminal direction). No host writes them any more and the only client reader parses the reply as unknown, so they described nothing. The reply on the wire is unchanged. * refactor(native-chat): normalize terminal-handoff lease values once at decode Nothing in this build writes a terminal owner (`runtimeKind: 'tui'`) or the handoff's `preparing` / `old-owner-stopped` stages, but the in-memory types still admitted them, so readers across the host kept branches for values no path produces and the compiler could not point at them. The store now validates the on-disk shape, which still accepts those values so an older record is not quarantined, and maps them once while parsing: - `preparing` and `old-owner-stopped` become `recovering` - a `tui` lease becomes `native`; when it records a process it also becomes `conflicted`, the claim every build probes but never stops. A plain native owner would be stopped by restart recovery, here and in older builds. Revisions are taken over the normalized state on both sides of every compare, and the mapped record reaches disk with the store's first transaction, the same way the tab-id backfill does. The in-memory types narrow to what this build writes, and the branches that existed only for the removed values go. Structured-worker identity keeps its verdict for a former terminal owner by refusing a conflicted claim rather than a non-native kind. * refactor(native-chat): stop threading the owner kind through a reservation A reservation only ever names a native owner now, so the request no longer carries a kind and the reserved lease records `native` directly. The attach params keep `runtimeKind`: agentSession.ensure and create accept it, and the operation fingerprint stored in the ledger covers it. * test(native-chat): pin the legacy-lease rewrite with a transaction that changes nothing else Hiding a tab also committed the visibility index, so the no-op transaction wrote the file even when its open-time revision was wrong. Committing the index first leaves the pending rewrite as the only reason to write. * fix(native-chat): name a chat write by its target, not the owner generation A write carried the fence of the last frame the pane read, and the host refused it unless that fence was still current. An idle release and the restart after it each move the fence, and the release publishes nothing, so a send after a release was refused "Expected runtime fence 1; the session is at 3", and a Stop queued behind a cold start was refused as stale. Every write already names what it acts on: a send its conversation, a cancel its turn, a prompt answer its item revision, a rewind its epoch; an option is last-writer-wins. So admission stops comparing the client's fence, and the rebase that papered over one restart (admitAtResumedFence, resumedFromFence) goes with it. The writer-lease check stays, and so does the attach's compare-and-swap. Frames now stamp the fence read when each frame is sent instead of a copy each subscriber kept, which went stale on the same release. * fix(native-chat): every journal append reaches the chats that are open A journal write and its delivery to open readers were two calls, and some writers made only the first. A failed start whose lease could not be handed back, a provider revision with no frame behind it, and eviction's settlement were all journaled without reaching an open chat. A journal handle now reports every durable change, and the host's session map binds that report to the session's readers when the handle is set. Writers no longer publish what they append; the per-writer publish calls are deleted. * test(native-chat): an epoch replacement reaches the open chat * test(native-chat): each row reaches an open chat once, and a live handle enters only through the map * test(native-chat): give the legacy-lease store test a tab id so the backfill cannot supply its rewrite The seeded record had no surface tab id, so the next open backfilled one and that rewrite alone made the no-op transaction write. The test passed with the legacy-lease rewrite signal removed. * test(worktree-activation): restore the OMP surfaced-agent resume test The handoff removal deleted it alongside the terminal-owner tests, but it covers the surfaced-PTY block that still guards resume, including an agent whose ownership is unknown. * perf(native-chat): a publish behind a delivered commit reads nothing Each commit now delivers itself, so the publish a provider frame still sends afterwards found every reader caught up but still read rows and rebuilt the timeline for each one. A caught-up reader now skips the read. * test(native-chat): state why the teardown test's fake journal is safe to cast * docs(native-chat): say mutation admission checks only the writer lease * docs(native-chat): drop the send rebase from comments that still described it * fix(native-chat): a message is accepted, then delivered A send to a chat with no running agent restarted the agent inside the send call, before the message was recorded, so the client waited for the whole start and a failed restart refused the message. Claude held prompts sent during startup, and those could settle as "unconfirmed". A send is now accepted inside the session's serialized queue: one ledger row and one submission row marked handoverRecorded, published, answered pending. A per-session delivery loop exists while a message is queued. It starts the agent through the same serialized attach a hold uses, waits outside the queue for a Claude child to prove its start, and hands the oldest queued message over as its own serialized step, writing dispatch{pending} before the adapter call. A start it needed and did not get writes one error-tone row and rejects every queued message with the same words; a start Stop cancelled writes none. Settlement follows from the rows. A queued message is provably unwritten, so a close, an eviction or an exit rejects it. A handed-over message stays in doubt. A queued row at or below the sequence a handle found when it opened was left by an earlier process and is rejected at open, with no latch. Stop withdraws queued messages with no writer lease and no fence. An attach failure keeps the conversation open, and the attach adopts its journal. Owed work counts the loop and queued rows. A compaction or rewind found prepared when a conversation opens was started under a child this process no longer has, so the open settles it rather than leaving it to refuse every send until a view attaches. The open cursor is scoped to its epoch, because sequences restart when an epoch is replaced. Deleted: restart-before-admission, recordFailedRestart, the fence rebase, Claude's startup gate, the attach's forget on failure and its own crash boundary. Clients without agent-session.accepted-send.v1 get their reply held until the handover; the desktop and paired desktop lists advertise it. * fix(native-chat): settle queued messages only for the child that ended A child that proved its start and then exited before its message was handed over left the message queued: the exit settlement returned early when nothing else was in flight. Delivery then started another child for it, and a child that died the same way started another, without end and without a row. A retried settlement for an earlier generation, run by the attach that delivery started, did the opposite: with that generation's turn unfinished it rejected the message queued for the child being attached. The settlement now takes the rejection for queued messages from its caller. The unexpected exit and the eviction pass one, and it applies even with no other work in flight; the retry for an earlier generation passes none. * fix(native-chat): an adoption that fails to import keeps the conversation open The attach now writes into the conversation's own open journal, but a failed transcript import still closed it as if it were the attach's provisional one. The conversation stayed indexed with a closed journal, so every later send answered "could not be recorded" and every attach failed again until the app restarted. The import now closes only a journal the attach opened for itself. * perf(native-chat): the recovering open reads the journal once Every conversation open now goes through the recovering open, including the read restore of every chat at startup, which used to replay its journal once. The recovering open replayed it twice: once to probe it and again inside the open. The probe is now handed to the open as its load. * fix(native-chat): an attach that fails after indexing its child leaves no child behind A failed attach now keeps the conversation open, but a failure after `onAttached` indexed the child (the rewind or compaction recovery, or the attach's own success record) left that entry claiming a child the failure path had already released. The next send found the phantom, skipped the start, and wrote at a fence the journal had moved past, so the message stayed queued for good. The entry now drops the released child and its event sink, and follows the record's fence, as a failure before indexing already did. * fix(native-chat): a withdrawn message shows no error, and a rejection outlasts the send's answer The error strip for a message the host accepted and then did not deliver matched the entry before the outbox reconciled, so a Stop's withdrawal, which the reconcile drops, showed "Orca could not send your message" with nothing to retry. It now reads the reconciled entry. A rejection the journal records before the send's own pending answer lands is final as well: that answer no longer puts the entry back to dispatching with no Retry. * fix(orchestration): a structured worker whose agent outlasts the preamble wait is left unknown, not torn down The preamble waits for its submission to be delivered while the worker's agent starts. When that wait ran out it threw operation_unknown, and the failed-start teardown then closed the session, which rejected the very preamble the host was about to deliver. It now reports a turn start nobody observed yet: the worker is start-unknown with its session kept, the host delivers the preamble when the agent starts, and the worker's report settles the dispatch as for any unobserved start. The receipt no longer suggests reading a screen a structured worker lacks. * fix(native-chat): a message rejected while its chat was closed reads as not sent A remount reads an entry it left dispatching as unconfirmed. When the journal had rejected it meanwhile, as a failed start or a quit now does, the reconcile left it unconfirmed: it blocked every later message behind a Retry and no reason, and the delivery probe, seeing the journal already answered, never ran. The reconcile now settles it as rejected like a dispatching one. * test(orchestration): name why the readiness settlement fakes are cast * fix(native-chat): keep each pane's own fence on frames so a failed restart is not resent * docs(native-chat): drop the fence from the admission the send effects run behind * docs(native-chat): give the fence move on release the reason that still holds * docs(native-chat): stop citing a write fence check in launch and mailbox comments Three places still gave the removed fence check as a reason: the launch replay said admission puts the ledger ahead of the fence, the launch surface said a send must name the lease it was admitted against, and the direct-mailbox path said the lease fence decides whether delivery is safe. Admission now checks only the writer lease. * refactor(native-chat): the provider child is its own record A conversation now outlives any number of provider children, so the child is one record on the conversation's entry instead of five loose fields beside its journal. It is written in one place: indexed only once an attach has fully succeeded, and ended through one function that an exit, a failed re-attach, a Stop and an eviction all share, matched on the child's generation and fence. - A failed attach writes no child, so there is nothing to unwind: the field unwind and the fence patch after it are gone. - Conversation writes read the record's fence, the way mutation admission already does; a child's own writes use its fence. The four stored-fence patches, and the settlement retry's overwrite of the conversation's fence, are gone. - The owed wind-down is its own tombstone, carrying the child it is owed for, and is no longer dropped when an attach replaced the whole entry. - Stop on a child still proving its start stops only the child: its lease goes back and the chat is told it is idle, but the journal, the holders and the readers stay. Close is that stop plus the conversation's close. - The settlement retry uses the conversation's own journal, opened through the host's one open. * fix(native-chat): the delivery loop alone settles a message its start or child failed A queued message was settled by whichever path happened to end the child first: the loop, the unexpected exit, eviction's work settlement, the open's leftover rule, and the startup branch that rejected every pending row. That gave two failure rows with different tones for one start, a loop that could hand over to a different child than the one it waited on, and a Claude start that died while starting reading unlike every other failed start. - The loop remembers the child it waited on. At handover, if that child is gone or replaced, it reads how it ended: a Stop continues; anything else writes one failure row and rejects every queued message with the same words, then stops. A child still starting whose start the adapter says did not land fails the same way. The exit, eviction and the settlement retry only settle the handed-over and legacy rows of the child that ended. - One failure row, always an error, keyed by the start. A start a view began that dies with nothing queued writes the same row through the same builder, so a second report revises it. - The open no longer rejects leftovers; the loop's first step does, and the open wakes it. - `awaitStarted` answers why a start did not land, so the row says it even when the loop sees the failure before the exit is processed. - Quit closes every conversation the way closing a chat does: what is still queued is rejected as closed, with or without a child, and a start the loop already has in flight is waited for so the child it produces is stopped rather than left behind. * refactor(native-chat): a stopped child ends on the one reading of its stop The eviction step reads a stop's result through `stopAgentSessionProviderRoot` and hands that verdict to the child's ending, so the host never forms a second view of whether the root is gone. Every ending carries it: a stop's comes from that reading, an exit's root is gone by definition, and a failed re-attach passes what its release saw. The end-of-child record can therefore also carry a stop whose root was not seen to go, which nothing ends on yet. * feat(native-chat): the host says it accepts a send before any agent has it The host now lists agent-session.accepted-send.v1 among its own runtime capabilities, the same string capable clients already send. A client can then tell a host that answers a send at acceptance, and admits a Stop with no writer before a turn starts, from an older one that still restarts the agent inside the send. Additive: an older client ignores a capability it does not know. * refactor(native-chat): an attach never opens a journal of its own The attach adopts the conversation's open journal, which outlives it, so it no longer opens one for a direct caller either. That leaves nothing for a failed adopted import to close, and the flag that told the two cases apart is gone. Tests that attach without a host open the conversation the way a host does. * fix(native-chat): a moved fence resends nothing on a host that accepts first The outbox treated any fence change as a new owner: it dropped the answer of a send in flight, queued that send to go out again under the same id, and unblocked a refused head. On an older host that is how a send the restart refused, unrecorded, gets another try. On a host that records every send before it starts an agent, a fence moves because that start ran, so the same rule resent into every failed start. With a fence stamped on every frame, that became a loop. The outbox now reacts to a fence change only when the host has not advertised that it accepts a send before any agent has it. On such a host, only a Retry or a new send goes out, and a failed start reaches the client as a rejected message it keeps with its Retry. Against an older host, or before one has answered, the outbox behaves as it did. Desktop and paired web share this hook. * refactor(native-chat): a child's end says whether the user or the host stopped it The end-of-child record's cause now tells a user's Stop from the host stopping the child for a cause of its own: `user-stop` and `host-stop` replace `stop`. The delivery loop goes on after a user's Stop, as before, and fails the start it was waiting on after a host stop, with the one error row and every queued message rejected, in the stop's reason when it gave one. The reason stays description only. Stop passes `user-stop`; nothing passes `host-stop` yet. * fix(native-chat): a chat whose only work is a queued message is not offered for resume A message accepted while the agent was starting counts as working in the chat, and quit rejects it as never sent. The teardown snapshot read the same working rule, so a relaunch offered to resume a chat whose agent never had the message. The snapshot now reads only what was handed over. * fix(native-chat): the conversation outlives its agent Opening a chat no longer starts its agent. A conversation is reached through one host accessor that opens its journal at rest, and a send is what starts the agent, through the delivery loop. One idle sweep, every five minutes, stops an agent that has been quiet for thirty minutes and owes no work, then drops an open journal handle that is only a cache. Its record, tab, status row and readers stay. - hold and release are no-ops; hold still builds the host for shipped mobile builds. - The holders, the holds, the release clock and the exit respawn are deleted. - Options, the model list, the goal and the context meter answer at rest; a model pick at rest is recorded as intent for the next start. - Compact, rewind, clear and goal changes start the agent first. A send does too when a rewind is still in doubt after the conversation opens. - Orchestration routes mail and group addresses on ownership (the record plus the chat tab), not on whether the process runs. An open dispatch keeps its worker running. - The restart continuation is a send; Resume all holds each slot until the message is handed over or rejected. - A read error never replaces a loaded transcript, and shows the host's own words. * test(native-chat): type the queued-message fixtures in the resume-offer tests * fix(native-chat): a start that dies while a message waits on it is that message's failed start Opening a chat's tab starts an agent for the view, and a send accepted meanwhile waits on it. When that start died, its exit wrote the start's error row and left the message queued, so the delivery loop started a second agent into the same failure and wrote a second row. A child's end now records where the conversation's journal stood, and the loop settles a message accepted before a failed start ended with that start: one row, under its key, and no second start. A message sent after the failure still gets a fresh start. * docs(native-chat): say what an attach's open conversation and unconfirmed ids are now * test(native-chat): pin what a failed start settles, and what a resume offer names A view's child that dies while a sent message waits settles that message only when it died starting and no child has taken its place: a proven child's crash, or a second start since, gets the message delivered. The resume offer names the handed-over message, never a newer one still queued. * test(native-chat): the failed-start pins fail on what the message became, not on a timeout * fix(native-chat): a restart offer ends when the chat's agent starts again The offer used to end only when the chat's newest user message changed, because opening a chat started its agent and that start could not be told apart from real activity. Opening a chat starts nothing now, so the host reads the fact it already publishes: a chat's status row goes from not host-owned to host-owned exactly when its agent is started. At that edge the offer and any failure record for the chat are withdrawn, unless the start is a resume action's own (its continuation is the oldest undelivered message). A continuation and a message racing to be first are decided at acceptance: the continuation is refused, quietly and with nothing filed, when any other message was accepted since the restart. A failed continuation start leaves the offer retryable, and each resume action sends its own message id. Deleted: the newest-user-message comparison, its journal reader, the continuation filter, and the failure ledger's own "answered by the chat" check. The marker still carries its message id for one release, so the previous build can read it. * fix(runtime): end a transcript stream when its client unsubscribes Desktop: the IPC subscription controller was dropped as soon as the streaming handler returned, which for most streams is right after it binds. A later runtime:unsubscribe then found nothing to abort, so the host kept the subscriber and derived and sent every publish to a channel no one listened to. The controller now lives until the renderer unsubscribes, resubscribes the same id, or goes away. Mobile: disposing an agentSession.subscribe stream now sends agentSession.unsubscribe with the stream's frame id, so the host ends that subscriber and leaves a sibling stream on the same socket running. The direct path now passes the frame id the relay path already passed. * test(orchestration): the preamble's host stub is typed, not cast The preamble send now takes only what it reads of the host, the send, the settlement wait and the record's fence, so its test builds that host with real types instead of `as never`. * fix(native-chat): one fact ends a restart offer: the chat moved on since the restart The offer is live while no other message has been accepted in the chat since the restart and its agent has not proved a start since. The offer list, the resume's reservation check and the continuation's acceptance check all read that one fact, so a message whose start then failed withdraws the offer too, and a stale click finds nothing to act on. The fact is read off the conversation's open handle, which the restart closed, so it is retired durably whenever it may have changed: a message accepted, a start proven. A close and reopen within the same run therefore cannot bring the offer back. A continuation rejected before it reached the agent does not count, so a retry after a failed start still runs. Deleted: the quit-time gate on withdrawal, which changed nothing because the withdrawal and the quit's own offer write share one queue; the per-action "withdrawn" flag and the separate acceptance check it paired with. * test(native-chat): an older build reads the restart offer this build records The offer lives in a file the previous release reads after a downgrade. Pin that against the pinned release's own capsule, and run the lane when the marker or the capsule changes. * fix(native-chat): read a restart offer against where the journal stood when it was taken "Since the restart" was read off the conversation's open handle, which the idle sweep closes: after a reopen, a message the user had already sent looked older than the handle and the withdrawn offer came back. The offer now records the journal position (epoch and sequence) at the moment it is taken, and a message accepted after that position, or a journal on another epoch, means the chat moved on. That is derived from the journal, so it holds across any number of closes and reopens. An older build's offer has no position; only a start withdraws it. Because the message half is now durable, the offer is no longer rewritten in the recovery file on every accepted message; a proven start still writes it, since only the host that saw the start knows of it. * test(native-chat): wait for the listing's retire write before reading the recovery file * fix(native-chat): keep the terminal-backed chat's read error over its local echoes Messages winning over a read error is right for the structured chat, whose read retries and whose messages came from the transcript. The terminal-backed view assembles its list from local echoes too (a launch prompt, a pending send), so a failed read there showed only those bubbles and no error. Only the structured pane now keeps messages over an error. * fix(native-chat): a start retries the exit settlement a failed journal write left owed An agent exit whose journal settlement write failed releases the lease latched until a retry lands. Reopening the chat used to be that retry; with reveal now only opening the journal, nothing retried it before the next app launch, and every send was refused. The start the send needs now runs the retry first, where the attach would. * perf(native-chat): answer the owner check without opening the chat Worktree activation calls agentSession.handoffStatus for every chat tab in the worktree, and the answer comes from the session record alone. Reaching it through the accessor opened each resting chat's journal (a full read, the crash-boundary write and a restored status publish), then kept it open for the idle window. It now checks the record and the adapter's support, as before this series, and opens nothing. * fix(native-chat): a read waiting on the session lock opens nothing once quit began The accessor checked for quit before queueing the open, so a read queued behind a session task ran its open after teardown had begun and indexed a journal no teardown step would close. The check now runs at the open itself. * fix(native-chat): read a failed resume's chat before calling it retryable Whether a failed resume is retryable is the offer's own rule: the chat has not moved on since the restart, read from its journal. The failure list read it only for a chat already open, so once the idle sweep closed a chat the user had moved on in, its failure showed Retry again, and the click did nothing. The list now opens the failed chats first, as the offer list does. * test(native-chat): type the provider event sink the settlement test reaches for * fix(native-chat): say the structured read keeps trying only where it does The structured pane's "Orca keeps trying to load it" line never showed: the view state filled in an untranslated fallback whenever the read error had no text, and the empty state prefers any message. The view state now leaves the message out, so the structured pane shows that line and the terminal-backed pane its own translated one. Mobile's structured lane does not resubscribe after an error frame, so it no longer makes the claim. * test(native-chat): await the send's settlement instead of polling for the start The at-rest send tests polled for the provider start with vi.waitFor's one-second default, which a loaded machine outran. They now await the host's own settlement of the message. * fix(native-chat): a restart offer resumes any time after the quit, and knows its own continuations The continuation's message id was dated by the quit, and the ledger refuses a new id dated more than a day back, so Resume or Retry a day after quitting was always refused (on main too). It is now dated by the resume action. Telling a rejected continuation from the user's own message read the operation ledger, whose rows expire after about a day; after that a failed resume stopped being retryable. The offer now records the continuation each action sends on its own capsule entry, bounded to the newest 16, so the ids end with the offer. The ledger read is deleted. * fix(orchestration): route no mail to a structured worker its orchestration released A structured worker is routed on ownership, and a resting worker's lease is released, so ownership held while its chat tab stayed listed. A worker the coordinator abandoned and then released, found at rest by the release, therefore still took peer mail and @worktree: broadcasts, and each one restarted its agent. Routing now also reads the orchestration's own resource row: once it is released, direct mail, group addressing and worker-show's addressable answer drop the worker, as they would a terminal worker whose terminal closed. The chat tab stays, and nothing new is stored. * fix(native-chat): a failed retry names the user's prompt, not Orca's continuation A resume's continuation is written to the chat before its start, so after a failed attempt the chat's newest user message is that rejected continuation. A second failure then showed Orca's own restart text as the chat's prompt. A retry now keeps the prompt its first failure named. * fix(orchestration): read the released row optionally, as the authority does worker-show's observation called the row lookup directly, which a runtime double without it threw on and failed the structured tab-retirement release. * fix(native-chat): the status bar drops a restart offer the chat moved on from The renderer re-read the host's restart offer only when a failed chat showed activity, so after a message withdrew a pending offer the host answered no chats while the status bar kept counting one, and clicking it opened nothing. The same watch now covers pending offers: a status change in an offered chat asks the host again, once. * fix(native-chat): a resting Claude chat shows the effort its next start runs A running Claude child reports the effort it applies. With no effort pick of its own, that is what the CLI runs for the model when none is sent, so the catalog write-through records it as the model's defaultEffort. The store keeps a known default through a listing that names none, and the resting options read answers the pick, else that default, as a live child does. Nothing is saved as the chat's pick. * test(native-chat): a roster of idle or finished children does not keep an agent awake The sweep reads owed background work through the shared child-work liveness that upstream's release clock adopted; a child that went idle or finished is not work the agent still owes. * fix(orchestration): a task dispatched into a resting structured worker keeps it running The sweep's open-dispatch check read only the worker-start dispatch that owns the worker's terminal resource, so a task later dispatched to the same worker (orchestration dispatch --to, which writes a dispatch with no worker row) did not count: after thirty quiet minutes the worker was stopped while that task was open, and its coordinator read exited. Any unsettled dispatch addressed to the worker's process incarnation now counts, derived from the existing rows. * docs(native-chat): comments stop describing the hold this PR removed Eight comments still justified orderings and teardown choices by a viewer or dispatch hold that pinned the provider child. Nothing holds any more; the orderings stand for the binding's redrive subscription and parked mail, and a chat's agent runs from a send until the idle sweep rests it. Comment-only. * fix(native-chat): a restart offer keeps the start its own continuation made Whose start ended an offer was decided at read time, from whether the offer's continuation was still the queued message. Once the provider refused that continuation, the child it had started read as someone else's start, so the offer ended and its failure showed no Retry. The delivery loop now records which queued message a start is for on the in-memory child, and the child's end carries it; the offer counts a start as its own when that message is one of its continuations. * fix(native-chat): an agent gets a full idle window after its owed work ends The sweep measured quiet only from the last journal row, so once a subagent, command, monitor or dispatch that had outlived the window ended, the agent was stopped at the next tick. A child can read done before the lead's wake-up turn writes anything, and stopping in that gap loses the wake-up. The sweep now counts owed work it observes as activity, which gives the agent the full window afterwards, as the release clock it replaced did. * test(claude): the options-read fixture runs a live child The fixture marked its conversation running with a hasProviderChild field the session type does not have, so the read took the at-rest path and refused a session with no record. It now carries a child, which is what the read checks. * test(native-chat): host tests reach its collaborators through a typed seam The rest-test rig and three test files read the host's private members with Reflect.get and cast the result. The host now exposes one test-only accessor, collaboratorsForTests(), and the subscribers class a subscriberCountForTests() beside its existing retainedActivityCountForTests(), so the tests are checked against the real types and the casts are gone. * refactor(orchestration): one owner answers a structured worker's custody Routing, group addressing, worker-show and the idle sweep each composed their own reading of whether orchestration still holds a structured worker, so each new obligation or retirement state had to be added to every reader. structured-worker-custody now derives both answers from the worker-terminal list state coordinators see in worker-list: addressable is owned and not released, and owed work is an active custody or an unsettled task dispatched to the same incarnation. The owner's state is read through the remote dispatch attachment too, as the terminal transfer lookup already does. Behaviour is unchanged; a settled worker awaiting its coordinator still rests. * refactor(orchestration): owed work is an open dispatch on the worker's incarnation A supervised worker's own dispatch context stays open exactly while the worker is active, so the separate active-custody branch only repeated it. Owed work is now one fact, which also states the policy that a worker awaiting its coordinator's decision may rest, and both custody decisions are written once at the top of the module. * fix(native-chat): a restart offer knows its continuations by a tag in their id The offer recorded each continuation id in a list on its capsule entry, capped at 16, and a running action's id in memory. Both could disagree with the journal: past the cap an old rejected continuation read as the chat moving on, and a crash during a retry restored the failure's older entry, which lacked the retry's id. Each continuation id now carries a tag derived from the offer (its teardown and chat), then the action's own part, so any continuation of this offer, queued or rejected, is recognised from the journal row and the marker alone. The persisted list, its cap and the in-memory action map are deleted; the agent-start withdrawal keeps an offer whose own continuation the start was for, read against the stored marker. * test(runtime): the legacy-worker reveal test judges its stale snapshot inside the wait The tui-idle probe reads through readTerminal, which now awaits the structured worker check before the PTY read, so the probe's snapshot request starts a microtask later. vi.waitFor missed it on its first check and polled again at 50 ms, the same moment the wait's own 50 ms timeout fired. The stale snapshot then resolved after the wait had already timed out, so the test passed without judging it, and the rejection landed before any handler was attached. Vitest reported that as an unhandled error and failed the shard. Polling every 1 ms sees the request within a few ms, so the snapshot is judged while the wait is still pending. * fix(native-chat): a view never restarts a chat whose last start failed A Claude chat whose CLI exits during startup left one red row per start, and every time a view bound to it (the chat opening right after its create died, or the user switching back to it) the hold started the CLI again, so the same launch-failure row repeated. Only a send retries a failed start now, the same rule provider-exit recovery already applied; the rule lives in one predicate the hold, exit recovery and the delivery loop share. * fix(native-chat): the idle sweep reads owed work every tick Owed work counted as activity, but the sweep read it only once the idle window had elapsed, so it refreshed the clock at most once a window. Work that ended just before the next read left the agent to be stopped at that read, moments after the work ended, which is the gap the refresh was meant to cover. The sweep now reads owed work on every tick for a started agent, so the window always runs from the last tick that saw work owed. * fix(native-chat): a continuation handed to the agent stays sent The offer read its own continuation as not reaching the agent while its dispatch was pending, which also covered one already handed over and still unanswered. When the wait for that answer ended first, the failure it filed read as retryable, and a retry sent a second continuation to an agent that may have acted on the first. Only a continuation still queued, or rejected, is now read as unsent. * test(native-chat): start the child the loop waits on with an attach, not a second view A view no longer starts a child whose last start failed, so the R2 case that waits on a child started since the failure now gets that child from a client attach, the one non-send starter left. * fix(native-chat): settle a gone generation's turn wherever a conversation opens A send that opens a chat this process had not read yet (after a crash, from a phone or the CLI) went through the delivery open, which never settled what the dead generation left running; only the read restore and a successful acquire did. When the send's start then failed, the turn stayed running for every reader. The settlement now runs in the one journal open, at the crash boundary, for every opener except an acquisition, which settles from the evidence it read before its reserve; the read restore's separate step is gone. * test(native-chat): prove the next child's start settles the turn an earlier child left The R1 case lost its only settlement assertion when the latch it checked was deleted. It now seeds the running turn the earlier child left and asserts it ends at the exit's receipt, with the exit's row, before the message is handed to the new child. * test(native-chat): count a failed start's rows by row, not by text Comparing the set of texts passed when two different rows carried the same words, which is the duplicate the test exists to catch. * test(native-chat): give the failed-start and stale-turn waits a loaded runner's budget * test(native-chat): the interrupted create's own retry continues again The merge of main's lease-latch fix replaced that test's retry of the interrupted create, under its own operation id, with a fresh start whose result nothing read. That fresh start passes with the released-reservation continuation deleted, so the case the fix exists for went untested. The retry and its assertion are main's again. * docs(native-chat): three comments that still had views starting agents A start with nothing queued now comes from a command, goal change or rewind; an interrupted compaction left alone would refuse every send, so no agent would ever start to finish it; and a current host raises the unattached read refusal only once quit began, with the attach window belonging to an older host. * test(native-chat): pin the open's and the send's start and row counts, however the view binds Opening a fresh chat whose starts fail makes one start and one row, with two views bound before or after the create's child died; one send makes one more of each. * test(native-chat): a reader's open settles the turn a failed exit settlement left running An exit whose settlement write failed leaves its turn running in the open journal. PR 1's open now settles it, and this pins the two reads that reach it here: a reader reopening a chat the idle sweep closed, and a read that opens the chat before the restart restore reaches it. * test(native-chat): the view-start test's starting window outlasts two subscriptions on a loaded runner A subscription reads the conversation before it returns, so under load the two views took longer than the create child's 300 ms start, which then exited before the test checked that it had not. The child now takes a second to fail. * fix(native-chat): settle a gone generation's turn at every open but an acquisition's The journal open skipped the settlement whenever the lease read reserved or live, to leave an acquisition's own open to the acquisition. But a lease a crashed process left in recovery also reads live, until the next acquire resolves it. A send that opened such a chat, from a phone or the CLI after a crash on a host that could not prove the old owner gone, skipped the settlement; when its start then failed, the dead turn stayed running for every reader. The acquisition now says it is the opener, and every other open settles, whatever the lease still claims. * test(native-chat): hold the create's start open until the views bind The "view binds while the create is still starting" case gave the create a 300 ms head start and asserted the views bound before it died. On a loaded runner the holds took longer, the create's exit landed first, and the case failed its own precondition. The create's initialize now waits on a gate the test releases once the views are bound. * test(native-chat): a read that reaches a crashed chat before the startup reconcile settles its turn On desktop the chat on screen at relaunch reads before startup reconciles the leases, while the dead process's lease still reads live. The open settles the turn it left running anyway, and the restore that follows finds it settled. * refactor(native-chat): drop the composer's second error formatter After the merge with main, every chat write in the composer path reports its failure as a typed outcome worded by the refusal-notice table, so the send's catch sees only a local throw. The {code, message} formatter this branch added for it has no payload left to format, and its claim to be the one way a chat words a failure is no longer true. The composer send is main's again. * test(native-chat): pin the reason on a message rejected while its chat was closed The reopen test checked only that the message reads as not sent; it now also checks the Retry row carries the host's reason. * docs(native-chat): drop the removed dispatch hold from six comments A worker's session no longer takes a dispatch hold, and no release clock rests a chat by visibility; the agent-launch comments, the abandon test, the teardown test and the refusal census still said so. * test(native-chat): rest the owner-status chat through the idle sweep, not a hold The activation-gate test from #22808 put its chat at rest by holding and releasing it, and passed the release-clock grace. This branch deleted both, so the case threw before it reached its assertions. It now moves the host's clock past the idle window and lets the sweep stop the agent and close the conversation, then asserts the same owner answer and activation gate. * fix(native-chat): show the structured pane's retrying line when a read fails The read transport always hands the pane the host's words, so the error state's "Orca keeps trying to load it" line, which showed only when there were none, was never seen: the pane showed the host's text twice, as its subtitle and on the status line under it. The structured pane now always says its read keeps retrying, and the host's text stays on the status line. The terminal-backed chat is unchanged. * fix(native-chat): keep a resting Codex chat's unsaved effort blank, as its live child shows it The resting options read fell back to the catalog's default effort for every provider. A live Codex child answers only the effort its thread reported, which is none when Codex's config names none, so a resting Codex chat showed Medium and then went blank once it started. * test(native-chat): read the resting Claude chat from the record its start persisted The at-rest test built the record by hand, so nothing proved the model id a start persists is the listed row the catalog learns the default under. --------- Co-authored-by: Claude --- src/main/claude/claude-model-catalog-probe.ts | 2 +- ...-structured-effort-default-at-rest.test.ts | 256 ++++++++++++++++++ .../claude-structured-session-options.ts | 30 +- .../agent-model-catalog-store.test.ts | 40 +++ .../agent-model-catalog-store.ts | 20 +- .../structured-agent-session-options-read.ts | 14 +- 6 files changed, 352 insertions(+), 10 deletions(-) create mode 100644 src/main/claude/claude-structured-effort-default-at-rest.test.ts diff --git a/src/main/claude/claude-model-catalog-probe.ts b/src/main/claude/claude-model-catalog-probe.ts index 882f716c3c92..f3a2646107cf 100644 --- a/src/main/claude/claude-model-catalog-probe.ts +++ b/src/main/claude/claude-model-catalog-probe.ts @@ -60,7 +60,7 @@ export function createClaudeModelCatalogProbe( ...(model.description ? { description: model.description } : {}), isDefault: model.isDefault === true, // No defaultEffort: the listing's thinking default is the commit-message generator's - // choice, not the effort Claude runs, and a live session's listing never names one. + // choice, not the effort Claude runs; the store keeps the one a live child reported. efforts: (model.thinkingLevels ?? []).map((level) => ({ value: level.id, label: level.label diff --git a/src/main/claude/claude-structured-effort-default-at-rest.test.ts b/src/main/claude/claude-structured-effort-default-at-rest.test.ts new file mode 100644 index 000000000000..2175ef49e435 --- /dev/null +++ b/src/main/claude/claude-structured-effort-default-at-rest.test.ts @@ -0,0 +1,256 @@ +// A Claude chat at rest shows the effort its next start will run: a live child teaches the host +// catalog what the CLI runs for each model when no effort is sent, and the resting read answers it. + +import { describe, expect, it } from 'vitest' +import type { AgentSessionRecord } from '../../shared/agent-session-record' +import { getAgentSessionOptionCatalog } from '../../shared/agent-session-option-catalog' +import { + applyStructuredAgentSessionOptions, + createStructuredAgentSessionOptionState, + structuredAgentSessionOptionSnapshot +} from '../../shared/structured-agent-session-options' +import { createAgentModelCatalogService } from '../native-chat/agent-model-catalog/agent-model-catalog-service' +import { agentModelCatalogFingerprintForRecord } from '../native-chat/agent-model-catalog/agent-model-catalog-fingerprint' +import { AgentModelCatalogStore } from '../native-chat/agent-model-catalog/agent-model-catalog-store' +import type { StructuredAgentSessionMutationContext } from '../native-chat/agent-session-wire/structured-agent-session-host-mutations' +import { readStructuredAgentSessionOptions } from '../native-chat/agent-session-wire/structured-agent-session-options-read' +import { nativeSessionOptionsFromReport } from '../native-chat/agent-session-wire/structured-agent-session-option-restoration' +import { + ClaudeStructuredSessionAdapter, + type ClaudeStructuredSessionEvent +} from './claude-structured-session-adapter' +import { + PROVIDER_SESSION_ID, + fakeClaude, + identityFor, + recordingJournalSink +} from './claude-structured-session-test-support' + +const SESSION = 'session-1' +const ACCOUNT_HOME = '/accounts/claude' +const EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max'] + +/** Claude Code 2.1.280's list_models rows: `default` resolves to the opus row. */ +const CATALOG = [ + { + value: 'default', + resolvedModel: 'claude-opus-5-5[1m]', + displayName: 'Default (recommended)', + supportsEffort: true, + supportedEffortLevels: EFFORTS + }, + { + value: 'opus[1m]', + resolvedModel: 'claude-opus-5-5[1m]', + displayName: 'Opus (1M context)', + supportsEffort: true, + supportedEffortLevels: EFFORTS + }, + { + value: 'sonnet', + resolvedModel: 'claude-sonnet-5', + displayName: 'Sonnet', + supportsEffort: true, + supportedEffortLevels: EFFORTS + } +] + +/** get_settings with nothing overriding the CLI's own default; an effort write moves both views. */ +function settingsWithNoOverride() { + const effective: { effortLevel?: string } = {} + const settings = { + effective, + sources: [], + applied: { model: 'claude-opus-5-5[1m]', effort: 'medium', advisor: null, ultracode: false } + } + const claude = fakeClaude({ + initProof: 'session-start', + initModels: CATALOG, + settings, + routes: { + list_models: () => CATALOG, + apply_flag_settings: (params) => { + const written = params?.settings + const effort = + typeof written === 'object' && written !== null && 'effortLevel' in written + ? written.effortLevel + : undefined + if (typeof effort === 'string') { + effective.effortLevel = effort + settings.applied.effort = effort + } + } + } + }) + return claude +} + +async function startChild( + store: AgentModelCatalogStore, + options?: Record, + events: ClaudeStructuredSessionEvent[] = [] +): Promise { + const adapter = new ClaudeStructuredSessionAdapter({ + resolveLaunch: async () => ({ + pathToClaudeCodeExecutable: 'claude', + options: {}, + cwd: '/work/repo', + claudeConfigDir: ACCOUNT_HOME, + providerSessionId: PROVIDER_SESSION_ID, + resumeLeafUuid: null, + resumesTranscript: false, + continuesChain: false + }), + onEvent: (event) => events.push(event), + openConnection: settingsWithNoOverride().openConnection, + readProcessStartTime: async () => 1_700_000_000_000, + now: () => 1_700_000_000_500, + persistHandle: async () => {}, + modelCatalog: store + }) + await adapter.acquire({ + identity: identityFor(SESSION), + fence: 7, + spawnToken: 'spawn-9', + events: recordingJournalSink(), + ...(options ? { options } : {}) + }) + await adapter.awaitStarted(SESSION) + return adapter +} + +function restingRecord(options: Record): AgentSessionRecord { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the resting read and the catalog key touch only these fields. + return { + provider: 'claude', + accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: ACCOUNT_HOME }, + location: { wslDistro: null }, + options + } as unknown as AgentSessionRecord +} + +function catalogDefault(store: AgentModelCatalogStore, model: string): string | undefined { + const entry = store.get(agentModelCatalogFingerprintForRecord(restingRecord({}))) + return entry?.models.find((row) => row.id === model)?.defaultEffort +} + +/** The options a client reads for the chat once its child is gone. */ +function readAtRest(store: AgentModelCatalogStore, record: AgentSessionRecord) { + const modelCatalog = createAgentModelCatalogService({ + store, + getRecord: () => record, + resolveAccountHome: async () => ({ variable: 'CLAUDE_CONFIG_DIR', path: ACCOUNT_HOME }) + }) + const resting = { child: null, params: { provider: 'claude' } } + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the resting read touches only these members. + const context = { + deps: { adapter: {}, store: { getRecord: () => record }, modelCatalog }, + serialize: (_sessionId: string, task: () => Promise) => task(), + openConversation: async () => resting, + conversation: async () => resting + } as unknown as StructuredAgentSessionMutationContext + return readStructuredAgentSessionOptions(context, SESSION) +} + +function pickerEffort(result: Awaited>) { + const seed = getAgentSessionOptionCatalog('claude')! + const state = applyStructuredAgentSessionOptions( + createStructuredAgentSessionOptionState('claude', seed), + seed, + result + ) + const effort = structuredAgentSessionOptionSnapshot(state).find((row) => row.id === 'effort') + return effort?.kind.type === 'select' ? effort.kind.currentValue : undefined +} + +describe('Claude effort default at rest', () => { + it("learns the model's default from a live child's applied effort", async () => { + const store = new AgentModelCatalogStore() + await startChild(store) + + // Both rows run claude-opus-5-5[1m]; sonnet was not applied, so nothing is known of it. + expect(catalogDefault(store, 'opus[1m]')).toBe('medium') + expect(catalogDefault(store, 'sonnet')).toBeUndefined() + }) + + it('shows that default in the picker of a chat at rest', async () => { + const store = new AgentModelCatalogStore() + await startChild(store) + + const result = await readAtRest(store, restingRecord({ model: 'opus[1m]' })) + + expect(result.current).toMatchObject({ model: 'opus[1m]', effort: 'medium' }) + expect(pickerEffort(result)).toBe('medium') + }) + + it("shows the user's pick at rest over the default", async () => { + const store = new AgentModelCatalogStore() + await startChild(store) + + const result = await readAtRest(store, restingRecord({ model: 'opus[1m]', effort: 'max' })) + + expect(result.current.effort).toBe('max') + expect(pickerEffort(result)).toBe('max') + }) + + it("never learns a user's pick as the default", async () => { + const store = new AgentModelCatalogStore() + const restored = await startChild(store, { model: 'opus[1m]', effort: 'high' }) + await restored.readOptions({ sessionId: SESSION, fence: 7 }) + expect(catalogDefault(store, 'opus[1m]')).toBeUndefined() + + const other = new AgentModelCatalogStore() + const live = await startChild(other) + await live.setOption({ sessionId: SESSION, fence: 7, key: 'effort', value: 'xhigh' }) + expect((await live.readOptions({ sessionId: SESSION, fence: 7 })).current.effort).toBe('xhigh') + expect(catalogDefault(other, 'opus[1m]')).toBe('medium') + }) + + it("leaves a Codex chat's unsaved effort blank at rest, as its live child does", async () => { + const store = new AgentModelCatalogStore() + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the resting read and the catalog key touch only these fields. + const record = { + provider: 'codex', + accountHome: { variable: 'CODEX_HOME', path: '/accounts/codex' }, + location: { wslDistro: null }, + options: { model: 'gpt-5.5' } + } as unknown as AgentSessionRecord + store.recordSuccess(agentModelCatalogFingerprintForRecord(record), 'codex', { + models: [ + { + id: 'gpt-5.5', + label: 'GPT-5.5', + isDefault: true, + defaultEffort: 'medium', + efforts: [ + { value: 'medium', label: 'Medium' }, + { value: 'high', label: 'High' } + ] + } + ], + fastModeTierByModel: new Map(), + origin: 'live-session' + }) + + const result = await readAtRest(store, record) + + expect(result.current).toEqual({ model: 'gpt-5.5' }) + }) + + it("never saves the applied effort as the chat's pick, yet shows it at rest", async () => { + const store = new AgentModelCatalogStore() + const events: ClaudeStructuredSessionEvent[] = [] + await startChild(store, undefined, events) + + const started = events.find((event) => event.type === 'started') + const reported = started?.type === 'started' ? started.reportedOptions : null + expect(reported).not.toHaveProperty('effort') + // The record the start persists names the listed row the catalog learned under. + const record = restingRecord( + nativeSessionOptionsFromReport({ reported: reported!, restoreSkipped: [] }) + ) + expect(record.options).toEqual({ model: 'opus[1m]' }) + expect((await readAtRest(store, record)).current.effort).toBe('medium') + expect(record.options).toEqual({ model: 'opus[1m]' }) + }) +}) diff --git a/src/main/claude/claude-structured-session-options.ts b/src/main/claude/claude-structured-session-options.ts index f50923162e5a..f4c59148241b 100644 --- a/src/main/claude/claude-structured-session-options.ts +++ b/src/main/claude/claude-structured-session-options.ts @@ -223,15 +223,37 @@ export function claudeCatalogAdmitsModel(models: readonly ListedModel[], modelId ) } -function wireClaudeModels(models: readonly ListedModel[]): AgentSessionOptionsResult['models'] { - return models.map((entry) => ({ +type WireClaudeModel = AgentSessionOptionsResult['models'][number] + +function wireClaudeModel(entry: ListedModel): WireClaudeModel { + return { id: entry.id, label: entry.label, ...(entry.description ? { description: entry.description } : {}), isDefault: entry.isDefault, efforts: entry.efforts, ...(entry.supportsFastMode !== undefined ? { supportsFastMode: entry.supportsFastMode } : {}) - })) + } +} + +function wireClaudeModels(models: readonly ListedModel[]): WireClaudeModel[] { + return models.map(wireClaudeModel) +} + +/** The listing, with what the CLI runs when no effort is sent on each model the child applies — + * a default only a running child knows, and only while this session has no effort pick. */ +function catalogClaudeModels(session: ClaudeSession, discovered: ListedModel[]): WireClaudeModel[] { + const applied = session.options.has('effort') ? undefined : session.appliedOptions + return discovered.map((listed) => { + const model = wireClaudeModel(listed) + const effort = applied?.effort + const runsApplied = + applied?.model !== undefined && + (listed.id === applied.model || listed.resolvedModel === applied.model) + return effort && runsApplied && model.efforts.some((choice) => choice.value === effort) + ? { ...model, defaultEffort: effort } + : model + }) } /** Write a provider-listed catalog through to the host store. Account-level @@ -243,7 +265,7 @@ function writeClaudeCatalogThrough(session: ClaudeSession, discovered: ListedMod } const support = claudeFastModeSupport(discovered, undefined) session.catalogAccess.store.recordSuccess(session.catalogAccess.fingerprint, 'claude', { - models: wireClaudeModels(discovered), + models: catalogClaudeModels(session, discovered), ...(support ? { fastModeSupport: support } : {}), fastModeTierByModel: new Map(), origin: 'live-session' diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.test.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.test.ts index 5f0b2f3bc7a8..34e0294b4586 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.test.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.test.ts @@ -153,6 +153,46 @@ describe('agent model catalog store', () => { expect(save).toHaveBeenCalledTimes(2) }) + it("keeps a live child's default effort through a listing that names none, across a restart", async () => { + const directory = mkdtempSync(join(tmpdir(), 'agent-model-catalog-')) + const store = new AgentModelCatalogStore() + await store.attachPersistence(createAgentModelCatalogFilePersistence(directory)) + const efforts = [ + { value: 'medium', label: 'Medium' }, + { value: 'high', label: 'High' } + ] + const listing = (defaultEffort?: string): AgentModelCatalogSuccess => ({ + models: [ + { + id: 'opus', + label: 'Opus', + isDefault: true, + efforts, + ...(defaultEffort ? { defaultEffort } : {}) + } + ], + fastModeTierByModel: new Map(), + origin: 'live-session' + }) + store.recordSuccess('fp', 'claude', listing('medium')) + // A session-less probe never names Claude's default. + store.recordSuccess('fp', 'claude', { ...listing(), origin: 'probe' }) + expect(store.get('fp')!.models[0]!.defaultEffort).toBe('medium') + await store.flushPersistence() + const restarted = new AgentModelCatalogStore() + await restarted.attachPersistence(createAgentModelCatalogFilePersistence(directory)) + expect(restarted.get('fp')!.models[0]!.defaultEffort).toBe('medium') + + // A newer report replaces it; a model that stops offering it drops it. + store.recordSuccess('fp', 'claude', listing('high')) + expect(store.get('fp')!.models[0]!.defaultEffort).toBe('high') + store.recordSuccess('fp', 'claude', { + ...listing(), + models: [{ id: 'opus', label: 'Opus', isDefault: true, efforts: [efforts[0]!] }] + }) + expect(store.get('fp')!.models[0]).not.toHaveProperty('defaultEffort') + }) + it('persists successes only and hydrates them across a restart', async () => { const directory = mkdtempSync(join(tmpdir(), 'agent-model-catalog-')) const store = new AgentModelCatalogStore() diff --git a/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts b/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts index eb26d78de5f2..dcb6e3935ac5 100644 --- a/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts +++ b/src/main/native-chat/agent-model-catalog/agent-model-catalog-store.ts @@ -53,6 +53,22 @@ function tierRecord(tiers: ReadonlyMap): Record return Object.fromEntries(tiers.entries()) } +/** A listing that names no default effort for a model keeps the one a live child reported for it, + * while that model still offers it: Claude's listing never names one, only a running child does. */ +function withKnownDefaultEfforts( + models: readonly AgentSessionModelOption[], + previous: AgentModelCatalogEntry | undefined +): AgentSessionModelOption[] { + return models.map((model) => { + const known = previous?.models.find((entry) => entry.id === model.id)?.defaultEffort + return model.defaultEffort === undefined && + known !== undefined && + model.efforts.some((choice) => choice.value === known) + ? { ...model, defaultEffort: known } + : { ...model } + }) +} + function listingKey(entry: AgentModelCatalogEntry): string { return JSON.stringify([ entry.origin, @@ -135,16 +151,16 @@ export class AgentModelCatalogStore { // An empty list identifies no model; it is doubt, not a catalog. return null } + const previous = this.entries.get(fingerprint) const entry: AgentModelCatalogEntry = { agent, fingerprint, - models: success.models.map((model) => ({ ...model })), + models: withKnownDefaultEfforts(success.models, previous), ...(success.fastModeSupport ? { fastModeSupport: success.fastModeSupport } : {}), fastModeTierByModel: tierRecord(success.fastModeTierByModel), origin: success.origin, fetchedAt: this.now() } - const previous = this.entries.get(fingerprint) this.entries.delete(fingerprint) this.entries.set(fingerprint, entry) this.failures.delete(fingerprint) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts index 2391ffa0205e..8fd9672b62fe 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts @@ -37,15 +37,23 @@ async function readStructuredAgentSessionOptionsAtRest( saved.fastMode === undefined ? null : decodeStructuredAgentSessionOptionValue('fastMode', saved.fastMode) + // An unknown model is one the client already treats as unconfirmed. + const model = saved.model ?? models.find((entry) => entry.isDefault)?.id ?? '' + // As a live child answers: the pick, else what Claude runs for this model when none is sent. + // A live Codex child answers only the effort its thread reported, never the model's default. + const effort = + saved.effort ?? + (record.provider === 'claude' + ? models.find((entry) => entry.id === model)?.defaultEffort + : undefined) return { models, ...(catalog.origin !== 'unknown' && catalog.fastModeSupport ? { fastModeSupport: catalog.fastModeSupport } : {}), current: { - // An unknown model is one the client already treats as unconfirmed. - model: saved.model ?? models.find((model) => model.isDefault)?.id ?? '', - ...(saved.effort ? { effort: saved.effort } : {}), + model, + ...(effort ? { effort } : {}), ...(typeof fastMode === 'boolean' ? { fastMode } : {}) } } From 95a16e3f6776e878bf4a1a941e7dd724f4dffad3 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:03:58 -0700 Subject: [PATCH 07/90] fix(release): stop the release policy from deleting pipeline-cut releases (#23669) * fix(release): stop the release policy from deleting pipeline-cut releases The policy judged a release by who created the release object. Cut Release reuses an existing draft, so a CI-built v1.4.216 whose draft a person had created was deleted (tag included) when its notes were edited, and Latest fell back to v1.4.214 because v1.4.215 was also published by a person. - Authorize a desktop release when its annotated tag was created by the release pipeline and points at its `release: vX` commit, not only by author. - Only delete on `published`; an edit never deletes a release or tag. - Pick Latest from the highest authorized stable using the same check. - Move the policy into config/scripts/release-policy.mjs with tests. * fix(release): load the policy module from the tagged commit Release events run the workflow file from the tag's commit, so checking out the default branch could pair an old workflow with a newer module. --- .github/workflows/release-policy.yml | 84 ++------------ config/scripts/release-policy.mjs | 138 +++++++++++++++++++++++ config/scripts/release-policy.test.mjs | 150 +++++++++++++++++++++++++ 3 files changed, 299 insertions(+), 73 deletions(-) create mode 100644 config/scripts/release-policy.mjs create mode 100644 config/scripts/release-policy.test.mjs diff --git a/.github/workflows/release-policy.yml b/.github/workflows/release-policy.yml index e6ab98f0d0d2..53decc5e7e39 100644 --- a/.github/workflows/release-policy.yml +++ b/.github/workflows/release-policy.yml @@ -19,80 +19,18 @@ jobs: runs-on: ubuntu-slim timeout-minutes: 5 steps: + # Why: release events run this file from the tagged commit, so load the module from the same commit. + - uses: actions/checkout@v6 + with: + sparse-checkout: config/scripts/release-policy.mjs + sparse-checkout-cone-mode: false + persist-credentials: false - name: Enforce release policy uses: actions/github-script@v8 with: script: | - const release = context.payload.release; - const tag = release.tag_name; - const author = release.author?.login; - const number = "(?:0|[1-9][0-9]*)"; - const version = `${number}\\.${number}\\.${number}`; - const stableTag = new RegExp(`^v${version}$`); - const prereleaseTag = new RegExp( - `^(?:v${version}-rc\\.${number}(?:\\.[0-9A-Za-z]+)?|mobile(?:-android)?-v${version})$`, - ); - const expectedPrerelease = prereleaseTag.test(tag); - const allowed = author === "github-actions[bot]" && - (stableTag.test(tag) || expectedPrerelease); - const { owner, repo } = context.repo; - - async function restoreLatestStable() { - const releases = await github.paginate(github.rest.repos.listReleases, { - owner, - repo, - per_page: 100, - }); - const stable = releases - .filter((candidate) => - !candidate.draft && - !candidate.prerelease && - candidate.author?.login === "github-actions[bot]" && - stableTag.test(candidate.tag_name), - ) - .sort((left, right) => { - const a = left.tag_name.slice(1).split(".").map(Number); - const b = right.tag_name.slice(1).split(".").map(Number); - return a.reduce((result, part, index) => result || part - b[index], 0); - }) - .at(-1); - if (stable) { - await github.rest.repos.updateRelease({ - owner, - repo, - release_id: stable.id, - make_latest: "true", - }); - } - } - - if (allowed) { - if (release.prerelease !== expectedPrerelease) { - await github.rest.repos.updateRelease({ - owner, - repo, - release_id: release.id, - prerelease: expectedPrerelease, - make_latest: expectedPrerelease ? "false" : "legacy", - }); - } - await restoreLatestStable(); - return; - } - - await github.rest.repos.updateRelease({ - owner, - repo, - release_id: release.id, - draft: true, - prerelease: true, - make_latest: "false", - }); - await restoreLatestStable(); - await github.rest.repos.deleteRelease({ owner, repo, release_id: release.id }); - try { - await github.rest.git.deleteRef({ owner, repo, ref: `tags/${tag}` }); - } catch (error) { - if (error.status !== 404) throw error; - } - core.warning(`Deleted unauthorized release ${tag} created by ${author || "unknown"}.`); + const { pathToFileURL } = await import("node:url") + const { enforceReleasePolicy } = await import( + pathToFileURL(`${process.env.GITHUB_WORKSPACE}/config/scripts/release-policy.mjs`).href + ) + await enforceReleasePolicy({ github, context, core }) diff --git a/config/scripts/release-policy.mjs b/config/scripts/release-policy.mjs new file mode 100644 index 000000000000..4733e79f2b44 --- /dev/null +++ b/config/scripts/release-policy.mjs @@ -0,0 +1,138 @@ +// Enforced by .github/workflows/release-policy.yml on release events. + +const BOT_LOGIN = 'github-actions[bot]' +const BOT_EMAIL = '41898282+github-actions[bot]@users.noreply.github.com' +const NUMBER = '(?:0|[1-9][0-9]*)' +const VERSION = `${NUMBER}\\.${NUMBER}\\.${NUMBER}` +const STABLE_TAG = new RegExp(`^v${VERSION}$`) +const RC_TAG = new RegExp(`^v${VERSION}-rc\\.${NUMBER}(?:\\.[0-9A-Za-z]+)?$`) +const MOBILE_TAG = new RegExp(`^mobile(?:-android)?-v${VERSION}$`) + +export function isPrereleaseTag(tag) { + return RC_TAG.test(tag) || MOBILE_TAG.test(tag) +} + +export function compareStableTags(left, right) { + const a = left.slice(1).split('.').map(Number) + const b = right.slice(1).split('.').map(Number) + return a.reduce((result, part, index) => result || part - b[index], 0) +} + +function escapeRegExp(text) { + return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') +} + +// Why: Cut Release creates the annotated tag and its `release: vX` commit, but the +// release object keeps whoever created the draft first, which can be a person. +export async function isCutByReleasePipeline(github, { owner, repo }, tag) { + if (!STABLE_TAG.test(tag) && !RC_TAG.test(tag)) { + return false + } + let ref + try { + ;({ data: ref } = await github.rest.git.getRef({ owner, repo, ref: `tags/${tag}` })) + } catch (error) { + if (error.status === 404) { + return false + } + throw error + } + if (ref.object.type !== 'tag') { + return false + } + const { data: tagObject } = await github.rest.git.getTag({ + owner, + repo, + tag_sha: ref.object.sha + }) + if (tagObject.tagger?.email !== BOT_EMAIL || tagObject.object.type !== 'commit') { + return false + } + const { data: commit } = await github.rest.git.getCommit({ + owner, + repo, + commit_sha: tagObject.object.sha + }) + const subject = commit.message.split('\n')[0] + return new RegExp(`^release: ${escapeRegExp(tag)}(?: \\[rc-slot:[^\\]]+\\])?$`).test(subject) +} + +async function isAuthorizedRelease(github, repoRef, release) { + const tag = release.tag_name + if (!STABLE_TAG.test(tag) && !isPrereleaseTag(tag)) { + return false + } + return release.author?.login === BOT_LOGIN || isCutByReleasePipeline(github, repoRef, tag) +} + +// Why: the highest authorized stable release must be Latest; GitHub's own pick +// (and the old bot-author-only filter) can move it to an older version. +export async function restoreLatestStable(github, repoRef) { + const releases = await github.paginate(github.rest.repos.listReleases, { + ...repoRef, + per_page: 100 + }) + const candidates = releases + .filter((release) => !release.draft && !release.prerelease && STABLE_TAG.test(release.tag_name)) + .sort((left, right) => compareStableTags(right.tag_name, left.tag_name)) + for (const release of candidates) { + if (!(await isAuthorizedRelease(github, repoRef, release))) { + continue + } + await github.rest.repos.updateRelease({ + ...repoRef, + release_id: release.id, + make_latest: 'true' + }) + return release.tag_name + } + return null +} + +export async function enforceReleasePolicy({ github, context, core }) { + const { release, action } = context.payload + const tag = release.tag_name + const author = release.author?.login + const repoRef = context.repo + const expectedPrerelease = isPrereleaseTag(tag) + + if (await isAuthorizedRelease(github, repoRef, release)) { + if (release.prerelease !== expectedPrerelease) { + await github.rest.repos.updateRelease({ + ...repoRef, + release_id: release.id, + prerelease: expectedPrerelease, + make_latest: expectedPrerelease ? 'false' : 'legacy' + }) + } + await restoreLatestStable(github, repoRef) + return + } + + // Why: editing notes on a live release is not a publication; deleting on edit + // took down the v1.4.216 release and its tag. + if (action !== 'published') { + core.warning( + `Release ${tag} by ${author || 'unknown'} is outside release policy; left as-is on "${action}".` + ) + return + } + + await github.rest.repos.updateRelease({ + ...repoRef, + release_id: release.id, + draft: true, + prerelease: true, + make_latest: 'false' + }) + await restoreLatestStable(github, repoRef) + await github.rest.repos.deleteRelease({ ...repoRef, release_id: release.id }) + try { + await github.rest.git.deleteRef({ ...repoRef, ref: `tags/${tag}` }) + } catch (error) { + if (error.status !== 404) { + throw error + } + } + core.warning(`Deleted unauthorized release ${tag} created by ${author || 'unknown'}.`) +} diff --git a/config/scripts/release-policy.test.mjs b/config/scripts/release-policy.test.mjs new file mode 100644 index 000000000000..6478f6bb0c49 --- /dev/null +++ b/config/scripts/release-policy.test.mjs @@ -0,0 +1,150 @@ +import { describe, expect, it, vi } from 'vitest' +import { enforceReleasePolicy, restoreLatestStable } from './release-policy.mjs' + +const BOT_EMAIL = '41898282+github-actions[bot]@users.noreply.github.com' +const repoRef = { owner: 'stablyai', repo: 'orca' } + +function notFound() { + return Object.assign(new Error('Not Found'), { status: 404 }) +} + +// tags: { [tag]: { tagger, subject } } for annotated tags; missing tags 404. +function createGithub({ releases = [], tags = {} } = {}) { + const rest = { + repos: { + listReleases: vi.fn(), + updateRelease: vi.fn(async () => ({ data: {} })), + deleteRelease: vi.fn(async () => ({ data: {} })) + }, + git: { + getRef: vi.fn(async ({ ref }) => { + const tag = ref.replace(/^tags\//, '') + if (!tags[tag]) { + throw notFound() + } + return { data: { object: { type: 'tag', sha: `tag-${tag}` } } } + }), + getTag: vi.fn(async ({ tag_sha }) => { + const tag = tag_sha.replace(/^tag-/, '') + return { + data: { + tagger: { email: tags[tag].tagger ?? BOT_EMAIL }, + object: { type: 'commit', sha: `commit-${tag}` } + } + } + }), + getCommit: vi.fn(async ({ commit_sha }) => { + const tag = commit_sha.replace(/^commit-/, '') + return { data: { message: `${tags[tag].subject ?? `release: ${tag}`}\n` } } + }), + deleteRef: vi.fn(async () => ({ data: {} })) + } + } + return { rest, paginate: vi.fn(async () => releases) } +} + +function release(tag, author, overrides = {}) { + return { + id: Number(tag.replace(/\D/g, '')), + tag_name: tag, + author: { login: author }, + draft: false, + prerelease: false, + ...overrides + } +} + +function run(github, payloadRelease, action) { + const core = { warning: vi.fn() } + const context = { payload: { release: payloadRelease, action }, repo: repoRef } + return enforceReleasePolicy({ github, context, core }).then(() => core) +} + +describe('release policy', () => { + it('keeps a pipeline-cut release whose draft a person created', async () => { + const r216 = release('v1.4.216', 'Jinwoo-H') + const github = createGithub({ + releases: [r216, release('v1.4.214', 'github-actions[bot]')], + tags: { 'v1.4.216': {}, 'v1.4.214': {} } + }) + + await run(github, r216, 'edited') + + expect(github.rest.repos.deleteRelease).not.toHaveBeenCalled() + expect(github.rest.git.deleteRef).not.toHaveBeenCalled() + expect(github.rest.repos.updateRelease).toHaveBeenCalledWith({ + ...repoRef, + release_id: r216.id, + make_latest: 'true' + }) + }) + + it('never deletes an unauthorized release on edit', async () => { + const qa = release('v1.4.300', 'someone') + const github = createGithub({ releases: [qa] }) + + const core = await run(github, qa, 'edited') + + expect(github.rest.repos.deleteRelease).not.toHaveBeenCalled() + expect(github.rest.git.deleteRef).not.toHaveBeenCalled() + expect(core.warning).toHaveBeenCalledWith(expect.stringContaining('left as-is')) + }) + + it('deletes a published release whose tag was not cut by the pipeline', async () => { + const qa = release('v1.4.300', 'someone') + const github = createGithub({ + releases: [qa, release('v1.4.215', 'nwparker')], + tags: { 'v1.4.300': { tagger: 'someone@example.com' }, 'v1.4.215': {} } + }) + + await run(github, qa, 'published') + + expect(github.rest.repos.deleteRelease).toHaveBeenCalledWith({ ...repoRef, release_id: qa.id }) + expect(github.rest.git.deleteRef).toHaveBeenCalledWith({ ...repoRef, ref: 'tags/v1.4.300' }) + }) + + it('rejects a bot-tagged tag whose commit is not a release commit', async () => { + const qa = release('v1.4.300', 'someone') + const github = createGithub({ tags: { 'v1.4.300': { subject: 'fix: something' } } }) + + await run(github, qa, 'published') + + expect(github.rest.repos.deleteRelease).toHaveBeenCalled() + }) + + it('accepts scheduled RC release commits', async () => { + const rc = release('v1.4.217-rc.1', 'someone', { prerelease: true }) + const github = createGithub({ + tags: { 'v1.4.217-rc.1': { subject: 'release: v1.4.217-rc.1 [rc-slot:2026-09-28-15]' } } + }) + + await run(github, rc, 'published') + + expect(github.rest.repos.deleteRelease).not.toHaveBeenCalled() + }) + + it('restores Latest to the highest pipeline-cut stable, not only bot-authored ones', async () => { + const github = createGithub({ + releases: [ + release('v1.4.214', 'github-actions[bot]'), + release('v1.4.215', 'nwparker'), + release('v1.4.216-rc.0', 'github-actions[bot]', { prerelease: true }) + ], + tags: { 'v1.4.214': {}, 'v1.4.215': {} } + }) + + await expect(restoreLatestStable(github, repoRef)).resolves.toBe('v1.4.215') + expect(github.rest.repos.updateRelease).toHaveBeenCalledTimes(1) + }) + + it('compares versions numerically when picking Latest', async () => { + const github = createGithub({ + releases: [ + release('v1.4.99', 'github-actions[bot]'), + release('v1.4.100', 'github-actions[bot]') + ] + }) + + await expect(restoreLatestStable(github, repoRef)).resolves.toBe('v1.4.100') + }) +}) From a84bd1c4fd421d4519f9573731ecc92df439cc42 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:04:59 -0700 Subject: [PATCH 08/90] fix(claude): write only the hook events and statusLine the user's Claude accepts (#23614) * refactor(claude): name the Claude version module after the hook events it gates Pure move of claude-session-end-hook-capability.ts and its tests; the next commit turns its one-event SessionEnd floor into a per-event version table. * fix(claude): write only the hook events the resolved Claude knows Claude 1.0.81 through 2.1.100 validate settings.json `hooks` against a closed event enum and discard the whole file on one unknown name, so Orca's install made Claude <= 2.1.77 silently ignore the user's env, permissions and hooks. Each managed event now carries the first Claude release that knows it (pinned to per-release enums read from the npm packages), and install, status and the SSH/WSL relay installer write only the events the resolved Claude accepts. An unresolved version gets the set every tabled Claude knows; a downgrade removes only Orca's own entry for an event the older Claude would reject. * refactor(claude): move the managed Claude hook events into their own module hook-settings.ts is at its line limit; the event list and its version gate move out whole so the next change has room. * fix(claude): an unresolved Claude version never removes Orca's hook entries A failed or timed-out version probe is no evidence of an old Claude, so it must not strip StopFailure, PermissionRequest and the other newer events a version-aware install wrote. With the version unknown, install adds only the set every tabled Claude knows and leaves every other entry exactly as it is; only a known version that lacks an event retires Orca's entry. * fix(claude): gate the core hook events on the Claude release that added them Claude validates hooks against a closed event list from 1.0.23, not 1.0.81. The table treated SessionStart, UserPromptSubmit, Stop, SubagentStop, PreToolUse and PostToolUse as known by every resolved version, so a Claude from 1.0.23 to 1.0.61 was still sent names it rejects, and it dropped the whole settings file. Pin each to its first release from the packed enums and keep the unresolved-version set as its own policy. * fix(claude): write Orca's statusLine only for a Claude that knows it Claude 1.0.49 through 1.0.66 also reject any unknown top-level settings key, and statusLine joined that schema only in 1.0.64. Orca wrote its statusLine for every Claude, so 1.0.49 to 1.0.63 still dropped the whole settings file even with the event gate. Gate statusLine on 1.0.64, pinned by the packed schemas; a known older Claude has Orca's own statusLine removed along with the opt-out marker, so an upgrade re-adds it. An unresolved version is now assumed to be 1.0.64, which knows the same core events and keeps the statusLine install it had before. * test(claude): a user statusLine opt-out survives a downgrade and upgrade Retiring Orca's statusLine for a Claude older than 1.0.64 forgets the install marker only when Orca's own statusLine was removed. Pin that, so a user who deleted Orca's statusLine is not opted back in by an upgrade. * test(claude): check the whole written settings file against each strict schema Claude 1.0.49 through 1.0.66 discard the whole settings file over any top-level key their schema lacks. The fixture recorded only whether each release knew statusLine, so a new top-level key Orca wrote would pass every test. Record each release's top-level keys instead (statusLine is derived from them), add the hook enums for every packed release in that window, and check that a real install and a downgrade write only keys and events each strict release accepts. --- config/tsconfig.cli.json | 3 +- .../managed-agent-hook-controls.test.ts | 2 +- .../managed-agent-hook-controls.ts | 2 +- .../managed-hook-detection-commands.ts | 2 +- .../__fixtures__/claude-hook-event-enums.json | 960 ++++++++++++++++++ .../claude/claude-hook-event-install.test.ts | 187 ++++ .../claude/claude-hook-event-versions.test.ts | 111 ++ src/main/claude/claude-hook-event-versions.ts | 86 ++ src/main/claude/claude-managed-hook-events.ts | 124 +++ ...claude-session-end-hook-capability.test.ts | 26 - .../claude-session-end-hook-capability.ts | 41 - .../claude/claude-session-end-install.test.ts | 49 - .../claude-settings-schema-install.test.ts | 59 ++ .../claude/claude-status-line-install.test.ts | 75 ++ .../compact-status-registration.test.ts | 7 +- src/main/claude/hook-service.test.ts | 79 +- src/main/claude/hook-service.ts | 59 +- src/main/claude/hook-settings.ts | 108 +- src/main/qoder/hook-service.test.ts | 10 + src/main/qoder/hook-service.ts | 11 +- src/relay/managed-hook-installer.ts | 2 +- 21 files changed, 1763 insertions(+), 240 deletions(-) create mode 100644 src/main/claude/__fixtures__/claude-hook-event-enums.json create mode 100644 src/main/claude/claude-hook-event-install.test.ts create mode 100644 src/main/claude/claude-hook-event-versions.test.ts create mode 100644 src/main/claude/claude-hook-event-versions.ts create mode 100644 src/main/claude/claude-managed-hook-events.ts delete mode 100644 src/main/claude/claude-session-end-hook-capability.test.ts delete mode 100644 src/main/claude/claude-session-end-hook-capability.ts delete mode 100644 src/main/claude/claude-session-end-install.test.ts create mode 100644 src/main/claude/claude-settings-schema-install.test.ts create mode 100644 src/main/claude/claude-status-line-install.test.ts diff --git a/config/tsconfig.cli.json b/config/tsconfig.cli.json index f6dfcfcd55b9..030a90632b0f 100644 --- a/config/tsconfig.cli.json +++ b/config/tsconfig.cli.json @@ -6,8 +6,9 @@ "../src/main/agent-state-file-reader.ts", "../src/main/agent-hooks/grok-replay-guard.ts", "../src/main/claude/hook-script.ts", + "../src/main/claude/claude-hook-event-versions.ts", + "../src/main/claude/claude-managed-hook-events.ts", "../src/main/qoder/hook-service.ts", - "../src/main/claude/claude-session-end-hook-capability.ts", "../src/main/agent-hooks/hook-stdin-contract.ts", "../src/main/agent-hooks/hook-post-command.ts", "../src/main/agent-hooks/hook-config-write-path.ts", diff --git a/src/main/agent-hooks/managed-agent-hook-controls.test.ts b/src/main/agent-hooks/managed-agent-hook-controls.test.ts index 625cc06f5052..ee38da3a7fe7 100644 --- a/src/main/agent-hooks/managed-agent-hook-controls.test.ts +++ b/src/main/agent-hooks/managed-agent-hook-controls.test.ts @@ -19,7 +19,7 @@ vi.mock('./local-agent-cli-presence', () => ({ detectLocalManagedAgentCliPresence: mocks.detect })) -vi.mock('../claude/claude-session-end-hook-capability', () => ({ +vi.mock('../claude/claude-hook-event-versions', () => ({ probeClaudeCliVersion: mocks.probeClaudeVersion })) diff --git a/src/main/agent-hooks/managed-agent-hook-controls.ts b/src/main/agent-hooks/managed-agent-hook-controls.ts index 7edfd94c7c83..fe7f18ccc322 100644 --- a/src/main/agent-hooks/managed-agent-hook-controls.ts +++ b/src/main/agent-hooks/managed-agent-hook-controls.ts @@ -5,7 +5,7 @@ import { } from '../../shared/managed-agent-hook-targets' import { normalizeDisabledTuiAgents } from '../../shared/tui-agent-selection' import type { GlobalSettings } from '../../shared/global-settings-types' -import { probeClaudeCliVersion } from '../claude/claude-session-end-hook-capability' +import { probeClaudeCliVersion } from '../claude/claude-hook-event-versions' import { detectLocalManagedAgentCliPresence } from './local-agent-cli-presence' import { MANAGED_AGENT_HOOK_ASYNC_REMOVERS, diff --git a/src/main/agent-hooks/managed-hook-detection-commands.ts b/src/main/agent-hooks/managed-hook-detection-commands.ts index f9507160e276..0d3ee8280d59 100644 --- a/src/main/agent-hooks/managed-hook-detection-commands.ts +++ b/src/main/agent-hooks/managed-hook-detection-commands.ts @@ -7,7 +7,7 @@ import { MANAGED_AGENT_HOOK_TARGETS } from '../../shared/managed-agent-hook-targ import { normalizeDisabledTuiAgents } from '../../shared/tui-agent-selection' import type { GlobalSettings } from '../../shared/global-settings-types' import type { TuiAgentDetectionCommand } from '../ipc/tui-agent-detection-commands' -import { parseClaudeCliVersion } from '../claude/claude-session-end-hook-capability' +import { parseClaudeCliVersion } from '../claude/claude-hook-event-versions' export type ManagedHookDetectionSettings = Partial< Pick diff --git a/src/main/claude/__fixtures__/claude-hook-event-enums.json b/src/main/claude/__fixtures__/claude-hook-event-enums.json new file mode 100644 index 000000000000..f4bedfc31df2 --- /dev/null +++ b/src/main/claude/__fixtures__/claude-hook-event-enums.json @@ -0,0 +1,960 @@ +{ + "source": "Read from cli.js of each @anthropic-ai/claude-code npm release. enums: the hook event enum; hooks keys outside it make 1.0.23-2.1.100 discard the whole user settings file. topLevelSettings: the settings schema's top-level keys, and whether it is strict, i.e. discards the whole file over any other key.", + "previousPublishedVersion": { + "1.0.23": "1.0.22", + "1.0.31": "1.0.30", + "1.0.41": "1.0.40", + "1.0.53": "1.0.52", + "1.0.62": "1.0.61", + "1.0.64": "1.0.63", + "1.0.85": "1.0.84", + "2.0.43": "2.0.42", + "2.0.45": "2.0.44", + "2.0.56": "2.0.55", + "2.1.33": "2.1.32", + "2.1.76": "2.1.75", + "2.1.78": "2.1.77" + }, + "topLevelSettings": { + "1.0.48": { + "strict": false, + "keys": [ + "apiKeyHelper", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod" + ] + }, + "1.0.49": { + "strict": true, + "keys": [ + "apiKeyHelper", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod" + ] + }, + "1.0.50": { + "strict": true, + "keys": [ + "apiKeyHelper", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod" + ] + }, + "1.0.51": { + "strict": true, + "keys": [ + "apiKeyHelper", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod" + ] + }, + "1.0.52": { + "strict": true, + "keys": [ + "apiKeyHelper", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod" + ] + }, + "1.0.53": { + "strict": true, + "keys": [ + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper" + ] + }, + "1.0.54": { + "strict": true, + "keys": [ + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper" + ] + }, + "1.0.58": { + "strict": true, + "keys": [ + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper" + ] + }, + "1.0.59": { + "strict": true, + "keys": [ + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper" + ] + }, + "1.0.60": { + "strict": true, + "keys": [ + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper" + ] + }, + "1.0.61": { + "strict": true, + "keys": [ + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper" + ] + }, + "1.0.62": { + "strict": true, + "keys": [ + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper" + ] + }, + "1.0.63": { + "strict": true, + "keys": [ + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper", + "outputMode" + ] + }, + "1.0.64": { + "strict": true, + "keys": [ + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "statusLine", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper", + "outputMode", + "feedbackSurveyState" + ] + }, + "1.0.65": { + "strict": true, + "keys": [ + "$schema", + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "statusLine", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper", + "outputMode", + "feedbackSurveyState" + ] + }, + "1.0.66": { + "strict": true, + "keys": [ + "$schema", + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "statusLine", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper", + "outputMode" + ] + }, + "1.0.67": { + "strict": false, + "keys": [ + "$schema", + "apiKeyHelper", + "awsCredentialExport", + "awsAuthRefresh", + "cleanupPeriodDays", + "env", + "includeCoAuthoredBy", + "permissions", + "model", + "enableAllProjectMcpServers", + "enabledMcpjsonServers", + "disabledMcpjsonServers", + "hooks", + "statusLine", + "learnMode", + "forceLoginMethod", + "otelHeadersHelper", + "outputMode" + ] + } + }, + "enums": { + "1.0.22": [ + "PreTask", + "PreBash", + "PreGlob", + "PreGrep", + "PreRead", + "PreEdit", + "PreMultiEdit", + "PreWrite", + "PreNotebookRead", + "PreNotebookEdit", + "PreWebFetch", + "PreWebSearch" + ], + "1.0.23": ["PreToolUse", "PostToolUse", "Notification"], + "1.0.30": ["PreToolUse", "PostToolUse", "Notification"], + "1.0.31": ["PreToolUse", "PostToolUse", "Notification", "Stop"], + "1.0.40": ["PreToolUse", "PostToolUse", "Notification", "Stop"], + "1.0.41": ["PreToolUse", "PostToolUse", "Notification", "Stop", "SubagentStop"], + "1.0.48": ["PreToolUse", "PostToolUse", "Notification", "Stop", "SubagentStop", "PreCompact"], + "1.0.49": ["PreToolUse", "PostToolUse", "Notification", "Stop", "SubagentStop", "PreCompact"], + "1.0.50": ["PreToolUse", "PostToolUse", "Notification", "Stop", "SubagentStop", "PreCompact"], + "1.0.51": ["PreToolUse", "PostToolUse", "Notification", "Stop", "SubagentStop", "PreCompact"], + "1.0.52": ["PreToolUse", "PostToolUse", "Notification", "Stop", "SubagentStop", "PreCompact"], + "1.0.53": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.54": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.58": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.59": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.60": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.61": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.62": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.63": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.64": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.65": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.66": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.67": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.81": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.84": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "Stop", + "SubagentStop", + "PreCompact" + ], + "1.0.85": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStop", + "PreCompact" + ], + "2.0.42": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStop", + "PreCompact" + ], + "2.0.43": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact" + ], + "2.0.44": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact" + ], + "2.0.45": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest" + ], + "2.0.52": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest" + ], + "2.0.54": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest" + ], + "2.0.55": [ + "PreToolUse", + "PostToolUse", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest" + ], + "2.0.56": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest" + ], + "2.0.60": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest" + ], + "2.0.76": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest" + ], + "2.1.32": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest", + "Setup" + ], + "2.1.33": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest", + "Setup", + "TeammateIdle", + "TaskCompleted" + ], + "2.1.75": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PermissionRequest", + "Setup", + "TeammateIdle", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded" + ], + "2.1.76": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PostCompact", + "PermissionRequest", + "Setup", + "TeammateIdle", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded" + ], + "2.1.77": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PostCompact", + "PermissionRequest", + "Setup", + "TeammateIdle", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded" + ], + "2.1.78": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "StopFailure", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PostCompact", + "PermissionRequest", + "Setup", + "TeammateIdle", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded" + ], + "2.1.84": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "StopFailure", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PostCompact", + "PermissionRequest", + "Setup", + "TeammateIdle", + "TaskCreated", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded", + "CwdChanged", + "FileChanged" + ], + "2.1.90": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "StopFailure", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PostCompact", + "PermissionRequest", + "PermissionDenied", + "Setup", + "TeammateIdle", + "TaskCreated", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded", + "CwdChanged", + "FileChanged" + ], + "2.1.97": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "StopFailure", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PostCompact", + "PermissionRequest", + "PermissionDenied", + "Setup", + "TeammateIdle", + "TaskCreated", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded", + "CwdChanged", + "FileChanged" + ], + "2.1.100": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "StopFailure", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PostCompact", + "PermissionRequest", + "PermissionDenied", + "Setup", + "TeammateIdle", + "TaskCreated", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded", + "CwdChanged", + "FileChanged" + ], + "2.1.101": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "StopFailure", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PostCompact", + "PermissionRequest", + "PermissionDenied", + "Setup", + "TeammateIdle", + "TaskCreated", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded", + "CwdChanged", + "FileChanged" + ], + "2.1.110": [ + "PreToolUse", + "PostToolUse", + "PostToolUseFailure", + "Notification", + "UserPromptSubmit", + "SessionStart", + "SessionEnd", + "Stop", + "StopFailure", + "SubagentStart", + "SubagentStop", + "PreCompact", + "PostCompact", + "PermissionRequest", + "PermissionDenied", + "Setup", + "TeammateIdle", + "TaskCreated", + "TaskCompleted", + "Elicitation", + "ElicitationResult", + "ConfigChange", + "WorktreeCreate", + "WorktreeRemove", + "InstructionsLoaded", + "CwdChanged", + "FileChanged" + ] + } +} diff --git a/src/main/claude/claude-hook-event-install.test.ts b/src/main/claude/claude-hook-event-install.test.ts new file mode 100644 index 000000000000..99af9a3fa536 --- /dev/null +++ b/src/main/claude/claude-hook-event-install.test.ts @@ -0,0 +1,187 @@ +import { describe, expect, it } from 'vitest' +import type { HooksConfig } from '../agent-hooks/installer-utils' +import fixture from './__fixtures__/claude-hook-event-enums.json' +import { CLAUDE_HOOK_EVENT_FIRST_VERSIONS } from './claude-hook-event-versions' +import { getClaudeManagedHookPlan } from './claude-managed-hook-events' +import { applyManagedHooks } from './hook-settings' + +const SCRIPT_FILE_NAME = 'claude-hook.sh' +const MANAGED_COMMAND = '/home/dev/.orca/agent-hooks/claude-hook.sh' +const managedHook = { type: 'command' as const, command: MANAGED_COMMAND } +const enums: Record = fixture.enums +const topLevelSettings: Record = fixture.topLevelSettings + +function install(config: HooksConfig, claudeVersion: string | undefined): HooksConfig { + return applyManagedHooks( + config, + managedHook, + SCRIPT_FILE_NAME, + getClaudeManagedHookPlan(claudeVersion) + ) +} + +function managedEvents(config: HooksConfig): string[] { + return Object.entries(config.hooks ?? {}) + .filter(([, definitions]) => + (definitions ?? []).some((definition) => + (definition.hooks ?? []).some((hook) => hook.command === MANAGED_COMMAND) + ) + ) + .map(([event]) => event) + .sort() +} + +const userHook = (event: string) => ({ + hooks: [{ type: 'command' as const, command: `echo user-${event}` }] +}) + +// Why: the user owns every event, managed or not, plus the keys an invalid file would discard. +function userOwnedSettings(): HooksConfig { + const events = [...Object.keys(CLAUDE_HOOK_EVENT_FIRST_VERSIONS), 'Notification'] + return { + env: { CLAUDE_CODE_USE_BEDROCK: '1' }, + permissions: { allow: ['Bash(git status)'] }, + hooks: Object.fromEntries(events.map((event) => [event, [userHook(event)]])) + } +} + +function expectUserSettingsKept(config: HooksConfig): void { + expect(config.env).toEqual({ CLAUDE_CODE_USE_BEDROCK: '1' }) + expect(config.permissions).toEqual({ allow: ['Bash(git status)'] }) + for (const [event, definitions] of Object.entries(userOwnedSettings().hooks ?? {})) { + expect(config.hooks?.[event], event).toContainEqual(definitions?.[0]) + } +} + +describe('Claude managed hook events by resolved version', () => { + it.each(Object.keys(enums))('writes only events Claude %s knows', (version) => { + const written = install({ hooks: {} }, version) + const unknown = Object.keys(written.hooks ?? {}).filter( + (event) => !enums[version].includes(event) + ) + expect(unknown).toEqual([]) + }) + + it.each(Object.keys(topLevelSettings))( + 'writes statusLine only if Claude %s knows it', + (version) => { + const plan = getClaudeManagedHookPlan(version) + expect(plan.statusLine === 'install').toBe( + topLevelSettings[version].keys.includes('statusLine') + ) + } + ) + + it('omits every event newer than an old Claude', () => { + expect(managedEvents(install({ hooks: {} }, '2.1.32 (Claude Code)'))).toEqual( + [ + 'PermissionRequest', + 'PostToolUse', + 'PostToolUseFailure', + 'PreToolUse', + 'SessionStart', + 'Stop', + 'SubagentStart', + 'SubagentStop', + 'UserPromptSubmit' + ].sort() + ) + }) + + it.each([undefined, 'unknown'])( + 'writes only the core lifecycle events when the version is %s', + (version) => { + expect(managedEvents(install({ hooks: {} }, version))).toEqual( + [ + 'PostToolUse', + 'PreToolUse', + 'SessionStart', + 'Stop', + 'SubagentStop', + 'UserPromptSubmit' + ].sort() + ) + } + ) + + it.each([undefined, 'unknown'])( + 'leaves Orca entries a version-aware install wrote untouched when the version is %s', + (version) => { + const current = install(userOwnedSettings(), '2.1.261') + expect(JSON.stringify(install(current, version))).toBe(JSON.stringify(current)) + + // Why: even an entry from an older hook command stays byte-identical; only a known version may rewrite it. + const staleHook = { + type: 'command' as const, + command: '/old/.orca/agent-hooks/claude-hook.sh' + } + const stale = { hooks: { StopFailure: [{ hooks: [staleHook] }] } } + const written = install(stale, version) + expect(JSON.stringify(written.hooks?.StopFailure)).toBe( + JSON.stringify(stale.hooks.StopFailure) + ) + expect(managedEvents(written)).toEqual( + [ + 'PostToolUse', + 'PreToolUse', + 'SessionStart', + 'Stop', + 'SubagentStop', + 'UserPromptSubmit' + ].sort() + ) + } + ) + + it('adds the newer events once the resolved Claude is upgraded', () => { + const old = install({ hooks: {} }, '2.1.77') + expect(old.hooks?.StopFailure).toBeUndefined() + + const upgraded = install(old, '2.1.78') + + expect(managedEvents(upgraded)).toContain('StopFailure') + expect(managedEvents(upgraded)).toContain('PostCompact') + expect(upgraded.hooks?.StopFailure).toEqual([{ hooks: [managedHook] }]) + }) + + it('removes only Orca entries for events a downgraded Claude does not know', () => { + const current = install({ hooks: {} }, '2.1.261') + expect(managedEvents(current)).toContain('SessionEnd') + + const downgraded = install(current, '2.1.32') + + for (const event of ['StopFailure', 'PostCompact', 'TeammateIdle', 'SessionEnd']) { + expect(downgraded.hooks?.[event], event).toBeUndefined() + } + }) + + it('gates a known Claude older than the unresolved-version set by its own enum', () => { + expect(managedEvents(install({ hooks: {} }, '1.0.52'))).toEqual( + ['PostToolUse', 'PreToolUse', 'Stop', 'SubagentStop'].sort() + ) + const downgraded = install(install({ hooks: {} }, '2.1.261'), '1.0.22') + expect(managedEvents(downgraded)).toEqual([]) + }) + + it.each(['1.0.22', '1.0.52', '1.0.81', '2.1.32', '2.1.77', '2.1.78', '2.1.261', undefined])( + 'keeps every user-written entry and setting when installing for %s', + (version) => { + const fresh = install(userOwnedSettings(), version) + expectUserSettingsKept(fresh) + // Why: a downgrade from the newest set is the path that removes Orca entries. + expectUserSettingsKept(install(install(userOwnedSettings(), '2.1.261'), version)) + } + ) + + it('leaves a user value it cannot parse under an unknown event untouched', () => { + const settings: HooksConfig = JSON.parse('{"hooks":{"StopFailure":[],"PostCompact":"mine"}}') + const written = install(settings, '2.1.32') + expect(written.hooks?.StopFailure).toEqual([]) + expect(written.hooks?.PostCompact).toBe('mine') + }) + + it('keeps SessionEnd behind its measured 2.1.261 floor', () => { + expect(install({ hooks: {} }, '2.1.260').hooks?.SessionEnd).toBeUndefined() + expect(install({ hooks: {} }, '2.1.261').hooks?.SessionEnd).toEqual([{ hooks: [managedHook] }]) + }) +}) diff --git a/src/main/claude/claude-hook-event-versions.test.ts b/src/main/claude/claude-hook-event-versions.test.ts new file mode 100644 index 000000000000..d27705a5f54b --- /dev/null +++ b/src/main/claude/claude-hook-event-versions.test.ts @@ -0,0 +1,111 @@ +import { describe, expect, it } from 'vitest' +import { compareAppVersions } from '../../shared/app-version' +import fixture from './__fixtures__/claude-hook-event-enums.json' +import { + CLAUDE_HOOK_EVENT_FIRST_VERSIONS, + CLAUDE_STATUS_LINE_FIRST_VERSION, + claudeKnowsHookEvent, + claudeKnowsStatusLine, + parseClaudeCliVersion, + UNRESOLVED_CLAUDE_VERSION, + type ClaudeHookEventName +} from './claude-hook-event-versions' + +const enums: Record = fixture.enums +const previousPublished: Record = fixture.previousPublishedVersion +const topLevelSettings: Record = + fixture.topLevelSettings +const versions = Object.keys(enums).sort(compareAppVersions) +const isTableEvent = (name: string): name is ClaudeHookEventName => + name in CLAUDE_HOOK_EVENT_FIRST_VERSIONS +const tableEntries = Object.keys(CLAUDE_HOOK_EVENT_FIRST_VERSIONS) + .filter(isTableEvent) + .map((event): [ClaudeHookEventName, string] => [event, CLAUDE_HOOK_EVENT_FIRST_VERSIONS[event]]) + +describe('Claude hook event version table', () => { + it.each(tableEntries)('pins %s to the first release whose enum knows it', (event, first) => { + expect(versions.find((version) => enums[version].includes(event))).toBe(first) + for (const version of versions) { + expect(enums[version].includes(event), `${event} in ${version}`).toBe( + compareAppVersions(version, first) >= 0 + ) + } + // Why: the release published just before `first` lacks the event, so the table is exact, not just safe. + const before = previousPublished[first] + expect(enums[before], `enum for ${before}`).toBeDefined() + expect(enums[before]).not.toContain(event) + }) +}) + +describe('Claude statusLine version floor', () => { + it('pins statusLine to the first release whose settings schema knows it', () => { + for (const [version, schema] of Object.entries(topLevelSettings)) { + expect(schema.keys.includes('statusLine'), version).toBe( + compareAppVersions(version, CLAUDE_STATUS_LINE_FIRST_VERSION) >= 0 + ) + } + // Why: the release just before rejects the unknown key, so the floor is exact, not just safe. + const before = previousPublished[CLAUDE_STATUS_LINE_FIRST_VERSION] + expect(topLevelSettings[before].strict).toBe(true) + expect(topLevelSettings[before].keys).not.toContain('statusLine') + }) + + it.each([ + ['1.0.63', false], + ['1.0.64 (Claude Code)', true], + [undefined, true] + ] as const)('%s knows statusLine: %s', (version, expected) => { + expect(claudeKnowsStatusLine(version)).toBe(expected) + }) +}) + +describe('claudeKnowsHookEvent', () => { + it.each([ + ['2.1.77', 'StopFailure', false], + ['2.1.78 (Claude Code)', 'StopFailure', true], + ['2.1.75', 'PostCompact', false], + ['2.1.76', 'PostCompact', true], + ['2.1.32', 'TeammateIdle', false], + ['2.0.55', 'PostToolUseFailure', false], + ['2.0.44', 'PermissionRequest', false], + ['2.0.42', 'SubagentStart', false], + ['1.0.84', 'SessionEnd', false], + ['1.0.61', 'SessionStart', false], + ['1.0.62', 'SessionStart', true], + ['1.0.52', 'UserPromptSubmit', false], + ['1.0.40', 'SubagentStop', false], + ['1.0.30', 'Stop', false], + ['1.0.22', 'PreToolUse', false] + ] as const)('%s knows %s: %s', (version, event, expected) => { + expect(claudeKnowsHookEvent(version, event)).toBe(expected) + }) + + it.each([undefined, null, 'unknown'])( + 'grants an unresolved version (%s) only the events its assumed release knows', + (version) => { + const known = tableEntries + .filter(([event]) => claudeKnowsHookEvent(version, event)) + .map(([event]) => event) + expect(known.sort()).toEqual( + [ + 'PostToolUse', + 'PreToolUse', + 'SessionStart', + 'Stop', + 'SubagentStop', + 'UserPromptSubmit' + ].sort() + ) + for (const event of known) { + expect(enums[UNRESOLVED_CLAUDE_VERSION]).toContain(event) + } + } + ) +}) + +describe('parseClaudeCliVersion', () => { + it('extracts Claude Code version output', () => { + expect(parseClaudeCliVersion('2.1.261 (Claude Code)')).toBe('2.1.261') + expect(parseClaudeCliVersion('unknown')).toBeNull() + }) +}) diff --git a/src/main/claude/claude-hook-event-versions.ts b/src/main/claude/claude-hook-event-versions.ts new file mode 100644 index 000000000000..5c9c28de66c5 --- /dev/null +++ b/src/main/claude/claude-hook-event-versions.ts @@ -0,0 +1,86 @@ +import { hasReachedAppVersion, isValidAppVersion } from '../../shared/app-version' +import { runProcess } from '../../shared/child-process/run-process' +import path from 'node:path' + +// Why: Claude 1.0.23 through 2.1.100 validate `hooks` against a closed event enum and discard the +// WHOLE settings.json (env, permissions, every user hook) on one unknown name, so an event may only +// be written for a Claude that knows it. Values come from each release's packed enum, pinned by +// __fixtures__/claude-hook-event-enums.json. +export const CLAUDE_HOOK_EVENT_FIRST_VERSIONS = { + PreToolUse: '1.0.23', + PostToolUse: '1.0.23', + Stop: '1.0.31', + SubagentStop: '1.0.41', + UserPromptSubmit: '1.0.53', + SessionStart: '1.0.62', + SessionEnd: '1.0.85', + SubagentStart: '2.0.43', + PermissionRequest: '2.0.45', + PostToolUseFailure: '2.0.56', + TeammateIdle: '2.1.33', + PostCompact: '2.1.76', + StopFailure: '2.1.78' +} as const + +// Why: 1.0.49 through 1.0.66 also discard the whole file over an unknown top-level key, and +// `statusLine` joined their schema only in 1.0.64. Pinned by the same fixture's topLevelSettings. +export const CLAUDE_STATUS_LINE_FIRST_VERSION = '1.0.64' + +// Why: an unresolved version gets what the first release accepting Orca's core lifecycle events and +// statusLine knows, and nothing newer; a Claude older than that is gated only once its version resolves. +export const UNRESOLVED_CLAUDE_VERSION = CLAUDE_STATUS_LINE_FIRST_VERSION + +export type ClaudeHookEventName = keyof typeof CLAUDE_HOOK_EVENT_FIRST_VERSIONS + +export function parseClaudeCliVersion(output: string | null | undefined): string | null { + const version = output?.match(/\b\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?\b/)?.[0] + return version && isValidAppVersion(version) ? version : null +} + +export function claudeVersionReaches(version: string | null | undefined, floor: string): boolean { + const parsed = parseClaudeCliVersion(version) + return parsed !== null && hasReachedAppVersion(parsed, floor) +} + +function claudeKnowsSince(version: string | null | undefined, firstVersion: string): boolean { + return hasReachedAppVersion( + parseClaudeCliVersion(version) ?? UNRESOLVED_CLAUDE_VERSION, + firstVersion + ) +} + +export function claudeKnowsHookEvent( + version: string | null | undefined, + eventName: ClaudeHookEventName +): boolean { + return claudeKnowsSince(version, CLAUDE_HOOK_EVENT_FIRST_VERSIONS[eventName]) +} + +export function claudeKnowsStatusLine(version: string | null | undefined): boolean { + return claudeKnowsSince(version, CLAUDE_STATUS_LINE_FIRST_VERSION) +} + +export async function probeClaudeCliVersion(executablePath: string): Promise { + try { + const pathKey = process.platform === 'win32' && process.env.Path !== undefined ? 'Path' : 'PATH' + const executableDir = path.dirname(executablePath) + const inheritedPath = process.env[pathKey] + const result = await runProcess({ + program: executablePath, + args: ['--version'], + // Why: version-manager launchers often use `#!/usr/bin/env node`; the resolved CLI's sibling + // runtime must remain reachable even when Electron started with a thinner PATH. + env: { + ...process.env, + [pathKey]: inheritedPath + ? `${executableDir}${path.delimiter}${inheritedPath}` + : executableDir + }, + timeoutMs: 5_000, + maxOutputBytes: 4_096 + }) + return result.code === 0 ? parseClaudeCliVersion(`${result.stdout}\n${result.stderr}`) : null + } catch { + return null + } +} diff --git a/src/main/claude/claude-managed-hook-events.ts b/src/main/claude/claude-managed-hook-events.ts new file mode 100644 index 000000000000..dbbb8ae15a21 --- /dev/null +++ b/src/main/claude/claude-managed-hook-events.ts @@ -0,0 +1,124 @@ +import type { HookDefinition } from '../agent-hooks/installer-utils' +import { + claudeKnowsHookEvent, + claudeKnowsStatusLine, + claudeVersionReaches, + parseClaudeCliVersion +} from './claude-hook-event-versions' + +export const CLAUDE_EVENTS = [ + // Why: SessionStart is the only event a resumed/idle session emits before the + // first prompt; without it the sidebar row can't exist until the user types (STA-3386). + { + eventName: 'SessionStart', + definition: { hooks: [{ type: 'command', command: '' }] } + }, + { + eventName: 'UserPromptSubmit', + definition: { hooks: [{ type: 'command', command: '' }] } + }, + { + eventName: 'Stop', + definition: { hooks: [{ type: 'command', command: '' }] } + }, + // Why: OpenClaude skips normal Stop hooks after API/model errors and emits + // StopFailure instead; without this hook Orca leaves the turn spinning. + { + eventName: 'StopFailure', + definition: { hooks: [{ type: 'command', command: '' }] } + }, + // Why: subagent/teammate lifecycle feeds the sidebar's child rows and keeps + // a pane 'working' while background children outlive the lead's turn. + // TeammateIdle parks turn-based teammates without trusting their permanently + // "running" background_tasks entry to gate the pane. + { + eventName: 'SubagentStart', + definition: { hooks: [{ type: 'command', command: '' }] } + }, + { + eventName: 'SubagentStop', + definition: { hooks: [{ type: 'command', command: '' }] } + }, + { + eventName: 'TeammateIdle', + definition: { hooks: [{ type: 'command', command: '' }] } + }, + // Why: PreToolUse gives the dashboard a live readout of the in-flight tool + // (name + input preview) before it completes. + { + eventName: 'PreToolUse', + definition: { matcher: '*', hooks: [{ type: 'command', command: '' }] } + }, + { + eventName: 'PostToolUse', + definition: { matcher: '*', hooks: [{ type: 'command', command: '' }] } + }, + { + eventName: 'PostToolUseFailure', + definition: { matcher: '*', hooks: [{ type: 'command', command: '' }] } + }, + { + eventName: 'PermissionRequest', + definition: { matcher: '*', hooks: [{ type: 'command', command: '' }] } + }, + // Why: a manual /compact ends at an idle prompt without emitting Stop, so PostCompact is the only + // signal that can clear the pane (STA-2915). PreCompact is deliberately NOT registered: it fires + // before the compact is validated, and an aborted compact emits it alone — mapping it to 'working' + // would strand the pane exactly as this registration is meant to prevent (STA-4613). + { + eventName: 'PostCompact', + definition: { hooks: [{ type: 'command', command: '' }] } + } +] as const + +const CLAUDE_SESSION_END_EVENT = { + eventName: 'SessionEnd', + // Why: Claude knows SessionEnd from 1.0.85, but 2.1.261 is the only version its delivery was measured on. + installFrom: '2.1.261', + definition: { hooks: [{ type: 'command', command: '' }] } +} as const + +export const CLAUDE_MANAGED_EVENTS = [...CLAUDE_EVENTS, CLAUDE_SESSION_END_EVENT] as const + +export type ManagedHookEvent = { + eventName: string + definition: Omit +} + +export type ClaudeManagedHookPlan = { + install: readonly ManagedHookEvent[] + /** Events whose Orca entry must go; user entries under them always stay. */ + retire: readonly ManagedHookEvent[] + /** Orca's statusLine usage feed; `retire` removes only Orca's own, `leave` never touches the slot. */ + statusLine: 'install' | 'retire' | 'leave' +} + +/** What to write for a Claude of this version; see claude-hook-event-versions.ts. */ +export function getClaudeManagedHookPlan( + claudeVersion: string | null | undefined +): ClaudeManagedHookPlan { + const install = CLAUDE_MANAGED_EVENTS.filter( + (event) => + claudeKnowsHookEvent(claudeVersion, event.eventName) && + (!('installFrom' in event) || claudeVersionReaches(claudeVersion, event.installFrom)) + ) + // Why: an unresolved version (e.g. a probe timeout) is no evidence of an old Claude, so it must + // not strip entries an install that knew the version wrote; only a known version retires events. + const retire = + parseClaudeCliVersion(claudeVersion) === null + ? [] + : CLAUDE_MANAGED_EVENTS.filter((event) => !install.includes(event)) + return { + install, + retire, + statusLine: claudeKnowsStatusLine(claudeVersion) ? 'install' : 'retire' + } +} + +// Why: OpenClaude reads its own settings file and accepts every event Orca writes. The statusline +// usage feed is Claude-only — OpenClaude data would be misattributed to the Claude provider. +export const OPENCLAUDE_MANAGED_HOOK_PLAN: ClaudeManagedHookPlan = { + install: CLAUDE_EVENTS, + retire: [CLAUDE_SESSION_END_EVENT], + statusLine: 'leave' +} diff --git a/src/main/claude/claude-session-end-hook-capability.test.ts b/src/main/claude/claude-session-end-hook-capability.test.ts deleted file mode 100644 index 755cdcbe4987..000000000000 --- a/src/main/claude/claude-session-end-hook-capability.test.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - CLAUDE_SESSION_END_CAPABILITY_FLOOR, - claudeVersionSupportsSessionEnd, - parseClaudeCliVersion -} from './claude-session-end-hook-capability' - -describe('Claude SessionEnd hook version capability', () => { - it('records 2.1.261 as the measured floor', () => { - expect(CLAUDE_SESSION_END_CAPABILITY_FLOOR).toBe('2.1.261') - }) - - it('extracts Claude Code version output', () => { - expect(parseClaudeCliVersion('2.1.261 (Claude Code)')).toBe('2.1.261') - }) - - it.each([ - ['2.1.260', false], - ['2.1.261', true], - ['2.2.0', true], - ['unknown', false], - [undefined, false] - ])('classifies %s as SessionEnd-capable: %s', (version, expected) => { - expect(claudeVersionSupportsSessionEnd(version)).toBe(expected) - }) -}) diff --git a/src/main/claude/claude-session-end-hook-capability.ts b/src/main/claude/claude-session-end-hook-capability.ts deleted file mode 100644 index 1587c154e7bd..000000000000 --- a/src/main/claude/claude-session-end-hook-capability.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { hasReachedAppVersion, isValidAppVersion } from '../../shared/app-version' -import { runProcess } from '../../shared/child-process/run-process' -import path from 'node:path' - -// 2.1.261 is the only version measured, not an established minimum. -export const CLAUDE_SESSION_END_CAPABILITY_FLOOR = '2.1.261' - -export function parseClaudeCliVersion(output: string | null | undefined): string | null { - const version = output?.match(/\b\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?\b/)?.[0] - return version && isValidAppVersion(version) ? version : null -} - -export function claudeVersionSupportsSessionEnd(version: string | null | undefined): boolean { - const parsed = parseClaudeCliVersion(version) - return parsed !== null && hasReachedAppVersion(parsed, CLAUDE_SESSION_END_CAPABILITY_FLOOR) -} - -export async function probeClaudeCliVersion(executablePath: string): Promise { - try { - const pathKey = process.platform === 'win32' && process.env.Path !== undefined ? 'Path' : 'PATH' - const executableDir = path.dirname(executablePath) - const inheritedPath = process.env[pathKey] - const result = await runProcess({ - program: executablePath, - args: ['--version'], - // Why: version-manager launchers often use `#!/usr/bin/env node`; the resolved CLI's sibling - // runtime must remain reachable even when Electron started with a thinner PATH. - env: { - ...process.env, - [pathKey]: inheritedPath - ? `${executableDir}${path.delimiter}${inheritedPath}` - : executableDir - }, - timeoutMs: 5_000, - maxOutputBytes: 4_096 - }) - return result.code === 0 ? parseClaudeCliVersion(`${result.stdout}\n${result.stderr}`) : null - } catch { - return null - } -} diff --git a/src/main/claude/claude-session-end-install.test.ts b/src/main/claude/claude-session-end-install.test.ts deleted file mode 100644 index 46f374ca7aef..000000000000 --- a/src/main/claude/claude-session-end-install.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { applyManagedHooks } from './hook-settings' - -const SCRIPT_FILE_NAME = 'claude-hook.sh' -const MANAGED_COMMAND = '/home/dev/.orca/agent-hooks/claude-hook.sh' -const managedHook = { type: 'command' as const, command: MANAGED_COMMAND } - -describe('Claude SessionEnd managed hook capability', () => { - it('installs SessionEnd beside SessionStart for the measured capable version', () => { - const written = applyManagedHooks({ hooks: {} }, managedHook, SCRIPT_FILE_NAME, { - claudeVersion: '2.1.261 (Claude Code)' - }) - - expect(written.hooks?.SessionEnd?.[0]?.hooks?.[0]?.command).toBe(MANAGED_COMMAND) - expect(written.hooks?.SessionStart?.[0]?.hooks?.[0]?.command).toBe(MANAGED_COMMAND) - }) - - it.each(['2.1.260', 'unknown', undefined])( - 'retains the legacy event set for an incapable or unverified host (%s)', - (claudeVersion) => { - const written = applyManagedHooks({ hooks: {} }, managedHook, SCRIPT_FILE_NAME, { - claudeVersion - }) - - expect(written.hooks?.SessionEnd).toBeUndefined() - expect(written.hooks?.SessionStart).toBeDefined() - } - ) - - it('removes only Orca SessionEnd during a capability downgrade', () => { - const capable = applyManagedHooks( - { - hooks: { - SessionEnd: [{ hooks: [{ type: 'command', command: 'echo user-session-end' }] }] - } - }, - managedHook, - SCRIPT_FILE_NAME, - { claudeVersion: '2.1.261' } - ) - const downgraded = applyManagedHooks(capable, managedHook, SCRIPT_FILE_NAME, { - claudeVersion: '2.1.260' - }) - - expect(downgraded.hooks?.SessionEnd).toEqual([ - { hooks: [{ type: 'command', command: 'echo user-session-end' }] } - ]) - }) -}) diff --git a/src/main/claude/claude-settings-schema-install.test.ts b/src/main/claude/claude-settings-schema-install.test.ts new file mode 100644 index 000000000000..577e455b6a34 --- /dev/null +++ b/src/main/claude/claude-settings-schema-install.test.ts @@ -0,0 +1,59 @@ +import { mkdtempSync, readFileSync, rmSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import fixture from './__fixtures__/claude-hook-event-enums.json' + +vi.mock('electron', () => ({ + app: { + getPath: () => '/tmp/userData' + } +})) + +import { ClaudeHookService } from './hook-service' + +const enums: Record = fixture.enums +const topLevelSettings: Record = + fixture.topLevelSettings +const strictReleases = Object.keys(topLevelSettings).filter( + (version) => topLevelSettings[version].strict +) + +// Why: checks the whole written file, so any new key Orca writes must pass each strict schema. +describe('Claude settings written for a strict settings schema', () => { + let tmpHome: string + let settingsPath: string + + beforeEach(() => { + tmpHome = mkdtempSync(join(tmpdir(), 'orca-claude-settings-schema-')) + settingsPath = join(tmpHome, '.claude', 'settings.json') + vi.stubEnv('HOME', tmpHome) + vi.stubEnv('USERPROFILE', tmpHome) + }) + + afterEach(() => { + vi.unstubAllEnvs() + rmSync(tmpHome, { recursive: true, force: true }) + }) + + function expectAcceptedBy(version: string): void { + const written = JSON.parse(readFileSync(settingsPath, 'utf-8')) + const { keys } = topLevelSettings[version] + expect(Object.keys(written).filter((key) => !keys.includes(key))).toEqual([]) + expect( + Object.keys(written.hooks ?? {}).filter((event) => !enums[version].includes(event)) + ).toEqual([]) + } + + it.each(strictReleases)('a fresh install writes only what Claude %s accepts', (version) => { + new ClaudeHookService().install({ claudeVersion: version }) + expectAcceptedBy(version) + }) + + it.each(strictReleases)('a downgrade to Claude %s leaves only what it accepts', (version) => { + const service = new ClaudeHookService() + service.install({ claudeVersion: '2.1.261' }) + service.install({ claudeVersion: version }) + expectAcceptedBy(version) + }) +}) diff --git a/src/main/claude/claude-status-line-install.test.ts b/src/main/claude/claude-status-line-install.test.ts new file mode 100644 index 000000000000..3c7c9c6f83c7 --- /dev/null +++ b/src/main/claude/claude-status-line-install.test.ts @@ -0,0 +1,75 @@ +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' + +vi.mock('electron', () => ({ + app: { + getPath: () => '/tmp/userData' + } +})) + +import { ClaudeHookService } from './hook-service' + +const USER_STATUS_LINE = { type: 'command', command: '/usr/local/bin/my-statusline' } + +describe('Claude statusLine by resolved version', () => { + let tmpHome: string + let settingsPath: string + + beforeEach(() => { + tmpHome = mkdtempSync(join(tmpdir(), 'orca-claude-statusline-version-')) + settingsPath = join(tmpHome, '.claude', 'settings.json') + vi.stubEnv('HOME', tmpHome) + vi.stubEnv('USERPROFILE', tmpHome) + }) + + afterEach(() => { + vi.unstubAllEnvs() + rmSync(tmpHome, { recursive: true, force: true }) + }) + + const readSettings = () => JSON.parse(readFileSync(settingsPath, 'utf-8')) + + it('writes no statusLine for a Claude whose settings schema rejects it', () => { + new ClaudeHookService().install({ claudeVersion: '1.0.63' }) + expect(readSettings().statusLine).toBeUndefined() + expect(readSettings().hooks.SessionStart).toBeDefined() + }) + + it('removes Orca statusLine on a downgrade and re-adds it after the upgrade', () => { + const service = new ClaudeHookService() + service.install({ claudeVersion: '2.1.261' }) + expect(readSettings().statusLine?.command).toContain('claude-statusline') + + service.install({ claudeVersion: '1.0.63' }) + expect(readSettings().statusLine).toBeUndefined() + + // Why: Orca's own removal must not read as the user's opt-out on the next capable install. + service.install({ claudeVersion: '1.0.64' }) + expect(readSettings().statusLine?.command).toContain('claude-statusline') + }) + + it('keeps the user opt-out across a downgrade and upgrade', () => { + const service = new ClaudeHookService() + service.install({ claudeVersion: '2.1.261' }) + const { statusLine: _optedOut, ...rest } = readSettings() + writeFileSync(settingsPath, JSON.stringify(rest)) + + service.install({ claudeVersion: '1.0.63' }) + service.install({ claudeVersion: '2.1.261' }) + expect(readSettings().statusLine).toBeUndefined() + }) + + it('never removes a user statusLine for an old Claude', () => { + mkdirSync(join(tmpHome, '.claude'), { recursive: true }) + writeFileSync(settingsPath, JSON.stringify({ statusLine: USER_STATUS_LINE })) + new ClaudeHookService().install({ claudeVersion: '1.0.63' }) + expect(readSettings().statusLine).toEqual(USER_STATUS_LINE) + }) + + it('keeps installing the statusLine when the version is unresolved', () => { + new ClaudeHookService().install() + expect(readSettings().statusLine?.command).toContain('claude-statusline') + }) +}) diff --git a/src/main/claude/compact-status-registration.test.ts b/src/main/claude/compact-status-registration.test.ts index 2c54cc8db622..225a52423c3a 100644 --- a/src/main/claude/compact-status-registration.test.ts +++ b/src/main/claude/compact-status-registration.test.ts @@ -12,7 +12,9 @@ import { import { seedClaudeSubagentRosterFromSnapshots } from '../../shared/agent-hook-listener/providers/claude-roster-state' import type { AgentHookEventPayload } from '../../shared/agent-hook-listener/listener-event' import { makePaneKey } from '../../shared/stable-pane-id' -import { applyManagedHooks, CLAUDE_EVENTS } from './hook-settings' +import { CLAUDE_HOOK_EVENT_FIRST_VERSIONS } from './claude-hook-event-versions' +import { CLAUDE_EVENTS, getClaudeManagedHookPlan } from './claude-managed-hook-events' +import { applyManagedHooks } from './hook-settings' const PANE_KEY = makePaneKey('compact-registration', '11111111-1111-4111-8111-111111111111') const TURN_PROMPT_ID = '22222222-2222-4222-8222-222222222222' @@ -108,7 +110,8 @@ describe('Claude compact hook registration', () => { const written = applyManagedHooks( { hooks: {} }, { type: 'command', command: 'orca-claude-hook' }, - 'claude-hook.sh' + 'claude-hook.sh', + getClaudeManagedHookPlan(CLAUDE_HOOK_EVENT_FIRST_VERSIONS.PostCompact) ) const postCompact = written.hooks?.PostCompact ?? [] expect( diff --git a/src/main/claude/hook-service.test.ts b/src/main/claude/hook-service.test.ts index 2a07aff4c8ae..c9191d42dbd1 100644 --- a/src/main/claude/hook-service.test.ts +++ b/src/main/claude/hook-service.test.ts @@ -27,11 +27,8 @@ import type { SFTPWrapper } from 'ssh2' import { createManagedCommandMatcher, WINDOWS_CMD_SAFE_PATH } from '../agent-hooks/installer-utils' import { WINDOWS_HOOK_STDIN_DRAIN_LABEL } from '../agent-hooks/hook-stdin-contract' import { ClaudeHookService } from './hook-service' -import { - CLAUDE_EVENTS, - getWindowsManagedLifecycleHook, - OPENCLAUDE_HOOK_SETTINGS -} from './hook-settings' +import { CLAUDE_EVENTS } from './claude-managed-hook-events' +import { getWindowsManagedLifecycleHook, OPENCLAUDE_HOOK_SETTINGS } from './hook-settings' const CLAUDE_SCRIPT_FILE_NAME = process.platform === 'win32' ? 'claude-hook.cmd' : 'claude-hook.sh' const STATUSLINE_SCRIPT_FILE_NAME = @@ -43,6 +40,9 @@ const isOpenClaudeManagedCommand = createManagedCommandMatcher(OPENCLAUDE_SCRIPT type TestHook = { command: string; args?: string[] } +// Why: the managed event set follows the resolved Claude; this one knows every event Orca writes. +const CURRENT_CLAUDE = { claudeVersion: '2.1.261 (Claude Code)' } + function hasManagedCommand(hook: TestHook, matcher: (command: string | undefined) => boolean) { return matcher(hook.command) || hook.args?.some(matcher) === true } @@ -217,7 +217,7 @@ describe('ClaudeHookService.install', () => { }) ) - const status = new ClaudeHookService().install() + const status = new ClaudeHookService().install(CURRENT_CLAUDE) expect(status.state).toBe('installed') const legacy = JSON.parse(readFileSync(legacyPath, 'utf-8')) @@ -275,6 +275,48 @@ describe('ClaudeHookService.install', () => { } }) + it('writes only the events an old resolved Claude knows and reports that as installed', () => { + const tmpHome = mkdtempSync(join(tmpdir(), 'orca-claude-old-version-')) + vi.stubEnv('HOME', tmpHome) + vi.stubEnv('USERPROFILE', tmpHome) + try { + const service = new ClaudeHookService() + expect(service.install({ claudeVersion: '2.1.32' }).state).toBe('installed') + + const settings = JSON.parse(readFileSync(join(tmpHome, '.claude', 'settings.json'), 'utf-8')) + for (const event of ['StopFailure', 'PostCompact', 'TeammateIdle', 'SessionEnd']) { + expect(settings.hooks[event], event).toBeUndefined() + } + expect(settings.hooks.SubagentStart).toBeDefined() + // Why: a reader without the version still sees a complete install of the universal set. + expect(service.getStatus().state).toBe('installed') + } finally { + vi.unstubAllEnvs() + rmSync(tmpHome, { recursive: true, force: true }) + } + }) + + it('keeps newer Orca events and reports installed when a later probe cannot resolve the version', () => { + const tmpHome = mkdtempSync(join(tmpdir(), 'orca-claude-unknown-version-')) + vi.stubEnv('HOME', tmpHome) + vi.stubEnv('USERPROFILE', tmpHome) + try { + const service = new ClaudeHookService() + const settingsPath = join(tmpHome, '.claude', 'settings.json') + expect(service.install(CURRENT_CLAUDE).state).toBe('installed') + const known = JSON.parse(readFileSync(settingsPath, 'utf-8')) + + expect(service.install().state).toBe('installed') + + const unknown = JSON.parse(readFileSync(settingsPath, 'utf-8')) + expect(unknown.hooks).toEqual(known.hooks) + expect(service.getStatus().state).toBe('installed') + } finally { + vi.unstubAllEnvs() + rmSync(tmpHome, { recursive: true, force: true }) + } + }) + it('installs the managed statusLine command and forwards rate_limits posts', () => { const tmpHome = mkdtempSync(join(tmpdir(), 'orca-claude-statusline-')) vi.stubEnv('HOME', tmpHome) @@ -458,7 +500,7 @@ describe('ClaudeHookService.install', () => { return } try { - expect(new ClaudeHookService().install().state).toBe('installed') + expect(new ClaudeHookService().install(CURRENT_CLAUDE).state).toBe('installed') const settings = JSON.parse( readFileSync(join(tmpHome, '.claude', 'settings.json'), 'utf-8') @@ -472,7 +514,7 @@ describe('ClaudeHookService.install', () => { } // Why: the whole point of #18875 — no interpreter is started to reach the script. expect(JSON.stringify(settings.hooks)).not.toMatch(/powershell|EncodedCommand/i) - expect(new ClaudeHookService().getStatus().state).toBe('installed') + expect(new ClaudeHookService().getStatus(CURRENT_CLAUDE).state).toBe('installed') } finally { vi.unstubAllEnvs() rmSync(tmpHome, { recursive: true, force: true }) @@ -681,7 +723,7 @@ describe('ClaudeHookService.installRemote', () => { it('writes Claude settings + managed script under the remote $HOME', async () => { const svc = new ClaudeHookService() const { sftp, fs } = createFakeSftp() - const status = await svc.installRemote(sftp, '/home/dev') + const status = await svc.installRemote(sftp, '/home/dev', CURRENT_CLAUDE) expect(status.state).toBe('installed') expect(status.configPath).toBe('/home/dev/.claude/settings.json') const settings = fs.files.get('/home/dev/.claude/settings.json') @@ -732,6 +774,25 @@ describe('ClaudeHookService.installRemote', () => { expect(fs.files.get('/home/dev/.orca/agent-hooks/claude-statusline.sh')).toBeUndefined() }) + it('writes only the events the remote Claude knows, adding newer ones once it upgrades', async () => { + const svc = new ClaudeHookService() + const { sftp, fs } = createFakeSftp() + const settingsPath = '/home/dev/.claude/settings.json' + const userStop = { hooks: [{ type: 'command', command: '/usr/local/bin/my-user-hook' }] } + fs.files.set(settingsPath, JSON.stringify({ env: { A: '1' }, hooks: { Stop: [userStop] } })) + + await svc.installRemote(sftp, '/home/dev', { claudeVersion: '2.1.77' }) + const old = JSON.parse(fs.files.get(settingsPath)!) + expect(old.hooks.StopFailure).toBeUndefined() + expect(old.hooks.PostCompact).toBeDefined() + + await svc.installRemote(sftp, '/home/dev', { claudeVersion: '2.1.78' }) + const upgraded = JSON.parse(fs.files.get(settingsPath)!) + expect(upgraded.hooks.StopFailure[0].hooks[0].command).toContain('claude-hook.sh') + expect(upgraded.hooks.Stop[0]).toEqual(userStop) + expect(upgraded.env).toEqual({ A: '1' }) + }) + it('reports parse error when remote settings.json cannot be parsed', async () => { const svc = new ClaudeHookService() const { sftp, fs } = createFakeSftp() diff --git a/src/main/claude/hook-service.ts b/src/main/claude/hook-service.ts index 1e9a0d91982f..bc27b56075e3 100644 --- a/src/main/claude/hook-service.ts +++ b/src/main/claude/hook-service.ts @@ -22,7 +22,6 @@ import { getManagedStatusLineScript } from './statusline-script' import { applyManagedHooks, applyManagedStatusLine, - CLAUDE_EVENTS, CLAUDE_HOOK_SETTINGS, getManagedScriptFileName, getConfigPath, @@ -39,16 +38,21 @@ import { hasSameManagedHookInvocation, removeManagedHooks, removeManagedStatusLine, - type ApplyManagedClaudeHooksOptions, type ClaudeCompatibleHookSettings } from './hook-settings' +import { + getClaudeManagedHookPlan, + OPENCLAUDE_MANAGED_HOOK_PLAN, + type ClaudeManagedHookPlan +} from './claude-managed-hook-events' type ClaudeHookServiceOptions = { agent: AgentHookInstallStatus['agent'] displayName: string settings: ClaudeCompatibleHookSettings source?: AgentHookSource - events?: ApplyManagedClaudeHooksOptions['events'] + /** A Claude-compatible CLI with its own settings file writes a fixed plan, not Claude's version table. */ + hookPlan?: ClaudeManagedHookPlan } type ClaudeHookInstallOptions = { @@ -68,7 +72,15 @@ export class ClaudeHookService { this.options = options } - getStatus(): AgentHookInstallStatus { + // Why: Claude's settings loader rejects events newer than the running CLI, so its plan follows the + // resolved version; OpenClaude and Qoder read their own settings files. + private managedHookPlan(options: ClaudeHookInstallOptions): ClaudeManagedHookPlan { + return this.options.agent === 'claude' + ? getClaudeManagedHookPlan(options.claudeVersion) + : (this.options.hookPlan ?? OPENCLAUDE_MANAGED_HOOK_PLAN) + } + + getStatus(options: ClaudeHookInstallOptions = {}): AgentHookInstallStatus { const configPath = getConfigPath(this.options.settings) const scriptPath = getManagedScriptPath(this.options.settings) const config = readHooksJson(configPath) @@ -86,7 +98,7 @@ export class ClaudeHookService { const expectedHook = getManagedLifecycleHook(scriptPath, this.options.settings) const missing: string[] = [] let presentCount = 0 - for (const event of this.options.events ?? CLAUDE_EVENTS) { + for (const event of this.managedHookPlan(options).install) { const definitions = Array.isArray(config.hooks?.[event.eventName]) ? config.hooks![event.eventName]! : [] @@ -146,11 +158,12 @@ export class ClaudeHookService { } const hook = getManagedLifecycleHook(scriptPath, this.options.settings) + const plan = this.managedHookPlan(options) let nextConfig = applyManagedHooks( config, hook, getManagedScriptFileName(this.options.settings), - { ...(this.options.agent === 'claude' ? options : {}), events: this.options.events } + plan ) writeManagedScript( scriptPath, @@ -160,12 +173,13 @@ export class ClaudeHookService { skipWhenGrokImportsClaude: this.options.agent === 'claude' }) ) - // Why: the statusline usage feed is Claude-only — OpenClaude data would be misattributed to the Claude provider. - if (this.options.agent === 'claude') { + if (plan.statusLine === 'install') { nextConfig = this.installManagedStatusLine(nextConfig) + } else if (plan.statusLine === 'retire') { + nextConfig = this.retireManagedStatusLine(nextConfig) } writeHooksJson(configPath, nextConfig) - return this.getStatus() + return this.getStatus(options) } // Why: the statusline feed is opportunistic (usage display, not agent status); a user who deleted the @@ -192,6 +206,23 @@ export class ClaudeHookService { return next } + // Why: a Claude that predates statusLine discards the whole settings file over Orca's; dropping the + // marker with it keeps an upgrade from reading the removal as the user's opt-out. + private retireManagedStatusLine(config: HooksConfig): HooksConfig { + const { config: next, changed } = removeManagedStatusLine( + config, + getStatusLineScriptFileName(this.options.settings) + ) + if (changed) { + try { + rmSync(getStatusLineInstallMarkerPath(this.options.settings), { force: true }) + } catch { + // Best-effort: a stale marker only means one upgrade skips re-adding the statusline. + } + } + return next + } + // Why: install the Claude hook on the remote box (via SFTP); POSIX-only by design (Windows-remote deferred). async installRemote( sftp: SFTPWrapper, @@ -217,10 +248,12 @@ export class ClaudeHookService { // Why: settings resolve HOME at runtime while SFTP still targets the discovered remote home. const hook = buildManagedCommandHook(getRemoteManagedCommand(remoteScriptPath)) - const nextConfig = applyManagedHooks(config, hook, remoteScriptFileName, { - ...(this.options.agent === 'claude' ? options : {}), - events: this.options.events - }) + const nextConfig = applyManagedHooks( + config, + hook, + remoteScriptFileName, + this.managedHookPlan(options) + ) // Why: write scripts before settings to avoid settings pointing to missing scripts. // Why: SSH scripts always use POSIX .sh paths, regardless of the local OS. diff --git a/src/main/claude/hook-settings.ts b/src/main/claude/hook-settings.ts index 185aa0b545a9..6ce4ea4869ca 100644 --- a/src/main/claude/hook-settings.ts +++ b/src/main/claude/hook-settings.ts @@ -16,7 +16,7 @@ import { quotePowerShellLiteral } from '../../shared/powershell-native-argument' import { wrapRuntimeHomeHookCommand } from '../agent-hooks/runtime-home-hook-command' import { wrapWindowsDirectCmdHookCommand } from '../agent-hooks/windows-direct-cmd-hook-command' import { isGitBashAvailable } from '../git-bash' -import { claudeVersionSupportsSessionEnd } from './claude-session-end-hook-capability' +import type { ClaudeManagedHookPlan } from './claude-managed-hook-events' export type ClaudeCompatibleHookSettings = { configDirName: '.claude' | '.openclaude' | '.qoder' @@ -37,82 +37,6 @@ export const OPENCLAUDE_HOOK_SETTINGS: ClaudeCompatibleHookSettings = { usesWindowsCompatLauncher: false } -export const CLAUDE_EVENTS = [ - // Why: SessionStart is the only event a resumed/idle session emits before the - // first prompt; without it the sidebar row can't exist until the user types (STA-3386). - { - eventName: 'SessionStart', - definition: { hooks: [{ type: 'command', command: '' }] } - }, - { - eventName: 'UserPromptSubmit', - definition: { hooks: [{ type: 'command', command: '' }] } - }, - { - eventName: 'Stop', - definition: { hooks: [{ type: 'command', command: '' }] } - }, - // Why: OpenClaude skips normal Stop hooks after API/model errors and emits - // StopFailure instead; without this hook Orca leaves the turn spinning. - { - eventName: 'StopFailure', - definition: { hooks: [{ type: 'command', command: '' }] } - }, - // Why: subagent/teammate lifecycle feeds the sidebar's child rows and keeps - // a pane 'working' while background children outlive the lead's turn. - // TeammateIdle parks turn-based teammates without trusting their permanently - // "running" background_tasks entry to gate the pane. - // Older Claude builds ignore unregistered event names (StopFailure precedent). - { - eventName: 'SubagentStart', - definition: { hooks: [{ type: 'command', command: '' }] } - }, - { - eventName: 'SubagentStop', - definition: { hooks: [{ type: 'command', command: '' }] } - }, - { - eventName: 'TeammateIdle', - definition: { hooks: [{ type: 'command', command: '' }] } - }, - // Why: PreToolUse gives the dashboard a live readout of the in-flight tool - // (name + input preview) before it completes. - { - eventName: 'PreToolUse', - definition: { matcher: '*', hooks: [{ type: 'command', command: '' }] } - }, - { - eventName: 'PostToolUse', - definition: { matcher: '*', hooks: [{ type: 'command', command: '' }] } - }, - { - eventName: 'PostToolUseFailure', - definition: { matcher: '*', hooks: [{ type: 'command', command: '' }] } - }, - { - eventName: 'PermissionRequest', - definition: { matcher: '*', hooks: [{ type: 'command', command: '' }] } - }, - // Why: a manual /compact ends at an idle prompt without emitting Stop, so PostCompact is the only - // signal that can clear the pane (STA-2915). PreCompact is deliberately NOT registered: it fires - // before the compact is validated, and an aborted compact emits it alone — mapping it to 'working' - // would strand the pane exactly as this registration is meant to prevent (STA-4613). - { - eventName: 'PostCompact', - definition: { hooks: [{ type: 'command', command: '' }] } - } -] as const - -const CLAUDE_SESSION_END_EVENT = { - eventName: 'SessionEnd', - definition: { hooks: [{ type: 'command', command: '' }] } -} as const - -export type ApplyManagedClaudeHooksOptions = { - claudeVersion?: string - events?: readonly { eventName: string; definition: Omit }[] -} - export function getConfigPath(settings = CLAUDE_HOOK_SETTINGS): string { return join(homedir(), settings.configDirName, 'settings.json') } @@ -235,33 +159,29 @@ export function getRemoteManagedCommand(scriptPath: string): string { export function applyManagedHooks( config: HooksConfig, hook: HookCommandConfig, - scriptFileName = getManagedScriptFileName(), - options: ApplyManagedClaudeHooksOptions = {} + scriptFileName: string, + plan: ClaudeManagedHookPlan ): HooksConfig { const nextHooks = { ...config.hooks } const isManagedCommand = createManagedCommandMatcher(scriptFileName) - const sessionEndCapable = claudeVersionSupportsSessionEnd(options.claudeVersion) - const events = - options.events ?? - (sessionEndCapable ? [...CLAUDE_EVENTS, CLAUDE_SESSION_END_EVENT] : CLAUDE_EVENTS) - for (const event of events) { - const current = Array.isArray(nextHooks[event.eventName]) ? nextHooks[event.eventName] : [] - const cleaned = removeManagedCommands(current, isManagedCommand) - const definition: HookDefinition = { - ...event.definition, - hooks: [hook] - } + for (const event of plan.install) { + const current = nextHooks[event.eventName] + const cleaned = Array.isArray(current) ? removeManagedCommands(current, isManagedCommand) : [] + const definition: HookDefinition = { ...event.definition, hooks: [hook] } nextHooks[event.eventName] = [...cleaned, definition] } - if (!sessionEndCapable && !options.events) { - const current = Array.isArray(nextHooks.SessionEnd) ? nextHooks.SessionEnd : [] + for (const event of plan.retire) { + const current = nextHooks[event.eventName] + if (!Array.isArray(current) || current.length === 0) { + continue + } const cleaned = removeManagedCommands(current, isManagedCommand) if (cleaned.length === 0) { - delete nextHooks.SessionEnd + delete nextHooks[event.eventName] } else { - nextHooks.SessionEnd = cleaned + nextHooks[event.eventName] = cleaned } } diff --git a/src/main/qoder/hook-service.test.ts b/src/main/qoder/hook-service.test.ts index 7f1d2674f9cb..3af282ecd767 100644 --- a/src/main/qoder/hook-service.test.ts +++ b/src/main/qoder/hook-service.test.ts @@ -53,6 +53,16 @@ describe('Qoder managed configuration', () => { }) }) + it("writes every Qoder event whatever Claude version is passed, since Claude's table never applies", () => { + const path = join(sandbox.home, '.qoder', 'settings.json') + writeFileSync(path, JSON.stringify({ hooks: {} })) + expect(qoderHookService.install({ claudeVersion: '1.0.62' }).state).toBe('installed') + const installed = JSON.parse(readFileSync(path, 'utf8')) + expect(Object.keys(installed.hooks).sort()).toEqual([...QODER_HOOK_EVENTS].sort()) + expect(installed.statusLine).toBeUndefined() + expect(qoderHookService.remove().state).toBe('not_installed') + }) + it('refuses malformed settings instead of overwriting them', () => { const path = join(sandbox.home, '.qoder', 'settings.json') writeFileSync(path, '{broken') diff --git a/src/main/qoder/hook-service.ts b/src/main/qoder/hook-service.ts index d6950ef32359..ac9e869638c8 100644 --- a/src/main/qoder/hook-service.ts +++ b/src/main/qoder/hook-service.ts @@ -1,3 +1,4 @@ +import type { ClaudeManagedHookPlan } from '../claude/claude-managed-hook-events' import { ClaudeHookService } from '../claude/hook-service' // Qoder documents Claude-shaped hooks at https://docs.qoder.com/cli/hooks. @@ -15,6 +16,14 @@ export const QODER_HOOK_EVENTS = [ 'PostCompact' ] as const +// Why: Qoder's own CLI reads these events, so Claude's version table never applies; the statusline +// usage feed is Claude-only. +export const QODER_MANAGED_HOOK_PLAN: ClaudeManagedHookPlan = { + install: QODER_HOOK_EVENTS.map((eventName) => ({ eventName, definition: {} })), + retire: [], + statusLine: 'leave' +} + export const qoderHookService = new ClaudeHookService({ agent: 'qoder', source: 'qoder', @@ -25,5 +34,5 @@ export const qoderHookService = new ClaudeHookService({ usesWindowsCompatLauncher: true, windowsHookShell: 'powershell' }, - events: QODER_HOOK_EVENTS.map((eventName) => ({ eventName, definition: {} })) + hookPlan: QODER_MANAGED_HOOK_PLAN }) diff --git a/src/relay/managed-hook-installer.ts b/src/relay/managed-hook-installer.ts index 3fa57dd5ed84..e88089f486ad 100644 --- a/src/relay/managed-hook-installer.ts +++ b/src/relay/managed-hook-installer.ts @@ -6,7 +6,7 @@ import { import type { RelayDispatcher, RequestContext } from './dispatcher' import type { AgentHookTarget } from '../shared/agent-hook-types' import { isManagedAgentHookTarget } from '../shared/managed-agent-hook-targets' -import { parseClaudeCliVersion } from '../main/claude/claude-session-end-hook-capability' +import { parseClaudeCliVersion } from '../main/claude/claude-hook-event-versions' export type ManagedHookInstallSummary = { installers: number From 2c92e5e7daf7a065bbb7b7c9aba09c8b3fe55e57 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:10:20 -0700 Subject: [PATCH 09/90] fix(native-chat): a failed Codex turn keeps its failure and "Worked for" (#23514) * fix(native-chat): a Codex turn's first terminal settlement is final Codex follows a turn-ending `error` with a failed `turn/completed` for the same turn. The error settled the turn and dropped its start and attributed send; the completion then re-settled it from nothing, so the record lost its start time and flipped from completed/failure to interrupted/failure. A failed turn lost its "Worked for" and read as interrupted. Both ends now go through one settlement that refuses a turn already in the recent-turns window, so every later end (error then completion, a duplicate completion) adds nothing and overwrites nothing. * test(native-chat): the settles-once fixture is an ordinary failed turn The fixture was labelled and worded as a failed compaction; this change covers the ordinary-turn path, so its frames now read as one. * test(native-chat): a failed Codex turn keeps its record when its two ends coalesce in the queue --- ...red-journal-translation-turn-boundaries.ts | 94 +++----- ...rnal-translation-turn-settles-once.test.ts | 210 ++++++++++++++++++ ...ructured-journal-translation-turn-state.ts | 7 +- ...-journal-turn-settles-once-journal.test.ts | 111 +++++++++ 4 files changed, 364 insertions(+), 58 deletions(-) create mode 100644 src/main/codex/codex-structured-journal-translation-turn-settles-once.test.ts create mode 100644 src/main/codex/codex-structured-journal-turn-settles-once-journal.test.ts diff --git a/src/main/codex/codex-structured-journal-translation-turn-boundaries.ts b/src/main/codex/codex-structured-journal-translation-turn-boundaries.ts index d4881de1897b..2c958858816c 100644 --- a/src/main/codex/codex-structured-journal-translation-turn-boundaries.ts +++ b/src/main/codex/codex-structured-journal-translation-turn-boundaries.ts @@ -37,6 +37,14 @@ type TurnBoundaryEvent = { dispatchSequenceAtReceipt?: number } +type TurnTerminal = { + state: 'completed' | 'interrupted' + completedAt: number + /** Null when Codex named no verdict, or when the host inferred this end itself. */ + outcome?: AgentJournalTurnOutcome | null + durationMs?: number | null +} + /** Opens and settles the durable lifecycle row for each primary-thread turn. */ export class CodexJournalTurnBoundaries { private readonly recentTurns = new CodexJournalRecentTurns() @@ -146,46 +154,12 @@ export class CodexJournalTurnBoundaries { // turn boundary is no evidence contact was lost. Only `settleSession` may // write `unverifiable`. const status = readCodexTurnStatus(event.params) - const turnLifecycle = - event.threadId === this.deps.primaryThreadId() - ? this.settled(event.threadId, turnId, { - state: codexTurnLifecycleState(status), - outcome: codexTurnOutcome(status), - completedAt: this.receiptTime(event), - durationMs: readCodexTurnDurationMs(event.params) - }) - : null - const requestOrigin = this.deps.activeTurns.requestOrigin(event.threadId, turnId) - const latestDispatchSequence = this.deps.activeTurns.latestDispatchSequence( - event.threadId, - turnId - ) - const admission = settleCodexJournalTurn({ - sink: this.deps.sink, - sessionId: event.sessionId, - threadId: event.threadId, - turnId, - turnLifecycle, - streams: this.deps.items.streams, - activeItems: this.deps.items.activeItems, - pendingPrompts: this.deps.pendingPrompts, - ...(this.deps.clearPromptTurn ? { clearPromptTurn: this.deps.clearPromptTurn } : {}), - linkageFor: this.deps.linkageFor + return this.end(event, turnId, { + state: codexTurnLifecycleState(status), + outcome: codexTurnOutcome(status), + completedAt: this.receiptTime(event), + durationMs: readCodexTurnDurationMs(event.params) }) - if (admission.accepted) { - if (turnLifecycle) { - this.recentTurns.remember( - event.threadId, - turnLifecycle, - requestOrigin, - latestDispatchSequence - ) - } - this.deps.items.ordinals.forgetTurn(event.threadId, turnId) - this.deps.activeTurns.forget(event.threadId, turnId) - this.deps.resetActivity(event.threadId) - } - return admission } /** @@ -204,18 +178,34 @@ export class CodexJournalTurnBoundaries { return suppressionAdmission } const turnId = readCodexTurnId(event.params) ?? this.deps.activeTurns.current(event.threadId) - // An error naming an already-settled turn is not a second end: its terminal - // row holds the start and duration this one could not reconstruct. + // An error ends only a turn this host saw open; its `turn/completed` settles any other. if (!turnId || !this.deps.activeTurns.isActive(event.threadId, turnId)) { return CODEX_JOURNAL_ADMITTED } + return this.end(event, turnId, { + state: 'completed', + outcome: 'failure', + completedAt: this.receiptTime(event) + }) + } + + /** + * A turn's first terminal settlement is final. Codex follows a turn-ending + * `error` with a failed `turn/completed` for the same turn, and by then the + * start and attributed send this row carries are forgotten, so a second end + * could only overwrite the record with less. + */ + private end( + event: TurnBoundaryEvent, + turnId: string, + terminal: TurnTerminal + ): CodexJournalTranslationAdmission { + if (this.recentTurns.has(event.threadId, turnId)) { + return CODEX_JOURNAL_ADMITTED + } const turnLifecycle = event.threadId === this.deps.primaryThreadId() - ? this.settled(event.threadId, turnId, { - state: 'completed', - outcome: 'failure', - completedAt: this.receiptTime(event) - }) + ? this.settled(event.threadId, turnId, terminal) : null const requestOrigin = this.deps.activeTurns.requestOrigin(event.threadId, turnId) const latestDispatchSequence = this.deps.activeTurns.latestDispatchSequence( @@ -252,17 +242,7 @@ export class CodexJournalTurnBoundaries { /** Terminal lifecycle for a remembered turn; `startedAt` is absent when the start was never seen. * The verdict travels as one record so a caller cannot supply the state and drop the outcome. */ - settled( - threadId: string, - turnId: string, - terminal: { - state: 'completed' | 'interrupted' - completedAt: number - /** Null when Codex named no verdict, or when the host inferred this end itself. */ - outcome?: AgentJournalTurnOutcome | null - durationMs?: number | null - } - ): AgentJournalTurnLifecycle { + settled(threadId: string, turnId: string, terminal: TurnTerminal): AgentJournalTurnLifecycle { const startedAt = this.deps.activeTurns.startedAt(threadId, turnId) // Carried forward from the exact echoed send that was attributed to this turn. const requestOrigin = this.deps.activeTurns.requestOrigin(threadId, turnId) diff --git a/src/main/codex/codex-structured-journal-translation-turn-settles-once.test.ts b/src/main/codex/codex-structured-journal-translation-turn-settles-once.test.ts new file mode 100644 index 000000000000..a5c02bd3bfeb --- /dev/null +++ b/src/main/codex/codex-structured-journal-translation-turn-settles-once.test.ts @@ -0,0 +1,210 @@ +import { describe, expect, it } from 'vitest' +import type { + AgentJournalItemBody, + AgentJournalItemIdentity +} from '../../shared/agent-session-journal-types' +import { + agentJournalItemKey, + agentJournalSubmissionKey +} from '../../shared/agent-session-journal-item-key' +import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' +import { createCodexJournalTranslator } from './codex-structured-journal-translation' +import type { CodexStructuredSessionEvent } from './codex-structured-session-adapter' + +const SESSION_ID = 'session-1' +const THREAD_ID = 'thread-abc' +const TURN_ID = 'turn-1' +const NEXT_TURN_ID = 'turn-2' +const CLIENT_MESSAGE_ID = 'client-1' + +type Row = { key: string; body: AgentJournalItemBody } + +function recorder() { + const rows: Row[] = [] + const sink: StructuredAgentSessionEventSink = { + appendItem: (identity: AgentJournalItemIdentity, body) => + rows.push({ key: agentJournalItemKey(identity), body }), + appendTombstone: () => {}, + publish: () => {} + } + return { sink, rows } +} + +function notification(method: string, params: unknown, observedAt: number) { + return { + type: 'notification', + sessionId: SESSION_ID, + threadId: THREAD_ID, + method, + params, + observedAt + } satisfies CodexStructuredSessionEvent +} + +function translator(tap: ReturnType) { + return createCodexJournalTranslator({ + sink: tap.sink, + sessionId: SESSION_ID, + primaryThreadId: () => THREAD_ID, + dispatchRequestOrigin: () => ({ requestedAt: 900, sequence: 0 }) + }) +} + +/** Every terminal write for a turn, in order: what a reader could observe. */ +function terminalWrites(rows: readonly Row[], turnId: string) { + return rows + .map((row) => row.body) + .filter((body) => body.kind === 'turn' && body.turnId === turnId && body.state !== 'running') +} + +/** The body the journal reducer keeps for a turn's lifecycle row. */ +function settledRecord(rows: readonly Row[], turnId: string) { + return rows + .map((row) => row.body) + .findLast((body) => body.kind === 'turn' && body.turnId === turnId) +} + +/** Codex's frames for a turn that fails: the error, then the failed completion. */ +function runFailedTurn(handle: (event: CodexStructuredSessionEvent) => unknown) { + handle(notification('turn/started', { turn: { id: TURN_ID } }, 1_000)) + handle( + notification( + 'item/started', + { + turnId: TURN_ID, + turn: { id: TURN_ID }, + item: { type: 'userMessage', id: 'user-1', clientId: CLIENT_MESSAGE_ID } + }, + 1_100 + ) + ) + handle( + notification( + 'item/completed', + { + turnId: TURN_ID, + item: { type: 'agentMessage', id: 'agent-1', text: 'Checking the build' } + }, + 1_500 + ) + ) + handle( + notification( + 'error', + { + threadId: THREAD_ID, + turnId: TURN_ID, + willRetry: false, + error: { message: 'stream disconnected before completion' } + }, + 2_000 + ) + ) + handle( + notification( + 'turn/completed', + { turn: { id: TURN_ID, status: 'failed', durationMs: 1_100 } }, + 2_100 + ) + ) +} + +describe('a Codex turn settles once', () => { + it('keeps the failure the error settled when the failed completion follows it', () => { + const tap = recorder() + const codex = translator(tap) + + runFailedTurn((event) => codex.handle(event)) + + expect(terminalWrites(tap.rows, TURN_ID)).toHaveLength(1) + expect(settledRecord(tap.rows, TURN_ID)).toEqual({ + kind: 'turn', + turnId: TURN_ID, + state: 'completed', + outcome: 'failure', + userItemId: agentJournalSubmissionKey(CLIENT_MESSAGE_ID), + startedAt: 1_000, + requestedAt: 900, + completedAt: 2_000 + }) + expect( + tap.rows.filter((row) => row.body.kind === 'status' && row.body.tone === 'error') + ).toHaveLength(1) + }) + + it('ignores a duplicate completion for a turn it already settled', () => { + const tap = recorder() + const codex = translator(tap) + + codex.handle(notification('turn/started', { turn: { id: TURN_ID } }, 1_000)) + codex.handle( + notification( + 'turn/completed', + { turn: { id: TURN_ID, status: 'completed', durationMs: 900 } }, + 2_000 + ) + ) + codex.handle(notification('turn/completed', { turn: { id: TURN_ID, status: 'failed' } }, 3_000)) + + expect(terminalWrites(tap.rows, TURN_ID)).toHaveLength(1) + expect(settledRecord(tap.rows, TURN_ID)).toMatchObject({ + state: 'completed', + outcome: 'success', + startedAt: 1_000, + completedAt: 2_000, + durationMs: 900 + }) + }) + + it('settles an ordinary turn exactly as before', () => { + const tap = recorder() + const codex = translator(tap) + + codex.handle(notification('turn/started', { turn: { id: TURN_ID } }, 1_000)) + codex.handle( + notification( + 'turn/completed', + { turn: { id: TURN_ID, status: 'completed', durationMs: 3_250 } }, + 4_500 + ) + ) + + expect(terminalWrites(tap.rows, TURN_ID)).toEqual([ + { + kind: 'turn', + turnId: TURN_ID, + state: 'completed', + outcome: 'success', + userItemId: `codex:${THREAD_ID}:${TURN_ID}:0`, + startedAt: 1_000, + completedAt: 4_500, + durationMs: 3_250 + } + ]) + }) + + it('settles the next turn on its own after a failed one', () => { + const tap = recorder() + const codex = translator(tap) + + runFailedTurn((event) => codex.handle(event)) + const failed = settledRecord(tap.rows, TURN_ID) + codex.handle(notification('turn/started', { turn: { id: NEXT_TURN_ID } }, 3_000)) + codex.handle( + notification( + 'turn/completed', + { turn: { id: NEXT_TURN_ID, status: 'completed', durationMs: 1_000 } }, + 4_000 + ) + ) + + expect(settledRecord(tap.rows, TURN_ID)).toEqual(failed) + expect(terminalWrites(tap.rows, NEXT_TURN_ID)).toHaveLength(1) + expect(settledRecord(tap.rows, NEXT_TURN_ID)).toMatchObject({ + state: 'completed', + outcome: 'success', + startedAt: 3_000, + completedAt: 4_000 + }) + }) +}) diff --git a/src/main/codex/codex-structured-journal-translation-turn-state.ts b/src/main/codex/codex-structured-journal-translation-turn-state.ts index ec1cff041db8..832f57f3096f 100644 --- a/src/main/codex/codex-structured-journal-translation-turn-state.ts +++ b/src/main/codex/codex-structured-journal-translation-turn-state.ts @@ -167,7 +167,8 @@ type RecentTurn = { bytes: number } -/** Bounded terminal lifecycle window for exact echoes that arrive after completion. */ +/** Bounded terminal lifecycle window: exact echoes that arrive after completion + * revise it, and a later end for a turn in it is not a second settlement. */ export class CodexJournalRecentTurns { private readonly turns = new Map() private retainedBytes = 0 @@ -231,6 +232,10 @@ export class CodexJournalRecentTurns { } } + has(threadId: string, turnId: string): boolean { + return this.turns.has(this.turnKey(threadId, turnId)) + } + requestOriginRevision( threadId: string, turnId: string, diff --git a/src/main/codex/codex-structured-journal-turn-settles-once-journal.test.ts b/src/main/codex/codex-structured-journal-turn-settles-once-journal.test.ts new file mode 100644 index 000000000000..6459b59755ce --- /dev/null +++ b/src/main/codex/codex-structured-journal-turn-settles-once-journal.test.ts @@ -0,0 +1,111 @@ +// A failed Codex turn through the real path its record takes: +// translator → deferred sink queue → on-disk journal → the shared turn-timing reader. + +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' +import { readAgentJournalTurn } from '../../shared/agent-session-turn-record' +import { + completedStructuredAgentTurnSeconds, + selectStructuredAgentRunningTurnTiming +} from '../../shared/structured-agent-session-turn-timing' +import { openAgentSessionJournal } from '../native-chat/agent-session-journal/journal-store-factory' +import { createDeferredStructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' +import { createCodexJournalTranslator } from './codex-structured-journal-translation' + +const SESSION = 'session-codex-failed-turn' +const THREAD = 'thread-abc' +const TURN = 'turn-1' + +const cleanups: (() => Promise)[] = [] +afterEach(async () => { + for (const cleanup of cleanups.splice(0)) { + await cleanup() + } +}) + +async function session() { + const root = await mkdtemp(join(tmpdir(), 'orca-codex-failed-turn-')) + const journal = await openAgentSessionJournal({ + identity: { + sessionId: SESSION, + workspaceId: 'workspace-1', + hostId: 'local', + agent: 'codex', + providerHandle: { kind: 'codex', threadId: THREAD } + }, + journalDir: root, + now: () => 1_000 + }) + const deferred = createDeferredStructuredAgentSessionEventSink() + deferred.bind({ journal, fence: 1, publish: () => {} }) + cleanups.push(async () => { + deferred.close() + await journal.close() + await rm(root, { recursive: true, force: true }) + }) + const translator = createCodexJournalTranslator({ + sink: deferred.sink, + sessionId: SESSION, + primaryThreadId: () => THREAD, + schedule: (run) => { + run() + return () => {} + } + }) + const on = (method: string, params: Record, observedAt: number) => + translator.handle({ + type: 'notification', + sessionId: SESSION, + threadId: THREAD, + method, + params: { threadId: THREAD, ...params }, + observedAt + }) + return { + on, + drained: () => deferred.drained(), + items: async () => { + await deferred.drained() + return journal.snapshot().items + } + } +} + +describe('a failed Codex turn in the journal', () => { + it('keeps the failure and its duration when the failed completion lands while the error is still queued', async () => { + const { on, drained, items } = await session() + on('turn/started', { turn: { id: TURN } }, 1_000) + on( + 'item/completed', + { turnId: TURN, item: { type: 'agentMessage', id: 'agent-1', text: 'Checking the build' } }, + 1_500 + ) + await drained() + + // Codex writes both frames back to back; the error's status row is still being + // written when the failed completion arrives, so the error's settlement is queued. + on( + 'error', + { turnId: TURN, willRetry: false, error: { message: 'stream disconnected' } }, + 3_000 + ) + on('turn/completed', { turn: { id: TURN, status: 'failed', durationMs: 1_900 } }, 3_100) + + const rows = await items() + const turn = rows + .map((item) => readAgentJournalTurn(item.body)) + .findLast((record) => record?.turnId === TURN) + expect(turn).toMatchObject({ + state: 'completed', + outcome: 'failure', + startedAt: 1_000, + completedAt: 3_000 + }) + // The duration "Worked for" shows under the turn's message. + expect( + completedStructuredAgentTurnSeconds(selectStructuredAgentRunningTurnTiming(rows, TURN)) + ).toBe(2) + }) +}) From 3eac4d93d3c31c018c08e48c849fe5d4ffc4cace Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:21:53 -0400 Subject: [PATCH 10/90] fix(terminal): stop guessing that apps died and wiping their keyboard modes (#23584) * fix(terminal): stop guessing that apps died and wiping their keyboard modes The renderer wiped xterm's Kitty keyboard flags on every Ctrl+C, every live reattach, and every Windows agent turn end, though the app usually survives. xterm then encoded keys in legacy form while the pane mirror Orca's shortcut policy reads still held the negotiated flags, so Cmd+C, Shift+Enter, Option/Alt and IME commits disagreed with each other and with the app. - Delete the Ctrl+C wipe, the ConPTY agent-idle wipe, and the mirror reset on every PTY exit (it also ran on unverified host-loss exits). - Live reattach profiles no longer reset Kitty; every replay epilogue instead re-asserts the mirror's flags (pop-all, then the host-proven set; a bare pop while unproven), so a revealed xterm gets the live app's flags back. - Route every renderer-originated mode write through one scanning writer so xterm and the mirror always parse the same bytes: confirmed-shell reset, hibernate, cold restore, and a full process-boundary ground at fresh spawn. - Read Kitty flags as 0 where the protocol is withheld (ConPTY), since xterm ignores CSI u there but the mirror still scans it. - The dashboard popout restores snapshot flags as bytes so its xterm agrees. * style(terminal): separate the kitty restore builder from the pen reset * fix(terminal): let the kitty mirror own the withheld-protocol rule Review follow-ups for the stop-guessing change: - The mirror takes a `kittyKeyboard` option from the xterm's advertisement and ignores CSI u when withheld, as xterm does, replacing a per-reader helper that any new reader could skip. Daemon/headless users keep the default. - Replay epilogues are writers (`writeReplayEpilogue`, `writeReattachReplayReset`) that take the sync or async xterm writer, so nothing that looks like a builder mutates the mirror. - An abandoned hidden restore re-asserts the mirror's kitty flags after the byte-gap reset: its discarded chunks were already scanned. - Tests pin a non-zero host restore (epilogue ends `=31u`, mirror 31), a withheld pane staying at 0, and the restart-in-place ground landing after the mirror reset; the epilogue test helper is now an exact builder. * refactor(terminal): one epilogue writer and one scanned ground per boundary - Reattach callers write `chooseReattachReplayReset(...)` through `writeReplayEpilogue`, dropping the second writer from the session. - Fresh spawn and cold restore rely on their scanned ground alone: it leaves the mirror known at 0 with a proven baseline, so the extra reset() was dead. --- src/main/daemon/daemon-pty-spawn-result.ts | 2 +- .../terminal-mode-rehydrate-sequences.ts | 8 +- src/main/providers/pty-spawn-result.ts | 4 +- .../AgentTerminalPreview.test.tsx | 8 +- .../dashboard-popout/AgentTerminalPreview.tsx | 11 +- .../preview-terminal-options.ts | 14 +- .../preview-terminal-snapshot-replay.test.ts | 4 +- .../preview-terminal-snapshot-replay.ts | 8 +- .../layout-serialization.test.ts | 3 +- ...-connection-daemon-snapshot-replay.test.ts | 9 +- .../pty-connection-fresh-spawn-guards.test.ts | 22 -- ...ty-connection-hidden-codex-queries.test.ts | 25 +- ...ction-hook-completion-side-effects.test.ts | 7 +- ...-connection-kitty-keyboard-restore.test.ts | 218 ++++++++++++++++++ ...pty-connection-parked-ssh-snapshot.test.ts | 3 +- ...pty-connection-reattach-mode-reset.test.ts | 45 ++-- ...connection-replay-payload-handling.test.ts | 10 +- ...-connection-stalled-hidden-restore.test.ts | 22 +- .../pty-connection-test-pane-fixtures.ts | 4 +- .../pty-connection-test-replay-epilogue.ts | 6 + ...-connection-windows-keyboard-reset.test.ts | 21 +- .../pty-connection/apply-reattach-payload.ts | 16 +- .../pty-connection/connect-pane-pty.ts | 18 +- .../pty-connection/direct-ssh-retry-status.ts | 9 - .../fresh-spawn-follow-reset.ts | 27 ++- .../pty-connection/fresh-spawn-start.ts | 9 +- .../hidden-output-restore-abandon.ts | 3 +- .../hidden-output-restore-drain.ts | 3 +- .../hidden-output-restore-snapshot.ts | 16 +- .../pty-connection/pane-agent-identity.ts | 17 +- .../pty-connection/pty-exit-hibernate.ts | 13 +- .../reattach-payload-context.test.ts | 5 +- .../reattach-payload-session.ts | 4 +- ...-payload-ssh-reconnect-model-paint.test.ts | 4 +- .../pty-connection/replay-data-drain.ts | 5 +- .../pty-connection/ssh-snapshot-prepaint.ts | 2 +- .../write-pty-output-to-xterm.ts | 3 +- .../terminal-pane-lifecycle-primitives.ts | 10 - .../terminal-pane/terminal-pane-pane-input.ts | 2 - .../terminal-replay-cursor-state.test.ts | 35 +-- .../use-terminal-pane-lifecycle.test.ts | 18 -- .../use-terminal-pane-lifecycle.ts | 1 - ...rminal-kitty-keyboard-mode-tracker.test.ts | 16 +- .../terminal-kitty-keyboard-mode-tracker.ts | 24 +- .../terminal-mode-reset-profiles.test.ts | 65 +++++- src/shared/terminal-mode-reset-profiles.ts | 24 +- .../terminal-kitty-reattach-parity.spec.ts | 119 ++++++++++ tests/e2e/terminal-shortcuts.spec.ts | 120 ++++++---- 48 files changed, 728 insertions(+), 314 deletions(-) create mode 100644 src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.ts create mode 100644 src/renderer/src/components/terminal-pane/pty-connection-test-replay-epilogue.ts create mode 100644 tests/e2e/terminal-kitty-reattach-parity.spec.ts diff --git a/src/main/daemon/daemon-pty-spawn-result.ts b/src/main/daemon/daemon-pty-spawn-result.ts index 5e799230fa1f..afc7315abcd3 100644 --- a/src/main/daemon/daemon-pty-spawn-result.ts +++ b/src/main/daemon/daemon-pty-spawn-result.ts @@ -289,7 +289,7 @@ export abstract class DaemonPtySpawnResult extends DaemonPtySpawnRequest { const snapshotPrefix = reattachSnapshot.scrollbackAnsi + reattachSnapshot.rehydrateSequences const snapshotFrame = reattachSnapshot.snapshotAnsi const snapshotPayload = snapshotPrefix + snapshotFrame - // Why kitty flags ride beside the payload, not inside it: the snapshot reaches renderer xterms where POST_REPLAY_REATTACH_RESET's kitty reset must win (terminal-query-authority.md §kitty). + // Why kitty flags ride beside the payload, not inside it: renderers re-assert them in the replay epilogue, after the payload's screen switches (terminal-query-authority.md §kitty). // Why known `0` is no longer dropped: the pane tracker must be able to tell // "the app negotiated nothing" from "this reattach proved nothing". const kittyKeyboardFlags = parseTerminalKittyKeyboardFlags( diff --git a/src/main/daemon/terminal-mode-rehydrate-sequences.ts b/src/main/daemon/terminal-mode-rehydrate-sequences.ts index ac4e34897b6c..8537de08961b 100644 --- a/src/main/daemon/terminal-mode-rehydrate-sequences.ts +++ b/src/main/daemon/terminal-mode-rehydrate-sequences.ts @@ -1,11 +1,9 @@ import type { TerminalModes } from './types' import { RESET_GRAPHIC_RENDITION } from '../../shared/terminal-mode-reset-profiles' -// Why no kitty flags here: rehydrateSequences feeds renderer xterms, and -// POST_REPLAY_REATTACH_RESET's deliberate kitty reset (stale CSI-u Ctrl+C -// hazard) must stay authoritative. modes.kittyKeyboardFlags exists for -// emulator re-seed parity only; a re-seeded emulator answers ?0u and -// protocol-conformant programs re-push. +// Why no kitty flags here: renderers re-assert the snapshot's kitty flags +// (carried beside the payload) in their replay epilogue, after these screen +// switches. A re-seeded emulator uses modes.kittyKeyboardFlags directly. export function buildRehydrateSequences(modes: TerminalModes): string { const seqs: string[] = [] if (modes.alternateScreen) { diff --git a/src/main/providers/pty-spawn-result.ts b/src/main/providers/pty-spawn-result.ts index 90b41d9656a6..2886a00e8b66 100644 --- a/src/main/providers/pty-spawn-result.ts +++ b/src/main/providers/pty-spawn-result.ts @@ -52,8 +52,8 @@ export type PtySpawnResult = { } /** Kitty keyboard flags persisted in the daemon snapshot, threaded so the * re-seeded runtime emulator answers hidden `CSI ? u` with the real flags - * (terminal-query-authority.md §kitty). Never replayed into a renderer - * xterm — POST_REPLAY_REATTACH_RESET's kitty reset stays authoritative. */ + * (terminal-query-authority.md §kitty). Renderers re-assert them in their + * replay epilogue, after the payload's screen switches. */ snapshotKittyKeyboardFlags?: number /** Renderer-domain sequence main reconciled for the attach boundary those * flags describe. Set by main, not the provider. */ diff --git a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx index 4a63a2895515..a40251967c4f 100644 --- a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx +++ b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx @@ -213,7 +213,8 @@ describe('AgentTerminalPreview', () => { expect(input).toHaveBeenCalledTimes(1) expect(input).toHaveBeenCalledWith('pty-1', 'k') - act(() => terminal.writeCallbacks.shift()?.()) + // Why drain all: the connection's kitty restore write queues ahead of the live chunk. + act(() => terminal.writeCallbacks.splice(0).forEach((callback) => callback())) expect(ack).toHaveBeenCalledWith('pty-1', 4) }) @@ -271,6 +272,11 @@ describe('AgentTerminalPreview', () => { render() await waitFor(() => expect(imeHarness.forwarders).toHaveLength(1)) await waitFor(() => expect(imeHarness.forwarders[0]!.getKittyKeyboardFlags()).toBe(8)) + // The popout xterm gets the same flags, so its encoder agrees with the mirror. + expect(terminalHarness.instances[0]!.write).toHaveBeenCalledWith( + '\x1b[<99u\x1b[=8u', + expect.any(Function) + ) // Live output keeps advancing the same mirror the forwarder reads. act(() => { diff --git a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.tsx b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.tsx index 59ed54f68d2b..875f13a96f4e 100644 --- a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.tsx +++ b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.tsx @@ -11,7 +11,8 @@ import { replayPreviewConnectionSnapshot } from './preview-terminal-snapshot-rep import { useEffectiveMacOptionAsAlt } from '@/lib/keyboard-layout/use-effective-mac-option-as-alt' import { buildPreviewAppearanceOptions, - buildPreviewTerminalOptions + buildPreviewTerminalOptions, + previewAdvertisesKittyKeyboard } from './preview-terminal-options' import { syncPreviewTerminalLigatures } from './preview-terminal-ligatures' import { installPreviewTerminalCompatibility } from './preview-terminal-compatibility' @@ -116,9 +117,13 @@ export function AgentTerminalPreview({ let disposeKeyHandler: (() => void) | null = null let disposeNativeCopyGutterTrim: (() => void) | null = null let disposeTerminalCompatibility: (() => void) | null = null + // Why one read: the xterm's advertisement and its mirror must never disagree. + const mountTerminalInput = terminalInputRef.current // Why: mirrors the pane's tracker — the policy needs the flags the TUI // negotiated, and this preview parses the same output stream the pane does. - const kittyKeyboardModes = new TerminalKittyKeyboardModeTracker() + const kittyKeyboardModes = new TerminalKittyKeyboardModeTracker({ + kittyKeyboard: previewAdvertisesKittyKeyboard(mountTerminalInput) + }) let refreshInFlight = false let refreshAgain = false let retryTimer: ReturnType | null = null @@ -254,7 +259,7 @@ export function AgentTerminalPreview({ terminal = new Terminal( buildPreviewTerminalOptions({ settings: settingsRef.current, - terminalInput: terminalInputRef.current, + terminalInput: mountTerminalInput, macOptionIsMeta: macOptionAsAltRef.current === 'true', theme: terminalTheme, themeMode: terminalMode, diff --git a/src/renderer/src/components/dashboard-popout/preview-terminal-options.ts b/src/renderer/src/components/dashboard-popout/preview-terminal-options.ts index c27f085029db..3bf324e385da 100644 --- a/src/renderer/src/components/dashboard-popout/preview-terminal-options.ts +++ b/src/renderer/src/components/dashboard-popout/preview-terminal-options.ts @@ -45,6 +45,13 @@ export function buildPreviewAppearanceOptions( } } +// Why: local ConPTY CLIs read the advertisement but can't decode CSI-u (#2434); mirror the pane's withhold. +export function previewAdvertisesKittyKeyboard( + terminalInput: DashboardCardTerminalInput | null +): boolean { + return !terminalInput || terminalInput.kittyKeyboardAdvertised +} + /** * Full option set for the preview's xterm: the same defaults, user appearance, * and host compatibility flags a pane resolves, so the agent's TUI negotiates @@ -65,10 +72,9 @@ export function buildPreviewTerminalOptions(args: { ...(args.terminalInput?.localWindowsConpty ? buildLocalConptyTerminalOptions(args.terminalInput.osRelease) : {}), - // Why: local ConPTY CLIs read the advertisement but can't decode CSI-u (#2434); mirror the pane's withhold. - ...(args.terminalInput && !args.terminalInput.kittyKeyboardAdvertised - ? { vtExtensions: { kittyKeyboard: false } } - : {}) + ...(previewAdvertisesKittyKeyboard(args.terminalInput) + ? {} + : { vtExtensions: { kittyKeyboard: false } }) } return { ...buildDefaultTerminalOptions(), diff --git a/src/renderer/src/components/dashboard-popout/preview-terminal-snapshot-replay.test.ts b/src/renderer/src/components/dashboard-popout/preview-terminal-snapshot-replay.test.ts index 3e288626259d..f3b3ed4f800c 100644 --- a/src/renderer/src/components/dashboard-popout/preview-terminal-snapshot-replay.test.ts +++ b/src/renderer/src/components/dashboard-popout/preview-terminal-snapshot-replay.test.ts @@ -110,7 +110,7 @@ describe('replayPreviewConnectionSnapshot', () => { expect(modes.snapshotFlags).toBe(0) }) - it('writes scrollback, frame, escape tail, then replay, in that order', () => { + it('writes scrollback, frame, kitty restore, escape tail, then replay, in that order', () => { const { written } = apply( { scrollbackAnsi: 'history', @@ -119,6 +119,6 @@ describe('replayPreviewConnectionSnapshot', () => { }, [{ data: 'tail', mode: 'live' }] ) - expect(written).toEqual(['history', 'frame', '\x1b[', 'tail']) + expect(written).toEqual(['history', 'frame', '\x1b[<99u', '\x1b[', 'tail']) }) }) diff --git a/src/renderer/src/components/dashboard-popout/preview-terminal-snapshot-replay.ts b/src/renderer/src/components/dashboard-popout/preview-terminal-snapshot-replay.ts index 43d4333cc172..9e684353eb73 100644 --- a/src/renderer/src/components/dashboard-popout/preview-terminal-snapshot-replay.ts +++ b/src/renderer/src/components/dashboard-popout/preview-terminal-snapshot-replay.ts @@ -1,5 +1,6 @@ import type { TerminalKittyKeyboardModeTracker } from '../../../../shared/terminal-kitty-keyboard-mode-tracker' import { parseTerminalKittyKeyboardFlags } from '../../../../shared/terminal-kitty-keyboard-flags' +import { buildKittyKeyboardRestore } from '../../../../shared/terminal-mode-reset-profiles' import type { TerminalPreviewReplayChunk, TerminalPreviewSnapshot @@ -7,7 +8,7 @@ import type { /** * Apply snapshot + buffered replay, restoring proven kitty flags after the - * snapshot scan (snapshot ANSI omits kitty pushes). Synchronous so no browser + * snapshot bytes (snapshot ANSI omits kitty pushes). Synchronous so no browser * event observes the temporary reset. */ export function replayPreviewConnectionSnapshot(args: { @@ -29,12 +30,11 @@ export function replayPreviewConnectionSnapshot(args: { if (snapshot.data) { args.write(snapshot.data, false) } + // Why as bytes: the popout xterm must parse the same restore its mirror scans. + args.write(buildKittyKeyboardRestore(provenFlags), false) if (snapshot.pendingEscapeTailAnsi) { args.write(snapshot.pendingEscapeTailAnsi, false) } - if (provenFlags !== undefined) { - kittyKeyboardModes.restoreSnapshotFlags(provenFlags) - } for (const chunk of args.replay) { args.write(chunk.data, chunk.mode === 'live') } diff --git a/src/renderer/src/components/terminal-pane/layout-serialization.test.ts b/src/renderer/src/components/terminal-pane/layout-serialization.test.ts index 8980c86ee8db..5835246ebaf9 100644 --- a/src/renderer/src/components/terminal-pane/layout-serialization.test.ts +++ b/src/renderer/src/components/terminal-pane/layout-serialization.test.ts @@ -38,7 +38,6 @@ import { POST_REPLAY_MODE_RESET, replayPayloadEndsWithCursorHidden, RESET_GRAPHIC_RENDITION, - RESET_KITTY_KEYBOARD_PROTOCOL, RESET_TERMINAL_CURSOR_STYLE } from '../../../../shared/terminal-mode-reset-profiles' import { @@ -462,7 +461,7 @@ describe('replayPayloadEndsWithCursorHidden', () => { describe('buildPostReplayLiveAgentReattachReset', () => { it('preserves an intentionally hidden cursor', () => { expect(buildPostReplayLiveAgentReattachReset('agent frame\x1b[?25l')).toBe( - `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}` + RESET_TERMINAL_CURSOR_STYLE ) }) diff --git a/src/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.test.ts index 2a20be955756..088c2c549052 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-daemon-snapshot-replay.test.ts @@ -6,6 +6,7 @@ import { POST_REPLAY_REATTACH_RESET, RESET_GRAPHIC_RENDITION } from '../../../../shared/terminal-mode-reset-profiles' +import { replayEpilogue } from './pty-connection-test-replay-epilogue' import { Terminal } from '@xterm/headless' import { flushAsyncTicks, createDeferred, writeHeadlessTerminal } from './pty-connection-test-async' import { createRect } from './pty-connection-test-dom' @@ -192,11 +193,11 @@ describe('connectPanePty', () => { expect.any(Function) ) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_REATTACH_RESET, + replayEpilogue(POST_REPLAY_REATTACH_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_MODE_RESET, + replayEpilogue(POST_REPLAY_MODE_RESET, 0), expect.any(Function) ) @@ -252,7 +253,7 @@ describe('connectPanePty', () => { await flushAsyncTicks(20) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_DEAD_TUI_RESET, + replayEpilogue(POST_REPLAY_DEAD_TUI_RESET), expect.any(Function) ) }) @@ -461,7 +462,7 @@ describe('connectPanePty', () => { expect(writes.join('')).toContain('RESTORE-LIVE-STATE') expect(writes.join('')).not.toContain('ALT-FRAME-BODY') expect(writes).toContain(`${RESET_GRAPHIC_RENDITION}PREFIX-SCROLLBACKRESTORE-LIVE-STATE`) - expect(writes).toContain(POST_REPLAY_MODE_RESET) + expect(writes).toContain(replayEpilogue(POST_REPLAY_MODE_RESET, 0)) }) it('resizes the pane to the snapshot grid before replaying daemon snapshot bytes (bug #7279)', async () => { diff --git a/src/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.test.ts index 02c99e2aa4b3..408ce503b7e3 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-fresh-spawn-guards.test.ts @@ -177,28 +177,6 @@ describe('connectPanePty', () => { ) }) - // Why: a late exit from a replaced PTY skips onExit's kitty reset, so a fresh spawn must reset the reused per-pane tracker itself or restart-in-place leaks old kitty flags. - it('resets a stale kitty keyboard mirror when spawning a fresh PTY', async () => { - const { connectPanePty } = await import('./pty-connection') - const { TerminalKittyKeyboardModeTracker } = - await import('../../../../shared/terminal-kitty-keyboard-mode-tracker') - const transport = createMockTransport() - transportFactoryQueue.push(transport) - const staleTracker = new TerminalKittyKeyboardModeTracker() - staleTracker.scan('\x1b[>1u') - expect(staleTracker.flags).toBe(1) - // Why: a unique tab id keeps this pane's key clear of other tests' pendingSpawnByPaneKey entries so the connect deterministically fresh-spawns. - const deps = createDeps({ - tabId: 'tab-kitty-fresh-spawn', - paneKittyKeyboardModesRef: { current: new Map([[91, staleTracker]]) } - }) - - connectPanePty(createPane(91) as never, createManager(91) as never, deps as never) - await flushAsyncTicks() - - expect(staleTracker.flags).toBe(0) - }) - // Why: deleting a worktree kills its PTYs for the filesystem teardown; the // renderer must not race a doomed respawn into a directory main is deleting // (main fences it with TerminalRemovalInProgressError and the pane is about to diff --git a/src/renderer/src/components/terminal-pane/pty-connection-hidden-codex-queries.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-hidden-codex-queries.test.ts index fe18699c20d5..e9443188b95b 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-hidden-codex-queries.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-hidden-codex-queries.test.ts @@ -6,6 +6,7 @@ import { POST_REPLAY_LIVE_SNAPSHOT_RESET, POST_REPLAY_REATTACH_RESET } from '../../../../shared/terminal-mode-reset-profiles' +import { replayEpilogue } from './pty-connection-test-replay-epilogue' import { makePaneKey } from '../../../../shared/stable-pane-id' import { flushAsyncTicks } from './pty-connection-test-async' import { @@ -520,15 +521,15 @@ describe('connectPanePty', () => { // A live agent owns ?1004h (focus reporting); the plain reset's ?1004l would silence focus events until restart, since agents only enable it at startup. expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_SNAPSHOT_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_SNAPSHOT_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_LIVE_SNAPSHOT_RESET, + replayEpilogue(POST_REPLAY_LIVE_SNAPSHOT_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_DEAD_TUI_RESET, + replayEpilogue(POST_REPLAY_DEAD_TUI_RESET), expect.any(Function) ) } finally { @@ -583,11 +584,11 @@ describe('connectPanePty', () => { await flushAsyncTicks(20) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_DEAD_TUI_RESET, + replayEpilogue(POST_REPLAY_DEAD_TUI_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_SNAPSHOT_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_SNAPSHOT_RESET), expect.any(Function) ) } finally { @@ -634,15 +635,15 @@ describe('connectPanePty', () => { await flushAsyncTicks(20) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_LIVE_SNAPSHOT_RESET, + replayEpilogue(POST_REPLAY_LIVE_SNAPSHOT_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_REATTACH_RESET, + replayEpilogue(POST_REPLAY_REATTACH_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_DEAD_TUI_RESET, + replayEpilogue(POST_REPLAY_DEAD_TUI_RESET), expect.any(Function) ) } finally { @@ -689,11 +690,11 @@ describe('connectPanePty', () => { await flushAsyncTicks(20) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_LIVE_SNAPSHOT_RESET, + replayEpilogue(POST_REPLAY_LIVE_SNAPSHOT_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_REATTACH_RESET, + replayEpilogue(POST_REPLAY_REATTACH_RESET), expect.any(Function) ) } finally { @@ -739,11 +740,11 @@ describe('connectPanePty', () => { await flushAsyncTicks(20) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_DEAD_TUI_RESET, + replayEpilogue(POST_REPLAY_DEAD_TUI_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_LIVE_SNAPSHOT_RESET, + replayEpilogue(POST_REPLAY_LIVE_SNAPSHOT_RESET), expect.any(Function) ) expect(window.api.pty.inspectProcess).not.toHaveBeenCalled() diff --git a/src/renderer/src/components/terminal-pane/pty-connection-hook-completion-side-effects.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-hook-completion-side-effects.test.ts index c3221a7753bf..2845be5a64d8 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-hook-completion-side-effects.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-hook-completion-side-effects.test.ts @@ -1,9 +1,6 @@ import type * as React from 'react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { - RESET_KITTY_KEYBOARD_PROTOCOL, - RESET_TERMINAL_CURSOR_STYLE -} from '../../../../shared/terminal-mode-reset-profiles' +import { RESET_TERMINAL_CURSOR_STYLE } from '../../../../shared/terminal-mode-reset-profiles' import { makePaneKey } from '../../../../shared/stable-pane-id' import { flushAsyncTicks } from './pty-connection-test-async' import { AGENT_TASK_COMPLETE_NOTIFICATION_MAX_WAIT_MS } from './pty-connection-test-constants' @@ -456,7 +453,7 @@ describe('connectPanePty', () => { expect(deps.dispatchNotification).toHaveBeenCalledWith(expectedNotification) } expect(pane.terminal.write).toHaveBeenCalledWith( - `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}`, + RESET_TERMINAL_CURSOR_STYLE, expect.any(Function) ) transport.sendInput.mockClear() diff --git a/src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.ts new file mode 100644 index 000000000000..4817dc8c17d3 --- /dev/null +++ b/src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.ts @@ -0,0 +1,218 @@ +import type * as React from 'react' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { + POST_REPLAY_REATTACH_RESET, + PROCESS_BOUNDARY_GROUND +} from '../../../../shared/terminal-mode-reset-profiles' +import { TerminalKittyKeyboardModeTracker } from '../../../../shared/terminal-kitty-keyboard-mode-tracker' +import { replayEpilogue } from './pty-connection-test-replay-epilogue' +import { flushAsyncTicks } from './pty-connection-test-async' +import { + LEAF_1, + createMockTransport, + createPane, + createManager, + type MockTransport +} from './pty-connection-test-pane-fixtures' +import { buildPaneConnectionDeps } from './pty-connection-test-deps' +import { createInitialStoreState } from './pty-connection-test-store-fixtures' +import type { StoreState } from './pty-connection-test-store-state' +import { + installTerminalTestGlobals, + restoreTerminalTestGlobals +} from './pty-connection-test-environment' + +const { + resetAndRefreshAllTerminalWebglAtlases, + scheduleTerminalWebglAtlasRecovery, + scheduleRuntimeGraphSync, + shouldSeedCacheTimerOnInitialTitle, + toastInfo, + notifyCodexPaneBoundForStaleSweep +} = vi.hoisted(() => ({ + resetAndRefreshAllTerminalWebglAtlases: vi.fn(), + scheduleTerminalWebglAtlasRecovery: vi.fn(), + scheduleRuntimeGraphSync: vi.fn(), + shouldSeedCacheTimerOnInitialTitle: vi.fn(() => false), + toastInfo: vi.fn(), + notifyCodexPaneBoundForStaleSweep: vi.fn() +})) + +let mockStoreState: StoreState +let transportFactoryQueue: MockTransport[] = [] +let createdTransportOptions: Record[] = [] +let storeSubscribers: ((state: StoreState) => void)[] = [] + +vi.mock('@/runtime/sync-runtime-graph', () => ({ + scheduleRuntimeGraphSync +})) + +vi.mock('@/lib/pane-manager/pane-manager-registry', async (importOriginal) => ({ + ...(await importOriginal>()), + resetAndRefreshAllTerminalWebglAtlases +})) + +vi.mock('./terminal-webgl-atlas-recovery', () => ({ + scheduleTerminalWebglAtlasRecovery +})) + +vi.mock('@/store', () => ({ + useAppStore: { + getState: () => mockStoreState, + subscribe: (listener: (state: StoreState) => void) => { + storeSubscribers.push(listener) + return () => { + storeSubscribers = storeSubscribers.filter((candidate) => candidate !== listener) + } + } + } +})) + +vi.mock('@/lib/agent-status', async (importOriginal) => { + const { buildAgentStatusModuleMock } = await import('./pty-connection-test-environment') + return buildAgentStatusModuleMock(await importOriginal>()) +}) + +vi.mock('./cache-timer-seeding', () => ({ + shouldSeedCacheTimerOnInitialTitle +})) + +vi.mock('sonner', () => ({ + toast: { + info: toastInfo + } +})) + +vi.mock('@/lib/codex-stale-pane-sweep', () => ({ + notifyCodexPaneBoundForStaleSweep +})) + +// Why: the working→idle test invokes the real useNotificationDispatch hook outside React, so useCallback must pass through (safe suite-wide: no test here renders React). +vi.mock('react', async (importOriginal) => { + const actual = await importOriginal() + return { + ...actual, + useCallback: unknown>(fn: T): T => fn + } +}) + +vi.mock('./pty-transport', () => ({ + createIpcPtyTransport: vi.fn((options: Record) => { + createdTransportOptions.push(options) + const nextTransport = transportFactoryQueue.shift() + if (!nextTransport) { + throw new Error('No mock transport queued') + } + return nextTransport + }) +})) + +vi.mock('./remote-runtime-pty-transport', () => ({ + createRemoteRuntimePtyTransport: vi.fn( + (_environmentId: string, options: Record) => { + createdTransportOptions.push(options) + const nextTransport = transportFactoryQueue.shift() + if (!nextTransport) { + throw new Error('No mock transport queued') + } + return nextTransport + } + ) +})) + +// Why: stub only getEagerPtyBufferHandle so tests can simulate a live eager buffer (adopt path) without standing up the real IPC dispatcher. +vi.mock('./pty-dispatcher', async (importOriginal) => { + const actual = await importOriginal>() + return { + ...actual, + getEagerPtyBufferHandle: vi.fn(() => undefined) + } +}) + +function createDeps(overrides: Record = {}) { + return buildPaneConnectionDeps(() => mockStoreState, overrides) +} + +// Why: xterm and the pane mirror must end every restore on the same kitty flags. +describe('connectPanePty kitty keyboard restore', () => { + beforeEach(() => { + vi.resetModules() + vi.clearAllMocks() + transportFactoryQueue = [] + createdTransportOptions = [] + storeSubscribers = [] + mockStoreState = createInitialStoreState(() => mockStoreState) + installTerminalTestGlobals() + }) + + afterEach(async () => { + await restoreTerminalTestGlobals() + }) + + async function reattachWithSnapshotFlags(kittyKeyboard: boolean) { + const { connectPanePty } = await import('./pty-connection') + const transport = createMockTransport('tab-pty') + transport.connect.mockImplementation(async ({ sessionId }: { sessionId?: string }) => + sessionId + ? { + id: sessionId, + snapshot: 'live app frame', + snapshotKittyKeyboardFlags: 31, + snapshotSeq: 7 + } + : null + ) + transportFactoryQueue.push(transport) + const pane = createPane(1) + pane.terminal.options.vtExtensions.kittyKeyboard = kittyKeyboard + const deps = createDeps({ + restoredLeafId: LEAF_1, + restoredPtyIdByLeafId: { [LEAF_1]: 'tab-pty' } + }) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: pane-connection mocks cover the members connectPanePty reads. + connectPanePty(pane as never, createManager(1) as never, deps as never) + await flushAsyncTicks(20) + return { pane, mirror: deps.paneKittyKeyboardModesRef.current.get(pane.id) } + } + + it("restores a live app's host-proven flags into xterm and the mirror on reattach", async () => { + const { pane, mirror } = await reattachWithSnapshotFlags(true) + + expect(pane.terminal.write).toHaveBeenCalledWith( + `${POST_REPLAY_REATTACH_RESET}\x1b[<99u\x1b[=31u`, + expect.any(Function) + ) + expect(mirror?.flags).toBe(31) + }) + + // Why: xterm ignores CSI u while the protocol is withheld (ConPTY), so its mirror must too. + it('keeps a withheld-protocol pane at 0 in both records despite host flags', async () => { + const { pane, mirror } = await reattachWithSnapshotFlags(false) + + expect(pane.terminal.write).toHaveBeenCalledWith( + replayEpilogue(POST_REPLAY_REATTACH_RESET), + expect.any(Function) + ) + expect(mirror?.flags).toBe(0) + }) + + it('grounds xterm and the mirror with one scanned write before a restart-in-place spawns', async () => { + const { connectPanePty } = await import('./pty-connection') + transportFactoryQueue.push(createMockTransport()) + const pane = createPane(91) + // Why: a unique tab id keeps this pane's key clear of other tests' pendingSpawnByPaneKey entries so the connect deterministically fresh-spawns. + const deps = createDeps({ tabId: 'tab-kitty-fresh-spawn' }) + // The pane's previous occupant left the alternate screen and kitty flags on. + const mirror = new TerminalKittyKeyboardModeTracker() + mirror.scan('\x1b[?1049h\x1b[>5u') + deps.paneKittyKeyboardModesRef.current.set(pane.id, mirror) + + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: pane-connection mocks cover the members connectPanePty reads. + connectPanePty(pane as never, createManager(91) as never, deps as never) + await flushAsyncTicks(20) + + expect(pane.terminal.write).toHaveBeenCalledWith(PROCESS_BOUNDARY_GROUND, expect.any(Function)) + expect(mirror.snapshotFlags).toBe(0) + expect(mirror.isAlternateScreen).toBe(false) + }) +}) diff --git a/src/renderer/src/components/terminal-pane/pty-connection-parked-ssh-snapshot.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-parked-ssh-snapshot.test.ts index 39191d5d36a6..840437719085 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-parked-ssh-snapshot.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-parked-ssh-snapshot.test.ts @@ -4,6 +4,7 @@ import { POST_REPLAY_REATTACH_RESET, RESET_GRAPHIC_RENDITION } from '../../../../shared/terminal-mode-reset-profiles' +import { replayEpilogue } from './pty-connection-test-replay-epilogue' import { toAppSshPtyId } from '../../../../shared/ssh-pty-id' import type { SshConnectionState } from '../../../../shared/ssh-types' import { flushAsyncTicks, createDeferred } from './pty-connection-test-async' @@ -209,7 +210,7 @@ describe('connectPanePty', () => { // Why: the relay's replay buffer holds full history, so clear xterm before writing to avoid duplicating prior-session content. expect(writes).toContain(`${RESET_GRAPHIC_RENDITION}\x1b[2J\x1b[3J\x1b[H`) expect(writes).toContain('restored-ssh-output') - expect(writes).toContain(POST_REPLAY_REATTACH_RESET) + expect(writes).toContain(replayEpilogue(POST_REPLAY_REATTACH_RESET)) expect(api.pty.signal).toHaveBeenCalledWith('leaf-session', 'SIGWINCH') }) diff --git a/src/renderer/src/components/terminal-pane/pty-connection-reattach-mode-reset.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-reattach-mode-reset.test.ts index 1e8ad402de7b..6c22586b59f2 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-reattach-mode-reset.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-reattach-mode-reset.test.ts @@ -7,9 +7,9 @@ import { POST_REPLAY_REATTACH_RESET, POST_REPLAY_REATTACH_RESET_KEEP_MOUSE, RESET_GRAPHIC_RENDITION, - RESET_KITTY_KEYBOARD_PROTOCOL, RESET_TERMINAL_CURSOR_STYLE } from '../../../../shared/terminal-mode-reset-profiles' +import { replayEpilogue } from './pty-connection-test-replay-epilogue' import { flushAsyncTicks } from './pty-connection-test-async' import { withMockedDocumentActiveElement, @@ -371,7 +371,7 @@ describe('connectPanePty', () => { expect(transport.sendInput).toHaveBeenCalledWith('\x1b[I', 'query-reply') // Snapshot ends with ?25l (Cursor Agent parks/hides the cursor); the reset must preserve it, not force ?25h, or a stray block paints. expect(pane.terminal.write).toHaveBeenCalledWith( - `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}`, + replayEpilogue(RESET_TERMINAL_CURSOR_STYLE), expect.any(Function) ) const writes = (pane.terminal.write as ReturnType).mock.calls.map( @@ -411,11 +411,11 @@ describe('connectPanePty', () => { await flushAsyncTicks(20) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_DEAD_TUI_RESET, + replayEpilogue(POST_REPLAY_DEAD_TUI_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_REATTACH_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), expect.any(Function) ) }) @@ -459,8 +459,8 @@ describe('connectPanePty', () => { expect(writes).toContain( `${RESET_GRAPHIC_RENDITION}\x1b[?1003h\x1b[?1006h\x1b[?2004huser@host ~ $ ` ) - expect(writes).toContain(POST_REPLAY_MODE_RESET) - expect(writes).not.toContain(POST_REPLAY_LIVE_AGENT_REATTACH_RESET) + expect(writes).toContain(replayEpilogue(POST_REPLAY_MODE_RESET, 0)) + expect(writes).not.toContain(replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET)) }) }) @@ -512,11 +512,11 @@ describe('connectPanePty', () => { ) const output = writes.join('') const snapshotIndex = output.indexOf('\x1b[?1003h\x1b[?1006h\x1b[?2004huser@host ~ $ ') - const resetIndex = output.indexOf(POST_REPLAY_MODE_RESET) + const resetIndex = output.indexOf(replayEpilogue(POST_REPLAY_MODE_RESET, 0)) expect(snapshotIndex).toBeGreaterThanOrEqual(0) expect(resetIndex).toBeGreaterThan(snapshotIndex) - expect(writes).toContain(POST_REPLAY_MODE_RESET) - expect(writes).not.toContain(POST_REPLAY_LIVE_AGENT_REATTACH_RESET) + expect(writes).toContain(replayEpilogue(POST_REPLAY_MODE_RESET, 0)) + expect(writes).not.toContain(replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET)) }) }) @@ -547,7 +547,7 @@ describe('connectPanePty', () => { await flushAsyncTicks(20) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_REATTACH_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), expect.any(Function) ) }) @@ -581,7 +581,7 @@ describe('connectPanePty', () => { expect(transport.sendInput).not.toHaveBeenCalledWith('\x1b[I') expect(pane.terminal.write).toHaveBeenCalledWith( - `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}`, + replayEpilogue(RESET_TERMINAL_CURSOR_STYLE), expect.any(Function) ) }) @@ -614,11 +614,11 @@ describe('connectPanePty', () => { expect(transport.sendInput).not.toHaveBeenCalledWith('\x1b[I') expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_REATTACH_RESET, + replayEpilogue(POST_REPLAY_REATTACH_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_REATTACH_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), expect.any(Function) ) }) @@ -650,7 +650,8 @@ describe('connectPanePty', () => { .map((call) => String(call[0])) .find( (data) => - data === POST_REPLAY_REATTACH_RESET || data === POST_REPLAY_REATTACH_RESET_KEEP_MOUSE + data === replayEpilogue(POST_REPLAY_REATTACH_RESET) || + data === replayEpilogue(POST_REPLAY_REATTACH_RESET_KEEP_MOUSE) ) }) } @@ -658,12 +659,12 @@ describe('connectPanePty', () => { it('keeps mouse reporting when a reattach snapshot restores a live alternate-screen TUI', async () => { await expect( reattachSnapshotResetFor('\x1b[?1049h\x1b[?1002h\x1b[?1006hthird-party tui session') - ).resolves.toBe(POST_REPLAY_REATTACH_RESET_KEEP_MOUSE) + ).resolves.toBe(replayEpilogue(POST_REPLAY_REATTACH_RESET_KEEP_MOUSE)) }) it('still disarms mouse reporting when a reattach snapshot ends on the normal buffer', async () => { await expect(reattachSnapshotResetFor('\x1b[?1003h\x1b[?1006hdead tui residue')).resolves.toBe( - POST_REPLAY_REATTACH_RESET + replayEpilogue(POST_REPLAY_REATTACH_RESET) ) }) @@ -703,11 +704,11 @@ describe('connectPanePty', () => { expect(transport.sendInput).not.toHaveBeenCalledWith('\x1b[I') expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_REATTACH_RESET, + replayEpilogue(POST_REPLAY_REATTACH_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_REATTACH_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), expect.any(Function) ) }) @@ -741,11 +742,11 @@ describe('connectPanePty', () => { expect(transport.sendInput).not.toHaveBeenCalledWith('\x1b[I') expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_REATTACH_RESET, + replayEpilogue(POST_REPLAY_REATTACH_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_REATTACH_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), expect.any(Function) ) }) @@ -782,11 +783,11 @@ describe('connectPanePty', () => { expect(transport.sendInput).not.toHaveBeenCalledWith('\x1b[I') expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_REATTACH_RESET, + replayEpilogue(POST_REPLAY_REATTACH_RESET), expect.any(Function) ) expect(pane.terminal.write).not.toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_REATTACH_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), expect.any(Function) ) }) diff --git a/src/renderer/src/components/terminal-pane/pty-connection-replay-payload-handling.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-replay-payload-handling.test.ts index a83236b5378c..dbcc67fa47ec 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-replay-payload-handling.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-replay-payload-handling.test.ts @@ -3,9 +3,9 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { POST_REPLAY_LIVE_AGENT_REATTACH_RESET, POST_REPLAY_REATTACH_RESET, - RESET_KITTY_KEYBOARD_PROTOCOL, RESET_TERMINAL_CURSOR_STYLE } from '../../../../shared/terminal-mode-reset-profiles' +import { replayEpilogue } from './pty-connection-test-replay-epilogue' import { flushAsyncTicks } from './pty-connection-test-async' import { NORMAL_BUFFER_PROLOGUE, @@ -397,7 +397,7 @@ describe('connectPanePty', () => { await flushAsyncTicks(12) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_REATTACH_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), expect.any(Function) ) expect(transport.sendInput).toHaveBeenCalledWith('\x1b[I', 'query-reply') @@ -437,7 +437,7 @@ describe('connectPanePty', () => { await flushAsyncTicks(12) expect(pane.terminal.write).toHaveBeenCalledWith( - POST_REPLAY_LIVE_AGENT_REATTACH_RESET, + replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), expect.any(Function) ) return connection @@ -514,7 +514,7 @@ describe('connectPanePty', () => { await flushAsyncTicks(12) expect(pane.terminal.write).toHaveBeenCalledWith( - `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}`, + replayEpilogue(RESET_TERMINAL_CURSOR_STYLE), expect.any(Function) ) expect(pane.terminal.write).toHaveBeenCalledWith('\x1b[?25h\x1b[?1004l', expect.any(Function)) @@ -673,7 +673,7 @@ describe('connectPanePty', () => { await flushAsyncTicks(8) const replayIndex = writes.indexOf('authoritative replay') - const resetIndex = writes.indexOf(POST_REPLAY_REATTACH_RESET) + const resetIndex = writes.indexOf(replayEpilogue(POST_REPLAY_REATTACH_RESET)) const liveIndex = writes.indexOf('NEWER-LIVE\r\n') expect(replayIndex).toBeGreaterThan(0) expect(resetIndex).toBeGreaterThan(replayIndex) diff --git a/src/renderer/src/components/terminal-pane/pty-connection-stalled-hidden-restore.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-stalled-hidden-restore.test.ts index d4c2ffd6745f..a0f06268e971 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-stalled-hidden-restore.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-stalled-hidden-restore.test.ts @@ -1,6 +1,9 @@ import type * as React from 'react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { RESET_AFTER_BYTE_GAP } from '../../../../shared/terminal-mode-reset-profiles' +import { + buildKittyKeyboardRestore, + RESET_AFTER_BYTE_GAP +} from '../../../../shared/terminal-mode-reset-profiles' import { flushAsyncTicks, createDeferred } from './pty-connection-test-async' import { NORMAL_BUFFER_PROLOGUE } from './pty-connection-test-constants' import { @@ -18,6 +21,9 @@ import { restoreTerminalTestGlobals } from './pty-connection-test-environment' +// An abandon re-asserts the (known-zero) mirror's kitty flags after grounding the gap. +const ABANDONED_RESTORE_GAP = `${RESET_AFTER_BYTE_GAP}${buildKittyKeyboardRestore(0)}` + const { resetAndRefreshAllTerminalWebglAtlases, scheduleTerminalWebglAtlasRecovery, @@ -206,10 +212,10 @@ describe('connectPanePty', () => { const warningIndex = written.findIndex((data) => data.includes('main recovery was unavailable')) const combinedLiveIndex = written.indexOf(firstLive + secondLive) expect(warningIndex).toBeGreaterThanOrEqual(0) - expect(written[warningIndex - 1]).toBe(RESET_AFTER_BYTE_GAP) + expect(written[warningIndex - 1]).toBe(ABANDONED_RESTORE_GAP) // Exactly one: writeRestoreUnavailableWarning already grounds the gap, so a // second unconditional write here was pure duplication. - expect(written.filter((data) => data === RESET_AFTER_BYTE_GAP)).toHaveLength(1) + expect(written.filter((data) => data === ABANDONED_RESTORE_GAP)).toHaveLength(1) expect(combinedLiveIndex).toBeGreaterThan(warningIndex) snapshot.resolve({ @@ -276,7 +282,7 @@ describe('connectPanePty', () => { await flushAsyncTicks(10) const written = pane.terminal.write.mock.calls.map(([data]) => data as string) - const resetIndex = written.indexOf(RESET_AFTER_BYTE_GAP) + const resetIndex = written.indexOf(ABANDONED_RESTORE_GAP) const liveIndex = written.findIndex((data) => data.includes('live-after-reveal')) expect(resetIndex).toBeGreaterThanOrEqual(0) expect(liveIndex).toBeGreaterThanOrEqual(0) @@ -319,13 +325,13 @@ describe('connectPanePty', () => { await flushAsyncTicks(10) const written = pane.terminal.write.mock.calls.map(([data]) => data as string) - const resetIndex = written.indexOf(RESET_AFTER_BYTE_GAP) + const resetIndex = written.indexOf(ABANDONED_RESTORE_GAP) const liveIndex = written.indexOf(live) expect(resetIndex).toBeGreaterThanOrEqual(0) expect(liveIndex).toBeGreaterThan(resetIndex) // The re-arm arm grounds in rearmRemoteHiddenOutputRestoreInsteadOfWarning, // so the abandon body must not ground a second time. - expect(written.filter((data) => data === RESET_AFTER_BYTE_GAP)).toHaveLength(1) + expect(written.filter((data) => data === ABANDONED_RESTORE_GAP)).toHaveLength(1) expect(written.join('')).not.toContain('main recovery was unavailable') disposable.dispose() @@ -383,8 +389,8 @@ describe('connectPanePty', () => { expect(liveIndex).toBeGreaterThan(warningIndex) // This arm gives up on recovery too, so the gap is grounded exactly once // before the blocked foreground is drained under it. - expect(written.filter((data) => data === RESET_AFTER_BYTE_GAP)).toHaveLength(1) - expect(written.indexOf(RESET_AFTER_BYTE_GAP)).toBeLessThan(liveIndex) + expect(written.filter((data) => data === ABANDONED_RESTORE_GAP)).toHaveLength(1) + expect(written.indexOf(ABANDONED_RESTORE_GAP)).toBeLessThan(liveIndex) disposable.dispose() }) diff --git a/src/renderer/src/components/terminal-pane/pty-connection-test-pane-fixtures.ts b/src/renderer/src/components/terminal-pane/pty-connection-test-pane-fixtures.ts index c91c51f789e9..302efe743bb0 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-test-pane-fixtures.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-test-pane-fixtures.ts @@ -103,6 +103,7 @@ export type MockPaneTerminal = { scrollback: number ignoreBracketedPasteMode: boolean theme: { foreground: string; background: string } + vtExtensions: { kittyKeyboard: boolean } } write: Mock<(data: string, callback?: () => void) => void> resize: Mock<(cols: number, rows: number) => void> @@ -162,7 +163,8 @@ export function createPane(paneId: number): MockPane { theme: { foreground: '#eeeeee', background: '#111111' - } + }, + vtExtensions: { kittyKeyboard: true } }, write: vi.fn<(data: string, callback?: () => void) => void>(function write(...args): void { const [data, callback] = args diff --git a/src/renderer/src/components/terminal-pane/pty-connection-test-replay-epilogue.ts b/src/renderer/src/components/terminal-pane/pty-connection-test-replay-epilogue.ts new file mode 100644 index 000000000000..56b4c5152497 --- /dev/null +++ b/src/renderer/src/components/terminal-pane/pty-connection-test-replay-epilogue.ts @@ -0,0 +1,6 @@ +import { buildKittyKeyboardRestore } from '../../../../shared/terminal-mode-reset-profiles' + +/** A post-replay reset: the profile, then the mirror's kitty restore (a bare pop while unproven). */ +export function replayEpilogue(profile: string, provenFlags?: number): string { + return `${profile}${buildKittyKeyboardRestore(provenFlags)}` +} diff --git a/src/renderer/src/components/terminal-pane/pty-connection-windows-keyboard-reset.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-windows-keyboard-reset.test.ts index 552f62c54bb3..22ef4f6618a2 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-windows-keyboard-reset.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-windows-keyboard-reset.test.ts @@ -182,7 +182,7 @@ describe('connectPanePty', () => { ) }) - it('resets stale keyboard state when a native Windows agent becomes idle', async () => { + it('keeps kitty keyboard state when a native Windows agent becomes idle', async () => { const restoreUserAgent = temporarilySetNavigatorUserAgent( 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' ) @@ -206,7 +206,12 @@ describe('connectPanePty', () => { idleHandler('* Codex done') + // Why: a finished turn is not a dead app; its kitty flags stay until the host sees it exit. expect(pane.terminal.write).toHaveBeenCalledWith( + RESET_TERMINAL_CURSOR_STYLE, + expect.any(Function) + ) + expect(pane.terminal.write).not.toHaveBeenCalledWith( `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}`, expect.any(Function) ) @@ -318,7 +323,7 @@ describe('connectPanePty', () => { } ) - it('resets stale keyboard state when native Windows hook status reaches done', async () => { + it('resets cursor style when native Windows hook status reaches done', async () => { const restoreUserAgent = temporarilySetNavigatorUserAgent( 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' ) @@ -359,7 +364,7 @@ describe('connectPanePty', () => { notifyStoreSubscribers() expect(pane.terminal.write).toHaveBeenCalledWith( - `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}`, + RESET_TERMINAL_CURSOR_STYLE, expect.any(Function) ) } finally { @@ -367,7 +372,7 @@ describe('connectPanePty', () => { } }) - it('resets stale keyboard state when a batched done→working→done burst lands as one publication', async () => { + it('resets cursor style when a batched done→working→done burst lands as one publication', async () => { const restoreUserAgent = temporarilySetNavigatorUserAgent( 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' ) @@ -413,7 +418,7 @@ describe('connectPanePty', () => { notifyStoreSubscribers() expect(pane.terminal.write).toHaveBeenCalledWith( - `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}`, + RESET_TERMINAL_CURSOR_STYLE, expect.any(Function) ) } finally { @@ -421,7 +426,7 @@ describe('connectPanePty', () => { } }) - it('resets stale keyboard state when a batched burst ends on working after a completed turn', async () => { + it('resets cursor style when a batched burst ends on working after a completed turn', async () => { const restoreUserAgent = temporarilySetNavigatorUserAgent( 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' ) @@ -464,7 +469,7 @@ describe('connectPanePty', () => { notifyStoreSubscribers() expect(pane.terminal.write).toHaveBeenCalledWith( - `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}`, + RESET_TERMINAL_CURSOR_STYLE, expect.any(Function) ) } finally { @@ -472,7 +477,7 @@ describe('connectPanePty', () => { } }) - it('keeps native Windows same-turn done repaints from re-resetting keyboard state', async () => { + it('keeps native Windows same-turn done repaints from re-resetting cursor style', async () => { const restoreUserAgent = temporarilySetNavigatorUserAgent( 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' ) diff --git a/src/renderer/src/components/terminal-pane/pty-connection/apply-reattach-payload.ts b/src/renderer/src/components/terminal-pane/pty-connection/apply-reattach-payload.ts index 1eabdf990327..e8f8e7c1a087 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/apply-reattach-payload.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/apply-reattach-payload.ts @@ -91,8 +91,8 @@ export function createReattachPayloadHandlers( : daemonSnapshotReplay }` ) - session.writeReplayData( - session.reattachReplayResetSequence( + session.writeReplayEpilogue( + session.chooseReattachReplayReset( daemonSnapshotReplay, Boolean(ctx.connectResult.coldRestore), ctx.connectResult.isAlternateScreen, @@ -198,8 +198,8 @@ export function createReattachPayloadHandlers( })) { session.writeReplayData(replayChunk) } - session.writeReplayData( - session.reattachReplayResetSequence( + session.writeReplayEpilogue( + session.chooseReattachReplayReset( modelData, Boolean(ctx.connectResult?.coldRestore), modelSnapshot.alternateScreen ?? ctx.connectResult?.isAlternateScreen, @@ -237,8 +237,8 @@ export function createReattachPayloadHandlers( session.writeReplayData( `${ctx.connectResult.coldRestore ? RESET_GRAPHIC_RENDITION : ''}${ctx.connectResult.replay}` ) - session.writeReplayData( - session.reattachReplayResetSequence( + session.writeReplayEpilogue( + session.chooseReattachReplayReset( ctx.connectResult.replay, Boolean(ctx.connectResult.coldRestore), ctx.connectResult.isAlternateScreen @@ -305,9 +305,7 @@ export function createReattachPayloadHandlers( session.clearSleepingRecordAfterColdRestoreSpawn(preparedStartup) } // Why: cold-restore spawned a fresh shell; reset mode bytes a crashed TUI (e.g. Claude's \e[?1004h) left in scrollback that no live TUI now consumes. - session.writeReplayData(POST_REPLAY_MODE_RESET) - // Why: the dead run's kitty flags died with it and its scrollback was never scanned — the fresh shell starts at zero. - session.kittyKeyboardModes.reset() + session.writeInputModeGround(POST_REPLAY_MODE_RESET) session.consumeRestoredViewportBlankingMarker() // Why: a taller destination fit must not pull recovered rows back into the fresh shell's viewport after source-grid replay. session.writeFreshShellViewportBlanking(Math.max(destinationRows, session.pane.terminal.rows)) diff --git a/src/renderer/src/components/terminal-pane/pty-connection/connect-pane-pty.ts b/src/renderer/src/components/terminal-pane/pty-connection/connect-pane-pty.ts index 1c43f40b0b48..8c560ce30bd0 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/connect-pane-pty.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/connect-pane-pty.ts @@ -114,10 +114,6 @@ export function connectPanePty( session.remoteOutputGatedPtyId = null session.remoteOutputFactConsumerPtyId = null session.suppressViewportClaimTerminalResize = false - // Why: idle callbacks are registered before the deferred PTY output plumbing - // exists. Start with the shared scheduler, then switch to the PTY writer - // below so hidden-tab resets keep backlog-recovery callbacks and byte order. - session.idleAgentTerminalModeReset = RESET_TERMINAL_CURSOR_STYLE session.suppressNativeWindowsIdleCodexFocusReports = false session.setFocusReportSuppressionForAgentCompletion = ( title: string | undefined, @@ -127,11 +123,14 @@ export function connectPanePty( session.suppressNativeWindowsIdleCodexFocusReports = agentType && agentType !== 'unknown' ? agentType === 'codex' : titleAgentType === 'codex' } + // Why: idle callbacks are registered before the deferred PTY output plumbing + // exists. Start with the shared scheduler, then switch to the PTY writer + // so hidden-tab resets keep backlog-recovery callbacks and byte order. session.queueAgentIdleTerminalModeReset = (): void => { if (session.disposed) { return } - writeTerminalOutput(session.pane.terminal, session.idleAgentTerminalModeReset, { + writeTerminalOutput(session.pane.terminal, RESET_TERMINAL_CURSOR_STYLE, { foreground: shouldWritePtyOutputForeground(session.deps.isVisibleRef.current) }) } @@ -162,15 +161,16 @@ export function connectPanePty( // Why: paneKey crosses PTY env, hook IPC, retained rows, and reload/replay. // Use the stable layout leaf UUID, not the renderer-local numeric pane id. session.cacheKey = makePaneKey(session.deps.tabId, session.pane.leafId) - // Why: mirrors the kitty keyboard flags the pane's application negotiates, - // so it still reflects what a live application expects after the renderer's - // defensive kitty wipes; see TerminalKittyKeyboardModeTracker for its feeds. + // Why: xterm exposes no kitty read, so this mirror tracks the flags xterm's + // encoder applies; see TerminalKittyKeyboardModeTracker for its feeds. session.kittyKeyboardModes = (() => { const existing = session.deps.paneKittyKeyboardModesRef.current.get(session.pane.id) if (existing) { return existing } - const created = new TerminalKittyKeyboardModeTracker() + const created = new TerminalKittyKeyboardModeTracker({ + kittyKeyboard: session.pane.terminal.options.vtExtensions?.kittyKeyboard === true + }) session.deps.paneKittyKeyboardModesRef.current.set(session.pane.id, created) return created })() diff --git a/src/renderer/src/components/terminal-pane/pty-connection/direct-ssh-retry-status.ts b/src/renderer/src/components/terminal-pane/pty-connection/direct-ssh-retry-status.ts index 67fd09bcc59b..a494d08fc806 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/direct-ssh-retry-status.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/direct-ssh-retry-status.ts @@ -6,10 +6,6 @@ import { hasCachedWindowsTerminalCapabilities } from '@/lib/windows-terminal-capabilities' import { requestTerminalWritePipelineProbe } from '@/lib/pane-manager/terminal-write-pipeline-health' -import { - RESET_KITTY_KEYBOARD_PROTOCOL, - RESET_TERMINAL_CURSOR_STYLE -} from '../../../../../shared/terminal-mode-reset-profiles' import { subscribeToTerminalUserInput } from '../terminal-user-input-signal' import { isLocalNativeWindowsConpty, @@ -86,11 +82,6 @@ export function installDirectSshRetryStatus(session: ConnectPanePtySession): voi ), executionHostId: session.executionHostId }) - if (session.isNativeWindowsConpty) { - // Why: Windows ConPTY agent turns can leave renderer keyboard modes armed - // after completion, corrupting plain input with encoded bytes. - session.idleAgentTerminalModeReset = `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}` - } session.shouldApplyNativeWindowsRewriteRefresh = session.isNativeWindowsConpty session.shouldApplyWindowsRendererUnicodeRefresh = CLIENT_PLATFORM === 'win32' session.shouldProtectNativeWindowsSynchronizedOutput = session.isNativeWindowsConpty diff --git a/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-follow-reset.ts b/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-follow-reset.ts index 83ab2e3f478a..cb553ebc7deb 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-follow-reset.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-follow-reset.ts @@ -5,7 +5,8 @@ import { POST_REPLAY_DEAD_TUI_RESET, POST_REPLAY_MODE_RESET, POST_REPLAY_REATTACH_RESET, - POST_REPLAY_REATTACH_RESET_KEEP_MOUSE + POST_REPLAY_REATTACH_RESET_KEEP_MOUSE, + buildKittyKeyboardRestore } from '../../../../../shared/terminal-mode-reset-profiles' import { buildFreshShellViewportBlankingSequence } from '../terminal-restored-viewport' import { flushTerminalOutput } from '@/lib/pane-manager/pane-terminal-output-scheduler' @@ -129,7 +130,29 @@ export function bindFreshSpawnFollowReset(session: ConnectPanePtySession): void }) } - session.reattachReplayResetSequence = ( + // Why one writer: the kitty mirror and xterm must parse every renderer-originated mode byte alike. + session.writeInputModeGround = (data: string): void => { + session.kittyKeyboardModes.scan(data) + session.writeReplayData(data) + } + + /** + * Writes a post-replay reset ending in the mirror's Kitty flags, through the + * mirror first. The restore is built after scanning the profile because its + * `?1049l` moves both records to the other screen's slot. + */ + session.writeReplayEpilogue = ( + profile: string, + write: (data: string) => T = session.writeReplayData + ): T => { + session.kittyKeyboardModes.scan(profile) + const kitty = buildKittyKeyboardRestore(session.kittyKeyboardModes.snapshotFlags) + session.kittyKeyboardModes.scan(kitty) + return write(`${profile}${kitty}`) + } + + /** Picks the post-replay reset profile for a reattach; the caller writes it via writeReplayEpilogue. */ + session.chooseReattachReplayReset = ( payload: string, ownerProcessEnded = false, isAlternateScreen?: boolean, diff --git a/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-start.ts b/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-start.ts index 29bc438a01cd..b260adcccb8c 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-start.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/fresh-spawn-start.ts @@ -1,4 +1,5 @@ import { useAppStore } from '@/store' +import { PROCESS_BOUNDARY_GROUND } from '../../../../../shared/terminal-mode-reset-profiles' import { hasPtySerializer } from '../pty-buffer-serializer' import { writeTerminalOutput } from '@/lib/pane-manager/pane-terminal-output-scheduler' @@ -52,11 +53,9 @@ export function bindStartFreshSpawn(session: ConnectPanePtySession): void { // Why: a canceled old replay clear can preserve xterm's native // isUserScrolling flag. A replacement shell must start in follow mode. session.resetFreshSpawnFollowOutput() - // Why: a fresh spawn is a new process with kitty keyboard flags at - // zero. The exit-handler reset alone is not enough: a late exit from a - // replaced PTY takes the stale-transport early return and skips it, so - // a restart-in-place would leak the old TUI's flags into a fresh shell. - session.kittyKeyboardModes.reset() + // Why: a fresh spawn is a new process, so a restart-in-place must not + // inherit the old TUI's screen, mouse or kitty modes in xterm or the mirror. + session.writeInputModeGround(PROCESS_BOUNDARY_GROUND) session.prepareFreshShellViewportForSpawn(options) const coldRestoreOverride = startupOverride && 'launchConfig' in startupOverride diff --git a/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-abandon.ts b/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-abandon.ts index 3d08e5d495b4..3e30289c2f68 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-abandon.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-abandon.ts @@ -1,4 +1,3 @@ -import { RESET_AFTER_BYTE_GAP } from '../../../../../shared/terminal-mode-reset-profiles' import { cancelScheduledHiddenOutputRestore } from '../hidden-output-restore-scheduler' import type { ConnectPanePtySession } from './connect-pane-pty-session' @@ -62,7 +61,7 @@ export function bindAbandonHiddenOutputRestore(session: ConnectPanePtySession): // session.rearmRemoteHiddenOutputRestoreInsteadOfWarning. Only the quiet // flood-abandon reaches neither, and it still drains chunks below. else if (!rearmedRemoteRestore) { - session.writePtyOutputToXterm(RESET_AFTER_BYTE_GAP, true) + session.writeAbandonedRestoreGap() } if (hadPendingOverflow) { return diff --git a/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-drain.ts b/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-drain.ts index 1705fbe2cdf3..ea4c48f43f29 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-drain.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-drain.ts @@ -1,6 +1,5 @@ import { recordTerminalFreezeBreadcrumb } from '../terminal-freeze-breadcrumbs' import { redactPtyIdForDiagnostics } from '../../../../../shared/pty-delivery-diagnostics' -import { RESET_AFTER_BYTE_GAP } from '../../../../../shared/terminal-mode-reset-profiles' import { cancelScheduledHiddenOutputRestore } from '../hidden-output-restore-scheduler' import { isRemoteExecutionHostPtyId } from '../remote-execution-host-pty' @@ -173,7 +172,7 @@ export function bindHiddenOutputRestoreDrain(session: ConnectPanePtySession): vo cycle: session.hiddenOutputRestoreRemoteAbandonCycles }) session.noteHiddenOutputRestoreFloodBackpressure() - session.writePtyOutputToXterm(RESET_AFTER_BYTE_GAP, true) + session.writeAbandonedRestoreGap() return true } } diff --git a/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-snapshot.ts b/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-snapshot.ts index 450fdd799db0..e895128b280d 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-snapshot.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/hidden-output-restore-snapshot.ts @@ -6,7 +6,8 @@ import { POST_REPLAY_LIVE_SNAPSHOT_RESET, POST_REPLAY_DEAD_TUI_RESET, POST_REPLAY_REATTACH_RESET, - RESET_AFTER_BYTE_GAP + RESET_AFTER_BYTE_GAP, + buildKittyKeyboardRestore } from '../../../../../shared/terminal-mode-reset-profiles' import { discardTerminalOutput, @@ -30,9 +31,18 @@ import { recordTerminalFreezeBreadcrumb } from '../terminal-freeze-breadcrumbs' import type { ConnectPanePtySession } from './connect-pane-pty-session' export function bindHiddenOutputRestoreSnapshot(session: ConnectPanePtySession): void { + // Why the kitty restore: an abandoned restore discards queued chunks the + // mirror already scanned, so xterm re-adopts the mirror's flags. + session.writeAbandonedRestoreGap = function (): void { + session.writePtyOutputToXterm( + `${RESET_AFTER_BYTE_GAP}${buildKittyKeyboardRestore(session.kittyKeyboardModes.snapshotFlags)}`, + true + ) + } + session.writeRestoreUnavailableWarning = function (): void { // The reset must parse before both the warning and any foreground drain. - session.writePtyOutputToXterm(RESET_AFTER_BYTE_GAP, true) + session.writeAbandonedRestoreGap() if (!shouldWritePtyOutputForeground(session.deps.isVisibleRef.current)) { return } @@ -156,7 +166,7 @@ export function bindHiddenOutputRestoreSnapshot(session: ConnectPanePtySession): : hasLiveAgent ? POST_REPLAY_LIVE_AGENT_SNAPSHOT_RESET : POST_REPLAY_LIVE_SNAPSHOT_RESET - session.writeReplayData(postReplayReset) + session.writeReplayEpilogue(postReplayReset) if (snapshot.pendingEscapeTailAnsi) { // Why last: snapshot taken mid-escape; re-arm as the FINAL replay write (any later ESC aborts it) so the live tail completes it, not render literally (Bug E / #7329). session.writeReplayData(snapshot.pendingEscapeTailAnsi) diff --git a/src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts b/src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts index 97ce140bd05f..2c86932c499d 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts @@ -1,9 +1,7 @@ import { agentTypeToIconAgent } from '@/lib/agent-status' import { useAppStore } from '@/store' import { getConnectionId } from '@/lib/connection-context' -import { replayIntoTerminal } from '../replay-guard' -import { flushTerminalOutput } from '@/lib/pane-manager/pane-terminal-output-scheduler' -import { POST_REPLAY_REATTACH_RESET } from '../../../../../shared/terminal-mode-reset-profiles' +import { CONFIRMED_SHELL_MODE_RESET } from '../../../../../shared/terminal-mode-reset-profiles' import { isLocalNativeWindowsConpty, resolveWindowsShellOverride @@ -182,18 +180,7 @@ export function installPaneAgentIdentity(session: ConnectPanePtySession): void { // Why: a hard-killed agent leaves mouse/focus/kitty modes armed, and the // surviving shell then receives pointer moves as typed SGR reports; the // replay guard keeps xterm's auto-replies from leaking to the shell. - // The input mirror scans the same bytes so shortcuts stop encoding for the dead app; - // draining queued output first keeps both in stream order. - flushTerminalOutput(session.pane.terminal) - session.kittyKeyboardModes.scan(POST_REPLAY_REATTACH_RESET) - replayIntoTerminal(session.pane, session.deps.replayingPanesRef, POST_REPLAY_REATTACH_RESET, { - breadcrumbIdentity: { - tabId: session.deps.tabId, - worktreeId: session.deps.worktreeId, - ptyId: session.transport.getPtyId() - }, - shouldRefreshViewportSynchronously: session.shouldRefreshForegroundSynchronously - }) + session.writeInputModeGround(CONFIRMED_SHELL_MODE_RESET) if (reason === 'visible-pty') { state.clearAgentLaunchConfig(session.cacheKey) return diff --git a/src/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.ts b/src/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.ts index 3ea62593ed30..98315f2ca6f8 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.ts @@ -6,7 +6,6 @@ import { deferPtyShutdownExit, isHostPtySleepPending } from '../pty-shutdown-exit-deferral' -import { replayIntoTerminal } from '../replay-guard' import { POST_REPLAY_MODE_RESET } from '../../../../../shared/terminal-mode-reset-profiles' import { isProvenProcessExit } from '../../../../../shared/terminal-exit-cause' import { getProviderSessionClaimKey } from '@/lib/sleeping-agent-pane-ownership' @@ -225,9 +224,6 @@ export function installPtyExitHibernate(session: ConnectPanePtySession): void { if (!isUnverifiedExit) { session.clearPanePtyFitBinding() } - // Why: the negotiating application died with its PTY; any replacement - // session starts with kitty keyboard flags at zero. - session.kittyKeyboardModes.reset() const isSuppressedExit = session.deps.consumeSuppressedPtyExit(ptyId) || preserveRendererBinding || @@ -272,14 +268,7 @@ export function installPtyExitHibernate(session: ConnectPanePtySession): void { // frame still has mouse-tracking/bracketed-paste armed, which silently // eats every click and keystroke against a dead transport — disarm the // modes now and arm the reveal-time wake. - replayIntoTerminal(session.pane, session.deps.replayingPanesRef, POST_REPLAY_MODE_RESET, { - breadcrumbIdentity: { - tabId: session.deps.tabId, - worktreeId: session.deps.worktreeId, - ptyId - }, - shouldRefreshViewportSynchronously: session.shouldRefreshForegroundSynchronously - }) + session.writeInputModeGround(POST_REPLAY_MODE_RESET) session.hibernatedWakeTarget = { ptyId, record: sleepingRecordEntry.record } const pendingWakeMatches = session.pendingHibernatedWakeTarget?.ptyId === ptyId && diff --git a/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-context.test.ts b/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-context.test.ts index de3ee9011a8a..46d2d41982dc 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-context.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-context.test.ts @@ -10,11 +10,14 @@ import type { ReattachPayloadContext } from './reattach-payload-context' import type { ReattachPayloadSession } from './reattach-payload-session' function createSession(overrides: Record = {}): ReattachPayloadSession { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the handlers under test read only these session members. return { pane: createPane(1), rememberReattachPayloadAgentSignal: vi.fn(), writeReplayData: vi.fn(), - reattachReplayResetSequence: vi.fn(() => ''), + writeInputModeGround: vi.fn(), + chooseReattachReplayReset: vi.fn(() => ''), + writeReplayEpilogue: vi.fn(), sendFocusedReattachFocusInAfterReplay: vi.fn(), kittyKeyboardModes: { hasProvenBaseline: true, diff --git a/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-session.ts b/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-session.ts index c9d53a56b54c..b4c963d29f48 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-session.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-session.ts @@ -5,6 +5,7 @@ export type ReattachPayloadSession = Pick< | 'applyColdRestoreAgentResumeStartup' | 'applySnapshotKittyKeyboardModes' | 'buildColdRestoreAgentResumeStartup' + | 'chooseReattachReplayReset' | 'clearSleepingRecordAfterColdRestoreSpawn' | 'consumeRestoredViewportBlankingMarker' | 'createReattachGridPush' @@ -13,7 +14,6 @@ export type ReattachPayloadSession = Pick< | 'markHiddenOutputRestoreNeeded' | 'pane' | 'pendingReattachFit' - | 'reattachReplayResetSequence' | 'recordRendererOrderedSeq' | 'rememberReattachPayloadAgentSignal' | 'schedulePendingStartupCommandDelivery' @@ -24,5 +24,7 @@ export type ReattachPayloadSession = Pick< | 'suppressStructuralReplayPtyResize' | 'transport' | 'writeFreshShellViewportBlanking' + | 'writeInputModeGround' + | 'writeReplayEpilogue' | 'writeReplayData' > diff --git a/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-ssh-reconnect-model-paint.test.ts b/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-ssh-reconnect-model-paint.test.ts index 68782e666f66..bf14e261b2be 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-ssh-reconnect-model-paint.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-ssh-reconnect-model-paint.test.ts @@ -36,11 +36,13 @@ function createSession( fireLog: FireLog, overrides: Record = {} ): ReattachPayloadSession { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the handlers under test read only these session members. return { pane: createPane(1), rememberReattachPayloadAgentSignal: vi.fn(), writeReplayData: vi.fn((data: string) => fireLog.push(`write:${data}`)), - reattachReplayResetSequence: vi.fn(() => ''), + chooseReattachReplayReset: vi.fn(() => ''), + writeReplayEpilogue: vi.fn((profile: string) => fireLog.push(`write:${profile}`)), sendFocusedReattachFocusInAfterReplay: vi.fn(), applySnapshotKittyKeyboardModes: vi.fn(() => fireLog.push('kitty:snapshot-baseline')), setRestoredSnapshotBaseline: vi.fn(), diff --git a/src/renderer/src/components/terminal-pane/pty-connection/replay-data-drain.ts b/src/renderer/src/components/terminal-pane/pty-connection/replay-data-drain.ts index bd3d7284ac9a..087326d0f400 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/replay-data-drain.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/replay-data-drain.ts @@ -158,8 +158,9 @@ export function bindReplayDataDrain(session: ConnectPanePtySession): void { continue } if (clearBeforeReplay || data.length > 0) { - await session.writeReplayDataAsync( - session.reattachReplayResetSequence(data, false, alternateScreen, terminalOwner) + await session.writeReplayEpilogue( + session.chooseReattachReplayReset(data, false, alternateScreen, terminalOwner), + session.writeReplayDataAsync ) if (!isCurrentPayload()) { continue diff --git a/src/renderer/src/components/terminal-pane/pty-connection/ssh-snapshot-prepaint.ts b/src/renderer/src/components/terminal-pane/pty-connection/ssh-snapshot-prepaint.ts index 8dfe10e8a6eb..fd2a4a097a24 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/ssh-snapshot-prepaint.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/ssh-snapshot-prepaint.ts @@ -60,7 +60,7 @@ export function bindPrepaintParkedSshSnapshot(session: ConnectPanePtySession): v })) { session.writeReplayData(replayChunk) } - session.writeReplayData(session.reattachReplayResetSequence(modelData)) + session.writeReplayEpilogue(session.chooseReattachReplayReset(modelData)) if (snapshot.pendingEscapeTailAnsi) { session.writeReplayData(snapshot.pendingEscapeTailAnsi) } diff --git a/src/renderer/src/components/terminal-pane/pty-connection/write-pty-output-to-xterm.ts b/src/renderer/src/components/terminal-pane/pty-connection/write-pty-output-to-xterm.ts index 3335776a118b..34fdd14bf705 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/write-pty-output-to-xterm.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/write-pty-output-to-xterm.ts @@ -1,6 +1,7 @@ import { takeCurrentTerminalDeliveryCredit } from '@/lib/pane-manager/terminal-delivery-credit' import { nativeWindowsRewriteNeedsFollowupRenderRefresh } from '@/lib/pane-manager/terminal-complex-script' import { writeTerminalOutput } from '@/lib/pane-manager/pane-terminal-output-scheduler' +import { RESET_TERMINAL_CURSOR_STYLE } from '../../../../../shared/terminal-mode-reset-profiles' import { forceFullViewportPresent } from '@/lib/pane-manager/terminal-render-pause-release' import { FOREGROUND_SYNCHRONIZED_FRAME_INTERACTIVE_WINDOW_MS } from './foreground-output-budgets' @@ -126,7 +127,7 @@ export function bindWritePtyOutputToXterm(session: ConnectPanePtySession): void return } session.writePtyOutputToXterm( - session.idleAgentTerminalModeReset, + RESET_TERMINAL_CURSOR_STYLE, shouldWritePtyOutputForeground(session.deps.isVisibleRef.current) ) } diff --git a/src/renderer/src/components/terminal-pane/terminal-pane-lifecycle-primitives.ts b/src/renderer/src/components/terminal-pane/terminal-pane-lifecycle-primitives.ts index d569e2650982..385c07cf7c0b 100644 --- a/src/renderer/src/components/terminal-pane/terminal-pane-lifecycle-primitives.ts +++ b/src/renderer/src/components/terminal-pane/terminal-pane-lifecycle-primitives.ts @@ -3,22 +3,12 @@ import type { TerminalLayoutSnapshot, TerminalTab } from '../../../../shared/ter import type { PtyPaneStartup } from './pty-connection-types' import type { PtyTransport } from './pty-transport' import type { PaneCwdMap } from './resolve-split-cwd' -import { writeTerminalOutput } from '@/lib/pane-manager/pane-terminal-output-scheduler' -import { RESET_KITTY_KEYBOARD_PROTOCOL } from '../../../../shared/terminal-mode-reset-profiles' import type { TerminalPaneSplitSource } from '../../../../shared/feature-education-telemetry' import type { HttpLinkSourceOwner } from '@/lib/http-link-routing' import { resolveLocalhostHttpLinkDisplayUrl } from '@/lib/http-link-routing' import { recordCreatedTerminalPaneSplit } from './terminal-pane-split-completion' import { PRIMARY_SELECTION_MAX_LENGTH } from '@/lib/primary-selection' -/** Writes a transport-agnostic interrupt reset without running xterm work inline. */ -export function resetTerminalKeyboardProtocolAfterInterrupt(terminal: Terminal): void { - writeTerminalOutput(terminal, RESET_KITTY_KEYBOARD_PROTOCOL, { - foreground: true, - latencySensitive: false - }) -} - export function recordRuntimeCreatedTerminalPaneSplit( createdPane: unknown, args: { diff --git a/src/renderer/src/components/terminal-pane/terminal-pane-pane-input.ts b/src/renderer/src/components/terminal-pane/terminal-pane-pane-input.ts index 6ecab6f332bf..32ee26390299 100644 --- a/src/renderer/src/components/terminal-pane/terminal-pane-pane-input.ts +++ b/src/renderer/src/components/terminal-pane/terminal-pane-pane-input.ts @@ -30,7 +30,6 @@ import { } from './xterm-bypass-policy' import { markTerminalPinnedViewport } from '@/lib/pane-manager/terminal-scroll-intent' import { syncTerminalScrollIntentSoon } from '@/lib/pane-manager/terminal-scroll-intent-settle' -import { resetTerminalKeyboardProtocolAfterInterrupt } from './terminal-pane-lifecycle-primitives' type PaneInputContext = { pane: Pick @@ -141,7 +140,6 @@ export function installTerminalPaneInputHandling(context: PaneInputContext): voi if (event.type === 'keydown') { pendingTerminalInterruptKeyup = true pane.terminal.input(TERMINAL_INTERRUPT_INPUT) - resetTerminalKeyboardProtocolAfterInterrupt(pane.terminal) } else { pendingTerminalInterruptKeyup = false } diff --git a/src/renderer/src/components/terminal-pane/terminal-replay-cursor-state.test.ts b/src/renderer/src/components/terminal-pane/terminal-replay-cursor-state.test.ts index ce6a3db257c9..70a3c4d26685 100644 --- a/src/renderer/src/components/terminal-pane/terminal-replay-cursor-state.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-replay-cursor-state.test.ts @@ -1,12 +1,12 @@ import { describe, expect, it } from 'vitest' import { Terminal } from '@xterm/headless' import { + CONFIRMED_SHELL_MODE_RESET, POST_REPLAY_LIVE_AGENT_REATTACH_RESET, POST_REPLAY_LIVE_SNAPSHOT_RESET, POST_REPLAY_MODE_RESET, POST_REPLAY_REATTACH_RESET, - RESET_KITTY_KEYBOARD_PROTOCOL, - RESET_TERMINAL_CURSOR_STYLE + RESET_KITTY_KEYBOARD_PROTOCOL } from '../../../../shared/terminal-mode-reset-profiles' const OLD_REATTACH_RESET_WITHOUT_CURSOR_STYLE = '\x1b[?25h\x1b[?1004l' @@ -74,10 +74,11 @@ function writeTerminal(term: Terminal, data: string): Promise { } describe('terminal replay state reset', () => { - it('includes Kitty keyboard protocol reset in replay reset bundles', () => { + it('resets Kitty keyboard state only in the process-ended bundles', () => { expect(RESET_KITTY_KEYBOARD_PROTOCOL).toBe('\x1b[<99u\x1b[=0u') expect(POST_REPLAY_MODE_RESET).toContain(RESET_KITTY_KEYBOARD_PROTOCOL) - expect(POST_REPLAY_REATTACH_RESET).toContain(RESET_KITTY_KEYBOARD_PROTOCOL) + expect(CONFIRMED_SHELL_MODE_RESET).toContain(RESET_KITTY_KEYBOARD_PROTOCOL) + expect(POST_REPLAY_REATTACH_RESET).not.toContain(RESET_KITTY_KEYBOARD_PROTOCOL) expect(POST_REPLAY_LIVE_SNAPSHOT_RESET).not.toContain(RESET_KITTY_KEYBOARD_PROTOCOL) }) @@ -137,7 +138,7 @@ describe('terminal replay state reset', () => { } }) - it('clears active-buffer Kitty keyboard state after live reattach replay', async () => { + it("keeps a live app's Kitty keyboard state through the live reattach reset", async () => { const term = new Terminal({ cols: 80, rows: 24, @@ -147,25 +148,14 @@ describe('terminal replay state reset', () => { try { await writeTerminal(term, '\x1b[=31u\x1b[>15u') - expect(readKittyKeyboardState(term)).toMatchObject({ - flags: 15, - mainStack: [31] - }) - await writeTerminal(term, POST_REPLAY_REATTACH_RESET) - // Why: after renderer reattach, the next Ctrl+C must not inherit a stale - // Kitty CSI-u encoder state from the replayed TUI snapshot. - expect(readKittyKeyboardState(term)).toMatchObject({ - flags: 0, - mainFlags: 0, - mainStack: [] - }) + expect(readKittyKeyboardState(term)).toMatchObject({ flags: 15, mainStack: [31] }) } finally { term.dispose() } }) - it('clears active-buffer Kitty keyboard state with the idle-agent reset sequence', async () => { + it('clears active-buffer Kitty keyboard state with the confirmed-shell reset', async () => { const term = new Terminal({ cols: 80, rows: 24, @@ -175,14 +165,7 @@ describe('terminal replay state reset', () => { try { await writeTerminal(term, '\x1b[=31u\x1b[>15u') - expect(readKittyKeyboardState(term)).toMatchObject({ - flags: 15, - mainStack: [31] - }) - - await writeTerminal(term, `${RESET_TERMINAL_CURSOR_STYLE}${RESET_KITTY_KEYBOARD_PROTOCOL}`) - // Why: this is the exact reset emitted when a native Windows agent turn - // completes, so the next Backspace/Enter must not inherit CSI-u encoding. + await writeTerminal(term, CONFIRMED_SHELL_MODE_RESET) expect(readKittyKeyboardState(term)).toMatchObject({ flags: 0, mainFlags: 0, diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts index a86341860fae..7e9e1e42b93a 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts @@ -12,7 +12,6 @@ import { resolvePaneSeedCwd, resolveQueuedInitialCwd, replayLayoutWithOneShotParkIntent, - resetTerminalKeyboardProtocolAfterInterrupt, retireMountedTerminalPaneSurface, shouldDetachPaneTransportOnUnmount, splitPaneWithOneShotStartup, @@ -168,23 +167,6 @@ describe('applyTerminalPaneCloseRequest', () => { }) }) -describe('resetTerminalKeyboardProtocolAfterInterrupt', () => { - it('does not write to an xterm whose pipeline is certified dead', async () => { - const { _resetWritePipelineHealthForTests, notifyUndeliverableWrite } = - await import('@/lib/pane-manager/terminal-write-pipeline-health') - const terminal = { write: vi.fn() } - try { - notifyUndeliverableWrite(terminal, 'replay-wedged') - - resetTerminalKeyboardProtocolAfterInterrupt(terminal as never) - - expect(terminal.write).not.toHaveBeenCalled() - } finally { - _resetWritePipelineHealthForTests(terminal) - } - }) -}) - // Why: onPaneCreated uses paneOwnsQueuedStartup to decide whether a pane may spend the tab's queued // startup command. Setup/issue splits borrow the same deps.startup field for their own one-shot // payload, so a looser test would let a split pane spend a command it never runs — re-breaking diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts index d5f39d6fa8ac..944a2e6bbe0c 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts @@ -25,7 +25,6 @@ export { mapRestoredPaneTitlesByPaneId, paneOwnsQueuedStartup, replayLayoutWithOneShotParkIntent, - resetTerminalKeyboardProtocolAfterInterrupt, resolvePaneLinkCwd, resolvePaneSeedCwd, resolveQueuedInitialCwd, diff --git a/src/shared/terminal-kitty-keyboard-mode-tracker.test.ts b/src/shared/terminal-kitty-keyboard-mode-tracker.test.ts index 91fab874a78b..7dbf7b94e1ac 100644 --- a/src/shared/terminal-kitty-keyboard-mode-tracker.test.ts +++ b/src/shared/terminal-kitty-keyboard-mode-tracker.test.ts @@ -1,7 +1,7 @@ import { Terminal } from '@xterm/headless' import { describe, expect, it } from 'vitest' import { TerminalKittyKeyboardModeTracker } from './terminal-kitty-keyboard-mode-tracker' -import { POST_REPLAY_REATTACH_RESET } from './terminal-mode-reset-profiles' +import { CONFIRMED_SHELL_MODE_RESET } from './terminal-mode-reset-profiles' describe('TerminalKittyKeyboardModeTracker', () => { it('starts inactive and ignores non-kitty sequences', () => { @@ -71,7 +71,7 @@ describe('TerminalKittyKeyboardModeTracker', () => { }) // Why: a confirmed-shell reset lands between live chunks in both records, so they must agree. - it('agrees with xterm when the reattach reset interrupts a split live sequence', async () => { + it('agrees with xterm when the confirmed-shell reset interrupts a split live sequence', async () => { const term = new Terminal({ allowProposedApi: true, vtExtensions: { kittyKeyboard: true } }) const tracker = new TerminalKittyKeyboardModeTracker() const replies: string[] = [] @@ -87,7 +87,7 @@ describe('TerminalKittyKeyboardModeTracker', () => { } await feed('\x1b[>5u\x1b[?1049h\x1b[>3u\x1b[>') - await feed(POST_REPLAY_REATTACH_RESET) + await feed(CONFIRMED_SHELL_MODE_RESET) await feed('1u') expect(tracker.flags).toBe(0) expect(await xtermReport()).toBe('\x1b[?0u') @@ -344,4 +344,14 @@ describe('TerminalKittyKeyboardModeTracker', () => { expect(softReset.hasProvenBaseline).toBe(true) }) }) + + // Why: xterm ignores CSI u while the protocol is withheld, so the mirror must stay at 0 too. + it('ignores kitty sequences and snapshot flags when the protocol is withheld', () => { + const tracker = new TerminalKittyKeyboardModeTracker({ kittyKeyboard: false }) + tracker.scan('\x1b[>5u\x1b[=31u') + expect(tracker.flags).toBe(0) + tracker.resetForSnapshot() + tracker.restoreSnapshotFlags(31) + expect(tracker.flags).toBe(0) + }) }) diff --git a/src/shared/terminal-kitty-keyboard-mode-tracker.ts b/src/shared/terminal-kitty-keyboard-mode-tracker.ts index 880d1fb5cf70..6b2b0e26f839 100644 --- a/src/shared/terminal-kitty-keyboard-mode-tracker.ts +++ b/src/shared/terminal-kitty-keyboard-mode-tracker.ts @@ -19,13 +19,11 @@ type KittyStackFrame = { flags: number; known: boolean } * DECSET/DECRST 47/1047/1049, the full reset on RIS, and the soft reset on * DECSTR (CSI ! p). * - * Why a mirror instead of reading xterm's internal state: Orca defensively - * wipes the renderer terminal's kitty flags at moments when the TUI may have - * died (Ctrl+C interrupts, reattach resets) while the TUI is usually still - * alive and expecting protocol-encoded input. This tracker is fed by - * application output, snapshot restores, and the Orca resets that also reach - * xterm (ConPTY agent-idle, confirmed shell), never by the renderer's other - * defensive xterm writes, so it reflects what the live application negotiated. + * Why a mirror instead of reading xterm's internal state: xterm's public API + * exposes no kitty flags. The renderer scans application output as it queues + * it and every mode write of its own; wherever xterm may skip or discard + * scanned bytes (snapshot replays, abandoned restores) the renderer re-asserts + * the mirror's flags into xterm, so their active-screen flags converge. * The daemon reuses it to carry flags into snapshots (xterm's SerializeAddon does * not serialize kitty state). */ @@ -49,6 +47,12 @@ export class TerminalKittyKeyboardModeTracker { // one. Grounding flips on evidence only: an explicit fresh-PTY reset, a // proven snapshot restore, or scanned bytes that state flags absolutely. private baselineProven = false + private readonly kittyKeyboard: boolean + + /** `kittyKeyboard: false` mirrors an xterm with the protocol withheld, which ignores `CSI u`. */ + constructor(options: { kittyKeyboard?: boolean } = {}) { + this.kittyKeyboard = options.kittyKeyboard ?? true + } /** * Current effective kitty keyboard flags. `0` doubles as the conservative @@ -129,7 +133,7 @@ export class TerminalKittyKeyboardModeTracker { */ restoreSnapshotFlags(flags: number): void { const parsed = parseTerminalKittyKeyboardFlags(flags) - if (parsed === undefined) { + if (parsed === undefined || !this.kittyKeyboard) { return } this.currentFlags = parsed @@ -184,7 +188,9 @@ export class TerminalKittyKeyboardModeTracker { this.applyScreenSwitch(match[1], match[2] === 'h') continue } - this.applyKittySequence(match[3], match[4] ?? '', replay) + if (this.kittyKeyboard) { + this.applyKittySequence(match[3], match[4] ?? '', replay) + } } } diff --git a/src/shared/terminal-mode-reset-profiles.test.ts b/src/shared/terminal-mode-reset-profiles.test.ts index d3de25ea4fe1..203d836a3f87 100644 --- a/src/shared/terminal-mode-reset-profiles.test.ts +++ b/src/shared/terminal-mode-reset-profiles.test.ts @@ -10,9 +10,13 @@ import { PROCESS_BOUNDARY_GROUND, RESET_GRAPHIC_RENDITION, RESET_MOUSE_REPORTING, + buildKittyKeyboardRestore, buildPostReplayLiveAgentReattachReset, + CONFIRMED_SHELL_MODE_RESET, + POST_REPLAY_DEAD_TUI_RESET, replayPayloadEndsWithCursorHidden } from './terminal-mode-reset-profiles' +import { TerminalKittyKeyboardModeTracker } from './terminal-kitty-keyboard-mode-tracker' // Why literal expectations: consumers import these constants, so only a byte-level // assertion here can catch a profile silently losing a mode it is meant to clear. @@ -31,7 +35,7 @@ describe('terminal mode reset profiles', () => { it('pins the daemon-reattach profile, which keeps bracketed paste', () => { expect(POST_REPLAY_REATTACH_RESET).toBe( - '\x1b[0m\x1b[0 q\x1b[<99u\x1b[=0u\x1b[?25h\x1b[?9l\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?1016l\x1b[?1004l\x1b7' + '\x1b[0m\x1b[0 q\x1b[?25h\x1b[?9l\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?1016l\x1b[?1004l\x1b7' ) expect(POST_REPLAY_REATTACH_RESET).toContain(RESET_GRAPHIC_RENDITION) expect(POST_REPLAY_REATTACH_RESET).not.toContain('\x1b[?2004l') @@ -41,9 +45,7 @@ describe('terminal mode reset profiles', () => { // so this profile can reach a plain shell, where armed focus reporting rings BEL on every pane // switch. Dropping it would also make this byte-identical to the live-agent profile. it('pins the live alternate-screen profile, which keeps mouse reporting but not focus', () => { - expect(POST_REPLAY_REATTACH_RESET_KEEP_MOUSE).toBe( - '\x1b[0 q\x1b[<99u\x1b[=0u\x1b[?25h\x1b[?1004l' - ) + expect(POST_REPLAY_REATTACH_RESET_KEEP_MOUSE).toBe('\x1b[0 q\x1b[?25h\x1b[?1004l') expect(POST_REPLAY_REATTACH_RESET_KEEP_MOUSE).not.toContain(RESET_MOUSE_REPORTING) expect(POST_REPLAY_REATTACH_RESET_KEEP_MOUSE).not.toBe(POST_REPLAY_LIVE_AGENT_REATTACH_RESET) }) @@ -87,7 +89,7 @@ describe('terminal mode reset profiles', () => { // coverage asserts they were passed through unchanged — need a literal here. it('pins the live-snapshot and live-agent profiles', () => { expect(POST_REPLAY_LIVE_SNAPSHOT_RESET).toBe('\x1b[0 q\x1b[?25h\x1b[?1004l') - expect(POST_REPLAY_LIVE_AGENT_REATTACH_RESET).toBe('\x1b[0 q\x1b[<99u\x1b[=0u\x1b[?25h') + expect(POST_REPLAY_LIVE_AGENT_REATTACH_RESET).toBe('\x1b[0 q\x1b[?25h') expect(POST_REPLAY_LIVE_AGENT_SNAPSHOT_RESET).toBe('\x1b[0 q') }) @@ -116,4 +118,57 @@ describe('terminal mode reset profiles', () => { expect(buildPostReplayLiveAgentReattachReset('x\x1b[?25h')).toContain('\x1b[?25h') }) }) + + // Why: a live reattach must keep the app's negotiated flags; the epilogue restores them instead. + it('keeps Kitty resets out of every live reattach profile', () => { + for (const profile of [ + POST_REPLAY_REATTACH_RESET, + POST_REPLAY_REATTACH_RESET_KEEP_MOUSE, + POST_REPLAY_DEAD_TUI_RESET, + POST_REPLAY_LIVE_AGENT_REATTACH_RESET, + POST_REPLAY_LIVE_SNAPSHOT_RESET, + POST_REPLAY_LIVE_AGENT_SNAPSHOT_RESET, + buildPostReplayLiveAgentReattachReset('x\x1b[?25l') + ]) { + // oxlint-disable-next-line no-control-regex -- terminal escape sequences require control chars + expect(profile).not.toMatch(/\x1b\[[<=>][0-9;]*u/) + } + expect(CONFIRMED_SHELL_MODE_RESET).toBe(`${POST_REPLAY_REATTACH_RESET}\x1b[<99u\x1b[=0u`) + }) + + it('restores proven Kitty flags and only pops unproven ones', () => { + expect(buildKittyKeyboardRestore(5)).toBe('\x1b[<99u\x1b[=5u') + expect(buildKittyKeyboardRestore(undefined)).toBe('\x1b[<99u') + }) + + // Why: xterm pushes a relay-redelivered push again while the mirror applies it as a set, so + // without the pop-all the app's single pop would leave xterm on the stale frame. + it("brings xterm and the mirror to 0 on the app's pop after a redelivered push", async () => { + const term = new Terminal({ allowProposedApi: true, vtExtensions: { kittyKeyboard: true } }) + const mirror = new TerminalKittyKeyboardModeTracker() + const replies: string[] = [] + term.onData((data) => replies.push(data)) + const write = (data: string): Promise => + new Promise((resolve) => term.write(data, resolve)) + const xtermFlags = async (): Promise => { + replies.length = 0 + await write('\x1b[?u') + return replies.join('') + } + for (const redelivery of ['\x1b[>1u', '\x1b[>1u']) { + mirror.scanReplay(redelivery) + await write(redelivery) + } + const restore = buildKittyKeyboardRestore(mirror.snapshotFlags) + mirror.scan(restore) + await write(restore) + expect(mirror.flags).toBe(1) + expect(await xtermFlags()).toBe('\x1b[?1u') + + mirror.scan('\x1b[ { + return page.evaluate(() => { + const state = window.__store?.getState() + const tabId = state?.activeTabId ?? null + const manager = tabId ? window.__paneManagers?.get(tabId) : null + const pane = manager?.getActivePane?.() ?? manager?.getPanes?.()[0] ?? null + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: xterm exposes kitty flags only on its private core; null when absent. + const terminal = pane?.terminal as + | { _core?: { coreService?: { kittyKeyboard?: { flags?: number } } } } + | undefined + return terminal?._core?.coreService?.kittyKeyboard?.flags ?? null + }) +} + +// Why Shift+Enter: the policy emits CSI-u only when the pane mirror reports kitty flags. +async function expectShiftEnterWrite( + page: Page, + app: ElectronApplication, + expected: string +): Promise { + await clearTerminalPtyWriteLog(app) + await focusActiveTerminalInput(page) + await page.keyboard.press('Shift+Enter') + await expect + .poll(async () => (await readTerminalPtyWrites(app)).includes(expected), { + timeout: 5_000, + message: `Shift+Enter did not write ${JSON.stringify(expected)}` + }) + .toBe(true) +} + +async function activateTerminalTab(page: Page, tabId: string): Promise { + await page.evaluate((tabId) => { + const state = window.__store?.getState() + if (!state) { + throw new Error('Orca store unavailable') + } + state.setActiveTabType('terminal', window.__store?.getState().activeWorktreeId ?? null) + state.setActiveTab(tabId) + }, tabId) + await expect.poll(() => getActiveTabId(page)).toBe(tabId) + await waitForActiveTerminalManager(page, 30_000) +} + +test("park and reveal keep a live app's kitty flags in xterm and the mirror", async ({ + orcaPage, + electronApp +}) => { + test.skip(process.platform === 'win32', 'ConPTY panes withhold the kitty protocol') + await installTerminalPtyWriteSpy(electronApp) + await waitForSessionReady(orcaPage) + const worktreeId = await waitForActiveWorktree(orcaPage) + await ensureTerminalVisible(orcaPage) + await waitForActiveTerminalManager(orcaPage, 30_000) + const tabId = await getActiveTabId(orcaPage) + if (!tabId) { + throw new Error('no active terminal tab') + } + const ptyId = await waitForActivePanePtyId(orcaPage) + await waitForPtyShellEcho(orcaPage, ptyId, 15_000) + + try { + // The app stays alive through the park, so nothing grounds its flags. + await sendToTerminal(orcaPage, ptyId, `printf '\\033[=${APP_FLAGS}u'; sleep 120\r`) + await expect.poll(() => readXtermKittyFlags(orcaPage)).toBe(APP_FLAGS) + await expectShiftEnterWrite(orcaPage, electronApp, '\x1b[13;2u') + + await parkHiddenTabBehindDecoy(orcaPage, worktreeId, tabId, { + parkDelayMs: PARKING_DELAY_MS + }) + await activateTerminalTab(orcaPage, tabId) + await waitForActivePanePtyId(orcaPage) + + await expect + .poll(() => readXtermKittyFlags(orcaPage), { + timeout: 10_000, + message: 'the revealed xterm did not get the live app kitty flags back' + }) + .toBe(APP_FLAGS) + await expectShiftEnterWrite(orcaPage, electronApp, '\x1b[13;2u') + } finally { + await sendToTerminal(orcaPage, ptyId, '\x03').catch(() => undefined) + } +}) diff --git a/tests/e2e/terminal-shortcuts.spec.ts b/tests/e2e/terminal-shortcuts.spec.ts index c70ab00567b0..a187df5b83b7 100644 --- a/tests/e2e/terminal-shortcuts.spec.ts +++ b/tests/e2e/terminal-shortcuts.spec.ts @@ -227,27 +227,6 @@ async function getActiveTerminalViewport( }) } -async function enableKittyKeyboardReporting(page: Page, flags: number): Promise { - await page.evaluate(async (flags) => { - const state = window.__store?.getState() - const worktreeId = state?.activeWorktreeId - const tabId = - state?.activeTabType === 'terminal' - ? state.activeTabId - : worktreeId - ? (state?.activeTabIdByWorktree?.[worktreeId] ?? null) - : null - const manager = tabId ? window.__paneManagers?.get(tabId) : null - const pane = manager?.getActivePane?.() ?? manager?.getPanes?.()[0] ?? null - if (!pane) { - throw new Error('No active terminal pane for kitty keyboard setup') - } - await new Promise((resolve) => { - pane.terminal.write(`\x1b[=${flags}u`, resolve) - }) - }, flags) -} - async function getKittyKeyboardFlags(page: Page): Promise { return page.evaluate(() => { const state = window.__store?.getState() @@ -274,6 +253,40 @@ async function getKittyKeyboardFlags(page: Page): Promise { }) } +// Why arm from the PTY: the mirror the shortcut policy reads only sees application output. +async function armKittyKeyboardFromPty(page: Page, ptyId: string, command: string): Promise { + await execInTerminal(page, ptyId, command) + await expect + .poll(async () => await getKittyKeyboardFlags(page), { + timeout: 15_000, + message: 'the application never armed kitty keyboard reporting' + }) + .toBe(31) +} + +async function interruptAndExpectEtx(page: Page, app: ElectronApplication): Promise { + await clearPtyWriteLog(app) + await focusActiveTerminalInput(page) + await page.keyboard.down('Control') + await page.keyboard.up('Control') + expect((await getPtyWrites(app)).join('')).toBe('') + await clearPtyWriteLog(app) + + expect(await dispatchCtrlCToActiveTerminalTextarea(page, { keyupCtrlKey: false })).toEqual({ + keydownDefaultPrevented: false, + keyupDefaultPrevented: false + }) + await expect + .poll(async () => (await getPtyWrites(app)).some((write) => write.includes('\x03')), { + timeout: 5_000, + message: 'Ctrl+C did not reach the PTY as ETX' + }) + .toBe(true) + const writes = (await getPtyWrites(app)).join('') + expect(writes).not.toContain('\x1b[99;5u') + expect(writes).not.toContain('\x1b[99') +} + async function pressShiftedRussianLayoutKey(page: Page): Promise<{ keydownDefaultPrevented: boolean keypressSent: boolean @@ -550,45 +563,55 @@ test.describe('Terminal Shortcuts', () => { await pressAndExpectWrite(orcaPage, electronApp, 'Control+Enter', '\x1b[13;5u') }) - test('plain Ctrl+C sends ETX under kitty keyboard reporting', async ({ + test('plain Ctrl+C sends ETX and leaves a surviving app its kitty flags', async ({ orcaPage, electronApp }) => { + test.skip(process.platform === 'win32', 'POSIX trap and printf fixture') await installMainProcessPtyWriteSpy(electronApp) const ptyId = await waitForActivePanePtyId(orcaPage) // SIGINT during shell startup kills the shell, so interrupt only a ready prompt. await execInTerminal(orcaPage, ptyId, 'echo "CTRL_C_""READY"') await waitForTerminalOutput(orcaPage, 'CTRL_C_READY') - await enableKittyKeyboardReporting(orcaPage, 31) - await clearPtyWriteLog(electronApp) - await focusActiveTerminalInput(orcaPage) - await orcaPage.keyboard.down('Control') - await orcaPage.keyboard.up('Control') - expect((await getPtyWrites(electronApp)).join('')).toBe('') - await clearPtyWriteLog(electronApp) + // An app that survives SIGINT, like an agent TUI, and disarms its own flags on exit. + await armKittyKeyboardFromPty( + orcaPage, + ptyId, + `bash -c 'trap "" INT; printf "\\033[=31u"; read -r _; printf "\\033[=0u"'` + ) - expect(await dispatchCtrlCToActiveTerminalTextarea(orcaPage, { keyupCtrlKey: false })).toEqual({ - keydownDefaultPrevented: false, - keyupDefaultPrevented: false - }) + await interruptAndExpectEtx(orcaPage, electronApp) - await expect - .poll(async () => (await getPtyWrites(electronApp)).some((write) => write.includes('\x03')), { - timeout: 5_000, - message: 'Ctrl+C did not reach the PTY as ETX' - }) - .toBe(true) - const writes = (await getPtyWrites(electronApp)).join('') - expect(writes).not.toContain('\x1b[99;5u') - expect(writes).not.toContain('\x1b[99') + // Orca no longer guesses the app died: xterm keeps encoding for it, and the + // mirror the shortcut policy reads agrees (Shift+Enter stays CSI-u). + expect(await getKittyKeyboardFlags(orcaPage)).toBe(31) + await pressAndExpectWrite(orcaPage, electronApp, 'Shift+Enter', '\x1b[13;2u') + + await sendToTerminal(orcaPage, ptyId, '\r') + await expect.poll(async () => await getKittyKeyboardFlags(orcaPage)).toBe(0) + await pressAndExpectWrite(orcaPage, electronApp, 'Shift+Enter', '\x1b\r') + }) + + test('the host grounds kitty flags an app killed by Ctrl+C left armed', async ({ + orcaPage, + electronApp + }) => { + test.skip(process.platform === 'win32', 'POSIX printf fixture') + await installMainProcessPtyWriteSpy(electronApp) + const ptyId = await waitForActivePanePtyId(orcaPage) + await execInTerminal(orcaPage, ptyId, 'echo "CTRL_C_""READY"') + await waitForTerminalOutput(orcaPage, 'CTRL_C_READY') + // `cat` dies on SIGINT with the flags still armed, like a crashed TUI. + await armKittyKeyboardFromPty(orcaPage, ptyId, `printf '\\033[=31u'; cat`) + + await interruptAndExpectEtx(orcaPage, electronApp) await expect .poll(async () => await getKittyKeyboardFlags(orcaPage), { timeout: 5_000, - message: 'Ctrl+C did not clear stale Kitty keyboard flags' + message: 'the host did not ground the dead app kitty flags at command end' }) .toBe(0) - await clearPtyWriteLog(electronApp) await focusActiveTerminalInput(orcaPage) await orcaPage.keyboard.type('x') @@ -598,8 +621,7 @@ test.describe('Terminal Shortcuts', () => { message: 'Post-interrupt keyboard input stayed in Kitty CSI-u mode' }) .toBe(true) - const postInterruptWrites = (await getPtyWrites(electronApp)).join('') - expect(postInterruptWrites).not.toContain('\x1b[') + expect((await getPtyWrites(electronApp)).join('')).not.toContain('\x1b[') await orcaPage.keyboard.press('Backspace') }) @@ -910,12 +932,13 @@ test.describe('Terminal Shortcuts', () => { orcaPage, electronApp }) => { + test.skip(process.platform === 'win32', 'ConPTY panes withhold the kitty protocol') await installMainProcessPtyWriteSpy(electronApp) // Why: CI can mount the xterm surface before the pane transport has a // live PTY. Probe first so xterm onData cannot race a disconnected // sendInput path, then clear the probe writes before the layout assertion. - await waitForActivePanePtyId(orcaPage) - await enableKittyKeyboardReporting(orcaPage, 31) + const ptyId = await waitForActivePanePtyId(orcaPage) + await armKittyKeyboardFromPty(orcaPage, ptyId, `printf '\\033[=31u'; cat`) await clearPtyWriteLog(electronApp) const dispatch = await pressShiftedRussianLayoutKey(orcaPage) @@ -937,5 +960,6 @@ test.describe('Terminal Shortcuts', () => { const joinedWrites = writes.join('') expect(joinedWrites).not.toContain('\x1b[97:1060;2;1060u') expect(joinedWrites).not.toContain('\x1b[97:1060;2:3u') + await sendToTerminal(orcaPage, ptyId, '\x03') }) }) From 84daac2de447bf1966ea573fae03ff796ce5779f Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:27:44 -0700 Subject: [PATCH 11/90] test(e2e): take the sidebar measured-row baseline with reduced motion (#23588) The fixture's collapse starts a row-removal slide; on hidden Linux windows the animation clock can stall, so the 'settled' baseline read LaunchStack 94px low (104 vs the resting 10). Emulate reduced motion, as the active-delete scroll spec already does, so the baseline is the resting layout. Linear: STA-8021 --- tests/e2e/sidebar-measured-row-scroll.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/sidebar-measured-row-scroll.spec.ts b/tests/e2e/sidebar-measured-row-scroll.spec.ts index a328d9fac700..84c21cd92d19 100644 --- a/tests/e2e/sidebar-measured-row-scroll.spec.ts +++ b/tests/e2e/sidebar-measured-row-scroll.spec.ts @@ -71,6 +71,8 @@ test('keeps a collapsed group visible when an idle card below it grows', async ( orcaPage, registerPostElectronShutdownCleanup }, testInfo) => { + // Why: the fixture's collapse slides rows in from their old position; a hidden window can freeze that mid-flight baseline. + await orcaPage.emulateMedia({ reducedMotion: 'reduce' }) await waitForSessionReady(orcaPage) await orcaPage.setViewportSize({ width: 1200, height: 900 }) const root = realpathSync(mkdtempSync(path.join(os.tmpdir(), 'orca-sidebar-measured-row-'))) From 0034ede120deddad62499cdc2f8972f40f987c32 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:31:40 -0400 Subject: [PATCH 12/90] fix(mobile): left-align every line of the desktop host card (#23673) * fix(mobile): left-align every line of the desktop host card StatusDot carried its own marginRight on top of each row's spacing, so the host card's status text sat 14 px in and the worktree line was hand-indented to match. Move the dot spacing to the row gap in every consumer and drop the worktree-line indent. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): re-pin tasks style parity hash for the title-row gap Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- mobile/src/components/MobileHostCard.tsx | 1 - mobile/src/components/StatusDot.tsx | 3 +-- mobile/src/host-screen/host-screen-primary-styles.ts | 2 +- mobile/src/session/mobile-session-frame-styles.ts | 1 + mobile/src/tasks/mobile-tasks-chrome-styles.ts | 1 + mobile/src/tasks/mobile-tasks-refactor-parity.test.ts | 3 ++- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mobile/src/components/MobileHostCard.tsx b/mobile/src/components/MobileHostCard.tsx index cadaf186fb24..19cf9d939938 100644 --- a/mobile/src/components/MobileHostCard.tsx +++ b/mobile/src/components/MobileHostCard.tsx @@ -178,7 +178,6 @@ const styles = StyleSheet.create({ metaText: { flex: 1, fontSize: 12, color: colors.textSecondary }, worktreeMetaText: { marginTop: 2, - marginLeft: spacing.xl, fontSize: 12, color: colors.textMuted }, diff --git a/mobile/src/components/StatusDot.tsx b/mobile/src/components/StatusDot.tsx index f9514b4e0bf9..a1e974f1cd27 100644 --- a/mobile/src/components/StatusDot.tsx +++ b/mobile/src/components/StatusDot.tsx @@ -42,7 +42,6 @@ const styles = StyleSheet.create({ dot: { width: 8, height: 8, - borderRadius: 4, - marginRight: 8 + borderRadius: 4 } }) diff --git a/mobile/src/host-screen/host-screen-primary-styles.ts b/mobile/src/host-screen/host-screen-primary-styles.ts index 1f13dd17b160..e262af906b5e 100644 --- a/mobile/src/host-screen/host-screen-primary-styles.ts +++ b/mobile/src/host-screen/host-screen-primary-styles.ts @@ -39,7 +39,7 @@ export const hostScreenPrimaryStyles = StyleSheet.create({ minWidth: 0, marginRight: spacing.md }, - hostIdentityLine: { flexDirection: 'row', alignItems: 'center', minWidth: 0 }, + hostIdentityLine: { flexDirection: 'row', alignItems: 'center', gap: spacing.sm, minWidth: 0 }, hostPlatformText: { marginLeft: 16, color: colors.textSecondary, diff --git a/mobile/src/session/mobile-session-frame-styles.ts b/mobile/src/session/mobile-session-frame-styles.ts index c6117fc8aaea..22ac97d23c8d 100644 --- a/mobile/src/session/mobile-session-frame-styles.ts +++ b/mobile/src/session/mobile-session-frame-styles.ts @@ -70,6 +70,7 @@ export const mobileSessionFrameStyles = StyleSheet.create({ sessionMetaRow: { flexDirection: 'row', alignItems: 'center', + gap: spacing.sm, marginTop: 2 }, sessionMetaText: { diff --git a/mobile/src/tasks/mobile-tasks-chrome-styles.ts b/mobile/src/tasks/mobile-tasks-chrome-styles.ts index 76601c4f7257..3b0c3f2d6e2c 100644 --- a/mobile/src/tasks/mobile-tasks-chrome-styles.ts +++ b/mobile/src/tasks/mobile-tasks-chrome-styles.ts @@ -28,6 +28,7 @@ export const mobileTasksChromeStyles = StyleSheet.create({ flex: 1, flexDirection: 'row', alignItems: 'center', + gap: spacing.sm, minWidth: 0 }, title: { diff --git a/mobile/src/tasks/mobile-tasks-refactor-parity.test.ts b/mobile/src/tasks/mobile-tasks-refactor-parity.test.ts index 3ba14c571d65..4eb61e3f1dad 100644 --- a/mobile/src/tasks/mobile-tasks-refactor-parity.test.ts +++ b/mobile/src/tasks/mobile-tasks-refactor-parity.test.ts @@ -113,7 +113,8 @@ const SCREEN_RPC_STATEMENTS = 'dd8f33cb3cf96f5c39abac397cb77e35f59079291033a1866 // Saved Linear selections now accept unknown persisted values; reconciliation tests cover them. const MAIN_REBASED_DECLARATIONS = 'ec77d34712c7c4ab19ac6a4d57878f32d22aba790d2420cc14c2c0f000d120e9' const SCREEN_RPC_SEMANTICS = 'e07a63387d57106483ee703ec6c19dea593e0eca5c651758f42bcb36254850b7' -const PRE_REFACTOR_STYLES = '1db6af69c791d9963928541ad5310942fcbda6d984b422c90b6eb92b6816579a' +// StatusDot's spacing moved to the tasks title row as `gap: spacing.sm`; same 8 px. +const PRE_REFACTOR_STYLES = '11504e9f655d4d45deb25d942158a0ee99a1f98007ad1630bb03e1bdfe1e73de' const SCREEN_RPC_RENDER_TREE = '086742f95f1e87fb89d8c67ffd9f7a229799ae05115f9f4bcc1a925e56dcc8bb' describe('Mobile Tasks refactor parity', () => { From 9d11a75cd3ce405a7bd3e5ae370ebc79a734bdb4 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:36:08 -0700 Subject: [PATCH 13/90] fix(native-chat): each chat failure says why in plain words, on the thing that failed (#23608) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(native-chat): a read whose history will not open is refused with its reason History, subscribe, snapshot and options reads reach a chat through one accessor, whose open had no catch: a journal that would not open reached every client as a runtime error carrying the storage's own text (a path, "file is not a database"). The accessor, and the options read's own open, now throw the classified journal refusal: journalCorrupt when SQLite reports damage, journalUnavailable otherwise. The storage text goes to the log only. The wire code stays runtime_error and the message becomes the bare code, as for every thrown refusal; the reason rides in the error's data. * refactor(native-chat): the idle sweep's stop of a hung start carries no hand-written reason The sweep passed an English sentence as the stop's reason. It lived only in memory and nothing read it: the delivery loop words the error row and the rejection from the hostStopped fact. Dropped, with the display-name lookup that built it. * fix(native-chat): a refusal the host throws is worded from its data, never its message A thrown agent-session refusal reaches the client as runtime_error with the bare code as its message and the typed refusal in error.data. Stop, answers, options and goals, a launch's held option pick, the option picker's failure toast, and the Retry line of a chat that could not start now word it from that refusal through the shared notice table. What each caller decides about the outcome is unchanged: only the words move. The Retry line of a failed start no longer prints the host's message or a thrown error's text; it keeps the refusal as a fact and says the cause and step its reason names, or only that the chat could not be started. The option toast keeps a local option surface's own sentence. * fix(native-chat): an unreadable history is worded from its refusal, and damage stops the retry The structured chat's read failure showed the host's text on the status line, and the pane always said Orca keeps trying. The read transport now takes the refusal from the error's data (a stream payload or a thrown RPC error), the reducer keeps it beside the failure text, and the pane and the status line word it through the notice table, once: on the pane when the failure took it, else beside the transcript that stays. A damaged journal says "Unable to load this chat." and the read stops reconnecting for that run; reopening the chat reads again. An open that can clear names its cause without "Try again", since the pane retries on its own. A failure that names no reason keeps today's generic line. Finality comes from the refusal's reason, never its message, which is the bare code for both. * fix(native-chat): a rejected message is worded from its stored fact A message the host recorded and then rejected keeps the host's typed fact beside its reason, but the Retry words re-read the reason alone. Now the fact decides: a hand-over failure says Orca couldn't reach the agent, a kind whose reason may be a legacy marker gets its fact's own sentence (a full queue now says so instead of only "not sent"), and any other kind shows the sentence the host wrote for it, which carries the agent's name and any words the provider wrote for a person. A row with no fact reads as before. * fix(native-chat): each message that did not go through says why on its own row The structured chat showed one Retry strip under the transcript for whichever single entry it picked, so a second failed message had no reason and no Retry of its own. The terminal-backed chat's existing per-row delivery marker now carries a notice and an optional Retry, and the structured pane derives one per message from the outbox on each render: every rejected message, and the one the queue stopped on (read through the drain's own rule, so a Retry never names a message waiting behind it). Each is worded from that message's stored failure. The single strip is deleted. Nothing new is stored, and the shared message projection is untouched. * fix(native-chat): say each chat failure's words where its own control already acts Three wording rules for the desktop chat: - A chat that could not start shows Retry beside its reason, so the reason stops at its cause where the Retry is the step: a reason whose action is to retry, and a start failure's "send your message again". Any other step stays (quit the terminal agent, start a new chat). The start-failure sentences take a retryControl context for this; what the host writes is unchanged. - A history that couldn't open right now still reconnects, so the pane keeps "Orca keeps trying to load it" under its cause. Only a damaged history, which no retry reads past, drops it. - A read failure that names no reason while the transcript is shown is only the pane reconnecting: the status line says "Reconnecting to this chat…" in muted text, not an error. New key components.native-chat.state.reconnecting, hand-translated for es/fr/ja/ko/zh. * fix(native-chat): a rejected message offers Retry only once the queue is moving Each rejected message's row offered its own Retry even while the queue was stopped on another message. Any Retry clears the stopped queue, so pressing a rejected message's Retry also sent the message the queue was holding, which the user had not retried; behind a message whose delivery is unconfirmed, the retried one instead went back into the queue with no notice and waited there. While the queue is stopped, only the message it stopped on offers Retry, as the single Retry strip this replaced did. A rejected message keeps its words on its row and gets its Retry back once the queue moves. * fix(native-chat): a chat whose history will not open logs once, not on every reconnect A reader reconnects every 750 ms while a journal open can clear, and each attempt logged the failure with its full stack. The read door now logs a session's failure once until that session opens, closes, or fails differently; every attempt is still refused with its reason. * fix(native-chat): a message's own Retry is its resend step, so its notice stops at the cause A rejected message offering Retry read "Claude stopped before it finished starting. Send your message to try again." beside that button. Its row now takes the rule the launch strip already follows: beside its own Retry the words leave out sending or trying again, worded from the stored fact with the chat's agent name. The stored fact keeps less than the host wrote from (a refusal, the provider's words), so a reason it cannot rebuild exactly is kept as written. A rejected message without a Retry, while the queue is held, keeps the step. What the host writes and the phone's notice are unchanged. * fix(native-chat): a message's Retry sends only that message, never the one the queue is held on Retry released the queue's refusal hold whichever message it was pressed on. While a queued message waited ahead of a held one, every rejected message offered Retry, and pressing it also sent the held message the person had not retried. Retrying an unconfirmed message ahead of a held one did the same. Retry now releases the hold only for its own message. * fix(native-chat): a not-signed-in failure beside Retry still says to sign in first Beside a Retry the notice dropped the whole next step, so a chat that could not start because the agent was not signed in read only the cause. Pressing Retry without signing in fails the same way again. The words now keep the sign-in step and leave out only the resend, which the Retry button is. * test(native-chat): a rejected message's hidden Retry only avoids waiting unseen * fix(native-chat): every Retry beside a notice leaves out the retry step the same way A message the queue stopped on worded its refusal with no agent name and with its retry step, beside its own Retry, while a rejected message next to it named the agent and left the step to the button. The launch strip and the history pane each had their own copy of the same rule. One wording context now goes through the one notice table for every surface: a Retry beside the words, or a pane that reconnects on its own, is the step for a reason whose action is to retry, and every other step stays. What the phone and the host write is unchanged. * test(native-chat): read the sent message id without a type assertion * fix(native-chat): a rejected message is worded from the journal's own fact, never by comparing sentences A message the host recorded and then rejected kept only the rejection's kind on the message, so its notice was reworded from that smaller copy only when it rebuilt the host's sentence word for word. A different agent name, an older host's wording, or anything the copy dropped (why a start failed, the provider's own words) left the host's sentence in place, beside a Retry that repeated its resend step. The notice now reads the journal's own rejection for that message, found by id, with the pane's agent name and Retry, and shows the provider's words only when they were written for a person. The message's smaller copy words it only when that journal row is not loaded. Nothing new is stored. * fix(native-chat): a message rejected before a restart retries under a new id the first time Whether a Retry needed a new message id was remembered in memory for one message, or read from the journal row when it was loaded. After a restart, or for an older message whose row was not loaded, the first Retry resent under the old id, the host answered with the same settled rejection, and nothing visibly happened. The message now says so itself: one the host recorded and rejected always retries under a new id, including after a restart. A refusal that already gave the message a fresh id, and a message whose delivery is unconfirmed or in flight, keep their id as before. * fix(native-chat): a rejected message older than the loaded history keeps the provider's words When the journal row that rejected a message is not loaded, the message's own copy of the fact has no provider detail or start refusal. For the kinds worded from those, the row now shows the sentence the host wrote for the person instead of a thinner rebuilt one. * test(native-chat): the chat pane words a rejected message from its loaded journal row Nothing covered the pane handing the journal's rows to the per-message notices, so a pane that stopped passing them would quietly fall back to the message's smaller copy of the rejection and show the host's sentence, resend step and all. The new case renders the pane with a rejected message whose journal row is loaded and checks that it reads that row's refusal in the chat's own agent name. * fix(native-chat): a chat whose history won't load says why in one line A read the host refused for a named reason put its sentence under the generic "Could not load conversation" title, so a damaged history read as two lines saying the same thing. The pane's own sentence now takes the title's place; a history that can come back keeps its line saying Orca keeps trying. A failure that names nothing keeps the generic title. * fix(native-chat): a message a failed start rejected says only that it was not sent When an agent stopped before it finished starting, the chat showed the start's red row ("Claude stopped before it finished starting. Send your message to try again.") and then repeated that cause under every message the start rejected. Each of those messages now reads "Your message was not sent." beside its Retry. The match is made on typed facts, not on the words: the host writes the start's row and the rejection of its queued messages from the same failure fact, and the row is keyed by the start. The pane finds the loaded start-failure rows by that key and shortens a message's notice only when its loaded journal submission was rejected with the same fact. Any other rejection, or one whose submission or row is not loaded, keeps its full notice. The row key moves to a shared module so the host that writes it and the pane that reads it use one definition. * fix(native-chat): a chat whose history keeps failing to open retries less often A read the host kept refusing (its history store could not be opened right now) reopened every 750 ms for as long as the chat stayed open, about 40 opens every 30 seconds. Each reconnect now waits twice as long as the last, from 750 ms up to 30 seconds, and never gives up; the first read that delivers anything starts the wait over at 750 ms. A damaged history still stops reconnecting at once. Reset happens on a delivered read, not on connect: a local subscribe resolves before the host's open refuses, so resetting there would keep the 750 ms loop. * test(native-chat): the pane harness types its journal rows without a cast * test(native-chat): the admission test passes no start-failure rows to the notices * test(native-chat): import the journal types once * fix(native-chat): a remote chat reads again as soon as its host is back The read retry doubles its wait up to 30 s during an outage, and nothing reset it when the remote runtime reconnected, so the transcript could lag the reconnect by up to 30 s. The read now watches the runtime status store's contact-regained edges (hostContactEpoch for a same-runtime return, connectionGeneration for a new runtime session) and, when one lands, runs a waiting retry immediately with the wait reset to its base. --- .../journal-open-failure.test.ts | 57 ++- .../journal-open-failure.ts | 58 +++ ...red-agent-session-conversation-lifetime.ts | 17 +- .../structured-agent-session-options-read.ts | 5 +- ...uctured-agent-session-start-failure-row.ts | 9 +- .../structured-agent-session-at-rest.test.ts | 72 +++ .../NativeChatDeliveryRetry.test.tsx | 57 --- .../native-chat/NativeChatDeliveryRetry.tsx | 59 --- .../native-chat/NativeChatEmptyState.test.tsx | 22 +- .../native-chat/NativeChatEmptyState.tsx | 38 +- .../native-chat/NativeChatLaunchRetry.tsx | 19 +- .../native-chat/NativeChatMessageList.tsx | 9 +- .../native-chat/NativeChatMessageRow.test.tsx | 42 ++ .../native-chat/NativeChatMessageRow.tsx | 29 +- .../native-chat/NativeChatResolvedView.tsx | 14 +- .../NativeChatSessionOptionPickers.test.tsx | 53 +++ .../NativeChatSessionOptionPickers.tsx | 14 +- ...tructuredSession.launch-lifecycle.test.tsx | 57 ++- ...eChatStructuredSession.read-error.test.tsx | 71 ++- ...turedSession.start-failure-notice.test.tsx | 163 +++++++ ...tiveChatStructuredSession.test-harness.tsx | 54 ++- .../NativeChatStructuredSession.tsx | 72 ++- ...tiveChatStructuredSessionDelivery.test.tsx | 145 +++++- .../NativeChatStructuredSessionStatus.tsx | 7 + .../native-chat/NativeChatTranscriptRow.tsx | 7 +- ...red-agent-session-delivery-notices.test.ts | 414 ++++++++++++++++++ ...ructured-agent-session-delivery-notices.ts | 137 ++++++ ...tured-agent-session-read-failure-notice.ts | 32 ++ .../structured-agent-session-read-owner.ts | 2 +- ...tured-agent-session-read-transport.test.ts | 205 ++++++++- ...structured-agent-session-read-transport.ts | 61 ++- ...tive-chat-launch-prompt-delivery-notice.ts | 22 + .../use-native-chat-provisional-launch.ts | 6 +- .../use-structured-agent-session-mutate.ts | 5 +- ...ed-agent-session-outbox-admission.test.tsx | 101 ++++- ...nt-session-outbox-rejection-cause.test.tsx | 47 +- .../use-structured-agent-session-outbox.ts | 24 +- ...-agent-session-start-failure-facts.test.ts | 42 ++ ...tured-agent-session-start-failure-facts.ts | 33 ++ ...tured-agent-session-write-refusal.test.tsx | 40 ++ .../use-structured-agent-session.ts | 7 +- .../src/i18n/en-runtime-required.json | 3 +- src/renderer/src/i18n/locales/en.json | 1 + src/renderer/src/i18n/locales/es.json | 1 + src/renderer/src/i18n/locales/fr.json | 1 + src/renderer/src/i18n/locales/ja.json | 1 + src/renderer/src/i18n/locales/ko.json | 1 + src/renderer/src/i18n/locales/zh.json | 1 + .../lib/launch-structured-agent-session.ts | 32 +- ...-agent-session-launch-exited-owner.test.ts | 13 +- ...structured-agent-session-launch-failure.ts | 18 + ...tured-agent-session-launch-options.test.ts | 36 ++ ...structured-agent-session-launch-options.ts | 5 +- ...tructured-agent-session-launch-registry.ts | 18 +- .../lib/structured-agent-session-launch.ts | 13 +- .../runtime-host-contact-regained.test.ts | 111 +++++ .../runtime/runtime-host-contact-regained.ts | 31 ++ src/shared/agent-session-failure-words.ts | 21 +- .../agent-session-refusal-notice.test.ts | 121 +++++ src/shared/agent-session-refusal-notice.ts | 56 ++- .../agent-session-write-failure.test.ts | 45 +- src/shared/agent-session-write-failure.ts | 31 ++ src/shared/structured-agent-session-outbox.ts | 5 +- .../structured-agent-session-read-refusal.ts | 16 + .../structured-agent-session-reducer.test.ts | 40 ++ .../structured-agent-session-reducer.ts | 11 +- ...red-agent-session-send-disposition.test.ts | 65 ++- ...ructured-agent-session-send-disposition.ts | 77 +++- ...red-agent-session-start-failure-row-key.ts | 17 + 69 files changed, 2790 insertions(+), 329 deletions(-) delete mode 100644 src/renderer/src/components/native-chat/NativeChatDeliveryRetry.test.tsx delete mode 100644 src/renderer/src/components/native-chat/NativeChatDeliveryRetry.tsx create mode 100644 src/renderer/src/components/native-chat/NativeChatStructuredSession.start-failure-notice.test.tsx create mode 100644 src/renderer/src/components/native-chat/structured-agent-session-delivery-notices.test.ts create mode 100644 src/renderer/src/components/native-chat/structured-agent-session-delivery-notices.ts create mode 100644 src/renderer/src/components/native-chat/structured-agent-session-read-failure-notice.ts create mode 100644 src/renderer/src/components/native-chat/use-native-chat-launch-prompt-delivery-notice.ts create mode 100644 src/renderer/src/components/native-chat/use-structured-agent-session-start-failure-facts.test.ts create mode 100644 src/renderer/src/components/native-chat/use-structured-agent-session-start-failure-facts.ts create mode 100644 src/renderer/src/lib/structured-agent-session-launch-failure.ts create mode 100644 src/renderer/src/runtime/runtime-host-contact-regained.test.ts create mode 100644 src/renderer/src/runtime/runtime-host-contact-regained.ts create mode 100644 src/shared/structured-agent-session-start-failure-row-key.ts diff --git a/src/main/native-chat/agent-session-journal/journal-open-failure.test.ts b/src/main/native-chat/agent-session-journal/journal-open-failure.test.ts index d2e1bf3b3501..a5427f76fdc7 100644 --- a/src/main/native-chat/agent-session-journal/journal-open-failure.test.ts +++ b/src/main/native-chat/agent-session-journal/journal-open-failure.test.ts @@ -1,9 +1,14 @@ import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { agentSessionRefusalError } from '../../../shared/agent-session-wire-refusals' import { openJournalDatabase } from './journal-database' -import { classifyJournalOpenFailure } from './journal-open-failure' +import { + classifyJournalOpenFailure, + createJournalOpenReadRefusals, + journalOpenReadRefusal +} from './journal-open-failure' import { loadJournal } from './journal-open' import { journalDatabaseFile } from './journal-paths' @@ -104,3 +109,51 @@ describe('classifyJournalOpenFailure', () => { expect(classifyJournalOpenFailure(first)).toBe('journalUnavailable') }) }) + +describe('journalOpenReadRefusal', () => { + it('names the reason, keeps the message the code and the storage text only as the cause', () => { + vi.spyOn(console, 'warn').mockImplementation(() => undefined) + const storage = nodeSqliteError(26) + const refusal = journalOpenReadRefusal(storage) + expect(refusal.message).toBe('agent_session_journal_unreadable') + expect(refusal.refusal).toMatchObject({ + code: 'agent_session_journal_unreadable', + details: { reason: 'journalCorrupt' } + }) + expect(refusal.cause).toBe(storage) + vi.restoreAllMocks() + }) + + it('passes a refusal the open already raised through unchanged', () => { + const raised = agentSessionRefusalError('agent_session_identity_required', { + reason: 'recordMissing' + }) + expect(journalOpenReadRefusal(raised)).toBe(raised) + }) +}) + +describe('createJournalOpenReadRefusals', () => { + it('logs a session once per failure until it opens, and each session on its own', () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) + const refusals = createJournalOpenReadRefusals() + const denied = systemError('EACCES', -13) + const corrupt = nodeSqliteError(26) + + for (let attempt = 0; attempt < 3; attempt += 1) { + const refusal = refusals.refusal('session-1', denied) + expect(refusal.refusal).toMatchObject({ details: { reason: 'journalUnavailable' } }) + expect(refusal.cause).toBe(denied) + } + expect(warn).toHaveBeenCalledTimes(1) + refusals.refusal('session-2', denied) + expect(warn).toHaveBeenCalledTimes(2) + expect(refusals.refusal('session-1', corrupt).refusal).toMatchObject({ + details: { reason: 'journalCorrupt' } + }) + expect(warn).toHaveBeenCalledTimes(3) + refusals.forget('session-1') + refusals.refusal('session-1', corrupt) + expect(warn).toHaveBeenCalledTimes(4) + vi.restoreAllMocks() + }) +}) diff --git a/src/main/native-chat/agent-session-journal/journal-open-failure.ts b/src/main/native-chat/agent-session-journal/journal-open-failure.ts index 1835f691cb72..5e4cff1f3ee2 100644 --- a/src/main/native-chat/agent-session-journal/journal-open-failure.ts +++ b/src/main/native-chat/agent-session-journal/journal-open-failure.ts @@ -2,6 +2,11 @@ // past, or the open failed in a way that can clear (a lock, permissions, too many open files). import type { AgentSessionRefusalReason } from '../../../shared/agent-session-refusal-details' +import { + AgentSessionRefusalError, + isAgentSessionRefusalError, + refuse +} from '../../../shared/agent-session-wire-refusals' import { isSqliteCorruption } from '../../sqlite/sqlite-read-failure' export type JournalOpenFailure = AgentSessionRefusalReason<'agent_session_journal_unreadable'> @@ -20,3 +25,56 @@ export function classifyJournalOpenFailure(error: unknown): JournalOpenFailure { } return 'journalUnavailable' } + +/** + * What a read throws when the conversation it reaches cannot be opened. The storage's own text + * (a path, "file is not a database") goes to the log only; the reader gets the classified refusal, + * whose message stays the bare code. + */ +export function journalOpenReadRefusal(error: unknown): AgentSessionRefusalError { + if (isAgentSessionRefusalError(error)) { + return error + } + return unreadableRefusal(error, classifyJournalOpenFailure(error), true) +} + +const MAX_LOGGED_SESSIONS = 256 + +/** + * The read door's refusals for one host. A reader reconnects on a timer while an open can clear, + * so a session's failure is logged once until that session opens or the failure changes. + */ +export function createJournalOpenReadRefusals() { + const logged = new Map() + return { + refusal: (sessionId: string, error: unknown): AgentSessionRefusalError => { + if (isAgentSessionRefusalError(error)) { + return error + } + const reason = classifyJournalOpenFailure(error) + const failure = `${reason}:${error instanceof Error ? error.message : String(error)}` + const repeat = logged.get(sessionId) === failure + // Past the cap a new session logs every failure rather than evict another's. + if (!repeat && (logged.has(sessionId) || logged.size < MAX_LOGGED_SESSIONS)) { + logged.set(sessionId, failure) + } + return unreadableRefusal(error, reason, !repeat) + }, + /** The session opened or closed: its next failure is news. */ + forget: (sessionId: string): void => { + logged.delete(sessionId) + } + } +} + +function unreadableRefusal( + error: unknown, + reason: JournalOpenFailure, + log: boolean +): AgentSessionRefusalError { + if (log) { + console.warn('[agent-session] opening the conversation for a read failed:', error) + } + const code = 'agent_session_journal_unreadable' + return new AgentSessionRefusalError(refuse(code, { reason }, code), { cause: error }) +} diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-lifetime.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-lifetime.ts index e81eb9ae9763..0fbd1a0a233c 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-lifetime.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-lifetime.ts @@ -5,11 +5,11 @@ // public entry point here takes the session's serialize once and calls the under-serialize forms, // because the queue is not reentrant. -import { TUI_AGENT_DISPLAY_NAMES } from '../../../shared/tui-agent-display-names' import { AgentSessionRefusalError, agentSessionRefusalError } from '../../../shared/agent-session-wire-refusals' +import { createJournalOpenReadRefusals } from '../agent-session-journal/journal-open-failure' import type { StructuredAgentSessionConversations } from './structured-agent-session-conversations' import { abandonQueuedStructuredAgentSessionMessages, @@ -40,6 +40,7 @@ export function createStructuredAgentSessionConversationLifetime(host: { let disposed = false const { sessions, serialize } = host const deps = () => host.context().deps + const readRefusals = createJournalOpenReadRefusals() // The sweep's stop puts an idle agent to rest: nothing is queued, so no loop reads its cause. const stopAgent = (sessionId: string) => stopStructuredAgentSessionAgentUnderSerialize(host.context(), sessionId) @@ -69,12 +70,11 @@ export function createStructuredAgentSessionConversationLifetime(host: { return record !== null && deps().hasOpenDispatch?.(record) === true }, stopAgent, - // A host stop with its reason: the delivery loop waiting on this child writes the one error - // row and rejects what is queued with it. + // A host stop: the delivery loop waiting on this child writes the one error row and rejects + // what is queued with it, both worded from the hostStopped fact. stopStartingAgent: (sessionId) => stopStructuredAgentSessionAgentUnderSerialize(host.context(), sessionId, { - cause: 'host-stop', - reason: `${TUI_AGENT_DISPLAY_NAMES[sessions.get(sessionId)?.params.provider ?? 'claude']} never finished starting, so Orca stopped it.` + cause: 'host-stop' }), closeConversation, onError: (sessionId, error) => deps().onEventSinkError?.({ sessionId, error }), @@ -98,6 +98,7 @@ export function createStructuredAgentSessionConversationLifetime(host: { conversation: async (sessionId: string): Promise => { const open = sessions.get(sessionId) if (open) { + readRefusals.forget(sessionId) return open } const record = deps().store.getRecord(sessionId) @@ -116,12 +117,15 @@ export function createStructuredAgentSessionConversationLifetime(host: { if (disposed) { throw new AgentSessionRefusalError(AGENT_SESSION_NOT_ATTACHED) } - const session = await host.open(sessionId) + const session = await host.open(sessionId).catch((error: unknown) => { + throw readRefusals.refusal(sessionId, error) + }) if (!session) { throw agentSessionRefusalError('agent_session_identity_required', { reason: 'recordMissing' }) } + readRefusals.forget(sessionId) return session }) }, @@ -129,6 +133,7 @@ export function createStructuredAgentSessionConversationLifetime(host: { * still queued will not be sent. */ close: (sessionId: string): Promise => serialize(sessionId, async () => { + readRefusals.forget(sessionId) const session = sessions.get(sessionId) if (session) { // Abandoned before the stop, so no start delivers it. diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts index 8fd9672b62fe..3bad8d9789f1 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-options-read.ts @@ -12,6 +12,7 @@ import { } from '../../../shared/agent-session-wire' import { decodeStructuredAgentSessionOptionValue } from '../../../shared/structured-agent-session-option-codec' import type { AgentSessionRecordStore } from '../../runtime/agent-session-record-store' +import { journalOpenReadRefusal } from '../agent-session-journal/journal-open-failure' import { isClaudeStructuredOptionKey } from '../../claude/claude-structured-options' import { isCodexTurnOptionKey } from '../../codex/codex-structured-turn-start' import type { StructuredAgentSessionHostDeps } from './structured-agent-session-host-types' @@ -96,7 +97,9 @@ export async function readStructuredAgentSessionOptions( ): Promise { const { adapter, store } = context.deps const live = await context.serialize(sessionId, async () => { - const session = await context.openConversation(sessionId) + const session = await context.openConversation(sessionId).catch((error: unknown) => { + throw journalOpenReadRefusal(error) + }) const child = session?.child if (!child) { return null diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-start-failure-row.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-start-failure-row.ts index c0660eb9791a..77ba7fe5f583 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-start-failure-row.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-start-failure-row.ts @@ -1,5 +1,6 @@ import { agentJournalItemKey } from '../../../shared/agent-session-journal-item-key' import { isQueuedAgentJournalSubmission } from '../../../shared/agent-session-queued-submission' +import { structuredAgentSessionStartFailureRowIdentity } from '../../../shared/structured-agent-session-start-failure-row-key' import type { JournalLifecycleMutationInput } from '../agent-session-journal/journal-row-builders' import type { StructuredAgentSessionHostSession } from './structured-agent-session-host-types' import type { StructuredAgentSessionStartFailureWords } from './structured-agent-session-failure-text' @@ -21,7 +22,7 @@ export function structuredAgentSessionStartFailureRow( ): JournalLifecycleMutationInput { return { kind: 'item', - identity: startFailureRowIdentity(startKey), + identity: structuredAgentSessionStartFailureRowIdentity(startKey), // The row repeats the sentence the start's rejected messages carry. body: { kind: 'status', text: words.reason, tone: 'error', failure: words.rejection } } @@ -33,14 +34,10 @@ export function hasStructuredAgentSessionStartFailureRow( items: readonly { itemId: string }[], startKey: string ): boolean { - const itemId = agentJournalItemKey(startFailureRowIdentity(startKey)) + const itemId = agentJournalItemKey(structuredAgentSessionStartFailureRowIdentity(startKey)) return items.some((item) => item.itemId === itemId) } -function startFailureRowIdentity(startKey: string) { - return { provider: 'orca' as const, clientMessageId: `start-failure:${startKey}` } -} - /** * A start the delivery loop needed and did not get: the start's row, and every queued message * rejected with the same words. Writes nothing when nothing is still queued: a start whose diff --git a/src/main/runtime/rpc/methods/structured-agent-session-at-rest.test.ts b/src/main/runtime/rpc/methods/structured-agent-session-at-rest.test.ts index a3d598a69d88..df00957215f0 100644 --- a/src/main/runtime/rpc/methods/structured-agent-session-at-rest.test.ts +++ b/src/main/runtime/rpc/methods/structured-agent-session-at-rest.test.ts @@ -236,6 +236,78 @@ describe('the accessor', () => { }) }) + it('refuses a read whose journal will not open with the classified reason, never the storage text', async () => { + await restingChat() + const open = vi.spyOn(rig.host.collaboratorsForTests().conversationDelivery, 'open') + vi.spyOn(console, 'warn').mockImplementation(() => undefined) + const storagePath = '/Users/someone/.orca/journals/session-1/journal.sqlite' + const failWith = (error: Error): void => { + open.mockRejectedValue(error) + } + const failures = async (): Promise => + [ + ...(await call('agentSession.history', { sessionId: SESSION, direction: 'tail' })), + ...(await call('agentSession.subscribe', { sessionId: SESSION })), + ...(await call('agentSession.options', { sessionId: SESSION })) + ].filter((reply) => !reply.ok) + + failWith( + Object.assign(new Error(`file is not a database: ${storagePath}`), { + code: 'ERR_SQLITE_ERROR', + errcode: 26 + }) + ) + const corrupt = await failures() + failWith(Object.assign(new Error(`EACCES: permission denied, open '${storagePath}'`), {})) + const unavailable = await failures() + + for (const [replies, reason] of [ + [corrupt, 'journalCorrupt'], + [unavailable, 'journalUnavailable'] + ] as const) { + expect(replies).toHaveLength(3) + for (const reply of replies) { + expect(reply).toMatchObject({ + ok: false, + error: { + // Not a passthrough code: released clients read the message, which stays the code. + code: 'runtime_error', + message: 'agent_session_journal_unreadable', + data: { refusal: { code: 'agent_session_journal_unreadable', details: { reason } } } + } + }) + expect(JSON.stringify(reply)).not.toContain(storagePath) + } + } + }) + + it('logs a reader reconnecting to a journal that will not open once per failure', async () => { + await restingChat() + const open = vi.spyOn(rig.host.collaboratorsForTests().conversationDelivery, 'open') + const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) + const logged = (): unknown[] => + warn.mock.calls + .filter(([line]) => line === '[agent-session] opening the conversation for a read failed:') + .map(([, error]) => error) + const reconnect = async (): Promise => [ + ...(await call('agentSession.subscribe', { sessionId: SESSION })), + ...(await call('agentSession.history', { sessionId: SESSION, direction: 'tail' })) + ] + const denied = new Error('EACCES: permission denied') + const exhausted = new Error('EMFILE: too many open files') + + open.mockRejectedValue(denied) + for (let attempt = 0; attempt < 4; attempt += 1) { + // Every attempt is still refused with its reason; only the log is quiet. + expect((await reconnect()).filter((reply) => !reply.ok)).toHaveLength(2) + } + expect(logged()).toEqual([denied]) + open.mockRejectedValue(exhausted) + await reconnect() + await reconnect() + expect(logged()).toEqual([denied, exhausted]) + }) + it('opens a corrupt journal through the recovering open and still accepts a send (P2-03)', async () => { await foundRestTestChat(rig) await rig.host.flushAllStreamedEvents() diff --git a/src/renderer/src/components/native-chat/NativeChatDeliveryRetry.test.tsx b/src/renderer/src/components/native-chat/NativeChatDeliveryRetry.test.tsx deleted file mode 100644 index a897588f7c54..000000000000 --- a/src/renderer/src/components/native-chat/NativeChatDeliveryRetry.test.tsx +++ /dev/null @@ -1,57 +0,0 @@ -// @vitest-environment happy-dom -import '@testing-library/jest-dom/vitest' -import { cleanup, render, screen } from '@testing-library/react' -import { afterEach, describe, expect, it } from 'vitest' -import { - createStructuredAgentSessionOutboxEntry, - type StructuredAgentSessionOutboxEntry -} from '../../../../shared/structured-agent-session-outbox' -import { NativeChatDeliveryRetry } from './NativeChatDeliveryRetry' - -const blocked = createStructuredAgentSessionOutboxEntry({ - clientMessageId: 'client-1', - sessionId: 'session-1', - text: 'hello', - attachments: [], - queuedAt: 1 -}) - -function renderRow(entry: StructuredAgentSessionOutboxEntry): void { - render( - {}} - /> - ) -} - -afterEach(cleanup) - -describe("the Retry row's reason", () => { - it('chooses its words from the saved failure when it is shown', () => { - renderRow({ - ...blocked, - lastFailure: { kind: 'refused', code: 'agent_session_owner_restart_failed' } - }) - - expect( - screen.getByText("The agent couldn't restart. Your message was not sent.") - ).toBeInTheDocument() - }) - - it("shows a provider's rejection in the provider's words", () => { - renderRow({ - ...blocked, - lastFailure: { kind: 'rejected', reason: 'Claude messages support at most 20 images' } - }) - - expect(screen.getByText('Claude messages support at most 20 images')).toBeInTheDocument() - }) - - it('says only that the message was not sent when nothing more is known', () => { - renderRow(blocked) - - expect(screen.getByText('Message was not sent.')).toBeInTheDocument() - }) -}) diff --git a/src/renderer/src/components/native-chat/NativeChatDeliveryRetry.tsx b/src/renderer/src/components/native-chat/NativeChatDeliveryRetry.tsx deleted file mode 100644 index e37016d646d2..000000000000 --- a/src/renderer/src/components/native-chat/NativeChatDeliveryRetry.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { RotateCcw } from 'lucide-react' -import { - admitStructuredAgentSessionOutboxEntry, - type StructuredAgentSessionOutboxEntry -} from '../../../../shared/structured-agent-session-outbox' -import { structuredAgentSessionAttemptFailureParts } from '../../../../shared/structured-agent-session-send-disposition' -import { agentSessionWriteNoticeText } from './agent-session-write-notice-text' -import { Button } from '@/components/ui/button' -import { translate } from '@/i18n/i18n' - -export function NativeChatDeliveryRetry({ - outbox, - blockedClientMessageId, - retry -}: { - outbox: readonly StructuredAgentSessionOutboxEntry[] - blockedClientMessageId: string | null - retry: (clientMessageId: string) => void -}): React.JSX.Element | null { - // Why: read through the drain's own rule, so Retry can never name an entry other than the one - // the queue actually stopped on -- which is no longer always the head. A rejected entry holds - // nothing up, so it is offered only when the queue itself is not stopped. - const admission = admitStructuredAgentSessionOutboxEntry(outbox, blockedClientMessageId) - const retryable = - admission.state === 'blocked' - ? admission.entry - : (outbox.find((entry) => entry.state === 'rejected') ?? null) - if (!retryable) { - return null - } - return ( -

- - {retryable.state === 'unconfirmed' - ? translate( - 'auto.components.native.chat.NativeChatStructuredSession.1f772bb5d0', - 'Message delivery is unconfirmed.' - ) - : retryable.lastFailure - ? agentSessionWriteNoticeText( - structuredAgentSessionAttemptFailureParts(retryable.lastFailure) - ) - : translate( - 'auto.components.native.chat.NativeChatStructuredSession.93ef441197', - 'Message was not sent.' - )} - - -
- ) -} diff --git a/src/renderer/src/components/native-chat/NativeChatEmptyState.test.tsx b/src/renderer/src/components/native-chat/NativeChatEmptyState.test.tsx index dc2639afca20..dccfaba728c8 100644 --- a/src/renderer/src/components/native-chat/NativeChatEmptyState.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatEmptyState.test.tsx @@ -30,9 +30,27 @@ it('shows the host message in place of the terminal-backed default', () => { expect(screen.queryByText(/Toggle back to the terminal/)).toBeNull() }) -it('keeps the structured chat retrying line when the host sent a message', () => { - render() +// The structured chat passes words only from the notice table, never the host's. +it("says the structured chat's own words for the failure once, as the title, above its retrying line", () => { + render( + + ) + expect(screen.getByText("Orca couldn't open this chat's history right now.")).toHaveClass( + 'font-medium' + ) + expect(screen.queryByText('Could not load conversation')).toBeNull() expect( screen.getByText('The transcript could not be read. Orca keeps trying to load it.') ).toBeInTheDocument() }) + +it('says a failure no retry gets past in its one line, with nothing of trying again', () => { + render() + expect(screen.getByText('Unable to load this chat.')).toHaveClass('font-medium') + expect(screen.queryByText('Could not load conversation')).toBeNull() + expect(screen.queryByText(/keeps trying|Toggle back/)).toBeNull() +}) diff --git a/src/renderer/src/components/native-chat/NativeChatEmptyState.tsx b/src/renderer/src/components/native-chat/NativeChatEmptyState.tsx index ed2299d2fc29..ec84f554cd76 100644 --- a/src/renderer/src/components/native-chat/NativeChatEmptyState.tsx +++ b/src/renderer/src/components/native-chat/NativeChatEmptyState.tsx @@ -7,17 +7,20 @@ import type { NativeChatSession } from '../../../../shared/native-chat-types' export function NativeChatEmptyState({ kind, message, + headline, agent, retrying = false }: { kind: 'loading' | 'empty' | 'error' | 'not-agent' message?: string + /** The chat's own sentence for the failure, said once: it takes the generic title's place. */ + headline?: string agent?: NativeChatSession['agent'] /** The read retries on its own (structured chat), so the error says so instead of pointing - * back to the terminal. The host's message is on the pane's status line already. */ + * back to the terminal. */ retrying?: boolean }): React.JSX.Element { - const copy = emptyStateCopy(kind, message, agent, retrying) + const copy = emptyStateCopy(kind, { message, headline }, agent, retrying) return (
void }): React.JSX.Element | null { if (lifecycle !== 'failed' && lifecycle !== 'visibility-unknown') { @@ -25,11 +32,17 @@ export function NativeChatLaunchRetry({ 'auto.components.native.chat.NativeChatLaunchRetry.unknown', 'Chat connection could not be confirmed.' ) + const cause = + lifecycle === 'failed' && failure + ? agentSessionWriteNoticeText( + agentSessionRefusalCauseParts(failure, agentLabel ? { agentName: agentLabel } : {}) + ) + : '' return (
{message} - {lifecycle === 'failed' && failureReason ? ` ${failureReason}` : null} + {cause ? ` ${cause}` : null}
) : null} - {deliveryFailed ? ( -
- {translate( - 'components.native-chat.launchPromptNotDelivered', - 'Not delivered — check the terminal' - )} + {deliveryNotice ? ( +
+ {deliveryNotice.text} + {deliveryNotice.onRetry ? ( + + ) : null}
) : null}
diff --git a/src/renderer/src/components/native-chat/NativeChatResolvedView.tsx b/src/renderer/src/components/native-chat/NativeChatResolvedView.tsx index e711d62245a3..fb432e1e5b4c 100644 --- a/src/renderer/src/components/native-chat/NativeChatResolvedView.tsx +++ b/src/renderer/src/components/native-chat/NativeChatResolvedView.tsx @@ -6,6 +6,7 @@ import { useNativeChatRetainedSession } from './use-native-chat-retained-session import { isNativeChatTranscriptUnsettled } from './native-chat-live-session-contract' import { selectNativeChatViewState } from './native-chat-view-state' import { NativeChatMessageList } from './NativeChatMessageList' +import { useNativeChatLaunchPromptDeliveryNotice } from './use-native-chat-launch-prompt-delivery-notice' import { NativeChatComposer, type NativeChatComposerHandle } from './NativeChatComposer' import { useNativeChatFontScale } from './use-native-chat-font-scale' import { useNativeChatCanSend } from './use-native-chat-can-send' @@ -246,13 +247,10 @@ export function NativeChatResolvedView({ ? sessionWithLaunchPrompt : { ...sessionWithLaunchPrompt, messages } }, [sessionWithLaunchPrompt, commandMarkers]) - const failedLaunchPromptMessageIds = useMemo(() => { - const id = paneLaunchPrompt?.failed ? launchPromptMessage?.id : null - if (!id || !sessionAfterCommandBoundaries.messages.some((message) => message.id === id)) { - return undefined - } - return new Set([id]) - }, [paneLaunchPrompt?.failed, launchPromptMessage?.id, sessionAfterCommandBoundaries.messages]) + const launchPromptDeliveryNotices = useNativeChatLaunchPromptDeliveryNotice( + paneLaunchPrompt?.failed ? launchPromptMessage?.id : null, + sessionAfterCommandBoundaries.messages + ) // The streaming preview bubble (if any) sits after the transcript but before // the optimistic user echoes — same order mobile uses. @@ -408,7 +406,7 @@ export function NativeChatResolvedView({ showTurnStatus={false} onLinkClick={onLinkClick} allowFileUriLinks={fileLinkContext !== null} - failedDeliveryMessageIds={failedLaunchPromptMessageIds} + deliveryNotices={launchPromptDeliveryNotices} /> )}
diff --git a/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx b/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx index cb777f910f21..f86fc972c22f 100644 --- a/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx @@ -4,6 +4,10 @@ import { cleanup, render, screen, waitFor } from '@testing-library/react' import type * as ReactModule from 'react' import { afterEach, describe, expect, it, vi } from 'vitest' import type { SessionOptionDescriptor } from '../../../../shared/native-chat-session-options' +import { RuntimeRpcCallError } from '@/runtime/runtime-rpc-result' + +const toastError = vi.hoisted(() => vi.fn()) +vi.mock('sonner', () => ({ toast: { error: toastError } })) vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string, values?: Record) => { @@ -441,6 +445,55 @@ describe('NativeChatSessionOptionPickers', () => { await waitFor(() => expect(invokeAction).toHaveBeenCalledWith('model')) }) + it.each([ + [ + "the table's words for a host's refusal, not its message", + new RuntimeRpcCallError({ + id: 'request-1', + ok: false, + error: { + code: 'runtime_error', + message: 'agent_session_journal_unreadable', + data: { + refusal: { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalCorrupt' } + } + } + }, + _meta: { runtimeId: 'runtime-1' } + }), + "Unable to load this chat. The setting wasn't changed." + ], + [ + "a local surface's own sentence", + new Error('The terminal did not accept the command.'), + 'The terminal did not accept the command.' + ] + ])('describes a failed option change with %s', async (_label, error, description) => { + toastError.mockClear() + const invokeAction = vi.fn().mockRejectedValue(error) + render( + + ) + screen.getByRole('button', { name: 'Choose in agent picker…' }).click() + await waitFor(() => + expect(toastError).toHaveBeenCalledExactlyOnceWith('Could not update option', { + description + }) + ) + }) + it('uses a Toggle action for unknown flip-only options via invokeAction', async () => { const invokeAction = vi.fn().mockResolvedValue({ snapshot: [] }) const setOption = vi.fn().mockResolvedValue({ snapshot: [] }) diff --git a/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsx b/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsx index 507103d485f0..0dacff0289e8 100644 --- a/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsx +++ b/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.tsx @@ -32,6 +32,9 @@ import { nativeChatSessionOptionLabel } from './native-chat-session-option-labels' import type { NativeChatOptionPickerRequest } from './native-chat-composer-types' +import { agentSessionThrownFailure } from '../../../../shared/agent-session-write-failure' +import { RuntimeRpcCallError } from '@/runtime/runtime-rpc-result' +import { agentSessionWriteFailureText } from './agent-session-write-notice-text' export type NativeChatSessionOptionPickersProps = { surface: SessionOptionsSurface | null @@ -204,6 +207,15 @@ function DescriptorMenuRows(props: { ) } +/** A host's error is words for its log, so it gets the table's; a local surface's error is + * already written for the person. */ +function optionUpdateFailureDescription(error: unknown): string { + if (error instanceof RuntimeRpcCallError) { + return agentSessionWriteFailureText(agentSessionThrownFailure(error, error.code), 'option') + } + return error instanceof Error ? error.message : String(error) +} + function runSurfaceCall( pendingKey: string, setPendingId: (id: string | null) => void, @@ -214,7 +226,7 @@ function runSurfaceCall( .catch((error) => { toast.error( translate('components.native-chat.composer.optionUpdateFailed', 'Could not update option'), - { description: error instanceof Error ? error.message : String(error) } + { description: optionUpdateFailureDescription(error) } ) }) .finally(() => setPendingId(null)) diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.launch-lifecycle.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.launch-lifecycle.test.tsx index 9513d0cfeb60..644c1c657500 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.launch-lifecycle.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.launch-lifecycle.test.tsx @@ -26,6 +26,14 @@ vi.mock('./NativeChatQuestionCard', () => moduleFactories.nativeChatQuestionCard import { NativeChatStructuredSession } from './NativeChatStructuredSession' import { readOutbox } from './structured-agent-session-outbox-storage' +const NOT_SIGNED_IN = { + kind: 'refused', + code: 'agent_session_operation_invalid', + details: { reason: 'notSignedIn' } +} as const +// Retry beside it is the resend, so the words keep only the step before it. +const NOT_SIGNED_IN_TEXT = 'Codex is not signed in for the selected account. Sign in first.' + function sessionView(): React.JSX.Element { return ( { expect(mocks.retryLaunch).toHaveBeenCalledWith('wt-1', 'session-1') }) - it('shows why a failed launch failed beside Retry', () => { + it('words why a failed launch failed beside Retry from the refusal, never its code', () => { + mocks.launchLifecycle = 'failed' + mocks.launchFailure = NOT_SIGNED_IN + render(sessionView()) + + expect(screen.getByText(`Chat could not be started. ${NOT_SIGNED_IN_TEXT}`)).toBeTruthy() + expect(screen.queryByText(/agent_session_/)).toBeNull() + }) + + it("keeps a step the Retry doesn't take, and drops one it does", () => { + mocks.launchLifecycle = 'failed' + mocks.launchFailure = { + kind: 'refused', + code: 'agent_session_conflict', + details: { reason: 'claimConflicted' } + } + const { rerender } = render(sessionView()) + expect( + screen.getByText( + 'Chat could not be started. This chat is still open in a terminal agent. Quit that agent to continue the chat here.' + ) + ).toBeTruthy() + + mocks.launchFailure = { + kind: 'refused', + code: 'agent_session_journal_unreadable', + details: { reason: 'journalUnavailable' } + } + rerender(sessionView()) + expect( + screen.getByText( + "Chat could not be started. Orca couldn't open this chat's history right now." + ) + ).toBeTruthy() + }) + + it('says only that the chat could not start when the refusal names no reason', () => { mocks.launchLifecycle = 'failed' - mocks.launchFailureReason = 'claude is not signed in' + mocks.launchFailure = { kind: 'refused', code: 'agent_session_operation_invalid' } render(sessionView()) - expect(screen.getByText('Chat could not be started. claude is not signed in')).toBeTruthy() + expect(screen.getByText('Chat could not be started.')).toBeTruthy() + expect(screen.queryByText(/agent_session_/)).toBeNull() }) it('keeps a stale reason off a launch that is no longer failed', () => { mocks.launchLifecycle = 'visibility-unknown' - mocks.launchFailureReason = 'claude is not signed in' + mocks.launchFailure = NOT_SIGNED_IN render(sessionView()) expect(screen.getByText('Chat connection could not be confirmed.')).toBeTruthy() @@ -177,10 +222,10 @@ describe('NativeChatStructuredSession launch lifecycle', () => { const { rerender } = render(sessionView()) expect(composerSend()('still there?', [])).toBe(true) - mocks.launchFailureReason = 'claude is not signed in' + mocks.launchFailure = NOT_SIGNED_IN rerender(sessionView()) - expect(screen.getByText('Chat could not be started. claude is not signed in')).toBeTruthy() + expect(screen.getByText(`Chat could not be started. ${NOT_SIGNED_IN_TEXT}`)).toBeTruthy() expect(mocks.call).not.toHaveBeenCalled() expect(readOutbox('session-1')).toEqual([ expect.objectContaining({ diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.read-error.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.read-error.test.tsx index 8edcd625ef44..89ef518feb3b 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.read-error.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.read-error.test.tsx @@ -26,13 +26,7 @@ afterEach(() => { resetStructuredSessionMocks() }) -// The read transport always hands the pane the host's words, so the retrying line must not hide -// behind them; those words show once, on the status line. -it('says a failed read keeps retrying, and shows the host message once', () => { - mocks.status = 'error' - mocks.readError = 'journal unreadable' - mocks.messages = [] - +function renderPane(): void { render( { agent="codex" /> ) +} + +function journalRefusal(reason: 'journalCorrupt' | 'journalUnavailable') { + return { code: 'agent_session_journal_unreadable', details: { reason } } as const +} + +// The host's message and code never reach the pane; it words the refusal, and says it once. +it('says a failed read with no refusal keeps retrying, and adds nothing of the host', () => { + mocks.status = 'error' + mocks.messages = [] + + renderPane() expect(screen.getByText('Could not load conversation')).toBeTruthy() expect( screen.getByText('The transcript could not be read. Orca keeps trying to load it.') ).toBeTruthy() - expect(screen.getAllByText('journal unreadable')).toHaveLength(1) + expect(screen.queryByText(/history couldn't be loaded/)).toBeNull() expect(screen.queryByText(/Toggle back to the terminal/)).toBeNull() }) + +it('says a damaged history cannot load in one line, without claiming Orca keeps trying', () => { + mocks.status = 'error' + mocks.readRefusal = journalRefusal('journalCorrupt') + mocks.messages = [] + + renderPane() + + expect(screen.getAllByText('Unable to load this chat.')).toHaveLength(1) + expect(screen.queryByText('Could not load conversation')).toBeNull() + expect(screen.queryByText(/keeps trying/)).toBeNull() + expect(screen.queryByText(/agent_session_/)).toBeNull() +}) + +it("names a history that couldn't open right now once, and that the pane keeps trying", () => { + mocks.status = 'error' + mocks.readRefusal = journalRefusal('journalUnavailable') + mocks.messages = [] + + renderPane() + + expect(screen.getAllByText("Orca couldn't open this chat's history right now.")).toHaveLength(1) + expect(screen.queryByText('Could not load conversation')).toBeNull() + expect( + screen.getByText('The transcript could not be read. Orca keeps trying to load it.') + ).toBeTruthy() + expect(screen.queryByText(/Try again/)).toBeNull() +}) + +it('says only that it is reconnecting, not as an error, when a failure names nothing', () => { + mocks.status = 'error' + + renderPane() + + expect(screen.getByTestId('message-list')).toBeTruthy() + const reconnecting = screen.getByText('Reconnecting to this chat…') + expect(reconnecting.className).not.toContain('text-destructive') + expect(screen.queryByText(/history couldn't be loaded/)).toBeNull() +}) + +it('words a failed reconnect beside a transcript it keeps', () => { + mocks.status = 'error' + mocks.readRefusal = journalRefusal('journalUnavailable') + + renderPane() + + expect(screen.getByTestId('message-list')).toBeTruthy() + expect(screen.getByText("Orca couldn't open this chat's history right now.")).toBeTruthy() +}) diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.start-failure-notice.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.start-failure-notice.test.tsx new file mode 100644 index 000000000000..6f529c1d3c9f --- /dev/null +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.start-failure-notice.test.tsx @@ -0,0 +1,163 @@ +// @vitest-environment happy-dom + +import { cleanup, render, screen, waitFor, within } from '@testing-library/react' +import { afterEach, expect, it, vi } from 'vitest' +import type { AgentSessionFailureFact } from '../../../../shared/agent-session-failure' +import { agentSessionFailureWords } from '../../../../shared/agent-session-failure-words' +import { + agentJournalItemKey, + agentJournalSubmissionKey +} from '../../../../shared/agent-session-journal-item-key' +import type { AgentJournalRenderItem } from '../../../../shared/agent-session-journal-types' +import { structuredAgentSessionStartFailureRowIdentity } from '../../../../shared/structured-agent-session-start-failure-row-key' + +const { mocks, moduleFactories, resetStructuredSessionMocks } = await vi.hoisted(async () => + (await import('./NativeChatStructuredSession.test-harness')).createStructuredSessionMocks() +) + +vi.mock('@/runtime/structured-agent-session-client', () => + moduleFactories.structuredAgentSessionClient() +) +vi.mock('./use-structured-agent-session', () => moduleFactories.useStructuredAgentSession()) +vi.mock('./use-native-chat-font-scale', () => moduleFactories.useNativeChatFontScale()) +vi.mock('./use-native-chat-file-link-context', () => moduleFactories.useNativeChatFileLinkContext()) +vi.mock('./use-native-chat-file-link-click', () => moduleFactories.useNativeChatFileLinkClick()) +vi.mock('./NativeChatMessageList', () => moduleFactories.nativeChatMessageList()) +vi.mock('./NativeChatComposer', () => moduleFactories.nativeChatComposer()) +vi.mock('./NativeChatEmptyState', () => moduleFactories.nativeChatEmptyState()) +vi.mock('./NativeChatApprovalCard', () => moduleFactories.nativeChatApprovalCard()) +vi.mock('./NativeChatQuestionCard', () => moduleFactories.nativeChatQuestionCard()) + +import { NativeChatStructuredSession } from './NativeChatStructuredSession' + +afterEach(() => { + cleanup() + localStorage.clear() + resetStructuredSessionMocks() +}) + +const SESSION_ID = 'start-failure-session' +const START_FAILED: AgentSessionFailureFact = { kind: 'providerStartFailed' } +const START_FAILED_REASON = + 'Claude stopped before it finished starting. Send your message to try again.' + +function startFailureRow(fact: AgentSessionFailureFact): AgentJournalRenderItem { + return { + itemId: agentJournalItemKey(structuredAgentSessionStartFailureRowIdentity('generation-1')), + revision: 1, + sequence: 1, + observedAt: 1, + body: { + kind: 'status', + tone: 'error', + ...agentSessionFailureWords(fact, { agentName: 'Claude', surface: 'row' }) + } + } +} + +function rejected(clientMessageId: string, reason: string, rejection: AgentSessionFailureFact) { + return { + outbox: { + clientMessageId, + sessionId: SESSION_ID, + body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text: clientMessageId }] }, + previewUris: [], + state: 'rejected', + queuedAt: 1, + lastAttemptAt: null, + retryAfterUnknownSubmittedAt: null, + lastFailure: { kind: 'rejected', reason, rejection: { kind: rejection.kind } } + }, + submission: { + clientMessageId, + fence: 1, + payloadFingerprint: clientMessageId, + dispatchState: 'rejected', + providerItemId: null, + reason, + rejection, + submittedAt: 1, + resolvedAt: 1 + } + } +} + +function renderPane(messages: ReturnType[]): void { + mocks.mode = 'outbox' + mocks.submissions = messages.map((message) => message.submission) + localStorage.setItem( + `orca:desktopStructuredAgentSessionOutbox:v1:${encodeURIComponent(SESSION_ID)}`, + JSON.stringify(messages.map((message) => message.outbox)) + ) + render( + + ) +} + +async function notice(clientMessageId: string): Promise { + return waitFor(() => { + const row = document.querySelector( + `[data-message-id="${agentJournalSubmissionKey(clientMessageId)}"]` + ) + if (!row) { + throw new Error(`no notice on ${clientMessageId}`) + } + return row + }) +} + +// The start's own row says why, so its rejected messages say only that they were not sent. +it("says only 'not sent', with its Retry, on each message the failed start's row explains", async () => { + mocks.journalItems = [startFailureRow(START_FAILED)] + + renderPane([ + rejected('first', START_FAILED_REASON, START_FAILED), + rejected('second', START_FAILED_REASON, START_FAILED) + ]) + + for (const id of ['first', 'second']) { + const row = await notice(id) + expect(within(row).getByText('Your message was not sent.')).toBeTruthy() + expect(within(row).getByRole('button', { name: 'Retry' })).toBeTruthy() + } + expect(screen.queryByText(/stopped before it finished starting/)).toBeNull() +}) + +it('keeps the full notice on a message rejected for a reason no start-failure row states', async () => { + mocks.journalItems = [startFailureRow(START_FAILED)] + const providerRejected: AgentSessionFailureFact = { + kind: 'providerRejected', + detail: { text: 'Image type .bmp', audience: 'person' } + } + + renderPane([ + rejected('stated', START_FAILED_REASON, START_FAILED), + rejected( + 'other', + 'The provider did not accept this message: Image type .bmp.', + providerRejected + ) + ]) + + expect(within(await notice('stated')).getByText('Your message was not sent.')).toBeTruthy() + expect( + within(await notice('other')).getByText( + 'The provider did not accept this message: Image type .bmp.' + ) + ).toBeTruthy() +}) + +it("keeps the start failure's own words when its row is not loaded", async () => { + renderPane([rejected('first', START_FAILED_REASON, START_FAILED)]) + + expect( + within(await notice('first')).getByText('Claude stopped before it finished starting.') + ).toBeTruthy() +}) diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx index 5690c879db18..5689cf9689f8 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx @@ -2,7 +2,10 @@ import { forwardRef, useImperativeHandle, useRef } from 'react' import { vi } from 'vitest' import type { AgentJournalRenderItem } from '../../../../shared/agent-session-journal-types' import type { AgentSessionBackgroundTask } from '../../../../shared/agent-session-wire' +import type { AgentSessionWriteRefusal } from '../../../../shared/agent-session-write-failure' +import type { AgentSessionRefusalReference } from '../../../../shared/agent-session-wire-refusals' import type { NativeChatApprovalCardProps } from './NativeChatApprovalCard' +import type { NativeChatDeliveryNotice } from './NativeChatMessageRow' import type { NativeChatQuestionCardProps } from './NativeChatQuestionCard' import type { NativeChatLaunchSeed } from './native-chat-composer-types' import type { NativeChatOlderPageResult } from './native-chat-pagination' @@ -19,6 +22,32 @@ function nullable(): T | null { return null } +function absent(): T | undefined { + return undefined +} + +/** Stands in for the transcript: renders only each message's delivery notice and its Retry. */ +export function DeliveryNoticesMock({ + notices +}: { + notices?: ReadonlyMap +}): React.JSX.Element { + return ( +
+ {[...(notices ?? [])].map(([id, notice]) => ( +
+ {notice.text} + {notice.onRetry ? ( + + ) : null} +
+ ))} +
+ ) +} + type StructuredSessionMessageListProps = { allowFileUriLinks?: boolean isVisible?: boolean @@ -28,6 +57,7 @@ type StructuredSessionMessageListProps = { isWorking?: boolean runtimeContext?: unknown session?: { hasMore: boolean; loadingEarlier: boolean; loadEarlier: () => Promise } + deliveryNotices?: ReadonlyMap } const initialMessageListProps: StructuredSessionMessageListProps | null = null @@ -43,13 +73,13 @@ export function createStructuredSessionMocks() { call: vi.fn<(...args: never[]) => unknown>(), fileLinkClick: vi.fn<(...args: never[]) => unknown>(), launchLifecycle: nullable(), - launchFailureReason: nullable(), + launchFailure: nullable(), launchResumes: false, retryLaunch: vi.fn<(...args: never[]) => unknown>(), controllerProps: nullable<{ transportEnabled?: boolean }>(), mode: 'static' as 'static' | 'outbox', status: 'ready' as 'idle' | 'loading' | 'ready' | 'error', - readError: nullable(), + readRefusal: absent(), messages: null as null | unknown[], messageListProps: initialMessageListProps, composerProps: null as null | { @@ -60,6 +90,7 @@ export function createStructuredSessionMocks() { approvalCardProps: initialApprovalCardProps, questionCardProps: null as NativeChatQuestionCardProps | null, promptItems: [] as AgentJournalRenderItem[], + journalItems: new Array(), respond: vi.fn<(...args: never[]) => unknown>(), cancel: vi.fn<(...args: never[]) => unknown>(), handlePasteEvent: vi.fn<(...args: never[]) => unknown>(), @@ -90,6 +121,8 @@ export function createStructuredSessionMocks() { useStructuredAgentSession: async () => { const { useStructuredAgentSessionOutbox } = await import('./use-structured-agent-session-outbox') + const { projectStructuredAgentSessionMessages } = + await import('../../../../shared/structured-agent-session-message-projection') return { useStructuredAgentSession: (props: { sessionId: string @@ -104,11 +137,11 @@ export function createStructuredSessionMocks() { submissions: mocks.submissions as never }) return { - journalItems: [], + journalItems: mocks.journalItems, messages: mocks.messages ?? (mocks.mode === 'outbox' - ? [] + ? projectStructuredAgentSessionMessages([], outbox.outbox, []) : [ { id: 'message-1', @@ -124,13 +157,15 @@ export function createStructuredSessionMocks() { } ]), status: mocks.status, - error: mocks.readError ?? outbox.error, + error: outbox.error, + readRefusal: mocks.readRefusal, hasOlder: mocks.hasOlder, loadingOlder: mocks.loadingOlder, olderHistoryGeneration: mocks.olderHistoryGeneration, loadOlder: mocks.loadOlder, prompts: mocks.promptItems, outbox: outbox.outbox, + submissions: mocks.submissions, blockedClientMessageId: outbox.blockedClientMessageId, send: outbox.send, retry: outbox.retry, @@ -182,7 +217,7 @@ export function createStructuredSessionMocks() { getStructuredAgentSessionLaunchResumes: () => mocks.launchResumes, useStructuredAgentSessionLaunchSelection: () => null, useStructuredAgentSessionLaunchLifecycle: () => mocks.launchLifecycle, - useStructuredAgentSessionLaunchFailureReason: () => mocks.launchFailureReason + useStructuredAgentSessionLaunchFailure: () => mocks.launchFailure }), useNativeChatFontScale: () => ({ useNativeChatFontScale: () => ({ scale: 1 }) @@ -200,7 +235,7 @@ export function createStructuredSessionMocks() { nativeChatMessageList: () => ({ NativeChatMessageList: (props: typeof mocks.messageListProps) => { mocks.messageListProps = props - return
+ return } }), nativeChatComposer: () => ({ @@ -238,19 +273,20 @@ export function createStructuredSessionMocks() { const resetStructuredSessionMocks = (): void => { mocks.call.mockReset() mocks.launchLifecycle = null - mocks.launchFailureReason = null + mocks.launchFailure = null mocks.launchResumes = false mocks.retryLaunch.mockReset() mocks.controllerProps = null mocks.mode = 'static' mocks.status = 'ready' - mocks.readError = null + mocks.readRefusal = undefined mocks.messages = null mocks.messageListProps = null mocks.composerProps = null mocks.approvalCardProps = null mocks.questionCardProps = null mocks.promptItems = [] + mocks.journalItems = [] mocks.respond.mockReset() mocks.cancel.mockReset() mocks.handlePasteEvent.mockReset() diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx index 8d20c65bd48a..6daa3d3f62c9 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx @@ -1,4 +1,4 @@ -import { useMemo, useRef, useState } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { agentSessionPromptQuestions } from '../../../../shared/agent-session-question-answer' import { dispatchStructuredAgentSessionComposerCommand } from '../../../../shared/structured-agent-session-composer' import { structuredAgentSessionPaneKey } from '../../../../shared/structured-agent-session-projection' @@ -22,10 +22,15 @@ import { NativeChatStructuredSessionStatus } from './NativeChatStructuredSession import { useNativeChatLaunchDraftSignal } from './use-native-chat-launch-draft-adoption' import { NativeChatLaunchRetry } from './NativeChatLaunchRetry' import { useNativeChatProvisionalLaunch } from './use-native-chat-provisional-launch' -import { NativeChatDeliveryRetry } from './NativeChatDeliveryRetry' import { useStructuredAgentSessionHostExecutionPhase } from './StructuredAgentSessionStatusBridge' import { structuredAgentLabel } from '@/lib/structured-agent-session-launch-label' import { NativeChatThreadGoalBanner } from './NativeChatThreadGoalBanner' +import { structuredAgentSessionReadFailureNotice } from './structured-agent-session-read-failure-notice' +import { useStructuredAgentSessionStartFailureFacts } from './use-structured-agent-session-start-failure-facts' +import { structuredAgentSessionDeliveryNotices } from './structured-agent-session-delivery-notices' +import type { AgentJournalSubmission } from '../../../../shared/agent-session-journal-types' + +const NO_SUBMISSIONS: readonly AgentJournalSubmission[] = [] export function NativeChatStructuredSession( props: Omit @@ -100,7 +105,46 @@ export function NativeChatStructuredSession( }), [controller, props.agent, props.sessionId] ) + // Read at click time, so the notices stay put while the outbox's Retry is rebuilt each render. + const retryRef = useRef(controller.retry) + useEffect(() => { + retryRef.current = controller.retry + }) + const retryDelivery = useCallback((clientMessageId: string) => { + retryRef.current(clientMessageId) + }, []) + const agentLabel = structuredAgentLabel(props.agent === 'codex' ? 'codex' : 'claude') + // Only a rejected message reads the journal's rows, so a new batch of them re-renders no row else. + const hasRejected = controller.outbox.some((entry) => entry.state === 'rejected') + const rejectionRows = hasRejected ? controller.submissions : NO_SUBMISSIONS + const startFailures = useStructuredAgentSessionStartFailureFacts( + controller.journalItems, + hasRejected + ) + const deliveryNotices = useMemo( + () => + structuredAgentSessionDeliveryNotices( + controller.outbox, + controller.blockedClientMessageId, + agentLabel, + retryDelivery, + rejectionRows, + startFailures + ), + [ + controller.outbox, + controller.blockedClientMessageId, + agentLabel, + retryDelivery, + rejectionRows, + startFailures + ] + ) const viewState = selectNativeChatViewState(session, { readRetries: true }) + const readFailure = + controller.status === 'error' + ? structuredAgentSessionReadFailureNotice(controller.readRefusal) + : null const fontScale = useNativeChatFontScale(viewState.kind === 'ready') const imageRuntimeContext = useNativeChatImageRuntimeContext(props.tabId) const { onLinkClick, linkActionRequest, closeLinkActions } = useNativeChatLinkActions( @@ -217,7 +261,11 @@ export function NativeChatStructuredSession( {viewState.kind === 'loading' ? ( ) : viewState.kind === 'error' ? ( - + ) : viewState.kind === 'empty' ? ( ) : ( @@ -237,24 +285,26 @@ export function NativeChatStructuredSession( onLinkClick={onLinkClick} allowFileUriLinks={onLinkClick !== undefined} runtimeContext={imageRuntimeContext} + deliveryNotices={deliveryNotices} /> )}
- ({ call: vi.fn(), @@ -45,6 +46,8 @@ vi.mock('@/runtime/structured-agent-session-client', () => ({ vi.mock('./use-structured-agent-session', async () => { const { useStructuredAgentSessionOutbox } = await import('./use-structured-agent-session-outbox') + const { projectStructuredAgentSessionMessages } = + await import('../../../../shared/structured-agent-session-message-projection') return { useStructuredAgentSession: (props: { sessionId: string @@ -60,7 +63,7 @@ vi.mock('./use-structured-agent-session', async () => { journalItems: [], messages: mocks.mode === 'outbox' - ? [] + ? projectStructuredAgentSessionMessages([], outbox.outbox, []) : [ { id: 'message-1', @@ -77,6 +80,7 @@ vi.mock('./use-structured-agent-session', async () => { loadOlder: vi.fn(), prompts: mocks.promptItems, outbox: outbox.outbox, + submissions: mocks.submissions, blockedClientMessageId: outbox.blockedClientMessageId, send: outbox.send, retry: outbox.retry, @@ -131,12 +135,19 @@ vi.mock('./use-native-chat-file-link-click', () => ({ useNativeChatFileLinkClick: (context: unknown) => (context ? mocks.fileLinkClick : undefined) })) -vi.mock('./NativeChatMessageList', () => ({ - NativeChatMessageList: (props: typeof mocks.messageListProps) => { - mocks.messageListProps = props - return
+vi.mock('./NativeChatMessageList', async () => { + const { DeliveryNoticesMock } = await import('./NativeChatStructuredSession.test-harness') + return { + NativeChatMessageList: ( + props: NonNullable & { + deliveryNotices?: ReadonlyMap + } + ) => { + mocks.messageListProps = props + return + } } -})) +}) vi.mock('./NativeChatComposer', () => ({ NativeChatComposer: forwardRef((props: typeof mocks.composerProps, ref) => { @@ -280,6 +291,128 @@ describe('NativeChatStructuredSession delivery', () => { expect(request.envelope.clientOperationId).toBe('op-head') }) + it('offers a rejected message no Retry while the queue is stopped, and gives it back once it moves', async () => { + mocks.mode = 'outbox' + mocks.submissions = [] + mocks.call.mockResolvedValue({ + ok: true, + value: { submission: { clientMessageId: 'op-head', dispatchState: 'accepted' } } + }) + seedOutbox('session-held-rejected', [ + seededEntry('session-held-rejected', 'op-head', 'first', 'unconfirmed'), + { + ...seededEntry('session-held-rejected', 'op-rejected', 'second', 'queued'), + state: 'rejected', + lastFailure: { kind: 'rejected', reason: 'Claude messages support at most 20 images' } + } + ]) + + render( + + ) + + await waitFor(() => expect(screen.getByText('Message delivery is unconfirmed.')).toBeTruthy()) + expect(screen.getByText('Claude messages support at most 20 images')).toBeTruthy() + // One Retry, the stopped message's: it sends only that one. + fireEvent.click(screen.getByRole('button', { name: /Retry/ })) + await waitFor(() => expect(mocks.call).toHaveBeenCalledOnce()) + expect(mocks.call.mock.calls[0]?.[2]).toMatchObject({ + envelope: { clientOperationId: 'op-head' } + }) + + // The queue moved, so the rejected message offers its own Retry again. + await waitFor(() => expect(screen.queryByText('Message delivery is unconfirmed.')).toBeNull()) + expect(screen.getByText('Claude messages support at most 20 images')).toBeTruthy() + expect(screen.getAllByRole('button', { name: /Retry/ })).toHaveLength(1) + expect(mocks.call).toHaveBeenCalledOnce() + }) + + it("words a failed start on each message by the chat's agent, leaving the resend to its Retry", async () => { + mocks.mode = 'outbox' + mocks.submissions = [] + const startFailed = (clientMessageId: string, text: string) => ({ + ...seededEntry('session-start-failed', clientMessageId, text, 'queued'), + state: 'rejected' as const, + lastFailure: { + kind: 'rejected' as const, + reason: 'Codex stopped before it finished starting. Send your message to try again.', + rejection: { kind: 'providerStartFailed' as const } + } + }) + seedOutbox('session-start-failed', [ + startFailed('op-first', 'first'), + startFailed('op-second', 'second') + ]) + + render( + + ) + + await waitFor(() => + expect(screen.getAllByText('Codex stopped before it finished starting.')).toHaveLength(2) + ) + expect(screen.getAllByRole('button', { name: /Retry/ })).toHaveLength(2) + expect(screen.queryByText(/Send your message to try again/)).toBeNull() + }) + + it("words a rejected message from its loaded journal row, not the message's own copy", async () => { + mocks.mode = 'outbox' + const reason = "Claude couldn't start. Send your message to try again." + mocks.submissions = [ + { + clientMessageId: 'op-recorded', + fence: 1, + payloadFingerprint: 'fingerprint', + dispatchState: 'rejected', + providerItemId: null, + reason, + rejection: { + kind: 'startFailed', + refusal: { code: 'agent_session_identity_required', details: { reason: 'recordMissing' } } + }, + submittedAt: 1, + resolvedAt: 1 + } + ] + seedOutbox('session-recorded', [ + { + ...seededEntry('session-recorded', 'op-recorded', 'first', 'queued'), + state: 'rejected', + lastFailure: { kind: 'rejected', reason, rejection: { kind: 'startFailed' } } + } + ]) + + render( + + ) + + await waitFor(() => + expect(screen.getByText("Codex couldn't start. Start a new chat to continue.")).toBeTruthy() + ) + expect(screen.queryByText(reason)).toBeNull() + }) + it('names the stuck message behind an admitted head, and its Retry sends that one', async () => { mocks.mode = 'outbox' mocks.submissions = [] diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSessionStatus.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSessionStatus.tsx index 86a2b858a422..2f33b0ed0c3a 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSessionStatus.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSessionStatus.tsx @@ -18,6 +18,8 @@ export function NativeChatStructuredSessionStatus(props: { /** The host's word on the provider child; `starting` is published but not yet answering. */ startupPhase: 'starting' | 'ready' | null error: string | null + /** A read the pane is reconnecting on its own: said plainly, not as an error. */ + reconnecting?: boolean composerError: string | null isVisible: boolean backgroundTasks: StructuredSessionBackgroundTasksView @@ -68,6 +70,11 @@ export function NativeChatStructuredSessionStatus(props: { )}

) : null} + {props.reconnecting && !props.error ? ( +

+ {translate('components.native-chat.state.reconnecting', 'Reconnecting to this chat…')} +

+ ) : null} {props.error || props.composerError ? (

{props.error ?? props.composerError} diff --git a/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx b/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx index b27736c71bbe..fb58acb7280d 100644 --- a/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx @@ -1,7 +1,7 @@ import { memo } from 'react' import type { CommentMarkdownLinkClickHandler } from '@/components/sidebar/CommentMarkdown' import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' -import { MessageRow } from './NativeChatMessageRow' +import { MessageRow, type NativeChatDeliveryNotice } from './NativeChatMessageRow' import { NativeChatResolutionReceipt } from './NativeChatResolutionReceipt' import { NativeChatWorkingStatus } from './NativeChatWorkingStatus' import { NativeChatTurnDiffRollup } from './NativeChatTurnDiffRollup' @@ -17,7 +17,8 @@ export type NativeChatTranscriptRowContext = { revealedDiff: NativeChatDiffReveal | null taskListPredecessors: ReadonlyMap expandedTurnIds: ReadonlySet - failedDeliveryMessageIds?: ReadonlySet + /** Keyed by message id: the user messages that did not go through, each with its own words. */ + deliveryNotices?: ReadonlyMap allowFileUriLinks: boolean runtimeContext?: RuntimeFileOperationArgs | null onLinkClick?: CommentMarkdownLinkClickHandler @@ -60,7 +61,7 @@ export const NativeChatTranscriptRow = memo(function NativeChatTranscriptRow({ onScrollMessageToTop={context.onScrollMessageToTop} onLinkClick={context.onLinkClick} allowFileUriLinks={context.allowFileUriLinks} - deliveryFailed={context.failedDeliveryMessageIds?.has(message.id) === true} + deliveryNotice={context.deliveryNotices?.get(message.id)} structuredActivityUi={context.showTurnStatus} folded={slot.folded} runtimeContext={context.runtimeContext} diff --git a/src/renderer/src/components/native-chat/structured-agent-session-delivery-notices.test.ts b/src/renderer/src/components/native-chat/structured-agent-session-delivery-notices.test.ts new file mode 100644 index 000000000000..faadac1127ef --- /dev/null +++ b/src/renderer/src/components/native-chat/structured-agent-session-delivery-notices.test.ts @@ -0,0 +1,414 @@ +import { describe, expect, it, vi } from 'vitest' +import type { AgentSessionFailureFact } from '../../../../shared/agent-session-failure' +import type { + AgentJournalRenderItem, + AgentJournalSubmission +} from '../../../../shared/agent-session-journal-types' +import { + createStructuredAgentSessionOutboxEntry, + type StructuredAgentSessionOutboxEntry +} from '../../../../shared/structured-agent-session-outbox' +import { agentSessionFailureWords } from '../../../../shared/agent-session-failure-words' +import { + agentJournalItemKey, + agentJournalSubmissionKey +} from '../../../../shared/agent-session-journal-item-key' +import { structuredAgentSessionStartFailureRowIdentity } from '../../../../shared/structured-agent-session-start-failure-row-key' +import { + structuredAgentSessionDeliveryNotices, + structuredAgentSessionStartFailureFacts +} from './structured-agent-session-delivery-notices' + +function entry( + clientMessageId: string, + patch: Partial = {} +): StructuredAgentSessionOutboxEntry { + return { + ...createStructuredAgentSessionOutboxEntry({ + clientMessageId, + sessionId: 'session-1', + text: clientMessageId, + attachments: [], + queuedAt: 1 + }), + ...patch + } +} + +function texts( + outbox: StructuredAgentSessionOutboxEntry[], + blocked: string | null = null, + submissions: readonly AgentJournalSubmission[] = [], + startFailures: readonly AgentSessionFailureFact[] = [] +): Record { + const notices = structuredAgentSessionDeliveryNotices( + outbox, + blocked, + 'Claude', + () => {}, + submissions, + startFailures + ) + return Object.fromEntries([...notices].map(([id, notice]) => [id, notice.text])) +} + +describe('the notice on each message that did not go through', () => { + it('gives two failed messages each their own reason and their own Retry', () => { + const retry = vi.fn() + const notices = structuredAgentSessionDeliveryNotices( + [ + entry('first', { + state: 'rejected', + lastFailure: { kind: 'rejected', reason: 'Claude messages support at most 20 images' } + }), + entry('second', { + state: 'rejected', + lastFailure: { + kind: 'rejected', + reason: 'Claude never finished starting, so Orca stopped it.', + rejection: { kind: 'hostStopped' } + } + }) + ], + null, + 'Claude', + retry, + [], + [] + ) + + expect([...notices.keys()]).toEqual([ + agentJournalSubmissionKey('first'), + agentJournalSubmissionKey('second') + ]) + expect(notices.get(agentJournalSubmissionKey('first'))?.text).toBe( + 'Claude messages support at most 20 images' + ) + expect(notices.get(agentJournalSubmissionKey('second'))?.text).toBe( + 'Claude never finished starting, so Orca stopped it.' + ) + notices.get(agentJournalSubmissionKey('second'))?.onRetry?.() + expect(retry).toHaveBeenCalledExactlyOnceWith('second') + }) + + it('chooses the words from the saved refusal on the message the queue stopped on', () => { + expect( + texts( + [ + entry('held', { + lastFailure: { kind: 'refused', code: 'agent_session_owner_restart_failed' } + }) + ], + 'held' + ) + ).toEqual({ + [agentJournalSubmissionKey('held')]: "The agent couldn't restart. Your message was not sent." + }) + }) + + // The same rule as a rejected row's: its own Retry is the resend step, and any other step stays. + it('leaves a retry step to the Retry beside the message the queue stopped on', () => { + const held = (lastFailure: StructuredAgentSessionOutboxEntry['lastFailure']) => + texts([entry('held', { lastFailure })], 'held') + expect( + held({ + kind: 'refused', + code: 'agent_session_journal_unreadable', + details: { reason: 'journalUnavailable' } + }) + ).toEqual({ + [agentJournalSubmissionKey('held')]: + "Orca couldn't open this chat's history right now. Your message was not sent." + }) + expect( + held({ + kind: 'refused', + code: 'agent_session_operation_invalid', + details: { reason: 'notSignedIn' } + }) + ).toEqual({ + [agentJournalSubmissionKey('held')]: + 'Your message was not sent. Claude is not signed in for the selected account. Sign in first.' + }) + }) + + it('says a message is unconfirmed, and only that it was not sent when nothing more is known', () => { + expect(texts([entry('doubt', { state: 'unconfirmed' })])).toEqual({ + [agentJournalSubmissionKey('doubt')]: 'Message delivery is unconfirmed.' + }) + expect(texts([entry('bare')], 'bare')).toEqual({ + [agentJournalSubmissionKey('bare')]: 'Message was not sent.' + }) + }) + + // The drain's own rule: a message behind the one the queue stopped on is only waiting, so it says + // nothing. A rejected message holds nothing up and keeps its words. + it('says why on the message the queue stopped on and on every rejected one', () => { + expect( + texts([ + entry('sent', { state: 'dispatching' }), + entry('rejected', { state: 'rejected' }), + entry('stuck', { state: 'unconfirmed' }), + entry('behind', { state: 'unconfirmed' }), + entry('queued') + ]) + ).toEqual({ + [agentJournalSubmissionKey('rejected')]: 'Message was not sent.', + [agentJournalSubmissionKey('stuck')]: 'Message delivery is unconfirmed.' + }) + }) + + // Its Retry would put it back in the queue to wait unseen behind the stopped message. + it('keeps a rejected message its words but not its Retry while the queue is stopped', () => { + const retry = vi.fn() + for (const [outbox, blocked] of [ + [[entry('stuck', { state: 'unconfirmed' }), entry('rejected', { state: 'rejected' })], null], + [[entry('rejected', { state: 'rejected' }), entry('held')], 'held'] + ] as const) { + const notices = structuredAgentSessionDeliveryNotices( + [...outbox], + blocked, + 'Claude', + retry, + [], + [] + ) + expect(notices.get(agentJournalSubmissionKey('rejected'))).toEqual({ + text: 'Message was not sent.' + }) + } + }) + + // Beside its own Retry the resend step is the button; without one the words keep it. + it('leaves out sending again only where the message has its own Retry', () => { + const startFailed = (clientMessageId: string): StructuredAgentSessionOutboxEntry => + entry(clientMessageId, { + state: 'rejected', + lastFailure: { + kind: 'rejected', + reason: 'Claude stopped before it finished starting. Send your message to try again.', + rejection: { kind: 'providerStartFailed' } + } + }) + expect(texts([startFailed('first'), startFailed('second')])).toEqual({ + [agentJournalSubmissionKey('first')]: 'Claude stopped before it finished starting.', + [agentJournalSubmissionKey('second')]: 'Claude stopped before it finished starting.' + }) + expect(texts([startFailed('rejected'), entry('held')], 'held')).toMatchObject({ + [agentJournalSubmissionKey('rejected')]: + 'Claude stopped before it finished starting. Send your message to try again.' + }) + }) + + it.each([ + [ + 'notDelivered', + 'This message was not delivered. Send it again to continue.', + 'This message was not delivered.' + ], + [ + 'hostFault', + "Orca ran into a problem, so this didn't go through. Try again.", + "Orca ran into a problem, so this didn't go through." + ] + ] as const)('leaves the step to the Retry beside a %s message', (kind, reason, shown) => { + expect( + texts([ + entry('rejected', { + state: 'rejected', + lastFailure: { kind: 'rejected', reason, rejection: { kind } } + }) + ]) + ).toEqual({ [agentJournalSubmissionKey('rejected')]: shown }) + }) + + // The journal holds the whole fact; the message's own copy keeps only its kind and attachment. + it("words a recorded rejection from the journal's fact, whatever reason the host wrote", () => { + const rejected = (id: string): StructuredAgentSessionOutboxEntry => + entry(id, { + state: 'rejected', + // An older host's words, and not the pane's agent name: never compared, never shown. + lastFailure: { + kind: 'rejected', + reason: "The agent couldn't be started.", + rejection: { kind: 'startFailed' } + } + }) + const recorded = (id: string, rejection: AgentSessionFailureFact): AgentJournalSubmission => ({ + clientMessageId: id, + fence: 1, + payloadFingerprint: 'fingerprint', + dispatchState: 'rejected', + providerItemId: null, + reason: "The agent couldn't be started.", + rejection, + submittedAt: 1, + resolvedAt: 1 + }) + const facts: [string, AgentSessionFailureFact, string][] = [ + [ + 'gone', + { + kind: 'startFailed', + refusal: { + code: 'agent_session_identity_required', + details: { reason: 'recordMissing' } + } + }, + "Claude couldn't start. Start a new chat to continue." + ], + [ + 'claimed', + { + kind: 'startFailed', + refusal: { code: 'agent_session_conflict', details: { reason: 'claimConflicted' } } + }, + "Claude couldn't start. This chat is still open in a terminal agent. Quit that agent to continue the chat here." + ], + [ + 'resumable', + { kind: 'startFailed', refusal: { code: 'agent_session_ownership_unknown' } }, + "Claude couldn't start." + ], + [ + 'provider', + { kind: 'providerRejected', detail: { text: 'Image type .bmp', audience: 'person' } }, + 'The provider did not accept this message: Image type .bmp.' + ], + [ + 'logged', + { kind: 'providerRejected', detail: { text: 'HTTP 400 at /v1', audience: 'log' } }, + 'The provider did not accept this message.' + ] + ] + expect( + texts( + facts.map(([id]) => rejected(id)), + null, + facts.map(([id, fact]) => recorded(id, fact)) + ) + ).toEqual( + Object.fromEntries(facts.map(([id, , shown]) => [agentJournalSubmissionKey(id), shown])) + ) + // Not loaded (older than the loaded page): the message's copy has no refusal or detail, so the + // host's sentence, which holds them, is shown for those kinds; the table words the rest. + expect( + texts([ + rejected('gone'), + entry('provider', { + state: 'rejected', + lastFailure: { + kind: 'rejected', + reason: 'The provider did not accept this message: Image type .bmp.', + rejection: { kind: 'providerRejected' } + } + }), + entry('stopped', { + state: 'rejected', + lastFailure: { + kind: 'rejected', + reason: 'The agent stopped before this message was sent.', + rejection: { kind: 'providerExited' } + } + }) + ]) + ).toEqual({ + [agentJournalSubmissionKey('gone')]: "The agent couldn't be started.", + [agentJournalSubmissionKey('provider')]: + 'The provider did not accept this message: Image type .bmp.', + [agentJournalSubmissionKey('stopped')]: 'Claude stopped before this message was sent.' + }) + }) + + it('says nothing on a message that is only waiting its turn or on its way', () => { + expect(texts([entry('queued'), entry('sending', { state: 'dispatching' })])).toEqual({}) + }) + + // Matched on the typed fact of a row found by its identity, never on either sentence. + describe('a message rejected by a start whose row already says why', () => { + const startFailed: AgentSessionFailureFact = { + kind: 'startFailed', + refusal: { code: 'agent_session_identity_required', details: { reason: 'recordMissing' } } + } + const rejected = (id: string, fact: AgentSessionFailureFact) => + entry(id, { + state: 'rejected', + lastFailure: { + kind: 'rejected', + reason: 'Written by the host.', + rejection: { kind: fact.kind } + } + }) + const recorded = (id: string, fact: AgentSessionFailureFact): AgentJournalSubmission => ({ + clientMessageId: id, + fence: 1, + payloadFingerprint: id, + dispatchState: 'rejected', + providerItemId: null, + reason: 'Written by the host.', + rejection: fact, + submittedAt: 1, + resolvedAt: 1 + }) + const statusRow = (itemId: string, fact: AgentSessionFailureFact): AgentJournalRenderItem => ({ + itemId, + revision: 1, + sequence: 1, + observedAt: 1, + body: { + kind: 'status', + tone: 'error', + ...agentSessionFailureWords(fact, { agentName: 'Claude', surface: 'row' }) + } + }) + const startRowKey = agentJournalItemKey(structuredAgentSessionStartFailureRowIdentity('gen')) + + it('reads only the start-failure rows', () => { + expect( + structuredAgentSessionStartFailureFacts([ + statusRow(startRowKey, startFailed), + statusRow(agentJournalSubmissionKey('exit-row'), { kind: 'providerExited' }) + ]) + ).toEqual([startFailed]) + }) + + it('says only that each was not sent, and words any other rejection in full', () => { + const otherRefusal: AgentSessionFailureFact = { + kind: 'startFailed', + refusal: { code: 'agent_session_conflict', details: { reason: 'claimConflicted' } } + } + const facts = structuredAgentSessionStartFailureFacts([statusRow(startRowKey, startFailed)]) + expect( + texts( + [ + rejected('first', startFailed), + rejected('second', startFailed), + rejected('other', otherRefusal) + ], + null, + [ + recorded('first', startFailed), + recorded('second', startFailed), + recorded('other', otherRefusal) + ], + facts + ) + ).toEqual({ + [agentJournalSubmissionKey('first')]: 'Your message was not sent.', + [agentJournalSubmissionKey('second')]: 'Your message was not sent.', + [agentJournalSubmissionKey('other')]: + "Claude couldn't start. This chat is still open in a terminal agent. Quit that agent to continue the chat here." + }) + }) + + it('keeps the full notice when the rejection is not loaded, or no start row states it', () => { + const shown = "Claude couldn't start. Start a new chat to continue." + expect(texts([rejected('first', startFailed)], null, [], [startFailed])).toEqual({ + [agentJournalSubmissionKey('first')]: 'Written by the host.' + }) + expect( + texts([rejected('first', startFailed)], null, [recorded('first', startFailed)], []) + ).toEqual({ [agentJournalSubmissionKey('first')]: shown }) + }) + }) +}) diff --git a/src/renderer/src/components/native-chat/structured-agent-session-delivery-notices.ts b/src/renderer/src/components/native-chat/structured-agent-session-delivery-notices.ts new file mode 100644 index 000000000000..ec3eb60e6875 --- /dev/null +++ b/src/renderer/src/components/native-chat/structured-agent-session-delivery-notices.ts @@ -0,0 +1,137 @@ +// Which of the structured chat's own messages say, on their row, that they did not go through. +// +// Derived from the outbox on every render and never stored: each failed or held message carries +// its own typed failure, so each row words its own reason. Read through the drain's own rule: while +// the queue is stopped, only the message it stopped on has a Retry; another's would wait unseen +// behind it. One waiting behind says nothing; a rejected message holds nothing up, so it keeps its +// words and gets its Retry once the queue moves. +// +// A message the host recorded and then rejected is worded from the journal's own fact, found by id; +// the message keeps only a smaller copy, read when its submission is not loaded. A rejection that +// is a failed start's, the fact its loaded row states, says only that it was not sent: the row +// already says why. + +import { + readAgentSessionFailureFact, + type AgentSessionFailureFact +} from '../../../../shared/agent-session-failure' +import { agentJournalSubmissionKey } from '../../../../shared/agent-session-journal-item-key' +import type { + AgentJournalRenderItem, + AgentJournalSubmission +} from '../../../../shared/agent-session-journal-types' +import { agentSessionWriteNotDoneParts } from '../../../../shared/agent-session-refusal-notice' +import { isStructuredAgentSessionStartFailureRow } from '../../../../shared/structured-agent-session-start-failure-row-key' +import { + admitStructuredAgentSessionOutboxEntry, + type StructuredAgentSessionOutboxEntry +} from '../../../../shared/structured-agent-session-outbox' +import type { AgentSessionFailureWordsContext } from '../../../../shared/agent-session-failure-words' +import { structuredAgentSessionAttemptFailureParts } from '../../../../shared/structured-agent-session-send-disposition' +import { translate } from '@/i18n/i18n' +import { agentSessionWriteNoticeText } from './agent-session-write-notice-text' +import type { NativeChatDeliveryNotice } from './NativeChatMessageRow' + +/** The facts the chat's loaded start-failure rows state. */ +export function structuredAgentSessionStartFailureFacts( + items: readonly AgentJournalRenderItem[] +): AgentSessionFailureFact[] { + const facts: AgentSessionFailureFact[] = [] + for (const item of items) { + if (item.body.kind === 'status' && isStructuredAgentSessionStartFailureRow(item.itemId)) { + const fact = readAgentSessionFailureFact(item.body.failure) + if (fact) { + facts.push(fact) + } + } + } + return facts +} + +/** Whether two facts are one failure: a start's row and the messages it rejected share one. */ +export function sameAgentSessionFailureFact( + a: AgentSessionFailureFact, + b: AgentSessionFailureFact +): boolean { + return ( + a.kind === b.kind && + a.detail?.text === b.detail?.text && + a.detail?.audience === b.detail?.audience && + a.refusal?.code === b.refusal?.code && + a.refusal?.details?.reason === b.refusal?.details?.reason && + a.attachment?.reason === b.attachment?.reason && + a.attachment?.limit === b.attachment?.limit && + a.retry?.error === b.retry?.error && + a.retry?.status === b.retry?.status + ) +} + +function deliveryNoticeText( + entry: StructuredAgentSessionOutboxEntry, + context: AgentSessionFailureWordsContext, + recorded: AgentJournalSubmission | undefined, + startFailures: readonly AgentSessionFailureFact[] +): string { + if (entry.state === 'unconfirmed') { + return translate( + 'auto.components.native.chat.NativeChatStructuredSession.1f772bb5d0', + 'Message delivery is unconfirmed.' + ) + } + if (!entry.lastFailure) { + return translate( + 'auto.components.native.chat.NativeChatStructuredSession.93ef441197', + 'Message was not sent.' + ) + } + const fact = readAgentSessionFailureFact(recorded?.rejection) + if ( + entry.state === 'rejected' && + fact && + startFailures.some((stated) => sameAgentSessionFailureFact(stated, fact)) + ) { + return agentSessionWriteNoticeText(agentSessionWriteNotDoneParts('send')) + } + return agentSessionWriteNoticeText( + structuredAgentSessionAttemptFailureParts(entry.lastFailure, context, fact) + ) +} + +/** Keyed by the message id the transcript renders each entry under. `blockedClientMessageId` is + * the entry a refusal stopped the queue on; `agentName` is the chat's agent, for the words. */ +export function structuredAgentSessionDeliveryNotices( + outbox: readonly StructuredAgentSessionOutboxEntry[], + blockedClientMessageId: string | null, + agentName: string, + retry: (clientMessageId: string) => void, + /** The journal's rows, whose rejected ones carry more of a rejection than the message keeps. */ + submissions: readonly AgentJournalSubmission[], + /** What the loaded start-failure rows state, from `structuredAgentSessionStartFailureFacts`. */ + startFailures: readonly AgentSessionFailureFact[] +): ReadonlyMap { + const admission = admitStructuredAgentSessionOutboxEntry(outbox, blockedClientMessageId) + const held = admission.state === 'blocked' ? admission.entry.clientMessageId : null + const rejected = new Map( + submissions + .filter((submission) => submission.dispatchState === 'rejected') + .map((submission) => [submission.clientMessageId, submission]) + ) + const notices = new Map() + for (const entry of outbox) { + if (entry.state === 'rejected' || entry.clientMessageId === held) { + // Its own Retry is the step, so the words leave out sending again. + const retryControl = held === null || entry.clientMessageId === held + const text = deliveryNoticeText( + entry, + { agentName, retryControl }, + rejected.get(entry.clientMessageId), + startFailures + ) + notices.set( + agentJournalSubmissionKey(entry.clientMessageId), + retryControl ? { text, onRetry: () => retry(entry.clientMessageId) } : { text } + ) + } + } + return notices +} diff --git a/src/renderer/src/components/native-chat/structured-agent-session-read-failure-notice.ts b/src/renderer/src/components/native-chat/structured-agent-session-read-failure-notice.ts new file mode 100644 index 000000000000..8dee55de82e6 --- /dev/null +++ b/src/renderer/src/components/native-chat/structured-agent-session-read-failure-notice.ts @@ -0,0 +1,32 @@ +// What the structured chat says when reading its history failed: the notice table's words for the +// refusal the read met, never the host's message or code. + +import { + agentSessionReadHistoryRefusalParts, + agentSessionWriteNotDoneParts +} from '../../../../shared/agent-session-refusal-notice' +import type { AgentSessionRefusalReference } from '../../../../shared/agent-session-wire-refusals' +import { isFinalAgentSessionReadRefusal } from '../../../../shared/structured-agent-session-read-refusal' +import { agentSessionWriteNoticeText } from './agent-session-write-notice-text' + +export type StructuredAgentSessionReadFailureNotice = { + text: string + /** The host named the situation, so the words say more than that the history did not load. */ + named: boolean + /** Nothing the read retries gets past it, so the pane no longer says it keeps trying. */ + final: boolean +} + +export function structuredAgentSessionReadFailureNotice( + refusal: AgentSessionRefusalReference | undefined +): StructuredAgentSessionReadFailureNotice { + // The pane reconnects on its own, so it is the Retry beside the words. + const parts = refusal + ? agentSessionReadHistoryRefusalParts(refusal.code, refusal.details, { retryControl: true }) + : agentSessionWriteNotDoneParts('read-history') + return { + text: agentSessionWriteNoticeText(parts), + named: refusal?.details?.reason !== undefined, + final: isFinalAgentSessionReadRefusal(refusal) + } +} diff --git a/src/renderer/src/components/native-chat/structured-agent-session-read-owner.ts b/src/renderer/src/components/native-chat/structured-agent-session-read-owner.ts index 6ec7b38f8b26..e3f87a8e95e6 100644 --- a/src/renderer/src/components/native-chat/structured-agent-session-read-owner.ts +++ b/src/renderer/src/components/native-chat/structured-agent-session-read-owner.ts @@ -223,7 +223,7 @@ function createReadOwner( } const transport = startStructuredAgentSessionReadTransport({ applyEvent: (event) => apply({ type: 'event', event }), - applyError: (message) => apply({ type: 'error', message }), + applyError: (message, refusal) => apply({ type: 'error', message, refusal }), getCursor: () => snapshot.state.cursor, onHistoryReadInvalidated: invalidateOlderPages, hydrate: snapshot.state.epoch === null ? hydrate : undefined, diff --git a/src/renderer/src/components/native-chat/structured-agent-session-read-transport.test.ts b/src/renderer/src/components/native-chat/structured-agent-session-read-transport.test.ts index 0305b93cb6d4..683676c99d65 100644 --- a/src/renderer/src/components/native-chat/structured-agent-session-read-transport.test.ts +++ b/src/renderer/src/components/native-chat/structured-agent-session-read-transport.test.ts @@ -9,12 +9,16 @@ import type { AgentSessionSubscribeEvent } from '../../../../shared/agent-session-wire' -const mocks = vi.hoisted(() => ({ subscribe: vi.fn() })) +const mocks = vi.hoisted(() => ({ subscribe: vi.fn(), watchHostContact: vi.fn() })) vi.mock('@/runtime/structured-agent-session-client', () => ({ subscribeStructuredAgentSession: mocks.subscribe })) +vi.mock('@/runtime/runtime-host-contact-regained', () => ({ + subscribeRuntimeHostContactRegained: mocks.watchHostContact +})) + import { startStructuredAgentSessionReadTransport } from './structured-agent-session-read-transport' type SubscribeAttempt = { @@ -311,6 +315,81 @@ describe('structured agent-session read transport unattached refusals', () => { } }) + it('hands the pane the refusal a read met, and stops reconnecting only past damage', async () => { + vi.useFakeTimers() + try { + const journalRefusal = (reason: string) => ({ + code: 'runtime_error', + message: 'agent_session_journal_unreadable', + data: { refusal: { code: 'agent_session_journal_unreadable', details: { reason } } } + }) + const applyError = vi.fn() + const transport = startWithHydration(async () => undefined, applyError) + await flushPromises() + expect(attempts).toHaveLength(1) + + // An open that can clear keeps reconnecting. + attempts[0].onError(journalRefusal('journalUnavailable')) + attempts[0].closed.resolve({ unsubscribe: attempts[0].unsubscribe }) + await flushPromises() + expect(applyError).toHaveBeenLastCalledWith('agent_session_journal_unreadable', { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalUnavailable' } + }) + await vi.advanceTimersByTimeAsync(750) + expect(attempts).toHaveLength(2) + + // Damage no retry reads past: decided from the reason, not the message, which is the same. + attempts[1].onError(journalRefusal('journalCorrupt')) + attempts[1].closed.resolve({ unsubscribe: attempts[1].unsubscribe }) + await flushPromises() + expect(applyError).toHaveBeenLastCalledWith('agent_session_journal_unreadable', { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalCorrupt' } + }) + await vi.advanceTimersByTimeAsync(60_000) + expect(attempts).toHaveLength(2) + transport.dispose() + } finally { + vi.useRealTimers() + } + }) + + it('reads a thrown hydrate refusal the same way, and a new run reads again', async () => { + vi.useFakeTimers() + try { + const corrupt = Object.assign(new Error('agent_session_journal_unreadable'), { + response: { + error: { + code: 'runtime_error', + message: 'agent_session_journal_unreadable', + data: { + refusal: { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalCorrupt' } + } + } + } + } + }) + const hydrate = vi.fn(async () => { + throw corrupt + }) + const first = startWithHydration(hydrate, vi.fn()) + await vi.advanceTimersByTimeAsync(60_000) + expect(attempts).toHaveLength(0) + first.dispose() + + // Reopening the chat is a new run, which reads again. + const second = startWithHydration(hydrate, vi.fn()) + await flushPromises() + expect(hydrate).toHaveBeenCalledTimes(2) + second.dispose() + } finally { + vi.useRealTimers() + } + }) + it('re-opens after a failed open and leaves the error once the conversation reads (P2-04)', async () => { vi.useFakeTimers() try { @@ -356,4 +435,128 @@ describe('structured agent-session read transport unattached refusals', () => { vi.useRealTimers() } }) + + it('waits twice as long after each failed open, up to 30 s, and starts over once a read lands', async () => { + vi.useFakeTimers() + try { + const unavailable = { + code: 'runtime_error', + message: 'agent_session_journal_unreadable', + data: { + refusal: { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalUnavailable' } + } + } + } + const transport = startWithHydration(async () => undefined, vi.fn()) + await flushPromises() + // As a local subscribe does: the open resolves, then the host's refusal arrives. + const refuseLatest = async (): Promise => { + const attempt = attempts.at(-1)! + attempt.closed.resolve({ unsubscribe: attempt.unsubscribe }) + await flushPromises() + attempt.onError(unavailable) + } + const expectReopenAfter = async (delay: number): Promise => { + const opened = attempts.length + await vi.advanceTimersByTimeAsync(delay - 1) + expect(attempts).toHaveLength(opened) + await vi.advanceTimersByTimeAsync(1) + expect(attempts).toHaveLength(opened + 1) + } + + for (const delay of [750, 1_500, 3_000, 6_000, 12_000, 24_000, 30_000, 30_000]) { + await refuseLatest() + await expectReopenAfter(delay) + } + + // A read that delivers is the success the next failure starts over from. + attempts.at(-1)!.closed.resolve({ unsubscribe: attempts.at(-1)!.unsubscribe }) + await flushPromises() + attempts.at(-1)!.onEvent(snapshot(1)) + attempts.at(-1)!.onError(unavailable) + await expectReopenAfter(750) + await refuseLatest() + await expectReopenAfter(1_500) + + // Damage still ends reconnecting, however far the wait has grown. + const latest = attempts.at(-1)! + latest.closed.resolve({ unsubscribe: latest.unsubscribe }) + await flushPromises() + latest.onError({ + ...unavailable, + data: { + refusal: { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalCorrupt' } + } + } + }) + const opened = attempts.length + await vi.advanceTimersByTimeAsync(120_000) + expect(attempts).toHaveLength(opened) + transport.dispose() + } finally { + vi.useRealTimers() + } + }) + + it('reads again as soon as a remote host is reachable, not after the grown wait', async () => { + vi.useFakeTimers() + try { + let hostContactRegained = (): void => {} + const stopWatch = vi.fn() + mocks.watchHostContact.mockImplementation((_environmentId, listener: () => void) => { + hostContactRegained = listener + return stopWatch + }) + const unavailable = { code: 'runtime_unavailable', message: 'Remote runtime is unavailable.' } + const transport = startStructuredAgentSessionReadTransport({ + applyEvent: vi.fn(), + applyError: vi.fn(), + getCursor: () => null, + onHistoryReadInvalidated: () => undefined, + hydrate: async () => undefined, + sessionId: 'session-a', + target: { kind: 'environment', environmentId: 'env-a' } + }) + expect(mocks.watchHostContact).toHaveBeenCalledWith('env-a', expect.any(Function)) + await flushPromises() + const refuseLatest = async (): Promise => { + const attempt = attempts.at(-1)! + attempt.closed.resolve({ unsubscribe: attempt.unsubscribe }) + await flushPromises() + attempt.onError(unavailable) + } + // An outage long enough that the wait reaches its cap. + for (const delay of [750, 1_500, 3_000, 6_000, 12_000, 24_000]) { + await refuseLatest() + await vi.advanceTimersByTimeAsync(delay) + } + await refuseLatest() + const opened = attempts.length + await vi.advanceTimersByTimeAsync(29_000) + expect(attempts).toHaveLength(opened) + + hostContactRegained() + await vi.advanceTimersByTimeAsync(0) + expect(attempts).toHaveLength(opened + 1) + + // The wait starts over too, so a failure right after reconnect is retried soon. + await refuseLatest() + await vi.advanceTimersByTimeAsync(750) + expect(attempts).toHaveLength(opened + 2) + + transport.dispose() + expect(stopWatch).toHaveBeenCalledTimes(1) + } finally { + vi.useRealTimers() + } + }) + + it('does not watch host contact for a local read', () => { + startWithHydration(async () => undefined, vi.fn()).dispose() + expect(mocks.watchHostContact).not.toHaveBeenCalled() + }) }) diff --git a/src/renderer/src/components/native-chat/structured-agent-session-read-transport.ts b/src/renderer/src/components/native-chat/structured-agent-session-read-transport.ts index ed8423fd079b..a0a693e92a9c 100644 --- a/src/renderer/src/components/native-chat/structured-agent-session-read-transport.ts +++ b/src/renderer/src/components/native-chat/structured-agent-session-read-transport.ts @@ -3,8 +3,12 @@ import type { AgentSessionSubscribeEvent } from '../../../../shared/agent-sessio import { createStructuredAgentSessionEventCoalescer } from '../../../../shared/structured-agent-session-coalescer' import { AGENT_SESSION_UNATTACHED_READ_GRACE_MS, + isFinalAgentSessionReadRefusal, isUnattachedAgentSessionReadRefusal } from '../../../../shared/structured-agent-session-read-refusal' +import type { AgentSessionRefusalReference } from '../../../../shared/agent-session-wire-refusals' +import { readAgentSessionErrorRefusal } from '../../../../shared/agent-session-write-failure' +import { subscribeRuntimeHostContactRegained } from '@/runtime/runtime-host-contact-regained' import type { RuntimeClientTarget } from '@/runtime/runtime-rpc-client' import { subscribeStructuredAgentSession } from '@/runtime/structured-agent-session-client' @@ -27,13 +31,20 @@ function readFailureText(error: unknown): string { return 'Something went wrong.' } +const RECONNECT_FIRST_DELAY_MS = 750 +const RECONNECT_MAX_DELAY_MS = 30_000 + +/** Each reconnect waits twice the last, up to the cap, until a read delivers. */ function createReconnectScheduler(args: { shouldStop: () => boolean; reconnect: () => void }) { let timer: ReturnType | null = null + let nextDelay = RECONNECT_FIRST_DELAY_MS return { - schedule(delay = 750): void { + schedule(): void { if (args.shouldStop() || timer) { return } + const delay = nextDelay + nextDelay = Math.min(delay * 2, RECONNECT_MAX_DELAY_MS) timer = setTimeout(() => { timer = null if (!args.shouldStop()) { @@ -41,6 +52,22 @@ function createReconnectScheduler(args: { shouldStop: () => boolean; reconnect: } }, delay) }, + /** A read delivered, so the next failure is retried soon again. */ + reset(): void { + nextDelay = RECONNECT_FIRST_DELAY_MS + }, + /** The host is reachable again: a waiting retry runs now instead of after the grown wait. */ + retryNow(): void { + nextDelay = RECONNECT_FIRST_DELAY_MS + if (!timer) { + return + } + clearTimeout(timer) + timer = null + if (!args.shouldStop()) { + args.reconnect() + } + }, dispose(): void { if (timer) { clearTimeout(timer) @@ -52,7 +79,8 @@ function createReconnectScheduler(args: { shouldStop: () => boolean; reconnect: export function startStructuredAgentSessionReadTransport(args: { applyEvent: (event: AgentSessionSubscribeEvent) => void - applyError: (message: string) => void + /** `message` is the failure's own text, for logs; `refusal` is what a surface words. */ + applyError: (message: string, refusal?: AgentSessionRefusalReference) => void getCursor: () => AgentJournalCursor | null onHistoryReadInvalidated: () => void hydrate?: (shouldStop: () => boolean) => Promise @@ -64,6 +92,8 @@ export function startStructuredAgentSessionReadTransport(args: { } { let stopped = false let connected = false + // A refusal no retry reads past ends reconnecting for this run; reopening the chat starts another. + let failedFinally = false let unattachedSince: number | null = null let opening = false let openGeneration = 0 @@ -76,9 +106,16 @@ export function startStructuredAgentSessionReadTransport(args: { } }) const reconnectScheduler = createReconnectScheduler({ - shouldStop: () => stopped || connected, + shouldStop: () => stopped || connected || failedFinally, reconnect: () => void open() }) + // Why: an outage grows the retry wait to its cap; a host that is back should not wait it out. + const stopHostContactWatch = + args.target.kind === 'environment' + ? subscribeRuntimeHostContactRegained(args.target.environmentId, () => + reconnectScheduler.retryNow() + ) + : () => {} const isCurrentOpenGeneration = (candidate: number): boolean => !stopped && candidate === openGeneration const clearUnattachedReadGrace = (): void => { @@ -95,16 +132,25 @@ export function startStructuredAgentSessionReadTransport(args: { * A window, not a mute. An unattached read still refusing past the grace is no longer * transitional, so the pane is owed the failure rather than a spinner that never resolves. */ + const applyReadFailure = (error: unknown): void => { + const refusal = readAgentSessionErrorRefusal(error) + failedFinally = isFinalAgentSessionReadRefusal(refusal) + if (refusal) { + args.applyError(readFailureText(error), refusal) + } else { + args.applyError(readFailureText(error)) + } + } const reportReadFailure = (error: unknown): void => { if (!isUnattachedAgentSessionReadRefusal(error)) { clearUnattachedReadGrace() - args.applyError(readFailureText(error)) + applyReadFailure(error) return } const now = Date.now() unattachedSince ??= now if (now - unattachedSince >= AGENT_SESSION_UNATTACHED_READ_GRACE_MS) { - args.applyError(readFailureText(error)) + applyReadFailure(error) } } const captureHistoryReadGuard = (): (() => boolean) => { @@ -118,6 +164,10 @@ export function startStructuredAgentSessionReadTransport(args: { return } clearUnattachedReadGrace() + // Not on connect: a local subscribe resolves before the host's open refuses. + if (event.type !== 'end') { + reconnectScheduler.reset() + } if (event.type === 'snapshot' || event.type === 'reset') { coalescer.flush() if (!isCurrentOpenGeneration(eventOpenGeneration)) { @@ -229,6 +279,7 @@ export function startStructuredAgentSessionReadTransport(args: { stopped = true openGeneration += 1 args.onHistoryReadInvalidated() + stopHostContactWatch() reconnectScheduler.dispose() coalescer.dispose() unsubscribe() diff --git a/src/renderer/src/components/native-chat/use-native-chat-launch-prompt-delivery-notice.ts b/src/renderer/src/components/native-chat/use-native-chat-launch-prompt-delivery-notice.ts new file mode 100644 index 000000000000..c3d7974c160a --- /dev/null +++ b/src/renderer/src/components/native-chat/use-native-chat-launch-prompt-delivery-notice.ts @@ -0,0 +1,22 @@ +import { useMemo } from 'react' +import { translate } from '@/i18n/i18n' +import type { NativeChatMessage } from '../../../../shared/native-chat-types' +import type { NativeChatDeliveryNotice } from './NativeChatMessageRow' + +/** The terminal-backed chat's one delivery notice: its launch prompt, when the terminal refused it + * and the prompt's row is on screen. The terminal is where to act, so it offers no Retry. */ +export function useNativeChatLaunchPromptDeliveryNotice( + failedMessageId: string | null | undefined, + messages: readonly NativeChatMessage[] +): ReadonlyMap | undefined { + return useMemo(() => { + if (!failedMessageId || !messages.some((message) => message.id === failedMessageId)) { + return undefined + } + const text = translate( + 'components.native-chat.launchPromptNotDelivered', + 'Not delivered — check the terminal' + ) + return new Map([[failedMessageId, { text }]]) + }, [failedMessageId, messages]) +} diff --git a/src/renderer/src/components/native-chat/use-native-chat-provisional-launch.ts b/src/renderer/src/components/native-chat/use-native-chat-provisional-launch.ts index 0661eb0df889..12528859d71a 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-provisional-launch.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-provisional-launch.ts @@ -3,7 +3,7 @@ import { getStructuredAgentSessionLaunchLifecycle, getStructuredAgentSessionLaunchResumes, retryStructuredAgentSessionLaunch, - useStructuredAgentSessionLaunchFailureReason, + useStructuredAgentSessionLaunchFailure, useStructuredAgentSessionLaunchLifecycle, useStructuredAgentSessionLaunchSelection } from '@/lib/structured-agent-session-launch' @@ -66,7 +66,7 @@ export function useNativeChatProvisionalLaunch( sessionId: string ) { const lifecycle = useStructuredAgentSessionLaunchLifecycle(worktreeId ?? '', sessionId) - const failureReason = useStructuredAgentSessionLaunchFailureReason(worktreeId ?? '', sessionId) + const failure = useStructuredAgentSessionLaunchFailure(worktreeId ?? '', sessionId) const launch = useLatchedLaunchView(sessionId, worktreeId, lifecycle !== null) const retry = useCallback(() => { if (worktreeId) { @@ -91,7 +91,7 @@ export function useNativeChatProvisionalLaunch( return { lifecycle, launch, - failureReason, + failure, retry, sendThroughRelaunch, transportEnabled: lifecycle === null || lifecycle === 'published' diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-mutate.ts b/src/renderer/src/components/native-chat/use-structured-agent-session-mutate.ts index 328d76d05344..40979780b36c 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session-mutate.ts +++ b/src/renderer/src/components/native-chat/use-structured-agent-session-mutate.ts @@ -12,7 +12,7 @@ import * as conversationCommands from './structured-conversation-command-send' import type { AgentSessionMutationResult } from '../../../../shared/agent-session-wire' import { agentSessionRefusalFailure, - agentSessionRpcErrorFailure, + agentSessionThrownFailure, agentSessionWriteKindForMethod as writeKind } from '../../../../shared/agent-session-write-failure' import { agentSessionRefusalOperationState } from '../../../../shared/agent-session-refusal-retry' @@ -98,7 +98,8 @@ export function useStructuredAgentSessionMutate(args: { ? { kind: 'not-done', notice: agentSessionWriteFailureText( - agentSessionRpcErrorFailure( + agentSessionThrownFailure( + error, error instanceof RuntimeRpcCallError ? error.code : undefined ), writeKind(fingerprintMethod, fields) diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-outbox-admission.test.tsx b/src/renderer/src/components/native-chat/use-structured-agent-session-outbox-admission.test.tsx index 0fff127cd2c2..feb9f898ce25 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session-outbox-admission.test.tsx +++ b/src/renderer/src/components/native-chat/use-structured-agent-session-outbox-admission.test.tsx @@ -21,6 +21,8 @@ vi.mock('@/runtime/structured-agent-session-client', () => ({ import { useStructuredAgentSessionOutbox } from './use-structured-agent-session-outbox' import { enqueueStructuredAgentSessionLaunchPrompt } from './structured-agent-session-outbox-storage' import { settleStructuredAgentLaunchPrompt } from '@/lib/structured-agent-session-launch-prompt' +import { structuredAgentSessionDeliveryNotices } from './structured-agent-session-delivery-notices' +import { agentJournalSubmissionKey } from '../../../../shared/agent-session-journal-item-key' const LOCAL_TARGET = { kind: 'local' } as const @@ -32,12 +34,19 @@ function deferred() { return { promise, resolve } } -type SendRequest = { body?: { blocks?: { text?: string }[] } } +type SendRequest = { + body?: { blocks?: { text?: string }[] } + envelope?: { clientOperationId?: string } +} function requestText(params: SendRequest | undefined): string | undefined { return params?.body?.blocks?.[0]?.text } +function requestId(params: SendRequest | undefined): string { + return String(params?.envelope?.clientOperationId) +} + function sentTexts(): (string | undefined)[] { return mocks.call.mock.calls.map((call) => requestText(call[2])) } @@ -219,4 +228,94 @@ describe('structured agent session outbox admission', () => { await act(async () => admission.resolve(submissionResult(String(id), 'pending', 10))) expect(sentTexts()).toEqual(['first', 'second']) }) + + // A message the queue is held on goes out only by its own Retry, never another message's. + it("keeps a refused message held when a rejected message's Retry shows while a head waits", async () => { + const inFlight = deferred>() + mocks.call.mockImplementation((_target, _method, params) => { + const text = requestText(params) + const attempt = sentTexts().filter((sent) => sent === text).length + const id = requestId(params) + if (text === 'held') { + return Promise.resolve(refusedResult('agent_session_ownership_unknown')) + } + if (attempt === 1) { + return Promise.resolve(refusedResult('agent_session_owner_restart_failed')) + } + return text === 'x' ? inFlight.promise : Promise.resolve(submissionResult(id, 'accepted', 20)) + }) + const { result } = renderOutbox() + for (const text of ['x', 'a', 'c']) { + act(() => expect(result.current.send(text)).toBe(true)) + await waitFor(() => expect(result.current.outbox.at(-1)?.state).toBe('rejected')) + } + act(() => expect(result.current.send('held')).toBe(true)) + await waitFor(() => expect(result.current.blockedClientMessageId).not.toBeNull()) + const heldId = result.current.blockedClientMessageId + const [x, a, c] = result.current.outbox + + // x goes out and stays in flight, so a, retried after it, waits queued ahead of the held one. + act(() => result.current.retry(x!.clientMessageId)) + await waitFor(() => expect(sentTexts()).toEqual(['x', 'a', 'c', 'held', 'x'])) + act(() => result.current.retry(a!.clientMessageId)) + await settleTimers(20) + // The drain would send a next, so the queue reads as moving and c offers its own Retry. + const notices = structuredAgentSessionDeliveryNotices( + result.current.outbox, + result.current.blockedClientMessageId, + 'Claude', + () => {}, + [], + [] + ) + expect(notices.get(agentJournalSubmissionKey(c!.clientMessageId))?.onRetry).toBeDefined() + + act(() => result.current.retry(c!.clientMessageId)) + expect(result.current.blockedClientMessageId).toBe(heldId) + await act(async () => inFlight.resolve(submissionResult(x!.clientMessageId, 'accepted', 20))) + await waitFor(() => expect(result.current.outbox).toHaveLength(1)) + await settleTimers(50) + expect(sentTexts().filter((text) => text === 'held')).toHaveLength(1) + expect(result.current.blockedClientMessageId).toBe(heldId) + }) + + it('keeps a refused message held when an unconfirmed message ahead of it is retried', async () => { + const none: readonly AgentJournalSubmission[] = [] + mocks.call.mockImplementation((_target, _method, params) => { + const id = requestId(params) + if (requestText(params) === 'held') { + return Promise.resolve(refusedResult('agent_session_ownership_unknown')) + } + const sent = sentTexts().filter((text) => text === 'first').length + return Promise.resolve(submissionResult(id, sent === 1 ? 'pending' : 'accepted', 10)) + }) + const { result, rerender } = renderHook( + ({ submissions }: { submissions: readonly AgentJournalSubmission[] }) => + useStructuredAgentSessionOutbox({ + sessionId: 'session-1', + target: LOCAL_TARGET, + fence: 1, + submissions + }), + { initialProps: { submissions: none } } + ) + act(() => expect(result.current.send('first')).toBe(true)) + await waitFor(() => expect(result.current.outbox[0]?.state).toBe('dispatching')) + act(() => expect(result.current.send('held')).toBe(true)) + await waitFor(() => expect(result.current.blockedClientMessageId).not.toBeNull()) + const heldId = result.current.blockedClientMessageId + const firstId = String(result.current.outbox[0]?.clientMessageId) + const unknown: AgentJournalSubmission = { + ...submissionResult(firstId, 'pending', 10).value.submission, + dispatchState: 'unknown' + } + rerender({ submissions: [unknown] }) + await waitFor(() => expect(result.current.outbox[0]?.state).toBe('unconfirmed')) + + act(() => result.current.retry(firstId)) + await waitFor(() => expect(result.current.outbox).toHaveLength(1)) + await settleTimers(50) + expect(sentTexts()).toEqual(['first', 'held', 'first']) + expect(result.current.blockedClientMessageId).toBe(heldId) + }) }) diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-outbox-rejection-cause.test.tsx b/src/renderer/src/components/native-chat/use-structured-agent-session-outbox-rejection-cause.test.tsx index a8b9f01b20b9..3ce99e6fd4b4 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session-outbox-rejection-cause.test.tsx +++ b/src/renderer/src/components/native-chat/use-structured-agent-session-outbox-rejection-cause.test.tsx @@ -17,7 +17,11 @@ import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-cap import { useStructuredAgentSessionOutbox } from './use-structured-agent-session-outbox' import { agentSessionWriteNoticeEnglish } from '../../../../shared/agent-session-refusal-notice' import { structuredAgentSessionAttemptFailureParts } from '../../../../shared/structured-agent-session-send-disposition' -import type { StructuredAgentSessionOutboxEntry } from '../../../../shared/structured-agent-session-outbox' +import { + createStructuredAgentSessionOutboxEntry, + type StructuredAgentSessionOutboxEntry +} from '../../../../shared/structured-agent-session-outbox' +import { writeOutbox } from './structured-agent-session-outbox-storage' function shownFailure(entry: StructuredAgentSessionOutboxEntry | undefined): string | undefined { return ( @@ -269,6 +273,47 @@ describe('a send the host rejected because the agent never started', () => { await waitFor(() => expect(mocks.call).toHaveBeenCalledTimes(2)) }) + // After a restart nothing in memory remembers the rejection, and its journal row may be older + // than the loaded page: the message's own state is what says a resend needs a new id. + it('retries a message rejected before a restart under a new id', async () => { + const rejected = createStructuredAgentSessionOutboxEntry({ + clientMessageId: 'rejected-before-restart', + sessionId: 'session-1', + text: 'first', + attachments: [], + queuedAt: 1 + }) + writeOutbox('session-1', [ + { + ...rejected, + state: 'rejected', + lastFailure: { + kind: 'rejected', + reason: 'The provider did not accept this message.', + rejection: { kind: 'providerRejected' } + } + } + ]) + mocks.call.mockImplementation(async (_target, _method, params) => + acceptedResultFor(String(params.envelope.clientOperationId)) + ) + const { result } = renderHook(() => + useStructuredAgentSessionOutbox({ + sessionId: 'session-1', + target: { kind: 'local' }, + fence: 1, + submissions: [] + }) + ) + expect(result.current.outbox[0]?.state).toBe('rejected') + + act(() => result.current.retry('rejected-before-restart')) + await waitFor(() => expect(mocks.call).toHaveBeenCalledOnce()) + const sentId: unknown = mocks.call.mock.calls[0]![2].envelope.clientOperationId + expect(sentId).not.toBe('rejected-before-restart') + await waitFor(() => expect(result.current.outbox).toHaveLength(0)) + }) + it('keeps the rejection when the journal settles the message before the send answers', async () => { const reason = "Codex couldn't restart: spawn codex ENOENT." let answer: (value: unknown) => void = () => undefined diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-outbox.ts b/src/renderer/src/components/native-chat/use-structured-agent-session-outbox.ts index 254c936cf63b..ae2a1ae0a61c 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session-outbox.ts +++ b/src/renderer/src/components/native-chat/use-structured-agent-session-outbox.ts @@ -52,7 +52,6 @@ export function useStructuredAgentSessionOutbox(args: { const inFlightIdRef = useRef(null) const dispatchGenerationRef = useRef(0) const blockedIdRef = useRef(null) - const retryWithFreshClientMessageIdRef = useRef(null) const probeAttemptsRef = useRef({ id: null as string | null, attempts: 0 }) const [error, setError] = useState(null) const [errorSession, setErrorSession] = useState(sessionId) @@ -71,7 +70,6 @@ export function useStructuredAgentSessionOutbox(args: { dispatchGenerationRef.current += 1 inFlightIdRef.current = null blockedIdRef.current = null - retryWithFreshClientMessageIdRef.current = null probeAttemptsRef.current = { id: null, attempts: 0 } }, [owner.ownerChange, owner.targetKey, sessionId]) @@ -139,7 +137,6 @@ export function useStructuredAgentSessionOutbox(args: { // drain, so a later microtask would leave the queue with no trigger to move on. inFlightIdRef.current = null blockedIdRef.current = disposition.blockedClientMessageId - retryWithFreshClientMessageIdRef.current = disposition.retryWithFreshClientMessageId setError(disposition.error) outboxRef.current = disposition.entries setOutbox(disposition.entries) @@ -286,21 +283,22 @@ export function useStructuredAgentSessionOutbox(args: { ) const retry = (clientMessageId: string): void => { - blockedIdRef.current = null + // Another message's Retry must not send the one the queue is held on. + if (blockedIdRef.current === clientMessageId) { + blockedIdRef.current = null + } setError(null) const submission = submissions.find( (candidate) => candidate.clientMessageId === clientMessageId ) const current = outboxRef.current.find((entry) => entry.clientMessageId === clientMessageId) - // A provider-history reconciliation can settle an earlier unknown as - // rejected before the user presses Retry. Reusing that operation id only - // replays the settled rejection forever, so rotate the id for a safe resend. - if ( - current && - (submission?.dispatchState === 'rejected' || - retryWithFreshClientMessageIdRef.current === clientMessageId) - ) { - retryWithFreshClientMessageIdRef.current = null + // The host settled this id as rejected, and reusing it only replays that forever, so rotate the + // id for a safe resend. Read from the message itself, which outlives a restart, or from a + // reconciliation that settled an earlier unknown before the outbox caught up. A refusal that + // settled the message already rotated it. + const recordedRejection = + current?.state === 'rejected' && current.lastFailure?.kind === 'rejected' + if (current && (recordedRejection || submission?.dispatchState === 'rejected')) { const rotated = outboxRef.current.map((entry) => entry.clientMessageId === clientMessageId ? { diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-start-failure-facts.test.ts b/src/renderer/src/components/native-chat/use-structured-agent-session-start-failure-facts.test.ts new file mode 100644 index 000000000000..97ef023dffb7 --- /dev/null +++ b/src/renderer/src/components/native-chat/use-structured-agent-session-start-failure-facts.test.ts @@ -0,0 +1,42 @@ +// @vitest-environment happy-dom + +import { renderHook } from '@testing-library/react' +import { expect, it } from 'vitest' +import type { AgentSessionFailureFact } from '../../../../shared/agent-session-failure' +import { agentSessionFailureWords } from '../../../../shared/agent-session-failure-words' +import { agentJournalItemKey } from '../../../../shared/agent-session-journal-item-key' +import type { AgentJournalRenderItem } from '../../../../shared/agent-session-journal-types' +import { structuredAgentSessionStartFailureRowIdentity } from '../../../../shared/structured-agent-session-start-failure-row-key' +import { useStructuredAgentSessionStartFailureFacts } from './use-structured-agent-session-start-failure-facts' + +function startFailureRow(startKey: string, fact: AgentSessionFailureFact): AgentJournalRenderItem { + return { + itemId: agentJournalItemKey(structuredAgentSessionStartFailureRowIdentity(startKey)), + revision: 1, + sequence: 1, + observedAt: 1, + body: { + kind: 'status', + tone: 'error', + ...agentSessionFailureWords(fact, { agentName: 'Claude', surface: 'row' }) + } + } +} + +// A streaming turn hands over a new item list on every delta; the facts must not follow it. +it('holds the same facts while the start rows state nothing new', () => { + const row = startFailureRow('gen-1', { kind: 'providerStartFailed' }) + const { result, rerender } = renderHook( + ({ items }) => useStructuredAgentSessionStartFailureFacts(items, true), + { initialProps: { items: [row] } } + ) + const first = result.current + expect(first).toEqual([{ kind: 'providerStartFailed' }]) + + rerender({ items: [row, startFailureRow('other-start', { kind: 'providerStartFailed' })] }) + expect(result.current).not.toBe(first) + const second = result.current + + rerender({ items: [row, startFailureRow('other-start', { kind: 'providerStartFailed' })] }) + expect(result.current).toBe(second) +}) diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-start-failure-facts.ts b/src/renderer/src/components/native-chat/use-structured-agent-session-start-failure-facts.ts new file mode 100644 index 000000000000..83f20103de11 --- /dev/null +++ b/src/renderer/src/components/native-chat/use-structured-agent-session-start-failure-facts.ts @@ -0,0 +1,33 @@ +import { useEffect, useMemo, useRef } from 'react' +import type { AgentSessionFailureFact } from '../../../../shared/agent-session-failure' +import type { AgentJournalRenderItem } from '../../../../shared/agent-session-journal-types' +import { + sameAgentSessionFailureFact, + structuredAgentSessionStartFailureFacts +} from './structured-agent-session-delivery-notices' + +const NO_FACTS: readonly AgentSessionFailureFact[] = [] + +/** What the loaded start-failure rows state, read only while `enabled`. Held while unchanged, so a + * streaming turn does not rebuild every row's delivery notice. */ +export function useStructuredAgentSessionStartFailureFacts( + items: readonly AgentJournalRenderItem[], + enabled: boolean +): readonly AgentSessionFailureFact[] { + const facts = useMemo( + () => (enabled ? structuredAgentSessionStartFailureFacts(items) : NO_FACTS), + [enabled, items] + ) + const previousRef = useRef(NO_FACTS) + const previous = previousRef.current + const stable = + previous.length === facts.length && + previous.every((fact, index) => sameAgentSessionFailureFact(fact, facts[index])) + ? previous + : facts + // Written after commit, so render stays pure. + useEffect(() => { + previousRef.current = stable + }, [stable]) + return stable +} diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session-write-refusal.test.tsx b/src/renderer/src/components/native-chat/use-structured-agent-session-write-refusal.test.tsx index 0336e81401a7..8cc467a3d283 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session-write-refusal.test.tsx +++ b/src/renderer/src/components/native-chat/use-structured-agent-session-write-refusal.test.tsx @@ -115,6 +115,46 @@ describe('a chat write the host refused', () => { ) }) + it('words a refusal the host threw from its data, never the bare code it carries as its message', async () => { + mocks.call.mockImplementation((_target, method) => + method === 'agentSession.options' + ? Promise.resolve(OPTIONS) + : Promise.reject( + new RuntimeRpcCallError({ + id: 'request-1', + ok: false, + error: { + code: 'runtime_error', + message: 'agent_session_journal_unreadable', + data: { + refusal: { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalUnavailable' } + } + } + }, + _meta: { runtimeId: 'runtime-1' } + }) + ) + ) + const { result } = renderHook(() => + useStructuredAgentSession({ + sessionId: 'session-1', + target: LOCAL_TARGET, + agent: 'claude', + isVisible: true + }) + ) + + await act(async () => { + await expect(result.current.cancel('turn-1')).resolves.toBeNull() + }) + + expect(mocks.toastError).toHaveBeenCalledExactlyOnceWith( + "Orca couldn't open this chat's history right now. The agent wasn't stopped. Try again." + ) + }) + it('answers a refused conversation command inline, where the command was typed', async () => { mocks.call.mockImplementation((_target, method) => method === 'agentSession.options' diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session.ts b/src/renderer/src/components/native-chat/use-structured-agent-session.ts index e45699e830cf..659bbafbbd94 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session.ts +++ b/src/renderer/src/components/native-chat/use-structured-agent-session.ts @@ -136,7 +136,10 @@ export function useStructuredAgentSession(args: { journalItems: transportState.journalItems, messages, status: transportEnabled ? state.status : 'ready', - error: transportEnabled ? (state.error ?? outboxController.error) : outboxController.error, + /** The outbox's own line; a failed read is worded from `readRefusal`, never its text. */ + error: outboxController.error, + /** The refusal the failed read met, while `status` is `error`. */ + readRefusal: transportEnabled ? state.readRefusal : undefined, hasOlder: transportEnabled && state.hasOlder, railOutline: transportEnabled ? railOutline : null, loadingOlder: transportEnabled && loadingOlder, @@ -144,6 +147,8 @@ export function useStructuredAgentSession(args: { loadOlder, prompts, outbox, + /** The journal's rows for sent messages, which carry a rejected message's whole fact. */ + submissions: transportState.submissions, blockedClientMessageId: outboxController.blockedClientMessageId, send: (...input: Parameters) => !commandPending.current && outboxController.send(...input), diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index 1e6ca9ecd659..57703fb7d1f4 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -2687,7 +2687,8 @@ "notAgent": { "subtitle": "This terminal is not running a recognized coding agent.", "title": "No conversation here" - } + }, + "reconnecting": "Reconnecting to this chat…" }, "status": { "responding": "Agent is responding", diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 033e0ecbb233..b7aac035aefc 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -17765,6 +17765,7 @@ "subtitle": "The transcript could not be read. Toggle back to the terminal to keep working.", "retryingSubtitle": "The transcript could not be read. Orca keeps trying to load it." }, + "reconnecting": "Reconnecting to this chat…", "pairHost": "Pair a host to view agent chat history.", "notAgent": { "title": "No conversation here", diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 5ce318699948..835eb4ab4408 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -15058,6 +15058,7 @@ "subtitle": "No se pudo leer la transcripción. Vuelva a la terminal para seguir trabajando.", "retryingSubtitle": "No se pudo leer la transcripción. Orca sigue intentando cargarla." }, + "reconnecting": "Reconectando con este chat…", "pairHost": "Empareje un host para ver el historial de chat del agente.", "notAgent": { "title": "No hay conversación aquí", diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json index b8b96da93220..d2a04423ace5 100644 --- a/src/renderer/src/i18n/locales/fr.json +++ b/src/renderer/src/i18n/locales/fr.json @@ -17620,6 +17620,7 @@ "subtitle": "La transcription n'a pas pu être lue. Rebasculez sur le terminal pour continuer à travailler.", "retryingSubtitle": "La transcription n'a pas pu être lue. Orca continue d'essayer de la charger." }, + "reconnecting": "Reconnexion à ce chat…", "pairHost": "Associez un hôte pour consulter l'historique de chat des agents.", "notAgent": { "title": "Aucune conversation ici", diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index c7041073d55b..30bbb81cab12 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -17556,6 +17556,7 @@ "subtitle": "トランスクリプトを読み取ることができませんでした。作業を続けるには、ターミナルに切り替えてください。", "retryingSubtitle": "トランスクリプトを読み取ることができませんでした。Orca は読み込みを再試行し続けます。" }, + "reconnecting": "このチャットに再接続しています…", "pairHost": "ホストをペアリングして、Agent のチャット履歴を表示します。", "notAgent": { "title": "ここでは会話はありません", diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index dfb560ec1ecf..2c2318895a6b 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -17556,6 +17556,7 @@ "subtitle": "스크립트를 읽을 수 없습니다. 계속 작업하려면 terminal로 다시 전환하세요.", "retryingSubtitle": "스크립트를 읽을 수 없습니다. Orca가 계속 다시 불러오기를 시도합니다." }, + "reconnecting": "이 채팅에 다시 연결하는 중…", "pairHost": "호스트를 페어링하여 에이전트 채팅 기록을 확인하세요.", "notAgent": { "title": "여기에는 대화가 없습니다.", diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 6433b62a2328..3c0f5d7aa3dc 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -17521,6 +17521,7 @@ "subtitle": "无法读取记录。请切回终端继续工作。", "retryingSubtitle": "无法读取记录。Orca 会继续尝试加载。" }, + "reconnecting": "正在重新连接此聊天…", "pairHost": "配对主机以查看智能体聊天记录。", "notAgent": { "title": "这里没有对话", diff --git a/src/renderer/src/lib/launch-structured-agent-session.ts b/src/renderer/src/lib/launch-structured-agent-session.ts index 759f5c7d6146..e1594d94c975 100644 --- a/src/renderer/src/lib/launch-structured-agent-session.ts +++ b/src/renderer/src/lib/launch-structured-agent-session.ts @@ -12,6 +12,11 @@ import { import { resolveStructuredLaunchSeedOptions } from '../../../shared/native-chat-session-option-defaults' import { hasRuntimeRpcErrorCode } from '../../../shared/runtime-rpc-error-code' import { isDefinitiveAgentSessionCreateRefusal } from '../../../shared/agent-session-definitive-refusal' +import { + readAgentSessionRefusalReference, + type AgentSessionRefusalReference +} from '../../../shared/agent-session-wire-refusals' +import { readAgentSessionErrorRefusal } from '../../../shared/agent-session-write-failure' import { callStructuredAgentSession } from '@/runtime/structured-agent-session-client' import { toRuntimeWorktreeSelector } from '@/runtime/runtime-worktree-selector' import { useAppStore } from '@/store' @@ -47,7 +52,9 @@ class StructuredAgentSessionCreateError extends Error { constructor( message: string, /** The wire refusal code, or the RPC error code when the create never reached a handler. */ - readonly code: string + readonly code: string, + /** The host's refusal as a reader may word it; absent from an older host or a local failure. */ + readonly refusal?: AgentSessionRefusalReference ) { super(message) } @@ -58,8 +65,12 @@ class StructuredAgentSessionCreateError extends Error { * `launchStructuredAgentSession` is the only place that decides it against the shared allowlist. */ export class StructuredAgentSessionCreateRefusalError extends StructuredAgentSessionCreateError { - constructor(message: string, code: string = 'structured_agent_session_unsupported') { - super(message, code) + constructor( + message: string, + code: string = 'structured_agent_session_unsupported', + refusal?: AgentSessionRefusalReference + ) { + super(message, code, refusal) this.name = 'StructuredAgentSessionCreateRefusalError' } } @@ -70,8 +81,8 @@ export class StructuredAgentSessionCreateRefusalError extends StructuredAgentSes * down the same path as a lost reply, which replays the intent and reconciles. */ export class StructuredAgentSessionCreateUnknownOutcomeError extends StructuredAgentSessionCreateError { - constructor(message: string, code: string) { - super(message, code) + constructor(message: string, code: string, refusal?: AgentSessionRefusalReference) { + super(message, code, refusal) this.name = 'StructuredAgentSessionCreateUnknownOutcomeError' } } @@ -252,7 +263,8 @@ async function hostSupportsCreate(intent: StructuredAgentSessionLaunchIntent): P } throw new StructuredAgentSessionCreateUnknownOutcomeError( error instanceof Error ? error.message : String(error), - code + code, + readAgentSessionErrorRefusal(error) ) } } @@ -291,20 +303,22 @@ export async function launchStructuredAgentSession( abandonStructuredAgentSessionLaunchIntent(intent) throw new StructuredAgentSessionCreateRefusalError( error instanceof Error ? error.message : String(error), - code + code, + readAgentSessionErrorRefusal(error) ) } throw error } if (!result.ok) { const { code, message, ownerVerdict } = result.refusal + const refusal = readAgentSessionRefusalReference(result.refusal) // A failed operation whose provider is proven gone is a failure a new operation may retry. if (!isDefinitiveAgentSessionCreateRefusal(code) && ownerVerdict !== 'exited') { // Keep the focus intent: the session may exist, and recovery still has to adopt it. - throw new StructuredAgentSessionCreateUnknownOutcomeError(message, code) + throw new StructuredAgentSessionCreateUnknownOutcomeError(message, code, refusal) } abandonStructuredAgentSessionLaunchIntent(intent) - throw new StructuredAgentSessionCreateRefusalError(message, code) + throw new StructuredAgentSessionCreateRefusalError(message, code, refusal) } return { sessionId: result.value.sessionId, fence: result.value.fence } } diff --git a/src/renderer/src/lib/structured-agent-session-launch-exited-owner.test.ts b/src/renderer/src/lib/structured-agent-session-launch-exited-owner.test.ts index 1662e4c04300..10ebbc8fd890 100644 --- a/src/renderer/src/lib/structured-agent-session-launch-exited-owner.test.ts +++ b/src/renderer/src/lib/structured-agent-session-launch-exited-owner.test.ts @@ -1,6 +1,6 @@ // @vitest-environment happy-dom // The launch client against the create wire contract: a failed create whose provider is proven -// gone reads as failed (with its reason) and Retry starts it again; any other verdict stays unknown. +// gone reads as failed (with its refusal) and Retry starts it again; any other verdict stays unknown. import { beforeEach, describe, expect, it, vi } from 'vitest' import type { @@ -49,13 +49,14 @@ import { startStructuredAgentLaunch } from './structured-agent-session-launch' import { - getStructuredAgentSessionLaunchFailureReason, + getStructuredAgentSessionLaunchFailure, resetStructuredAgentLaunchRegistryForTests } from './structured-agent-session-launch-registry' import { resetStructuredAgentLaunchPersistenceForTests } from './structured-agent-session-launch-persistence' const WORKTREE = 'wt-1' const EXIT_REASON = 'claude stream-json exited (code 1): stderr tail' +const HOST_REFUSAL = { kind: 'refused', code: 'agent_session_operation_invalid' } /** The verdict the host puts on the failed operation's replay; undefined models an older host. */ let replayVerdict: AgentSessionOwnerVerdict | undefined @@ -125,12 +126,13 @@ beforeEach(() => { }) describe('structured launch after a host-failed create', () => { - it('fails with the host reason when the provider is proven gone, and Retry starts it under a new operation', async () => { + it('fails with the host refusal when the provider is proven gone, and Retry starts it under a new operation', async () => { const sessionId = launch() await settle(sessionId) expect(getStructuredAgentSessionLaunchLifecycle(WORKTREE, sessionId)).toBe('failed') - expect(getStructuredAgentSessionLaunchFailureReason(WORKTREE, sessionId)).toBe(EXIT_REASON) + // The host's message is for its log; the Retry line words the refusal. + expect(getStructuredAgentSessionLaunchFailure(WORKTREE, sessionId)).toEqual(HOST_REFUSAL) expect(createdOperations.every((operation) => operation === failedOperation)).toBe(true) expect(retryStructuredAgentSessionLaunch(WORKTREE, sessionId)).toBe(true) @@ -147,7 +149,8 @@ describe('structured launch after a host-failed create', () => { const sessionId = launch() await settle(sessionId) expect(getStructuredAgentSessionLaunchLifecycle(WORKTREE, sessionId)).toBe('failed') - expect(getStructuredAgentSessionLaunchFailureReason(WORKTREE, sessionId)).toBe(EXIT_REASON) + // The host's message is for its log; the Retry line words the refusal. + expect(getStructuredAgentSessionLaunchFailure(WORKTREE, sessionId)).toEqual(HOST_REFUSAL) expect(createdOperations).toEqual([failedOperation]) expect(retryStructuredAgentSessionLaunch(WORKTREE, sessionId)).toBe(true) await settle(sessionId) diff --git a/src/renderer/src/lib/structured-agent-session-launch-failure.ts b/src/renderer/src/lib/structured-agent-session-launch-failure.ts new file mode 100644 index 000000000000..b9ad791a0c44 --- /dev/null +++ b/src/renderer/src/lib/structured-agent-session-launch-failure.ts @@ -0,0 +1,18 @@ +// What a failed chat start's Retry line may say: the host's refusal, never its message. + +import { readAgentSessionRefusalReference } from '../../../shared/agent-session-wire-refusals' +import { + agentSessionRefusalFailure, + readAgentSessionErrorRefusal, + type AgentSessionWriteRefusal +} from '../../../shared/agent-session-write-failure' + +/** The host's refusal behind a failed launch; undefined when the failure carried none (a lost + * reply, a local fault, an older host). Reads a create error's own refusal or an RPC error's. */ +export function structuredLaunchFailure(error: unknown): AgentSessionWriteRefusal | undefined { + const refusal = + error instanceof Error && 'refusal' in error + ? readAgentSessionRefusalReference(error.refusal) + : readAgentSessionErrorRefusal(error) + return refusal ? agentSessionRefusalFailure(refusal) : undefined +} diff --git a/src/renderer/src/lib/structured-agent-session-launch-options.test.ts b/src/renderer/src/lib/structured-agent-session-launch-options.test.ts index 8fa72308538f..3787ebe36080 100644 --- a/src/renderer/src/lib/structured-agent-session-launch-options.test.ts +++ b/src/renderer/src/lib/structured-agent-session-launch-options.test.ts @@ -3,6 +3,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import type { RuntimeMobileSessionTabsResult } from '../../../shared/runtime-session-contracts' import type { StructuredAgentSessionLaunchIntent } from '@/lib/launch-structured-agent-session' +import { RuntimeRpcCallError } from '@/runtime/runtime-rpc-result' type CallParams = { envelope?: { expectedRuntimeFence?: number | null } @@ -264,6 +265,41 @@ describe('picks made while a chat launches', () => { ]) }) + it('reports a refusal the host threw as its fact, never the bare code it carries as a message', async () => { + mocks.launch.mockResolvedValue({ sessionId: SESSION_ID, fence: 1 }) + startStructuredAgentLaunch(WORKTREE_ID, 'codex') + const pick = holdStructuredAgentSessionLaunchOption(SESSION_ID, 'model', 'gpt-missing') + await settle() + setOptionReplies[0]!.resolve( + Promise.reject( + new RuntimeRpcCallError({ + id: 'request-1', + ok: false, + error: { + code: 'runtime_error', + message: 'agent_session_journal_unreadable', + data: { + refusal: { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalUnavailable' } + } + } + }, + _meta: { runtimeId: 'runtime-1' } + }) + ) + ) + + await expect(pick).resolves.toEqual({ + kind: 'refused', + failure: { + kind: 'refused', + code: 'agent_session_journal_unreadable', + details: { reason: 'journalUnavailable' } + } + }) + }) + it('keeps picks held through a failed start and applies them to the retry', async () => { mocks.launch .mockRejectedValueOnce(new StructuredAgentSessionCreateRefusalError('unsupported')) diff --git a/src/renderer/src/lib/structured-agent-session-launch-options.ts b/src/renderer/src/lib/structured-agent-session-launch-options.ts index 091e7543f88a..b087264ce251 100644 --- a/src/renderer/src/lib/structured-agent-session-launch-options.ts +++ b/src/renderer/src/lib/structured-agent-session-launch-options.ts @@ -23,7 +23,7 @@ import { } from './structured-agent-session-launch-registry' import { agentSessionRefusalFailure, - agentSessionRpcErrorFailure, + agentSessionThrownFailure, type AgentSessionWriteFailure } from '../../../shared/agent-session-write-failure' @@ -110,7 +110,8 @@ async function setLaunchOption( } catch (error) { return { kind: 'refused', - failure: agentSessionRpcErrorFailure( + failure: agentSessionThrownFailure( + error, error instanceof RuntimeRpcCallError ? error.code : undefined ) } diff --git a/src/renderer/src/lib/structured-agent-session-launch-registry.ts b/src/renderer/src/lib/structured-agent-session-launch-registry.ts index dcafea65803d..2f444446e03e 100644 --- a/src/renderer/src/lib/structured-agent-session-launch-registry.ts +++ b/src/renderer/src/lib/structured-agent-session-launch-registry.ts @@ -1,5 +1,6 @@ import { useSyncExternalStore } from 'react' import type { AgentSessionHandleProvider } from '../../../shared/agent-session-provider-handle' +import type { AgentSessionWriteRefusal } from '../../../shared/agent-session-write-failure' import type { StructuredAgentSessionResumeSource } from '../../../shared/structured-agent-session-create' import type { StructuredLaunchRecoveryState } from './structured-agent-session-launch-recovery' import type { StructuredLaunchSelection } from './structured-agent-session-launch-options' @@ -26,8 +27,9 @@ export type StructuredLaunchState = StructuredLaunchRecoveryState & { /** Fixed by the caller that opened this launch so coalesced prompts use one delivery mode. */ promptDelivery: StructuredAgentLaunchOptions['promptDelivery'] callers: StructuredLaunchCallerGroup - /** Why the last attempt failed, shown beside Retry; the toast stays generic. */ - failureReason?: string + /** The host's refusal behind the last failed attempt, worded beside Retry; the toast stays + * generic. Absent when the failure named none. */ + failure?: AgentSessionWriteRefusal selection: StructuredLaunchSelection } @@ -176,25 +178,25 @@ export function getStructuredAgentSessionLaunchResumes(sessionId: string): boole return resumeFrom !== undefined } -export function getStructuredAgentSessionLaunchFailureReason( +export function getStructuredAgentSessionLaunchFailure( worktreeId: string, sessionId: string -): string | null { +): AgentSessionWriteRefusal | null { const state = getStructuredLaunchStateBySessionId(sessionId) return state && matchesLaunchWorktree(state, worktreeId) && launchStateLifecycle(state) === 'failed' - ? (state.failureReason ?? null) + ? (state.failure ?? null) : null } -export function useStructuredAgentSessionLaunchFailureReason( +export function useStructuredAgentSessionLaunchFailure( worktreeId: string, sessionId: string -): string | null { +): AgentSessionWriteRefusal | null { return useSyncExternalStore( subscribeStructuredAgentLaunchStatus, - () => getStructuredAgentSessionLaunchFailureReason(worktreeId, sessionId), + () => getStructuredAgentSessionLaunchFailure(worktreeId, sessionId), () => null ) } diff --git a/src/renderer/src/lib/structured-agent-session-launch.ts b/src/renderer/src/lib/structured-agent-session-launch.ts index 5ad75c36ed67..4c62128813b4 100644 --- a/src/renderer/src/lib/structured-agent-session-launch.ts +++ b/src/renderer/src/lib/structured-agent-session-launch.ts @@ -27,6 +27,7 @@ import { } from '@/lib/structured-agent-session-launch-callers' import * as launchDraft from './structured-agent-session-launch-draft' import { trackStructuredLaunchFailureToast } from './structured-agent-session-launch-failure-toast' +import { structuredLaunchFailure } from './structured-agent-session-launch-failure' import { deleteStructuredLaunchStateIfCurrent, getStructuredLaunchState, @@ -51,7 +52,7 @@ export { retireStructuredAgentSessionLaunchCancellationTombstone, shouldRetainStructuredAgentSessionLaunchTab, subscribeStructuredAgentLaunchStatus, - useStructuredAgentSessionLaunchFailureReason, + useStructuredAgentSessionLaunchFailure, useStructuredAgentSessionLaunchLifecycle, type StructuredAgentLaunchStatus, type StructuredAgentSessionLaunchLifecycle @@ -138,7 +139,13 @@ function trackLaunchSettlement( } return } - state.failureReason = error instanceof Error ? error.message : String(error) + // The host's message is for its log; the Retry line words the refusal itself. + const failure = structuredLaunchFailure(error) + if (failure) { + state.failure = failure + } else { + delete state.failure + } if (error instanceof StructuredAgentSessionCreateRefusalError) { settleStructuredLaunchRefusal(state) } else if (!state.visibilityUnknown) { @@ -171,7 +178,7 @@ function restartStructuredLaunchState(state: StructuredLaunchState): void { state.intent = retryStructuredAgentSessionLaunchIntent(state.intent) } resetStructuredLaunchCallers(state) - delete state.failureReason + delete state.failure state.callers.outcome = 'pending' // A new create seeds from the settings of now; picks held through the failure still apply. state.selection = { ...state.selection, seed: state.intent.seedOptions } diff --git a/src/renderer/src/runtime/runtime-host-contact-regained.test.ts b/src/renderer/src/runtime/runtime-host-contact-regained.test.ts new file mode 100644 index 000000000000..5daabf377901 --- /dev/null +++ b/src/renderer/src/runtime/runtime-host-contact-regained.test.ts @@ -0,0 +1,111 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import type { RuntimeStatus } from '../../../shared/runtime-types' + +vi.mock('sonner', () => ({ + toast: { warning: vi.fn(), dismiss: vi.fn() } +})) + +vi.mock('@/store', async () => { + const { create } = await import('zustand') + const { createRuntimeStatusSlice } = await import('@/store/slices/runtime-status') + type Slice = ReturnType + return { + useAppStore: create()((...a) => + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the slice reads only its own fields. + createRuntimeStatusSlice(...(a as unknown as Parameters)) + ) + } +}) + +import { useAppStore } from '@/store' +import { clearRuntimeEnvironmentConnectionGenerationsForTests } from '@/store/slices/runtime-status' +import { subscribeRuntimeHostContactRegained } from './runtime-host-contact-regained' + +function makeStatus(runtimeId: string): RuntimeStatus { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: fixture carries only the fields the slice reads. + return { + runtimeId, + rendererGraphEpoch: 0, + graphStatus: 'ready', + authoritativeWindowId: null, + liveTabCount: 0, + liveLeafCount: 0, + runtimeProtocolVersion: 3, + minCompatibleRuntimeClientVersion: 3 + } as RuntimeStatus +} + +let lastVerified: RuntimeStatus | null = null + +// As the host-status snapshot does: an outage keeps the last verified status, so a same-runtime +// return moves only the contact epoch, not the connection generation. +function publish(status: RuntimeStatus | null, checkedAt: number): void { + lastVerified = status ?? lastVerified + useAppStore.getState().setRuntimeEnvironmentStatus('env-a', { + status, + checkedAt, + snapshot: { + environmentId: 'env-a', + pairingRevision: 1, + sequence: checkedAt, + checkedAt, + status: lastVerified, + verification: status ? 'verified' : 'unavailable', + transport: status ? 'ready' : 'disconnected' + } + }) +} + +beforeEach(() => { + clearRuntimeEnvironmentConnectionGenerationsForTests() + vi.stubGlobal('window', { api: {}, dispatchEvent: vi.fn() }) + useAppStore.setState({ runtimeStatusByEnvironmentId: new Map() }) + lastVerified = null +}) + +afterEach(() => { + vi.unstubAllGlobals() +}) + +describe('subscribeRuntimeHostContactRegained', () => { + it('fires when the runtime answers again after an outage, and not while it stays down', () => { + publish(makeStatus('runtime-a'), 1) + const listener = vi.fn() + const stop = subscribeRuntimeHostContactRegained('env-a', listener) + + publish(null, 2) + publish(null, 3) + expect(listener).not.toHaveBeenCalled() + + // Same runtime back: only the contact epoch moves. + const generation = useAppStore + .getState() + .runtimeStatusByEnvironmentId.get('env-a')?.connectionGeneration + publish(makeStatus('runtime-a'), 4) + expect( + useAppStore.getState().runtimeStatusByEnvironmentId.get('env-a')?.connectionGeneration + ).toBe(generation) + expect(listener).toHaveBeenCalledTimes(1) + publish(makeStatus('runtime-a'), 5) + expect(listener).toHaveBeenCalledTimes(1) + + // A restarted runtime: the connection generation moves. + publish(makeStatus('runtime-b'), 6) + expect(listener).toHaveBeenCalledTimes(2) + + stop() + publish(null, 7) + publish(makeStatus('runtime-b'), 8) + expect(listener).toHaveBeenCalledTimes(2) + }) + + it('ignores other environments', () => { + publish(makeStatus('runtime-a'), 1) + const listener = vi.fn() + const stop = subscribeRuntimeHostContactRegained('env-b', listener) + publish(null, 2) + publish(makeStatus('runtime-a'), 3) + expect(listener).not.toHaveBeenCalled() + stop() + }) +}) diff --git a/src/renderer/src/runtime/runtime-host-contact-regained.ts b/src/renderer/src/runtime/runtime-host-contact-regained.ts new file mode 100644 index 000000000000..b829f51d99a5 --- /dev/null +++ b/src/renderer/src/runtime/runtime-host-contact-regained.ts @@ -0,0 +1,31 @@ +import { useAppStore } from '@/store' +import type { AppState } from '@/store/types' + +function contactMarks(state: AppState, environmentId: string): string | null { + const entry = state.runtimeStatusByEnvironmentId.get(environmentId) + return entry ? `${entry.hostContactEpoch ?? 0}:${entry.connectionGeneration ?? 0}` : null +} + +/** + * Calls `listener` each time this client regains contact with an environment's runtime: the + * same-runtime return (`hostContactEpoch`) or a new runtime session (`connectionGeneration`), + * both published by runtime-status.ts. + */ +export function subscribeRuntimeHostContactRegained( + environmentId: string, + listener: () => void +): () => void { + let lastMarks = contactMarks(useAppStore.getState(), environmentId) + return useAppStore.subscribe((state, previousState) => { + if (state.runtimeStatusByEnvironmentId === previousState.runtimeStatusByEnvironmentId) { + return + } + const marks = contactMarks(state, environmentId) + // Why keep the last marks across a missing entry: a cleared status that returns is a reconnect. + if (marks === null || marks === lastMarks) { + return + } + lastMarks = marks + listener() + }) +} diff --git a/src/shared/agent-session-failure-words.ts b/src/shared/agent-session-failure-words.ts index f02d02abdea9..edd399edc473 100644 --- a/src/shared/agent-session-failure-words.ts +++ b/src/shared/agent-session-failure-words.ts @@ -53,6 +53,9 @@ export type AgentSessionFailureWordsContext = { /** The conversation command a failed start was for, so the next step is to run it again * rather than to send a message. */ command?: 'clear' + /** The surface retries for the person — its own Retry beside the words, or a read that reconnects + * on its own — so they leave out sending or trying again. */ + retryControl?: boolean } /** @@ -110,7 +113,10 @@ function retryStep({ command }: AgentSessionFailureWordsContext): string { } /** The next step after a start or restart that failed: the command, or the message, again. */ -function startRetry({ command }: AgentSessionFailureWordsContext): string { +function startRetry({ command, retryControl }: AgentSessionFailureWordsContext): string { + if (retryControl) { + return '' + } return command === 'clear' ? ' Run /clear again.' : ' Send your message to try again.' } @@ -162,8 +168,9 @@ const FAILURE_SENTENCES = { providerStartFailed: (context) => `${context.agentName ?? 'The agent'} stopped before it finished starting.${startRetry(context)}`, startFailed: couldNot('start'), + // Beside a Retry the resend is the button, but signing in is still a step to take first. notSignedIn: (context) => - `${context.agentName ?? 'The agent'} is not signed in for the selected account. Sign in, then ${retryStep(context)}.`, + `${context.agentName ?? 'The agent'} is not signed in for the selected account. ${context.retryControl ? 'Sign in first.' : `Sign in, then ${retryStep(context)}.`}`, historyTooLarge: () => `This conversation's history is too large to restore here. ${START_NEW_CHAT}`, managedAccountEnvOverride: () => @@ -171,7 +178,7 @@ const FAILURE_SENTENCES = { accountSwitchInProgress: () => 'A Claude account switch is in progress. Try again after it finishes.', managedAccountUnsupported: (context) => - `While a Claude account is added in WSL, Claude chats need a Windows Claude account. Choose or add one in Claude Accounts settings, then ${retryStep(context)}.`, + `While a Claude account is added in WSL, Claude chats need a Windows Claude account. Choose or add one in Claude Accounts settings${context.retryControl ? '' : `, then ${retryStep(context)}`}.`, providerExited: ({ agentName }, _, surface) => surface === 'row' ? `${agentName ?? 'The agent'} stopped while this response was in progress. You can continue in this conversation.` @@ -190,12 +197,16 @@ const FAILURE_SENTENCES = { cancelled: () => 'This message was withdrawn before the agent started it.', chatClosed: () => 'The chat closed before this message was sent.', hostRestarted: () => 'Orca restarted before this message was sent.', - notDelivered: () => 'This message was not delivered. Send it again to continue.', + notDelivered: ({ retryControl }) => + retryControl + ? 'This message was not delivered.' + : 'This message was not delivered. Send it again to continue.', compactionFailed: (_, fact) => quotingPersonDetail('Compaction failed', fact.detail), compactionUnconfirmed: () => 'Compaction completion is unconfirmed.', cancelUnconfirmed: () => 'Cancellation was not confirmed.', answerUnconfirmed: () => 'Your answer was recorded but the agent did not confirm it.', - hostFault: () => "Orca ran into a problem, so this didn't go through. Try again.", + hostFault: ({ retryControl }) => + `Orca ran into a problem, so this didn't go through.${retryControl ? '' : ' Try again.'}`, hostStopped: ({ agentName }) => `${agentName ?? 'The agent'} never finished starting, so Orca stopped it.`, providerRetrying: ({ agentName }, { retry }) => diff --git a/src/shared/agent-session-refusal-notice.test.ts b/src/shared/agent-session-refusal-notice.test.ts index 73652adbf1ad..a83a95c43880 100644 --- a/src/shared/agent-session-refusal-notice.test.ts +++ b/src/shared/agent-session-refusal-notice.test.ts @@ -5,6 +5,7 @@ import { } from './agent-session-wire-refusals' import { agentSessionReadHistoryRefusalParts, + agentSessionRefusalCauseParts, agentSessionRefusalNotice, agentSessionRefusalReasonWords, agentSessionWriteFailureNotice, @@ -368,6 +369,45 @@ describe('the notice for every reason a host names', () => { } }) + // Beside a Retry, that Retry is the step for a reason whose action is to retry, and only for it. + it('leaves out only a retry step when a Retry stands beside the words', () => { + const beside = { agentName: 'Codex', retryControl: true } + for (const { failure, write, parts, words, cell } of cells) { + if (words && 'cause' in words) { + const retried = words.action === 'retry' ? words.step : undefined + expect(agentSessionWriteNoticeParts(failure, write, beside), cell).toEqual( + parts.filter((part) => part !== retried) + ) + } + } + const send = (failure: AgentSessionWriteRefusal) => + agentSessionWriteNoticeParts(failure, 'send', beside) + expect( + send({ + kind: 'refused', + code: 'agent_session_journal_unreadable', + details: { reason: 'journalUnavailable' } + }) + ).toEqual(['historyUnavailable', 'notDoneSend']) + expect( + send({ + kind: 'refused', + code: 'agent_session_operation_invalid', + details: { reason: 'notSignedIn' } + }) + ).toEqual([ + 'notDoneSend', + { text: 'Codex is not signed in for the selected account. Sign in first.' } + ]) + expect( + send({ + kind: 'refused', + code: 'agent_session_operation_invalid', + details: { reason: 'providerStartFailed' } + }) + ).toEqual(['notDoneSend', { text: 'Codex stopped before it finished starting.' }]) + }) + it('says the write did not happen, once, and never shows the host message', () => { for (const { failure, write, parts, cell } of cells) { const english = agentSessionWriteNoticeEnglish(parts) @@ -522,3 +562,84 @@ describe('a chat whose history the host could not open', () => { ]) }) }) + +// For a line that already says what did not happen and shows its own Retry, such as a chat that +// could not start: the Retry is the step for retrying and for sending again, and only for those. +describe('agentSessionRefusalCauseParts', () => { + it('keeps a step other than retrying, beside the cause', () => { + expect( + agentSessionRefusalCauseParts({ + kind: 'refused', + code: 'agent_session_operation_invalid', + details: { reason: 'turnActive' } + }) + ).toEqual(['turnActive', 'waitForTurn']) + expect( + agentSessionRefusalCauseParts({ + kind: 'refused', + code: 'agent_session_operation_invalid', + details: { reason: 'historyTooLarge' } + }) + ).toEqual([ + { + text: "This conversation's history is too large to restore here. Start a new chat to continue." + } + ]) + }) + + it('leaves out a step the Retry beside it takes', () => { + expect( + agentSessionRefusalCauseParts({ + kind: 'refused', + code: 'agent_session_journal_unreadable', + details: { reason: 'journalUnavailable' } + }) + ).toEqual(['historyUnavailable']) + expect( + agentSessionRefusalCauseParts( + { + kind: 'refused', + code: 'agent_session_operation_invalid', + details: { reason: 'notSignedIn' } + }, + { agentName: 'Claude' } + ) + ).toEqual([{ text: 'Claude is not signed in for the selected account. Sign in first.' }]) + expect( + agentSessionRefusalCauseParts({ + kind: 'refused', + code: 'agent_session_operation_invalid', + details: { reason: 'providerStartFailed' } + }) + ).toEqual([{ text: 'The agent stopped before it finished starting.' }]) + expect( + agentSessionRefusalCauseParts({ + kind: 'refused', + code: 'agent_session_operation_invalid', + details: { reason: 'managedAccountUnsupported' } + }) + ).toEqual([ + { + text: 'While a Claude account is added in WSL, Claude chats need a Windows Claude account. Choose or add one in Claude Accounts settings.' + } + ]) + }) + + it('writes the same sentences as before where no Retry stands beside them', () => { + expect(agentSessionFailureSentence({ kind: 'notSignedIn' }, 'rejection')).toBe( + 'The agent is not signed in for the selected account. Sign in, then send your message again.' + ) + }) + + it.each<[string, AgentSessionWriteFailure]>([ + ['a refusal with no reason', { kind: 'refused', code: 'agent_session_operation_invalid' }], + [ + "a reason whose code's words stand", + { kind: 'refused', code: 'agent_session_conflict', details: { reason: 'ownerAlive' } } + ], + ['a failed request', { kind: 'failed' }], + ['an unconfirmed one', { kind: 'unconfirmed' }] + ])('names nothing for %s', (_label, failure) => { + expect(agentSessionRefusalCauseParts(failure)).toEqual([]) + }) +}) diff --git a/src/shared/agent-session-refusal-notice.ts b/src/shared/agent-session-refusal-notice.ts index 818031b81915..0f4121dc9b31 100644 --- a/src/shared/agent-session-refusal-notice.ts +++ b/src/shared/agent-session-refusal-notice.ts @@ -6,11 +6,15 @@ // own row names a cause only where every emitter of the code means it; it is also the words for a // host too old to send a reason. A notice says how to get past a refusal only where the person has // a step to take; retrying is the control that sent the write, except on the phone, whose message -// goes back to the composer, and a history that couldn't open right now says to try again. +// goes back to the composer, and a history that couldn't open right now says to try again unless +// something beside the words retries it. // Surfaces keep the fact and choose the words when they show it, so nothing saved carries copy. import type { AgentSessionFailureKind } from './agent-session-failure' -import { agentSessionFailureSentence } from './agent-session-failure-words' +import { + agentSessionFailureSentence, + type AgentSessionFailureWordsContext +} from './agent-session-failure-words' import type { AgentSessionRefusalReason } from './agent-session-refusal-details' import { AGENT_SESSION_WRITE_NOTICE_COPY, @@ -80,8 +84,6 @@ export type AgentSessionRefusalReasonWords = /** A start that failed: the sentence that failure has everywhere, whose next step is a send. */ | { fact: AgentSessionFailureKind; action: AgentSessionRefusalAction } -type AgentSessionRefusalCauseWords = Extract - function codeWords(action: AgentSessionRefusalAction): AgentSessionRefusalReasonWords { return { words: 'code', action } } @@ -197,7 +199,7 @@ const REASON_WORDS = { agent_session_journal_unreadable: { // No retry reads past damage, and the words name no step: it only can't load. journalCorrupt: causeWords('historyUnusable', 'hostFinding'), - // Says its step despite 'retry': released clients and the phone often show no Retry here. + // Says its step despite 'retry' unless a Retry stands beside it: the phone often has none. journalUnavailable: causeWords('historyUnavailable', 'retry', 'tryAgain') }, // Thrown, so a client meets these only as an RPC error; the code's words stand. @@ -242,34 +244,47 @@ function causeParts( return saysNotDone ? [cause] : [cause, NOT_DONE[write]] } -function causeWordsParts( - words: AgentSessionRefusalCauseWords, - write: AgentSessionWriteKind -): AgentSessionWriteNoticeSentence[] { - const said = causeParts(words.cause, write) - return words.step ? [...said, words.step] : said -} - /** The notice a named reason has of its own; undefined leaves the code's words. */ function reasonParts( failure: AgentSessionWriteRefusal, - write: AgentSessionWriteKind + write: AgentSessionWriteKind, + context: AgentSessionFailureWordsContext ): AgentSessionWriteNoticePart[] | undefined { const words = agentSessionRefusalReasonWords(failure) if (!words || 'words' in words) { return undefined } if ('fact' in words) { + const sentence = agentSessionFailureSentence({ kind: words.fact }, 'rejection', context) return write === 'send' || write === 'composer-send' - ? [NOT_DONE[write], { text: agentSessionFailureSentence({ kind: words.fact }, 'rejection') }] + ? [NOT_DONE[write], { text: sentence }] : undefined } - return causeWordsParts(words, write) + const said = causeParts(words.cause, write) + // A Retry beside the words is the step for a reason whose action is to retry. + const retried = context.retryControl && words.action === 'retry' + return words.step && !retried ? [...said, words.step] : said } +/** What stopped a refused start, for a line that already says the chat did not start and shows its + * own Retry. Empty when the refusal names no reason with words of its own. */ +export function agentSessionRefusalCauseParts( + failure: AgentSessionWriteFailure, + context: { agentName?: string } = {} +): AgentSessionWriteNoticePart[] { + const parts = + failure.kind === 'refused' + ? reasonParts(failure, 'send', { ...context, retryControl: true }) + : undefined + return parts?.filter((part) => part !== 'notDoneSend') ?? [] +} + +/** `context.retryControl`: a Retry beside the words is the step for a reason whose action is to + * retry, and for sending again; any other step stays. */ export function agentSessionWriteNoticeParts( failure: AgentSessionWriteFailure, - write: AgentSessionWriteKind + write: AgentSessionWriteKind, + context: AgentSessionFailureWordsContext = {} ): AgentSessionWriteNoticePart[] { const notDone = NOT_DONE[write] if (failure.kind === 'failed') { @@ -278,7 +293,7 @@ export function agentSessionWriteNoticeParts( if (failure.kind === 'unconfirmed') { return ['outcomeUnknown'] } - const byReason = reasonParts(failure, write) + const byReason = reasonParts(failure, write, context) if (byReason) { return byReason } @@ -350,10 +365,11 @@ export function agentSessionWriteFailureNotice(write: AgentSessionWriteKind): st * host sent; a code this build does not know says only that the history did not load. */ export function agentSessionReadHistoryRefusalParts( code: string, - details?: unknown + details?: unknown, + context: AgentSessionFailureWordsContext = {} ): AgentSessionWriteNoticePart[] { const failure = parseAgentSessionWriteFailure({ kind: 'refused', code, details }) return failure - ? agentSessionWriteNoticeParts(failure, 'read-history') + ? agentSessionWriteNoticeParts(failure, 'read-history', context) : agentSessionWriteNotDoneParts('read-history') } diff --git a/src/shared/agent-session-write-failure.test.ts b/src/shared/agent-session-write-failure.test.ts index 83d8faea7901..0b614b3a2650 100644 --- a/src/shared/agent-session-write-failure.test.ts +++ b/src/shared/agent-session-write-failure.test.ts @@ -1,7 +1,9 @@ import { describe, expect, it } from 'vitest' import { agentSessionRefusalFailure, - parseAgentSessionWriteFailure + agentSessionThrownFailure, + parseAgentSessionWriteFailure, + readAgentSessionErrorRefusal } from './agent-session-write-failure' const HOST_TEXT = 'Expected runtime fence 1; the session is at 3.' @@ -122,3 +124,44 @@ describe('agentSessionRefusalFailure', () => { }) }) }) + +describe('a refusal a failed request carried in its error', () => { + const refusal = { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalCorrupt', stray: 'dropped' } + } + const payload = { code: 'runtime_error', message: 'agent_session_journal_unreadable' } + + it('is read from a thrown RPC error and from a stream payload alike', () => { + const expected = { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalCorrupt' } + } + expect( + readAgentSessionErrorRefusal({ response: { error: { ...payload, data: { refusal } } } }) + ).toEqual(expected) + expect(readAgentSessionErrorRefusal(saved({ ...payload, data: { refusal } }))).toEqual(expected) + }) + + it.each([ + ['an older host', payload], + ['a thrown error without a response', new Error('agent_session_journal_unreadable')], + ['a code this build does not know', { ...payload, data: { refusal: { code: 'from_later' } } }], + ['nothing', undefined] + ])('is absent from %s', (_label, error) => { + expect(readAgentSessionErrorRefusal(error)).toBeUndefined() + }) + + it("words the refusal when there is one, else what the request's error code proves", () => { + expect(agentSessionThrownFailure({ ...payload, data: { refusal } }, 'runtime_error')).toEqual({ + kind: 'refused', + code: 'agent_session_journal_unreadable', + details: { reason: 'journalCorrupt' } + }) + expect(agentSessionThrownFailure(payload, 'runtime_error')).toEqual({ kind: 'unconfirmed' }) + expect(agentSessionThrownFailure(payload, 'method_not_found')).toEqual({ + kind: 'refused', + code: 'structured_agent_session_unsupported' + }) + }) +}) diff --git a/src/shared/agent-session-write-failure.ts b/src/shared/agent-session-write-failure.ts index dd5c8f26caa2..81809133871e 100644 --- a/src/shared/agent-session-write-failure.ts +++ b/src/shared/agent-session-write-failure.ts @@ -9,7 +9,9 @@ import { import type { AgentSessionRewindReason } from './agent-session-rewind' import { isAgentSessionWireRefusalCode, + readAgentSessionRefusalReference, type AgentSessionOwnerVerdict, + type AgentSessionRefusalReference, type AgentSessionWireRefusal, type AgentSessionWireRefusalCode } from './agent-session-wire-refusals' @@ -136,6 +138,35 @@ export function agentSessionRpcErrorFailure(code: string | undefined): AgentSess : { kind: 'unconfirmed' } } +function isRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null +} + +/** The refusal a failed request's error carries in its data. Takes both shapes a client meets: an + * RPC call's thrown error, whose payload is on `response.error`, and the payload a stream hands + * its error callback. Undefined from an older host, or for a failure that was not a refusal. */ +export function readAgentSessionErrorRefusal( + error: unknown +): AgentSessionRefusalReference | undefined { + const payload = + isRecord(error) && isRecord(error.response) && isRecord(error.response.error) + ? error.response.error + : error + const data = isRecord(payload) ? payload.data : undefined + return isRecord(data) ? readAgentSessionRefusalReference(data.refusal) : undefined +} + +/** What to say about a request that threw: the host's refusal when its error carried one, else + * what the RPC error code proves. Words only: whether the write may have happened stays the + * caller's own classification. */ +export function agentSessionThrownFailure( + error: unknown, + rpcCode: string | undefined +): AgentSessionWriteFailure { + const refusal = readAgentSessionErrorRefusal(error) + return refusal ? agentSessionRefusalFailure(refusal) : agentSessionRpcErrorFailure(rpcCode) +} + /** A saved failure, or undefined when it is not one this build wrote. */ export function parseAgentSessionWriteFailure( value: unknown diff --git a/src/shared/structured-agent-session-outbox.ts b/src/shared/structured-agent-session-outbox.ts index 4211bbb3961d..c14209a716cc 100644 --- a/src/shared/structured-agent-session-outbox.ts +++ b/src/shared/structured-agent-session-outbox.ts @@ -36,8 +36,9 @@ export type StructuredAgentSessionOutboxEntry = { lastFailure?: StructuredAgentSessionAttemptFailure } -/** A host's rejection fact as a message keeps it: never its provider detail, whose person-facing - * words are already in the reason and whose log text is not kept client-side. */ +/** A host's rejection fact as a message keeps it: never its provider detail, whose log text is not + * kept client-side, or its refusal. The journal row keeps the whole fact, and words the notice + * while it is loaded; this copy words it when it is not. */ export type StructuredAgentSessionRejectionFact = Pick< AgentSessionFailureFact, 'kind' | 'attachment' diff --git a/src/shared/structured-agent-session-read-refusal.ts b/src/shared/structured-agent-session-read-refusal.ts index 784f38ed2a25..74279d7811d6 100644 --- a/src/shared/structured-agent-session-read-refusal.ts +++ b/src/shared/structured-agent-session-read-refusal.ts @@ -1,3 +1,5 @@ +import type { AgentSessionRefusalReference } from './agent-session-wire-refusals' + /** * The one refusal a structured-session READ can raise that is not a failure to read. * @@ -43,3 +45,17 @@ export function isUnattachedAgentSessionReadRefusal(error: unknown): boolean { message === AGENT_SESSION_UNATTACHED_REFUSAL_CODE ) } + +/** + * A read refusal no retry reads past: SQLite reported the chat's journal damaged. Decided from the + * reason, never the message, which is the bare code for every journal refusal; a journal that + * failed to open for any other reason can clear, so its read keeps reconnecting. + */ +export function isFinalAgentSessionReadRefusal( + refusal: AgentSessionRefusalReference | undefined +): boolean { + return ( + refusal?.code === 'agent_session_journal_unreadable' && + refusal.details?.reason === 'journalCorrupt' + ) +} diff --git a/src/shared/structured-agent-session-reducer.test.ts b/src/shared/structured-agent-session-reducer.test.ts index a374c794d7fb..ca108710bcf8 100644 --- a/src/shared/structured-agent-session-reducer.test.ts +++ b/src/shared/structured-agent-session-reducer.test.ts @@ -158,6 +158,46 @@ describe('structured agent session reducer', () => { ]) }) + it("keeps a failed read's refusal beside its text until the read recovers", () => { + const refusal = { + code: 'agent_session_journal_unreadable', + details: { reason: 'journalCorrupt' } + } as const + const failed = reduceStructuredAgentSession(EMPTY_STRUCTURED_AGENT_SESSION, { + type: 'error', + message: 'agent_session_journal_unreadable', + refusal + }) + expect(failed).toMatchObject({ status: 'error', readRefusal: refusal }) + + expect(reduceStructuredAgentSession(failed, { type: 'loading' }).readRefusal).toBeUndefined() + const live = reduceStructuredAgentSession( + reduceStructuredAgentSession(failed, { + type: 'history-page', + page: hydrationPage([item('a', 1)]) + }), + { type: 'error', message: 'transport died' } + ) + expect(live.readRefusal).toBeUndefined() + const recovered = reduceStructuredAgentSession( + { ...live, readRefusal: refusal }, + { + type: 'event', + event: { + type: 'batch', + sessionId: 'session-a', + batch: { + cursor: { epoch: 'epoch-a', sequence: 2 }, + items: [item('b', 2)], + removedItemIds: [], + submissions: [] + } + } + } + ) + expect(recovered).toMatchObject({ status: 'ready', error: undefined, readRefusal: undefined }) + }) + it('uses the bounded hydration page pagination boundary', () => { const restored = reduceStructuredAgentSession(EMPTY_STRUCTURED_AGENT_SESSION, { type: 'event', diff --git a/src/shared/structured-agent-session-reducer.ts b/src/shared/structured-agent-session-reducer.ts index e47ed5ad57b4..02c554628fb8 100644 --- a/src/shared/structured-agent-session-reducer.ts +++ b/src/shared/structured-agent-session-reducer.ts @@ -10,6 +10,7 @@ import type { AgentSessionSubscribeEvent, AgentSessionTurnActivity } from './agent-session-wire' +import type { AgentSessionRefusalReference } from './agent-session-wire-refusals' import { backgroundTaskStatesEqual } from './agent-session-background-task-state-equality' import { agentJournalSubmissionKey } from './agent-session-journal-item-key' import { compareAgentJournalItems } from './agent-session-journal-position' @@ -32,7 +33,10 @@ export type StructuredAgentSessionState = { retainedItemLimit: number hasOlder: boolean status: 'idle' | 'loading' | 'ready' | 'error' + /** The failed read's own text, for logs; a surface words `readRefusal` instead. */ error?: string + /** The refusal the failed read met, when the host sent one; cleared with `error`. */ + readRefusal?: AgentSessionRefusalReference backgroundTasks?: AgentSessionBackgroundTaskState | null commands?: AgentSessionSlashCommand[] | null activity?: AgentSessionTurnActivity | null @@ -45,7 +49,7 @@ export type StructuredAgentSessionState = { export type StructuredAgentSessionAction = | { type: 'loading' } - | { type: 'error'; message: string } + | { type: 'error'; message: string; refusal?: AgentSessionRefusalReference } | { type: 'event'; event: AgentSessionSubscribeEvent } | { type: 'history-page'; page: AgentSessionHistoryPage } | { type: 'older-page'; requestedCursor: AgentJournalCursor; page: AgentSessionHistoryPage } @@ -176,10 +180,10 @@ export function reduceStructuredAgentSession( ): StructuredAgentSessionState { if (action.type === 'loading') { // Keep the last transcript visible while a reconnect rehydrates the stream. - return { ...state, status: 'loading', error: undefined } + return { ...state, status: 'loading', error: undefined, readRefusal: undefined } } if (action.type === 'error') { - return { ...state, status: 'error', error: action.message } + return { ...state, status: 'error', error: action.message, readRefusal: action.refusal } } if (action.type === 'history-page') { return { @@ -272,6 +276,7 @@ export function reduceStructuredAgentSession( : mergeSubmissions(state.submissions, event.batch.submissions, items), status: 'ready', error: undefined, + readRefusal: undefined, commands: event.commands !== undefined ? event.commands : state.commands, ...(backgroundTasks !== undefined ? { backgroundTasks } : {}), ...(activity !== undefined ? { activity } : {}), diff --git a/src/shared/structured-agent-session-send-disposition.test.ts b/src/shared/structured-agent-session-send-disposition.test.ts index 08fad831af2d..e95a21937d1c 100644 --- a/src/shared/structured-agent-session-send-disposition.test.ts +++ b/src/shared/structured-agent-session-send-disposition.test.ts @@ -55,12 +55,12 @@ function rejectedWith( } } -function notice(reason: string | null): string | undefined { +function notice(reason: string | null, rejection?: AgentSessionFailureFact): string | undefined { const disposition = disposeStructuredAgentSessionSendResult({ entries: [entry], entry, blockedClientMessageId: null, - result: rejectedWith(reason), + result: rejectedWith(reason, rejection ? { rejection } : {}), createOperationId: () => 'unused' }) // The reason travels with the message it explains, never as a separate error. @@ -121,8 +121,7 @@ describe('what a rejection shows the user', () => { expect(disposition).toEqual({ entries: [], error: null, - blockedClientMessageId: null, - retryWithFreshClientMessageId: null + blockedClientMessageId: null }) } }) @@ -157,6 +156,64 @@ describe('what a rejection shows the user', () => { }) }) +// A row that carries the host's fact is worded from it; the reason is not read. +describe('what a rejection with a typed fact shows the user', () => { + it('says Orca could not hand the message over, whatever the reason holds', () => { + expect(notice('provider_write_failed', { kind: 'writeFailed' })).toBe( + "Orca couldn't reach the agent. Your message was not sent." + ) + expect(notice('Something unrelated.', { kind: 'writeFailed' })).toBe( + "Orca couldn't reach the agent. Your message was not sent." + ) + }) + + it("rebuilds the fact's sentence where a marker stands in for it", () => { + expect(notice(DISPATCH_REJECTED_QUEUE_FULL, { kind: 'queueFull' })).toBe( + 'Too many messages were waiting for the agent, so this one was not sent.' + ) + }) + + // The surface names the agent; the host's own sentence is never compared or shown. + it('words the fact itself, never the sentence the host wrote beside it', () => { + expect( + notice('Claude never finished starting, so Orca stopped it.', { kind: 'hostStopped' }) + ).toBe('The agent never finished starting, so Orca stopped it.') + }) + + // The message keeps no fact it cannot place, so the host's sentence stands, as on an older host. + it("shows a newer host's sentence when its fact cannot be placed", () => { + expect(notice('A sentence a newer host wrote.', JSON.parse('{"kind":"fromTheFuture"}'))).toBe( + 'A sentence a newer host wrote.' + ) + }) + + // The message's copy drops the detail and the refusal these kinds are worded from, so the + // sentence the host wrote for the person stands in for them; with none, the table's words. + it("shows the host's sentence for a kind whose words its copy cannot rebuild", () => { + expect( + notice('The provider did not accept this message: Image type .bmp.', { + kind: 'providerRejected', + detail: { text: 'Image type .bmp', audience: 'person' } + }) + ).toBe('The provider did not accept this message: Image type .bmp.') + expect( + notice("Claude couldn't start. Start a new chat to continue.", { + kind: 'startFailed', + refusal: { code: 'agent_session_identity_required' } + }) + ).toBe("Claude couldn't start. Start a new chat to continue.") + expect(notice(null, { kind: 'providerRejected' })).toBe( + 'The provider did not accept this message.' + ) + }) + + it('says only that the message was not sent for a fact no message can carry', () => { + expect(notice('Compaction failed.', { kind: 'compactionFailed' })).toBe( + 'Your message was not sent.' + ) + }) +}) + describe('what a refusal shows the user', () => { it('keeps the refusal as a fact on the message, without the host diagnostic', () => { const disposition = disposeStructuredAgentSessionSendResult({ diff --git a/src/shared/structured-agent-session-send-disposition.ts b/src/shared/structured-agent-session-send-disposition.ts index 7ffce942b6e6..11e2b45fc0be 100644 --- a/src/shared/structured-agent-session-send-disposition.ts +++ b/src/shared/structured-agent-session-send-disposition.ts @@ -16,6 +16,11 @@ import { } from './agent-session-refusal-notice' import type { AgentSessionWriteNoticePart } from './agent-session-write-notice-copy' import { agentSessionRefusalFailure } from './agent-session-write-failure' +import type { AgentSessionFailureFact } from './agent-session-failure' +import { + agentSessionFailureSentence, + type AgentSessionFailureWordsContext +} from './agent-session-failure-words' import { classifyDispatchRejection } from './structured-agent-session-dispatch-rejection' import { classifyStructuredAgentSessionSendFailure, @@ -32,8 +37,6 @@ export type StructuredAgentSessionSendDisposition = { /** The entry the queue is stuck on, or null when nothing blocks it. Always the * next value, never "unchanged": the caller assigns it verbatim. */ blockedClientMessageId: string | null - /** A rejected result arrived before the journal snapshot; Retry must rotate this id. */ - retryWithFreshClientMessageId: string | null } type SendDispositionInput = { @@ -129,8 +132,14 @@ export function structuredAgentSessionRejectionNotice( export function structuredAgentSessionRejectionParts( reason: string | null, - write: 'send' | 'composer-send' + write: 'send' | 'composer-send', + /** The host's typed fact, which decides when the row carried one. */ + fact?: AgentSessionFailureFact, + context: AgentSessionFailureWordsContext = {} ): AgentSessionWriteNoticePart[] { + if (fact) { + return rejectionFactParts(write, fact, context) + } if (reason === null) { return ['notDoneSend'] } @@ -143,13 +152,43 @@ export function structuredAgentSessionRejectionParts( return rejection.kind ? agentSessionWriteNotDoneParts(write) : [{ text: reason }] } +function rejectionFactParts( + write: 'send' | 'composer-send', + fact: AgentSessionFailureFact, + context: AgentSessionFailureWordsContext +): AgentSessionWriteNoticePart[] { + const { kind } = classifyDispatchRejection({ reason: null, rejection: fact }) + if (kind === 'writeFailed') { + return ['unreachable', ...agentSessionWriteNotDoneParts(write)] + } + // A fact this build cannot place proves only that the message did not happen. + return kind + ? [{ text: agentSessionFailureSentence({ ...fact, kind }, 'rejection', context) }] + : agentSessionWriteNotDoneParts(write) +} + +/** Kinds whose words need what the message's copy drops: the provider's detail, or the refusal. */ +const WORDED_FROM_WHOLE_FACT: ReadonlySet = new Set< + AgentSessionFailureFact['kind'] +>(['providerRejected', 'startFailed', 'restartFailed']) + /** What the Retry row says about why its message did not go through. */ export function structuredAgentSessionAttemptFailureParts( - failure: StructuredAgentSessionAttemptFailure + failure: StructuredAgentSessionAttemptFailure, + context: AgentSessionFailureWordsContext = {}, + /** The journal's whole fact for a recorded rejection, when its submission is loaded: the + * message's own copy keeps only its kind and attachment. */ + recorded?: AgentSessionFailureFact ): AgentSessionWriteNoticePart[] { - return failure.kind === 'rejected' - ? structuredAgentSessionRejectionParts(failure.reason, 'send') - : agentSessionWriteNoticeParts(failure, 'send') + if (failure.kind !== 'rejected') { + return agentSessionWriteNoticeParts(failure, 'send', context) + } + const fact = recorded ?? failure.rejection + // Without the journal's fact, the host's sentence still holds what the copy dropped. + if (!recorded && fact && WORDED_FROM_WHOLE_FACT.has(fact.kind) && failure.reason !== null) { + return [{ text: failure.reason }] + } + return structuredAgentSessionRejectionParts(failure.reason, 'send', fact, context) } export function disposeStructuredAgentSessionSendResult( @@ -187,8 +226,7 @@ export function disposeStructuredAgentSessionSendResult( blockedClientMessageId: !refused || refused.state === 'rejected' ? input.blockedClientMessageId - : refused.clientMessageId, - retryWithFreshClientMessageId: null + : refused.clientMessageId } } const submission = result.value.submission @@ -196,16 +234,14 @@ export function disposeStructuredAgentSessionSendResult( return { entries: dropEntry(input), error: 'Message delivery is unconfirmed and Orca will not send it again', - blockedClientMessageId: input.blockedClientMessageId, - retryWithFreshClientMessageId: null + blockedClientMessageId: input.blockedClientMessageId } } if (submission.dispatchState === 'accepted') { return { entries: dropEntry(input), error: null, - blockedClientMessageId: input.blockedClientMessageId, - retryWithFreshClientMessageId: null + blockedClientMessageId: input.blockedClientMessageId } } // A Stop's withdrawal failed nothing, first reply or replay: the entry leaves as the reconcile @@ -217,8 +253,7 @@ export function disposeStructuredAgentSessionSendResult( return { entries: dropEntry(input), error: null, - blockedClientMessageId: input.blockedClientMessageId, - retryWithFreshClientMessageId: null + blockedClientMessageId: input.blockedClientMessageId } } if (submission.dispatchState === 'rejected') { @@ -229,8 +264,7 @@ export function disposeStructuredAgentSessionSendResult( structuredAgentSessionRejectedFailure(submission) ), error: null, - blockedClientMessageId: input.blockedClientMessageId, - retryWithFreshClientMessageId: input.entry.clientMessageId + blockedClientMessageId: input.blockedClientMessageId } } if (submission.dispatchState === 'unknown' && submission.recovered) { @@ -241,8 +275,7 @@ export function disposeStructuredAgentSessionSendResult( : candidate ), error: null, - blockedClientMessageId: input.blockedClientMessageId, - retryWithFreshClientMessageId: null + blockedClientMessageId: input.blockedClientMessageId } } // `pending` is the host saying the message was written and is awaiting the @@ -257,8 +290,7 @@ export function disposeStructuredAgentSessionSendResult( submission.dispatchState === 'unknown' ? 'unconfirmed' : 'dispatching' ), error: null, - blockedClientMessageId: input.blockedClientMessageId, - retryWithFreshClientMessageId: null + blockedClientMessageId: input.blockedClientMessageId } } @@ -278,7 +310,6 @@ export function disposeStructuredAgentSessionSendFailure( error: null, blockedClientMessageId: deliveryUnknown ? input.blockedClientMessageId - : input.entry.clientMessageId, - retryWithFreshClientMessageId: null + : input.entry.clientMessageId } } diff --git a/src/shared/structured-agent-session-start-failure-row-key.ts b/src/shared/structured-agent-session-start-failure-row-key.ts new file mode 100644 index 000000000000..6dc4a4817b14 --- /dev/null +++ b/src/shared/structured-agent-session-start-failure-row-key.ts @@ -0,0 +1,17 @@ +// A failed start's one row is keyed by the start, so a reader finds it by identity, not by its words. + +import { parseAgentJournalItemKey } from './agent-session-journal-item-key' +import type { AgentJournalItemIdentity } from './agent-session-journal-types' + +const START_FAILURE_ROW = 'start-failure:' + +export function structuredAgentSessionStartFailureRowIdentity( + startKey: string +): Extract { + return { provider: 'orca', clientMessageId: `${START_FAILURE_ROW}${startKey}` } +} + +export function isStructuredAgentSessionStartFailureRow(itemId: string): boolean { + const identity = parseAgentJournalItemKey(itemId) + return identity?.provider === 'orca' && identity.clientMessageId.startsWith(START_FAILURE_ROW) +} From d5451d9ec03104511bc800c617174b49302c3746 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:39:23 -0700 Subject: [PATCH 14/90] test(cross-version): a released client's capabilities come from its own release (#23533) --- src/shared/protocol-version.ts | 3 ++- .../cross-version-agent-session-wire.unit.test.ts | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/shared/protocol-version.ts b/src/shared/protocol-version.ts index 5dcc8c3b52b9..bd8b3f62a31f 100644 --- a/src/shared/protocol-version.ts +++ b/src/shared/protocol-version.ts @@ -167,7 +167,8 @@ export const AGENT_SESSION_PENDING_SEND_RESULT_RUNTIME_CAPABILITY = 'agent-session.pending-send-result.v1' as const // Why: a send is now answered once the host accepts it, before any agent has it. A client without // this cannot show a message rejected after that answer, so the host holds its reply until the -// message is handed over or rejected. +// message is handed over or rejected. Transitional: drop the hold once no supported desktop or +// mobile client lacks the capability; mobile must first show a rejected message in place. export const AGENT_SESSION_ACCEPTED_SEND_RUNTIME_CAPABILITY = 'agent-session.accepted-send.v1' as const // Why: paired clients advertise Claude-structured support so the host can gate its agent-specific diff --git a/tests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.ts index ec7b2b9ec548..c52cbfcca034 100644 --- a/tests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.ts @@ -795,11 +795,10 @@ describe('cross-version structured agent sessions', () => { // a rejection that arrives after it. So it is answered once the message is handed over, while // a client that advertises accepted sends is answered at acceptance, start or no start (W9). it('holds the send reply of a released client until the handover, and answers a current one at once', async () => { - const released = [ - STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY, - AGENT_SESSION_PENDING_SEND_RESULT_RUNTIME_CAPABILITY - ] - expect(baseline.capabilities).not.toContain(AGENT_SESSION_ACCEPTED_SEND_RUNTIME_CAPABILITY) + // Why: the baseline is the newest release, which will itself carry accepted sends. + const released = baseline.capabilities.filter( + (capability) => capability !== AGENT_SESSION_ACCEPTED_SEND_RUNTIME_CAPABILITY + ) const created = await answer('agentSession.create', createIntentParams()) await bootHost('b') let open = (): void => undefined From 6c4625d7ff178badefa38527c3d6e69ea5c8e88e Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:40:26 -0700 Subject: [PATCH 15/90] fix(terminal): main records every tab close, and seeding reads the records (#22955) * fix(terminal): every explicit terminal close commits through one main transaction A renderer save cannot shrink terminal membership once main owns a repo's topology, so desktop tab and pane closes, CLI split-pane closes and mobile split-pane closes only became durable when the killed process's exit retired the surface. A close whose kill failed or threw, or whose exit was never certified, came back after a reload. Every close now reaches closeTerminalSurface: the renderer sends an explicit intent for user and cleanup closes, the CLI and mobile split-pane closes commit the pane after their stop, and the headless and relayed mobile closes reuse the same commit. A failed flush keeps the in-memory removal and no longer cancels the kill. Exit retirement is unchanged. * fix(terminal): tell the desktop renderer to drop a split pane main closed A CLI or mobile close of one pane in a split commits the pane in main, but the desktop kept showing it until reload when no exit arrived to remove it. The close now sends a leaf-addressed notice: a mounted pane closes by leaf id, and a parked tab collapses its stored layout. Addressing by leaf makes the notice and the renderer's exit handling no-ops after each other, which replaces the numeric pane-id notice that could close the whole tab when the exit won. * fix(terminal): a pane close never widens into a whole-tab close A leaf-addressed close fell through to the whole-tab close whenever main's layout no longer held that leaf as one of several. Main's exit handling retires an exited split pane from the saved layout, so closing that pane afterwards (the exited-pane overlay's Close, or a CLI close whose stop delivers the exit first) removed the whole tab, live sibling included, and the next renderer save could not restore it. A pane close is now a no-op unless its leaf is in a multi-pane layout. Also updates two mobile split-close assertions to expect the leaf-addressed notice, and adds a test that a relayed mobile close of a renderer-listed tab still reaches the renderer's pin guard. * test(terminal): cover the PTY-handle branch of a CLI split-pane close The existing CLI split test resolves its handle through the renderer graph, so the branch that closes a runtime-owned pane by its PTY handle had no test failing without its commit. * fix(terminal): main records every terminal tab close, and seeding reads the records * test(terminal): pin the renderer close mirror against an early SSH pull, and main's record writes against later saves * fix(terminal): a CLI pane close with an unconfirmed stop closes only that pane `orca terminal close ` on one pane of a split used to close the whole tab, live sibling included, whenever that pane's stop could not be confirmed (for example an unreachable SSH host). An unconfirmed stop is unverifiable, not a reason to drop siblings: the close now commits only that leaf, tells the renderer to drop that leaf, and leaves the owed kill to the controller's existing SSH pending-kill path. On a host where no renderer lists the tab, main now also removes the closed pane from the paired-client snapshot (with its retirement proof), since no exit may arrive to do it. * docs(terminal): correct the pull merge's record-safety comment The mirror is written by closeTab before main commits, so the claim that only a main-committed close writes a record was inaccurate; also reflow a split comment. * refactor(terminal): one resolver decides whether a pane close becomes a tab close Every explicit close now states its target as `{kind:'tab'}` or `{kind:'pane', leafId}`; no optional leaf id silently means the whole tab. Main resolves a close it started in exactly one place, reading the copy of the tab's panes its layout owner holds (the renderer-published layout for tabs the desktop renderer lists, main's session layout otherwise). Only `last-pane` escalates, through the existing tab path so the renderer's pin guard still runs; an unknown pane never widens. - The CLI and phone paths drop their per-site sibling counts for the resolver. - The notifier splits into a tab-only close and a leaf-addressed pane close. - The headless tab closer takes a parent tab id, so a pane row cannot reach it. - A phone close of one pane on a host with no desktop window now stops and closes only that pane. - A phone close of one pane with no live process record closes that pane, not its tab. * fix(cli): an unverifiable stop says the close happened `orca terminal close` still exits 1 when the process stop cannot be verified, but its message now says the terminal was closed and names the host's reason, instead of "close failed". It promises that the kill retries on reconnect only when the SSH relay itself never answered the stop, the one case a recorded kill order backs. * fix(terminal): a phone pane close commits even when its kill fails A paired client's close of one pane threw `terminal_close_failed` before committing anything when the controller reported the kill failed, so the pane stayed. The kill is now best-effort, as it is for a whole-tab close: the pane's removal always commits and the failure stays on the PTY's liveness verdict. * fix(terminal): a pane close widens only when a copy shows it is the last pane The close resolver read an owner copy that records no panes as "the tab has one pane", so a CLI close of one pane of a split, addressed while the renderer listed the tab before publishing its panes, closed the whole tab. Every copy now counts only if it records at least one pane, read in the owner's order with the published rows as the last fallback, and a pane close widens only when a copy lists that pane as the tab's only one. An unsplit tab whose saved layout predates its pane still closes: its published row names the pane. * fix(cli): promise a kill retry only when the host recorded the kill The close receipt inferred "the kill retries when the host reconnects" from the stop reason's text, which a new transport message or a reworded error would silently break. An explicit close now records the replayable kill order when its stop goes unconfirmed, before sending the follow-up kill (whose own failure is recorded only once its RPC settles), and reports that on the receipt as an optional `pendingKillRecorded`. The CLI promises the retry only from that field, so an older host, which never sends it, gets no promise. * test(pty): justify the controller cast the recorded-stop tests extend * fix(terminal): parse the close target with typed narrowing The low-evidence lint gate rejects Reflect.get and broad object parameters, which failed static analysis. Narrow with 'in' checks instead and cover the boundary parser's accept and reject cases. * test(terminal): drive the close-record tests through the durable store * fix(terminal): a desktop tab close is not refused by a split that bound while it waited The renderer has already removed and killed a tab it closes, so its close intent now skips the owner fence phone and CLI closes use. Before, a split pane whose binding was admitted between the close request and its durable write made main refuse the close, and the tab came back on the next launch whenever its processes did not exit. * chore(terminal): note that closedByLayoutOwner goes away once main owns the terminal layout * chore: take the base branch's lockfile, which a merge had reverted * test(terminal): reload the close-intent fixture through the SQLite profile store Main now requires a SQLite profile-state authority for a writable Store, so the save-and-reload close tests build and reopen their store through the shared SQLite test harness. * docs(terminal): state the close-record rule in the merge's active-workspace comment * fix(terminal): the first close of a tab keeps its record, and every lookup honours the TTL * test(terminal): give the relay reattach close record a recent close time * fix(terminal): a close that removes a listed tab records itself; only an echo is skipped The echo of a close main already made never finds the tab listed, and the close transaction already skips it when a live record exists. The record helper kept the first record as well, which only ever applied to a close that did remove a listed tab, and there it kept a stale reason and TTL. --- src/main/ipc/pty-ssh-undelivered-kill.test.ts | 42 ++- .../ipc/pty/runtime/undelivered-ssh-kill.ts | 17 +- src/main/ipc/session.ts | 9 +- .../persistence-ssh-pending-pty-kill.test.ts | 13 + .../leasing-ssh-ptys/ssh-normalization.ts | 2 +- .../ssh-pty-kill-intent-operations.ts | 2 +- .../loading-store/pty-binding-persistence.ts | 5 +- .../loading-store/pty-binding-refusals.ts | 24 +- .../terminal-close-async-durability.test.ts | 41 ++- ...ntime-authored-workspace-session-fields.ts | 16 +- ...ld-headless-mobile-session-browser-tabs.ts | 11 +- ...time-close-headless-mobile-terminal-tab.ts | 5 +- .../orca-runtime-close-mobile-session-tab.ts | 1 + ...runtime-terminal-close-no-widening.test.ts | 11 +- ...rca-runtime-terminal-close-records.test.ts | 309 ++++++++++++++++++ ...rca-runtime-terminal-surface-close.test.ts | 27 +- ...output-and-worker-recovery-part-07.spec.ts | 52 +++ .../runtime-terminal-orphan-adoption.ts | 7 +- src/main/runtime/terminal-surface-close.ts | 62 +++- .../ssh/ssh-pending-pty-kill-replay.test.ts | 22 ++ ...elay-session-reconnect-incarnation.test.ts | 32 +- src/main/ssh/ssh-relay-session.ts | 17 +- src/preload/api/workspace-session-api.ts | 1 + ...nitial-terminal-structured-launch.test.tsx | 22 +- .../terminal/initial-terminal-wiring.test.ts | 4 +- .../components/terminal/initial-terminal.ts | 3 +- .../use-terminal-watcher-effects.ts | 9 +- ...ace-session-merge-close-tombstones.test.ts | 51 ++- ...on-merge-closed-terminal-tombstone.test.ts | 15 +- .../hooks/remote-workspace-session-merge.ts | 65 ++-- ...pshot-apply-deferred-session-write.test.ts | 5 +- .../hooks/remote-workspace-snapshot-apply.ts | 2 +- ...-write-subscriber-deferred-persist.test.ts | 16 +- .../workspace-session-browser-history.test.ts | 3 +- ...pace-session-closed-tab-tombstones.test.ts | 38 --- ...workspace-session-closed-tab-tombstones.ts | 10 - .../workspace-session-editor-drafts.test.ts | 1 - .../lib/workspace-session-liveness.test.ts | 1 - .../src/lib/workspace-session-patch.ts | 6 - .../workspace-session-relevant-fields.test.ts | 1 - ...e-session-ssh-partition-round-trip.test.ts | 6 +- src/renderer/src/lib/workspace-session.ts | 6 - .../worktree-activation-default-tabs.test.ts | 7 +- ...ctivation-emptied-workspace-reseed.test.ts | 7 +- .../lib/worktree-activation-store-contract.ts | 2 + ...ree-initial-terminal-close-records.test.ts | 70 ++++ .../lib/worktree-initial-terminal-seeding.ts | 3 +- ...e-identity-rename-row-worktree-ids.test.ts | 4 +- .../terminal-surface-close-intent.ts | 5 +- .../terminal-tab-close-intent.test.ts | 3 +- .../terminal-tab-close-tombstone.test.ts | 82 ++++- .../src/store/terminals/terminal-tab-close.ts | 37 +-- .../workspace-terminal-hydration-patch.ts | 2 +- .../terminals/workspace-terminal-hydration.ts | 9 +- .../closed-terminal-tab-tombstones.test.ts | 105 +++--- src/shared/closed-terminal-tab-tombstones.ts | 120 ++++--- src/shared/ssh-pending-pty-kill.test.ts | 21 ++ src/shared/ssh-pending-pty-kill.ts | 41 ++- ...pace-session-schema-field-coverage.test.ts | 7 +- 59 files changed, 1084 insertions(+), 433 deletions(-) create mode 100644 src/main/runtime/orca-runtime-terminal-close-records.test.ts delete mode 100644 src/renderer/src/lib/workspace-session-closed-tab-tombstones.test.ts delete mode 100644 src/renderer/src/lib/workspace-session-closed-tab-tombstones.ts create mode 100644 src/renderer/src/lib/worktree-initial-terminal-close-records.test.ts diff --git a/src/main/ipc/pty-ssh-undelivered-kill.test.ts b/src/main/ipc/pty-ssh-undelivered-kill.test.ts index 32f4da8356f3..2d92ffa18598 100644 --- a/src/main/ipc/pty-ssh-undelivered-kill.test.ts +++ b/src/main/ipc/pty-ssh-undelivered-kill.test.ts @@ -356,8 +356,8 @@ describe('undelivered SSH stops', () => { } }) - // No incarnation means no fence, and an unfenced order can only be discarded or guessed at. - it('records nothing when the PTY incarnation was never learned', async () => { + // A legacy id with no incarnation has no fence, and an unfenced order can only be guessed at. + it('records nothing for a legacy id whose PTY incarnation was never learned', async () => { const store = createKillStore() registerSshPtyProvider( 'ssh-1', @@ -378,6 +378,44 @@ describe('undelivered SSH stops', () => { } }) + // A `pty2:` id is epoch-scoped, so it names one process even when the incarnation was never + // learned: an offline close across a relaunch still owes the kill. + it('records the stop for an epoch-scoped id whose incarnation was never learned', () => { + const store = createKillStore() + const ptyId = 'ssh:ssh-1@@pty2:epoch-a:4' + setPtyOwnership(ptyId, 'ssh-1') + const { kill } = install(store) + + try { + expect(kill(ptyId)).toBe(false) + expect(store.recordSshRemotePtyKillIntent).toHaveBeenCalledWith('ssh-1', 'pty2:epoch-a:4', { + requestedAt: expect.any(Number), + attempts: 0 + }) + } finally { + deletePtyOwnership(ptyId) + } + }) + + // One recorder: the explicit-close receipt promises the retry for an epoch-scoped id too. + it("records an explicit close's unconfirmed stop for an epoch-scoped id with no incarnation", () => { + const store = createKillStore() + const ptyId = 'ssh:ssh-1@@pty2:epoch-b:5' + setPtyOwnership(ptyId, 'ssh-1') + const { recordUnconfirmedStop } = install(store) + + try { + expect(recordUnconfirmedStop(ptyId)).toBe(true) + expect(store.recordSshRemotePtyKillIntent).toHaveBeenCalledTimes(1) + expect(store.recordSshRemotePtyKillIntent).toHaveBeenCalledWith('ssh-1', 'pty2:epoch-b:5', { + requestedAt: expect.any(Number), + attempts: 0 + }) + } finally { + deletePtyOwnership(ptyId) + } + }) + // An explicit close records its order when the stop goes unconfirmed, before the follow-up kill, // so its receipt can promise the reconnect retry from the record itself. it("records an explicit close's unconfirmed stop and says so", () => { diff --git a/src/main/ipc/pty/runtime/undelivered-ssh-kill.ts b/src/main/ipc/pty/runtime/undelivered-ssh-kill.ts index 00d23478eaac..45b80ea1f9e1 100644 --- a/src/main/ipc/pty/runtime/undelivered-ssh-kill.ts +++ b/src/main/ipc/pty/runtime/undelivered-ssh-kill.ts @@ -2,6 +2,7 @@ import type { Store } from '../../../persistence' import { parseAppSshPtyId } from '../../../providers/ssh-pty-id' import { ptyIncarnationById, ptyOwnership } from '../provider/ownership-state' import { getRelayPtyId } from '../provider/registry' +import { isEpochScopedRelayPtyId } from '../../../../shared/ssh-pending-pty-kill' export type UndeliveredSshPtyKill = { store: Store | undefined @@ -26,9 +27,9 @@ export type UndeliveredSshPtyKill = { * - **reversible**: see above. * - **no `connectionId`**: a local PTY's owner is this process, so a failed kill has no later host * to ask; there is nothing to replay against. - * - **no incarnation**: the replay fence is the host-minted PTY incarnation, and a relay renumbers - * from `pty-1` on every start. An order we could never safely aim can only be discarded later, - * or worse, guessed at. + * - **no incarnation on a legacy id**: a legacy relay renumbers from `pty-1` on every start, so + * without the host-minted incarnation the order could never be safely aimed. A `pty2:` id is + * epoch-scoped and names one process, so it is recorded without one. * - **an id naming another connection**: `getRelayPtyId` throws on those, and this runs inside * promise `.catch` handlers where that would surface as an unhandled rejection. */ export function recordUndeliveredSshPtyKill(args: UndeliveredSshPtyKill): boolean { @@ -36,19 +37,19 @@ export function recordUndeliveredSshPtyKill(args: UndeliveredSshPtyKill): boolea if (!store || !connectionId || args.reversible) { return false } - const incarnationId = args.incarnationId ?? ptyIncarnationById.get(ptyId) - if (!incarnationId) { - return false - } let relayPtyId: string try { relayPtyId = getRelayPtyId(connectionId, ptyId) } catch { return false } + const incarnationId = args.incarnationId ?? ptyIncarnationById.get(ptyId) + if (!incarnationId && !isEpochScopedRelayPtyId(relayPtyId)) { + return false + } store.recordSshRemotePtyKillIntent(connectionId, relayPtyId, { requestedAt: args.now ?? Date.now(), - incarnationId, + ...(incarnationId ? { incarnationId } : {}), attempts: 0 }) return true diff --git a/src/main/ipc/session.ts b/src/main/ipc/session.ts index cfc60e7ade60..f1f0c1b14e15 100644 --- a/src/main/ipc/session.ts +++ b/src/main/ipc/session.ts @@ -33,12 +33,17 @@ export function registerSessionHandlers(store: Store, runtime: OrcaRuntimeServic // Why: a renderer save cannot shrink membership main owns, so each close commits it explicitly. ipcMain.handle( 'session:close-terminal-surface', - (_event, args: { worktreeId?: unknown; target?: unknown } | undefined) => { + (_event, args: { worktreeId?: unknown; target?: unknown; reason?: unknown } | undefined) => { const target = parseTerminalSurfaceCloseTarget(args?.target) if (typeof args?.worktreeId !== 'string' || !target) { throw new Error('invalid_terminal_surface') } - return runtime.closeTerminalSurfaceFromRenderer(args.worktreeId, target) + // Why only these two: main alone closes a tab for its process exit. + return runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: args.worktreeId, + target, + reason: args.reason === 'cleanup' ? 'cleanup' : 'user' + }) } ) diff --git a/src/main/persistence-ssh-pending-pty-kill.test.ts b/src/main/persistence-ssh-pending-pty-kill.test.ts index 1d9c665c56f6..19298b3288fd 100644 --- a/src/main/persistence-ssh-pending-pty-kill.test.ts +++ b/src/main/persistence-ssh-pending-pty-kill.test.ts @@ -50,6 +50,19 @@ describe('Store SSH pending PTY kills', () => { ]) }) + it('keeps an epoch-scoped intent with no incarnation across a restart, and drops a legacy one', async () => { + const store = await createStore() + for (const ptyId of ['pty2:epoch-a:1', 'pty-2']) { + store.recordSshRemotePtyKillIntent('ssh-1', ptyId, { requestedAt: NOW, attempts: 0 }) + } + store.flush() + + const reloaded = await createStore() + expect(reloaded.getSshRemotePtyKillIntents('ssh-1', NOW)).toEqual([ + { ptyId: 'pty2:epoch-a:1', intent: { requestedAt: NOW, attempts: 0 } } + ]) + }) + // A kill issued while the provider was already unregistered writes no lease of its own, and that // offline close is the case most likely to strand a remote shell. it('records an intent for a PTY that has no lease row yet', async () => { diff --git a/src/main/persistence/leasing-ssh-ptys/ssh-normalization.ts b/src/main/persistence/leasing-ssh-ptys/ssh-normalization.ts index 58b0cd0473a1..a23bd421dd59 100644 --- a/src/main/persistence/leasing-ssh-ptys/ssh-normalization.ts +++ b/src/main/persistence/leasing-ssh-ptys/ssh-normalization.ts @@ -61,7 +61,7 @@ export function normalizeSshRemotePtyLease(value: unknown): SshRemotePtyLease | return null } const now = Date.now() - const pendingKill = normalizeSshPendingPtyKill(raw.pendingKill) + const pendingKill = normalizeSshPendingPtyKill(raw.pendingKill, raw.ptyId) return { targetId: raw.targetId, ptyId: raw.ptyId, diff --git a/src/main/persistence/leasing-ssh-ptys/ssh-pty-kill-intent-operations.ts b/src/main/persistence/leasing-ssh-ptys/ssh-pty-kill-intent-operations.ts index 52d1c51e9f2b..a499ba10253b 100644 --- a/src/main/persistence/leasing-ssh-ptys/ssh-pty-kill-intent-operations.ts +++ b/src/main/persistence/leasing-ssh-ptys/ssh-pty-kill-intent-operations.ts @@ -126,7 +126,7 @@ export function recordSshRemotePtyKillIntent( const prior = existing.pendingKill // Same incarnation means a repeated close; a recycled relay id starts a new intent lifetime. existing.pendingKill = - prior?.incarnationId === intent.incarnationId + prior && prior.incarnationId === intent.incarnationId ? { ...intent, requestedAt: Math.min(prior.requestedAt, now), diff --git a/src/main/persistence/loading-store/pty-binding-persistence.ts b/src/main/persistence/loading-store/pty-binding-persistence.ts index f902ff7d2526..c90544f75026 100644 --- a/src/main/persistence/loading-store/pty-binding-persistence.ts +++ b/src/main/persistence/loading-store/pty-binding-persistence.ts @@ -92,7 +92,10 @@ export class PtyBindingPersistenceOperations { const paneKey = `${args.tabId}:${args.leafId}` const bindingWorktreeId = args.expectedSourceBinding?.worktreeId ?? args.worktreeId const session = sessions.getWorkspaceSession(resolvedHostId) - if (ptyBindingIsRefused(args, session, bindingWorktreeId, paneKey)) { + const partitions = sessions + .getWorkspaceSessionHostIds() + .map((hostId) => sessions.getWorkspaceSession(hostId)) + if (ptyBindingIsRefused(args, session, bindingWorktreeId, paneKey, partitions)) { outcome = 'refused' return { value: false, persist: false } } diff --git a/src/main/persistence/loading-store/pty-binding-refusals.ts b/src/main/persistence/loading-store/pty-binding-refusals.ts index 3c61056bfca1..636e69bd936e 100644 --- a/src/main/persistence/loading-store/pty-binding-refusals.ts +++ b/src/main/persistence/loading-store/pty-binding-refusals.ts @@ -1,3 +1,4 @@ +import { hasClosedTerminalTabRecord } from '../../../shared/closed-terminal-tab-tombstones' import { isTerminalLeafId } from '../../../shared/stable-pane-id' import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types' import { layoutContainsLeafId } from '../restoring-sessions/terminal-layout-normalization' @@ -13,7 +14,7 @@ export type PtyBindingRefusalRequest = { } /** - * The four fences a binding must clear before anything is mutated, so a refusal leaves nothing + * The five fences a binding must clear before anything is mutated, so a refusal leaves nothing * half-written. Order matters: every `false` here is returned before the write path or the * fast lane can run, which is what the relay's lease expiry and the stable-owner throw rely on. */ @@ -21,7 +22,10 @@ export function ptyBindingIsRefused( args: PtyBindingRefusalRequest, session: WorkspaceSessionState, bindingWorktreeId: string, - paneKey: string + paneKey: string, + /** Every host partition: a close is recorded where the tab lived, which need not be where this + * binding lands (a relay reattach binds into `local`). */ + partitions: readonly WorkspaceSessionState[] = [session] ): boolean { if (args.expectedSourceBinding) { const expected = args.expectedSourceBinding @@ -56,6 +60,19 @@ export function ptyBindingIsRefused( return true } } + const existingTab = session.tabsByWorktree?.[bindingWorktreeId]?.find( + (candidate) => candidate.id === args.tabId + ) + // Why: a closed tab's spawn can commit after the close, even after a crash and relaunch; tab + // ids are uuids, so a recorded id is never a new tab. + if ( + !existingTab && + partitions.some((partition) => + hasClosedTerminalTabRecord(partition.closedTerminalTabTombstonesByTabId, args.tabId) + ) + ) { + return true + } // Mirrors the four creating branches of the write path — mint a tab, mint a root leaf, split // the root and graft a leaf, mint a layout — each of which sets `terminalMembershipChanged`. if ( @@ -65,9 +82,6 @@ export function ptyBindingIsRefused( return true } if (args.mayCreate === false) { - const existingTab = session.tabsByWorktree?.[bindingWorktreeId]?.find( - (candidate) => candidate.id === args.tabId - ) const existingLayout = session.terminalLayoutsByTabId?.[args.tabId] const wouldCreateTopology = !existingTab || diff --git a/src/main/persistence/loading-store/terminal-close-async-durability.test.ts b/src/main/persistence/loading-store/terminal-close-async-durability.test.ts index 4e74eea38ae5..090d2340932a 100644 --- a/src/main/persistence/loading-store/terminal-close-async-durability.test.ts +++ b/src/main/persistence/loading-store/terminal-close-async-durability.test.ts @@ -98,9 +98,11 @@ it.each([ const before = persistedLeafIds() const gate = authority.pause() let acknowledged = false - const closing = runtime.closeTerminalSurfaceFromRenderer(binding.worktreeId, target).then(() => { - acknowledged = true - }) + const closing = runtime + .closeTerminalSurfaceFromRenderer({ worktreeId: binding.worktreeId, target: target }) + .then(() => { + acknowledged = true + }) try { await Promise.race([gate.started.promise, closing]) expect(acknowledged).toBe(false) @@ -140,9 +142,12 @@ it('keeps a renderer close when its durable write fails', async () => { const { authority, runtime, persistedLeafIds, liveLeafIds } = await closeFixture() vi.spyOn(console, 'error').mockImplementation(() => {}) const gate = authority.pause() - const closing = runtime.closeTerminalSurfaceFromRenderer(binding.worktreeId, { - kind: 'tab', - tabId: binding.tabId + const closing = runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: binding.worktreeId, + target: { + kind: 'tab', + tabId: binding.tabId + } }) await Promise.race([gate.started.promise, closing]) gate.finish.reject(new Error('close disk refused')) @@ -165,10 +170,13 @@ it('commits nothing for a pane that restarted while its close waited for the wri ptyId: 'restarted-pty', incarnationId: 'ffffffff-ffff-4fff-8fff-ffffffffffff' }) - const closing = runtime.closeTerminalSurfaceFromRenderer(binding.worktreeId, { - kind: 'pane', - tabId: binding.tabId, - leafId: binding.leafId + const closing = runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: binding.worktreeId, + target: { + kind: 'pane', + tabId: binding.tabId, + leafId: binding.leafId + } }) gate.finish.resolve() await earlierWrite @@ -193,9 +201,12 @@ it('commits a renderer tab close whose split pane bound while the close waited f incarnationId: 'eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee', expectedSourceBinding: binding }) - const closing = runtime.closeTerminalSurfaceFromRenderer(binding.worktreeId, { - kind: 'tab', - tabId: binding.tabId + const closing = runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: binding.worktreeId, + target: { + kind: 'tab', + tabId: binding.tabId + } }) gate.finish.resolve() await earlierWrite @@ -209,4 +220,8 @@ it('commits a renderer tab close whose split pane bound while the close waited f .getWorkspaceSession() .tabsByWorktree[binding.worktreeId]?.some((tab) => tab.id === binding.tabId) ).toBe(false) + // Why: skipping the owner fence for the layout owner's own close must not skip its record. + expect(store.getWorkspaceSession().closedTerminalTabTombstonesByTabId?.[binding.tabId]).toEqual( + expect.objectContaining({ worktreeId: binding.worktreeId, reason: 'user' }) + ) }) diff --git a/src/main/persistence/runtime-authored-workspace-session-fields.ts b/src/main/persistence/runtime-authored-workspace-session-fields.ts index e87b47cd5355..80a9d30b532d 100644 --- a/src/main/persistence/runtime-authored-workspace-session-fields.ts +++ b/src/main/persistence/runtime-authored-workspace-session-fields.ts @@ -4,9 +4,9 @@ import type { WorkspaceSessionState } from '../../shared/workspace-session-state * Keeps session fields the renderer persist snapshot does not author across a full write. * * A session write replaces the stored object. Zustand-built payloads omit runtime-owned - * client-hosted pages, and they omit-when-empty the write-once default-terminal-tab marker. - * Without this, those slices vanish on the next desktop write and only show up missing after - * restart. + * client-hosted pages and terminal close records, and they omit-when-empty the write-once + * default-terminal-tab marker. Without this, those slices vanish on the next desktop write and + * only show up missing after restart. * * Callers do not opt in: the Store applies this inside setLocalWorkspaceSession and * setHostWorkspaceSession, so the before-unload stage path inherits it too. @@ -44,6 +44,16 @@ export function preserveRuntimeAuthoredWorkspaceSessionFields( clientHostedBrowserPagesByWorktree: prior.clientHostedBrowserPagesByWorktree } } + // Why: close records are main's alone (its close transaction); a renderer save never carries them. + if ( + next.closedTerminalTabTombstonesByTabId === undefined && + prior?.closedTerminalTabTombstonesByTabId !== undefined + ) { + result = { + ...result, + closedTerminalTabTombstonesByTabId: prior.closedTerminalTabTombstonesByTabId + } + } // Why union: persist snapshots omit this write-once map (empty Zustand slice, omit-when-empty // payload). Treating omission as "never applied" re-spawns default terminals on every attach. return unionWriteOnceDefaultTerminalTabsApplied(result, prior) diff --git a/src/main/runtime/orca-runtime-build-headless-mobile-session-browser-tabs.ts b/src/main/runtime/orca-runtime-build-headless-mobile-session-browser-tabs.ts index e2e1e2337fcc..73d0e44499fd 100644 --- a/src/main/runtime/orca-runtime-build-headless-mobile-session-browser-tabs.ts +++ b/src/main/runtime/orca-runtime-build-headless-mobile-session-browser-tabs.ts @@ -12,7 +12,9 @@ import type { Tab } from '../../shared/tab-types' import { resolveTerminalCloseTarget, terminalSurfaceCloseMutation, - type PaneCloseResolution + type PaneCloseResolution, + type RendererTerminalClose, + type TerminalSurfaceCloseOptions } from './terminal-surface-close' import type { TerminalPaneCloseTarget, @@ -113,8 +115,7 @@ export class OrcaRuntimeWithBuildHeadlessMobileSessionBrowserTabs extends OrcaRu protected async closeTerminalSurface( worktreeId: string, target: TerminalSurfaceCloseTarget, - // closedByLayoutOwner goes away with D1, once main owns the terminal layout. - options: { allowMissing?: boolean; force?: boolean; closedByLayoutOwner?: boolean } = {} + options: TerminalSurfaceCloseOptions = {} ): Promise { const store = this.store if (!store?.getWorkspaceSession || !store.setWorkspaceSession || !store.runDurableMutation) { @@ -153,8 +154,8 @@ export class OrcaRuntimeWithBuildHeadlessMobileSessionBrowserTabs extends OrcaRu } /** The desktop renderer's close intent: it already guarded, removed and killed; this only reports. */ - async closeTerminalSurfaceFromRenderer(worktreeId: string, target: TerminalSurfaceCloseTarget) { - const options = { allowMissing: true, force: true, closedByLayoutOwner: true } + async closeTerminalSurfaceFromRenderer({ worktreeId, target, reason }: RendererTerminalClose) { + const options = { allowMissing: true, force: true, closedByLayoutOwner: true, reason } await this.closeTerminalSurface(worktreeId, target, options) } diff --git a/src/main/runtime/orca-runtime-close-headless-mobile-terminal-tab.ts b/src/main/runtime/orca-runtime-close-headless-mobile-terminal-tab.ts index 7239f66d3165..5ef34314e42e 100644 --- a/src/main/runtime/orca-runtime-close-headless-mobile-terminal-tab.ts +++ b/src/main/runtime/orca-runtime-close-headless-mobile-terminal-tab.ts @@ -11,6 +11,7 @@ import { buildHeadlessMobileSessionTabGroups } from './mobile-session-layout-pro import { appendRetiredTerminalSurfaceProofs } from './mobile-session-terminal-retirement-proof' import type { RuntimePtyWorktreeRecord } from './runtime-terminal-state-records' import type { TerminalPaneLayoutNode } from '../../shared/terminal-tab-types' +import type { RuntimeSessionTabCloseReason } from '../../shared/runtime-session-contracts' export class OrcaRuntimeWithCloseHeadlessMobileTerminalTab extends OrcaRuntimeWithCloseStructuredAgentSessionTab { protected async closeHeadlessMobileTerminalTab( @@ -22,6 +23,7 @@ export class OrcaRuntimeWithCloseHeadlessMobileTerminalTab extends OrcaRuntimeWi killPtys?: boolean authorizedPty?: RuntimePtyWorktreeRecord force?: boolean + reason?: RuntimeSessionTabCloseReason } = {} ): Promise { const closedParentTabId = tab.parentTabId @@ -42,7 +44,8 @@ export class OrcaRuntimeWithCloseHeadlessMobileTerminalTab extends OrcaRuntimeWi { kind: 'tab', tabId: closedParentTabId }, { allowMissing: options.allowMissingPersistedTab, - force: options.force + force: options.force, + reason: options.reason } ) if (!acknowledgeRetirement().matches) { diff --git a/src/main/runtime/orca-runtime-close-mobile-session-tab.ts b/src/main/runtime/orca-runtime-close-mobile-session-tab.ts index 7f161f81dc5d..3f7047c64876 100644 --- a/src/main/runtime/orca-runtime-close-mobile-session-tab.ts +++ b/src/main/runtime/orca-runtime-close-mobile-session-tab.ts @@ -172,6 +172,7 @@ export class OrcaRuntimeWithCloseMobileSessionTab extends OrcaRuntimeWithRefuseU await this.closeHeadlessMobileTerminalTab(worktreeId, snapshot, tab, { allowMissingPersistedTab: Boolean(ptyCloseAuthority), force: options.force, + reason: options.reason, killPtys: options.localPtyTeardownOwnedExternally !== true && (options.reason === undefined || options.reason === 'user'), diff --git a/src/main/runtime/orca-runtime-terminal-close-no-widening.test.ts b/src/main/runtime/orca-runtime-terminal-close-no-widening.test.ts index 2def6219d294..1b98c67b8be1 100644 --- a/src/main/runtime/orca-runtime-terminal-close-no-widening.test.ts +++ b/src/main/runtime/orca-runtime-terminal-close-no-widening.test.ts @@ -175,10 +175,13 @@ function arrange(entry: Entry, condition: Condition): CloseContinuityHarness { async function closePane(entry: Entry, harness: CloseContinuityHarness): Promise { if (entry === 'renderer') { - await harness.runtime.closeTerminalSurfaceFromRenderer(WORKTREE_ID, { - kind: 'pane', - tabId: TAB_ID, - leafId: LEAF_ID + await harness.runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { + kind: 'pane', + tabId: TAB_ID, + leafId: LEAF_ID + } }) return } diff --git a/src/main/runtime/orca-runtime-terminal-close-records.test.ts b/src/main/runtime/orca-runtime-terminal-close-records.test.ts new file mode 100644 index 000000000000..f05ac78957ac --- /dev/null +++ b/src/main/runtime/orca-runtime-terminal-close-records.test.ts @@ -0,0 +1,309 @@ +import { mkdtempSync, rmSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' +import { getDefaultWorkspaceSession } from '../../shared/constants' +import { + CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS, + MAX_CLOSED_TERMINAL_TAB_TOMBSTONES +} from '../../shared/closed-terminal-tab-tombstones' +import type { WorkspaceSessionState } from '../../shared/workspace-session-state-types' +import { Store } from '../persistence/loading-store/store' +import { closeTestStores, createSqliteTestStore } from '../persistence-test-harness' +import { OrcaRuntimeService } from './orca-runtime' +import { + LEAF_ID, + REPO_ID, + TAB_ID, + WORKTREE_ID, + WORKTREE_PATH, + makeSession +} from './__fixtures__/orca-runtime-terminal-close-continuity-fixtures' +import { advanceTerminalTopologyRevision } from './workspace-session-terminal-membership-authority' + +const SSH_REPO_ID = 'ssh-repo' +const SSH_HOST_ID = 'ssh:target-1' +const SSH_WORKTREE_ID = `${SSH_REPO_ID}::/srv/app` +const LATE_TAB_ID = '6f0a5c8e-2b1d-4c3e-9f7a-1d2e3f4a5b6c' + +const directories: string[] = [] +afterEach(async () => { + await closeTestStores() + for (const directory of directories.splice(0)) { + rmSync(directory, { recursive: true, force: true }) + } +}) + +function createPersistedRuntime(session: WorkspaceSessionState = makeSession()) { + const directory = mkdtempSync(join(tmpdir(), 'orca-close-records-')) + directories.push(directory) + const dataFile = join(directory, 'orca-data.json') + const store = createSqliteTestStore(Store, { dataFile }) + store.addRepo({ + id: REPO_ID, + path: WORKTREE_PATH, + displayName: 'Fixture', + badgeColor: 'gray', + addedAt: 1 + }) + store.addRepo({ + id: SSH_REPO_ID, + path: '/srv/app', + displayName: 'Remote', + badgeColor: 'gray', + addedAt: 1, + connectionId: 'target-1' + }) + store.setWorkspaceSession(advanceTerminalTopologyRevision(session, WORKTREE_ID)) + store.flushOrThrow() + return { + store, + runtime: new OrcaRuntimeService(store), + reload: async () => { + store.flush() + store.freezeWrites() + await store.waitForPendingWrite() + return createSqliteTestStore(Store, { dataFile }) + } + } +} + +/** A renderer save: membership as the renderer holds it, and no close records, which it never sends. */ +function rendererSave(session: WorkspaceSessionState): WorkspaceSessionState { + const { + terminalTopologyRevisionByRepoId: _hostPrivate, + closedTerminalTabTombstonesByTabId: _mainOwned, + ...rendererView + } = session + return { ...rendererView, tabsByWorktree: { [WORKTREE_ID]: [] }, terminalLayoutsByTabId: {} } +} + +describe('close records', () => { + it.each(['user', 'cleanup'] as const)( + 'records a %s close in main and keeps it across a renderer save and a reload', + async (reason) => { + const { store, runtime, reload } = createPersistedRuntime() + + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { kind: 'tab', tabId: TAB_ID }, + reason + }) + store.setWorkspaceSession(rendererSave(store.getWorkspaceSession())) + + const reloaded = (await reload()).getWorkspaceSession() + expect(reloaded.tabsByWorktree[WORKTREE_ID]).toEqual([]) + expect(reloaded.closedTerminalTabTombstonesByTabId?.[TAB_ID]).toEqual({ + closedAt: expect.any(Number), + worktreeId: WORKTREE_ID, + reason + }) + } + ) + + // The store keeps main's map only when a write omits it; main's own writes carry it and win. + it("keeps main's own record writes across later store writes", async () => { + const { store, runtime } = createPersistedRuntime() + + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { kind: 'tab', tabId: TAB_ID } + }) + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { kind: 'tab', tabId: LATE_TAB_ID } + }) + store.setWorkspaceSession(rendererSave(store.getWorkspaceSession())) + + expect( + Object.keys(store.getWorkspaceSession().closedTerminalTabTombstonesByTabId ?? {}).sort() + ).toEqual([LATE_TAB_ID, TAB_ID].sort()) + }) + + it("keeps a close's first reason when the renderer's echo closes the same tab again", async () => { + const { store, runtime } = createPersistedRuntime() + + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { kind: 'tab', tabId: LATE_TAB_ID }, + reason: 'cleanup' + }) + const first = store.getWorkspaceSession().closedTerminalTabTombstonesByTabId?.[LATE_TAB_ID] + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { kind: 'tab', tabId: LATE_TAB_ID }, + reason: 'user' + }) + + expect(first?.reason).toBe('cleanup') + expect(store.getWorkspaceSession().closedTerminalTabTombstonesByTabId?.[LATE_TAB_ID]).toEqual( + first + ) + }) + + it('lets a close that removes a listed tab replace a record that tab already had', async () => { + const earlier = Date.now() - 24 * 60 * 60 * 1000 + const { store, runtime } = createPersistedRuntime({ + ...makeSession(), + closedTerminalTabTombstonesByTabId: { + [TAB_ID]: { closedAt: earlier, worktreeId: WORKTREE_ID, reason: 'cleanup' } + } + }) + + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { kind: 'tab', tabId: TAB_ID }, + reason: 'user' + }) + + const record = store.getWorkspaceSession().closedTerminalTabTombstonesByTabId?.[TAB_ID] + expect(store.getWorkspaceSession().tabsByWorktree[WORKTREE_ID]).toEqual([]) + expect(record?.reason).toBe('user') + expect(record?.closedAt).toBeGreaterThan(earlier) + }) + + it('admits a late spawn for a tab whose close record is past the TTL', async () => { + const expired = { + [LATE_TAB_ID]: { + closedAt: Date.now() - CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS - 60_000, + worktreeId: WORKTREE_ID, + reason: 'user' as const + } + } + const { store } = createPersistedRuntime({ + ...makeSession(), + closedTerminalTabTombstonesByTabId: expired + }) + + expect( + await store.persistPtyBinding({ + worktreeId: WORKTREE_ID, + tabId: LATE_TAB_ID, + leafId: LEAF_ID, + ptyId: 'late-pty', + incarnationId: 'late-incarnation' + }) + ).toBe(true) + }) + + it('records nothing for a split pane close, which leaves its tab open', async () => { + const { store, runtime } = createPersistedRuntime() + + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { + kind: 'pane', + tabId: 'unknown-tab', + leafId: LEAF_ID + } + }) + + expect(store.getWorkspaceSession().closedTerminalTabTombstonesByTabId).toBeUndefined() + }) + + // Why: only a resolved tab close records; a pane target never widens here, even on the last pane. + it("records nothing for a pane close aimed at its tab's only pane", async () => { + const { store, runtime } = createPersistedRuntime() + + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { + kind: 'pane', + tabId: TAB_ID, + leafId: LEAF_ID + } + }) + + expect(store.getWorkspaceSession().closedTerminalTabTombstonesByTabId).toBeUndefined() + expect(store.getWorkspaceSession().tabsByWorktree[WORKTREE_ID]?.map((tab) => tab.id)).toEqual([ + TAB_ID + ]) + }) + + // The durable half of refusing a late graft: the close lands while the tab's spawn is in + // flight, so main has never listed the tab, and the spawn commits only after a relaunch. + it('refuses a closed tab whose spawn commits after a crash and reload', async () => { + const { runtime, reload } = createPersistedRuntime() + + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { kind: 'tab', tabId: LATE_TAB_ID } + }) + const relaunched = await reload() + + expect( + await relaunched.persistPtyBinding({ + worktreeId: WORKTREE_ID, + tabId: LATE_TAB_ID, + leafId: LEAF_ID, + ptyId: 'late-pty', + incarnationId: 'late-incarnation' + }) + ).toBe(false) + expect( + relaunched.getWorkspaceSession().tabsByWorktree[WORKTREE_ID]?.map((tab) => tab.id) + ).not.toContain(LATE_TAB_ID) + }) + + it('refuses the graft when the close was recorded in another host partition', async () => { + const { store, runtime } = createPersistedRuntime() + store.setWorkspaceSession( + { ...getDefaultWorkspaceSession(), tabsByWorktree: { [SSH_WORKTREE_ID]: [] } }, + SSH_HOST_ID + ) + + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: SSH_WORKTREE_ID, + target: { + kind: 'tab', + tabId: LATE_TAB_ID + } + }) + + expect( + store.getWorkspaceSession(SSH_HOST_ID).closedTerminalTabTombstonesByTabId?.[LATE_TAB_ID] + ).toBeDefined() + // A relay reattach binds into `local`, not the partition the close was recorded in. + expect( + await store.persistPtyBinding({ + worktreeId: SSH_WORKTREE_ID, + tabId: LATE_TAB_ID, + leafId: LEAF_ID, + ptyId: 'ssh:target-1@@pty2:epoch:1', + incarnationId: 'relay-incarnation' + }) + ).toBe(false) + }) + + it('prunes each host partition alone, so local churn evicts no SSH record', async () => { + const { store, runtime } = createPersistedRuntime() + store.setWorkspaceSession( + { ...getDefaultWorkspaceSession(), tabsByWorktree: { [SSH_WORKTREE_ID]: [] } }, + SSH_HOST_ID + ) + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: SSH_WORKTREE_ID, + target: { + kind: 'tab', + tabId: 'ssh-tab' + } + }) + + for (let index = 0; index <= MAX_CLOSED_TERMINAL_TAB_TOMBSTONES; index += 1) { + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { + kind: 'tab', + tabId: `local-${index}` + } + }) + } + + expect( + Object.keys(store.getWorkspaceSession().closedTerminalTabTombstonesByTabId ?? {}) + ).toHaveLength(MAX_CLOSED_TERMINAL_TAB_TOMBSTONES) + expect( + store.getWorkspaceSession(SSH_HOST_ID).closedTerminalTabTombstonesByTabId?.['ssh-tab'] + ).toBeDefined() + }) +}) diff --git a/src/main/runtime/orca-runtime-terminal-surface-close.test.ts b/src/main/runtime/orca-runtime-terminal-surface-close.test.ts index df39087c6888..c9bd30b7199b 100644 --- a/src/main/runtime/orca-runtime-terminal-surface-close.test.ts +++ b/src/main/runtime/orca-runtime-terminal-surface-close.test.ts @@ -123,7 +123,10 @@ describe('renderer close intents', () => { it('keeps a closed tab closed across a renderer save and a reload', async () => { const { store, runtime, reload } = createPersistedRuntime(makeSession()) - await runtime.closeTerminalSurfaceFromRenderer(WORKTREE_ID, { kind: 'tab', tabId: TAB_ID }) + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { kind: 'tab', tabId: TAB_ID } + }) store.setWorkspaceSession(rendererSaveWithout(store.getWorkspaceSession())) expect((await reload()).tabsByWorktree[WORKTREE_ID]).toEqual([]) @@ -132,10 +135,13 @@ describe('renderer close intents', () => { it('keeps a closed split pane closed across a renderer save and a reload', async () => { const { store, runtime, reload } = createPersistedRuntime(splitSession()) - await runtime.closeTerminalSurfaceFromRenderer(WORKTREE_ID, { - kind: 'pane', - tabId: TAB_ID, - leafId: LEAF_ID + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { + kind: 'pane', + tabId: TAB_ID, + leafId: LEAF_ID + } }) store.setWorkspaceSession(rendererSaveWithout(store.getWorkspaceSession(), LEAF_ID)) @@ -158,10 +164,13 @@ describe('renderer close intents', () => { ])('never widens a pane close into a tab close when %s', async (_case, session) => { const { runtime, reload } = createPersistedRuntime(session()) - await runtime.closeTerminalSurfaceFromRenderer(WORKTREE_ID, { - kind: 'pane', - tabId: TAB_ID, - leafId: LEAF_ID + await runtime.closeTerminalSurfaceFromRenderer({ + worktreeId: WORKTREE_ID, + target: { + kind: 'pane', + tabId: TAB_ID, + leafId: LEAF_ID + } }) expect((await reload()).tabsByWorktree[WORKTREE_ID]).toEqual([ diff --git a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts index 4f89b097cbbe..b9f605ccf910 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts @@ -146,6 +146,58 @@ describe('OrcaRuntimeService', () => { ).rejects.toThrow('terminal_topology_conflict') }) + // The client's retirement proofs die with a host restart; the close record does not. + it('refuses to adopt an orphan under a tab the user closed', async () => { + const session = { + ...getDefaultWorkspaceSession(), + tabsByWorktree: { [TEST_WORKTREE_ID]: [] }, + terminalTopologyRevisionByRepoId: { [TEST_REPO_ID]: 7 }, + closedTerminalTabTombstonesByTabId: { + 'tab-closed': { + closedAt: Date.now(), + worktreeId: TEST_WORKTREE_ID, + reason: 'user' as const + } + } + } + const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession(session) + const runtime = new OrcaRuntimeService( + withDurableRuntimeStore({ ...runtimeStore, flushOrThrow: vi.fn() }) + ) + runtime.setPtyController({ + write: () => true, + kill: () => true, + getForegroundProcess: async () => null, + listProcesses: async () => [ + { + id: 'pty-closed', + incarnationId: 'inc-closed', + terminalHandle: 'term_closed', + title: 'shell', + cwd: TEST_WORKTREE_PATH, + worktreeId: TEST_WORKTREE_ID, + wslDistro: null + } + ] + }) + + await expect( + runtime.adoptTerminalOrphans({ + worktree: `id:${TEST_WORKTREE_ID}`, + expectedTopologyRevision: 7, + claims: [ + { + terminal: 'term_closed', + ptyId: 'pty-closed', + incarnationId: 'inc-closed', + tabId: 'tab-closed', + leafId: HEADLESS_LEAF_ID + } + ] + }) + ).rejects.toThrow('terminal_orphan_surface_retired') + }) + it('keeps orphaned list and show writability aligned with the send gate', async () => { const { runtimeStore } = makeRuntimeStoreWithWorkspaceSession({ ...getDefaultWorkspaceSession(), diff --git a/src/main/runtime/runtime-terminal-orphan-adoption.ts b/src/main/runtime/runtime-terminal-orphan-adoption.ts index 24df1cc1cbfb..51e56d0b5086 100644 --- a/src/main/runtime/runtime-terminal-orphan-adoption.ts +++ b/src/main/runtime/runtime-terminal-orphan-adoption.ts @@ -5,6 +5,7 @@ import type { RuntimeTerminalOrphanAdoptionResult } from '../../shared/runtime-types' import { makePaneKey } from '../../shared/stable-pane-id' +import { hasClosedTerminalTabRecord } from '../../shared/closed-terminal-tab-tombstones' import type { WorkspaceSessionState } from '../../shared/workspace-session-state-types' import { terminalOrphanExecutionOwnersEqual } from './terminal-orphan-owner' import type { TerminalWorkspaceLaunchScope } from './runtime-legacy-worker-terminal-recovery-types' @@ -185,7 +186,11 @@ export async function adoptRuntimeTerminalOrphansFromInventory(args: { ) { throw new Error('terminal_orphan_surface_occupied') } - if (session.terminalSurfaceTombstonesByPaneKey?.[paneKey]) { + // Why the close record too: it outlives a host restart, which the client's retirement proofs do not. + if ( + session.terminalSurfaceTombstonesByPaneKey?.[paneKey] || + hasClosedTerminalTabRecord(session.closedTerminalTabTombstonesByTabId, claim.tabId) + ) { throw new Error('terminal_orphan_surface_retired') } for (const snapshot of ports.getMobileSnapshots()) { diff --git a/src/main/runtime/terminal-surface-close.ts b/src/main/runtime/terminal-surface-close.ts index 65756f12e4fb..0feee12402c6 100644 --- a/src/main/runtime/terminal-surface-close.ts +++ b/src/main/runtime/terminal-surface-close.ts @@ -1,4 +1,9 @@ +import type { RuntimeSessionTabCloseReason } from '../../shared/runtime-session-contracts' import type { WorkspaceSessionState } from '../../shared/workspace-session-state-types' +import { + hasClosedTerminalTabRecord, + recordClosedTerminalTabTombstone +} from '../../shared/closed-terminal-tab-tombstones' import type { TerminalLayoutSnapshot, TerminalPaneLayoutNode @@ -91,12 +96,18 @@ export type TerminalSurfaceCloseResult = WorkspaceSessionTerminalTabCloseResult * The membership half of every explicit terminal close: removes a tab, or one pane of a split * tab, and advances the repo's topology revision so a stale renderer save cannot restore it. * A pane close only ever removes that pane; the resolution says why anything else was a no-op. + * Every tab close is recorded in the session it was removed from, the owning host's partition. */ export function closeTerminalSurfaceInWorkspaceSession( session: WorkspaceSessionState, worktreeId: string, target: TerminalSurfaceCloseTarget, - options: { force?: boolean; paneIncarnationId?: string } = {} + options: { + force?: boolean + paneIncarnationId?: string + reason: RuntimeSessionTabCloseReason + now?: number + } ): TerminalSurfaceCloseResult { if (target.kind === 'pane') { const layout = session.terminalLayoutsByTabId[target.tabId] @@ -128,20 +139,48 @@ export function closeTerminalSurfaceInWorkspaceSession( const result = closeTerminalTabInWorkspaceSession(session, worktreeId, target.tabId, { force: options.force }) + if (result.pinned) { + return { ...result, resolution: 'tab' } + } + // Why a tab this session never listed is still recorded: its spawn may commit later and graft it. + const recorded: WorkspaceSessionState = { + ...result.session, + closedTerminalTabTombstonesByTabId: recordClosedTerminalTabTombstone( + result.session.closedTerminalTabTombstonesByTabId, + target.tabId, + { worktreeId, reason: options.reason }, + options.now ?? Date.now() + ) + } return { ...result, - ...(result.closed - ? { session: advanceTerminalTopologyRevision(result.session, worktreeId) } - : {}), + session: result.closed ? advanceTerminalTopologyRevision(recorded, worktreeId) : recorded, resolution: 'tab' } } +/** How one close commits; `reason` is recorded only when the close resolves to the whole tab. */ +export type TerminalSurfaceCloseOptions = { + allowMissing?: boolean + force?: boolean + reason?: RuntimeSessionTabCloseReason + /** The desktop renderer's own close: its layout owner already removed the tab. Goes away with + * D1, once main owns the terminal layout. */ + closedByLayoutOwner?: boolean +} + +/** The desktop renderer's close intent as its IPC delivers it; main alone passes 'pty-exit'. */ +export type RendererTerminalClose = { + worktreeId: string + target: TerminalSurfaceCloseTarget + reason?: 'user' | 'cleanup' +} + /** What one close's durable mutation reads and writes, resolved when the writer admits it. */ export type TerminalSurfaceCloseCommit = { worktreeId: string target: TerminalSurfaceCloseTarget - options: { allowMissing?: boolean; force?: boolean } + options: TerminalSurfaceCloseOptions /** The session as it was when the close was asked, before the writer admitted it. */ requestedSession: WorkspaceSessionState | null | undefined /** The tab's owner identity still matches the one the close was asked against. */ @@ -175,12 +214,23 @@ export function terminalSurfaceCloseMutation( } const result = closeTerminalSurfaceInWorkspaceSession(session, commit.worktreeId, target, { force: commit.options.force, - paneIncarnationId + paneIncarnationId, + reason: commit.options.reason ?? 'user' }) if (result.pinned) { return { value: new Error('terminal_tab_pinned'), persist: false } } if (!result.closed) { + // Why: a tab this session never listed still records its close, so its late spawn is refused; + // an existing record (an echo of that close) needs no second write. + if ( + commit.options.allowMissing && + target.kind === 'tab' && + !hasClosedTerminalTabRecord(session.closedTerminalTabTombstonesByTabId, target.tabId) + ) { + commit.setSession(result.session, hostId) + return { value: undefined } + } return { value: commit.options.allowMissing ? undefined : new Error('tab_not_found'), persist: false diff --git a/src/main/ssh/ssh-pending-pty-kill-replay.test.ts b/src/main/ssh/ssh-pending-pty-kill-replay.test.ts index 7f682c6c1b65..95296aa6434b 100644 --- a/src/main/ssh/ssh-pending-pty-kill-replay.test.ts +++ b/src/main/ssh/ssh-pending-pty-kill-replay.test.ts @@ -134,6 +134,28 @@ describe('replayPendingSshPtyKills', () => { expect(terminated).toEqual(['pty-1']) }) + // An offline close across a relaunch never learned the incarnation; the epoch-scoped id is the fence. + it('replays an epoch-scoped stop that carries no incarnation', async () => { + const relayPtyId = 'pty2:epoch-a:4' + const { store, cleared, terminated } = createStoreStub([ + { ptyId: relayPtyId, intent: { requestedAt: NOW, attempts: 0 } } + ]) + const { provider, shutdown } = createProviderStub([{ relayPtyId, incarnationId: 'inc-live' }]) + await replayPendingSshPtyKills({ + targetId: TARGET, + store, + provider, + shouldContinue: () => true, + now: () => NOW + }) + expect(shutdown).toHaveBeenCalledWith(`ssh:ssh-1@@${relayPtyId}`, { + immediate: true, + expectedIncarnationId: undefined + }) + expect(cleared).toEqual([relayPtyId]) + expect(terminated).toEqual([relayPtyId]) + }) + // #16970: a redeployed relay renumbers from pty-1, so this id now names someone else's shell. it('refuses to kill a recycled relay id and expires the lease that named it', async () => { const { store, cleared, terminated, expired, recycled } = createStoreStub([ diff --git a/src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts b/src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts index 3c405cd5dff9..ce223ae0b9c8 100644 --- a/src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts +++ b/src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts @@ -458,13 +458,21 @@ describe('SshRelaySession reconnect incarnation ordering', () => { }) it.each([ - { relay: 'current', incarnationId: 'inc-1', tombstonePartition: 'local' }, - { relay: 'current', incarnationId: 'inc-1', tombstonePartition: 'host' }, - { relay: 'legacy', incarnationId: undefined, tombstonePartition: 'local' }, - { relay: 'legacy', incarnationId: undefined, tombstonePartition: 'host' } + { relay: 'current', incarnationId: 'inc-1', tombstonePartition: 'local', retiredBy: 'surface' }, + { relay: 'current', incarnationId: 'inc-1', tombstonePartition: 'host', retiredBy: 'surface' }, + { + relay: 'legacy', + incarnationId: undefined, + tombstonePartition: 'local', + retiredBy: 'surface' + }, + { relay: 'legacy', incarnationId: undefined, tombstonePartition: 'host', retiredBy: 'surface' }, + // A closed tab whose pane is in no tab: the close record is the backstop. + { relay: 'current', incarnationId: 'inc-1', tombstonePartition: 'local', retiredBy: 'close' }, + { relay: 'current', incarnationId: 'inc-1', tombstonePartition: 'host', retiredBy: 'close' } ])( - 'suppresses a $tombstonePartition-partition retired surface from a $relay relay', - async ({ incarnationId, tombstonePartition }) => { + 'suppresses a $tombstonePartition-partition $retiredBy retirement from a $relay relay', + async ({ incarnationId, tombstonePartition, retiredBy }) => { const { mockConn, mockStore, mockPortForward, getMainWindow, mockWindow } = createMockDeps() const attachForReconnect = vi.fn().mockResolvedValue({ ...(incarnationId ? { incarnationId } : {}), @@ -514,10 +522,16 @@ describe('SshRelaySession reconnect incarnation ordering', () => { } } } + const closedTab: ReturnType = { + ...getDefaultWorkspaceSession(), + closedTerminalTabTombstonesByTabId: { [tabId]: { closedAt: Date.now(), worktreeId } } + } vi.mocked(mockStore.getWorkspaceSession).mockImplementation((hostId) => - (hostId ? 'host' : 'local') === tombstonePartition - ? sessionWithTombstone - : getDefaultWorkspaceSession() + (hostId ? 'host' : 'local') !== tombstonePartition + ? getDefaultWorkspaceSession() + : retiredBy === 'close' + ? closedTab + : sessionWithTombstone ) const runtime = { registerPty: vi.fn(), onPtySpawned: vi.fn() } const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined) diff --git a/src/main/ssh/ssh-relay-session.ts b/src/main/ssh/ssh-relay-session.ts index 76b7bfb238c6..e79116912616 100644 --- a/src/main/ssh/ssh-relay-session.ts +++ b/src/main/ssh/ssh-relay-session.ts @@ -119,6 +119,7 @@ import { } from '../../shared/ssh-ai-vault-relay' import { isTerminalLeafId, makePaneKey } from '../../shared/stable-pane-id' import { isValidTerminalTabId } from '../../shared/terminal-tab-id' +import { hasClosedTerminalTabRecord } from '../../shared/closed-terminal-tab-tombstones' import { openSshPtyConsumerSession, type OpenSshPtyConsumerSessionOptions, @@ -2752,9 +2753,19 @@ export class SshRelaySession { if (hasLiveCurrentBinding) { return false } - return [lease.tabId, ...currentTabIds] - .filter((tabId) => isValidTerminalTabId(tabId)) - .some(tombstoneMatches) + // Why only when no tab holds the leaf: a pane moved out of the tab before it closed lives on. + const leaseTabId = lease.tabId + const closedByRecord = + currentTabIds.length === 0 && + candidates.some((candidate) => + hasClosedTerminalTabRecord(candidate?.closedTerminalTabTombstonesByTabId, leaseTabId) + ) + return ( + closedByRecord || + [lease.tabId, ...currentTabIds] + .filter((tabId) => isValidTerminalTabId(tabId)) + .some(tombstoneMatches) + ) } private async suppressRetiredReattachedPty( diff --git a/src/preload/api/workspace-session-api.ts b/src/preload/api/workspace-session-api.ts index 434b3795df1d..d621e5dc7db6 100644 --- a/src/preload/api/workspace-session-api.ts +++ b/src/preload/api/workspace-session-api.ts @@ -24,6 +24,7 @@ export type WorkspaceSessionApi = { closeTerminalSurface: (args: { worktreeId: string target: TerminalSurfaceCloseTarget + reason?: 'user' | 'cleanup' }) => Promise flush: () => Promise readTerminalScrollback: (args: { ref: string }) => string | null diff --git a/src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx b/src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx index d9799888a2e4..734cef0f7956 100644 --- a/src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx +++ b/src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx @@ -6,18 +6,24 @@ import { useTerminalWatcherEffects } from '../use-terminal-watcher-effects' const mocks = vi.hoisted(() => { const storeTabsByWorktree: Record = {} + const storeClosedRecords: Record = {} return { gate: vi.fn(), resume: vi.fn(), authority: 'none', launchStatus: vi.fn((_worktreeId: string, _provider: string): string => 'idle'), createTab: vi.fn(), - storeTabsByWorktree + storeTabsByWorktree, + storeClosedRecords } }) vi.mock('@/store', () => ({ useAppStore: Object.assign(() => mocks.authority, { - getState: () => ({ activeWorktreeId: 'wt-1', tabsByWorktree: mocks.storeTabsByWorktree }) + getState: () => ({ + activeWorktreeId: 'wt-1', + tabsByWorktree: mocks.storeTabsByWorktree, + closedTerminalTabTombstonesByTabId: mocks.storeClosedRecords + }) }) })) vi.mock('@/lib/worktree-agent-activation-gate', () => ({ @@ -46,6 +52,7 @@ afterEach(async () => { vi.clearAllMocks() mocks.authority = 'none' mocks.storeTabsByWorktree = {} + mocks.storeClosedRecords = {} }) function Watcher({ restored = true, hydrated = false, worktreeId = 'wt-1' } = {}): null { @@ -179,11 +186,22 @@ describe('passive terminal seeding retries until a decision applies', () => { const finishGate = deferredGate() root = createRoot(document.createElement('div')) await act(async () => root?.render()) + // closeTab empties the row and records the close in the same store write. mocks.storeTabsByWorktree = { 'wt-1': [] } + mocks.storeClosedRecords = { 'closed-tab': { worktreeId: 'wt-1', closedAt: Date.now() } } await finishGate('empty') expect(mocks.createTab).not.toHaveBeenCalled() }) + it('seeds an empty row that has no close record, which legacy data leaves', async () => { + const finishGate = deferredGate() + root = createRoot(document.createElement('div')) + await act(async () => root?.render()) + mocks.storeTabsByWorktree = { 'wt-1': [] } + await finishGate('empty') + expect(mocks.createTab).toHaveBeenCalledTimes(1) + }) + it('seeds after leaving and returning to a blocked workspace', async () => { mocks.gate.mockResolvedValue('blocked') root = createRoot(document.createElement('div')) diff --git a/src/renderer/src/components/terminal/initial-terminal-wiring.test.ts b/src/renderer/src/components/terminal/initial-terminal-wiring.test.ts index 8908ecefa406..d56384227cc3 100644 --- a/src/renderer/src/components/terminal/initial-terminal-wiring.test.ts +++ b/src/renderer/src/components/terminal/initial-terminal-wiring.test.ts @@ -15,10 +15,10 @@ function readSource(relativePath: string): string { describe('Terminal auto-create wiring', () => { const source = readSource(TERMINAL_PATH) - it('derives the tombstone from the active worktree row at decision time', () => { + it('derives the tombstone from the active worktree row and its close records at decision time', () => { // Why the live store: a render-captured row goes stale while the activation check runs. expect(source).toMatch( - /Object\.hasOwn\(\s*useAppStore\.getState\(\)\.tabsByWorktree,\s*activeWorktreeId\s*\)/ + /isTerminalWorkspaceEmptiedOnPurpose\(\s*useAppStore\.getState\(\),\s*activeWorktreeId\s*\)/ ) }) diff --git a/src/renderer/src/components/terminal/initial-terminal.ts b/src/renderer/src/components/terminal/initial-terminal.ts index b895bf0cbd54..515effce58c2 100644 --- a/src/renderer/src/components/terminal/initial-terminal.ts +++ b/src/renderer/src/components/terminal/initial-terminal.ts @@ -2,6 +2,7 @@ export function shouldAutoCreateInitialTerminal( renderableTabCount: number, hasPersistedTerminalState = false ): boolean { - // Why: a missing row means never initialized; an explicit empty row records that the user closed the last terminal. + // Why: desktop callers pass isTerminalWorkspaceEmptiedOnPurpose, so an empty row with no close + // record (legacy data, or a writer that is not a close) still reads as never initialized. return renderableTabCount === 0 && !hasPersistedTerminalState } diff --git a/src/renderer/src/components/use-terminal-watcher-effects.ts b/src/renderer/src/components/use-terminal-watcher-effects.ts index 0de705d9df5b..f91c06bd7d7c 100644 --- a/src/renderer/src/components/use-terminal-watcher-effects.ts +++ b/src/renderer/src/components/use-terminal-watcher-effects.ts @@ -10,6 +10,7 @@ import { type ParkedTerminalTabWatcherSyncEntry } from './terminal-pane/terminal-parked-tab-watchers' import { useAppStore } from '@/store' +import { isTerminalWorkspaceEmptiedOnPurpose } from '../../../shared/closed-terminal-tab-tombstones' import { gateWorktreeAgentActivation } from '@/lib/worktree-agent-activation-gate' import { createWorkspaceTerminalHostAuthoritySelector } from '@/lib/workspace-terminal-host-authority' import { getStructuredAgentLaunchStatus } from '@/lib/structured-agent-session-launch' @@ -238,10 +239,10 @@ export function useTerminalWatcherEffects(controller: TerminalWatcherController) } // Why: the activation gate reconciles durable/live agent state first; only an actually empty, never-visited workspace receives a default shell. const { renderableTabCount } = reconcileWorktreeTabModel(activeWorktreeId) - // Why (main): a missing row means never initialized, an explicit empty row means the user - // closed the last terminal. Read at decision time: the row can change while the check runs. - const activeWorktreeHasTerminalState = Object.hasOwn( - useAppStore.getState().tabsByWorktree, + // Why (main): only a workspace emptied by a recorded close stays empty; an empty row with no + // record is unknown and seeds. Read at decision time: the row can change while the check runs. + const activeWorktreeHasTerminalState = isTerminalWorkspaceEmptiedOnPurpose( + useAppStore.getState(), activeWorktreeId ) if (shouldAutoCreateInitialTerminal(renderableTabCount, activeWorktreeHasTerminalState)) { diff --git a/src/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.ts b/src/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.ts index a1e82633f988..57964af2e99c 100644 --- a/src/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.ts +++ b/src/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.ts @@ -33,32 +33,28 @@ function sessionState(overrides: Partial = {}): Workspace } as WorkspaceSessionState } +// Records ride on `current` here for brevity; the caller passes the renderer's read-only mirror. function merge( current: WorkspaceSessionState, remote: WorkspaceSessionState, - liveTabs: AppState['tabsByWorktree'] = {}, - remoteRevision?: number + liveTabs: AppState['tabsByWorktree'] = {} ): WorkspaceSessionState { return mergeDirectSshRemoteWorkspaceSession( - current, + { ...current, closedTerminalTabTombstonesByTabId: undefined }, remote, new Set([WORKTREE]), liveTabs, new Set(), undefined, - remoteRevision + current.closedTerminalTabTombstonesByTabId ) } -function tombstone(tabId: string, ackRevision?: number): WorkspaceSessionState { +function tombstone(tabId: string): WorkspaceSessionState { return sessionState({ tabsByWorktree: { [WORKTREE]: [] }, closedTerminalTabTombstonesByTabId: { - [tabId]: { - closedAt: Date.now(), - worktreeId: WORKTREE, - ...(ackRevision ? { ackRevision } : {}) - } + [tabId]: { closedAt: Date.now(), worktreeId: WORKTREE } } }) } @@ -77,7 +73,7 @@ describe('direct-SSH pull merge: closed-tab tombstones', () => { remoteSessionIdsByTabId: { toString: 'session-1' } }) - const merged = merge(current, remote, {}, 2) + const merged = merge(current, remote, {}) expect(merged.tabsByWorktree[WORKTREE]?.map((tab) => tab.id)).toEqual(['toString']) expect(Object.hasOwn(merged.terminalLayoutsByTabId, 'toString')).toBe(true) @@ -96,7 +92,7 @@ describe('direct-SSH pull merge: closed-tab tombstones', () => { }) const remote = sessionState({ tabsByWorktree: { [WORKTREE]: [terminalTab('tab-x')] } }) - const merged = merge(current, remote, {}, 2) + const merged = merge(current, remote, {}) expect(merged.tabsByWorktree[WORKTREE]?.map((tab) => tab.id)).toEqual(['tab-x']) }) @@ -109,12 +105,11 @@ describe('direct-SSH pull merge: closed-tab tombstones', () => { remoteSessionIdsByTabId: { ghost: 'pty-1' } }) - const merged = merge(tombstone('ghost'), remote, { [WORKTREE]: [] }, 3) + const merged = merge(tombstone('ghost'), remote, { [WORKTREE]: [] }) expect(merged.tabsByWorktree[WORKTREE]).toEqual([]) expect(merged.terminalLayoutsByTabId.ghost).toBeUndefined() expect(merged.remoteSessionIdsByTabId?.ghost).toBeUndefined() - expect(merged.closedTerminalTabTombstonesByTabId?.ghost).toBeDefined() }) it('does not re-add a tombstoned tab through the host-unknown branch', () => { @@ -127,7 +122,7 @@ describe('direct-SSH pull merge: closed-tab tombstones', () => { }) const remote = sessionState({ tabsByWorktree: { [WORKTREE]: [] } }) - const merged = merge(current, remote, {}, 3) + const merged = merge(current, remote, {}) expect(merged.tabsByWorktree[WORKTREE]).toEqual([]) }) @@ -143,7 +138,7 @@ describe('direct-SSH pull merge: closed-tab tombstones', () => { activeTabIdByWorktree: { [WORKTREE]: 'ghost' } }) - const merged = merge(tombstone('ghost'), remote, { [WORKTREE]: [] }, 3) + const merged = merge(tombstone('ghost'), remote, { [WORKTREE]: [] }) expect(merged.tabsByWorktree[WORKTREE].map((tab) => tab.id)).toEqual(['survivor']) }) @@ -156,7 +151,7 @@ describe('direct-SSH pull merge: closed-tab tombstones', () => { }) const remote = sessionState({ tabsByWorktree: { [WORKTREE]: [live] } }) - const merged = merge(current, remote, { [WORKTREE]: [live] }, 3) + const merged = merge(current, remote, { [WORKTREE]: [live] }) expect(merged.tabsByWorktree[WORKTREE].map((tab) => tab.id)).toEqual(['live']) }) @@ -169,24 +164,20 @@ describe('direct-SSH pull merge: closed-tab tombstones', () => { const current = sessionState({ tabsByWorktree: { [WORKTREE]: [agent, closedElsewhere] } }) const remote = sessionState({ tabsByWorktree: { [WORKTREE]: [agent] } }) - const merged = merge(current, remote, { [WORKTREE]: [agent, closedElsewhere] }, 3) + const merged = merge(current, remote, { [WORKTREE]: [agent, closedElsewhere] }) expect(merged.tabsByWorktree[WORKTREE].map((tab) => tab.id)).toContain('closed-elsewhere') }) - it('retires the tombstone once a newer snapshot stops listing the tab', () => { - const remote = sessionState({ tabsByWorktree: { [WORKTREE]: [] } }) - - const merged = merge(tombstone('ghost', 3), remote, { [WORKTREE]: [] }, 4) + it('neither retires nor writes back a record once the host stops listing the tab', () => { + // Main alone writes records; an acknowledgement used to delete them here, which made a workspace + // the user emptied read as never initialized as soon as the host caught up. + const current = tombstone('ghost') + const merged = merge(current, sessionState({ tabsByWorktree: { [WORKTREE]: [] } }), { + [WORKTREE]: [] + }) expect(merged.closedTerminalTabTombstonesByTabId).toBeUndefined() - }) - - it('keeps the tombstone when the snapshot omits the worktree entirely', () => { - // A snapshot that says nothing about the worktree — including one whose path never resolved — - // is not evidence the host saw the close. - const merged = merge(tombstone('ghost', 3), sessionState(), {}, 4) - - expect(merged.closedTerminalTabTombstonesByTabId?.ghost).toBeDefined() + expect(current.closedTerminalTabTombstonesByTabId?.ghost).toBeDefined() }) }) diff --git a/src/renderer/src/hooks/remote-workspace-session-merge-closed-terminal-tombstone.test.ts b/src/renderer/src/hooks/remote-workspace-session-merge-closed-terminal-tombstone.test.ts index 3764181e71c1..ff817913da43 100644 --- a/src/renderer/src/hooks/remote-workspace-session-merge-closed-terminal-tombstone.test.ts +++ b/src/renderer/src/hooks/remote-workspace-session-merge-closed-terminal-tombstone.test.ts @@ -15,9 +15,10 @@ import { useAppStore } from '@/store' * The closed-last-terminal tombstone across a direct-SSH reconnect, end to end. * * The unit-level rule lives in remote-workspace-session-merge-local-survival.test.ts; this asserts - * what that rule is FOR. `Object.hasOwn(tabsByWorktree, worktreeId)` has to keep meaning one thing - * — the merge dropping the key turned "the user closed the last terminal" into "never - * initialized", and the seeding pass then handed the terminal back on every reconnect. + * what that rule is FOR. An empty row plus a close record has to keep meaning one thing — the + * merge dropping the key, or the re-hydration dropping the record, turns "the user closed the last + * terminal" into "never initialized", and the seeding pass then hands the terminal back on every + * reconnect. */ const initialAppStoreState = useAppStore.getState() @@ -26,9 +27,13 @@ afterEach(() => { useAppStore.setState(initialAppStoreState, true) }) -/** The state a workspace lands in once its last terminal is closed: an explicit empty row. */ +/** The state a workspace lands in once its last terminal is closed: an explicit empty row, and + * the close record the renderer mirrors from main. */ function seedClosedLastTerminal(worktreeId: string): void { - useAppStore.setState({ tabsByWorktree: { [worktreeId]: [] } }) + useAppStore.setState({ + tabsByWorktree: { [worktreeId]: [] }, + closedTerminalTabTombstonesByTabId: { closed: { closedAt: Date.now(), worktreeId } } + }) expect(useAppStore.getState().reconcileWorktreeTabModel(worktreeId).renderableTabCount).toBe(0) } diff --git a/src/renderer/src/hooks/remote-workspace-session-merge.ts b/src/renderer/src/hooks/remote-workspace-session-merge.ts index 964c942e0ad8..f8bbb0d5ab16 100644 --- a/src/renderer/src/hooks/remote-workspace-session-merge.ts +++ b/src/renderer/src/hooks/remote-workspace-session-merge.ts @@ -1,6 +1,9 @@ import type { TerminalTab } from '../../../shared/terminal-tab-types' import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types' -import { reconcileClosedTerminalTabTombstones } from '../../../shared/closed-terminal-tab-tombstones' +import { + hasClosedTerminalTabRecord, + type ClosedTerminalTabTombstonesByTabId +} from '../../../shared/closed-terminal-tab-tombstones' import type { ExecutionHostId } from '../../../shared/execution-host' import { worktreeWorkspaceKey } from '../../../shared/workspace-scope' import { splitWorktreeId } from '../../../shared/worktree/id' @@ -33,7 +36,7 @@ export function mergeDirectSshRemoteWorkspaceSession( liveTabsByWorktree: AppState['tabsByWorktree'], preserveLocalTerminalTabIds: ReadonlySet, replaceExecutionHostId?: ExecutionHostId, - remoteRevision?: number, + closedTabRecords?: ClosedTerminalTabTombstonesByTabId, preserveLocalLayoutTabIds: ReadonlySet = new Set() ): WorkspaceSessionState { // Live tabs across the worktrees this snapshot replaces. Close-suppression consults it so a tab @@ -45,7 +48,7 @@ export function mergeDirectSshRemoteWorkspaceSession( // (terminal-tab-close.ts), so a tombstoned id is not live anywhere; // 2. isSuppressedByClose matches the tombstone's own worktreeId, so it cannot reach another // workspace's tab even if an id somehow recurred; - // 3. only closeReason === 'user' ever writes a tombstone. + // 3. only a tab close writes a record; nothing infers one from a tab's absence. // A final sweep of suppression over the assembled tabsByWorktree — including worktrees // omitTargetWorktrees passes through verbatim — is still deliberately absent. const currentTabsById = new Map( @@ -56,10 +59,10 @@ export function mergeDirectSshRemoteWorkspaceSession( const locallyPreservedTabIds = new Set() const localTabsFor = (worktreeId: string): TerminalTab[] => liveTabsByWorktree[worktreeId] ?? current.tabsByWorktree[worktreeId] ?? [] - // Why presence and not length: an explicit empty row is the record that the user closed the last - // terminal (initial-terminal.ts), and localTabsFor cannot tell it from an absent one. Admitting - // only non-empty rows dropped the key, which reads downstream as "never initialized" and seeds a - // fresh terminal on every reconnect. + // Why presence and not length: an explicit empty row, with a close record for the worktree, is how + // a workspace the user emptied reads (initial-terminal.ts), and localTabsFor cannot tell it from an + // absent one. Admitting only non-empty rows dropped the key, which reads downstream as "never + // initialized" and seeds a fresh terminal on every reconnect. const hasLocalTabsRow = (worktreeId: string): boolean => Object.hasOwn(liveTabsByWorktree, worktreeId) || Object.hasOwn(current.tabsByWorktree, worktreeId) @@ -116,36 +119,13 @@ export function mergeDirectSshRemoteWorkspaceSession( .filter(([tabId]) => remoteKnownTabIds.has(tabId)) .map(([, sessionId]) => sessionId) ) - // The other half of the trade below. Absence still cannot say "closed", so this says it instead: - // a tab THIS client watched the user close, whose close never reached the host. Only ids the user - // closed are ever in here, and only until the host's own snapshot stops listing them. - const closedTerminalTabTombstonesByTabId = reconcileClosedTerminalTabTombstones({ - tombstones: current.closedTerminalTabTombstonesByTabId, - acknowledgedWorktreeIds: new Set( - [...replaceWorktreeIds].filter((worktreeId) => - Object.hasOwn(remote.tabsByWorktree, worktreeId) - ) - ), - hostKnownTabIds: remoteKnownTabIds, - hostRevision: remoteRevision, - now: Date.now() - }) - // Why Object.hasOwn and not `in`: the map is a plain object from Object.fromEntries, so `in` - // answers true for every Object.prototype key on an EMPTY map — a host tab whose id is - // `toString` would be filtered, blocked from the host-unknown branch, and stripped of its layout - // and session id. Tab ids are validated only as non-empty and colon-free, and createTab honours - // caller-supplied id hints, so that id is reachable. This is the one place either direction could - // delete a tab the user never closed. - // Why the worktree comparison: the tombstone already carries the worktree it was closed in, so - // scoping on it makes "this suppression cannot reach another workspace's tab" structural rather - // than a property of where the call sites happen to sit. - // Why a live local tab still overrides its own tombstone: an id that is live here means the - // tombstone is stale (a close undone before it persisted), not a revival. Deleting a live pane is - // the one outcome this whole function exists to avoid. + // The other half of the trade below. Absence still cannot say "closed", so main's close record + // says it instead. Read only here: main alone writes records, and nothing acknowledges them away. + // Scoped to the record's own worktree, so suppression cannot reach another workspace's tab. + // Why a live local tab still overrides its record: an id that is live here means the record is + // stale, not a revival. Deleting a live pane is the one outcome this function exists to avoid. const isSuppressedByClose = (tabId: string, worktreeId: string): boolean => - Object.hasOwn(closedTerminalTabTombstonesByTabId, tabId) && - closedTerminalTabTombstonesByTabId[tabId]?.worktreeId === worktreeId && - !currentTabsById.has(tabId) + hasClosedTerminalTabRecord(closedTabRecords, tabId, worktreeId) && !currentTabsById.has(tabId) // Ids this merge actually suppressed, recorded as it walks the worktrees. The layout and // session-id sweeps below have no worktree in scope, so they consult decisions already made // rather than re-deriving one without the scope that makes it safe. @@ -271,10 +251,9 @@ export function mergeDirectSshRemoteWorkspaceSession( // the workspace or its path did not resolve to a local id, and taking that literally drops the // user onto the home screen while their terminals keep running. So it is only overridden when the // workspace they are standing in demonstrably still exists in the merged result. - // Why presence and not length, the same reading `hasLocalTabsRow` above already gives: an - // explicit empty row is the record that the user closed the last terminal, and a workspace they - // emptied still exists in the merged result. Counting rows sent them to the home screen for - // having closed their last tab. + // Why presence and not length, the same reading `hasLocalTabsRow` above already gives: a + // workspace the user emptied keeps an explicit empty row, so it still exists in the merged + // result. Counting rows sent them to the home screen for having closed their last tab. const localActiveWorkspaceSurvives = current.activeWorktreeId != null && replaceWorktreeIds.has(current.activeWorktreeId) && @@ -348,11 +327,7 @@ export function mergeDirectSshRemoteWorkspaceSession( // tabs. Removal is the worktree-teardown path's job, not a reconnect's. ...current.defaultTerminalTabsAppliedByWorktreeId, ...remote.defaultTerminalTabsAppliedByWorktreeId - }, - closedTerminalTabTombstonesByTabId: - Object.keys(closedTerminalTabTombstonesByTabId).length > 0 - ? closedTerminalTabTombstonesByTabId - : undefined + } } } diff --git a/src/renderer/src/hooks/remote-workspace-snapshot-apply-deferred-session-write.test.ts b/src/renderer/src/hooks/remote-workspace-snapshot-apply-deferred-session-write.test.ts index 00b2e8b0c263..020d7d43c923 100644 --- a/src/renderer/src/hooks/remote-workspace-snapshot-apply-deferred-session-write.test.ts +++ b/src/renderer/src/hooks/remote-workspace-snapshot-apply-deferred-session-write.test.ts @@ -213,7 +213,6 @@ describe('session writes deferred by a direct-SSH apply', () => { expect(persist, 'the close made during the apply never reached disk').toHaveBeenCalledTimes(1) const patch = persist.mock.calls[0][0].patch - expect(patch.closedTerminalTabTombstonesByTabId?.['tab-b']?.worktreeId).toBe(WORKTREE_B) expect(patch.tabsByWorktree?.[WORKTREE_B]).toEqual([]) expect(patch.tabsByWorktree?.[WORKTREE_A]).toHaveLength(1) } finally { @@ -321,9 +320,7 @@ describe('session writes deferred by a direct-SSH apply', () => { vi.advanceTimersByTime(5_200) expect(persist, 'a clock step back stranded the deferred write').toHaveBeenCalledTimes(1) - expect( - persist.mock.calls[0][0].patch.closedTerminalTabTombstonesByTabId?.['tab-b'] - ).toBeDefined() + expect(persist.mock.calls[0][0].patch.tabsByWorktree?.[WORKTREE_B]).toEqual([]) } finally { cleanup() } diff --git a/src/renderer/src/hooks/remote-workspace-snapshot-apply.ts b/src/renderer/src/hooks/remote-workspace-snapshot-apply.ts index e304ff175972..5ca493251ec0 100644 --- a/src/renderer/src/hooks/remote-workspace-snapshot-apply.ts +++ b/src/renderer/src/hooks/remote-workspace-snapshot-apply.ts @@ -182,7 +182,7 @@ export async function applyDirectSshRemoteWorkspaceSnapshot({ state.tabsByWorktree, currentRecoveryTabIds(state, authority, worktreeIds), toSshExecutionHostId(authority.targetId), - snapshot.revision, + state.closedTerminalTabTombstonesByTabId, new Set( [...worktreeIds].flatMap((id) => (state.tabsByWorktree[id] ?? []) diff --git a/src/renderer/src/lib/session-write-subscriber-deferred-persist.test.ts b/src/renderer/src/lib/session-write-subscriber-deferred-persist.test.ts index df8bf5217d0d..2a65442bd184 100644 --- a/src/renderer/src/lib/session-write-subscriber-deferred-persist.test.ts +++ b/src/renderer/src/lib/session-write-subscriber-deferred-persist.test.ts @@ -104,16 +104,12 @@ describe('session write subscriber defers writes across a closed persistence gat expect(persist).toHaveBeenCalledTimes(1) const patch = persist.mock.calls[0][0].patch + // Close records are main's; the renderer's mirror of them is never written back. + expect(patch.closedTerminalTabTombstonesByTabId).toBeUndefined() expect( - patch.closedTerminalTabTombstonesByTabId, - 'the tombstone written during the apply window was discarded, not deferred' - ).toEqual({ - 'closed-during-apply': { - closedAt: expect.any(Number), - worktreeId: 'wt-remote' - } - }) - expect(patch.activeTabId).toBe('still-open-tab') + patch.activeTabId, + 'the mutation made during the apply window was discarded, not deferred' + ).toBe('still-open-tab') expect(patch.activeRepoId).toBe('repo-1') cleanup() }) @@ -198,7 +194,7 @@ describe('session write subscriber defers writes across a closed persistence gat 'target B lost a tab close because target A was mid-apply' ).toEqual([]) expect(patch.tabsByWorktree?.['wt-target-a']).toHaveLength(1) - expect(patch.closedTerminalTabTombstonesByTabId?.['tab-b']?.worktreeId).toBe('wt-target-b') + expect(patch.closedTerminalTabTombstonesByTabId).toBeUndefined() cleanup() }) diff --git a/src/renderer/src/lib/workspace-session-browser-history.test.ts b/src/renderer/src/lib/workspace-session-browser-history.test.ts index 1a9bde2f605d..8c6ef564e255 100644 --- a/src/renderer/src/lib/workspace-session-browser-history.test.ts +++ b/src/renderer/src/lib/workspace-session-browser-history.test.ts @@ -34,8 +34,7 @@ function createSnapshot(browserUrlHistory: BrowserHistoryEntry[]): WorkspaceSess worktreesByRepo: {}, lastKnownRelayPtyIdByTabId: {}, lastVisitedAtByWorktreeId: {}, - defaultTerminalTabsAppliedByWorktreeId: {}, - closedTerminalTabTombstonesByTabId: {} + defaultTerminalTabsAppliedByWorktreeId: {} } } diff --git a/src/renderer/src/lib/workspace-session-closed-tab-tombstones.test.ts b/src/renderer/src/lib/workspace-session-closed-tab-tombstones.test.ts deleted file mode 100644 index 522b079aff6e..000000000000 --- a/src/renderer/src/lib/workspace-session-closed-tab-tombstones.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { buildWorkspaceSessionPatch } from './workspace-session-patch' -import { SESSION_RELEVANT_FIELDS } from './workspace-session' -import { CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS } from '../../../shared/closed-terminal-tab-tombstones' - -// Why browserPagesByWorkspace is stubbed: buildWorkspaceSessionPatch pre-filters staged browser tabs -// before field dispatch, so the minimal fixture has to carry the map it iterates. -function patchFor( - map: Record -): ReturnType { - return buildWorkspaceSessionPatch( - { browserPagesByWorkspace: {}, closedTerminalTabTombstonesByTabId: map } as never, - ['closedTerminalTabTombstonesByTabId'] - ) -} - -describe('closed-tab tombstones in the persisted session', () => { - it('is a session-relevant field, so a close on its own schedules a write', () => { - expect(SESSION_RELEVANT_FIELDS).toContain('closedTerminalTabTombstonesByTabId') - }) - - it('writes live tombstones and drops ones past the TTL', () => { - const now = Date.now() - expect( - patchFor({ - fresh: { closedAt: now, worktreeId: 'repo-1::/srv/app' }, - stale: { - closedAt: now - CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS - 1, - worktreeId: 'repo-1::/srv/app' - } - }).closedTerminalTabTombstonesByTabId - ).toEqual({ fresh: { closedAt: now, worktreeId: 'repo-1::/srv/app' } }) - }) - - it('omits the field entirely once the map empties', () => { - expect(patchFor({}).closedTerminalTabTombstonesByTabId).toBeUndefined() - }) -}) diff --git a/src/renderer/src/lib/workspace-session-closed-tab-tombstones.ts b/src/renderer/src/lib/workspace-session-closed-tab-tombstones.ts deleted file mode 100644 index 48b1cb1a727c..000000000000 --- a/src/renderer/src/lib/workspace-session-closed-tab-tombstones.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types' -import { pruneClosedTerminalTabTombstones } from '../../../shared/closed-terminal-tab-tombstones' - -/** Applies the TTL/cap bound on the way to disk, and omits an empty map like its siblings. */ -export function buildPersistedClosedTerminalTabTombstones( - map: WorkspaceSessionState['closedTerminalTabTombstonesByTabId'] -): WorkspaceSessionState['closedTerminalTabTombstonesByTabId'] { - const pruned = pruneClosedTerminalTabTombstones(map, Date.now()) - return Object.keys(pruned).length > 0 ? pruned : undefined -} diff --git a/src/renderer/src/lib/workspace-session-editor-drafts.test.ts b/src/renderer/src/lib/workspace-session-editor-drafts.test.ts index 690e5917fd1b..ba639bb46683 100644 --- a/src/renderer/src/lib/workspace-session-editor-drafts.test.ts +++ b/src/renderer/src/lib/workspace-session-editor-drafts.test.ts @@ -36,7 +36,6 @@ function createSnapshot( lastKnownRelayPtyIdByTabId: {}, lastVisitedAtByWorktreeId: {}, defaultTerminalTabsAppliedByWorktreeId: {}, - closedTerminalTabTombstonesByTabId: {}, ...overrides } } diff --git a/src/renderer/src/lib/workspace-session-liveness.test.ts b/src/renderer/src/lib/workspace-session-liveness.test.ts index 5cabd5b52ff6..821c059bfa05 100644 --- a/src/renderer/src/lib/workspace-session-liveness.test.ts +++ b/src/renderer/src/lib/workspace-session-liveness.test.ts @@ -35,7 +35,6 @@ function createSnapshot( lastKnownRelayPtyIdByTabId: {}, lastVisitedAtByWorktreeId: {}, defaultTerminalTabsAppliedByWorktreeId: {}, - closedTerminalTabTombstonesByTabId: {}, ...overrides } } diff --git a/src/renderer/src/lib/workspace-session-patch.ts b/src/renderer/src/lib/workspace-session-patch.ts index 4537e1c570bb..dc2947918c20 100644 --- a/src/renderer/src/lib/workspace-session-patch.ts +++ b/src/renderer/src/lib/workspace-session-patch.ts @@ -20,7 +20,6 @@ import { withoutStagedBrowserTabs } from './workspace-session-staged-browser-tab import { buildPersistedUnifiedTabSessionData } from './workspace-session-unified-tabs' import { buildLastVisitedAtByWorktreeId } from './workspace-session-focus-recency' import { buildSleepingAgentSessionData } from './workspace-session-sleeping-agents' -import { buildPersistedClosedTerminalTabTombstones } from './workspace-session-closed-tab-tombstones' type SessionRelevantField = keyof WorkspaceSessionSnapshot @@ -193,11 +192,6 @@ export function buildWorkspaceSessionPatch( ? snapshot.defaultTerminalTabsAppliedByWorktreeId : undefined } - if (changed.has('closedTerminalTabTombstonesByTabId')) { - patch.closedTerminalTabTombstonesByTabId = buildPersistedClosedTerminalTabTombstones( - snapshot.closedTerminalTabTombstonesByTabId - ) - } if (changed.has('sleepingAgentSessionsByPaneKey')) { patch.sleepingAgentSessionsByPaneKey = buildSleepingAgentSessionData(snapshot).sleepingAgentSessionsByPaneKey diff --git a/src/renderer/src/lib/workspace-session-relevant-fields.test.ts b/src/renderer/src/lib/workspace-session-relevant-fields.test.ts index ce26d33ec82d..9aadf0579647 100644 --- a/src/renderer/src/lib/workspace-session-relevant-fields.test.ts +++ b/src/renderer/src/lib/workspace-session-relevant-fields.test.ts @@ -36,7 +36,6 @@ describe('SESSION_RELEVANT_FIELDS', () => { lastKnownRelayPtyIdByTabId: true, lastVisitedAtByWorktreeId: true, defaultTerminalTabsAppliedByWorktreeId: true, - closedTerminalTabTombstonesByTabId: true, sleepingAgentSessionsByPaneKey: true, clientHostedBrowserCloseIntentsByEnvironment: true, pendingReconnectPtyIdByTabId: true, diff --git a/src/renderer/src/lib/workspace-session-ssh-partition-round-trip.test.ts b/src/renderer/src/lib/workspace-session-ssh-partition-round-trip.test.ts index 19050b9ff670..13cc1baf5078 100644 --- a/src/renderer/src/lib/workspace-session-ssh-partition-round-trip.test.ts +++ b/src/renderer/src/lib/workspace-session-ssh-partition-round-trip.test.ts @@ -682,8 +682,7 @@ describe('ssh host partition remote-workspace round trip', () => { new Set([WORKTREE_ID]), read.session.tabsByWorktree, new Set(), - SSH_HOST_ID, - 1 + SSH_HOST_ID ) expect(merged.tabsByWorktree[WORKTREE_ID]?.map((entry) => entry.id)).toEqual(['tab-runtime']) @@ -718,8 +717,7 @@ describe('ssh host partition remote-workspace round trip', () => { new Set([WORKTREE_ID]), read.session.tabsByWorktree, new Set(), - SSH_HOST_ID, - 2 + SSH_HOST_ID ) expect(merged.tabsByWorktree[WORKTREE_ID]?.map((entry) => entry.id)).toEqual(['tab-runtime']) diff --git a/src/renderer/src/lib/workspace-session.ts b/src/renderer/src/lib/workspace-session.ts index e35e2194f8ef..4bf57f6d82fc 100644 --- a/src/renderer/src/lib/workspace-session.ts +++ b/src/renderer/src/lib/workspace-session.ts @@ -11,7 +11,6 @@ import type { OpenFile } from '../store/slices/editor' import { buildPersistedUnifiedTabSessionData } from './workspace-session-unified-tabs' import { buildLastVisitedAtByWorktreeId } from './workspace-session-focus-recency' import { buildSleepingAgentSessionData } from './workspace-session-sleeping-agents' -import { buildPersistedClosedTerminalTabTombstones } from './workspace-session-closed-tab-tombstones' import { buildActiveConnectionIdsAtShutdown } from './workspace-session-reconnect-targets' import { withoutStagedBrowserTabs } from './workspace-session-staged-browser-tabs' import { buildBrowserSessionData } from './workspace-session-browser-tabs' @@ -57,7 +56,6 @@ export type WorkspaceSessionSnapshot = Pick< | 'lastKnownRelayPtyIdByTabId' | 'lastVisitedAtByWorktreeId' | 'defaultTerminalTabsAppliedByWorktreeId' - | 'closedTerminalTabTombstonesByTabId' > & { activeWorkspaceExecutionHostId?: AppState['activeWorkspaceExecutionHostId'] sleepingAgentSessionsByPaneKey?: AppState['sleepingAgentSessionsByPaneKey'] @@ -100,7 +98,6 @@ export const SESSION_RELEVANT_FIELDS = [ 'lastKnownRelayPtyIdByTabId', 'lastVisitedAtByWorktreeId', 'defaultTerminalTabsAppliedByWorktreeId', - 'closedTerminalTabTombstonesByTabId', 'sleepingAgentSessionsByPaneKey', 'clientHostedBrowserCloseIntentsByEnvironment', 'pendingReconnectPtyIdByTabId', @@ -330,9 +327,6 @@ export function buildWorkspaceSessionPayload( Object.keys(snapshot.defaultTerminalTabsAppliedByWorktreeId).length > 0 ? snapshot.defaultTerminalTabsAppliedByWorktreeId : undefined, - closedTerminalTabTombstonesByTabId: buildPersistedClosedTerminalTabTombstones( - snapshot.closedTerminalTabTombstonesByTabId - ), ...buildSleepingAgentSessionData(snapshot), // Why unconditional rather than omit-when-empty: a full write replaces the persisted object, // so an emptied map has to be written as empty or the last replay never sticks. diff --git a/src/renderer/src/lib/worktree-activation-default-tabs.test.ts b/src/renderer/src/lib/worktree-activation-default-tabs.test.ts index 3b9909483402..a6e5e5136a85 100644 --- a/src/renderer/src/lib/worktree-activation-default-tabs.test.ts +++ b/src/renderer/src/lib/worktree-activation-default-tabs.test.ts @@ -21,8 +21,11 @@ describe('ensureWorktreeHasInitialTerminal', () => { expect(store.queueTabSetupSplit).not.toHaveBeenCalled() }) - it('does not recreate a terminal after an explicit empty state was persisted', () => { - const store = createMockStore({ tabsByWorktree: { 'wt-1': [] } }) + it('does not recreate a terminal after the user closed the last one', () => { + const store = createMockStore({ + tabsByWorktree: { 'wt-1': [] }, + closedTerminalTabTombstonesByTabId: { closed: { closedAt: Date.now(), worktreeId: 'wt-1' } } + }) ensureWorktreeHasInitialTerminal(store, 'wt-1') diff --git a/src/renderer/src/lib/worktree-activation-emptied-workspace-reseed.test.ts b/src/renderer/src/lib/worktree-activation-emptied-workspace-reseed.test.ts index 4d2b43e26bd4..13cedba66df1 100644 --- a/src/renderer/src/lib/worktree-activation-emptied-workspace-reseed.test.ts +++ b/src/renderer/src/lib/worktree-activation-emptied-workspace-reseed.test.ts @@ -24,9 +24,12 @@ afterEach(() => { }) /** The state a workspace lands in once its last terminal is closed: the row survives as an - * explicit empty list rather than disappearing. */ + * explicit empty list rather than disappearing, beside the close's record. */ function seedClosedLastTerminal(worktreeId: string): void { - useAppStore.setState({ tabsByWorktree: { [worktreeId]: [] } }) + useAppStore.setState({ + tabsByWorktree: { [worktreeId]: [] }, + closedTerminalTabTombstonesByTabId: { closed: { closedAt: Date.now(), worktreeId } } + }) const { renderableTabCount } = useAppStore.getState().reconcileWorktreeTabModel(worktreeId) expect(renderableTabCount).toBe(0) } diff --git a/src/renderer/src/lib/worktree-activation-store-contract.ts b/src/renderer/src/lib/worktree-activation-store-contract.ts index 63ce180ffed9..3608c9def1c1 100644 --- a/src/renderer/src/lib/worktree-activation-store-contract.ts +++ b/src/renderer/src/lib/worktree-activation-store-contract.ts @@ -8,9 +8,11 @@ import type { } from '../../../shared/agent-session-resume' import type { WorktreeRuntimeOwnerState } from '@/lib/worktree-runtime-owner' import type { AgentStartedTelemetry } from '@/lib/worktree-startup-payload' +import type { ClosedTerminalTabTombstonesByTabId } from '../../../shared/closed-terminal-tab-tombstones' export type WorktreeActivationStore = Partial & { tabsByWorktree: Record + closedTerminalTabTombstonesByTabId?: ClosedTerminalTabTombstonesByTabId defaultTerminalTabsAppliedByWorktreeId: Record createTab: ( worktreeId: string, diff --git a/src/renderer/src/lib/worktree-initial-terminal-close-records.test.ts b/src/renderer/src/lib/worktree-initial-terminal-close-records.test.ts new file mode 100644 index 000000000000..cd563d9cbe74 --- /dev/null +++ b/src/renderer/src/lib/worktree-initial-terminal-close-records.test.ts @@ -0,0 +1,70 @@ +import { describe, expect, it } from 'vitest' +import { ensureWorktreeHasInitialTerminal } from './worktree-initial-terminal-seeding' +import { + createMockStore, + registerWorktreeActivationReset +} from './worktree-activation-test-harness' +import { + CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS, + MAX_CLOSED_TERMINAL_TAB_TOMBSTONES, + recordClosedTerminalTabTombstone, + type ClosedTerminalTabTombstonesByTabId +} from '../../../shared/closed-terminal-tab-tombstones' + +registerWorktreeActivationReset() + +const WT = 'wt-1' + +/** Startup hydration's seeding decision: no reseed opt-in, so only the row and records decide. */ +function seeds( + tabsByWorktree: Record, + closedTerminalTabTombstonesByTabId?: ClosedTerminalTabTombstonesByTabId, + opts?: { reseedEmptiedWorkspace?: boolean } +): boolean { + const store = createMockStore({ tabsByWorktree, closedTerminalTabTombstonesByTabId }) + ensureWorktreeHasInitialTerminal(store, WT, undefined, undefined, undefined, undefined, opts) + return store.createTab.mock.calls.length > 0 +} + +function closedAt(closedAtMs: number): ClosedTerminalTabTombstonesByTabId { + return { 'closed-tab': { closedAt: closedAtMs, worktreeId: WT, reason: 'user' } } +} + +describe('seeding an empty workspace reads close records', () => { + it('an empty row with a close record stays empty', () => { + expect(seeds({ [WT]: [] }, closedAt(Date.now()))).toBe(false) + }) + + it('a legacy empty row with no record seeds', () => { + expect(seeds({ [WT]: [] })).toBe(true) + }) + + it('an empty row whose only record is past its TTL seeds', () => { + expect( + seeds({ [WT]: [] }, closedAt(Date.now() - CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS - 1)) + ).toBe(true) + }) + + it('an empty row whose record the per-host cap evicted seeds', () => { + const now = Date.now() + let records = closedAt(now - 1_000) + for (let index = 0; index < MAX_CLOSED_TERMINAL_TAB_TOMBSTONES; index += 1) { + records = recordClosedTerminalTabTombstone( + records, + `other-${index}`, + { worktreeId: 'wt-other', reason: 'user' }, + now + ) + } + expect(records['closed-tab']).toBeUndefined() + expect(seeds({ [WT]: [] }, records)).toBe(true) + }) + + // Known weakness until every membership shrink is a close: an older close plus an empty row + // written by something that is not a close still reads as emptied on purpose. + it('a stale record from an earlier close suppresses the startup seed; activation reseeds', () => { + const earlierClose = closedAt(Date.now() - 60_000) + expect(seeds({ [WT]: [] }, earlierClose)).toBe(false) + expect(seeds({ [WT]: [] }, earlierClose, { reseedEmptiedWorkspace: true })).toBe(true) + }) +}) diff --git a/src/renderer/src/lib/worktree-initial-terminal-seeding.ts b/src/renderer/src/lib/worktree-initial-terminal-seeding.ts index f9c2844d4721..b0a6296b30e8 100644 --- a/src/renderer/src/lib/worktree-initial-terminal-seeding.ts +++ b/src/renderer/src/lib/worktree-initial-terminal-seeding.ts @@ -4,6 +4,7 @@ import type { } from '../../../shared/worktree/launch-types' import type { ExecutionHostId } from '../../../shared/execution-host' import { shouldAutoCreateInitialTerminal } from '@/components/terminal/initial-terminal' +import { isTerminalWorkspaceEmptiedOnPurpose } from '../../../shared/closed-terminal-tab-tombstones' import { createSequencedSetupAgentCommands } from '../../../shared/setup-agent-sequencing' import { getSetupRunnerCommandPlatformForPath } from '../../../shared/setup-runner-command' import { agentKindToTuiAgent } from '../../../shared/agent-kind' @@ -174,7 +175,7 @@ export function ensureWorktreeHasInitialTerminal( // terminal is added; and closeTabPreservingPty (use-terminal-pane-lifecycle.ts) skips both // deactivation hooks for pane moves and retirement, where re-seeding is the wanted outcome. const shouldHonourClosedTerminalTombstone = - Object.hasOwn(store.tabsByWorktree, worktreeId) && opts?.reseedEmptiedWorkspace !== true + isTerminalWorkspaceEmptiedOnPurpose(store, worktreeId) && opts?.reseedEmptiedWorkspace !== true // Why: an execution host that has not answered is not a host with no terminals; seeding into that // gap is what adds a tab per launch (STA-4658). Explicit launch work below is a request to create // a terminal now, so it stays ungated. diff --git a/src/renderer/src/store/slices/worktrees/session/worktree-identity-rename-row-worktree-ids.test.ts b/src/renderer/src/store/slices/worktrees/session/worktree-identity-rename-row-worktree-ids.test.ts index 039b1b5ca91a..cb6dd89e0262 100644 --- a/src/renderer/src/store/slices/worktrees/session/worktree-identity-rename-row-worktree-ids.test.ts +++ b/src/renderer/src/store/slices/worktrees/session/worktree-identity-rename-row-worktree-ids.test.ts @@ -41,7 +41,7 @@ describe('buildWorktreeRenameState value-owned worktree rows', () => { const next = buildWorktreeRenameState( appState({ closedTerminalTabTombstonesByTabId: { - 'tab-1': { closedAt: 5, worktreeId: OLD, ackRevision: 3 }, + 'tab-1': { closedAt: 5, worktreeId: OLD, reason: 'user' }, 'tab-2': { closedAt: 6, worktreeId: OTHER } } }), @@ -49,7 +49,7 @@ describe('buildWorktreeRenameState value-owned worktree rows', () => { NEW ) expect(next.closedTerminalTabTombstonesByTabId).toEqual({ - 'tab-1': { closedAt: 5, worktreeId: NEW, ackRevision: 3 }, + 'tab-1': { closedAt: 5, worktreeId: NEW, reason: 'user' }, 'tab-2': { closedAt: 6, worktreeId: OTHER } }) }) diff --git a/src/renderer/src/store/terminals/terminal-surface-close-intent.ts b/src/renderer/src/store/terminals/terminal-surface-close-intent.ts index 0ee2d5aead42..25393aa8129b 100644 --- a/src/renderer/src/store/terminals/terminal-surface-close-intent.ts +++ b/src/renderer/src/store/terminals/terminal-surface-close-intent.ts @@ -4,11 +4,12 @@ import type { TerminalSurfaceCloseTarget } from '../../../../shared/terminal-sur * cannot shrink it, so without this the close would ride on the PTY exit. */ export function commitTerminalSurfaceClose( worktreeId: string, - target: TerminalSurfaceCloseTarget + target: TerminalSurfaceCloseTarget, + reason?: 'user' | 'cleanup' ): void { // Why optional: an older preload can linger through an in-place renderer reload. void globalThis.window?.api?.session - ?.closeTerminalSurface?.({ worktreeId, target }) + ?.closeTerminalSurface?.({ worktreeId, target, ...(reason ? { reason } : {}) }) ?.catch((error: unknown) => { console.warn('[terminal-close] main did not commit the close', error) }) diff --git a/src/renderer/src/store/terminals/terminal-tab-close-intent.test.ts b/src/renderer/src/store/terminals/terminal-tab-close-intent.test.ts index 076de3babb68..61b51c053375 100644 --- a/src/renderer/src/store/terminals/terminal-tab-close-intent.test.ts +++ b/src/renderer/src/store/terminals/terminal-tab-close-intent.test.ts @@ -62,7 +62,8 @@ describe('closeTab close intent', () => { expect(mockApi.pty.kill).toHaveBeenCalledWith(SSH_PTY) expect(closeTerminalSurface).toHaveBeenCalledWith({ worktreeId: SSH_WORKTREE, - target: { kind: 'tab', tabId: 'ssh-tab' } + target: { kind: 'tab', tabId: 'ssh-tab' }, + reason: 'user' }) }) diff --git a/src/renderer/src/store/terminals/terminal-tab-close-tombstone.test.ts b/src/renderer/src/store/terminals/terminal-tab-close-tombstone.test.ts index 8a7d5039c8ac..9d7820c7bd3a 100644 --- a/src/renderer/src/store/terminals/terminal-tab-close-tombstone.test.ts +++ b/src/renderer/src/store/terminals/terminal-tab-close-tombstone.test.ts @@ -2,6 +2,9 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import type * as AgentStatusModule from '@/lib/agent-status' import { createTestStore, makeTab, makeWorktree, seedStore } from '../slices/store-test-helpers' import { createStoreCascadesMockApi } from '../slices/store-cascades-test-harness' +import { mergeDirectSshRemoteWorkspaceSession } from '@/hooks/remote-workspace-session-merge' +import { buildWorkspaceSessionPayload } from '@/lib/workspace-session' +import { getDefaultWorkspaceSession } from '../../../../shared/constants' vi.mock('sonner', () => ({ toast: { info: vi.fn(), success: vi.fn(), error: vi.fn(), warning: vi.fn() } @@ -43,38 +46,93 @@ function storeWithBothWorktrees(): ReturnType { return store } -describe('closeTab close tombstones', () => { +const closeTerminalSurface = vi.fn() +Object.assign(mockApi, { session: { closeTerminalSurface } }) + +describe('closeTab close-record mirror', () => { beforeEach(() => { vi.clearAllMocks() + closeTerminalSurface.mockResolvedValue(undefined) mockApi.worktrees.updateMeta.mockResolvedValue({}) }) - it('records the closed tab against the worktree it was closed in', () => { + // Why every workspace kind: main records every close it is told about, and the mirror is what + // the seeding predicate reads before the next launch hydrates main's copy. + it.each([ + ['remote-tab', REMOTE_WORKTREE], + ['local-tab', LOCAL_WORKTREE] + ])('mirrors the record main is told to write for %s', (tabId, worktreeId) => { const store = storeWithBothWorktrees() - store.getState().closeTab('remote-tab') + store.getState().closeTab(tabId) - expect(store.getState().closedTerminalTabTombstonesByTabId['remote-tab']).toEqual({ + expect(store.getState().closedTerminalTabTombstonesByTabId[tabId]).toEqual({ closedAt: expect.any(Number), - worktreeId: REMOTE_WORKTREE + worktreeId, + reason: 'user' + }) + expect(closeTerminalSurface).toHaveBeenCalledWith({ + worktreeId, + target: { kind: 'tab', tabId }, + reason: 'user' }) }) - // A tombstone outlives the host's own record, so the only claim it may ever make is "the user - // closed this". Neither of these closes is that claim. - it.each([['pty-exit'], ['cleanup']] as const)('records nothing for a %s close', (reason) => { + it('mirrors a cleanup close with its reason', () => { const store = storeWithBothWorktrees() - store.getState().closeTab('remote-tab', { reason }) + store.getState().closeTab('remote-tab', { reason: 'cleanup' }) - expect(store.getState().closedTerminalTabTombstonesByTabId['remote-tab']).toBeUndefined() + expect(store.getState().closedTerminalTabTombstonesByTabId['remote-tab']?.reason).toBe( + 'cleanup' + ) }) - it('records nothing for a definitively local worktree, which no pull merge ever reads', () => { + // Main alone closes for a process exit; a paired host owns its own records. + it.each([ + ['a pty-exit close', { reason: 'pty-exit' as const }], + ['a host-owned close', { remoteCloseOwnedByHost: true }] + ])('mirrors nothing for %s', (_label, opts) => { const store = storeWithBothWorktrees() - store.getState().closeTab('local-tab') + store.getState().closeTab('remote-tab', opts) expect(store.getState().closedTerminalTabTombstonesByTabId).toEqual({}) + expect(closeTerminalSurface).not.toHaveBeenCalled() + }) + + // The race the mirror exists for: a host pull lands after closeTab and before main has answered + // the close intent (which never resolves here). The host still lists the tab. + it('keeps a closed SSH tab closed through a pull that lands before main answers', () => { + closeTerminalSurface.mockReturnValue(new Promise(() => {})) + const store = storeWithBothWorktrees() + const hostStillListing = { + ...getDefaultWorkspaceSession(), + tabsByWorktree: { + [REMOTE_WORKTREE]: [makeTab({ id: 'remote-tab', worktreeId: REMOTE_WORKTREE })] + } + } + const applyPull = (): void => { + const state = store.getState() + const merged = mergeDirectSshRemoteWorkspaceSession( + buildWorkspaceSessionPayload(state), + hostStillListing, + new Set([REMOTE_WORKTREE]), + state.tabsByWorktree, + new Set(), + undefined, + state.closedTerminalTabTombstonesByTabId + ) + const replaceWorkspaceKeys = [REMOTE_WORKTREE] + store.getState().hydrateWorkspaceSession(merged, { replaceWorkspaceKeys }) + store.getState().hydrateTabsSession(merged, { replaceWorkspaceKeys }) + } + + store.getState().closeTab('remote-tab') + applyPull() + // A second pull: once re-added, a live local tab would override its record for good. + applyPull() + + expect(store.getState().tabsByWorktree[REMOTE_WORKTREE]?.map((tab) => tab.id) ?? []).toEqual([]) }) }) diff --git a/src/renderer/src/store/terminals/terminal-tab-close.ts b/src/renderer/src/store/terminals/terminal-tab-close.ts index 529b19ded0b7..8227521d2ecd 100644 --- a/src/renderer/src/store/terminals/terminal-tab-close.ts +++ b/src/renderer/src/store/terminals/terminal-tab-close.ts @@ -1,6 +1,4 @@ -import { recordClosedTerminalTabTombstone } from '../../../../shared/closed-terminal-tab-tombstones' import type { TerminalTab } from '../../../../shared/terminal-tab-types' -import { getConnectionIdFromState } from '@/lib/connection-owner-resolution' import { sweepRetiredTerminalTabState } from '../slices/retired-terminal-tab-state-sweep' import { getRecentlyClosedTabPosition, @@ -27,7 +25,9 @@ export function createTerminalTabCloseActions( return { closeTab: (tabId, opts) => { const closeReason = opts?.reason ?? 'user' - const retiresSession = closeReason === 'user' || closeReason === 'cleanup' + // Why narrowed separately: main alone records a close for a process exit. + const intentReason = closeReason === 'pty-exit' ? null : closeReason + const retiresSession = intentReason !== null const retirementPlan = opts?.precomputedRetirementPlan?.tabId === tabId ? opts.precomputedRetirementPlan @@ -69,22 +69,19 @@ export function createTerminalTabCloseActions( next[wId] = after } } - // Why `user` and not retiresSession: a tombstone outlives the host's own record, so the only - // thing it may ever say is "the user closed this". A pty-exit close is the process ending, - // and a `cleanup` close retires a tab the app itself created — neither is that claim. - // Why a non-local worktree only: the tombstone is read solely by the direct-SSH pull merge, - // and a definitively local tab would just consume the map's cap. An unresolved repo - // (undefined, not null) still records — losing the tombstone reinstates the resurrection. + // Why mirrored here and never persisted: main records the close through the intent below, + // and the direct-SSH pull merge reads this synchronously, so a pull landing before main + // answered would otherwise re-add the tab. Goes away when that merge moves to main. const nextClosedTombstones = - closeReason === 'user' && - closedWorktreeId && - getConnectionIdFromState(s, closedWorktreeId) !== null - ? recordClosedTerminalTabTombstone( - s.closedTerminalTabTombstonesByTabId, - tabId, - closedWorktreeId, - Date.now() - ) + intentReason && closedWorktreeId && opts?.remoteCloseOwnedByHost !== true + ? { + ...s.closedTerminalTabTombstonesByTabId, + [tabId]: { + closedAt: Date.now(), + worktreeId: closedWorktreeId, + reason: intentReason + } + } : s.closedTerminalTabTombstonesByTabId // Why: only explicit user closes feed the Cmd+Shift+T reopen stack; cleanup/PTY-exit closes must not pollute undo history. const closedPosition = @@ -250,8 +247,8 @@ export function createTerminalTabCloseActions( : {}) } }) - if (retiresSession && closingWorktreeId && opts?.remoteCloseOwnedByHost !== true) { - commitTerminalSurfaceClose(closingWorktreeId, { kind: 'tab', tabId }) + if (intentReason && closingWorktreeId && opts?.remoteCloseOwnedByHost !== true) { + commitTerminalSurfaceClose(closingWorktreeId, { kind: 'tab', tabId }, intentReason) } // Why shared with the paired snapshot apply: every path that removes a tab owes it the same sweep, and a second copy of the list is how one path silently misses a new entry. sweepRetiredTerminalTabState(get(), tabId, closingWorktreeId) diff --git a/src/renderer/src/store/terminals/workspace-terminal-hydration-patch.ts b/src/renderer/src/store/terminals/workspace-terminal-hydration-patch.ts index 6f2e3d47e753..ef53641d0dc7 100644 --- a/src/renderer/src/store/terminals/workspace-terminal-hydration-patch.ts +++ b/src/renderer/src/store/terminals/workspace-terminal-hydration-patch.ts @@ -198,7 +198,7 @@ export function targetScopedWorkspaceHydrationPatch( ), ...state.defaultTerminalTabsAppliedByWorktreeId }, - // Why passed through whole: hydration already unioned it with live store state, and the map is + // Why passed through whole: hydration already fell back to live store state, and the map is // keyed by tab id rather than by workspace key so replaceHydratedRecordKeys has nothing to match. closedTerminalTabTombstonesByTabId: hydrated.closedTerminalTabTombstonesByTabId, automaticAgentResumeClaimsByTabId: replaceHydratedRecordKeys( diff --git a/src/renderer/src/store/terminals/workspace-terminal-hydration.ts b/src/renderer/src/store/terminals/workspace-terminal-hydration.ts index db278e05d925..9cfe4e687e8d 100644 --- a/src/renderer/src/store/terminals/workspace-terminal-hydration.ts +++ b/src/renderer/src/store/terminals/workspace-terminal-hydration.ts @@ -191,11 +191,10 @@ export function createWorkspaceTerminalHydrationActions( ...session.defaultTerminalTabsAppliedByWorktreeId, ...s.defaultTerminalTabsAppliedByWorktreeId }, - // Why replace and not union: both callers hand over a map they derived from this store - // synchronously (the pull merge) or from disk before the store had one (startup), so there - // is no local tombstone to lose — and a union would resurrect the ones the merge just - // retired on the host's acknowledgement, which is the whole bound on this map. - closedTerminalTabTombstonesByTabId: session.closedTerminalTabTombstonesByTabId ?? {}, + // Why keep the store's when absent: only main's session carries close records, and the + // pull merge's session does not, so re-hydrating from it must not clear the mirror. + closedTerminalTabTombstonesByTabId: + session.closedTerminalTabTombstonesByTabId ?? s.closedTerminalTabTombstonesByTabId, automaticAgentResumeClaimsByTabId: {}, sleepingAgentSessionsByPaneKey, pendingReconnectWorktreeIds, diff --git a/src/shared/closed-terminal-tab-tombstones.test.ts b/src/shared/closed-terminal-tab-tombstones.test.ts index a2db1828ac32..b28c64d9dd93 100644 --- a/src/shared/closed-terminal-tab-tombstones.test.ts +++ b/src/shared/closed-terminal-tab-tombstones.test.ts @@ -2,37 +2,29 @@ import { describe, expect, it } from 'vitest' import { CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS, MAX_CLOSED_TERMINAL_TAB_TOMBSTONES, + closedTerminalTabTombstoneSchema, + hasClosedTerminalTabRecord, + isTerminalWorkspaceEmptiedOnPurpose, pruneClosedTerminalTabTombstones, recordClosedTerminalTabTombstone, - reconcileClosedTerminalTabTombstones, type ClosedTerminalTabTombstonesByTabId } from './closed-terminal-tab-tombstones' const NOW = 1_800_000_000_000 const WT = 'repo-1::/srv/app' -function reconcile( - tombstones: ClosedTerminalTabTombstonesByTabId, - args: { - acknowledgedWorktreeIds?: string[] - hostKnownTabIds?: string[] - hostRevision?: number - } -): ClosedTerminalTabTombstonesByTabId { - return reconcileClosedTerminalTabTombstones({ - tombstones, - acknowledgedWorktreeIds: new Set(args.acknowledgedWorktreeIds ?? [WT]), - hostKnownTabIds: new Set(args.hostKnownTabIds ?? []), - hostRevision: args.hostRevision, - now: NOW +describe('closed terminal tab records', () => { + it('records the closing worktree, reason and time', () => { + expect( + recordClosedTerminalTabTombstone({}, 'tab-1', { worktreeId: WT, reason: 'cleanup' }, NOW) + ).toEqual({ 'tab-1': { closedAt: NOW, worktreeId: WT, reason: 'cleanup' } }) }) -} -describe('closed terminal tab tombstones', () => { - it('records the closing worktree and time', () => { - expect(recordClosedTerminalTabTombstone({}, 'tab-1', WT, NOW)).toEqual({ - 'tab-1': { closedAt: NOW, worktreeId: WT } - }) + it('treats a record past the TTL as absent, even before its partition prunes it', () => { + const stale = { + 'tab-1': { closedAt: NOW - CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS - 1, worktreeId: WT } + } + expect(hasClosedTerminalTabRecord(stale, 'tab-1', undefined, NOW)).toBe(false) }) it('prunes past the TTL and caps at the newest entries', () => { @@ -57,53 +49,46 @@ describe('closed terminal tab tombstones', () => { expect(capped['tab-0']).toBeDefined() expect(capped[`tab-${MAX_CLOSED_TERMINAL_TAB_TOMBSTONES + 9}`]).toBeUndefined() }) -}) - -describe('closed terminal tab tombstone acknowledgement', () => { - const tombstones = { 'tab-1': { closedAt: NOW, worktreeId: WT } } - - it('a snapshot carrying no revision acknowledges nothing', () => { - expect(reconcile(tombstones, { hostRevision: undefined })).toEqual(tombstones) - }) - - it('a snapshot with no row for the tombstone worktree acknowledges nothing', () => { - const kept = reconcile(tombstones, { acknowledgedWorktreeIds: [], hostRevision: 9 }) - expect(kept['tab-1']).toEqual({ closedAt: NOW, worktreeId: WT }) - }) - - it('the first omitting snapshot only stamps the revision — it could predate the close', () => { - const kept = reconcile(tombstones, { hostRevision: 4 }) - expect(kept['tab-1']).toEqual({ closedAt: NOW, worktreeId: WT, ackRevision: 4 }) - }) - it('a strictly newer omitting snapshot retires the tombstone', () => { - const stamped = reconcile(tombstones, { hostRevision: 4 }) - expect(reconcile(stamped, { hostRevision: 5 })['tab-1']).toBeUndefined() + it('reads an older build record as a close, and an unknown reason as no reason', () => { + expect(closedTerminalTabTombstoneSchema.parse({ closedAt: 1, worktreeId: WT })).toEqual({ + closedAt: 1, + worktreeId: WT + }) + expect( + closedTerminalTabTombstoneSchema.parse({ closedAt: 1, worktreeId: WT, reason: 'later' }) + ).toEqual({ closedAt: 1, worktreeId: WT, reason: undefined }) }) +}) - it('a repeat of the same revision does not retire it', () => { - const stamped = reconcile(tombstones, { hostRevision: 4 }) - expect(reconcile(stamped, { hostRevision: 4 })['tab-1']).toBeDefined() - }) +describe('emptied on purpose', () => { + const closed: ClosedTerminalTabTombstonesByTabId = { 'tab-1': { closedAt: NOW, worktreeId: WT } } - it('a host that still lists the tab re-arms the watermark instead of retiring', () => { - const stamped = reconcile(tombstones, { hostRevision: 4 }) - const stillListed = reconcile(stamped, { hostRevision: 7, hostKnownTabIds: ['tab-1'] }) - expect(stillListed['tab-1']).toEqual({ closedAt: NOW, worktreeId: WT, ackRevision: 7 }) - expect(reconcile(stillListed, { hostRevision: 7 })['tab-1']).toBeDefined() - expect(reconcile(stillListed, { hostRevision: 8 })['tab-1']).toBeUndefined() + it('an empty row with a close record in that workspace was emptied on purpose', () => { + expect( + isTerminalWorkspaceEmptiedOnPurpose( + { tabsByWorktree: { [WT]: [] }, closedTerminalTabTombstonesByTabId: closed }, + WT + ) + ).toBe(true) }) - it('a host revision that went backwards never retires', () => { - const stamped = reconcile(tombstones, { hostRevision: 40 }) - const rewound = reconcile(stamped, { hostRevision: 1 }) - expect(rewound['tab-1']).toEqual({ closedAt: NOW, worktreeId: WT, ackRevision: 40 }) + it('an empty row with no record is unknown, as is a missing row', () => { + expect(isTerminalWorkspaceEmptiedOnPurpose({ tabsByWorktree: { [WT]: [] } }, WT)).toBe(false) + expect( + isTerminalWorkspaceEmptiedOnPurpose( + { tabsByWorktree: {}, closedTerminalTabTombstonesByTabId: closed }, + WT + ) + ).toBe(false) }) - it('a tab listed under a different worktree still counts as known to the host', () => { - const stamped = reconcile(tombstones, { hostRevision: 4 }) + it('a record for another workspace does not count', () => { expect( - reconcile(stamped, { hostRevision: 5, hostKnownTabIds: ['tab-1'] })['tab-1'] - ).toBeDefined() + isTerminalWorkspaceEmptiedOnPurpose( + { tabsByWorktree: { other: [] }, closedTerminalTabTombstonesByTabId: closed }, + 'other' + ) + ).toBe(false) }) }) diff --git a/src/shared/closed-terminal-tab-tombstones.ts b/src/shared/closed-terminal-tab-tombstones.ts index 3db0a585987d..6c7b6f81d49c 100644 --- a/src/shared/closed-terminal-tab-tombstones.ts +++ b/src/shared/closed-terminal-tab-tombstones.ts @@ -1,18 +1,23 @@ import { z } from 'zod' +import type { RuntimeSessionTabCloseReason } from './runtime-session-contracts' -/** A client's own record that the user closed a terminal tab. +const TERMINAL_TAB_CLOSE_REASONS = [ + 'user', + 'cleanup', + 'pty-exit' +] as const satisfies readonly RuntimeSessionTabCloseReason[] + +/** Main's record that a terminal tab was closed, written by its close transaction only. * - * Why it must exist: absence alone cannot distinguish "the host was never told" from "the user - * closed it", so the merge keeps the tab — and a `pty.kill` that died on the transport means the - * host keeps listing it forever. This is the close signal that outlives the failed RPC. - * Safe because tab ids are uuids: a tombstoned id never legitimately returns. */ + * Why it must exist: absence alone cannot distinguish "never told" from "closed", so without it a + * host snapshot or a late spawn commit brings the tab back, and an emptied workspace reads as one + * that was never initialized. Safe because tab ids are uuids: a closed id never legitimately + * returns. Nothing acknowledges it away; it dies by TTL or the per-host cap. */ export type ClosedTerminalTabTombstone = { closedAt: number worktreeId: string - /** Newest host revision seen for this tab's scope since the close. Retirement needs a STRICTLY - * newer snapshot that omits the tab, so a pull already in flight when the user closed cannot - * acknowledge a close it predates. */ - ackRevision?: number + /** Absent on records an older build wrote, when only user closes were recorded. */ + reason?: RuntimeSessionTabCloseReason } export type ClosedTerminalTabTombstonesByTabId = Record @@ -22,11 +27,12 @@ export type ClosedTerminalTabTombstonesByTabId = Record, now: number ): ClosedTerminalTabTombstonesByTabId { - return pruneClosedTerminalTabTombstones({ ...map, [tabId]: { closedAt: now, worktreeId } }, now) -} - -function maxAckRevision(a: number | undefined, b: number | undefined): number | undefined { - if (a === undefined) { - return b - } - return b === undefined ? a : Math.max(a, b) + return pruneClosedTerminalTabTombstones({ ...map, [tabId]: { ...record, closedAt: now } }, now) } -export type ClosedTerminalTabTombstoneAck = { - tombstones: ClosedTerminalTabTombstonesByTabId | undefined - /** Worktrees this snapshot actually carries a tab row for. A worktree the snapshot says nothing - * about — including one whose path never resolved to a local id — is not evidence of anything, - * so its tombstones are left untouched. */ - acknowledgedWorktreeIds: ReadonlySet - /** Every tab id the snapshot lists, across all worktrees: an id the host still carries anywhere - * has not been acknowledged, whichever worktree it now sits under. */ - hostKnownTabIds: ReadonlySet - hostRevision: number | undefined - now: number +/** Whether a tab id was closed within the TTL, by the record's own worktree. The TTL is checked + * here because pruning only runs when the partition next records a close. Object.hasOwn because + * the map is a plain object: `in` answers true for every Object.prototype key. */ +export function hasClosedTerminalTabRecord( + map: ClosedTerminalTabTombstonesByTabId | undefined, + tabId: string, + worktreeId?: string, + now = Date.now() +): boolean { + const record = map !== undefined && Object.hasOwn(map, tabId) ? map[tabId] : undefined + return ( + record !== undefined && + now - record.closedAt <= CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS && + (worktreeId === undefined || record.worktreeId === worktreeId) + ) } -/** Retires tombstones the host has demonstrably seen, and stamps the rest with the revision that - * proved it had not yet. - * - * Retirement takes a snapshot that both covers the tombstone's worktree and is strictly newer than - * the last one that did — one snapshot alone can be the pull that was already in flight when the - * user closed. Absence never deletes here: a snapshot with no revision, or one carrying no row for - * the worktree, retires nothing. */ -export function reconcileClosedTerminalTabTombstones({ - tombstones, - acknowledgedWorktreeIds, - hostKnownTabIds, - hostRevision, - now -}: ClosedTerminalTabTombstoneAck): ClosedTerminalTabTombstonesByTabId { - const pruned = pruneClosedTerminalTabTombstones(tombstones, now) - if (hostRevision === undefined) { - return pruned - } - const kept: ClosedTerminalTabTombstonesByTabId = {} - for (const [tabId, tombstone] of Object.entries(pruned)) { - if (!acknowledgedWorktreeIds.has(tombstone.worktreeId)) { - kept[tabId] = tombstone - continue - } - const observed = tombstone.ackRevision - if (!hostKnownTabIds.has(tabId) && observed !== undefined && hostRevision > observed) { - continue - } - kept[tabId] = { ...tombstone, ackRevision: maxAckRevision(observed, hostRevision) } - } - return kept +/** Emptied on purpose: the workspace's terminal row exists, is empty, and some tab in it was + * closed within the TTL. An empty row with no live record is unknown (legacy data, an expired + * record, or a writer that is not a close), so it reads as never initialized. Any record + * suffices, which is weaker than "the last removal was a close" until every membership shrink is + * a close. */ +export function isTerminalWorkspaceEmptiedOnPurpose( + state: { + tabsByWorktree: Readonly> + closedTerminalTabTombstonesByTabId?: ClosedTerminalTabTombstonesByTabId + }, + worktreeId: string, + now = Date.now() +): boolean { + return ( + Object.hasOwn(state.tabsByWorktree, worktreeId) && + (state.tabsByWorktree[worktreeId]?.length ?? 0) === 0 && + Object.values(state.closedTerminalTabTombstonesByTabId ?? {}).some( + (record) => + record.worktreeId === worktreeId && + now - record.closedAt <= CLOSED_TERMINAL_TAB_TOMBSTONE_TTL_MS + ) + ) } diff --git a/src/shared/ssh-pending-pty-kill.test.ts b/src/shared/ssh-pending-pty-kill.test.ts index 9b13a193a077..c2ba4cb95f11 100644 --- a/src/shared/ssh-pending-pty-kill.test.ts +++ b/src/shared/ssh-pending-pty-kill.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest' import { decideSshPendingPtyKill, MAX_SSH_PENDING_PTY_KILLS_PER_TARGET, + normalizeSshPendingPtyKill, prunePendingSshPtyKills, SSH_PENDING_PTY_KILL_TTL_MS, type SshPendingPtyKill, @@ -64,6 +65,26 @@ describe('decideSshPendingPtyKill', () => { }) }) +// A close whose incarnation was never learned (the host was offline across a relaunch) still owes +// the kill: a `pty2:` id carries a per-start mint epoch, so the id alone names one process. +describe('a pending kill with no incarnation', () => { + const unfenced = { requestedAt: NOW, attempts: 0 } + + it('is kept for an epoch-scoped relay id and dropped for a legacy one', () => { + expect(normalizeSshPendingPtyKill(unfenced, 'pty2:epoch-a:3')).toEqual(unfenced) + expect(normalizeSshPendingPtyKill(unfenced, 'pty-3')).toBeNull() + }) + + it('replays while the host lists the id and retires once it does not', () => { + expect( + decideSshPendingPtyKill(unfenced, { hostListsPty: true, hostIncarnationId: 'inc-z' }, NOW) + ).toEqual({ action: 'replay' }) + expect( + decideSshPendingPtyKill(unfenced, { hostListsPty: false, hostIncarnationId: undefined }, NOW) + ).toEqual({ action: 'retire', reason: 'host-reports-absent' }) + }) +}) + describe('prunePendingSshPtyKills', () => { it('drops expired entries and caps the rest newest-first', () => { const entries: SshPendingPtyKillEntry[] = [ diff --git a/src/shared/ssh-pending-pty-kill.ts b/src/shared/ssh-pending-pty-kill.ts index 186ecd65acc3..89472aee27f3 100644 --- a/src/shared/ssh-pending-pty-kill.ts +++ b/src/shared/ssh-pending-pty-kill.ts @@ -12,21 +12,32 @@ import type { SshRemotePtyLease } from './ssh-types' * already the durable, restart-surviving, per-`(targetId, relayPtyId)` record of a remote PTY. */ export type SshPendingPtyKill = { requestedAt: number - /** The host-minted PTY incarnation this kill was aimed at, and the whole fence. + /** The host-minted PTY incarnation this kill was aimed at, and the fence. * - * A relay renumbers from `pty-1` on every start, so `(targetId, relayPtyId)` alone can name a - * DIFFERENT shell after a redeploy — the collision behind #16970. Current relays enforce this - * identity on `pty.shutdown`; the client also proves it from `pty.listProcesses` before replay so - * older relays that ignore the additive field keep the safest available fallback. */ - incarnationId: string + * A legacy relay renumbers from `pty-1` on every start, so `(targetId, relayPtyId)` alone can + * name a DIFFERENT shell after a redeploy — the collision behind #16970. Current relays enforce + * this identity on `pty.shutdown`; the client also proves it from `pty.listProcesses` before + * replay so older relays that ignore the additive field keep the safest available fallback. + * + * Absent only for a `pty2:` id, whose per-start mint epoch makes the id itself the fence. */ + incarnationId?: string /** Replays attempted since. Diagnostic; the TTL, not this, is the bound. */ attempts: number } +/** Whether a relay PTY id names exactly one process: current relays mint `pty2::` with a + * fresh epoch per start, so the id never recurs. Legacy `pty-N` ids restart at 1. */ +export function isEpochScopedRelayPtyId(relayPtyId: string): boolean { + return relayPtyId.startsWith('pty2:') +} + /** Colocated with the type so the two cannot drift. The lease loader is a strict whitelist that * drops anything it does not name, so a record omitted here would be silently stripped on every * launch — the exact failure `closed-terminal-tab-tombstones.ts` records having shipped once. */ -export function normalizeSshPendingPtyKill(value: unknown): SshPendingPtyKill | null { +export function normalizeSshPendingPtyKill( + value: unknown, + relayPtyId: string +): SshPendingPtyKill | null { if (!value || typeof value !== 'object') { return null } @@ -34,7 +45,11 @@ export function normalizeSshPendingPtyKill(value: unknown): SshPendingPtyKill | if (typeof raw.requestedAt !== 'number' || !Number.isFinite(raw.requestedAt)) { return null } - // No incarnation, no fence, and an unfenced kill order is worse than none. + const attempts = typeof raw.attempts === 'number' && raw.attempts >= 0 ? raw.attempts : 0 + if (raw.incarnationId === undefined && isEpochScopedRelayPtyId(relayPtyId)) { + return { requestedAt: raw.requestedAt, attempts } + } + // No fence, and an unfenced kill order is worse than none. if ( typeof raw.incarnationId !== 'string' || !raw.incarnationId || @@ -42,11 +57,7 @@ export function normalizeSshPendingPtyKill(value: unknown): SshPendingPtyKill | ) { return null } - return { - requestedAt: raw.requestedAt, - incarnationId: raw.incarnationId, - attempts: typeof raw.attempts === 'number' && raw.attempts >= 0 ? raw.attempts : 0 - } + return { requestedAt: raw.requestedAt, incarnationId: raw.incarnationId, attempts } } /** Backstop only — host acknowledgement is the normal exit. This covers a target the user never @@ -107,6 +118,10 @@ export function decideSshPendingPtyKill( if (!observation.hostListsPty) { return { action: 'retire', reason: 'host-reports-absent' } } + if (intent.incarnationId === undefined) { + // The id is the fence: only an epoch-scoped id is ever recorded without an incarnation. + return { action: 'replay' } + } if (observation.hostIncarnationId === undefined) { // Why not replay: an unfenced kill against a renumbered relay id destroys a shell nobody asked // to close, which is strictly worse than the leak. Hosts predating the published incarnation diff --git a/src/shared/workspace-session-schema-field-coverage.test.ts b/src/shared/workspace-session-schema-field-coverage.test.ts index 28572703d5aa..c7001060b7b8 100644 --- a/src/shared/workspace-session-schema-field-coverage.test.ts +++ b/src/shared/workspace-session-schema-field-coverage.test.ts @@ -91,13 +91,16 @@ describe('workspaceSessionStateSchema field coverage', () => { const parsed = parseWorkspaceSession({ ...MINIMAL_SESSION, closedTerminalTabTombstonesByTabId: { - 'tab-1': { closedAt: 1_700_000_000_000, worktreeId: 'repo:wt-1', ackRevision: 4 } + 'tab-1': { closedAt: 1_700_000_000_000, worktreeId: 'repo:wt-1', reason: 'cleanup' }, + // An older build's acknowledgement stamp is dropped; the record itself survives. + 'tab-2': { closedAt: 1_700_000_000_000, worktreeId: 'repo:wt-1', ackRevision: 4 } } }) expect(parsed.ok).toBe(true) expect(parsed.ok && parsed.value.closedTerminalTabTombstonesByTabId).toEqual({ - 'tab-1': { closedAt: 1_700_000_000_000, worktreeId: 'repo:wt-1', ackRevision: 4 } + 'tab-1': { closedAt: 1_700_000_000_000, worktreeId: 'repo:wt-1', reason: 'cleanup' }, + 'tab-2': { closedAt: 1_700_000_000_000, worktreeId: 'repo:wt-1' } }) }) From 9b46c3f0f2585c22aac48ccca37f2c59231a9733 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:49:22 -0400 Subject: [PATCH 16/90] fix(terminal): let unselected Cmd+C reach apps that own their selection (#23597) * fix(terminal): let unselected Cmd+C reach apps that negotiated kitty keyboard On macOS Orca swallowed an unselected Cmd+C as a no-op copy, so a full-screen TUI like Codex, which captures the mouse and keeps its highlight out of xterm's selection, never received its own copy chord. - isAppOwnedCopyChord (xterm-bypass-policy) is the one rule: macOS, no xterm selection, and non-zero kitty flags from the pane's mirror. The pane's xterm bypass and the dashboard popout's key handler both use it. - A selection copy stays claimed through its repeats and release, including custom copy bindings, so kitty event reporting cannot leak them to the PTY. - Plain shells keep sending nothing; Linux and Windows are unchanged. - The e2e kitty helpers move to helpers/terminal-kitty-keyboard.ts so the shortcut spec stays under the line limit. * fix(terminal): popout copy ownership reads xterm's selection like the pane A highlight of blank cells trims to empty text but is still a selection, so the popout must not hand that Cmd+C to a kitty app while the pane withholds it. * test(terminal): keep the held-copy binding test beside the copy dispatch tests The shortcut-policy suite is at its line limit. * test(terminal): stub a blank-cell selection without widening the preview harness type * style(terminal): tighten the app-owned copy comment and read the popout selection after the early return --- ...tTerminalPreview.clipboard-routes.test.tsx | 1 + ...ntTerminalPreview.option-dead-key.test.tsx | 1 + .../AgentTerminalPreview.test.tsx | 32 +++ .../preview-terminal-key-handler.ts | 10 + .../terminal-copy-shortcut.test.ts | 90 ++++++++ .../terminal-keyboard-action-dispatch.ts | 18 +- .../terminal-pane/terminal-shortcut-policy.ts | 12 +- .../terminal-pane/xterm-bypass-policy.test.ts | 41 +++- .../terminal-pane/xterm-bypass-policy.ts | 21 ++ tests/e2e/helpers/terminal-kitty-keyboard.ts | 122 +++++++++++ tests/e2e/terminal-shortcuts.spec.ts | 194 ++++++++---------- 11 files changed, 413 insertions(+), 129 deletions(-) create mode 100644 src/renderer/src/components/terminal-pane/terminal-copy-shortcut.test.ts create mode 100644 tests/e2e/helpers/terminal-kitty-keyboard.ts diff --git a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.clipboard-routes.test.tsx b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.clipboard-routes.test.tsx index f95815b2552e..06e2cb38721b 100644 --- a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.clipboard-routes.test.tsx +++ b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.clipboard-routes.test.tsx @@ -88,6 +88,7 @@ vi.mock('@xterm/xterm', () => ({ scrollToBottom = vi.fn() selectAll = vi.fn() getSelection = vi.fn(() => this.selectionText) + hasSelection = vi.fn(() => this.selectionText !== '') attachCustomKeyEventHandler = vi.fn((handler: (event: KeyboardEvent) => boolean) => { this.customKeyHandler = handler }) diff --git a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.option-dead-key.test.tsx b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.option-dead-key.test.tsx index 62f5b5b2a1d5..65e7026291b0 100644 --- a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.option-dead-key.test.tsx +++ b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.option-dead-key.test.tsx @@ -37,6 +37,7 @@ vi.mock('@xterm/xterm', () => ({ scrollToBottom = vi.fn() selectAll = vi.fn() getSelection = vi.fn(() => '') + hasSelection = vi.fn(() => false) attachCustomKeyEventHandler = vi.fn((handler: (event: KeyboardEvent) => boolean) => { this.customKeyHandler = handler }) diff --git a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx index a40251967c4f..d31f7293e76c 100644 --- a/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx +++ b/src/renderer/src/components/dashboard-popout/AgentTerminalPreview.test.tsx @@ -80,6 +80,7 @@ vi.mock('@xterm/xterm', () => ({ scrollToBottom = vi.fn() selectAll = vi.fn() getSelection = vi.fn(() => this.selectionText) + hasSelection = vi.fn(() => this.selectionText !== '') attachCustomKeyEventHandler = vi.fn((handler: (event: KeyboardEvent) => boolean) => { this.customKeyHandler = handler }) @@ -364,6 +365,37 @@ describe('AgentTerminalPreview', () => { expect(writeTerminalClipboardText).not.toHaveBeenCalled() }) + it('hands unselected Cmd+C to a kitty app and copies a selection instead', async () => { + platformState.value = 'darwin' + render() + await waitFor(() => expect(terminalHarness.instances).toHaveLength(1)) + const terminal = terminalHarness.instances[0]! + await waitFor(() => expect(terminal.customKeyHandler).not.toBeNull()) + const cmdC = (type: string): KeyboardEvent => + new KeyboardEvent(type, { key: 'c', code: 'KeyC', metaKey: true, cancelable: true }) + + // A plain shell's unselected Cmd+C sends nothing. + expect(terminal.customKeyHandler!(cmdC('keydown'))).toBe(false) + expect(terminal.customKeyHandler!(cmdC('keyup'))).toBe(false) + + act(() => { + emitData?.({ type: 'data', ptyId: 'pty-1', data: '\x1b[>1u', bytes: 5 }) + }) + expect(terminal.customKeyHandler!(cmdC('keydown'))).toBe(true) + expect(terminal.customKeyHandler!(cmdC('keyup'))).toBe(true) + + // A highlight of blank cells copies no text but is still Orca's selection, as in the pane. + Object.assign(terminal, { hasSelection: () => true }) + expect(terminal.customKeyHandler!(cmdC('keydown'))).toBe(false) + expect(terminal.customKeyHandler!(cmdC('keyup'))).toBe(false) + expect(writeTerminalClipboardText).not.toHaveBeenCalled() + + terminal.selectionText = 'selected text' + expect(terminal.customKeyHandler!(cmdC('keydown'))).toBe(false) + expect(terminal.customKeyHandler!(cmdC('keyup'))).toBe(false) + expect(writeTerminalClipboardText).toHaveBeenCalledWith('selected text') + }) + it('selects all terminal text on Cmd+A and blocks xterm handling', async () => { platformState.value = 'darwin' render() diff --git a/src/renderer/src/components/dashboard-popout/preview-terminal-key-handler.ts b/src/renderer/src/components/dashboard-popout/preview-terminal-key-handler.ts index 1b263144a537..faaeb0048dca 100644 --- a/src/renderer/src/components/dashboard-popout/preview-terminal-key-handler.ts +++ b/src/renderer/src/components/dashboard-popout/preview-terminal-key-handler.ts @@ -14,6 +14,7 @@ import { type PreviewShortcutContext } from './preview-terminal-shortcuts' import { readTerminalClipboardSelection } from '@/components/terminal-pane/terminal-clipboard-selection-text' +import { isAppOwnedCopyChord } from '@/components/terminal-pane/xterm-bypass-policy' /** * Installs the preview terminal's ONE custom key handler (xterm allows a single @@ -110,6 +111,15 @@ export function installPreviewTerminalKeyHandler(args: { nativeOnlyShortcutTracker.prepareKeyDown(event) const keybindings = useAppStore.getState().keybindings if (keybindingMatchesAction('terminal.copySelection', event, platform, keybindings)) { + if ( + isAppOwnedCopyChord(event, { + isMac: platform === 'darwin', + hasSelection: terminal.hasSelection(), + kittyKeyboardFlags: args.getShortcutContext().getKittyKeyboardFlags() + }) + ) { + return true + } const selection = readTerminalClipboardSelection(terminal) if ( !selection && diff --git a/src/renderer/src/components/terminal-pane/terminal-copy-shortcut.test.ts b/src/renderer/src/components/terminal-pane/terminal-copy-shortcut.test.ts new file mode 100644 index 000000000000..05b363d973a1 --- /dev/null +++ b/src/renderer/src/components/terminal-pane/terminal-copy-shortcut.test.ts @@ -0,0 +1,90 @@ +// @vitest-environment happy-dom +import { afterEach, describe, expect, it, vi } from 'vitest' +import type { PaneManager } from '@/lib/pane-manager/pane-manager' +import { dispatchTerminalShortcutAction } from './terminal-keyboard-action-dispatch' +import { resolveTerminalShortcutAction } from './terminal-shortcut-policy' +import { createTerminalNativeOnlyShortcutTracker } from './terminal-native-only-shortcut' + +type DispatchContext = Parameters[3] + +function dispatchCopy(selection: string, repeat: boolean) { + const writeTerminalClipboardText = vi.fn().mockResolvedValue(undefined) + vi.stubGlobal('api', { ui: { writeTerminalClipboardText } }) + const tracker = createTerminalNativeOnlyShortcutTracker() + const event = new KeyboardEvent('keydown', { + key: 'c', + code: 'KeyC', + metaKey: true, + repeat, + cancelable: true + }) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Copy only reads the active pane's selection. + const manager = { + getActivePane: () => ({ terminal: { getSelection: () => selection } }) + } as PaneManager + const context: DispatchContext = { + tabId: 'tab', + worktreeId: 'workspace', + fallbackCwd: '', + expandedPaneIdRef: { current: null }, + setExpandedPane: vi.fn(), + restoreExpandedLayout: vi.fn(), + refreshPaneSizes: vi.fn(), + persistLayoutSnapshot: vi.fn(), + toggleExpandPane: vi.fn(), + setSearchOpen: vi.fn(), + focusSearchInput: vi.fn(), + searchOpenRef: { current: false }, + onRequestClosePane: vi.fn(), + onClearPaneScrollback: vi.fn(), + onSetTitle: vi.fn(), + onClearPaneTitle: vi.fn(), + paneTransportsRef: { current: new Map() }, + paneCwdRef: { current: new Map() }, + managerRef: { current: manager }, + getKeyboardSplitTelemetrySource: () => 'keyboard', + armNativeOnlyShortcut: tracker.armKeyDown + } + dispatchTerminalShortcutAction({ type: 'copySelection' }, event, manager, context) + return { + claimed: event.defaultPrevented, + copies: writeTerminalClipboardText.mock.calls.length, + releaseClaimed: tracker.consumeCompanion({ type: 'keyup', key: 'c', code: 'KeyC' }) + } +} + +afterEach(() => vi.unstubAllGlobals()) + +describe('terminal copy shortcut', () => { + it('leaves an unselected press to the terminal', () => { + expect(dispatchCopy('', false)).toEqual({ claimed: false, copies: 0, releaseClaimed: false }) + }) + + it('copies a selection once and claims the press through its release', () => { + expect(dispatchCopy('text', false)).toEqual({ claimed: true, copies: 1, releaseClaimed: true }) + expect(dispatchCopy('text', true)).toEqual({ claimed: true, copies: 0, releaseClaimed: false }) + }) + + it('matches held and remapped copy bindings', () => { + const keybindings = { 'terminal.copySelection': ['Mod+Shift+C'] } + const chord = { + key: 'c', + code: 'KeyC', + metaKey: true, + ctrlKey: false, + altKey: false, + shiftKey: false + } + expect(resolveTerminalShortcutAction(chord, true, 'false', 0, false, keybindings)).toBeNull() + expect( + resolveTerminalShortcutAction( + { ...chord, shiftKey: true, repeat: true }, + true, + 'false', + 0, + false, + keybindings + ) + ).toEqual({ type: 'copySelection' }) + }) +}) diff --git a/src/renderer/src/components/terminal-pane/terminal-keyboard-action-dispatch.ts b/src/renderer/src/components/terminal-pane/terminal-keyboard-action-dispatch.ts index feb3eb4b7de7..ce0c10694f32 100644 --- a/src/renderer/src/components/terminal-pane/terminal-keyboard-action-dispatch.ts +++ b/src/renderer/src/components/terminal-pane/terminal-keyboard-action-dispatch.ts @@ -79,10 +79,6 @@ export function dispatchTerminalShortcutAction( event.stopImmediatePropagation() return } - if (event.repeat) { - return - } - if (action.type === 'copySelection') { const pane = manager.getActivePane() ?? manager.getPanes()[0] if (!pane || !pane.terminal.getSelection()) { @@ -90,10 +86,16 @@ export function dispatchTerminalShortcutAction( } event.preventDefault() event.stopImmediatePropagation() - void copyTerminalSelection({ - terminal: pane.terminal, - writeClipboardText: window.api.ui.writeTerminalClipboardText - }).catch(() => {}) + if (!event.repeat) { + armNativeOnlyShortcut(event) + void copyTerminalSelection({ + terminal: pane.terminal, + writeClipboardText: window.api.ui.writeTerminalClipboardText + }).catch(() => {}) + } + return + } + if (event.repeat) { return } if (action.type === 'toggleSearch') { diff --git a/src/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts b/src/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts index 3ec1fea161da..98f47941bb74 100644 --- a/src/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts +++ b/src/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts @@ -100,17 +100,17 @@ export function resolveTerminalShortcutAction( return { type: 'switchInputSource' } } - // Why: held select-all keydowns must remain claimed until keyup so Kitty - // event reporting cannot encode their repeat or release into the PTY. + // Why: held select-all and copy keydowns must remain claimed until keyup so + // Kitty event reporting cannot encode their repeat or release into the PTY. if (keybindingMatchesAction('terminal.selectAll', event, platform, keybindings)) { return { type: 'selectAll' } } - if (!event.repeat) { - if (keybindingMatchesAction('terminal.copySelection', event, platform, keybindings)) { - return { type: 'copySelection' } - } + if (keybindingMatchesAction('terminal.copySelection', event, platform, keybindings)) { + return { type: 'copySelection' } + } + if (!event.repeat) { if (keybindingMatchesAction('terminal.search', event, platform, keybindings)) { return { type: 'toggleSearch' } } diff --git a/src/renderer/src/components/terminal-pane/xterm-bypass-policy.test.ts b/src/renderer/src/components/terminal-pane/xterm-bypass-policy.test.ts index 265a80bf47e9..c08ff8316c10 100644 --- a/src/renderer/src/components/terminal-pane/xterm-bypass-policy.test.ts +++ b/src/renderer/src/components/terminal-pane/xterm-bypass-policy.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from 'vitest' import { + isAppOwnedCopyChord, shouldBypassXtermKeyboardEvent, shouldPreventDefaultTerminalImeCandidateKey, shouldSuppressTerminalImeKeyboardEvent @@ -19,12 +20,32 @@ describe('shouldBypassXtermKeyboardEvent — macOS', () => { ).toBe(true) }) - it('bubbles Cmd+C even with no selection (no-op copy is harmless on macOS)', () => { + it('bubbles Cmd+C in a plain shell with no selection', () => { expect( shouldBypassXtermKeyboardEvent(event({ key: 'c', code: 'KeyC', metaKey: true }), noSel) ).toBe(true) }) + it.each([1, 2, 3, 8, 31])('lets unselected Cmd+C reach Kitty flags %i', (flags) => { + for (const type of ['keydown', 'keyup']) { + for (const repeat of [false, true]) { + const chord = event({ type, key: 'c', code: 'KeyC', metaKey: true, repeat }) + expect(shouldBypassXtermKeyboardEvent(chord, { ...noSel, kittyKeyboardFlags: flags })).toBe( + false + ) + expect(shouldBypassXtermKeyboardEvent(chord, { ...opts, kittyKeyboardFlags: flags })).toBe( + true + ) + expect( + shouldBypassXtermKeyboardEvent( + { ...chord, defaultPrevented: true }, + { ...noSel, kittyKeyboardFlags: flags } + ) + ).toBe(true) + } + } + }) + it('bubbles Cmd+V so web clients receive the native paste event', () => { expect( shouldBypassXtermKeyboardEvent(event({ key: 'v', code: 'KeyV', metaKey: true }), noSel) @@ -173,6 +194,24 @@ describe('shouldBypassXtermKeyboardEvent — macOS', () => { }) }) +describe('isAppOwnedCopyChord', () => { + const cmdC = event({ key: 'c', code: 'KeyC', metaKey: true }) + const kittyApp = { isMac: true, hasSelection: false, kittyKeyboardFlags: 1 } + + it('gives unselected macOS Cmd+C to an app that negotiated Kitty reporting', () => { + expect(isAppOwnedCopyChord(cmdC, kittyApp)).toBe(true) + }) + + it('keeps Orca copy for a selection, a plain shell, other chords, and other platforms', () => { + expect(isAppOwnedCopyChord(cmdC, { ...kittyApp, hasSelection: true })).toBe(false) + expect(isAppOwnedCopyChord(cmdC, { ...kittyApp, kittyKeyboardFlags: 0 })).toBe(false) + expect(isAppOwnedCopyChord(cmdC, { ...kittyApp, kittyKeyboardFlags: undefined })).toBe(false) + expect(isAppOwnedCopyChord({ ...cmdC, shiftKey: true }, kittyApp)).toBe(false) + const ctrlShiftC = event({ key: 'C', code: 'KeyC', ctrlKey: true, shiftKey: true }) + expect(isAppOwnedCopyChord(ctrlShiftC, { ...kittyApp, isMac: false })).toBe(false) + }) +}) + describe('shouldSuppressTerminalImeKeyboardEvent — macOS', () => { const idle = { isMac: true, diff --git a/src/renderer/src/components/terminal-pane/xterm-bypass-policy.ts b/src/renderer/src/components/terminal-pane/xterm-bypass-policy.ts index 2ab8f27f4f1b..977a1731e1ed 100644 --- a/src/renderer/src/components/terminal-pane/xterm-bypass-policy.ts +++ b/src/renderer/src/components/terminal-pane/xterm-bypass-policy.ts @@ -282,6 +282,23 @@ function matchesClipboardBinding( return keybindingMatchesInput(binding, event, platform) } +/** + * On macOS an unselected Cmd+C belongs to an app that negotiated Kitty keyboard + * reporting: apps like Codex capture the mouse, so their highlight is never an + * xterm selection. Without negotiation, unselected Cmd+C still sends nothing. + */ +export function isAppOwnedCopyChord( + event: XtermBypassEvent, + options: Pick +): boolean { + return ( + options.isMac && + !options.hasSelection && + (options.kittyKeyboardFlags ?? 0) !== 0 && + matchesClipboardBinding('Mod+C', event, 'darwin') + ) +} + /** * Decide whether plain Ctrl+C should bypass xterm's kitty CSI-u encoder and * be sent as ETX through Terminal.input() instead. @@ -356,6 +373,10 @@ export function shouldBypassXtermKeyboardEvent( return true } + if (isAppOwnedCopyChord(event, options)) { + return false + } + if (isMac) { // Why: window-level handlers already consume other Cmd chords before xterm // sees them in Electron. Web clients still need paste to bubble to diff --git a/tests/e2e/helpers/terminal-kitty-keyboard.ts b/tests/e2e/helpers/terminal-kitty-keyboard.ts new file mode 100644 index 000000000000..61b298a4c3eb --- /dev/null +++ b/tests/e2e/helpers/terminal-kitty-keyboard.ts @@ -0,0 +1,122 @@ +import type { ElectronApplication, Page } from '@stablyai/playwright-test' +import { expect } from './orca-app' +import { execInTerminal, focusActiveTerminalInput } from './terminal' +import { clearTerminalPtyWriteLog, readTerminalPtyWrites } from './terminal-pty-write-spy' + +async function dispatchCtrlCToActiveTerminalTextarea( + page: Page, + options: { keyupCtrlKey?: boolean } = {} +): Promise<{ + keydownDefaultPrevented: boolean + keyupDefaultPrevented: boolean +}> { + return page.evaluate((dispatchOptions) => { + const state = window.__store?.getState() + const worktreeId = state?.activeWorktreeId + const tabId = + state?.activeTabType === 'terminal' + ? state.activeTabId + : worktreeId + ? (state?.activeTabIdByWorktree?.[worktreeId] ?? null) + : null + const manager = tabId ? window.__paneManagers?.get(tabId) : null + const pane = manager?.getActivePane?.() ?? manager?.getPanes?.()[0] ?? null + const textarea = pane?.container.querySelector( + '.xterm-helper-textarea' + ) as HTMLTextAreaElement | null + if (!pane || !textarea) { + throw new Error('No active terminal textarea for Ctrl+C dispatch') + } + pane.terminal.clearSelection() + pane.terminal.focus() + textarea.focus() + + const createEvent = (type: 'keydown' | 'keyup', ctrlKey: boolean): KeyboardEvent => { + const event = new KeyboardEvent(type, { + key: 'c', + code: 'KeyC', + ctrlKey, + bubbles: true, + cancelable: true + }) + Object.defineProperty(event, 'keyCode', { get: () => 67 }) + Object.defineProperty(event, 'which', { get: () => 67 }) + return event + } + + // Why: Electron headless consumes real Ctrl+C before xterm in automation; + // synthetic DOM events still exercise Orca's installed xterm boundary. + const keydown = createEvent('keydown', true) + textarea.dispatchEvent(keydown) + const keyup = createEvent('keyup', dispatchOptions.keyupCtrlKey !== false) + textarea.dispatchEvent(keyup) + return { + keydownDefaultPrevented: keydown.defaultPrevented, + keyupDefaultPrevented: keyup.defaultPrevented + } + }, options) +} + +export async function getKittyKeyboardFlags(page: Page): Promise { + return page.evaluate(() => { + const state = window.__store?.getState() + const worktreeId = state?.activeWorktreeId + const tabId = + state?.activeTabType === 'terminal' + ? state.activeTabId + : worktreeId + ? (state?.activeTabIdByWorktree?.[worktreeId] ?? null) + : null + const manager = tabId ? window.__paneManagers?.get(tabId) : null + const pane = manager?.getActivePane?.() ?? manager?.getPanes?.()[0] ?? null + const terminal = pane?.terminal as + | { + core?: { coreService?: { kittyKeyboard?: { flags?: number } } } + _core?: { coreService?: { kittyKeyboard?: { flags?: number } } } + } + | undefined + return ( + terminal?.core?.coreService?.kittyKeyboard?.flags ?? + terminal?._core?.coreService?.kittyKeyboard?.flags ?? + null + ) + }) +} + +// Why arm from the PTY: the mirror the shortcut policy reads only sees application output. +export async function armKittyKeyboardFromPty( + page: Page, + ptyId: string, + command: string +): Promise { + await execInTerminal(page, ptyId, command) + await expect + .poll(async () => await getKittyKeyboardFlags(page), { + timeout: 15_000, + message: 'the application never armed kitty keyboard reporting' + }) + .toBe(31) +} + +export async function interruptAndExpectEtx(page: Page, app: ElectronApplication): Promise { + await clearTerminalPtyWriteLog(app) + await focusActiveTerminalInput(page) + await page.keyboard.down('Control') + await page.keyboard.up('Control') + expect((await readTerminalPtyWrites(app)).join('')).toBe('') + await clearTerminalPtyWriteLog(app) + + expect(await dispatchCtrlCToActiveTerminalTextarea(page, { keyupCtrlKey: false })).toEqual({ + keydownDefaultPrevented: false, + keyupDefaultPrevented: false + }) + await expect + .poll(async () => (await readTerminalPtyWrites(app)).some((write) => write.includes('\x03')), { + timeout: 5_000, + message: 'Ctrl+C did not reach the PTY as ETX' + }) + .toBe(true) + const writes = (await readTerminalPtyWrites(app)).join('') + expect(writes).not.toContain('\x1b[99;5u') + expect(writes).not.toContain('\x1b[99') +} diff --git a/tests/e2e/terminal-shortcuts.spec.ts b/tests/e2e/terminal-shortcuts.spec.ts index a187df5b83b7..0ea9f19b3543 100644 --- a/tests/e2e/terminal-shortcuts.spec.ts +++ b/tests/e2e/terminal-shortcuts.spec.ts @@ -34,6 +34,11 @@ import { installTerminalPtyWriteSpy as installMainProcessPtyWriteSpy, readTerminalPtyWrites as getPtyWrites } from './helpers/terminal-pty-write-spy' +import { + armKittyKeyboardFromPty, + getKittyKeyboardFlags, + interruptAndExpectEtx +} from './helpers/terminal-kitty-keyboard' async function setActivePaneForegroundAgent( page: Page, @@ -65,60 +70,6 @@ async function setActivePaneForegroundAgent( }, agent) } -async function dispatchCtrlCToActiveTerminalTextarea( - page: Page, - options: { keyupCtrlKey?: boolean } = {} -): Promise<{ - keydownDefaultPrevented: boolean - keyupDefaultPrevented: boolean -}> { - return page.evaluate((dispatchOptions) => { - const state = window.__store?.getState() - const worktreeId = state?.activeWorktreeId - const tabId = - state?.activeTabType === 'terminal' - ? state.activeTabId - : worktreeId - ? (state?.activeTabIdByWorktree?.[worktreeId] ?? null) - : null - const manager = tabId ? window.__paneManagers?.get(tabId) : null - const pane = manager?.getActivePane?.() ?? manager?.getPanes?.()[0] ?? null - const textarea = pane?.container.querySelector( - '.xterm-helper-textarea' - ) as HTMLTextAreaElement | null - if (!pane || !textarea) { - throw new Error('No active terminal textarea for Ctrl+C dispatch') - } - pane.terminal.clearSelection() - pane.terminal.focus() - textarea.focus() - - const createEvent = (type: 'keydown' | 'keyup', ctrlKey: boolean): KeyboardEvent => { - const event = new KeyboardEvent(type, { - key: 'c', - code: 'KeyC', - ctrlKey, - bubbles: true, - cancelable: true - }) - Object.defineProperty(event, 'keyCode', { get: () => 67 }) - Object.defineProperty(event, 'which', { get: () => 67 }) - return event - } - - // Why: Electron headless consumes real Ctrl+C before xterm in automation; - // synthetic DOM events still exercise Orca's installed xterm boundary. - const keydown = createEvent('keydown', true) - textarea.dispatchEvent(keydown) - const keyup = createEvent('keyup', dispatchOptions.keyupCtrlKey !== false) - textarea.dispatchEvent(keyup) - return { - keydownDefaultPrevented: keydown.defaultPrevented, - keyupDefaultPrevented: keyup.defaultPrevented - } - }, options) -} - async function focusFloatingTerminal(page: Page): Promise { await page .locator( @@ -227,66 +178,6 @@ async function getActiveTerminalViewport( }) } -async function getKittyKeyboardFlags(page: Page): Promise { - return page.evaluate(() => { - const state = window.__store?.getState() - const worktreeId = state?.activeWorktreeId - const tabId = - state?.activeTabType === 'terminal' - ? state.activeTabId - : worktreeId - ? (state?.activeTabIdByWorktree?.[worktreeId] ?? null) - : null - const manager = tabId ? window.__paneManagers?.get(tabId) : null - const pane = manager?.getActivePane?.() ?? manager?.getPanes?.()[0] ?? null - const terminal = pane?.terminal as - | { - core?: { coreService?: { kittyKeyboard?: { flags?: number } } } - _core?: { coreService?: { kittyKeyboard?: { flags?: number } } } - } - | undefined - return ( - terminal?.core?.coreService?.kittyKeyboard?.flags ?? - terminal?._core?.coreService?.kittyKeyboard?.flags ?? - null - ) - }) -} - -// Why arm from the PTY: the mirror the shortcut policy reads only sees application output. -async function armKittyKeyboardFromPty(page: Page, ptyId: string, command: string): Promise { - await execInTerminal(page, ptyId, command) - await expect - .poll(async () => await getKittyKeyboardFlags(page), { - timeout: 15_000, - message: 'the application never armed kitty keyboard reporting' - }) - .toBe(31) -} - -async function interruptAndExpectEtx(page: Page, app: ElectronApplication): Promise { - await clearPtyWriteLog(app) - await focusActiveTerminalInput(page) - await page.keyboard.down('Control') - await page.keyboard.up('Control') - expect((await getPtyWrites(app)).join('')).toBe('') - await clearPtyWriteLog(app) - - expect(await dispatchCtrlCToActiveTerminalTextarea(page, { keyupCtrlKey: false })).toEqual({ - keydownDefaultPrevented: false, - keyupDefaultPrevented: false - }) - await expect - .poll(async () => (await getPtyWrites(app)).some((write) => write.includes('\x03')), { - timeout: 5_000, - message: 'Ctrl+C did not reach the PTY as ETX' - }) - .toBe(true) - const writes = (await getPtyWrites(app)).join('') - expect(writes).not.toContain('\x1b[99;5u') - expect(writes).not.toContain('\x1b[99') -} - async function pressShiftedRussianLayoutKey(page: Page): Promise<{ keydownDefaultPrevented: boolean keypressSent: boolean @@ -625,6 +516,81 @@ test.describe('Terminal Shortcuts', () => { await orcaPage.keyboard.press('Backspace') }) + test('unselected Cmd+C reaches a Kitty app, including after Ctrl+C', async ({ + orcaPage, + electronApp + }) => { + test.skip(process.platform !== 'darwin', 'macOS copy binding') + await installMainProcessPtyWriteSpy(electronApp) + const ptyId = await waitForActivePanePtyId(orcaPage) + await execInTerminal(orcaPage, ptyId, 'echo "CMD_C_""READY"') + await waitForTerminalOutput(orcaPage, 'CMD_C_READY') + const select = (text: string | null): Promise => + orcaPage.evaluate(async (selectedText) => { + const state = window.__store!.getState() + const pane = window.__paneManagers!.get(state.activeTabId!)!.getActivePane()! + if (selectedText === null) { + pane.terminal.clearSelection() + return '' + } + await new Promise((resolve) => + pane.terminal.write(`\r\n${selectedText}\r\n`, resolve) + ) + const buffer = pane.terminal.buffer.active + pane.terminal.select(0, buffer.baseY + buffer.cursorY - 1, selectedText.length) + return pane.terminal.getSelection() + }, text) + // Presses Cmd+C, then a marker chord whose write proves the Cmd+C bytes had their turn. + const pressCmdC = async (marker: string, markerWrite: string): Promise => { + await clearPtyWriteLog(electronApp) + await focusActiveTerminalInput(orcaPage) + await orcaPage.keyboard.press('Meta+c') + await orcaPage.keyboard.press(marker) + await expect.poll(async () => await getPtyWrites(electronApp)).toContain(markerWrite) + const writes = await getPtyWrites(electronApp) + return writes.slice(0, writes.indexOf(markerWrite)) + } + const kittyCmdC = ['\x1b[99;9;99u', '\x1b[99;9:3u'] + const originalClipboard = await electronApp.evaluate(({ clipboard }) => clipboard.readText()) + try { + await select(null) + expect(await pressCmdC('x', 'x')).toEqual([]) + await orcaPage.keyboard.press('Backspace') + + // An app that survives SIGINT, like an agent TUI, and disarms its own flags on exit. + await armKittyKeyboardFromPty( + orcaPage, + ptyId, + `bash -c 'trap "" INT; printf "\\033[=31u"; read -r _; printf "\\033[=0u"'` + ) + await select(null) + expect(await pressCmdC('Shift+Enter', '\x1b[13;2u')).toEqual(kittyCmdC) + + const selectedText = await select('Terminal copy selection') + expect(selectedText).toBe('Terminal copy selection') + await electronApp.evaluate(({ clipboard }) => clipboard.writeText('')) + expect(await pressCmdC('Shift+Enter', '\x1b[13;2u')).toEqual([]) + await expect + .poll(() => electronApp.evaluate(({ clipboard }) => clipboard.readText())) + .toBe(selectedText) + + await interruptAndExpectEtx(orcaPage, electronApp) + expect(await getKittyKeyboardFlags(orcaPage)).toBe(31) + await select(null) + expect(await pressCmdC('Shift+Enter', '\x1b[13;2u')).toEqual(kittyCmdC) + + await sendToTerminal(orcaPage, ptyId, '\r') + await expect.poll(async () => await getKittyKeyboardFlags(orcaPage)).toBe(0) + expect(await pressCmdC('x', 'x')).toEqual([]) + await orcaPage.keyboard.press('Backspace') + } finally { + await electronApp.evaluate( + ({ clipboard }, text) => clipboard.writeText(text), + originalClipboard + ) + } + }) + test('@headful Codex-like background output stays visible without disabling WebGL in auto mode', async ({ orcaPage }) => { From 1f6f8523abe47a75a679dc6b5ea12aa03d7d4e2b Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:49:28 -0400 Subject: [PATCH 17/90] feat(terminal): add Reset Terminal that clears leftover input modes on the host and pane (#23602) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test(native-chat): await the async history and journal snapshot in three tests (#23560) #22835 made history() and journalSnapshot() async; tests from #23502 and #22944 still call them synchronously, so the typecheck job is red on every PR while main pushes do not run it. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * feat(usage): show ZCode Coding Plan quota on current main (#23520) Shows the ZCode Coding Plan quota in the status bar alongside the Claude and Codex usage readouts, reading the key from the user's own ZCode config. Credentials are scoped tightly: the host must be an exact match in the allowlist, HTTPS on port 443 only, `redirect: 'error'`, and the key is checked for CR/LF before it reaches a header. The key itself is never stored or logged — account identity is an HMAC. Both JSON inputs (a user-edited config file and the remote quota response) are narrowed at runtime rather than asserted, and the request cancels an unread response body on the error path so it cannot trip the undici parser crash (orca#8695). Co-authored-by: guanbear * fix(mobile): paired clients re-derive a kept terminal after a cold restore (#23109) * fix(mobile): paired clients re-derive a kept terminal after a cold restore A renderer frame published before a cold-restored terminal's PTY registered was fenced to an empty tab list and recorded as accepted, and the renderer never resends unchanged content. When registerPty binds a surface the accepted frame fenced out, re-merge that frame so the fence reads current state. * test(mobile): drive the live desktop window through the runtime's desktop seam * test(mobile): the re-derive path never flushes the store synchronously * test(mobile): a re-derived frame must not bring back a surface the host retired after accept * fix(mobile): a re-derived frame changes membership only for the registering surface The replay re-ran the whole accepted frame, so a surface the host retired after accept (a phone close whose remote PTY is still exiting, or a closed chat tab) came back. Every other surface now keeps the host's current decision; the removal repair is extracted from the terminal retirement helper so non-terminal tabs are removed the same way. * test(mobile): a re-derived frame must not drop or disown a phone-created terminal the desktop has not published * fix(mobile): a re-derived frame does not infer renderer retirements from its older frame * revert(mobile): drop the replay of a fenced renderer frame Reverts the production parts of a88e1eaa0a, f5b99d0003 and 5af1c6d97a: the kept renderer frame, rederiveFencedRendererSurface and its registerPty call, and the mergeRendererMobileSnapshot / removeMobileSessionSnapshotTabs extractions. The fence will instead read the host's saved membership record. The test file stays and is rewritten for that mechanism. * fix(mobile): the paired-list fence admits a terminal the saved session still lists After a cold restore the in-memory mobile snapshot and PTY table start empty, so in a repo with host-authoritative terminal membership the fence dropped a restored terminal whose renderer frame arrived before its PTY registered, and paired clients never listed it. The fence now also admits a surface the host's saved workspace session still lists (tab under the worktree, leaf in its layout), and registerPty pushes the listing so pending-handle turns ready at once. A restored pane whose PTY never returns is listed as pending-handle, as in repos that are not host-authoritative. * test(mobile): keep the desktop window stub's type assertion on its SAFETY line * fix(mobile): coalesce the registration push for a listed restored terminal registerPty pushed the paired list immediately on every registration that backs a listed surface. The desktop's graph sync after a spawn already publishes the same pending-handle to ready flip on the 50 ms coalescing window, so each restored pane cost two pushes, and a restore of N panes cost N immediate full-list pushes per client. The touch now rides the same coalescing window, which still covers a registration no graph change follows. The test's "unchanged" sync dropped the graph's tab, which is itself a change, and its no-extra-push assertion ran before any coalesced push could fire; both are fixed, and a restore of two panes is asserted to push once. The fence comment no longer claims the new clause keeps pending leaves out of the graph: once the surface is listed, its leaves pass the shared predicate through that listing, as any listed surface's do. * fix(mobile): read saved membership only from the worktree's own session partition For a runtime-host workspace, emptying the owning partition re-routes session reads to a single other partition that still lists the worktree. If that older copy lists a surface a retirement just removed, a lagging renderer frame could re-admit it. The saved-membership check now reads only the partition the worktree's host names, so it never trusts a fallback copy. * test(mobile): pin the own saved partition for every workspace host kind Also correct the immediate-emit comment: only an exit bypasses the window; a registration's ready flip coalesces. * Fix terminal focus when Cmd+J wakes a workspace (#23546) * fix: retain workspace terminal focus through wake restoration * test: reset CPU throttling after wake focus assertion * fix: require terminal textarea readiness before claiming focus * test: configure React act environment for dialog regression * fix(mobile): size a terminal's first subscribe from the document's reported cell box (#23080) * fix(mobile): size a terminal's first subscribe from the document's reported cell box #22960 sent phone dims on a terminal's first subscribe by opening a throwaway empty terminal (init 80x24 ""), awaiting its ready and measuring, behind a per-document first-subscribe mark whose lifetime was tied to web-ready. That cost a second xterm/WebGL instance and ~150 ms per open, plus lifecycle state. The document now measures the cell box without a terminal (xterm 6's CharSizeService strategy, rounded as the renderer rounds it) for every text-size preset and reports it with its viewport in web-ready; a table, because the text scale only reaches the document after that notify. Each init's ready reports the box xterm actually laid out, which replaces the probe's entry. The controller answers fitDimensions/measureFitDimensions from that table and the view's layout with no message; without a table it asks the document as before. The session seeds an unmeasured viewport synchronously in subscribeToTerminal, so the first subscribe carries dims by construction. Deleted: the empty init, its awaitReady gate, deferFirstSubscribeUntilViewportMeasured and the subscribedDocuments mark. The fit pass is unchanged and still covers a document that reports no cell box. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): read the reported cell box through in-narrowing, not Reflect.get Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): correct the probe's cell-box guess from the box xterm lays out The web-ready probe is a guess: building the WebGL addon creates no context, so a context that fails on load lands on the DOM renderer, whose width is not snapped and depends on the column count. Before, a ready box that differed was only logged; the first subscribe had carried the wrong column count, the host echoed it, the fit pass saw the viewport equal to the host's dims, and the grid stayed slightly shrunk. The store also kept the WebGL width after a context loss. The document now reports the box xterm laid out whenever it changes (from onRender, which covers a renderer swap and a DPR change that onDimensionsChange does not fire for, and at ready). The store replaces the guess; when that changes the current text size's entry, the view calls onCellBoxChange with xterm's grid and the session re-fits, running the bounded fit pass if the dims moved (one resubscribe). Equal boxes do nothing. The RN layout box now survives a document reload; the document's own viewport only stands in until the view reports a layout (on the page, web-ready arrives first). The mismatch console.log is gone, and the probe's rounding names the xterm version it copies. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): correct each cell-box guess at most once, so a DOM renderer cannot loop On the DOM renderer the cell width is the rounded canvas width divided by the column count, so every re-init at new cols reported a new box. Each one counted as a correction, a floor over floats could flip the fit between two sizes, and each flip landed converged, which reset the resubscribe budget: an unbounded series of full-snapshot resubscribes. Only the first laid-out box for a guessed text size may be a correction; later reports still update the store, so fits stay truthful, but never resubscribe on their own. The fit's floor gains a 1e-6 epsilon so floating-point error at an exact boundary cannot flip a column or row. New document tests pin the render report after a renderer swap and the report at ready for a paused renderer. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): make xterm the only terminal cell measurer The document builds its real terminal before web-ready, at the app's text scale, and reports the box xterm laid out; the first init reuses that terminal. The page-side prediction, the per-scale guess table and the once-per-document correction are gone. The app remembers the box per text scale for its lifetime, so a later open at a known scale subscribes with phone dims at once. A box that changes at the same grid (renderer swap, pixel ratio) refits the open terminal in place. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): keep commands queued before the terminal WebView first loads A subscribe sized from the stored cell box can queue init before the native WebView reports its first load start, which cleared the queue and left the terminal blank. Only a reload now drops queued commands. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): re-init a document that lacks the subscription's init, and fit one frame width - Web-ready now says whether the document holds the terminal's latest init (a reload before the first ready drops a queued one); the session resubscribes any initialized terminal whose document lacks it. - One grid fit, shared by the app and the document, fed the unrounded frame width React Native laid out; it keeps exact fits whole at fractional pixel ratios. The document's viewport-width fits are gone. - The page builds every document at the scale the view mounted with, as the native WebView does. - A new document's first cell box is compared against the grid the subscribe fitted from the stored box. - The terminal built before ready stays hidden until its first init. - The cell-box census matches glyph-measurement techniques, not names; the store's unused clear() is gone. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): build the terminal before ready only for the view shown at mount A session mounts one terminal view per tab, and each built xterm and a WebGL context before ready: 20 tabs made 20 contexts at load, past the ~16 a page (or Android's shared WebView renderer) holds, and native logged 32 context losses. Only the view shown when it mounts builds early now; the rest build at their first init as before. Deferring the WebGL addon instead would change the reported box: the DOM renderer lays out 7.8x15 where WebGL lays out 7.667x15 at the same font. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): write a WebView document's start values into its page, not an injected script Android ran the pre-content injected script after the document's own in 1 of 22 documents on the emulator; that document started with no text scale or shown flag and built a terminal it should not have. The values now sit in the page ahead of the document script, one source object per start pair so a render never reloads the WebView. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): the pre-ready terminal measures and reports while hidden Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): measure only the laid-out frame, and refit on a new grid, not a new width - A measure needs both of the frame's dimensions from React Native; the document's viewport-height fallback is gone, and before the first layout the handle answers no fit without asking the document. - A frame width change that still fits the PTY's grid from the stored box is a no-op, so sub-pixel layout jitter no longer re-measures. The width ref is written in that effect rather than during render (react-doctor). - One "last grid" ref: the last reported grid, or the one a subscribe fitted from the stored box. - The page render rig measures through the frame it laid out, as the session does, and lets the replay's fit settle before its resize-refit witness. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): let only the current terminal document's ready flush A reload kept the WebView and its onMessage, so the old document's late web-ready flushed the queue into the reloading view and the new document got a second init. Each document now gets its own view (keyed on a generation the controller owns), every notify carries the generation of the view that received it, and a web-ready from a replaced document flushes nothing and stamps nothing. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): drop every notify from a replaced terminal document One rule at the receive boundary: a notify from any generation but the current one is dropped, whatever its type, not only web-ready. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): make fitDimensions a pure question; name each generation counter - fitDimensions no longer records the grid. A width change to a new grid asked it first, so the DOM renderer's report of that grid's box read as "same grid, new box" and refit again. Only the first-subscribe seed (seedFitDimensions) records the grid the document's first report is checked against. - viewGeneration counts the views, readyGeneration counts web-readies. - replaceDocument no longer resets the load flag; the load-start reset stays as the guard for a view that reloads itself. - The name-based lifecycle census is replaced by a behavioural test. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): typecheck the handle mocks, drop the unused cell-box get - The two handle mocks carry both fitDimensions and seedFitDimensions, and the fake-timer acts return nothing, so the three test files check under tsconfig.test.json again. - terminalCellBoxes.get had no product caller; the store's tests assert through fit. - The load-start comment says what the controller does now. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): hold the grid the document has, ignore a replaced view's load start, dispose a failed pre-ready terminal - The document reports a new grid even with an unchanged box, so an in-place reflow on WebGL is held before a later renderer swap at that grid; the swap then refits. The app's apply paths do not hold the grid themselves: the DOM renderer's box follows cols, and a grid held on apply would read its own box as a renderer change and loop. One writer (holdGrid) holds the seeded or reported grid. - A load start from a view a replacement unmounted is ignored, as its notifies already are. - A terminal whose open throws before ready is disposed, not only unreferenced. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): ignore every native event from a replaced terminal view One wrapper binds each WebView lifecycle event (load start, error, HTTP error, render process gone, content process terminated) to the view's generation, so a replaced view's late event cannot reset, replace or put an error over the current document. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): a DOM seed refits once on its first report, not on the refit's own Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): subscribe a terminal only after its document is ready The document still builds its terminal before ready and reports the cell box xterm laid out in web-ready; the app now subscribes after that ready and fits from that box, so nothing is sent to a document before it is ready. Everything that made a pre-ready subscribe safe goes: the app-lifetime box store, the seed fit, the per-document view generations and their event filtering, the init tracker and the hasInit resubscribe. The native view reloads in place again and web-ready keeps main's reload rule. Boxes are kept per view; the grid a document last reported still guards the in-place refit against the DOM renderer's cols-dependent box. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): hold one reported cell box and the grid the subscribe fitted The controller keeps only the box the current document last reported, not a per-text-size store: the document re-reports on a scale change. The subscribe after ready fits from that box and holds the grid it fitted, so the DOM renderer's first report at that grid (a new box) refits once in place and converges; refit and apply paths hold nothing. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): fit only a ready box at the app's scale; forget a reloaded document's box and grid A reload keeps the document's mount scale, so a ready after a text-size change reports a box at the old scale; that box no longer sizes the first subscribe, which then takes the no-box path. A readiness reset drops the old document's box and held grid, so the new document's first DOM report at the same grid does not refit. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): give the terminal document its frame at init, and fit text scale over it only A subscribe sized from the ready box sends no measure, so the document had no frame when the text size changed and reported the pre-refit row pitch. The app's init now carries the frame it laid out, in the fields a measure uses; the router takes it from either. The text-scale fit reads only that frame, with no viewport fallback. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * docs(mobile): say why a frameless text-scale change skips the resize Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): one cell box per terminal notify, not an array web-ready and cell-metrics carry `cellBox: {fontScale, cellWidth, cellHeight} | null`; the document's `laidOutCellBox` returns one or null and the parser validates one object. The text-scale match moves from web-ready into `handle.fitDimensions`, the one place a box is fitted. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): fit terminals in the app from the reported box; drop the measure round trip The app already holds the box the document reported, so the refit and the fit pass await the init's ready and call `handle.fitDimensions` instead of posting `measure` and waiting on `measure-result`. The document's measure, its retries, and the measure promise and timeout go. The document still resizes locally on a text-size change, so every grid the app sends (init, resize, reflow) carries the laid-out frame it was fitted to. `holdSubscribedGrid` replaces `subscribeFitDimensions`, so the only fits are `fitDimensionsFromCell` and `handle.fitDimensions`. The render rig reads its fit from the ready box. The recorder adapter mounts the new handle with the same recorded effects; the goldens it mounts move on their adapterSha256 header only. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): keep the terminal frame in one ref, and notify a new width imperatively The session held the frame in a height ref, a width ref, a width state and the refit's own width ref. It now holds one `terminalFrameRef` ({width, height} | null until the first layout; a hidden 0x0 layout keeps the last box). onLayout notifies a new width imperatively, as it does height, and the refit's notify skips a width whose fit is the grid the PTY has. `terminal-frame-width-refit.ts`, the width state and its effect go. The subscribe's layout gate reads "no frame yet" directly. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): subscribe a held-back terminal on the frame's first layout only `handleTerminalFrameLayout` ran on every onLayout; it now runs once, when the frame first has a size. Later layouts only notify a new width. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): size the first subscribe inline in subscribeToTerminal `sizeTerminalViewportFromCellBox` wrapped five lines in a 37-line module; the subscribe now fits the ready box against the frame, holds that grid and records the diagnostic itself. The helper's tests fold into the subscription tests, which move to the subscription's name. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): drop the unreachable font-size guard on the reported cell box xterm 6.1.0-beta.303 updates the render service's cell box in the same task that sets `options.fontSize`: CharSizeService.measure fires onCharSizeChange, and RenderService.handleCharSizeChanged runs the renderer's `_updateDimensions` (DomRenderer.ts:359, WebglRenderer.ts:229). `term.onRender` fires from RenderService._renderRows after the rows are drawn (RenderService.ts:213, CoreBrowserTerminal.ts:538), and the document writes its text scale and the font size in one task (text-scaling.ts applyTextScale, terminal-init.ts init). So no report can read a box between the font and the scale; the guard and its test go. A new test pins the real order: no report when the font is set, the new box at the new scale on the next render. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): one start seam, no source cache, the reported box as an object - `useState` already pins each view's WebView source at mount (a new test re-renders at another text scale and gets the same object), so the module-level `webViewSources` Map goes. - `initialTextScale` and `buildsTerminalBeforeReady` become one `start(): { textScale, shown }` seam. - `reportedCellBox` holds the last reported box and grid, not a string key. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the RPC recordings to this branch and re-record The terminal refit now fits in the app from the reported box and reads one frame ref, so the recorder's terminal adapter mounts the new handle (`awaitReady` + `fitDimensions`) and options (`terminalFrameRef`), keeping its recorded effects. `baseline` is repinned to 21954dbd2f1, the last commit to touch a fenced path, and every golden is re-recorded. Proof by class against HEAD: 787 header-only, 0 body moved, 0 added, 0 deleted. Header keys moved: `baseline` on all 787, and `adapterSha256` on the 14 goldens `terminal-mount-adapters.ts` mounts (query-reply 3, accessory-raw-send 4, takeover-report 4, viewport-refit 3). No recorded traffic moved. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): hold the reported cell box and its grid in one ref The controller kept the box in `cellBoxRef`, the grid in a string `lastGridRef` and wrote it through `terminal-held-grid.ts`. One `heldRef` now holds `{ cellBox, grid }`, as the document's own `reportedCellBox` does: web-ready writes the box, every cell-metrics report writes both, `holdSubscribedGrid` writes the grid, and a readiness reset clears it. Same write points, so the one-refit bound holds; the DOM-loop and refit-once tests pass unchanged. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the RPC recordings to the hold-rule commit and re-record H (f00bebba483) touched a fenced path after the last repin, so `baseline` moves to it and every golden is re-recorded. Against the corpus before this branch's refreshes (21954dbd2f1): 787 header-only, 0 body moved, 0 added, 0 deleted; `baseline` on all 787 and `adapterSha256` on the 14 goldens `terminal-mount-adapters.ts` mounts. Against the previous refresh: `baseline` only. No recorded traffic moved. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the RPC recordings to the main merge and re-record The merge (b3b1b0def22) is the last commit to touch a fenced path, so `baseline` moves to it and every golden is re-recorded. Against 97b5bb2b9ac: 787 header-only, 0 body moved, 0 added, 0 deleted; `baseline` on all 787, and `adapterSha256` on the 14 session.diff-review-actions goldens whose adapter #22951 edited. Against origin/main: 787 header-only, 0 body moved/added/deleted; `baseline` on all 787 and `adapterSha256` on this branch's 14 terminal goldens. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): the terminal document holds the grid and decides each refit The document already kept the last reported box and grid; the app kept a mirror of both to decide the refit. Now the document decides: its `cell-box` notify carries `{ cellBox, refit }`, sent only when the box changes, with `refit` a box that changed at a kept grid. web-ready records the pre-ready terminal's box at its 80x24 grid, and the first init that reuses that terminal holds the init's grid, so the DOM renderer's first report refits once, as the subscribe's hold did. A re-init no longer clears the record, so a new renderer at the same grid still refits. The app keeps one `cellBoxRef` and `holdSubscribedGrid`, `heldRef` and the grid on the notify go. The one-refit, DOM-loop and renderer-swap tests move to the document with the same scenarios. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): one init options object, and a frame on every grid `init` takes `{ cols, rows, data, preserveScroll, oscLinks, frame }` instead of six positionals, and `init`, `resize` and `reflow` (handle and messages) require `frame: TerminalFrame | null`. The refit's reflow check reads `!dims` alone, and the controller's test file is named for the `cell-box` notify it now covers. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): one notifyTerminalFrame for the frame's layout The frame's onLayout made four calls and held the classification itself. It now calls `notifyTerminalFrame({ width, height })`, and the session's terminal-webview hook keeps the one frame ref, notifies the height, subscribes the document held back for the first layout, and notifies a later width change. `handleTerminalFrameLayout` is named for what it does: `subscribeIntendedActiveTerminal`. The layout tests move to that hook. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the RPC recordings to the round-8 head and re-record 85d421963c6 is the last commit to touch a fenced path. Against a676c1b65a7: 787 header-only, 0 body moved/added/deleted, `baseline` only. Against origin/main: 787 header-only, 0 body moved/added/deleted; `baseline` on all 787 and `adapterSha256` on this branch's 14 terminal goldens. No recorded traffic moved. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): name the init option initialData, as the message does The init option `data` becomes `initialData`, the message field's name, so the controller passes it through unrenamed. The `preserveScroll` why stays on the message type only, and the document test's title names the three grids that carry the frame. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): repin the RPC recordings to the round-9 head and re-record 486566c82b4 is the last commit to touch a fenced path. Against 3371c397150: 787 header-only, 0 body moved/added/deleted, `baseline` only. Against origin/main: 787 header-only, 0 body moved/added/deleted; `baseline` on all 787 and `adapterSha256` on this branch's 14 terminal goldens. No recorded traffic moved. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * ci: rerun checks against main with #23560 landed Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * feat(ai-vault): show ZCode CLI session history (#23513) Surfaces ZCode CLI session history in AI Vault, so past ZCode sessions show up next to the other agents' instead of being invisible. ZCode stores sessions in the same SQLite shape OpenCode uses, so this reuses the existing OpenCode lister and parser rather than adding a second scanner — the worker only varies the agent it stamps on each row. Discovery covers the native home and any WSL homes. SQLite rows are narrowed at runtime rather than asserted: the statement API returns untyped column values, so the declared row shape is only a claim until something checks it, and a drifted schema or a database written by another tool reaches the same code. Co-authored-by: guanbear * test(mobile): repin the RPC recording corpus to main after #23080 (#23565) #23080 squash-merged a corpus pinned to its branch commit 486566c82b4, which the squash left unreachable from main. Repin baseline to main's tip and re-record; every golden moves only its baseline header. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * perf(ci): diff against the merge commit's first parent so PR checkouts can be shallow (#23562) Every changed-path gate asked git for `--merge-base "$BASE_SHA" "$HEAD_SHA"`, which needs the event payload's base SHA to be in the local graph. That is the only reason two jobs cloned all 8127 refs' history. On a pull_request checkout HEAD is already the merge commit, so its first parent is the base side and no merge base has to be computed. config/scripts/git-pull-request-diff-base.mjs resolved that for the two Node gates; the workflow's inline gates now use the same helper through a small CLI rather than open-coding it. code_paths gates all 22 jobs, so its checkout is charged to the start of every one of them: measured 20.7s to 1.6s, keeping blob:none because its sparse tree is ~7 files and leaves no blobs to refetch. Static analysis drops the filter instead, since populating all 30,226 files makes blob:none force a second promisor fetch: 23s to ~11s. Verified on a real merge ref. At depth 50 the old and new forms produce identical changed-file sets. At depth 2 the new form still works and the old one fails with `fatal: bad object`, which is the failure a stale base would have caused once the checkout stopped being complete. Also drops the dead resolveBase + merge-base prelude in the changed-code gate, whose result resolvePullRequestDiffBase already discarded on every PR. * feat(mobile): the keyboard covers the page like a native screen, and the shell says its height (#23110) The shell no longer shortens the WebView for the keyboard; it publishes the keyboard height like the safe-area insets, so native's keyboard lift, refit hold and dismiss key run on the page unchanged. Keyboard and inset arithmetic read the shell's OS through a host-os seam. One page-version floor (manifest pageVersion, shell floor 1) replaces per-feature accept negotiation; a page below the floor gets the existing update wall, a desktop with no bundle keeps native screens. iOS shell drops the form accessory bar and its own keyboard observers. Native session screens untouched. * fix(agent-session): wait for in-flight session-store writes before teardown returns (#23545) * fix(agent-session): stop lease renewal before the renewal's write lands Clearing the renewal interval only cancelled the next tick. A tick already past its guard still had a whole-file store transaction to commit, and the store's transaction lock re-creates the store directory before it writes, so that commit could land after host teardown had finished releasing everything it touches. `stop()` now resolves once the tick in flight has finished writing, and host teardown's stop-lease-renewal phase waits for it. The three test harnesses that model a host vanishing without a clean quit shared a copy of the same incomplete shutdown; they now share one helper that waits. The symptom was a CI flake: the refusal-oracle spec removes its temp directory in `afterEach`, and a renewal landing mid-removal put the store directory back, so the removal failed with ENOTEMPTY on the temp root. * fix(agent-session): wait for the delivery loop's restart when abandoning a host The abandon helper disposed the delivery loop and moved on. Disposing only stops the loop's NEXT step: a step already past that check keeps going, and the restart it runs for an accepted send reserves an owner, which is a store commit. The store re-creates its own directory before every commit, so that commit put the directory back under the temp-directory removal the test does next, and the removal failed with ENOTEMPTY. Quit already waits for exactly this work, in its drain-attaches phase — every attach is registered with the task queue from enqueue. The helper now runs the same drain, in quit's order, so it waits for both producers that reach the store after the last awaited call returns. Adds a regression test that holds the loop's restart inside its provider acquisition and asserts abandoning does not return until it lands. * chore: re-trigger PR checks The push to 2ecc9c6e emitted no pull_request event, so the matrix never ran. * fix(sidebar): clip worktree card content to its border (#23566) * fix(runtime): answer terminal.subscribe at once for a pane the desktop already has mounted (#23512) * fix(runtime): answer terminal.subscribe at once for a pane the desktop already has mounted A mobile subscribe to a PTY with no headless model asked the renderer to mount its tab and waited for a newer serializer settle. The renderer drops mount requests for tabs it already has mounted, so a reattached daemon PTY whose restored provider snapshot outranked the live renderer held the reply for the full 3 s deadline. A live renderer screen now proves attachment and is adopted directly; an unmounted pane still requests the mount and waits. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(runtime): treat any renderer answer, even a blank screen, as an attached pane A fresh shell that has printed nothing has a registered serializer and an empty screen; requiring non-empty data sent it back through the dropped mount request and the 3 s wait. A blank screen skips the wait but does not replace the chosen snapshot, so a parked pane cannot erase provider history. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(runtime): treat a mounted pane with unsettled output as attached The stable renderer snapshot returned null both when no renderer answered and when output advanced under every retry, so a desktop pane printing continuously still took the dropped mount request and the 3 s wait. It now returns a typed outcome (settled, moving, absent); moving skips the mount and publishes the chosen snapshot, and late recovery still requires settled. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(runtime): adopt only a renderer-ordered screen when probing a mounted pane The attachment probe read the terminal before knowing it would adopt, which can reach the provider snapshot on the unmounted path; the read now follows the decision. A seq-less renderer screen would replay every buffered chunk on top of itself, so the probe keeps the chosen snapshot for it. The probe, adopt and mount wait move into their own module to stay under the line cap. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(runtime): adopt a seq-less renderer screen when no output is pending The seq gate only prevents a double replay of buffered output, so a settled non-blank screen without a seq is safe when nothing is pending. That keeps the better screen for a pane right after a deferred cold restore, before it is renderer-ordered. The rule now applies after the mount wait as well. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(runtime): decide renderer attachment from the host's serializer flag The mounted-pane probe re-derived attachment by serializing the renderer up to six times, which cost ~7.5 s for a registered but unresponsive renderer on a busy PTY. The host already holds that fact in the serializer readiness flag. The flag is never cleared when a pane closes over a live PTY, so one null serializer answer falls back to the mount wait: worst case is the old 3 s plus one 750 ms serialize. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(runtime): let the serializer's answer alone prove renderer attachment serializeRendererTerminalBuffer already answers null when the host's serializer flag is unset, so the separate flag accessor was redundant. The numeric-seq adopt test now replays only the byte past the seam. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * Revert "perf(ci): shard the anti-slop audit across processes instead of one JS runtime (#23543)" (#23575) This reverts commit fae0ae7a464c2991bd25885e7e61689c7f471a0f. * perf(ci): cache pnpm verification records on Linux (#23568) * perf(ci): pilot pnpm verification record caching on Linux * test(ci): review pnpm verification record in mobile cache audit * fix(native-chat): the host writes chat failures for a person, with a typed fact beside them (#23116) * refactor(native-chat): remove the unused terminal handoff No client ever called agentSession.requestHandoff or mounted the handoff chrome. Delete the handoff coordinator, the terminal-owner runtime, the proof write path and the unmounted UI. Keep agentSession.handoffStatus, which released desktop clients read for worktree activation, and let records an older build left mid handoff reconcile through the ordinary restart and recovery paths. * fix(native-chat): never let the pre-stop snapshot hold a chat's stop Eviction now drains delivered events before quit's resume-offer snapshot. An unbounded wait there sits ahead of the provider stop, so a sink whose journal write stalls kept the child running until the step deadline aborted the eviction. The offer is advisory: bound the drain and stop the child regardless. Co-Authored-By: Claude * refactor(native-chat): drop helpers only the terminal handoff called `claudeAuthEnvCarriedForward`, `isPathWithinDirectory` and `queryWindowsProcessRowsFresh` lost their last caller with the handoff. The fresh-scan tests now go through `queryWindowsProcessDescendants({ fresh: true })`, the teardown path that still depends on that contract. Co-Authored-By: Claude * docs(native-chat): stop citing the removed handoff in lifecycle comments Six comments still named the handoff coordinator, a handoff suspend, or a terminal-owned session as live participants in the flows they describe. Co-Authored-By: Claude * test(native-chat): type the stalled snapshot drain without a cast Co-Authored-By: Claude * test(native-chat): pin that a start dead before proving owes no settlement The removed restart handoff test pinned this branch; nothing else did. Co-Authored-By: Claude * fix(native-chat): keep the owner-status read behind an in-flight attach The handoff removal dropped the per-session queue from `handoffStatus`, so a read landing mid-start reported the reservation (no owner) instead of the settled chat owner, and shipped desktop clients blocked worktree activation on it. The read is queued again, as it was before the removal. Co-Authored-By: Claude * refactor(terminal): remove the agent-session PTY write gate The gate only refused a write when a PTY had been bound to a chat session, and the only code that ever bound one was the terminal handoff this branch removes. With it gone, every admit/readmit returned "admitted" unconditionally, so the checks on the renderer write path, the runtime controller backstop, terminal.send, agent prompts, preview input and orchestration pointers, the refusal fields on terminal.send and worker-start receipts, the plugin and CLI refusal copy, and the adopted-pane orchestration routing could no longer run. Ordinary writes take the same path in the same order as before. Co-Authored-By: Claude * refactor(native-chat): drop the transcript helpers only the handoff called appendLegacyTranscriptMessages fed the terminal transcript catch-up and proveClaudeTranscriptBranch backed the terminal owner's exit proof. Both lost their last caller with the handoff. Their tests now go through the live entry points instead: the roster bounds through the legacy import, the pinned-read and growth tests through the ancestry replay the history window uses, and the marker rules through the string proof in their own file rather than the session-file resolver's. Co-Authored-By: Claude * fix(native-chat): stop calling a starting chat "mid-handoff" A send refused because the chat's owner is not settled showed "The session is mid-handoff ()." in the composer. With the handoff gone, the stages that reach it are a chat that is still starting, or one whose previous agent process has not yet been confirmed stopped. The message now says which of the two it is. The refusal code is unchanged. Co-Authored-By: Claude * test(native-chat): type the stand-in roster decoder without a cast Co-Authored-By: Claude * refactor(codex): name the pinned rollout lookup for what it does With the terminal handoff gone, the module named codex-tui-rollout-proof holds only the pinned rollout lookup that structured Codex launches use to resume a thread, so the name described code that no longer exists. Rename the module and its options type. Also drop a mobile allowlist assertion that pinned the removed agentSession.requestHandoff method, which no longer exists to allow. * refactor(native-chat): type the owner-status reply as the host sends it The handoffStatus reply type still listed the terminal handoff's fields and states (terminal placement, host label, proof retry, queued and waiting phases, the to-terminal direction). No host writes them any more and the only client reader parses the reply as unknown, so they described nothing. The reply on the wire is unchanged. * refactor(native-chat): normalize terminal-handoff lease values once at decode Nothing in this build writes a terminal owner (`runtimeKind: 'tui'`) or the handoff's `preparing` / `old-owner-stopped` stages, but the in-memory types still admitted them, so readers across the host kept branches for values no path produces and the compiler could not point at them. The store now validates the on-disk shape, which still accepts those values so an older record is not quarantined, and maps them once while parsing: - `preparing` and `old-owner-stopped` become `recovering` - a `tui` lease becomes `native`; when it records a process it also becomes `conflicted`, the claim every build probes but never stops. A plain native owner would be stopped by restart recovery, here and in older builds. Revisions are taken over the normalized state on both sides of every compare, and the mapped record reaches disk with the store's first transaction, the same way the tab-id backfill does. The in-memory types narrow to what this build writes, and the branches that existed only for the removed values go. Structured-worker identity keeps its verdict for a former terminal owner by refusing a conflicted claim rather than a non-native kind. * refactor(native-chat): stop threading the owner kind through a reservation A reservation only ever names a native owner now, so the request no longer carries a kind and the reserved lease records `native` directly. The attach params keep `runtimeKind`: agentSession.ensure and create accept it, and the operation fingerprint stored in the ledger covers it. * test(native-chat): pin the legacy-lease rewrite with a transaction that changes nothing else Hiding a tab also committed the visibility index, so the no-op transaction wrote the file even when its open-time revision was wrong. Committing the index first leaves the pending rewrite as the only reason to write. * fix(native-chat): name a chat write by its target, not the owner generation A write carried the fence of the last frame the pane read, and the host refused it unless that fence was still current. An idle release and the restart after it each move the fence, and the release publishes nothing, so a send after a release was refused "Expected runtime fence 1; the session is at 3", and a Stop queued behind a cold start was refused as stale. Every write already names what it acts on: a send its conversation, a cancel its turn, a prompt answer its item revision, a rewind its epoch; an option is last-writer-wins. So admission stops comparing the client's fence, and the rebase that papered over one restart (admitAtResumedFence, resumedFromFence) goes with it. The writer-lease check stays, and so does the attach's compare-and-swap. Frames now stamp the fence read when each frame is sent instead of a copy each subscriber kept, which went stale on the same release. * fix(native-chat): every journal append reaches the chats that are open A journal write and its delivery to open readers were two calls, and some writers made only the first. A failed start whose lease could not be handed back, a provider revision with no frame behind it, and eviction's settlement were all journaled without reaching an open chat. A journal handle now reports every durable change, and the host's session map binds that report to the session's readers when the handle is set. Writers no longer publish what they append; the per-writer publish calls are deleted. * test(native-chat): an epoch replacement reaches the open chat * test(native-chat): each row reaches an open chat once, and a live handle enters only through the map * test(native-chat): give the legacy-lease store test a tab id so the backfill cannot supply its rewrite The seeded record had no surface tab id, so the next open backfilled one and that rewrite alone made the no-op transaction write. The test passed with the legacy-lease rewrite signal removed. * test(worktree-activation): restore the OMP surfaced-agent resume test The handoff removal deleted it alongside the terminal-owner tests, but it covers the surfaced-PTY block that still guards resume, including an agent whose ownership is unknown. * perf(native-chat): a publish behind a delivered commit reads nothing Each commit now delivers itself, so the publish a provider frame still sends afterwards found every reader caught up but still read rows and rebuilt the timeline for each one. A caught-up reader now skips the read. * test(native-chat): state why the teardown test's fake journal is safe to cast * docs(native-chat): say mutation admission checks only the writer lease * docs(native-chat): drop the send rebase from comments that still described it * fix(native-chat): a message is accepted, then delivered A send to a chat with no running agent restarted the agent inside the send call, before the message was recorded, so the client waited for the whole start and a failed restart refused the message. Claude held prompts sent during startup, and those could settle as "unconfirmed". A send is now accepted inside the session's serialized queue: one ledger row and one submission row marked handoverRecorded, published, answered pending. A per-session delivery loop exists while a message is queued. It starts the agent through the same serialized attach a hold uses, waits outside the queue for a Claude child to prove its start, and hands the oldest queued message over as its own serialized step, writing dispatch{pending} before the adapter call. A start it needed and did not get writes one error-tone row and rejects every queued message with the same words; a start Stop cancelled writes none. Settlement follows from the rows. A queued message is provably unwritten, so a close, an eviction or an exit rejects it. A handed-over message stays in doubt. A queued row at or below the sequence a handle found when it opened was left by an earlier process and is rejected at open, with no latch. Stop withdraws queued messages with no writer lease and no fence. An attach failure keeps the conversation open, and the attach adopts its journal. Owed work counts the loop and queued rows. A compaction or rewind found prepared when a conversation opens was started under a child this process no longer has, so the open settles it rather than leaving it to refuse every send until a view attaches. The open cursor is scoped to its epoch, because sequences restart when an epoch is replaced. Deleted: restart-before-admission, recordFailedRestart, the fence rebase, Claude's startup gate, the attach's forget on failure and its own crash boundary. Clients without agent-session.accepted-send.v1 get their reply held until the handover; the desktop and paired desktop lists advertise it. * fix(native-chat): settle queued messages only for the child that ended A child that proved its start and then exited before its message was handed over left the message queued: the exit settlement returned early when nothing else was in flight. Delivery then started another child for it, and a child that died the same way started another, without end and without a row. A retried settlement for an earlier generation, run by the attach that delivery started, did the opposite: with that generation's turn unfinished it rejected the message queued for the child being attached. The settlement now takes the rejection for queued messages from its caller. The unexpected exit and the eviction pass one, and it applies even with no other work in flight; the retry for an earlier generation passes none. * fix(native-chat): an adoption that fails to import keeps the conversation open The attach now writes into the conversation's own open journal, but a failed transcript import still closed it as if it were the attach's provisional one. The conversation stayed indexed with a closed journal, so every later send answered "could not be recorded" and every attach failed again until the app restarted. The import now closes only a journal the attach opened for itself. * perf(native-chat): the recovering open reads the journal once Every conversation open now goes through the recovering open, including the read restore of every chat at startup, which used to replay its journal once. The recovering open replayed it twice: once to probe it and again inside the open. The probe is now handed to the open as its load. * fix(native-chat): an attach that fails after indexing its child leaves no child behind A failed attach now keeps the conversation open, but a failure after `onAttached` indexed the child (the rewind or compaction recovery, or the attach's own success record) left that entry claiming a child the failure path had already released. The next send found the phantom, skipped the start, and wrote at a fence the journal had moved past, so the message stayed queued for good. The entry now drops the released child and its event sink, and follows the record's fence, as a failure before indexing already did. * fix(native-chat): a withdrawn message shows no error, and a rejection outlasts the send's answer The error strip for a message the host accepted and then did not deliver matched the entry before the outbox reconciled, so a Stop's withdrawal, which the reconcile drops, showed "Orca could not send your message" with nothing to retry. It now reads the reconciled entry. A rejection the journal records before the send's own pending answer lands is final as well: that answer no longer puts the entry back to dispatching with no Retry. * fix(orchestration): a structured worker whose agent outlasts the preamble wait is left unknown, not torn down The preamble waits for its submission to be delivered while the worker's agent starts. When that wait ran out it threw operation_unknown, and the failed-start teardown then closed the session, which rejected the very preamble the host was about to deliver. It now reports a turn start nobody observed yet: the worker is start-unknown with its session kept, the host delivers the preamble when the agent starts, and the worker's report settles the dispatch as for any unobserved start. The receipt no longer suggests reading a screen a structured worker lacks. * fix(native-chat): a message rejected while its chat was closed reads as not sent A remount reads an entry it left dispatching as unconfirmed. When the journal had rejected it meanwhile, as a failed start or a quit now does, the reconcile left it unconfirmed: it blocked every later message behind a Retry and no reason, and the delivery probe, seeing the journal already answered, never ran. The reconcile now settles it as rejected like a dispatching one. * test(orchestration): name why the readiness settlement fakes are cast * fix(native-chat): keep each pane's own fence on frames so a failed restart is not resent * docs(native-chat): drop the fence from the admission the send effects run behind * docs(native-chat): give the fence move on release the reason that still holds * docs(native-chat): stop citing a write fence check in launch and mailbox comments Three places still gave the removed fence check as a reason: the launch replay said admission puts the ledger ahead of the fence, the launch surface said a send must name the lease it was admitted against, and the direct-mailbox path said the lease fence decides whether delivery is safe. Admission now checks only the writer lease. * refactor(native-chat): the provider child is its own record A conversation now outlives any number of provider children, so the child is one record on the conversation's entry instead of five loose fields beside its journal. It is written in one place: indexed only once an attach has fully succeeded, and ended through one function that an exit, a failed re-attach, a Stop and an eviction all share, matched on the child's generation and fence. - A failed attach writes no child, so there is nothing to unwind: the field unwind and the fence patch after it are gone. - Conversation writes read the record's fence, the way mutation admission already does; a child's own writes use its fence. The four stored-fence patches, and the settlement retry's overwrite of the conversation's fence, are gone. - The owed wind-down is its own tombstone, carrying the child it is owed for, and is no longer dropped when an attach replaced the whole entry. - Stop on a child still proving its start stops only the child: its lease goes back and the chat is told it is idle, but the journal, the holders and the readers stay. Close is that stop plus the conversation's close. - The settlement retry uses the conversation's own journal, opened through the host's one open. * fix(native-chat): the delivery loop alone settles a message its start or child failed A queued message was settled by whichever path happened to end the child first: the loop, the unexpected exit, eviction's work settlement, the open's leftover rule, and the startup branch that rejected every pending row. That gave two failure rows with different tones for one start, a loop that could hand over to a different child than the one it waited on, and a Claude start that died while starting reading unlike every other failed start. - The loop remembers the child it waited on. At handover, if that child is gone or replaced, it reads how it ended: a Stop continues; anything else writes one failure row and rejects every queued message with the same words, then stops. A child still starting whose start the adapter says did not land fails the same way. The exit, eviction and the settlement retry only settle the handed-over and legacy rows of the child that ended. - One failure row, always an error, keyed by the start. A start a view began that dies with nothing queued writes the same row through the same builder, so a second report revises it. - The open no longer rejects leftovers; the loop's first step does, and the open wakes it. - `awaitStarted` answers why a start did not land, so the row says it even when the loop sees the failure before the exit is processed. - Quit closes every conversation the way closing a chat does: what is still queued is rejected as closed, with or without a child, and a start the loop already has in flight is waited for so the child it produces is stopped rather than left behind. * refactor(native-chat): a stopped child ends on the one reading of its stop The eviction step reads a stop's result through `stopAgentSessionProviderRoot` and hands that verdict to the child's ending, so the host never forms a second view of whether the root is gone. Every ending carries it: a stop's comes from that reading, an exit's root is gone by definition, and a failed re-attach passes what its release saw. The end-of-child record can therefore also carry a stop whose root was not seen to go, which nothing ends on yet. * feat(native-chat): the host says it accepts a send before any agent has it The host now lists agent-session.accepted-send.v1 among its own runtime capabilities, the same string capable clients already send. A client can then tell a host that answers a send at acceptance, and admits a Stop with no writer before a turn starts, from an older one that still restarts the agent inside the send. Additive: an older client ignores a capability it does not know. * refactor(native-chat): an attach never opens a journal of its own The attach adopts the conversation's open journal, which outlives it, so it no longer opens one for a direct caller either. That leaves nothing for a failed adopted import to close, and the flag that told the two cases apart is gone. Tests that attach without a host open the conversation the way a host does. * fix(native-chat): a moved fence resends nothing on a host that accepts first The outbox treated any fence change as a new owner: it dropped the answer of a send in flight, queued that send to go out again under the same id, and unblocked a refused head. On an older host that is how a send the restart refused, unrecorded, gets another try. On a host that records every send before it starts an agent, a fence moves because that start ran, so the same rule resent into every failed start. With a fence stamped on every frame, that became a loop. The outbox now reacts to a fence change only when the host has not advertised that it accepts a send before any agent has it. On such a host, only a Retry or a new send goes out, and a failed start reaches the client as a rejected message it keeps with its Retry. Against an older host, or before one has answered, the outbox behaves as it did. Desktop and paired web share this hook. * refactor(native-chat): a child's end says whether the user or the host stopped it The end-of-child record's cause now tells a user's Stop from the host stopping the child for a cause of its own: `user-stop` and `host-stop` replace `stop`. The delivery loop goes on after a user's Stop, as before, and fails the start it was waiting on after a host stop, with the one error row and every queued message rejected, in the stop's reason when it gave one. The reason stays description only. Stop passes `user-stop`; nothing passes `host-stop` yet. * fix(native-chat): a chat whose only work is a queued message is not offered for resume A message accepted while the agent was starting counts as working in the chat, and quit rejects it as never sent. The teardown snapshot read the same working rule, so a relaunch offered to resume a chat whose agent never had the message. The snapshot now reads only what was handed over. * test(native-chat): type the queued-message fixtures in the resume-offer tests * fix(native-chat): a start that dies while a message waits on it is that message's failed start Opening a chat's tab starts an agent for the view, and a send accepted meanwhile waits on it. When that start died, its exit wrote the start's error row and left the message queued, so the delivery loop started a second agent into the same failure and wrote a second row. A child's end now records where the conversation's journal stood, and the loop settles a message accepted before a failed start ended with that start: one row, under its key, and no second start. A message sent after the failure still gets a fresh start. * docs(native-chat): say what an attach's open conversation and unconfirmed ids are now * test(native-chat): pin what a failed start settles, and what a resume offer names A view's child that dies while a sent message waits settles that message only when it died starting and no child has taken its place: a proven child's crash, or a second start since, gets the message delivered. The resume offer names the handed-over message, never a newer one still queued. * test(native-chat): the failed-start pins fail on what the message became, not on a timeout * test(orchestration): the preamble's host stub is typed, not cast The preamble send now takes only what it reads of the host, the send, the settlement wait and the record's fence, so its test builds that host with real types instead of `as never`. * feat(native-chat): a typed failure fact beside every failure sentence Adds the shared vocabulary the host writes a failure with: a closed failure kind, a provider diagnostic that says who it is for (a person, or a log), and a refusal cause beside the refusal code. Status rows gain an optional failure fact and rejected submissions an optional rejection fact; the dispatch row carries it, the reducer reads it field by field, and the projection forwards it. Older rows and older readers are untouched: every field is optional and the schemas stay open. * fix(native-chat): durable failure rows and rejection reasons are written for a person Every host writer that records a failure now writes a sentence for a person beside a typed fact, instead of embedding a refusal's message, an exception or a composed exit string. A provider's own words travel as a separate diagnostic from the places Orca composes them - the Claude and Codex exit stderr (a log), Codex's JSON-RPC message, Claude's compact_error and Codex's turn error (for a person) - and are never inferred from a string afterwards. Not signed in and oversized history are typed at the adapter that detects them. Covers start and restart failures, the delivery loop, dispatch rejections (content, queue-full, write failures, provider refusals), cancel and answer confirmation rows, compaction, the rewind fallback, and not_delivered, which released clients printed as it was. Two leaks close on the way: a settlement retry no longer writes Orca's probe evidence into the exit row, and an attach or journal-sink failure is recorded as Orca's fault rather than as the provider stopping. The legacy rejection markers and the reasons on sends in doubt stay byte-identical. * feat(native-chat): refusals name their cause, and a failed start is worded in one place A refusal now carries an optional cause beside its code: one closed enum of the situations a chat write can meet, set at every emitter a structured-chat write reaches. Returned refusals build it with refuse(code, cause, message). Store and host paths that raised a bare Error(code) now throw AgentSessionRefusalError, whose message is still the code and which has no code property; the RPC error mapper handles it before any other passthrough, keeps today's wire code and message byte-identical, and adds { refusal: { code, cause } } to the error's data. The hold throws it, and restart-resume files the cause beside the unchanged reason. The operation ledger stores the cause beside the code, so a replay names the same situation as the first answer. The store fallback copy picks its words and cause by situation, so a stale replay or a moved lease no longer reads as a latched owner. Every failed start is worded by structuredAgentSessionStartFailure(cause, context), which returns the row sentence and the typed fact together; the delivery loop, the exit settlement and the dispatch that met a starting child all call it. Provider diagnostics are capped at the lease record's 512 characters wherever a fact is built. * refactor(native-chat): one reader of why a submission was rejected classifyDispatchRejection(submission) returns { category, verdict, kind? }. It reads the typed rejection fact when the row carries one this build can place, and the legacy markers otherwise - all six, including not_delivered, which released clients printed as it was. The verdict is null only for a withdrawal, a host restart and a closed chat; write failures, a full queue and not-delivered stay failures. It replaces dispatchRejectionReasonIsInternal and every string comparison against the markers: the outbox reconcile, the rejection notice, and the send disposition, where a replayed Stop-withdrawn send no longer surfaces as a failed send. The journal reducer's echo-aliasing guard reads the narrow isWriteFailureSubmission, which matches the typed kind or the legacy prefix in any dispatch state, so its behaviour on legacy unknown rows is unchanged. * test(native-chat): pin provider diagnostics where they are composed The Claude exit status and stderr, the Codex stderr tail and Codex's JSON-RPC message are each checked at the place Orca composes its own error around them, so the typed detail is proven to come from the provider's value and never from Orca's wording. * fix(native-chat): an attachment Orca refuses says which limit it broke The content check's refusals (20 images, 5 MB per image, 20 MB in total, supported types) are written for a person, but the rejection writer replaced them all with one generic sentence. Each refusal now carries its own sentence, in MB rather than bytes, and the writer records it beside kind attachmentInvalid. Only an attachment that could not be read keeps the generic sentence. * fix(native-chat): the chat tab table refuses with a typed cause Showing a chat tab refused with bare Error('agent_session_conflict') and Error('agent_session_identity_required'), the only chat-reachable refusals still thrown without a cause (opening a chat from history can reach the second when the chat is removed mid-open). Both now throw the typed refusal; wire code and message are unchanged. * fix(native-chat): a compaction Codex refuses up front keeps Codex's words When Codex refused thread/compact/start, the adapter passed on only Orca's wrapped error text and dropped Codex's own message, so the chat's row read just "Compaction failed." The refusal now carries Codex's message as the failure detail, as a compaction that fails later already did. * fix(native-chat): an unreadable chat record no longer promises an update fixes it The recordUnreadable copy said a newer Orca saved the chat, but the store marks a record unreadable for damage and key mismatches too, where updating does nothing. The sentence now says Orca can't read it and gives both next steps. * fix(native-chat): a restart or a close leaves released clients a sentence, not a marker host_restarted_before_delivery and provider_closed_before_delivery are not in the markers released desktop and mobile builds hide, so they printed raw on every rejected message a restart or a chat close left. Neither marker has shipped. New rows carry a sentence plus kind hostRestarted or chatClosed, as not_delivered already did; the classifier still reads both markers, and the verdict for both stays no-failure. * fix(native-chat): log why an attachment could not be read The rejected message now says only that the attachment couldn't be read, so the error that said why (a missing file, a permission, or an unexpected throw) went nowhere. It is logged instead. The content rejection moves beside the content check that owns its errors. * refactor(native-chat): drop an unused thrown-refusal cause reader It had no callers, and its comment claimed it looked through wrappers, which it did not. * fix(native-chat): a compaction the provider never confirmed is recorded as unconfirmed, not failed * fix(native-chat): an empty or non-user message is not recorded as a bad attachment * fix(native-chat): an undelivered preamble's error ends in one period * refactor(native-chat): a compaction ends as compacted, failed, or unconfirmed, never an unlabelled error * refactor(native-chat): a failure's sentence is written only from its fact A writer could choose its sentence and its kind separately, so five writers put hand-written words beside a fact that said something else. One shared constructor, agentSessionFailureWords(fact, { surface, agentName }), now makes both, and the journal types refuse anything else: a status row, a rejected message or a conversation command that carries a fact must carry the sentence that constructor branded. Persisted rows keep their shape. - The sentence table and the restart table move to src/shared, as the English default a client copy table can reuse. - A rejection's legacy markers come from the same constructor. A write failure is now the bare `provider_write_failed` marker, which released clients already hide; its error goes to the log. - An image Orca refuses carries which check it failed (and the limit) in the fact instead of a sentence; an empty message gets its own kind, and a non-user message is Orca's fault. - The exit row, the interrupted compaction, the /clear failure and the rewind placeholder no longer carry their own words beside a fact: the exit row says what its fact says, and the placeholder carries no fact. * fix(native-chat): a start that failed without an observed exit no longer blames the provider Every untyped start error was recorded as "The provider stopped before it finished starting.", so an Orca fault, a failed spawn or a close that ended a start was blamed on the provider. Only an exit the adapter observed says so now: the Claude adapter marks the error it saw the child exit with, and anything else is a new `startFailed` kind, " couldn't start.", keeping the provider's diagnostic when the error carried one. A child gone with no end observed, and a /clear whose new conversation was refused, read the same way. * fix(native-chat): a view never restarts a chat whose last start failed A Claude chat whose CLI exits during startup left one red row per start, and every time a view bound to it (the chat opening right after its create died, or the user switching back to it) the hold started the CLI again, so the same launch-failure row repeated. Only a send retries a failed start now, the same rule provider-exit recovery already applied; the rule lives in one predicate the hold, exit recovery and the delivery loop share. * fix(native-chat): a chat a terminal agent still holds says to quit that agent The merged base words a restart a terminal agent's claim refused with the refusal's own message, which names the process. That message is Orca's text and never reaches a durable row here, so the row read only " couldn't restart." and lost the one step that frees the chat. The restart sentence now derives it from the refusal's cause: a claimConflicted refusal adds "This chat is still open in a terminal agent. Quit that agent to continue the chat here." The live refusal still names the process. The restart-resume ledger test now sets up a claim the base still refuses: a terminal owner that is proven running. * refactor(native-chat): keep the changed files inside their lint limits The legacy-marker lookup is a table, not a non-exhaustive switch; the preamble tests read the error without a cast; and the Codex history refusal goes through a named constructor so its file stays under the line limit. * test(native-chat): start the child the loop waits on with an attach, not a second view A view no longer starts a child whose last start failed, so the R2 case that waits on a child started since the failure now gets that child from a client attach, the one non-send starter left. * fix(native-chat): settle a gone generation's turn wherever a conversation opens A send that opens a chat this process had not read yet (after a crash, from a phone or the CLI) went through the delivery open, which never settled what the dead generation left running; only the read restore and a successful acquire did. When the send's start then failed, the turn stayed running for every reader. The settlement now runs in the one journal open, at the crash boundary, for every opener except an acquisition, which settles from the evidence it read before its reserve; the read restore's separate step is gone. * test(native-chat): prove the next child's start settles the turn an earlier child left The R1 case lost its only settlement assertion when the latch it checked was deleted. It now seeds the running turn the earlier child left and asserts it ends at the exit's receipt, with the exit's row, before the message is handed to the new child. * test(native-chat): count a failed start's rows by row, not by text Comparing the set of texts passed when two different rows carried the same words, which is the duplicate the test exists to catch. * test(native-chat): give the failed-start and stale-turn waits a loaded runner's budget * refactor(native-chat): refusals carry details keyed by their code A refusal named its situation with one flat cause list shared by every code, so nothing stopped a site pairing a code with a situation that code never means, and the loose fields released clients read (fence, revision, resolution, verdict, rewind reason) were written by hand at each emitter. A refusal is now one variant per code with optional details: a reason that code lists plus that code's own facts. refuse(code, details, message) rejects a reason the code does not list at compile time, and it is the one place the loose top-level fields are copied from details, so released clients read exactly what they read before. A site that cannot name its situation uses refuseUnclassified, which carries facts but no reason, the same as an older host; there is no catch-all reason. Thrown refusals put { refusal: { code, details } } in the RPC error's data (wire code and message unchanged). The operation ledger, the restart-resume record and a restart failure's embedded refusal keep details beside the code and read them back against it; a row an unreleased build wrote with a cause parses and reads as naming none. * test(native-chat): pin the open's and the send's start and row counts, however the view binds Opening a fresh chat whose starts fail makes one start and one row, with two views bound before or after the create's child died; one send makes one more of each. * test(native-chat): a restart-resume failure keeps its refusal details The recovery capsule reads a failure's details back against the refusal code in its reason: facts the code does not list and a reason another code owns are dropped, and a record an unreleased build wrote with a cause still parses, naming nothing. * test(native-chat): import the failure words once in the provider child test The merge left two imports of the same modules. * fix(native-chat): settle a gone generation's turn at every open but an acquisition's The journal open skipped the settlement whenever the lease read reserved or live, to leave an acquisition's own open to the acquisition. But a lease a crashed process left in recovery also reads live, until the next acquire resolves it. A send that opened such a chat, from a phone or the CLI after a crash on a host that could not prove the old owner gone, skipped the settlement; when its start then failed, the dead turn stayed running for every reader. The acquisition now says it is the opener, and every other open settles, whatever the lease still claims. * test(native-chat): hold the create's start open until the views bind The "view binds while the create is still starting" case gave the create a 300 ms head start and asserted the views bound before it died. On a loaded runner the holds took longer, the create's exit landed first, and the case failed its own precondition. The create's initialize now waits on a gate the test releases once the views are bound. * fix(native-chat): a start the provider refused or Orca broke no longer says the provider stopped A failed start whose cleanup proved the child gone was typed as `providerStartFailed` whatever failed it: Codex refusing to resume a thread, a timeout, or Orca's own store fault. The chat then read "The provider stopped before it finished starting.", which was untrue, and the provider's own words were dropped. A refused restart also inferred the same from an `exited` verdict, which only says nothing runs now. Only an exit the adapter observed names that situation now; anything else is refused with no reason, keeping its verdict, and the chat reads " couldn't restart.". The provider's words travel host-side from where the acquisition failed into the start-failure fact's detail, never onto the refusal, and the sentence does not quote them. What failed is logged once where the start failed. * fix(native-chat): a refused /clear start keeps the situation it named The replacement start that /clear makes built its own start-failure fact, so a refusal that named its situation, such as not being signed in or a history too large to restore, was recorded as a bare "couldn't start". It now takes its fact from the same start-failure function as every other start, as a new session that failed to start. * fix(native-chat): the journal schema and comments describe a refusal's details, not its cause The persisted failure fact's schema still described `refusal.cause`, which this branch replaced with `details`. It now describes `details` as an optional open object; a row an earlier build wrote with a `cause` still parses. A comment and three test descriptions that still named the cause now name the details. * fix(native-chat): a Claude child that exits while being acquired still reads as the provider stopping Now that only an exit the adapter observed says the provider stopped, the exit the Claude adapter saw during acquisition has to be marked where it is seen, as the exit after acquisition already is. Without the mark, a Claude CLI that exited at spawn read "Claude couldn't restart." instead of "The provider stopped before it finished starting." * fix(native-chat): word a failed chat start's refusal as its start failure A chat whose agent failed to start answered the create with the raw error: the launch strip read "Chat could not be started. claude stream-json exited (code 1): claude: not signed in", and the ledger replayed the same text. The first answer and the replay now carry the sentence the chat's start-failure row reads as ("The provider stopped before it finished starting.", "Claude couldn't start.", the not-signed-in and history-too-large sentences), and the raw error goes to the log. A store refusal's code and the unproven-exit marker are unchanged. * fix(native-chat): show Claude's API retries as one sentence row While Claude retried a refused request (a 429, say), the chat gained one red row per attempt reading "rate_limit", with the raw retry frame behind Details. Each retry run now writes one warning row that later attempts revise in place: "Claude is rate-limited and retrying." for a rate limit (error `rate_limit` or status 429), and "Claude hit a temporary problem and is retrying." otherwise. The row carries a `providerRetrying` fact with the provider's error type and status, and the frame as a log detail capped at 512 characters. * fix(native-chat): tell the user to run /clear again when its new conversation can't start When /clear's replacement conversation failed to start, the result told the user to "send your message again", which would go into the old conversation. The failure words now take the command the start was for, so a failed /clear reads "Codex is not signed in for the selected account. Sign in, then run /clear again.", "Codex couldn't start. Run /clear again." or "The provider stopped before it finished starting. Run /clear again." A message send keeps its wording. * test(native-chat): expect a failed Claude create to be refused in a sentence The runtime suites asserted the CLI's stderr reached the create refusal; it now goes to the log and the refusal reads as the chat's start failure. * fix(native-chat): name the agent that stopped starting and say how to retry a failed start A start the provider ended now reads "Claude stopped before it finished starting." (or "The agent ..." when the chat's agent is unknown) instead of naming "the provider". A start or restart that failed with a chat left to retry now ends in "Send your message to try again.", or "Run /clear again." for /clear; released clients print only this sentence. A message rejected at dispatch because its child died while starting names the same agent as the start's row. * refactor(native-chat): drop the composer's second error formatter After the merge with main, every chat write in the composer path reports its failure as a typed outcome worded by the refusal-notice table, so the send's catch sees only a local throw. The {code, message} formatter this branch added for it has no payload left to format, and its claim to be the one way a chat words a failure is no longer true. The composer send is main's again. * test(native-chat): pin the reason on a message rejected while its chat was closed The reopen test checked only that the message reads as not sent; it now also checks the Retry row carries the host's reason. * fix(native-chat): answer a create refused before spawn in the words its replay reads A create that failed before any process started threw Orca's own error text as its first answer, while its replay from the operation ledger read the generic start sentence. The two refusals a person can act on, a launch whose Anthropic sign-in variables override the managed Claude account and a Claude account switch in progress, are now typed where they are thrown and worded by the shared failure constructor, so the first answer and the replay say the same thing. Every other pre-spawn failure reads the generic start sentence, with its own text in the log. The first answer keeps its wire code; a message that is itself a code is unchanged. * fix(native-chat): say how to retry after an agent stopped before it finished starting " stopped before it finished starting." gave no next step outside /clear, unlike every other failed start. It now ends "Send your message to try again.", the same step a start or restart that could not run gives; after /clear it still says "Run /clear again." * fix(native-chat): say how to reach a Claude chat when a WSL Claude account blocks it A Claude chat that restarts while a Claude account is added in WSL and no Windows Claude account is selected was refused before spawn with Orca's own text as its first answer, and the generic start sentence on replay. The refusal is now typed where the account gate throws, and both answers read the same sentence: choose or add a Windows Claude account in Claude Accounts settings, then send the message again. Account settings that cannot be read name no situation and keep the generic sentence. * fix(native-chat): say the reason a host names for a refused chat write A refused Stop, answer, setting, goal, command or queued message now reads the refusal's reason as well as its code. A code stands for several situations, so the code alone could only say what did not happen; with the reason, the notice says why and, where the person has a step to take, what it is: "The agent is still responding. The command didn't run. Wait for the agent to finish responding, or stop it." The phone uses the same words. The notice table keys on code, then reason, then the kind of write. Every reason of every code has an entry, so a reason the host adds does not compile until it has words; a reason whose honest words are its code's keeps the code's row. A refusal with no reason, or one this build does not know, reads exactly as before, which is what an older host gets. A start that failed reuses the failure row's own sentence rather than a second one. A queued message keeps the reason, the rewind reason and the owner's verdict with its saved failure, and a rejected one keeps the host's typed fact without its provider detail. Nothing that moves with the owner or comes from the provider is saved; entries saved before this load as they were. The saved failure moves to its own module beside the words chosen from it. * fix(native-chat): retry a refused send under a new id only once its agent is proven gone A send refused because Orca could not tell who owns the chat keeps its operation id, since the first attempt may still land. When the refusal also says the agent process has exited, nothing can run that attempt, so the message moves to its Retry row under a new id instead of holding the queue. The owner's verdict is read as a floor: a saved `exited` is final, and any other saved verdict never changes the id on its own. Only a verdict re-derived from the current lease can raise it to `exited`, and nothing lowers a saved `exited`. Today no host sends a verdict on a send refusal, so nothing a person sees changes; the rule is in place for the saved verdict a reload reads back. * fix(native-chat): say a /clear that never finished did not finish, instead of that it cleared the chat A send into a chat whose /clear started but never committed was refused as if the conversation had been cleared: "This conversation has been cleared. Your message was not sent. Open the current conversation to continue." The clear never finished, so its new conversation may not exist and there is nothing to open. That refusal now has its own reason and reads "The last /clear didn't finish. Your message was not sent. Start a new chat to continue.", which is the only way on today. Its message for released clients says the same: "The last /clear didn't finish. Start a new chat to continue." Only a committed /clear still says the conversation was cleared. * fix(native-chat): a send the provider never received after a restart has no verdict Restart reconciliation rejects a crash-stranded send the provider's history proves it never received. Nobody failed that send, but the verdict table treated it as a failure. Each rejection kind now has its verdict in one exhaustive table, so a new kind does not compile until its verdict is chosen; no verdict for a withdrawal, a host restart, a chat close, or this lost send. A rejection whose kind this build cannot place, such as one a newer host added, now reads as undelivered with no verdict instead of falling back to the reason beside it: all it proves is that the message did not happen. The host keeps such a fact's kind when it reads the row back, rather than dropping it and letting the reason decide. Only kinds that can be why a message was not sent may reject one, by type: compaction, cancel/answer confirmation and provider-retry kinds stay on status rows. The one dispatch-row builder takes its input from the type that makes a rejected row carry its fact. * fix(native-chat): a send refused after its agent exited keeps its place in the queue When Orca cannot tell who owns a chat but the refusal says the agent process has exited, the next attempt may use a new id, since nothing can run the old one. It no longer marks the message as rejected: nothing recorded it, so it still holds the head of the queue, and later messages wait behind it instead of being sent ahead of it. * fix(native-chat): stop reading a provider's words from an error that contains itself A cleanup that aggregates errors restarted the depth count for each one, so an aggregate error that contains itself recursed until the host ran out of stack. One depth bound now covers both the cause chain and the aggregated errors. * fix(native-chat): say a chat whose history can't be read can't continue, and to start a new one A read of a chat's history is refused with `agent_session_journal_unreadable` only when the chat's journal file is corrupt or not a database, which no retry can change. The notice table had no words for a read at all, so a pane had nothing to show but the raw code. Reading a chat's history is now its own request kind, `read-history`, and that refusal on it reads "This chat's history couldn't be read, so it can't continue here. Start a new chat to continue.", whether the host names the reason or raises the bare code. A write refused under the same code keeps its words, because its cause is any failed open, which can clear. Any other read refusal says only "This chat's history couldn't be loaded." `agentSessionReadHistoryRefusalParts(code, details)` gives a pane those words from a read error. The notice sentences move to their own module so the table stays within its size limit. * fix(native-chat): decide what every way a child ends means for queued messages in one table What a child's end means for the messages queued behind it was an if-chain: a user's Stop was checked in one place, a host stop in another, and every other cause, including one added later, fell through to "the provider exited". It is now one table over every end cause, so a new cause does not compile until someone says whether it fails what is queued and how. A user's Stop still fails nothing, a host stop is still Orca's fault, and an exit, a failed attach or an eviction still carry the failure the end recorded. Nothing a person sees changes. * test(native-chat): a close that stops the child and then fails rejects what is queued by how the child ended When a chat closes, stops its agent, and then fails a later step, the chat stays open with its messages still queued. The delivery loop then rejects them by the way the child ended: an eviction during startup reads as a failed start, otherwise as the provider having stopped, and either counts as a failure. The cases are rows over the end cause, so another way a chat closes is one more row. * test(native-chat): type the refusal a persisted-schema test admits * fix(native-chat): say whether a chat's history is damaged or just couldn't open A write refused because the chat's journal would not open named one reason, `journalUnreadable`, for every failed open, and a read of the history took that same reason as final. So the words depended on what was asked, not on what happened: a busy or permission-denied open could tell a person to start a new chat, and a damaged one could read as something that clears. The host now decides at the refusal which it was. `journalCorrupt` is set only when SQLite itself reports the journal damaged or not a database (SQLITE_CORRUPT or SQLITE_NOTADB, extended codes included, read from the driver's result code and never from message text, through any `cause` chain). Every other failed open is `journalUnavailable`. A corrupt history reads "This chat's history couldn't be read, so it can't continue here. Start a new chat to continue.", with "Your message was not sent." before the step on a send. One that couldn't open reads "Orca couldn't open this chat's history right now. Try again.", likewise on a send. A host that names no reason gets "Orca couldn't read this chat's saved history.", which promises neither, because damage can't be proven from the code alone. The refusal's message, which released clients print for a send, is now that person sentence instead of the open error's own text; the error is logged instead. `journalUnreadable` is replaced outright: no released build wrote it, and a stored one reads as a refusal with no reason. * docs(native-chat): say why a history that couldn't open names its retry step * fix(native-chat): a failed start's row keeps the words its rejected messages carry When the delivery loop settles a failed start before the child's exit is published, it writes the start's error row and rejects every queued message with the adapter's startup answer. The exit settlement then rewrote the same row from the exit event, so the row could say one thing while the rejected messages, which are terminal, said another. The exit now leaves a start's row it finds already written. * fix(native-chat): a Claude start Orca itself failed no longer says Claude stopped Every error that ended a Claude session was marked as an exit the adapter observed, including a start Orca failed while the CLI was still running: a saved option whose restore lost its answer, an init frame naming another session, or a journal write fault. Those read "Claude stopped before it finished starting." although Claude never stopped on its own. The mark now stays where the child's exit is seen (the connection's exit callback), so those starts read "Claude couldn't start." with any diagnostic beside it, and a real exit before the start lands still says Claude stopped. * fix(native-chat): name the agent that stopped, and blame Orca for its own closes A chat that lost its agent mid-response said "The provider stopped…", and a started Claude session that Orca itself closed after a journal fault said the same, as if Claude had exited on its own. The exit row and the rejected-message reason now name the chat's agent ("Claude stopped while this response was in progress…", "Codex stopped before this message was sent."), or "The agent" when the name is unknown; the stale-state settlement now passes the agent name too. After a Claude start has landed, the ended event reports providerExited only when the child's own exit was observed; any other close is Orca's fault and reads as one. * test(native-chat): pin the sidebar verdict to the rejection classifier for every kind and legacy marker * fix(native-chat): blame Orca, not Codex, when Orca closes the Codex child A Codex chat that Orca itself closed (a journal sink that could not take a frame, or a forced close) said "Codex stopped while this response was in progress", as if Codex had exited on its own. Orca's own close path now reports hostFault. providerExited is left to the app-server connection's exit callback, which the connection withholds while Orca is closing the child, so it only ever reports the child's own exit. * fix(native-chat): a chat whose history is damaged reads "Unable to load this chat." * fix(native-chat): route the conversation-outlives-agent writers through the typed refusals Three writers that arrived with the merge wrote refusals the old way: - An operation that starts the agent itself, such as a goal change, turned any error the start threw into a refusal whose message was Orca's own error text, which released clients print. It now logs the error and says only that the agent couldn't restart. - An option picked while the chat is at rest, for a key the provider would not accept, is refused with the rejected-option reason, like the same pick on a running agent. - A restart continuation whose agent was refused a start filed the rejected message's sentence as the failure's reason. It files the refusal's code with its details again, which is what the restart-failure guidance keys on. * fix(native-chat): a start Orca stopped because it never finished reads as that The idle sweep now stops an agent whose start never finished and rejects the messages waiting on it. The chat read "Orca ran into a problem, so this didn't go through. Try again." for that, because every host stop was worded as Orca's own fault. It now reads "Codex never finished starting, so Orca stopped it." in the chat's row and on each rejected message, carried as its own failure kind so newer clients can tell it apart. The message counts as failed, like any start that did not land. * test(native-chat): pin the merged close and host-stop rows to their typed facts The merge left two expectations on the old words: the close tests looked for the marker a close used to write, and the host-stop test for the host-fault sentence. A close now writes "The chat closed before this message was sent." with its fact, and a host stop the hostStopped sentence the constructor gives, whatever reason the stop carried. Also folds the conversation command's two imports from send preparation into one. * fix(native-chat): a read of a chat this host cannot open says why Reads now reach a chat through one accessor, which refused a missing record and a provider this host does not run as a bare code with nothing beside it. Revealing the same chat already names those reasons, so a client could tell "this chat no longer exists" and "update Orca" apart there but not on the history or subscribe read that follows. The accessor now throws the same typed refusals. The wire code and message are unchanged; the reason rides only in the error's data, which released clients ignore. * test(native-chat): a Claude retrying past the idle window keeps its conversation open Every api_retry frame publishes the journal, and that publish is the activity the idle sweep reads, so a retry run revised into one row still renews the clock on each attempt. --------- Co-authored-by: Claude * perf(ci): stop duplicating shared Linux download caches (#23578) * perf(ci): pilot pnpm verification record caching on Linux * test(ci): review pnpm verification record in mobile cache audit * perf(ci): share Electron downloads and clean closed PR caches * test(ci): retain cache ordering checks for restore-only consumers * perf(ci): limit archive sharing rollout to primed Linux hosts * perf(ci): run static analysis on the free ARM runner (#23576) Measured 128s against 172s on ubuntu-latest, with every compute-bound step faster: type-aware 24s to 15s, anti-slop 28s to 19s, localization extraction 67s to 46s, and the orcad terminal smoke 39s to 14s. Checkout and the install were unchanged at 12s and 16s. The toolchain resolves on arm64: both lint engines ship linux-arm64 bindings (@oxlint/binding-linux-arm64-gnu, @oxlint-tsgolint/linux-arm64), and build-orcad-bun.mjs derives its target from process.arch. The orcad smoke booting and round-tripping a real PTY is the evidence that node-pty compiled and that Bun, the bundled ripgrep and @parcel/watcher all resolved. The runner is free for public repositories, the same one the typecheck job already uses. * fix(orchestration): reland process-incarnation reap for stale worker terminal handles (#23583) * fix(orchestration): reland process-incarnation reap for stale worker terminal handles Relands the orchestration part of #18790, which #22601 reverted in full because that squash commit also bundled an unannounced agent. Only the worker terminal-reap fix returns; no agent catalog changes. When a worker's saved terminal handle stops resolving while its process is still running, worker-show/read, worker-stop and worker-release now re-mint a live handle from the recorded process incarnation (exact pty id + incarnation id, same host scope) and act on it, instead of reporting the terminal missing and leaving the process running on the host. Fixes STA-8493 * test(orchestration): spy on the public incarnation methods instead of casting the runtime * feat(agents): add Freebuff launch and sidebar status support (#23567) Add Freebuff launch support and execution-host status reporting for the sidebar, including running, question, blocked, and settled states. Validate against captured CLI transcripts and real rendered sidebar evidence. Cross-referenced community implementations #17065, #20839, and the Freebuff portion of #18790. Preserve their agent/catalog/mobile/documentation coverage and add canonical status publication and regression tests. Co-authored-by: Harkaran Brar <18134082+harkaranbrar7@users.noreply.github.com> Co-authored-by: Prarambha369 <98906077+Prarambha369@users.noreply.github.com> Co-authored-by: Lesley Murfin <260182349+LesleyMurfin@users.noreply.github.com> * perf(ci): move six more jobs to the free ARM runner (#23594) * perf(ci): move six more jobs to the free ARM runner Follows the static-analysis move, which measured 172s to 128s. Each of these was checked for an x86 requirement rather than assumed portable. pr.yml: cross-version-wire source-only, tagged checkout plus in-process vitest managed_hook_node18 Node 18 publishes linux-arm64; the per-platform runtime files are read as data, so host arch is moot codex_index_heal_contract @openai/codex ships @openai/codex-linux-arm64 shell_contracts fish 4.x is published for noble/arm64, zsh is in the arm64 archive, so the fatal fish-4 gate still holds mobile.yml: verify 209s of its 298s is Vitest; no Android SDK, emulator, gradle, Hermes or Watchman, no docker, no artifacts. Gemfile.lock lists the generic `ruby` platform, so frozen bundler resolves without an aarch64-linux entry recording-pin pure Node plus git; the golden comparison masks `platform` Left on x86 deliberately: package builds --x64 targets, its docker gates are --platform linux/amd64, and it is where the glibc floor check runs. node-pty's .symver pin is arch-specific, so flipping would validate the arm64 pin and stop validating the shipped x64 one orcad_browser Google ships no Linux arm64 Chrome mobile_web_app same Chrome wall; its render check fails closed git_compatibility its cache key carries runner.arch and the warmer is x86, so flipping alone means a cold `make git` every run relay_integration no technical blocker, but x86 relay coverage is a documented placement and the reusable workflow has no per-job runner input e2e and the ssh lanes the ssh jobs would silently retarget the tested remote from linux-x64 to linux-arm64 * perf(ci): move xterm_patch_sync to ARM too The patch check rebuilds 4 packages x 2 builds and byte-compares against the checked-in bundles. Ran it on darwin-arm64: exit 0, in sync at 1362743 bytes, with the full fetch-and-rebuild path exercised rather than a short-circuit. The bundles were generated on Linux x64 and reproduce byte-for-byte on a different arch and a different OS, so the output is host-independent. * Fix status bar on smaller screen (#23587) * fix(status-bar): adapt layout to smaller screens with responsive density Replace fixed breakpoints with a responsive density system that measures the status bar's content and picks the roomiest density level that fits. At progressively tighter widths, the bar sheds usage mini bars, segment labels, and finally collapses calm usage chips into a "+N" overflow indicator — keeping every feature one click away in the Usage popover. Usage-first collapse order ensures urgent providers stay visible longer. * fix(status-bar): use overflow-clip-margin to preserve focus rings Adds a 3px overflow-clip-margin to status bar containers so focus rings and badge dots aren't clipped when content overflows on smaller screens. * feat: add first-class Qoder CLI support (#23581) feat: add first-class Qoder CLI support Integrate Qoder launch, identity, canonical hook status, trust and resume. Verify with captured Qoder 1.1.64 transcripts and hidden Electron sidebar checks. Builds on and cross-reviews #7502, #8611, #9655, #12910, #13311 and #15291. Co-authored-by: dalveytech-vincent Co-authored-by: Eridanus117 <45489268+Eridanus117@users.noreply.github.com> Co-authored-by: xingqingzzp-gif Co-authored-by: jyang2004 Co-authored-by: yunqian Co-authored-by: huzhening.hzn * ci: skip unrelated installs and share xterm build dependencies (#23607) * ci: pilot shared xterm installed dependencies * ci: bound xterm cache production to verified main entries * ci: benchmark xterm reuse on the production ARM runner * ci: avoid installing Orca dependencies for standalone xterm checks * ci: use Node-only setup in the production xterm job * ci: remove completed xterm benchmark workflow * ci: use faster gzip for temporary Linux test packages (#23609) * ci: benchmark faster Linux package compression * ci: pass compression options through typed builder configuration * ci: retain original configuration for benchmark baseline * test: preserve release settings in CI compression configuration * ci: normalize generated changelog dates in package comparison * ci: remove completed Linux compression benchmark * Update README downloads badge * fix(deps): take Electron 43.7.5 so detached webviews stop blanking browser tabs (#23586) Electron 43.7.0 threw 'Invalid guestInstanceId' from 's disconnectedCallback for a loaded guest (electron/electron#53989), so a webview React removed and re-inserted kept a dead guest id: the tab went blank, reload did nothing, and the destroyed listener never fired. 43.7.4 (electron/electron#54097) returns early when the guest is gone. Raises the runtime floor test to 43.7.4 so a downgrade cannot re-ship it. Fixes STA-8757 * docs(readme): remove the TestFlight link (#23660) * docs: update GitHub star history chart (#23661) * fix(claude): withdraw a follow-up queued behind a stopped turn instead of dropping it silently (#23553) * fix(claude): withdraw a follow-up queued behind a stopped turn instead of dropping it silently Orca's SessionStart hook proves most Claude starts before the turn's system/init, the only frame that advertises interrupt_cancel_queued_v1. Capabilities were read once from the start proof, so they stayed empty: Stop never asked Claude to cancel its queue, and the one-at-a-time fallback withdrew the follow-up without settling it. The send stayed pending and the chat read Working until the child exited. Capabilities are now one derived value, taken from whichever report names any and never cleared by one that names none. The fallback settles each send the CLI confirms it withdrew. * test(claude): pin that only a confirmed cancel_async_message counts as withdrawn * test(native-chat): await the async journal snapshot in the queued-stop test * test(native-chat): wait for the queued-stop states instead of sleeping A fixed 20 ms sleep does not cover the host's asynchronous journal writes on a loaded runner. * fix(codex): a message whose turn was stopped before Codex took it is withdrawn, not stuck (#23618) * fix(native-chat): land a late settlement from a streamed turn's end after that turn's rows A settlement that says a streamed turn ended waits for the session's event sink to drain before writing its dispatch row. The journal reducer still refuses to overwrite an accepted or rejected send. * fix(codex): settle a send from the end of the turn Codex answered it into The turn/start answer names the turn that holds a send. The send's echo entry now keeps that binding, in memory only. If the bound turn is interrupted without echoing the send, the send is withdrawn: Codex clears a turn's pending input on interrupt, so the model never saw it. If the turn fails first, the send is rejected in Codex's words. A completed turn settles nothing, since Codex records pending input when it finishes and the echo is still due. An answer read after its turn already ended is settled by that end. The echo is still the acceptance and carries the item key. * test(codex): a send settles from the end of the turn Codex answered it into The fake Codex keeps 0.157's turn bookkeeping, and can deliver the turn/start answer after turn/started or after turn/completed. The tests cover: - a Stop before any echo withdraws the send, and the working rule reads idle; - a steered follow-up is withdrawn when the turn is interrupted; - a failed turn rejects the send in Codex's words; - a completed turn leaves the send to its echo; - a normal echo and a late echo; - two steered sends in one turn; - an answer read after the turn ended; - a timed-out answer; - child-thread turns; - how a binding dies. * refactor(native-chat): drop the stream flush before a late turn-end settlement Nothing reads the order of a dispatch row against the turn's terminal row: the reducer keeps a settled send terminal and the working state is derived from both. The echo acceptance on the same path never waited either, and the wait could drop the settlement on a failed sink barrier. * fix(codex): settle a failed turn's sends at its end, not at its error Codex keeps a failed turn's pending input and records it after the error frame, before turn/completed. Settling at the error rejected a steered follow-up the model had in fact received, so a Retry would send it twice. * docs(codex): say a completed turn echoes what it took before it ends Codex records a completed turn's pending input before `turn/completed`, so a bound send that turn never echoed is left for recovery, not awaiting an echo. The comments and one test title said the echo was still due. * test(codex): settle a send whose answer is read after its turn failed or completed A failed turn that ended before the answer rejects the send in Codex's words, once; a completed one leaves it admitted and still armed for its echo. * refactor(codex): read a failed turn's reason with the typed thread-fact reader * Show a resting Claude chat's effort instead of a blank picker (#23106) * refactor(native-chat): remove the unused terminal handoff No client ever called agentSession.requestHandoff or mounted the handoff chrome. Delete the handoff coordinator, the terminal-owner runtime, the proof write path and the unmounted UI. Keep agentSession.handoffStatus, which released desktop clients read for worktree activation, and let records an older build left mid handoff reconcile through the ordinary restart and recovery paths. * fix(native-chat): never let the pre-stop snapshot hold a chat's stop Eviction now drains delivered events before quit's resume-offer snapshot. An unbounded wait there sits ahead of the provider stop, so a sink whose journal write stalls kept the child running until the step deadline aborted the eviction. The offer is advisory: bound the drain and stop the child regardless. Co-Authored-By: Claude * refactor(native-chat): drop helpers only the terminal handoff called `claudeAuthEnvCarriedForward`, `isPathWithinDirectory` and `queryWindowsProcessRowsFresh` lost their last caller with the handoff. The fresh-scan tests now go through `queryWindowsProcessDescendants({ fresh: true })`, the teardown path that still depends on that contract. Co-Authored-By: Claude * docs(native-chat): stop citing the removed handoff in lifecycle comments Six comments still named the handoff coordinator, a handoff suspend, or a terminal-owned session as live participants in the flows they describe. Co-Authored-By: Claude * test(native-chat): type the stalled snapshot drain without a cast Co-Authored-By: Claude * test(native-chat): pin that a start dead before proving owes no settlement The removed restart handoff test pinned this branch; nothing else did. Co-Authored-By: Claude * fix(native-chat): keep the owner-status read behind an in-flight attach The handoff removal dropped the per-session queue from `handoffStatus`, so a read landing mid-start reported the reservation (no owner) instead of the settled chat owner, and shipped desktop clients blocked worktree activation on it. The read is queued again, as it was before the removal. Co-Authored-By: Claude * refactor(terminal): remove the agent-session PTY write gate The gate only refused a write when a PTY had been bound to a chat session, and the only code that ever bound one was the terminal handoff this branch removes. With it gone, every admit/readmit returned "admitted" unconditionally, so the checks on the renderer write path, the runtime controller backstop, terminal.send, agent prompts, preview input and orchestration pointers, the refusal fields on terminal.send and worker-start receipts, the plugin and CLI refusal copy, and the adopted-pane orchestration routing could no longer run. Ordinary writes take the same path in the same order as before. Co-Authored-By: Claude * refactor(native-chat): drop the transcript helpers only the handoff called appendLegacyTranscriptMessages fed the terminal transcript catch-up and proveClaudeTranscriptBranch backed the terminal owner's exit proof. Both lost their last caller with the handoff. Their tests now go through the live entry points instead: the roster bounds through the legacy import, the pinned-read and growth tests through the ancestry replay the history window uses, and the marker rules through the string proof in their own file rather than the session-file resolver's. Co-Authored-By: Claude * fix(native-chat): stop calling a starting chat "mid-handoff" A send refused because the chat's owner is not settled showed "The session is mid-handoff ()." in the composer. With the handoff gone, the stages that reach it are a chat that is still starting, or one whose previous agent process has not yet been confirmed stopped. The message now says which of the two it is. The refusal code is unchanged. Co-Authored-By: Claude * test(native-chat): type the stand-in roster decoder without a cast Co-Authored-By: Claude * refactor(codex): name the pinned rollout lookup for what it does With the terminal handoff gone, the module named codex-tui-rollout-proof holds only the pinned rollout lookup that structured Codex launches use to resume a thread, so the name described code that no longer exists. Rename the module and its options type. Also drop a mobile allowlist assertion that pinned the removed agentSession.requestHandoff method, which no longer exists to allow. * refactor(native-chat): type the owner-status reply as the host sends it The handoffStatus reply type still listed the terminal handoff's fields and states (terminal placement, host label, proof retry, queued and waiting phases, the to-terminal direction). No host writes them any more and the only client reader parses the reply as unknown, so they described nothing. The reply on the wire is unchanged. * refactor(native-chat): normalize terminal-handoff lease values once at decode Nothing in this build writes a terminal owner (`runtimeKind: 'tui'`) or the handoff's `preparing` / `old-owner-stopped` stages, but the in-memory types still admitted them, so readers across the host kept branches for values no path produces and the compiler could not point at them. The store now validates the on-disk shape, which still accepts those values so an older record is not quarantined, and maps them once while parsing: - `preparing` and `old-owner-stopped` become `recovering` - a `tui` lease becomes `native`; when it records a process it also becomes `conflicted`, the claim every build probes but never stops. A plain native owner would be stopped by restart recovery, here and in older builds. Revisions are taken over the normalized state on both sides of every compare, and the mapped record reaches disk with the store's first transaction, the same way the tab-id backfill does. The in-memory types narrow to what this build writes, and the branches that existed only for the removed values go. Structured-worker identity keeps its verdict for a former terminal owner by refusing a conflicted claim rather than a non-native kind. * refactor(native-chat): stop threading the owner kind through a reservation A reservation only ever names a native owner now, so the request no longer carries a kind and the reserved lease records `native` directly. The attach params keep `runtimeKind`: agentSession.ensure and create accept it, and the operation fingerprint stored in the ledger covers it. * test(native-chat): pin the legacy-lease rewrite with a transaction that changes nothing else Hiding a tab also committed the visibility index, so the no-op transaction wrote the file even when its open-time revision was wrong. Committing the index first leaves the pending rewrite as the only reason to write. * fix(native-chat): name a chat write by its target, not the owner generation A write carried the fence of the last frame the pane read, and the host refused it unless that fence was still current. An idle release and the restart after it each move the fence, and the release publishes nothing, so a send after a release was refused "Expected runtime fence 1; the session is at 3", and a Stop queued behind a cold start was refused as stale. Every write already names what it acts on: a send its conversation, a cancel its turn, a prompt answer its item revision, a rewind its epoch; an option is last-writer-wins. So admission stops comparing the client's fence, and the rebase that papered over one restart (admitAtResumedFence, resumedFromFence) goes with it. The writer-lease check stays, and so does the attach's compare-and-swap. Frames now stamp the fence read when each frame is sent instead of a copy each subscriber kept, which went stale on the same release. * fix(native-chat): every journal append reaches the chats that are open A journal write and its delivery to open readers were two calls, and some writers made only the first. A failed start whose lease could not be handed back, a provider revision with no frame behind it, and eviction's settlement were all journaled without reaching an open chat. A journal handle now reports every durable change, and the host's session map binds that report to the session's readers when the handle is set. Writers no longer publish what they append; the per-writer publish calls are deleted. * test(native-chat): an epoch replacement reaches the open chat * test(native-chat): each row reaches an open chat once, and a live handle enters only through the map * test(native-chat): give the legacy-lease store test a tab id so the backfill cannot supply its rewrite The seeded record had no surface tab id, so the next open backfilled one and that rewrite alone made the no-op transaction write. The test passed with the legacy-lease rewrite signal removed. * test(worktree-activation): restore the OMP surfaced-agent resume test The handoff removal deleted it alongside the terminal-owner tests, but it covers the surfaced-PTY block that still guards resume, including an agent whose ownership is unknown. * perf(native-chat): a publish behind a delivered commit reads nothing Each commit now delivers itself, so the publish a provider frame still sends afterwards found every reader caught up but still read rows and rebuilt the timeline for each one. A caught-up reader now skips the read. * test(native-chat): state why the teardown test's fake journal is safe to cast * docs(native-chat): say mutation admission checks only the writer lease * docs(native-chat): drop the send rebase from comments that still described it * fix(native-chat): a message is accepted, then delivered A send to a chat with no running agent restarted the agent inside the send call, before the message was recorded, so the client waited for the whole start and a failed restart refused the message. Claude held prompts sent during startup, and those could settle as "unconfirmed". A send is now accepted inside the session's serialized queue: one ledger row and one submission row marked handoverRecorded, published, answered pending. A per-session delivery loop exists while a message is queued. It starts the agent through the same serialized attach a hold uses, waits outside the queue for a Claude child to prove its start, and hands the oldest queued message over as its own serialized step, writing dispatch{pending} before the adapter call. A start it needed and did not get writes one error-tone row and rejects every queued message with the same words; a start Stop cancelled writes none. Settlement follows from the rows. A queued message is provably unwritten, so a close, an eviction or an exit rejects it. A handed-over message stays in doubt. A queued row at or below the sequence a handle found when it opened was left by an earlier process and is rejected at open, with no latch. Stop withdraws queued messages with no writer lease and no fence. An attach failure keeps the conversation open, and the attach adopts its journal. Owed work counts the loop and queued rows. A compaction or rewind found prepared when a conversation opens was started under a child this process no longer has, so the open settles it rather than leaving it to refuse every send until a view attaches. The open cursor is scoped to its epoch, because sequences restart when an epoch is replaced. Deleted: restart-before-admission, recordFailedRestart, the fence rebase, Claude's startup gate, the attach's forget on failure and its own crash boundary. Clients without agent-session.accepted-send.v1 get their reply held until the handover; the desktop and paired desktop lists advertise it. * fix(native-chat): settle queued messages only for the child that ended A child that proved its start and then exited before its message was handed over left the message queued: the exit settlement returned early when nothing else was in flight. Delivery then started another child for it, and a child that died the same way started another, without end and without a row. A retried settlement for an earlier generation, run by the attach that delivery started, did the opposite: with that generation's turn unfinished it rejected the message queued for the child being attached. The settlement now takes the rejection for queued messages from its caller. The unexpected exit and the eviction pass one, and it applies even with no other work in flight; the retry for an earlier generation passes none. * fix(native-chat): an adoption that fails to import keeps the conversation open The attach now writes into the conversation's own open journal, but a failed transcript import still closed it as if it were the attach's provisional one. The conversation stayed indexed with a closed journal, so every later send answered "could not be recorded" and every attach failed again until the app restarted. The import now closes only a journal the attach opened for itself. * perf(native-chat): the recovering open reads the journal once Every conversation open now goes through the recovering open, including the read restore of every chat at startup, which used to replay its journal once. The recovering open replayed it twice: once to probe it and again inside the open. The probe is now handed to the open as its load. * fix(native-chat): an attach that fails after indexing its child leaves no child behind A failed attach now keeps the conversation open, but a failure after `onAttached` indexed the child (the rewind or compaction recovery, or the attach's own success record) left that entry claiming a child the failure path had already released. The next send found the phantom, skipped the start, and wrote at a fence the journal had moved past, so the message stayed queued for good. The entry now drops the released child and its event sink, and follows the record's fence, as a failure before indexing already did. * fix(native-chat): a withdrawn message shows no error, and a rejection outlasts the send's answer The error strip for a message the host accepted and then did not deliver matched the entry before the outbox reconciled, so a Stop's withdrawal, which the reconcile drops, showed "Orca could not send your message" with nothing to retry. It now reads the reconciled entry. A rejection the journal records before the send's own pending answer lands is final as well: that answer no longer puts the entry back to dispatching with no Retry. * fix(orchestration): a structured worker whose agent outlasts the preamble wait is left unknown, not torn down The preamble waits for its submission to be delivered while the worker's agent starts. When that wait ran out it threw operation_unknown, and the failed-start teardown then closed the session, which rejected the very preamble the host was about to deliver. It now reports a turn start nobody observed yet: the worker is start-unknown with its session kept, the host delivers the preamble when the agent starts, and the worker's report settles the dispatch as for any unobserved start. The receipt no longer suggests reading a screen a structured worker lacks. * fix(native-chat): a message rejected while its chat was closed reads as not sent A remount reads an entry it left dispatching as unconfirmed. When the journal had rejected it meanwhile, as a failed start or a quit now does, the reconcile left it unconfirmed: it blocked every later message behind a Retry and no reason, and the delivery probe, seeing the journal already answered, never ran. The reconcile now settles it as rejected like a dispatching one. * test(orchestration): name why the readiness settlement fakes are cast * fix(native-chat): keep each pane's own fence on frames so a failed restart is not resent * docs(native-chat): drop the fence from the admission the send effects run behind * docs(native-chat): give the fence move on release the reason that still holds * docs(native-chat): stop citing a write fence check in launch and mailbox comments Three places still gave the removed fence check as a reason: the launch replay said admission puts the ledger ahead of the fence, the launch surface said a send must name the lease it was admitted against, and the direct-mailbox path said the lease fence decides whether delivery is safe. Admission now checks only the writer lease. * refactor(native-chat): the provider child is its own record A conversation now outlives any number of provider children, so the child is one record on the conversation's entry instead of five loose fields beside its journal. It is written in one place: indexed only once an attach has fully succeeded, and ended through one function that an exit, a failed re-attach, a Stop and an eviction all share, matched on the child's generation and fence. - A failed attach writes no child, so there is nothing to unwind: the field unwind and the fence patch after it are gone. - Conversation writes read the record's fence, the way mutation admission already does; a child's own writes use its fence. The four stored-fence patches, and the settlement retry's overwrite of the conversation's fence, are gone. - The owed wind-down is its own tombstone, carrying the child it is owed for, and is no longer dropped when an attach replaced the whole entry. - Stop on a child still proving its start stops only the child: its lease goes back and the chat is told it is idle, but the journal, the holders and the readers stay. Close is that stop plus the conversation's close. - The settlement retry uses the conversation's own journal, opened through the host's one open. * fix(native-chat): the delivery loop alone settles a message its start or child failed A queued message was settled by whichever path happened to end the child first: the loop, the unexpected exit, eviction's work settlement, the open's leftover rule, and the startup branch that rejected every pending row. That gave two failure rows with different tones for one start, a loop that could hand over to a different child than the one it waited on, and a Claude start that died while starting reading unlike every other failed start. - The loop remembers the child it waited on. At handover, if that child is gone or replaced, it reads how it ended: a Stop continues; anything else writes one failure row and rejects every queued message with the same words, then stops. A child still starting whose start the adapter says did not land fails the same way. The exit, eviction and the settlement retry only settle the handed-over and legacy rows of the child that ended. - One failure row, always an error, keyed by the start. A start a view began that dies with nothing queued writes the same row through the same builder, so a second report revises it. - The open no longer rejects leftovers; the loop's first step does, and the open wakes it. - `awaitStarted` answers why a start did not land, so the row says it even when the loop sees the failure before the exit is processed. - Quit closes every conversation the way closing a chat does: what is still queued is rejected as closed, with or without a child, and a start the loop already has in flight is waited for so the child it produces is stopped rather than left behind. * refactor(native-chat): a stopped child ends on the one reading of its stop The eviction step reads a stop's result through `stopAgentSessionProviderRoot` and hands that verdict to the child's ending, so the host never forms a second view of whether the root is gone. Every ending carries it: a stop's comes from that reading, an exit's root is gone by definition, and a failed re-attach passes what its release saw. The end-of-child record can therefore also carry a stop whose root was not seen to go, which nothing ends on yet. * feat(native-chat): the host says it accepts a send before any agent has it The host now lists agent-session.accepted-send.v1 among its own runtime capabilities, the same string capable clients already send. A client can then tell a host that answers a send at acceptance, and admits a Stop with no writer before a turn starts, from an older one that still restarts the agent inside the send. Additive: an older client ignores a capability it does not know. * refactor(native-chat): an attach never opens a journal of its own The attach adopts the conversation's open journal, which outlives it, so it no longer opens one for a direct caller either. That leaves nothing for a failed adopted import to close, and the flag that told the two cases apart is gone. Tests that attach without a host open the conversation the way a host does. * fix(native-chat): a moved fence resends nothing on a host that accepts first The outbox treated any fence change as a new owner: it dropped the answer of a send in flight, queued that send to go out again under the same id, and unblocked a refused head. On an older host that is how a send the restart refused, unrecorded, gets another try. On a host that records every send before it starts an agent, a fence moves because that start ran, so the same rule resent into every failed start. With a fence stamped on every frame, that became a loop. The outbox now reacts to a fence change only when the host has not advertised that it accepts a send before any agent has it. On such a host, only a Retry or a new send goes out, and a failed start reaches the client as a rejected message it keeps with its Retry. Against an older host, or before one has answered, the outbox behaves as it did. Desktop and paired web share this hook. * refactor(native-chat): a child's end says whether the user or the host stopped it The end-of-child record's cause now tells a user's Stop from the host stopping the child for a cause of its own: `user-stop` and `host-stop` replace `stop`. The delivery loop goes on after a user's Stop, as before, and fails the start it was waiting on after a host stop, with the one error row and every queued message rejected, in the stop's reason when it gave one. The reason stays description only. Stop passes `user-stop`; nothing passes `host-stop` yet. * fix(native-chat): a chat whose only work is a queued message is not offered for resume A message accepted while the agent was starting counts as working in the chat, and quit rejects it as never sent. The teardown snapshot read the same working rule, so a relaunch offered to resume a chat whose agent never had the message. The snapshot now reads only what was handed over. * fix(native-chat): the conversation outlives its agent Opening a chat no longer starts its agent. A conversation is reached through one host accessor that opens its journal at rest, and a send is what starts the agent, through the delivery loop. One idle sweep, every five minutes, stops an agent that has been quiet for thirty minutes and owes no work, then drops an open journal handle that is only a cache. Its record, tab, status row and readers stay. - hold and release are no-ops; hold still builds the host for shipped mobile builds. - The holders, the holds, the release clock and the exit respawn are deleted. - Options, the model list, the goal and the context meter answer at rest; a model pick at rest is recorded as intent for the next start. - Compact, rewind, clear and goal changes start the agent first. A send does too when a rewind is still in doubt after the conversation opens. - Orchestration routes mail and group addresses on ownership (the record plus the chat tab), not on whether the process runs. An open dispatch keeps its worker running. - The restart continuation is a send; Resume all holds each slot until the message is handed over or rejected. - A read error never replaces a loaded transcript, and shows the host's own words. * test(native-chat): type the queued-message fixtures in the resume-offer tests * fix(native-chat): a start that dies while a message waits on it is that message's failed start Opening a chat's tab starts an agent for the view, and a send accepted meanwhile waits on it. When that start died, its exit wrote the start's error row and left the message queued, so the delivery loop started a second agent into the same failure and wrote a second row. A child's end now records where the conversation's journal stood, and the loop settles a message accepted before a failed start ended with that start: one row, under its key, and no second start. A message sent after the failure still gets a fresh start. * docs(native-chat): say what an attach's open conversation and unconfirmed ids are now * test(native-chat): pin what a failed start settles, and what a resume offer names A view's child that dies while a sent message waits settles that message only when it died starting and no child has taken its place: a proven child's crash, or a second start since, gets the message delivered. The resume offer names the handed-over message, never a newer one still queued. * test(native-chat): the failed-start pins fail on what the message became, not on a timeout * fix(native-chat): a restart offer ends when the chat's agent starts again The offer used to end only when the chat's newest user message changed, because opening a chat started its agent and that start could not be told apart from real activity. Opening a chat starts nothing now, so the host reads the fact it already publishes: a chat's status row goes from not host-owned to host-owned exactly when its agent is started. At that edge the offer and any failure record for the chat are withdrawn, unless the start is a resume action's own (its continuation is the oldest undelivered message). A continuation and a message racing to be first are decided at acceptance: the continuation is refused, quietly and with nothing filed, when any other message was accepted since the restart. A failed continuation start leaves the offer retryable, and each resume action sends its own message id. Deleted: the newest-user-message comparison, its journal reader, the continuation filter, and the failure ledger's own "answered by the chat" check. The marker still carries its message id for one release, so the previous build can read it. * fix(runtime): end a transcript stream when its client unsubscribes Desktop: the IPC subscription controller was dropped as soon as the streaming handler returned, which for most streams is right after it binds. A later runtime:unsubscribe then found nothing to abort, so the host kept the subscriber and derived and sent every publish to a channel no one listened to. The controller now lives until the renderer unsubscribes, resubscribes the same id, or goes away. Mobile: disposing an agentSession.subscribe stream now sends agentSession.unsubscribe with the stream's frame id, so the host ends that subscriber and leaves a sibling stream on the same socket running. The direct path now passes the frame id the relay path already passed. * test(orchestration): the preamble's host stub is typed, not cast The preamble send now takes only what it reads of the host, the send, the settlement wait and the record's fence, so its test builds that host with real types instead of `as never`. * fix(native-chat): one fact ends a restart offer: the chat moved on since the restart The offer is live while no other message has been accepted in the chat since the restart and its agent has not proved a start since. The offer list, the resume's reservation check and the continuation's acceptance check all read that one fact, so a message whose start then failed withdraws the offer too, and a stale click finds nothing to act on. The fact is read off the conversation's open handle, which the restart closed, so it is retired durably whenever it may have changed: a message accepted, a start proven. A close and reopen within the same run therefore cannot bring the offer back. A continuation rejected before it reached the agent does not count, so a retry after a failed start still runs. Deleted: the quit-time gate on withdrawal, which changed nothing because the withdrawal and the quit's own offer write share one queue; the per-action "withdrawn" flag and the separate acceptance check it paired with. * test(native-chat): an older build reads the restart offer this build records The offer lives in a file the previous release reads after a downgrade. Pin that against the pinned release's own capsule, and run the lane when the marker or the capsule changes. * fix(native-chat): read a restart offer against where the journal stood when it was taken "Since the restart" was read off the conversation's open handle, which the idle sweep closes: after a reopen, a message the user had already sent looked older than the handle and the withdrawn offer came back. The offer now records the journal position (epoch and sequence) at the moment it is taken, and a message accepted after that position, or a journal on another epoch, means the chat moved on. That is derived from the journal, so it holds across any number of closes and reopens. An older build's offer has no position; only a start withdraws it. Because the message half is now durable, the offer is no longer rewritten in the recovery file on every accepted message; a proven start still writes it, since only the host that saw the start knows of it. * test(native-chat): wait for the listing's retire write before reading the recovery file * fix(native-chat): keep the terminal-backed chat's read error over its local echoes Messages winning over a read error is right for the structured chat, whose read retries and whose messages came from the transcript. The terminal-backed view assembles its list from local echoes too (a launch prompt, a pending send), so a failed read there showed only those bubbles and no error. Only the structured pane now keeps messages over an error. * fix(native-chat): a start retries the exit settlement a failed journal write left owed An agent exit whose journal settlement write failed releases the lease latched until a retry lands. Reopening the chat used to be that retry; with reveal now only opening the journal, nothing retried it before the next app launch, and every send was refused. The start the send needs now runs the retry first, where the attach would. * perf(native-chat): answer the owner check without opening the chat Worktree activation calls agentSession.handoffStatus for every chat tab in the worktree, and the answer comes from the session record alone. Reaching it through the accessor opened each resting chat's journal (a full read, the crash-boundary write and a restored status publish), then kept it open for the idle window. It now checks the record and the adapter's support, as before this series, and opens nothing. * fix(native-chat): a read waiting on the session lock opens nothing once quit began The accessor checked for quit before queueing the open, so a read queued behind a session task ran its open after teardown had begun and indexed a journal no teardown step would close. The check now runs at the open itself. * fix(native-chat): read a failed resume's chat before calling it retryable Whether a failed resume is retryable is the offer's own rule: the chat has not moved on since the restart, read from its journal. The failure list read it only for a chat already open, so once the idle sweep closed a chat the user had moved on in, its failure showed Retry again, and the click did nothing. The list now opens the failed chats first, as the offer list does. * test(native-chat): type the provider event sink the settlement test reaches for * fix(native-chat): say the structured read keeps trying only where it does The structured pane's "Orca keeps trying to load it" line never showed: the view state filled in an untranslated fallback whenever the read error had no text, and the empty state prefers any message. The view state now leaves the message out, so the structured pane shows that line and the terminal-backed pane its own translated one. Mobile's structured lane does not resubscribe after an error frame, so it no longer makes the claim. * test(native-chat): await the send's settlement instead of polling for the start The at-rest send tests polled for the provider start with vi.waitFor's one-second default, which a loaded machine outran. They now await the host's own settlement of the message. * fix(native-chat): a restart offer resumes any time after the quit, and knows its own continuations The continuation's message id was dated by the quit, and the ledger refuses a new id dated more than a day back, so Resume or Retry a day after quitting was always refused (on main too). It is now dated by the resume action. Telling a rejected continuation from the user's own message read the operation ledger, whose rows expire after about a day; after that a failed resume stopped being retryable. The offer now records the continuation each action sends on its own capsule entry, bounded to the newest 16, so the ids end with the offer. The ledger read is deleted. * fix(orchestration): route no mail to a structured worker its orchestration released A structured worker is routed on ownership, and a resting worker's lease is released, so ownership held while its chat tab stayed listed. A worker the coordinator abandoned and then released, found at rest by the release, therefore still took peer mail and @worktree: broadcasts, and each one restarted its agent. Routing now also reads the orchestration's own resource row: once it is released, direct mail, group addressing and worker-show's addressable answer drop the worker, as they would a terminal worker whose terminal closed. The chat tab stays, and nothing new is stored. * fix(native-chat): a failed retry names the user's prompt, not Orca's continuation A resume's continuation is written to the chat before its start, so after a failed attempt the chat's newest user message is that rejected continuation. A second failure then showed Orca's own restart text as the chat's prompt. A retry now keeps the prompt its first failure named. * fix(orchestration): read the released row optionally, as the authority does worker-show's observation called the row lookup directly, which a runtime double without it threw on and failed the structured tab-retirement release. * fix(native-chat): the status bar drops a restart offer the chat moved on from The renderer re-read the host's restart offer only when a failed chat showed activity, so after a message withdrew a pending offer the host answered no chats while the status bar kept counting one, and clicking it opened nothing. The same watch now covers pending offers: a status change in an offered chat asks the host again, once. * fix(native-chat): a resting Claude chat shows the effort its next start runs A running Claude child reports the effort it applies. With no effort pick of its own, that is what the CLI runs for the model when none is sent, so the catalog write-through records it as the model's defaultEffort. The store keeps a known default through a listing that names none, and the resting options read answers the pick, else that default, as a live child does. Nothing is saved as the chat's pick. * test(native-chat): a roster of idle or finished children does not keep an agent awake The sweep reads owed background work through the shared child-work liveness that upstream's release clock adopted; a child that went idle or finished is not work the agent still owes. * fix(orchestration): a task dispatched into a resting structured worker keeps it running The sweep's open-dispatch check read only the worker-start dispatch that owns the worker's terminal resource, so a task later dispatched to the same worker (orchestration dispatch --to, which writes a dispatch with no worker row) did not count: after thirty quiet minutes the worker was stopped while that task was open, and its coordinator read exited. Any unsettled dispatch addressed to the worker's process incarnation now counts, derived from the existing rows. * docs(native-chat): comments stop describing the hold this PR removed Eight comments still justified orderings and teardown choices by a viewer or dispatch hold that pinned the provider child. Nothing holds any more; the orderings stand for the binding's redrive subscription and parked mail, and a chat's agent runs from a send until the idle sweep rests it. Comment-only. * fix(native-chat): a restart offer keeps the start its own continuation made Whose start ended an offer was decided at read time, from whether the offer's continuation was still the queued message. Once the provider refused that continuation, the child it had started read as someone else's start, so the offer ended and its failure showed no Retry. The delivery loop now records which queued message a start is for on the in-memory child, and the child's end carries it; the offer counts a start as its own when that message is one of its continuations. * fix(native-chat): an agent gets a full idle window after its owed work ends The sweep measured quiet only from the last journal row, so once a subagent, command, monitor or dispatch that had outlived the window ended, the agent was stopped at the next tick. A child can read done before the lead's wake-up turn writes anything, and stopping in that gap loses the wake-up. The sweep now counts owed work it observes as activity, which gives the agent the full window afterwards, as the release clock it replaced did. * test(claude): the options-read fixture runs a live child The fixture marked its conversation running with a hasProviderChild field the session type does not have, so the read took the at-rest path and refused a session with no record. It now carries a child, which is what the read checks. * test(native-chat): host tests reach its collaborators through a typed seam The rest-test rig and three test files read the host's private members with Reflect.get and cast the result. The host now exposes one test-only accessor, collaboratorsForTests(), and the subscribers class a subscriberCountForTests() beside its existing retainedActivityCountForTests(), so the tests are checked against the real types and the casts are gone. * refactor(orchestration): one owner answers a structured worker's custody Routing, group addressing, worker-show and the idle sweep each composed their own reading of whether orchestration still holds a structured worker, so each new obligation or retirement state had to be added to every reader. structured-worker-custody now derives both answers from the worker-terminal list state coordinators see in worker-list: addressable is owned and not released, and owed work is an active custody or an unsettled task dispatched to the same incarnation. The owner's state is read through the remote dispatch attachment too, as the terminal transfer lookup already does. Behaviour is unchanged; a settled worker awaiting its coordinator still rests. * refactor(orchestration): owed work is an open dispatch on the worker's incarnation A supervised worker's own dispatch context stays open exactly while the worker is active, so the separate active-custody branch only repeated it. Owed work is now one fact, which also states the policy that a worker awaiting its coordinator's decision may rest, and both custody decisions are written once at the top of the module. * fix(native-chat): a restart offer knows its continuations by a tag in their id The offer recorded each continuation id in a list on its capsule entry, capped at 16, and a running action's id in memory. Both could disagree with the journal: past the cap an old rejected continuation read as the chat moving on, and a crash during a retry restored the failure's older entry, which lacked the retry's id. Each continuation id now carries a tag derived from the offer (its teardown and chat), then the action's own part, so any continuation of this offer, queued or rejected, is recognised from the journal row and the marker alone. The persisted list, its cap and the in-memory action map are deleted; the agent-start withdrawal keeps an offer whose own continuation the start was for, read against the stored marker. * test(runtime): the legacy-worker reveal test judges its stale snapshot inside the wait The tui-idle probe reads through readTerminal, which now awaits the structured worker check before the PTY read, so the probe's snapshot request starts a microtask later. vi.waitFor missed it on its first check and polled again at 50 ms, the same moment the wait's own 50 ms timeout fired. The stale snapshot then resolved after the wait had already timed out, so the test passed without judging it, and the rejection landed before any handler was attached. Vitest reported that as an unhandled error and failed the shard. Polling every 1 ms sees the request within a few ms, so the snapshot is judged while the wait is still pending. * fix(native-chat): a view never restarts a chat whose last start failed A Claude chat whose CLI exits during startup left one red row per start, and every time a view bound to it (the chat opening right after its create died, or the user switching back to it) the hold started the CLI again, so the same launch-failure row repeated. Only a send retries a failed start now, the same rule provider-exit recovery already applied; the rule lives in one predicate the hold, exit recovery and the delivery loop share. * fix(native-chat): the idle sweep reads owed work every tick Owed work counted as activity, but the sweep read it only once the idle window had elapsed, so it refreshed the clock at most once a window. Work that ended just before the next read left the agent to be stopped at that read, moments after the work ended, which is the gap the refresh was meant to cover. The sweep now reads owed work on every tick for a started agent, so the window always runs from the last tick that saw work owed. * fix(native-chat): a continuation handed to the agent stays sent The offer read its own continuation as not reaching the agent while its dispatch was pending, which also covered one already handed over and still unanswered. When the wait for that answer ended first, the failure it filed read as retryable, and a retry sent a second continuation to an agent that may have acted on the first. Only a continuation still queued, or rejected, is now read as unsent. * test(native-chat): start the child the loop waits on with an attach, not a second view A view no longer starts a child whose last start failed, so the R2 case that waits on a child started since the failure now gets that child from a client attach, the one non-send starter left. * fix(native-chat): settle a gone generation's turn wherever a conversation opens A send that opens a chat this process had not read yet (after a crash, from a phone or the CLI) went through the delivery open, which never settled what the dead generation left running; only the read restore and a successful acquire did. When the send's start then failed, the turn stayed running for every reader. The settlement now runs in the one journal open, at the crash boundary, for every opener except an acquisition, which settles from the evidence it read before its reserve; the read restore's separate step is gone. * test(native-chat): prove the next child's start settles the turn an earlier child left The R1 case lost its only settlement assertion when the latch it checked was deleted. It now seeds the running turn the earlier child left and asserts it ends at the exit's receipt, with the exit's row, before the message is handed to the new child. * test(native-chat): count a failed start's rows by row, not by text Comparing the set of texts passed when two different rows carried the same words, which is the duplicate the test exists to catch. * test(native-chat): give the failed-start and stale-turn waits a loaded runner's budget * test(native-chat): the interrupted create's own retry continues again The merge of main's lease-latch fix replaced that test's retry of the interrupted create, under its own operation id, with a fresh start whose result nothing read. That fresh start passes with the released-reservation continuation deleted, so the case the fix exists for went untested. The retry and its assertion are main's again. * docs(native-chat): three comments that still had views starting agents A start with nothing queued now comes from a command, goal change or rewind; an interrupted compaction left alone would refuse every send, so no agent would ever start to finish it; and a current host raises the unattached read refusal only once quit began, with the attach window belonging to an older host. * test(native-chat): pin the open's and the send's start and row counts, however the view binds Opening a fresh chat whose starts fail makes one start and one row, with two views bound before or after the create's child died; one send makes one more of each. * test(native-chat): a reader's open settles the turn a failed exit settlement left running An exit whose settlement write failed leaves its turn running in the open journal. PR 1's open now settles it, and this pins the two reads that reach it here: a reader reopening a chat the idle sweep closed, and a read that opens the chat before the restart restore reaches it. * test(native-chat): the view-start test's starting window outlasts two subscriptions on a loaded runner A subscription reads the conversation before it returns, so under load the two views took longer than the create child's 300 ms start, which then exited before the test checked that it had not. The child now takes a second to fail. * fix(native-chat): settle a gone generation's turn at every open but an acquisition's The journal open skipped the settlement whenever the lease read reserved or live, to leave an acquisition's own open to the acquisition. But a lease a crashed process left in recovery also reads live, until the next acquire resolves it. A send that opened such a chat, from a phone or the CLI after a crash on a host that could not prove the old owner gone, skipped the settlement; when its start then failed, the dead turn stayed running for every reader. The acquisition now says it is the opener, and every other open settles, whatever the lease still claims. * test(native-chat): hold the create's start open until the views bind The "view binds while the create is still starting" case gave the create a 300 ms head start and asserted the views bound before it died. On a loaded runner the holds took longer, the create's exit landed first, and the case failed its own precondition. The create's initialize now waits on a gate the test releases once the views are bound. * test(native-chat): a read that reaches a crashed chat before the startup reconcile settles its turn On desktop the chat on screen at relaunch reads before startup reconciles the leases, while the dead process's lease still reads live. The open settles the turn it left running anyway, and the restore that follows finds it settled. * refactor(native-chat): drop the composer's second error formatter After the merge with main, every chat write in the composer path reports its failure as a typed outcome worded by the refusal-notice table, so the send's catch sees only a local throw. The {code, message} formatter this branch added for it has no payload left to format, and its claim to be the one way a chat words a failure is no longer true. The composer send is main's again. * test(native-chat): pin the reason on a message rejected while its chat was closed The reopen test checked only that the message reads as not sent; it now also checks the Retry row carries the host's reason. * docs(native-chat): drop the removed dispatch hold from six comments A worker's session no longer takes a dispatch hold, and no release clock rests a chat by visibility; the agent-launch comments, the abandon test, the teardown test and the refusal census still said so. * test(native-chat): rest the owner-status chat through the idle sweep, not a hold The activation-gate test from #22808 put its chat at rest by holding and releasing it, and passed the release-clock grace. This branch deleted both, so the case threw before it reached its assertions. It now moves the host's clock past the idle window and lets the sweep stop the agent and close the conversation, then asserts the same owner answer and activation gate. * fix(native-chat): show the structured pane's retrying line when a read fails The read transport always hands the pane the host's words, so the error state's "Orca keeps trying to load it" line, which showed only when there were none, was never seen: the pane showed the host's text twice, as its subtitle and on the status line under it. The structured pane now always says its read keeps retrying, and the host's text stays on the status line. The terminal-backed chat is unchanged. * fix(native-chat): keep a resting Codex chat's unsaved effort blank, as its live child shows it The resting options read fell back to the catalog's default effort for every provider. A live Codex child answers only the effort its thread reported, which is none when Codex's config names none, so a resting Codex chat showed Medium and then went blank once it started. * test(native-chat): read the resting Claude chat from the record its start persisted The at-rest test built the record by hand, so nothing proved the model id a start persists is the listed row the catalog learns the default under. --------- Co-authored-by: Claude * fix(release): stop the release policy from deleting pipeline-cut releases (#23669) * fix(release): stop the release policy from deleting pipeline-cut releases The policy judged a release by who created the release object. Cut Release reuses an existing draft, so a CI-built v1.4.216 whose draft a person had created was deleted (tag included) when its notes were edited, and Latest fell back to v1.4.214 because v1.4.215 was also published by a person. - Authorize a desktop release when its annotated tag was created by the release pipeline and points at its `release: vX` commit, not only by author. - Only delete on `published`; an edit never deletes a release or tag. - Pick Latest from the highest authorized stable using the same check. - Move the policy into config/scripts/release-policy.mjs with tests. * fix(release): load the policy module from the tagged commit Release events run the workflow file from the tag's commit, so checking out the default branch could pair an old workflow with a newer module. * fix(claude): write only the hook events and statusLine the user's Claude accepts (#23614) * refactor(claude): name the Claude version module after the hook events it gates Pure move of claude-session-end-hook-capability.ts and its tests; the next commit turns its one-event SessionEnd floor into a per-event version table. * fix(claude): write only the hook events the resolved Claude knows Claude 1.0.81 through 2.1.100 validate settings.json `hooks` against a closed event enum and discard the whole file on one unknown name, so Orca's install made Claude <= 2.1.77 silently ignore the user's env, permissions and hooks. Each managed event now carries the first Claude release that knows it (pinned to per-release enums read from the npm packages), and install, status and the SSH/WSL relay installer write only the events the resolved Claude accepts. An unresolved version gets the set every tabled Claude knows; a downgrade removes only Orca's own entry for an event the older Claude would reject. * refactor(claude): move the managed Claude hook events into their own module hook-settings.ts is at its line limit; the event list and its version gate move out whole so the next change has room. * fix(claude): an unresolved Claude version never removes Orca's hook entries A failed or timed-out version probe is no evidence of an old Claude, so it must not strip StopFailure, PermissionRequest and the other newer events a version-aware install wrote. With the version unknown, install adds only the set every tabled Claude knows and leaves every other entry exactly as it is; only a known version that lacks an event retires Orca's entry. * fix(claude): gate the core hook events on the Claude release that added them Claude validates hooks against a closed event list from 1.0.23, not 1.0.81. The table treated SessionStart, UserPromptSubmit, Stop, SubagentStop, PreToolUse and PostToolUse as known by every resolved version, so a Claude from 1.0.23 to 1.0.61 was still sent names it rejects, and it dropped the whole settings file. Pin each to its first release from the packed enums and keep the unresolved-version set as its own policy. * fix(claude): write Orca's statusLine only for a Claude that knows it Claude 1.0.49 through 1.0.66 also reject any unknown top-level settings key, and statusLine joined that schema only in 1.0.64. Orca wrote its statusLine for every Claude, so 1.0.49 to 1.0.63 still dropped the whole settings file even with the event gate. Gate statusLine on 1.0.64, pinned by the packed schemas; a known older Claude has Orca's own statusLine removed along with the opt-out marker, so an upgrade re-adds it. An unresolved version is now assumed to be 1.0.64, which knows the same core events and keeps the statusLine install it had before. * test(claude): a user statusLine opt-out survives a downgrade and upgrade Retiring Orca's statusLine for a Claude older than 1.0.64 forgets the install marker only when Orca's own statusLine was removed. Pin that, so a user who deleted Orca's statusLine is not opted back in by an upgrade. * test(claude): check the whole written settings file against each strict schema Claude 1.0.49 through 1.0.66 discard the whole settings file over any top-level key their schema lacks. The fixture recorded only whether each release knew statusLine, so a new top-level key Orca wrote would pass every test. Record each release's top-level keys instead (statusLine is derived from them), add the hook enums for every packed release in that window, and check that a real install and a downgrade write only keys and events each strict release accepts. * fix(native-chat): a failed Codex turn keeps its failure and "Worked for" (#23514) * fix(native-chat): a Codex turn's first terminal settlement is final Codex follows a turn-ending `error` with a failed `turn/completed` for the same turn. The error settled the turn and dropped its start and attributed send; the completion then re-settled it from nothing, so the record lost its start time and flipped from completed/failure to interrupted/failure. A failed turn lost its "Worked for" and read as interrupted. Both ends now go through one settlement that refuses a turn already in the recent-turns window, so every later end (error then completion, a duplicate completion) adds nothing and overwrites nothing. * test(native-chat): the settles-once fixture is an ordinary failed turn The fixture was labelled and worded as a failed compaction; this change covers the ordinary-turn path, so its frames now read as one. * test(native-chat): a failed Codex turn keeps its record when its two ends coalesce in the queue * fix(terminal): stop guessing that apps died and wiping their keyboard modes (#23584) * fix(terminal): stop guessing that apps died and wiping their keyboard modes The renderer wiped xterm's Kitty keyboard flags on every Ctrl+C, every live reattach, and every Windows agent turn end, though the app usually survives. xterm then encoded keys in legacy form while the pane mirror Orca's shortcut policy reads still held the negotiated flags, so Cmd+C, Shift+Enter, Option/Alt and IME commits disagreed with each other and with the app. - Delete the Ctrl+C wipe, the ConPTY agent-idle wipe, and the mirror reset on every PTY exit (it also ran on unverified host-loss exits). - Live reattach profiles no longer reset Kitty; every replay epilogue instead re-asserts the mirror's flags (pop-all, then the host-proven set; a bare pop while unproven), so a revealed xterm gets the live app's flags back. - Route every renderer-originated mode write through one scanning writer so xterm and the mirror always parse the same bytes: confirmed-shell reset, hibernate, cold restore, and a full process-boundary ground at fresh spawn. - Read Kitty flags as 0 where the protocol is withheld (ConPTY), since xterm ignores CSI u there but the mirror still scans it. - The dashboard popout restores snapshot flags as bytes so its xterm agrees. * style(terminal): separate the kitty restore builder from the pen reset * fix(terminal): let the kitty mirror own the withheld-protocol rule Review follow-ups for the stop-guessing change: - The mirror takes a `kittyKeyboard` option from the xterm's advertisement and ignores CSI u when withheld, as xterm does, replacing a per-reader helper that any new reader could skip. Daemon/headless users keep the default. - Replay epilogues are writers (`writeReplayEpilogue`, `writeReattachReplayReset`) that take the sync or async xterm writer, so nothing that looks like a builder mutates the mirror. - An abandoned hidden restore re-asserts the mirror's kitty flags after the byte-gap reset: its discarded chunks were already scanned. - Tests pin a non-zero host restore (epilogue ends `=31u`, mirror 31), a withheld pane staying at 0, and the restart-in-place ground landing after the mirror reset; the epilogue test helper is now an exact builder. * refactor(terminal): one epilogue writer and one scanned ground per boundary - Reattach callers write `chooseReattachReplayReset(...)` through `writeReplayEpilogue`, dropping the second writer from the session. - Fresh spawn and cold restore rely on their scanned ground alone: it leaves the mirror known at 0 with a proven baseline, so the extra reset() was dead. * feat(terminal): add Reset Terminal that grounds input modes on the host and the pane An app that crashes where the host sees no command end (no shell hooks, after exec bash, inside a manual ssh) keeps its Kitty, mouse, paste and focus modes. Reset Terminal grounds them in every model that can re-arm them: the pane's xterm and Kitty mirror, the daemon emulator, records and lifecycle scanner, the relay replay buffer, and main's headless model, so park/reveal, reattach and reload stay grounded. Each holder grounds its own model at the request, like Clear Screen. A zero-raw in-stream span would be dropped by SSH credit delivery and is ambiguous under snapshot-seq dedup. The host request is a sibling of clear, not a field on it, because an older host would ignore the field and clear scrollback instead. * test(e2e): Reset Terminal grounds an unhooked crash's modes through park and reveal * test(runtime): pin Reset Terminal's headless snapshot to a proven 0 kitty flag * fix(terminal): ground main's provider mode tracker in arrival order on Reset Terminal onPtyData scans live bytes into the tracker on arrival, so a ground queued on the headless write chain could land after a newer ?1049h and leave the tracker grounded while the emulator stays on the alternate screen. Also pass the serializer registry's clear/reset hooks as an options object. * fix(terminal): ground in-flight provider snapshot captures on Reset Terminal onPtyData feeds both the settled provider mode tracker and any in-flight capture's live tracker; the reset grounded only the first, so a capture whose request predated the reset could republish the pre-reset alternate screen. Share one scanProviderModeTrackers for both. Cover the pty:resetInputModes IPC handler and the runtime controller's host-window request. --------- Co-authored-by: GuanBear <123guan@gmail.com> Co-authored-by: guanbear Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com> Co-authored-by: Claude Co-authored-by: Harkaran Brar <18134082+harkaranbrar7@users.noreply.github.com> Co-authored-by: Prarambha369 <98906077+Prarambha369@users.noreply.github.com> Co-authored-by: Lesley Murfin <260182349+LesleyMurfin@users.noreply.github.com> Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Co-authored-by: dalveytech-vincent Co-authored-by: Eridanus117 <45489268+Eridanus117@users.noreply.github.com> Co-authored-by: xingqingzzp-gif Co-authored-by: jyang2004 Co-authored-by: yunqian Co-authored-by: huzhening.hzn Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../daemon/daemon-pty-buffer-snapshots.ts | 5 + src/main/daemon/daemon-pty-router.ts | 4 + src/main/daemon/daemon-request-router.ts | 3 + .../degraded-daemon-pty-provider.test.ts | 1 + .../daemon/degraded-daemon-pty-provider.ts | 1 + src/main/daemon/session-output-plane.ts | 10 ++ .../daemon/session-reset-input-modes.test.ts | 89 ++++++++++++ src/main/daemon/session.ts | 14 +- src/main/daemon/terminal-host.ts | 4 + .../daemon/terminal-shell-recovery-barrier.ts | 7 + src/main/daemon/types.ts | 7 +- src/main/ipc/pty-reset-input-modes.test.ts | 106 ++++++++++++++ src/main/ipc/pty/ipc/resize-visibility.ts | 9 ++ src/main/ipc/pty/runtime/controller.ts | 2 + src/main/ipc/pty/runtime/operations.ts | 15 ++ src/main/providers/local-pty-provider.ts | 2 + src/main/providers/provider-dispatch.test.ts | 1 + src/main/providers/pty-provider-contract.ts | 2 + .../ssh-pty-provider-rpc-operations.ts | 3 + src/main/providers/ssh-pty-provider.ts | 1 + ...time-create-pty-headless-terminal-state.ts | 18 +++ src/main/runtime/orca-runtime-on-pty-data.ts | 13 +- ...-runtime-serialize-main-terminal-buffer.ts | 10 ++ ...nal-creation-and-readiness-part-09.spec.ts | 75 ++++++++++ .../runtime/pty-shell-ownership-mirror.ts | 5 + ...terminal-manifest-characterization.test.ts | 5 +- .../terminal/terminal-query-methods.ts | 7 + .../runtime-pty-controller-contract.ts | 1 + src/preload/api/pty-api.ts | 2 + src/preload/api/pty-bridge-session-control.ts | 3 + .../pty-bridge-stream-and-serialization.ts | 5 + src/relay/pty-handler-shell-recovery.test.ts | 13 ++ src/relay/pty-handler.ts | 10 ++ .../TerminalContextMenu.test.tsx | 1 + .../terminal-pane/TerminalContextMenu.tsx | 10 ++ .../terminal-pane/TerminalPaneSurface.tsx | 1 + .../pty-buffer-serializer.test.ts | 14 ++ .../terminal-pane/pty-buffer-serializer.ts | 12 +- ...-connection-kitty-keyboard-restore.test.ts | 15 ++ .../pty-connection-test-environment.ts | 2 + .../pane-serializer-register.ts | 15 +- .../terminal-input-mode-reset.ts | 18 +++ .../use-terminal-pane-context-menu.ts | 10 ++ src/renderer/src/i18n/locales/en.json | 1 + src/renderer/src/i18n/locales/es.json | 1 + src/renderer/src/i18n/locales/fr.json | 1 + src/renderer/src/i18n/locales/ja.json | 1 + src/renderer/src/i18n/locales/ko.json | 1 + src/renderer/src/i18n/locales/zh.json | 1 + .../src/runtime/web-runtime-session.ts | 7 +- .../runtime/web-runtime-terminal-actions.ts | 29 ---- .../web-runtime-terminal-buffer-actions.ts | 49 +++++++ .../src/web/preload-api/web-terminal-api.ts | 3 + .../rpc-params-catalog.generated.ts | 1 + tests/e2e/terminal-reset-input-modes.spec.ts | 131 ++++++++++++++++++ 55 files changed, 724 insertions(+), 53 deletions(-) create mode 100644 src/main/daemon/session-reset-input-modes.test.ts create mode 100644 src/main/ipc/pty-reset-input-modes.test.ts create mode 100644 src/renderer/src/components/terminal-pane/terminal-input-mode-reset.ts create mode 100644 src/renderer/src/runtime/web-runtime-terminal-buffer-actions.ts create mode 100644 tests/e2e/terminal-reset-input-modes.spec.ts diff --git a/src/main/daemon/daemon-pty-buffer-snapshots.ts b/src/main/daemon/daemon-pty-buffer-snapshots.ts index f640483a39f9..0bfb6cd44c91 100644 --- a/src/main/daemon/daemon-pty-buffer-snapshots.ts +++ b/src/main/daemon/daemon-pty-buffer-snapshots.ts @@ -184,6 +184,11 @@ export abstract class DaemonPtyBufferSnapshots extends DaemonPtySessionControl { this.markSessionDirty(id) } + async resetInputModes(id: string): Promise { + await this.client.request('resetInputModes', { sessionId: id }) + this.markSessionDirty(id) + } + acknowledgeDataEvent(_id: string, _charCount: number): void { // No flow control for daemon-backed terminals } diff --git a/src/main/daemon/daemon-pty-router.ts b/src/main/daemon/daemon-pty-router.ts index 2fbfd17a0391..c3330e618263 100644 --- a/src/main/daemon/daemon-pty-router.ts +++ b/src/main/daemon/daemon-pty-router.ts @@ -162,6 +162,10 @@ export class DaemonPtyRouter implements IPtyProvider { await this.adapterFor(id).clearBuffer(id) } + async resetInputModes(id: string): Promise { + await this.adapterFor(id).resetInputModes(id) + } + async closeStartupQueryAuthority(id: string): Promise { return (await this.adapterFor(id).closeStartupQueryAuthority?.(id)) ?? 0 } diff --git a/src/main/daemon/daemon-request-router.ts b/src/main/daemon/daemon-request-router.ts index ae007366dd02..9bd0d7963b64 100644 --- a/src/main/daemon/daemon-request-router.ts +++ b/src/main/daemon/daemon-request-router.ts @@ -129,6 +129,9 @@ export class DaemonRequestRouter { case 'clearScrollback': this.options.host.clearScrollback(request.payload.sessionId) return {} + case 'resetInputModes': + this.options.host.resetInputModes(request.payload.sessionId) + return {} case 'listSessions': return { sessions: this.options.host.listSessions() } case 'shutdownIfIdle': diff --git a/src/main/daemon/degraded-daemon-pty-provider.test.ts b/src/main/daemon/degraded-daemon-pty-provider.test.ts index f2e86abab280..363e9125b26a 100644 --- a/src/main/daemon/degraded-daemon-pty-provider.test.ts +++ b/src/main/daemon/degraded-daemon-pty-provider.test.ts @@ -50,6 +50,7 @@ function createProvider( getCwd: vi.fn(async () => ''), getInitialCwd: vi.fn(async () => ''), clearBuffer: vi.fn(async () => {}), + resetInputModes: vi.fn(async () => {}), acknowledgeDataEvent: vi.fn(), hasChildProcesses: vi.fn(async () => false), getForegroundProcess: vi.fn(async () => null), diff --git a/src/main/daemon/degraded-daemon-pty-provider.ts b/src/main/daemon/degraded-daemon-pty-provider.ts index 2b50424ae830..6db8c80ac879 100644 --- a/src/main/daemon/degraded-daemon-pty-provider.ts +++ b/src/main/daemon/degraded-daemon-pty-provider.ts @@ -168,6 +168,7 @@ export class DegradedDaemonPtyProvider implements IPtyProvider { } clearBuffer = (id: string): Promise => this.providerFor(id).clearBuffer(id) + resetInputModes = (id: string): Promise => this.providerFor(id).resetInputModes(id) async closeStartupQueryAuthority(id: string): Promise { return (await this.providerFor(id).closeStartupQueryAuthority?.(id)) ?? 0 diff --git a/src/main/daemon/session-output-plane.ts b/src/main/daemon/session-output-plane.ts index 507ca01a927e..04b3f773bda3 100644 --- a/src/main/daemon/session-output-plane.ts +++ b/src/main/daemon/session-output-plane.ts @@ -125,6 +125,16 @@ export class SessionOutputPlane { }) } + /** Grounds the emulator and the cold-restore records without a client + * broadcast; attached renderers ground themselves (Reset Terminal). */ + applyInputModeGround(ground: string): void { + if (this.disposed) { + return + } + this.emulator.write(ground) + this.record({ kind: 'output', data: ground }) + } + isCursorOnEmptyPromptLine(): boolean { return this.emulator.isCursorOnEmptyPromptLine() } diff --git a/src/main/daemon/session-reset-input-modes.test.ts b/src/main/daemon/session-reset-input-modes.test.ts new file mode 100644 index 000000000000..ea1aa7e7351e --- /dev/null +++ b/src/main/daemon/session-reset-input-modes.test.ts @@ -0,0 +1,89 @@ +import { describe, expect, it, vi } from 'vitest' +import { Session } from './session' +import type { SubprocessHandle } from './session-subprocess-handle' + +function createSession() { + let onData: ((data: string) => void) | null = null + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Session reads only these members. + const handle = { + pid: 999, + getForegroundProcess: () => null, + confirmShellForeground: vi.fn(async () => false), + write: () => {}, + resize: () => {}, + pause: () => {}, + resume: () => {}, + kill: () => {}, + forceKill: () => {}, + signal: () => {}, + terminateOwnedTree: () => 'unavailable' as const, + onData(cb: (data: string) => void) { + onData = cb + }, + onExit() {}, + dispose: () => {} + } as unknown as SubprocessHandle + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the omitted options are optional. + const session = new Session({ + sessionId: 'reset', + cols: 80, + rows: 24, + subprocess: handle, + shellReadySupported: false + } as never) + const received: string[] = [] + session.attachClient({ onData: (data: string) => received.push(data), onExit: () => {} }) + return { session, received, emit: (data: string) => onData?.(data) } +} + +async function readModes(session: Session) { + await session.settleShellOwnershipConfirmation() + return session.getSnapshot()!.modes +} + +describe('Session.resetInputModes', () => { + it('grounds modes an app left armed without a command end, and the next snapshot carries it', async () => { + const { session, received, emit } = createSession() + // A crashed app's arming with no OSC 133;D the barrier could ground at. + emit('prompt$ app\r\n\x1b[>31u\x1b[?1000h\x1b[?1006h\x1b[?2004h\x1b[?1h') + const armed = await readModes(session) + expect(armed).toMatchObject({ + kittyKeyboardFlags: 31, + mouseTracking: true, + bracketedPaste: true + }) + session.takePendingOutput(false) + const broadcast = received.length + + session.resetInputModes() + + expect(await readModes(session)).toMatchObject({ + kittyKeyboardFlags: 0, + mouseTracking: false, + sgrMouseMode: false, + bracketedPaste: false, + applicationCursor: false, + alternateScreen: false + }) + // Clients ground themselves; a zero-raw span here would be dropped or duplicated. + expect(received).toHaveLength(broadcast) + const records = session.takePendingOutput(false)!.records + expect(records).toEqual([{ kind: 'output', data: expect.stringContaining('\x1b[<99u') }]) + session.dispose() + }) + + it('keeps focus reporting the terminal host armed for the pane', async () => { + const { session, emit } = createSession() + // ConPTY arms ?1004h before any shell marker. + emit('\x1b[?1004hprompt$ ') + await readModes(session) + session.takePendingOutput(false) + + session.resetInputModes() + + const [record] = session.takePendingOutput(false)!.records + expect(record).toMatchObject({ kind: 'output' }) + expect(record?.kind === 'output' && record.data).not.toContain('\x1b[?1004l') + session.dispose() + }) +}) diff --git a/src/main/daemon/session.ts b/src/main/daemon/session.ts index e69bec7c5b1c..7d1136652924 100644 --- a/src/main/daemon/session.ts +++ b/src/main/daemon/session.ts @@ -146,13 +146,9 @@ export class Session { // Daemon POSIX PTYs need the local provider's cooked-echo containment (#13137). // DA1/CPR stay immediate unless an echo-risk reply is already held (#13892, #15559). - if (this.startupIngress.answerLiveQueryReply(data)) { - return - } - - // Why: keep queuing during the post-ready flush-gate window ('ready' but not yet flushed); a - // direct write would race fresh input ahead of the buffered startup command. - if (this.shellReady.tryEnqueue(data)) { + // Why the queue: keep queuing during the post-ready flush-gate window ('ready' but not yet + // flushed); a direct write would race fresh input ahead of the buffered startup command. + if (this.startupIngress.answerLiveQueryReply(data) || this.shellReady.tryEnqueue(data)) { return } @@ -277,6 +273,10 @@ export class Session { this.output.clearScrollback(this.subprocess, this.shellReady.isGatingWrites) } + resetInputModes(): void { + this.output.applyInputModeGround(this.recoveryBarrier.groundInputModes()) + } + prepareForFinalSnapshot(): string { const held = this.shellReady.releaseHeldBytes() this.startupIngress.snapshotBarrier() diff --git a/src/main/daemon/terminal-host.ts b/src/main/daemon/terminal-host.ts index 6e8d5ceee816..d5669618c7a1 100644 --- a/src/main/daemon/terminal-host.ts +++ b/src/main/daemon/terminal-host.ts @@ -277,6 +277,10 @@ export class TerminalHost { getAliveTerminalHostSession(this.sessions, sessionId).clearScrollback() } + resetInputModes(sessionId: string): void { + getAliveTerminalHostSession(this.sessions, sessionId).resetInputModes() + } + // Why: null-not-throw — checkpoint is best-effort against a session that may have just exited. getSnapshot(sessionId: string, opts: { scrollbackRows?: number } = {}): TerminalSnapshot | null { return getTerminalHostSnapshot(this.sessions.get(sessionId), opts) diff --git a/src/main/daemon/terminal-shell-recovery-barrier.ts b/src/main/daemon/terminal-shell-recovery-barrier.ts index 6fe5832dcf1a..d8a29d4b4b43 100644 --- a/src/main/daemon/terminal-shell-recovery-barrier.ts +++ b/src/main/daemon/terminal-shell-recovery-barrier.ts @@ -86,6 +86,13 @@ export class TerminalShellRecoveryBarrier { return this.scanner.owner } + /** Reset Terminal: grounds the lifecycle model now and returns the bytes for + * the host's other models. Not released downstream: a zero-raw span is dropped + * by credit-windowed delivery and snapshot-seq dedup, so each client grounds itself. */ + groundInputModes(): string { + return this.scanner.groundProcessBoundary() + } + /** Answers a paired runtime's ownership question from the barrier's settled * state. The barrier scans bytes before any consumer receives them, so its * verdict is never behind the caller's parse position — a fresh process diff --git a/src/main/daemon/types.ts b/src/main/daemon/types.ts index d8d88fab0333..2ef4dfeb117a 100644 --- a/src/main/daemon/types.ts +++ b/src/main/daemon/types.ts @@ -206,9 +206,10 @@ export type GetCwdRequest = { } } -export type ClearScrollbackRequest = { +// Why resetInputModes is a type, not a clear flag: an older daemon rejects it instead of clearing. +export type TerminalBufferActionRequest = { id: string - type: 'clearScrollback' + type: 'clearScrollback' | 'resetInputModes' payload: { sessionId: string } @@ -321,7 +322,7 @@ export type DaemonRequest = | InspectProcessRequest | ConfirmForegroundProcessRequest | ConfirmShellForegroundRequest - | ClearScrollbackRequest + | TerminalBufferActionRequest | ShutdownRequest | PingRequest | SystemResolverHealthRequest diff --git a/src/main/ipc/pty-reset-input-modes.test.ts b/src/main/ipc/pty-reset-input-modes.test.ts new file mode 100644 index 000000000000..55fa628078d5 --- /dev/null +++ b/src/main/ipc/pty-reset-input-modes.test.ts @@ -0,0 +1,106 @@ +import { describe, expect, it, vi } from 'vitest' +import { onMock } from './pty-ipc-mock-registry' +import { setupPtyIpcSuite } from './pty-ipc-test-harness' +import { registerPtyHandlers } from './pty' + +vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock())) +vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock())) +vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock())) +vi.mock('node:child_process', async (importOriginal) => + (await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal()) +) +vi.mock('../opencode/hook-service', () => + import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock()) +) +vi.mock('../mimo/hook-service', () => + import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock()) +) +vi.mock('../agent-hooks/server', () => + import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock()) +) +vi.mock('../pi/titlebar-extension-service', () => + import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock()) +) +vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock())) +vi.mock('../wsl', async (importOriginal) => + (await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal()) +) +vi.mock('../telemetry/client', () => + import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock()) +) +vi.mock('../telemetry/classify-error', () => + import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock()) +) +vi.mock('../cli/linux-terminal-orca-cli-shim', () => + import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock()) +) +vi.mock('../memory/pty-registry', () => + import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock()) +) +vi.mock('../agent-hooks/migration-unsupported-pty-state', () => + import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock()) +) +vi.mock('../codex/codex-pane-account-registry', () => + import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock()) +) +vi.mock('../codex/codex-state-db-backfill-recovery', () => + import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock()) +) + +describe('Reset Terminal main-side entry points', () => { + const { handlers, mainWindow, installDaemonTestProvider } = setupPtyIpcSuite() + + function setup() { + const resetInputModes = vi.fn(async () => {}) + installDaemonTestProvider({ resetInputModes }) + let controller: { resetInputModes: (ptyId: string) => Promise } | undefined + const runtime = { + setPtyController: vi.fn((next) => { + controller = next + }), + resetHeadlessTerminalInputModes: vi.fn(async () => {}) + } + handlers.clear() + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: registration reads only these members. + registerPtyHandlers(mainWindow as never, runtime as never) + return { resetInputModes, runtime, controller: controller! } + } + + it('grounds the provider and the headless model from the pane IPC', () => { + const { resetInputModes, runtime } = setup() + const listener = onMock.mock.calls.findLast( + (entry: unknown[]) => entry[0] === 'pty:resetInputModes' + )?.[1] + if (typeof listener !== 'function') { + throw new Error('missing pty:resetInputModes listener') + } + + listener(null, { id: 'pty-1' }) + + expect(resetInputModes).toHaveBeenCalledWith('pty-1') + expect(runtime.resetHeadlessTerminalInputModes).toHaveBeenCalledWith('pty-1') + // The pane grounded itself before sending; echoing back would ground it twice. + expect(mainWindow.webContents.send).not.toHaveBeenCalledWith( + 'pty:resetInputModes:request', + expect.anything() + ) + }) + + it("grounds the host window's pane and the provider for a runtime-initiated reset", async () => { + const { resetInputModes, controller } = setup() + + await controller.resetInputModes('pty-1') + + expect(mainWindow.webContents.send).toHaveBeenCalledWith('pty:resetInputModes:request', { + ptyId: 'pty-1' + }) + expect(resetInputModes).toHaveBeenCalledWith('pty-1') + }) + + it('swallows an older host rejecting the request', async () => { + const { resetInputModes, controller } = setup() + resetInputModes.mockRejectedValueOnce(new Error('Unknown request type: resetInputModes')) + + await expect(controller.resetInputModes('pty-1')).resolves.toBeUndefined() + }) +}) diff --git a/src/main/ipc/pty/ipc/resize-visibility.ts b/src/main/ipc/pty/ipc/resize-visibility.ts index c9f3e92c6207..62e74738b726 100644 --- a/src/main/ipc/pty/ipc/resize-visibility.ts +++ b/src/main/ipc/pty/ipc/resize-visibility.ts @@ -322,4 +322,13 @@ export function installPtyResizeVisibilityIpc(session: PtyIpcSession): void { .catch(() => {}) runtime?.clearHeadlessTerminalBuffer(args.id).catch(() => {}) }) + + ipcMain.removeAllListeners('pty:resetInputModes') + ipcMain.on('pty:resetInputModes', (_event, args: { id: string }) => { + // Why: an older daemon or relay rejects the request; its model keeps the modes until reattach. + tryGetProviderForPty(args.id) + ?.resetInputModes(args.id) + .catch(() => {}) + runtime?.resetHeadlessTerminalInputModes(args.id).catch(() => {}) + }) } diff --git a/src/main/ipc/pty/runtime/controller.ts b/src/main/ipc/pty/runtime/controller.ts index 75ff168a6460..4013e06e37fa 100644 --- a/src/main/ipc/pty/runtime/controller.ts +++ b/src/main/ipc/pty/runtime/controller.ts @@ -10,6 +10,7 @@ import { import { attachPtyFromRuntimeController, clearBufferFromRuntimeController, + resetInputModesFromRuntimeController, confirmForegroundProcessFromRuntimeController, confirmShellForegroundFromRuntimeController, getCwdFromRuntimeController, @@ -70,6 +71,7 @@ export function installPtyRuntimeController(deps: PtyRuntimeControllerDeps): voi getCwd: (ptyId) => getCwdFromRuntimeController(ptyId), hasChildProcesses: (ptyId) => hasChildProcessesFromRuntimeController(ptyId), clearBuffer: (ptyId) => clearBufferFromRuntimeController(deps, ptyId), + resetInputModes: (ptyId) => resetInputModesFromRuntimeController(deps, ptyId), hasPty: (ptyId) => hasPtyFromRuntimeController(deps, ptyId), listProcesses: (connectionId, opts) => listProcessesFromRuntimeController(deps, connectionId, opts), diff --git a/src/main/ipc/pty/runtime/operations.ts b/src/main/ipc/pty/runtime/operations.ts index 5fec2c25e26f..c555c0b31021 100644 --- a/src/main/ipc/pty/runtime/operations.ts +++ b/src/main/ipc/pty/runtime/operations.ts @@ -193,6 +193,21 @@ export async function clearBufferFromRuntimeController( } } +export async function resetInputModesFromRuntimeController( + deps: PtyRuntimeControllerDeps, + ptyId: string +): Promise { + // Why: a remote client's reset must also ground this host window's view of the pane. + if (deps.mainWindow && !deps.mainWindow.isDestroyed()) { + deps.mainWindow.webContents.send('pty:resetInputModes:request', { ptyId }) + } + try { + await getProviderForPty(ptyId).resetInputModes(ptyId) + } catch { + /* best effort: an older daemon or relay rejects the request */ + } +} + const settledLocalPtyProviderStartups = new WeakSet>() const watchedLocalPtyProviderStartups = new WeakSet>() diff --git a/src/main/providers/local-pty-provider.ts b/src/main/providers/local-pty-provider.ts index a8e2f9ce6094..728e8a1273ab 100644 --- a/src/main/providers/local-pty-provider.ts +++ b/src/main/providers/local-pty-provider.ts @@ -118,6 +118,8 @@ export class LocalPtyProvider implements IPtyProvider { clearBuffer(id: string): Promise { return clearLocalPtyBuffer(id) } + // A direct PTY keeps no terminal model of its own. + async resetInputModes(_id: string): Promise {} closeStartupQueryAuthority(id: string): number { return closeLocalPtyStartupQueryAuthority(id) } diff --git a/src/main/providers/provider-dispatch.test.ts b/src/main/providers/provider-dispatch.test.ts index cc63cfb9d09d..c6f00c98354a 100644 --- a/src/main/providers/provider-dispatch.test.ts +++ b/src/main/providers/provider-dispatch.test.ts @@ -109,6 +109,7 @@ describe('PTY provider dispatch', () => { getCwd: vi.fn(), getInitialCwd: vi.fn(), clearBuffer: vi.fn(), + resetInputModes: vi.fn(), acknowledgeDataEvent: vi.fn(), hasChildProcesses: vi.fn(), getForegroundProcess: vi.fn(), diff --git a/src/main/providers/pty-provider-contract.ts b/src/main/providers/pty-provider-contract.ts index 4b31fbbb2c8b..d2b38bd4b2f2 100644 --- a/src/main/providers/pty-provider-contract.ts +++ b/src/main/providers/pty-provider-contract.ts @@ -224,6 +224,8 @@ export type IPtyProvider = { getCwd(id: string): Promise getInitialCwd(id: string): Promise clearBuffer(id: string): Promise + /** Grounds the host's own terminal models (Reset Terminal); renderers ground themselves. */ + resetInputModes(id: string): Promise /** Ordered handoff from startup source authority to the live/hidden view authority. */ closeStartupQueryAuthority?: (id: string) => Promise | number acknowledgeDataEvent(id: string, charCount: number): void diff --git a/src/main/providers/ssh-pty-provider-rpc-operations.ts b/src/main/providers/ssh-pty-provider-rpc-operations.ts index bcd847de27b0..361bdc157151 100644 --- a/src/main/providers/ssh-pty-provider-rpc-operations.ts +++ b/src/main/providers/ssh-pty-provider-rpc-operations.ts @@ -34,6 +34,9 @@ export function createSshPtyProviderRpcOperations({ mux, toRelayPtyId }: SshPtyP clearBuffer: async (id: string): Promise => { await mux.request('pty.clearBuffer', { id: toRelayPtyId(id) }) }, + resetInputModes: async (id: string): Promise => { + await mux.request('pty.resetInputModes', { id: toRelayPtyId(id) }) + }, closeStartupQueryAuthority: async (id: string): Promise => { const result = (await mux.request('pty.closeStartupQueryAuthority', { id: toRelayPtyId(id) diff --git a/src/main/providers/ssh-pty-provider.ts b/src/main/providers/ssh-pty-provider.ts index 76b5d9f85e48..854e076cec5d 100644 --- a/src/main/providers/ssh-pty-provider.ts +++ b/src/main/providers/ssh-pty-provider.ts @@ -55,6 +55,7 @@ export class SshPtyProvider implements IPtyProvider { getCwd = (id: string): Promise => this.rpcOperations.getCwd(id) getInitialCwd = (id: string): Promise => this.rpcOperations.getInitialCwd(id) clearBuffer = (id: string): Promise => this.rpcOperations.clearBuffer(id) + resetInputModes = (id: string): Promise => this.rpcOperations.resetInputModes(id) closeStartupQueryAuthority = (id: string): Promise => this.rpcOperations.closeStartupQueryAuthority(id) acknowledgeDataEvent = (id: string, charCount: number): void => diff --git a/src/main/runtime/orca-runtime-create-pty-headless-terminal-state.ts b/src/main/runtime/orca-runtime-create-pty-headless-terminal-state.ts index dbdf4f1c37ae..4ebeed55f903 100644 --- a/src/main/runtime/orca-runtime-create-pty-headless-terminal-state.ts +++ b/src/main/runtime/orca-runtime-create-pty-headless-terminal-state.ts @@ -6,6 +6,7 @@ import { shouldForwardHeadlessTerminalQueryReply } from './headless-terminal-que import { isNativeWindowsConptyPty } from './terminal-model-query-authority' import { getTerminalViewAttributes } from './terminal-view-attribute-store' import { PtyShellOwnershipMirror } from './pty-shell-ownership-mirror' +import { PROCESS_BOUNDARY_GROUND } from '../../shared/terminal-mode-reset-profiles' export class OrcaRuntimeWithCreatePtyHeadlessTerminalState extends OrcaRuntimeWithMaybeHydrateHeadlessFromRenderer { /** Shared factory for the per-PTY runtime emulators (seed, hydration, and @@ -195,4 +196,21 @@ export class OrcaRuntimeWithCreatePtyHeadlessTerminalState extends OrcaRuntimeWi state.writeChain = state.writeChain.then(() => state.emulator.clearScrollback()) await state.writeChain } + + // Public: Reset Terminal must ground this model too; park/reveal and mobile restore from it. + async resetHeadlessTerminalInputModes(ptyId: string): Promise { + // Why now, not on the chain: onPtyData scans live bytes into these on arrival. + // Focus is outside their model, so the plain ground is exact. + this.scanProviderModeTrackers(ptyId, PROCESS_BOUNDARY_GROUND) + const state = this.headlessTerminals.get(ptyId) + if (!state) { + return + } + // Why on the chain: the ground must land after every PTY chunk already queued. + const completion = state.writeChain.then(async () => { + await state.emulator.write(state.ownership.groundInputModes()) + }) + state.writeChain = completion.catch(() => {}) + await completion + } } diff --git a/src/main/runtime/orca-runtime-on-pty-data.ts b/src/main/runtime/orca-runtime-on-pty-data.ts index 160c99f20717..57b094165dae 100644 --- a/src/main/runtime/orca-runtime-on-pty-data.ts +++ b/src/main/runtime/orca-runtime-on-pty-data.ts @@ -16,6 +16,14 @@ import { import { extractOscTitleScanTail } from '../../shared/osc-title-scan-tail' export class OrcaRuntimeWithOnPtyData extends OrcaRuntimeWithPreparePtyExecutionContext { + /** Arrival-order mode scan: the settled tracker plus any in-flight snapshot capture's. */ + protected scanProviderModeTrackers(ptyId: string, data: string): void { + this.providerModeTrackersByPtyId.get(ptyId)?.scan(data) + for (const tracker of this.providerModeSnapshotScansByPtyId.get(ptyId) ?? []) { + tracker.scan(data) + } + } + onPtyData( ptyId: string, data: string, @@ -27,10 +35,7 @@ export class OrcaRuntimeWithOnPtyData extends OrcaRuntimeWithPreparePtyExecution ): number { const outputSequence = (this.ptyOutputSequenceById.get(ptyId) ?? 0) + sequenceChars this.ptyOutputSequenceById.set(ptyId, outputSequence) - this.providerModeTrackersByPtyId.get(ptyId)?.scan(data) - for (const tracker of this.providerModeSnapshotScansByPtyId.get(ptyId) ?? []) { - tracker.scan(data) - } + this.scanProviderModeTrackers(ptyId, data) const osc7Metadata = this.recordOsc7MetadataForPty(ptyId, data) const cwd = osc7Metadata.cwd const cwdChanged = osc7Metadata.cwdChanged diff --git a/src/main/runtime/orca-runtime-serialize-main-terminal-buffer.ts b/src/main/runtime/orca-runtime-serialize-main-terminal-buffer.ts index 7994f7d8857d..53a9b4ffc59c 100644 --- a/src/main/runtime/orca-runtime-serialize-main-terminal-buffer.ts +++ b/src/main/runtime/orca-runtime-serialize-main-terminal-buffer.ts @@ -80,6 +80,16 @@ export class OrcaRuntimeWithSerializeMainTerminalBuffer extends OrcaRuntimeWithA return { handle, cleared: true } } + async resetTerminalInputModes(handle: string): Promise<{ handle: string; reset: boolean }> { + const leaf = this.resolveLeafForHandle(handle) + if (!leaf?.ptyId) { + throw new Error('terminal_not_found') + } + await this.ptyController?.resetInputModes?.(leaf.ptyId) + await this.resetHeadlessTerminalInputModes(leaf.ptyId) + return { handle, reset: true } + } + getTerminalSize(ptyId: string): { cols: number; rows: number } | null { return this.ptyController?.getSize?.(ptyId) ?? null } diff --git a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts index ef0a1a96de53..ef895661c106 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts @@ -1,5 +1,7 @@ import { describe, expect, it, vi } from 'vitest' import { OrcaRuntimeService } from '../orca-runtime-test-mocks.spec' +import type { PtyProviderBufferSnapshot } from '../../providers/pty-provider-contract' +import { TerminalKittyKeyboardModeTracker } from '../../../shared/terminal-kitty-keyboard-mode-tracker' import { HEADLESS_LEAF_ID, TEST_WORKTREE_ID, @@ -199,6 +201,79 @@ describe('OrcaRuntimeService', () => { expect(snapshot?.data).not.toContain('line-0') }) + it('resets input modes through the PTY controller and the headless model', async () => { + const resetInputModes = vi.fn().mockResolvedValue(undefined) + const runtime = new OrcaRuntimeService(store) + runtime.setPtyController({ + write: () => true, + kill: () => true, + getForegroundProcess: async () => null, + resetInputModes + }) + syncSinglePty(runtime, 'pty-1') + // An app armed these and crashed with no command end. + runtime.onPtyData('pty-1', 'prompt$ app\r\n\x1b[>31u\x1b[?1000h\x1b[?2004h', 123) + const [terminal] = (await runtime.listTerminals()).terminals + const armed = await runtime.serializeTerminalBuffer('pty-1') + expect(armed?.kittyKeyboardFlags).toBe(31) + + await expect(runtime.resetTerminalInputModes(terminal.handle)).resolves.toEqual({ + handle: terminal.handle, + reset: true + }) + + expect(resetInputModes).toHaveBeenCalledWith('pty-1') + const snapshot = await runtime.serializeTerminalBuffer('pty-1') + expect(snapshot?.kittyKeyboardFlags).toBe(0) + expect(snapshot?.data).not.toContain('\x1b[?1000h') + expect(snapshot?.data).not.toContain('\x1b[?2004h') + }) + + it('grounds the provider mode tracker before a later chunk, in the emulator order', async () => { + const runtime = new OrcaRuntimeService(store) + syncSinglePty(runtime, 'pty-1') + runtime.onPtyData('pty-1', 'prompt$ ', 123) + const tracker = new TerminalKittyKeyboardModeTracker() + runtime['providerModeTrackersByPtyId'].set('pty-1', tracker) + + // A TUI starts while the reset still waits on the headless write chain. + const reset = runtime.resetHeadlessTerminalInputModes('pty-1') + runtime.onPtyData('pty-1', '\x1b[?1049h', 124) + await reset + await runtime['headlessTerminals'].get('pty-1')?.writeChain + + expect(runtime['headlessTerminals'].get('pty-1')?.emulator.isAlternateScreen).toBe(true) + expect(tracker.isAlternateScreen).toBe(true) + }) + + it('grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen', async () => { + let resolveSnapshot: (snapshot: PtyProviderBufferSnapshot) => void = () => {} + const runtime = new OrcaRuntimeService(store) + runtime.setPtyController({ + write: () => true, + kill: () => true, + getForegroundProcess: async () => null, + serializeProviderBuffer: () => new Promise((resolve) => (resolveSnapshot = resolve)) + }) + syncSinglePty(runtime, 'pty-1') + const generation = runtime['getPtyLifecycleGeneration']('pty-1') + + // The capture's daemon request left before the reset; its answer predates the ground. + const capture = runtime['captureProviderTerminalBuffer']('pty-1', {}, generation) + await runtime.resetHeadlessTerminalInputModes('pty-1') + resolveSnapshot({ + data: '', + cols: 80, + rows: 24, + seq: 1, + source: 'headless', + alternateScreen: true + }) + await capture + + expect(runtime['providerModeTrackersByPtyId'].get('pty-1')?.isAlternateScreen).toBe(false) + }) + it('waits for terminal exit and resolves with the exit status', async () => { const runtime = new OrcaRuntimeService(store) diff --git a/src/main/runtime/pty-shell-ownership-mirror.ts b/src/main/runtime/pty-shell-ownership-mirror.ts index 5c54465be756..45a7d8e8422b 100644 --- a/src/main/runtime/pty-shell-ownership-mirror.ts +++ b/src/main/runtime/pty-shell-ownership-mirror.ts @@ -42,6 +42,11 @@ export class PtyShellOwnershipMirror { } } + /** Reset Terminal: the ground for this mirror's view of mode ownership, already scanned. */ + groundInputModes(): string { + return this.scanner.groundProcessBoundary() + } + get owner(): TerminalOwner | undefined { return this.scanner.owner } diff --git a/src/main/runtime/rpc/methods/terminal-manifest-characterization.test.ts b/src/main/runtime/rpc/methods/terminal-manifest-characterization.test.ts index e26788d5d467..59370934057e 100644 --- a/src/main/runtime/rpc/methods/terminal-manifest-characterization.test.ts +++ b/src/main/runtime/rpc/methods/terminal-manifest-characterization.test.ts @@ -21,6 +21,7 @@ const METHOD_CASES: readonly (readonly [string, unknown, boolean])[] = [ ['terminal.agentStatus', { terminal: 'term' }, false], ['terminal.rename', { terminal: 'term', title: null }, false], ['terminal.clearBuffer', { terminal: 'term' }, false], + ['terminal.resetInputModes', { terminal: 'term' }, false], ['terminal.send', { terminal: 'term', text: 'x' }, false], ['terminal.wait', { terminal: 'term', for: 'exit' }, false], ['terminal.create', {}, false], @@ -67,11 +68,11 @@ async function invoke(name: string, params: unknown, runtime: Partial { it('preserves all method names, order, streaming flags, and parseable minimum inputs', () => { - expect(TERMINAL_METHODS).toHaveLength(35) + expect(TERMINAL_METHODS).toHaveLength(36) expect(TERMINAL_METHODS.map((method) => [method.name, 'stream' in method])).toEqual( METHOD_CASES.map(([name, _params, stream]) => [name, stream]) ) - expect(new Set(TERMINAL_METHODS.map((method) => method.name)).size).toBe(35) + expect(new Set(TERMINAL_METHODS.map((method) => method.name)).size).toBe(36) for (const [name, params] of METHOD_CASES) { expect(() => schemaFor(name).parse(params), name).not.toThrow() } diff --git a/src/main/runtime/rpc/methods/terminal/terminal-query-methods.ts b/src/main/runtime/rpc/methods/terminal/terminal-query-methods.ts index 52c1063b0cc7..68afc1e8d196 100644 --- a/src/main/runtime/rpc/methods/terminal/terminal-query-methods.ts +++ b/src/main/runtime/rpc/methods/terminal/terminal-query-methods.ts @@ -121,5 +121,12 @@ export const TERMINAL_QUERY_METHODS = [ handler: async (params, { runtime }) => ({ clear: await runtime.clearTerminalBuffer(params.terminal) }) + }), + defineMethod({ + name: 'terminal.resetInputModes', + params: TerminalHandle, + handler: async (params, { runtime }) => ({ + reset: await runtime.resetTerminalInputModes(params.terminal) + }) }) ] diff --git a/src/main/runtime/runtime-pty-controller-contract.ts b/src/main/runtime/runtime-pty-controller-contract.ts index 7b540a05e9a5..60c1e18cf10a 100644 --- a/src/main/runtime/runtime-pty-controller-contract.ts +++ b/src/main/runtime/runtime-pty-controller-contract.ts @@ -124,6 +124,7 @@ export type RuntimePtyController = { confirmShellForeground?(ptyId: string): Promise hasChildProcesses?(ptyId: string): Promise clearBuffer?(ptyId: string): Promise + resetInputModes?(ptyId: string): Promise resize?(ptyId: string, cols: number, rows: number): boolean // Why: exact-id mobile polls should not enumerate every local and SSH PTY. hasPty?(ptyId: string): boolean | null diff --git a/src/preload/api/pty-api.ts b/src/preload/api/pty-api.ts index 55937134bb13..eb45c4dba68c 100644 --- a/src/preload/api/pty-api.ts +++ b/src/preload/api/pty-api.ts @@ -84,6 +84,7 @@ export type PtyApi = { reportGeometry: (id: string, cols: number, rows: number) => void signal: (id: string, signal: string) => void clearBuffer: (id: string) => void + resetInputModes: (id: string) => void kill: (id: string, opts?: { keepHistory?: boolean }) => Promise ackColdRestore: (id: string) => void ackData: (id: string, charCount: number, processedChars?: number) => void @@ -229,6 +230,7 @@ export type PtyApi = { }) => void ) => () => void onClearBufferRequest: (callback: (data: { ptyId: string }) => void) => () => void + onResetInputModesRequest: (callback: (data: { ptyId: string }) => void) => () => void sendSerializedBuffer: ( requestId: string, snapshot: { diff --git a/src/preload/api/pty-bridge-session-control.ts b/src/preload/api/pty-bridge-session-control.ts index 225aec9618a2..1f8639c58be0 100644 --- a/src/preload/api/pty-bridge-session-control.ts +++ b/src/preload/api/pty-bridge-session-control.ts @@ -98,6 +98,9 @@ export const ptySessionControlApi = { clearBuffer: (id: string): void => { ipcRenderer.send('pty:clearBuffer', { id }) }, + resetInputModes: (id: string): void => { + ipcRenderer.send('pty:resetInputModes', { id }) + }, ackColdRestore: (id: string): void => { ipcRenderer.send('pty:ackColdRestore', { id }) }, diff --git a/src/preload/api/pty-bridge-stream-and-serialization.ts b/src/preload/api/pty-bridge-stream-and-serialization.ts index 49e2189fd537..557570c8eab6 100644 --- a/src/preload/api/pty-bridge-stream-and-serialization.ts +++ b/src/preload/api/pty-bridge-stream-and-serialization.ts @@ -120,6 +120,11 @@ export const ptyStreamAndSerializationApi = { ipcRenderer.on('pty:clearBuffer:request', listener) return () => ipcRenderer.removeListener('pty:clearBuffer:request', listener) }, + onResetInputModesRequest: (callback: (data: { ptyId: string }) => void): (() => void) => { + const listener = (_event: Electron.IpcRendererEvent, data: { ptyId: string }) => callback(data) + ipcRenderer.on('pty:resetInputModes:request', listener) + return () => ipcRenderer.removeListener('pty:resetInputModes:request', listener) + }, sendSerializedBuffer: ( requestId: string, snapshot: { diff --git a/src/relay/pty-handler-shell-recovery.test.ts b/src/relay/pty-handler-shell-recovery.test.ts index 0d34aa80ff90..54497cd1763b 100644 --- a/src/relay/pty-handler-shell-recovery.test.ts +++ b/src/relay/pty-handler-shell-recovery.test.ts @@ -193,4 +193,17 @@ describe.each([ expect(published()).toBe(`${DYING_COMMAND}${COMMAND_DONE}${PROMPT}`) }) + + it('grounds replay, not the live stream, on Reset Terminal after an unhooked crash', async () => { + // Armed with no command end: nothing the host barrier could ground at. + const unhookedCrash = '\x1b[>1u\x1b[?1000h' + await stream(unhookedCrash, PROMPT) + + dispatcher.feed(requestFrame(4, 'pty.resetInputModes', { id: ptyId })) + await vi.advanceTimersByTimeAsync(50) + + // The client grounds its own view; a zero-raw span would not cross the credit window. + expect(published()).toBe(`${unhookedCrash}${PROMPT}`) + expect(await replay()).toBe(`${unhookedCrash}${PROMPT}${PROCESS_BOUNDARY_GROUND}`) + }) }) diff --git a/src/relay/pty-handler.ts b/src/relay/pty-handler.ts index 6f17479784fa..286bfdb89a7d 100644 --- a/src/relay/pty-handler.ts +++ b/src/relay/pty-handler.ts @@ -1118,6 +1118,7 @@ export class PtyHandler { this.dispatcher.onRequest('pty.getInitialCwd', (p) => this.getInitialCwd(p)) this.dispatcher.onRequest('pty.getSize', (p) => this.getSize(p)) this.dispatcher.onRequest('pty.clearBuffer', (p) => this.clearBuffer(p)) + this.dispatcher.onRequest('pty.resetInputModes', (p) => this.resetInputModes(p)) this.dispatcher.onRequest('pty.hasChildProcesses', (p) => this.hasChildProcesses(p)) this.dispatcher.onRequest('pty.getForegroundProcess', (p) => this.getForegroundProcess(p)) this.dispatcher.onRequest('pty.inspectProcess', (p) => this.inspectProcess(p)) @@ -2686,6 +2687,15 @@ export class PtyHandler { } } + // Why the replay buffer and not the stream: a zero-raw span never crosses the + // credit window, and the client grounds its own view; reattach replays this. + private async resetInputModes(params: Record): Promise { + const managed = this.ptys.get(params.id as string) + if (managed?.recoveryBarrier && !managed.disposed) { + this.appendReplayBuffer(managed, managed.recoveryBarrier.groundInputModes()) + } + } + private async hasChildProcesses(params: Record): Promise { const id = params.id as string const managed = this.ptys.get(id) diff --git a/src/renderer/src/components/terminal-pane/TerminalContextMenu.test.tsx b/src/renderer/src/components/terminal-pane/TerminalContextMenu.test.tsx index bd25abcce741..16f87ae24a92 100644 --- a/src/renderer/src/components/terminal-pane/TerminalContextMenu.test.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalContextMenu.test.tsx @@ -78,6 +78,7 @@ function renderMenu(overrides: Record = {}): string { onEqualizePaneSizes: vi.fn(), onClosePane: vi.fn(), onClearScreen: vi.fn(), + onResetTerminal: vi.fn(), canContinueAgentSessionInNewSession: false, onContinueAgentSessionInNewSession: vi.fn(), onForkAgentSession: vi.fn(), diff --git a/src/renderer/src/components/terminal-pane/TerminalContextMenu.tsx b/src/renderer/src/components/terminal-pane/TerminalContextMenu.tsx index 5236d61d1a65..e09969753e99 100644 --- a/src/renderer/src/components/terminal-pane/TerminalContextMenu.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalContextMenu.tsx @@ -12,6 +12,7 @@ import { PanelsTopLeft, PanelRightClose, Pencil, + RotateCcw, SquareTerminal, TextSelect, X @@ -53,6 +54,7 @@ type TerminalContextMenuProps = { onEqualizePaneSizes: () => void onClosePane: () => void onClearScreen: () => void + onResetTerminal: () => void canContinueAgentSessionInNewSession: boolean onContinueAgentSessionInNewSession: () => void onForkAgentSession: () => void @@ -144,6 +146,7 @@ function TerminalContextMenuItems({ onEqualizePaneSizes, onClosePane, onClearScreen, + onResetTerminal, canContinueAgentSessionInNewSession, onContinueAgentSessionInNewSession, onForkAgentSession, @@ -350,6 +353,13 @@ function TerminalContextMenuItems({ {translate('auto.components.terminal.pane.TerminalContextMenu.b4cdd9314e', 'Clear Screen')} + + + {translate( + 'auto.components.terminal.pane.TerminalContextMenu.resetTerminal', + 'Reset Terminal' + )} + ) } diff --git a/src/renderer/src/components/terminal-pane/TerminalPaneSurface.tsx b/src/renderer/src/components/terminal-pane/TerminalPaneSurface.tsx index 08613fb6c3ae..0b5da641c955 100644 --- a/src/renderer/src/components/terminal-pane/TerminalPaneSurface.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalPaneSurface.tsx @@ -242,6 +242,7 @@ export function TerminalPaneSurface({ onEqualizePaneSizes={contextMenu.onEqualizePaneSizes} onClosePane={contextMenu.onClosePane} onClearScreen={contextMenu.onClearScreen} + onResetTerminal={contextMenu.onResetTerminal} canContinueAgentSessionInNewSession={contextMenuCanContinueInNewSession} onContinueAgentSessionInNewSession={contextMenu.onContinueAgentSessionInNewSession} onForkAgentSession={() => void contextMenu.onForkAgentSession()} diff --git a/src/renderer/src/components/terminal-pane/pty-buffer-serializer.test.ts b/src/renderer/src/components/terminal-pane/pty-buffer-serializer.test.ts index 4adda77cc208..f72596187fbb 100644 --- a/src/renderer/src/components/terminal-pane/pty-buffer-serializer.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-buffer-serializer.test.ts @@ -6,6 +6,7 @@ describe('pty buffer serializer registry', () => { beforeEach(() => { vi.resetModules() + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the registry reads only these pty members. ;(globalThis as { window: typeof window }).window = { ...originalWindow, api: { @@ -13,6 +14,7 @@ describe('pty buffer serializer registry', () => { pty: { ...originalWindow?.api?.pty, onClearBufferRequest: vi.fn(() => () => {}), + onResetInputModesRequest: vi.fn(() => () => {}), onSerializeBufferRequest: vi.fn(() => () => {}), sendSerializedBuffer: vi.fn() } @@ -120,4 +122,16 @@ describe('pty buffer serializer registry', () => { expect.objectContaining({ pendingEscapeTailAnsi: '\x1b[38;5;' }) ) }) + + it("routes a host's Reset Terminal request to the pane that owns the PTY", async () => { + const { registerPtySerializer } = await import('./pty-buffer-serializer') + const resetInputModes = vi.fn() + registerPtySerializer('pty-1', () => null, { resetInputModes }) + const [[onRequest]] = vi.mocked(window.api.pty.onResetInputModesRequest).mock.calls + + onRequest({ ptyId: 'pty-2' }) + expect(resetInputModes).not.toHaveBeenCalled() + onRequest({ ptyId: 'pty-1' }) + expect(resetInputModes).toHaveBeenCalledOnce() + }) }) diff --git a/src/renderer/src/components/terminal-pane/pty-buffer-serializer.ts b/src/renderer/src/components/terminal-pane/pty-buffer-serializer.ts index 35d6a833050e..ada99d6cbe81 100644 --- a/src/renderer/src/components/terminal-pane/pty-buffer-serializer.ts +++ b/src/renderer/src/components/terminal-pane/pty-buffer-serializer.ts @@ -34,6 +34,7 @@ export type SerializeFn = ( type SerializerEntry = { fn: SerializeFn clear?: () => void + resetInputModes?: () => void owner: symbol } @@ -50,10 +51,10 @@ let listenerAttached = false export function registerPtySerializer( ptyId: string, serialize: SerializeFn, - clear?: () => void + actions: Pick = {} ): () => void { const owner = Symbol(ptyId) - serializersByPtyId.set(ptyId, { fn: serialize, clear, owner }) + serializersByPtyId.set(ptyId, { fn: serialize, ...actions, owner }) ensureSerializerListener() return () => { const current = serializersByPtyId.get(ptyId) @@ -116,6 +117,11 @@ export function registerPtyTitleSource( } } +/** Grounds the pane's own records only; the host grounds its models on its own request. */ +export function resetPtyRendererInputModes(ptyId: string): void { + serializersByPtyId.get(ptyId)?.resetInputModes?.() +} + export function hasPtySerializer(ptyId: string): boolean { return serializersByPtyId.has(ptyId) } @@ -133,6 +139,8 @@ function ensureSerializerListener(): void { serializersByPtyId.get(request.ptyId)?.clear?.() }) + window.api.pty.onResetInputModesRequest((request) => resetPtyRendererInputModes(request.ptyId)) + window.api.pty.onSerializeBufferRequest((request) => { const entry = serializersByPtyId.get(request.ptyId) void Promise.resolve(entry?.fn(request.opts) ?? null) diff --git a/src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.ts b/src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.ts index 4817dc8c17d3..9faaaf10eb3b 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-kitty-keyboard-restore.test.ts @@ -215,4 +215,19 @@ describe('connectPanePty kitty keyboard restore', () => { expect(mirror.snapshotFlags).toBe(0) expect(mirror.isAlternateScreen).toBe(false) }) + + it('grounds xterm and the mirror together on Reset Terminal and asks the host to ground', async () => { + const { pane, mirror } = await reattachWithSnapshotFlags(true) + expect(mirror?.flags).toBe(31) + const { resetTerminalInputModes } = await import('./terminal-input-mode-reset') + + resetTerminalInputModes('tab-pty') + + expect(pane.terminal.write).toHaveBeenLastCalledWith( + PROCESS_BOUNDARY_GROUND, + expect.any(Function) + ) + expect(mirror?.flags).toBe(0) + expect(window.api.pty.resetInputModes).toHaveBeenCalledWith('tab-pty') + }) }) diff --git a/src/renderer/src/components/terminal-pane/pty-connection-test-environment.ts b/src/renderer/src/components/terminal-pane/pty-connection-test-environment.ts index eb3a40b6803b..d8a9333c359d 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection-test-environment.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection-test-environment.ts @@ -54,6 +54,8 @@ export function installTerminalTestGlobals(): void { setPtyDeliveryInterest: vi.fn(), ackColdRestore: vi.fn(), onClearBufferRequest: vi.fn(() => vi.fn()), + onResetInputModesRequest: vi.fn(() => vi.fn()), + resetInputModes: vi.fn(), onSerializeBufferRequest: vi.fn(() => vi.fn()), sendSerializedBuffer: vi.fn(), declarePendingPaneSerializer: vi.fn().mockResolvedValue(1), diff --git a/src/renderer/src/components/terminal-pane/pty-connection/pane-serializer-register.ts b/src/renderer/src/components/terminal-pane/pty-connection/pane-serializer-register.ts index b4a953ef5b5e..2b75548ec393 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/pane-serializer-register.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/pane-serializer-register.ts @@ -1,3 +1,4 @@ +import { buildProcessBoundaryGround } from '../../../../../shared/terminal-mode-reset-profiles' import { serializeWithAbsoluteCursor } from '../../../../../shared/terminal-serialize-absolute-cursor' import { isTerminalWritePipelineCertifiedDead } from '@/lib/pane-manager/terminal-write-pipeline-health' import { registerPtySerializer, registerPtyTitleSource } from '../pty-buffer-serializer' @@ -72,10 +73,16 @@ export function bindRegisterPaneSerializer(session: ConnectPanePtySession): void return null } }, - () => { - session.clearHiddenOutputRestoreState() - discardTerminalOutput(session.pane.terminal) - clearTerminalScrollbackAndFollowOutput(session.pane.terminal) + { + clear: () => { + session.clearHiddenOutputRestoreState() + discardTerminalOutput(session.pane.terminal) + clearTerminalScrollbackAndFollowOutput(session.pane.terminal) + }, + resetInputModes: () => + session.writeInputModeGround( + buildProcessBoundaryGround({ keepFocusReporting: session.isNativeWindowsConpty }) + ) } ) const unregisterTitleSource = registerPtyTitleSource(ptyId, (handler) => diff --git a/src/renderer/src/components/terminal-pane/terminal-input-mode-reset.ts b/src/renderer/src/components/terminal-pane/terminal-input-mode-reset.ts new file mode 100644 index 000000000000..479da70f65d6 --- /dev/null +++ b/src/renderer/src/components/terminal-pane/terminal-input-mode-reset.ts @@ -0,0 +1,18 @@ +import { resetWebRuntimeTerminalInputModes } from '@/runtime/web-runtime-session' +import { resetPtyRendererInputModes } from './pty-buffer-serializer' + +/** + * Reset Terminal: grounds the input modes an app left armed (Kitty keyboard, + * mouse, bracketed paste, focus, alt screen, cursor keys) in the pane and in the + * host's models, so a reattach does not re-arm them. Each side grounds its own + * records; an older host rejects the request and only the pane is grounded. + */ +export function resetTerminalInputModes(ptyId: string | null): void { + if (!ptyId) { + return + } + resetPtyRendererInputModes(ptyId) + if (!resetWebRuntimeTerminalInputModes(ptyId)) { + window.api.pty.resetInputModes(ptyId) + } +} diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts index 155482f21632..463a3a7f4154 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts @@ -26,6 +26,7 @@ import { useTerminalContextMenuTrigger } from './use-terminal-context-menu-trigg import { useAppStore } from '@/store' import { makePaneKey } from '../../../../shared/stable-pane-id' import { resolvePaneAgentSessionId } from './pane-agent-session-id' +import { resetTerminalInputModes } from './terminal-input-mode-reset' type UseTerminalPaneContextMenuDeps = { managerRef: React.RefObject @@ -68,6 +69,7 @@ type TerminalMenuState = { onEqualizePaneSizes: () => void onClosePane: () => void onClearScreen: () => void + onResetTerminal: () => void onForkAgentSession: () => Promise onContinueAgentSessionInNewSession: () => void onCopyAgentSessionContext: () => Promise @@ -209,6 +211,13 @@ export function useTerminalPaneContextMenu({ } } + const onResetTerminal = (): void => { + const pane = resolveMenuPane() + if (pane) { + resetTerminalInputModes(paneTransportsRef.current.get(pane.id)?.getPtyId() ?? null) + } + } + const onForkAgentSession = async (): Promise => forkAgentSessionFromMenuPane(agentSessionContext, resolveMenuPane()) @@ -295,6 +304,7 @@ export function useTerminalPaneContextMenu({ onEqualizePaneSizes, onClosePane, onClearScreen, + onResetTerminal, onForkAgentSession, onContinueAgentSessionInNewSession, onCopyAgentSessionContext, diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index b7aac035aefc..ffdcd6031c2f 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -3193,6 +3193,7 @@ }, "TerminalContextMenu": { "b4cdd9314e": "Clear Screen", + "resetTerminal": "Reset Terminal", "8c17d6786d": "Close Pane", "copyTerminalId": "Copy Terminal ID", "2cf85a6a55": "Copy Pane ID", diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 835eb4ab4408..adbe527574ae 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -2751,6 +2751,7 @@ }, "TerminalContextMenu": { "b4cdd9314e": "Borrar pantalla", + "resetTerminal": "Restablecer terminal", "8c17d6786d": "Cerrar panel", "copyTerminalId": "Copiar ID de terminal", "2cf85a6a55": "Copiar ID del panel", diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json index d2a04423ace5..047564c4e617 100644 --- a/src/renderer/src/i18n/locales/fr.json +++ b/src/renderer/src/i18n/locales/fr.json @@ -3136,6 +3136,7 @@ }, "TerminalContextMenu": { "b4cdd9314e": "Effacer l'écran", + "resetTerminal": "Réinitialiser le terminal", "8c17d6786d": "Fermer le volet", "copyTerminalId": "Copier l'ID du terminal", "2cf85a6a55": "Copier l'ID du volet", diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 30bbb81cab12..97ff2a6ffdae 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -3033,6 +3033,7 @@ }, "TerminalContextMenu": { "b4cdd9314e": "クリアスクリーン", + "resetTerminal": "ターミナルをリセット", "8c17d6786d": "ペインを閉じる", "copyTerminalId": "ターミナル ID をコピー", "2cf85a6a55": "ペインIDのコピー", diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index 2c2318895a6b..511ee010e702 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -3033,6 +3033,7 @@ }, "TerminalContextMenu": { "b4cdd9314e": "화면 지우기", + "resetTerminal": "터미널 초기화", "8c17d6786d": "창 닫기", "copyTerminalId": "터미널 ID 복사", "2cf85a6a55": "창 ID 복사", diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 3c0f5d7aa3dc..e4fa1521899a 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -3033,6 +3033,7 @@ }, "TerminalContextMenu": { "b4cdd9314e": "清屏", + "resetTerminal": "重置终端", "8c17d6786d": "关闭窗格", "copyTerminalId": "复制终端 ID", "2cf85a6a55": "复制窗格 ID", diff --git a/src/renderer/src/runtime/web-runtime-session.ts b/src/renderer/src/runtime/web-runtime-session.ts index d62b48527b34..1ef7cfa5d6df 100644 --- a/src/renderer/src/runtime/web-runtime-session.ts +++ b/src/renderer/src/runtime/web-runtime-session.ts @@ -25,7 +25,10 @@ export { consumePendingWebRuntimeSplitMirrorTelemetry, closeWebRuntimeTerminal, updateWebRuntimePaneLayout, - setWebRuntimeTabProps, - clearWebRuntimeTerminalBuffer + setWebRuntimeTabProps } from './web-runtime-terminal-actions' +export { + clearWebRuntimeTerminalBuffer, + resetWebRuntimeTerminalInputModes +} from './web-runtime-terminal-buffer-actions' export type { WebRuntimeSplitSource } from './web-runtime-split-focus' diff --git a/src/renderer/src/runtime/web-runtime-terminal-actions.ts b/src/renderer/src/runtime/web-runtime-terminal-actions.ts index e12e99414927..0ae704640f06 100644 --- a/src/renderer/src/runtime/web-runtime-terminal-actions.ts +++ b/src/renderer/src/runtime/web-runtime-terminal-actions.ts @@ -279,32 +279,3 @@ export function setWebRuntimeTabProps(args: { }) return true } - -// Why: local pane.terminal.clear() is undone by the next host snapshot replay; clear the host buffer so it sticks. -export function clearWebRuntimeTerminalBuffer(ptyId: string | null | undefined): boolean { - if (!ptyId) { - return false - } - const remote = parseRemoteRuntimePtyId(ptyId) - const environmentId = remote?.environmentId?.trim() - if (!remote || !environmentId || !isWebRuntimeSessionActive(environmentId)) { - return false - } - void window.api.runtimeEnvironments - .call({ - selector: environmentId, - method: 'terminal.clearBuffer', - params: { terminal: remote.handle }, - timeoutMs: 15_000 - }) - .then((response) => { - unwrapRuntimeRpcResult(response as RuntimeRpcResponse<{ clear: unknown }>) - }) - .catch((error) => { - console.warn( - '[web-runtime-session] failed to clear terminal buffer:', - error instanceof Error ? error.message : String(error) - ) - }) - return true -} diff --git a/src/renderer/src/runtime/web-runtime-terminal-buffer-actions.ts b/src/renderer/src/runtime/web-runtime-terminal-buffer-actions.ts new file mode 100644 index 000000000000..8759f2feaeb6 --- /dev/null +++ b/src/renderer/src/runtime/web-runtime-terminal-buffer-actions.ts @@ -0,0 +1,49 @@ +import { unwrapRuntimeRpcResult } from './runtime-rpc-client' +import { parseRemoteRuntimePtyId } from './runtime-terminal-stream' +import { isWebRuntimeSessionActive } from './web-runtime-session-environment' + +// Why: local pane.terminal.clear() is undone by the next host snapshot replay; clear the host buffer so it sticks. +export function clearWebRuntimeTerminalBuffer(ptyId: string | null | undefined): boolean { + return callWebRuntimeTerminalAction(ptyId, 'terminal.clearBuffer', 'clear terminal buffer') +} + +// Why: same as clear; the host's snapshot would re-arm the modes on the next replay. +export function resetWebRuntimeTerminalInputModes(ptyId: string | null | undefined): boolean { + return callWebRuntimeTerminalAction( + ptyId, + 'terminal.resetInputModes', + 'reset terminal input modes' + ) +} + +function callWebRuntimeTerminalAction( + ptyId: string | null | undefined, + method: 'terminal.clearBuffer' | 'terminal.resetInputModes', + action: string +): boolean { + if (!ptyId) { + return false + } + const remote = parseRemoteRuntimePtyId(ptyId) + const environmentId = remote?.environmentId?.trim() + if (!remote || !environmentId || !isWebRuntimeSessionActive(environmentId)) { + return false + } + void window.api.runtimeEnvironments + .call({ + selector: environmentId, + method, + params: { terminal: remote.handle }, + timeoutMs: 15_000 + }) + .then((response) => { + unwrapRuntimeRpcResult(response) + }) + .catch((error) => { + console.warn( + `[web-runtime-session] failed to ${action}:`, + error instanceof Error ? error.message : String(error) + ) + }) + return true +} diff --git a/src/renderer/src/web/preload-api/web-terminal-api.ts b/src/renderer/src/web/preload-api/web-terminal-api.ts index 535c34544312..be6dc77cd7de 100644 --- a/src/renderer/src/web/preload-api/web-terminal-api.ts +++ b/src/renderer/src/web/preload-api/web-terminal-api.ts @@ -17,6 +17,8 @@ export function createPtyApi(): NonNullable['pty']> { signal: () => {}, // Web panes clear the host buffer via the terminal.clearBuffer runtime RPC. clearBuffer: () => {}, + // Likewise terminal.resetInputModes. + resetInputModes: () => {}, kill: () => Promise.resolve(), ackColdRestore: () => {}, ackData: () => {}, @@ -84,6 +86,7 @@ export function createPtyApi(): NonNullable['pty']> { onSpawned: () => noopUnsubscribe, onSerializeBufferRequest: () => noopUnsubscribe, onClearBufferRequest: () => noopUnsubscribe, + onResetInputModesRequest: () => noopUnsubscribe, sendSerializedBuffer: () => {}, declarePendingPaneSerializer: () => Promise.resolve(0), settlePaneSerializer: () => Promise.resolve(), diff --git a/src/shared/rpc-contract/rpc-params-catalog.generated.ts b/src/shared/rpc-contract/rpc-params-catalog.generated.ts index df05a234a883..326962eae58c 100644 --- a/src/shared/rpc-contract/rpc-params-catalog.generated.ts +++ b/src/shared/rpc-contract/rpc-params-catalog.generated.ts @@ -1137,6 +1137,7 @@ export const RPC_PARAMS_BY_METHOD = { 'terminal.read': TerminalRead, 'terminal.recoverPane': TerminalRecoverPane, 'terminal.rename': TerminalRename, + 'terminal.resetInputModes': TerminalHandle, 'terminal.resizeForClient': TerminalResizeForClient, 'terminal.resolveActive': TerminalResolveActive, 'terminal.resolveIdentity': TerminalHandle, diff --git a/tests/e2e/terminal-reset-input-modes.spec.ts b/tests/e2e/terminal-reset-input-modes.spec.ts new file mode 100644 index 000000000000..f10797666af3 --- /dev/null +++ b/tests/e2e/terminal-reset-input-modes.spec.ts @@ -0,0 +1,131 @@ +/** + * Reset Terminal grounds the input modes an app left armed where the host saw + * no command end, and the ground survives park and reveal. The reveal builds a + * fresh xterm from the host's model, so a renderer-only reset would come back + * armed. + */ +import type { ElectronApplication, Page } from '@stablyai/playwright-test' +import { expect, test } from './helpers/orca-app' +import { parkHiddenTabBehindDecoy } from './helpers/terminal-hidden-parking' +import { + ensureTerminalVisible, + getActiveTabId, + waitForActiveWorktree, + waitForSessionReady +} from './helpers/store' +import { + focusActiveTerminalInput, + sendToTerminal, + waitForActivePanePtyId, + waitForActiveTerminalManager +} from './helpers/terminal' +import { openTerminalContextMenu } from './helpers/terminal-pane-title-actions' +import { + clearTerminalPtyWriteLog, + installTerminalPtyWriteSpy, + readTerminalPtyWrites +} from './helpers/terminal-pty-write-spy' +import { waitForPtyShellEcho } from './terminal-pty-readiness' + +const PARKING_DELAY_MS = Number(process.env.ORCA_E2E_TERMINAL_PARKING_DELAY_MS) || 500 +const KITTY_SHIFT_ENTER = '\x1b[13;2u' + +test.use({ + orcaAppExtraEnv: { ORCA_E2E_TERMINAL_PARKING_DELAY_MS: String(PARKING_DELAY_MS) } +}) + +type XtermInputModes = { kittyFlags: number | null; mouse: string | null } + +async function readXtermInputModes(page: Page): Promise { + return page.evaluate(() => { + const state = window.__store?.getState() + const tabId = state?.activeTabId ?? null + const manager = tabId ? window.__paneManagers?.get(tabId) : null + const pane = manager?.getActivePane?.() ?? manager?.getPanes?.()[0] ?? null + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: xterm exposes kitty flags only on its private core; null when absent. + const terminal = pane?.terminal as + | { + modes?: { mouseTrackingMode?: string } + _core?: { coreService?: { kittyKeyboard?: { flags?: number } } } + } + | undefined + return { + kittyFlags: terminal?._core?.coreService?.kittyKeyboard?.flags ?? null, + mouse: terminal?.modes?.mouseTrackingMode ?? null + } + }) +} + +// Why Shift+Enter: the policy emits CSI-u only when the pane mirror reports kitty flags. +async function readShiftEnterWrite(page: Page, app: ElectronApplication): Promise { + await clearTerminalPtyWriteLog(app) + await focusActiveTerminalInput(page) + await page.keyboard.press('Shift+Enter') + let written = '' + await expect + .poll( + async () => { + written = (await readTerminalPtyWrites(app)).join('') + return written.length + }, + { timeout: 5_000, message: 'Shift+Enter wrote nothing' } + ) + .toBeGreaterThan(0) + return written +} + +async function expectGrounded(page: Page, app: ElectronApplication, when: string): Promise { + await expect + .poll(() => readXtermInputModes(page), { timeout: 10_000, message: `xterm armed ${when}` }) + .toEqual({ kittyFlags: 0, mouse: 'none' }) + expect(await readShiftEnterWrite(page, app)).not.toContain(KITTY_SHIFT_ENTER) +} + +async function activateTerminalTab(page: Page, tabId: string): Promise { + await page.evaluate((tabId) => { + const state = window.__store?.getState() + if (!state) { + throw new Error('Orca store unavailable') + } + state.setActiveTabType('terminal', window.__store?.getState().activeWorktreeId ?? null) + state.setActiveTab(tabId) + }, tabId) + await expect.poll(() => getActiveTabId(page)).toBe(tabId) + await waitForActiveTerminalManager(page, 30_000) +} + +test('Reset Terminal grounds modes an unhooked crash left armed, through park and reveal', async ({ + orcaPage, + electronApp +}) => { + test.skip(process.platform === 'win32', 'ConPTY panes withhold the kitty protocol') + await installTerminalPtyWriteSpy(electronApp) + await waitForSessionReady(orcaPage) + const worktreeId = await waitForActiveWorktree(orcaPage) + await ensureTerminalVisible(orcaPage) + await waitForActiveTerminalManager(orcaPage, 30_000) + const tabId = await getActiveTabId(orcaPage) + if (!tabId) { + throw new Error('no active terminal tab') + } + const ptyId = await waitForActivePanePtyId(orcaPage) + await waitForPtyShellEcho(orcaPage, ptyId, 15_000) + + // `exec` drops the shell hooks, so no OSC 133;D ever lets the host ground the + // modes the printf arms and leaves behind. + await sendToTerminal(orcaPage, ptyId, 'exec bash --norc --noprofile\r') + await sendToTerminal(orcaPage, ptyId, "printf '\\033[>5u\\033[?1000h\\033[?1006h'\r") + await expect + .poll(() => readXtermInputModes(orcaPage), { timeout: 10_000 }) + .toEqual({ kittyFlags: 5, mouse: 'vt200' }) + expect(await readShiftEnterWrite(orcaPage, electronApp)).toContain(KITTY_SHIFT_ENTER) + + await openTerminalContextMenu(orcaPage) + await orcaPage.getByRole('menuitem', { name: 'Reset Terminal', exact: true }).click() + await expectGrounded(orcaPage, electronApp, 'after Reset Terminal') + + await parkHiddenTabBehindDecoy(orcaPage, worktreeId, tabId, { parkDelayMs: PARKING_DELAY_MS }) + await activateTerminalTab(orcaPage, tabId) + await waitForActivePanePtyId(orcaPage) + await expectGrounded(orcaPage, electronApp, 'after park and reveal') +}) From fe7e13daf2c8a6e799da1e94fcb799bceb2fad36 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:49:52 -0700 Subject: [PATCH 18/90] test(claude): expect typed cancellation in queued-send settlements (#23675) --- src/main/claude/claude-structured-control-actions.test.ts | 3 ++- src/main/claude/claude-structured-queued-stop.test.ts | 3 ++- src/main/claude/claude-structured-real-cli.test.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/claude/claude-structured-control-actions.test.ts b/src/main/claude/claude-structured-control-actions.test.ts index 5c5db2f01121..3eaf496f75ad 100644 --- a/src/main/claude/claude-structured-control-actions.test.ts +++ b/src/main/claude/claude-structured-control-actions.test.ts @@ -91,7 +91,8 @@ describe('cancelClaudeTurn', () => { { clientMessageId: 'client-1', state: 'rejected', - reason: 'provider_cancelled_before_start' + reason: 'provider_cancelled_before_start', + rejection: { kind: 'cancelled' } } ] ]) diff --git a/src/main/claude/claude-structured-queued-stop.test.ts b/src/main/claude/claude-structured-queued-stop.test.ts index 0c4b6ed6e728..2dbc99bb82be 100644 --- a/src/main/claude/claude-structured-queued-stop.test.ts +++ b/src/main/claude/claude-structured-queued-stop.test.ts @@ -136,7 +136,8 @@ const WITHDRAWN = [ sessionId: 'session-1', clientMessageId: 'client-b', state: 'rejected', - reason: DISPATCH_REJECTED_CANCELLED + reason: DISPATCH_REJECTED_CANCELLED, + rejection: { kind: 'cancelled' } } ] diff --git a/src/main/claude/claude-structured-real-cli.test.ts b/src/main/claude/claude-structured-real-cli.test.ts index 7fcd9a51de20..cfd4c8c33eab 100644 --- a/src/main/claude/claude-structured-real-cli.test.ts +++ b/src/main/claude/claude-structured-real-cli.test.ts @@ -375,7 +375,8 @@ describe.skipIf(!realClaudeAvailable)('Claude structured real CLI handshake', () sessionId: 'real-cli-handshake', clientMessageId: 'real-cli-queued-stop-b', state: 'rejected', - reason: 'provider_cancelled_before_start' + reason: 'provider_cancelled_before_start', + rejection: { kind: 'cancelled' } }) } finally { await adapter.closeAll() From 55aea8533fb425b72377cee091f32c7d25e57994 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:58:41 -0700 Subject: [PATCH 19/90] fix(ci): repair terminal link handling and E2E recovery fixtures (#23677) * test(claude): expect typed cancellation in queued-send settlements * fix(ci): respect disabled terminal links and await browser recovery * test(e2e): give legacy close client a profile authority --- .../terminal-link-action-request.ts | 2 +- .../terminal-link-action-routing.test.ts | 20 ++++++++++ .../daemon-generation-legacy-close-client.ts | 7 +++- .../daemon-generation-profile-store.ts | 14 +++++++ ...nt-hosted-browser-restart-survival.spec.ts | 37 ++++++++++--------- 5 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 tests/e2e/fixtures/daemon-generation-profile-store.ts diff --git a/src/renderer/src/components/terminal-pane/terminal-link-action-request.ts b/src/renderer/src/components/terminal-pane/terminal-link-action-request.ts index 1ddedfe9e5a1..21f917302ca4 100644 --- a/src/renderer/src/components/terminal-pane/terminal-link-action-request.ts +++ b/src/renderer/src/components/terminal-pane/terminal-link-action-request.ts @@ -50,7 +50,7 @@ export function requestTerminalLinkAction( !event || !context || !( - isTerminalLinkActionActivation(event) || + (isTerminalLinkActionActivation(event) && context.plainClickBehavior !== 'none') || (isTerminalMiddleClickActivation(event) && context.middleClickBehavior !== 'none') ) || !context.pointerGesture.canRequestAction(event) diff --git a/src/renderer/src/components/terminal-pane/terminal-link-action-routing.test.ts b/src/renderer/src/components/terminal-pane/terminal-link-action-routing.test.ts index ca1168eb7b68..be546428c907 100644 --- a/src/renderer/src/components/terminal-pane/terminal-link-action-routing.test.ts +++ b/src/renderer/src/components/terminal-pane/terminal-link-action-routing.test.ts @@ -122,6 +122,26 @@ describe('terminal link action routing', () => { expect(run).toHaveBeenCalledOnce() }) + it('leaves disabled plain clicks with the terminal while middle click remains enabled', () => { + const context = actionContext() + context.plainClickBehavior = 'none' + context.middleClickBehavior = 'open' + const event = plainEvent() + const run = vi.fn() + + expect( + requestTerminalLinkAction(event, context, { + destination: 'https://example.com', + kind: 'url', + primary: { label: 'Open', run } + }) + ).toBe(false) + expect(context.claimPtyMouse).not.toHaveBeenCalled() + expect(event.preventDefault).not.toHaveBeenCalled() + expect(context.request).not.toHaveBeenCalled() + expect(run).not.toHaveBeenCalled() + }) + it('keeps middle click available when plain clicks stay with the terminal', () => { const run = vi.fn() const context = actionContext() diff --git a/tests/e2e/fixtures/daemon-generation-legacy-close-client.ts b/tests/e2e/fixtures/daemon-generation-legacy-close-client.ts index 730ebbeffc9a..473071c030b5 100644 --- a/tests/e2e/fixtures/daemon-generation-legacy-close-client.ts +++ b/tests/e2e/fixtures/daemon-generation-legacy-close-client.ts @@ -1,11 +1,13 @@ import { readFileSync } from 'node:fs' import process from 'node:process' +import type { Store } from '../../../src/main/persistence' import { OrcaRuntimeService } from '../../../src/main/runtime/orca-runtime' import { RpcDispatcher } from '../../../src/main/runtime/rpc/dispatcher' import { SESSION_TAB_METHODS } from '../../../src/main/runtime/rpc/methods/session-tabs' import { SESSION_TAB_CLOSE_INTENT_RUNTIME_CAPABILITY } from '../../../src/shared/protocol-version' import type { RuntimeMobileSessionTabsSnapshot } from '../../../src/shared/runtime-types' import { createDesktopDiscoveredDaemonRouter } from './daemon-generation-desktop-discovery' +import { createDaemonGenerationProfileStore } from './daemon-generation-profile-store' type FixtureSession = { protocolVersion: number @@ -126,6 +128,7 @@ async function waitForFinish(): Promise { async function main(): Promise { const config = readConfig() const { router } = await createDesktopDiscoveredDaemonRouter(config) + let store: Store | null = null try { const outputBySessionId = new Map() router.onData((event) => { @@ -149,7 +152,8 @@ async function main(): Promise { } } - const runtime = new OrcaRuntimeService() + store = createDaemonGenerationProfileStore(config.cwd) + const runtime = new OrcaRuntimeService(store) const calls: Record[] = [] const sessionByTabId = new Map(config.sessions.map((session) => [session.tabId, session])) runtime.setPtyController({ @@ -296,6 +300,7 @@ async function main(): Promise { } finally { await router.disconnectOnly().catch(() => {}) router.dispose() + await store?.freezeWritesAsync() } } diff --git a/tests/e2e/fixtures/daemon-generation-profile-store.ts b/tests/e2e/fixtures/daemon-generation-profile-store.ts new file mode 100644 index 000000000000..a709d84bcc8f --- /dev/null +++ b/tests/e2e/fixtures/daemon-generation-profile-store.ts @@ -0,0 +1,14 @@ +import path from 'node:path' +import { installOrcadHostAdapters } from '../../../src/main/orcad/orcad-entry' +import type { Store } from '../../../src/main/persistence' +import { createProfileStateStore } from '../../../src/main/persistence/profile-state/profile-state-store-factory' + +export function createDaemonGenerationProfileStore(directory: string): Store { + installOrcadHostAdapters() + // The bundled fixture has no profile writer worker; use the synchronous SQLite authority. + return createProfileStateStore({ + dataFile: path.join(directory, 'orca-data.json'), + databaseFile: path.join(directory, 'profile-state.sqlite'), + profileId: 'legacy-close-fixture' + }).store +} diff --git a/tests/e2e/paired-client-hosted-browser-restart-survival.spec.ts b/tests/e2e/paired-client-hosted-browser-restart-survival.spec.ts index 03eb0e0b18d6..0f8e24ecd6e9 100644 --- a/tests/e2e/paired-client-hosted-browser-restart-survival.spec.ts +++ b/tests/e2e/paired-client-hosted-browser-restart-survival.spec.ts @@ -112,24 +112,22 @@ test('keeps a client-hosted browser tab across a paired runtime restart', async }) .toContain(opened.remotePageId) - await expect - .poll(() => findMirroredBrowserPage(client!.page, restartedWorktreeId, fixture.origin), { - timeout: 180_000, - message: 'the client lost its client-hosted row across the runtime restart' - }) - .not.toBeNull() - - // Counted across the whole fixture origin: a recovery that also replays the create URL leaves - // two rows, and matching only the moved one would call that a pass. - const rows = await readClientBrowserRows(client.page, restartedWorktreeId) - const survivorRows = rows.filter((row) => row.url.startsWith(fixture.origin)) - expect(survivorRows, 'the tab must survive the restart exactly once').toHaveLength(1) + let survivor: Awaited> = null + // Reconnection can replace the retained row between reads; wait for the whole contract. + await expect(async () => { + const rows = await readClientBrowserRows(client!.page, restartedWorktreeId) + const survivorRows = rows.filter((row) => row.url.startsWith(fixture.origin)) + expect(survivorRows, 'the tab must survive the restart exactly once').toHaveLength(1) - const survivor = await findMirroredBrowserPage(client.page, restartedWorktreeId, fixture.origin) - expect(survivor?.remotePageId, 'recovery must keep the page identity it was created with').toBe( - opened.remotePageId - ) - expect(survivor?.placementKind, 'the surviving tab must still be client-hosted').toBe('client') + survivor = await findMirroredBrowserPage(client!.page, restartedWorktreeId, fixture.origin) + expect( + survivor?.remotePageId, + 'recovery must keep the page identity it was created with' + ).toBe(opened.remotePageId) + expect(survivor?.placementKind, 'the surviving tab must still be client-hosted').toBe( + 'client' + ) + }).toPass({ timeout: 180_000 }) await focusClientBrowserRow(client.page, restartedWorktreeId, survivor!.localPageId) expect( @@ -140,6 +138,11 @@ test('keeps a client-hosted browser tab across a paired runtime restart', async ), 'the tab must come back where the user left it, not on its create URL' ).toBe('moved-on') + const renderedRows = await readClientBrowserRows(client.page, restartedWorktreeId) + expect( + renderedRows.filter((row) => row.url.startsWith(fixture.origin)), + 'rendering the recovered guest must leave exactly one surviving tab' + ).toHaveLength(1) } finally { if (client) { await cleanupE2EDaemons(client.userDataDir).catch(() => undefined) From 409462a31901e2896f65a1d91a92ecb25d6c16b9 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:41:48 -0700 Subject: [PATCH 20/90] fix(status-bar): fold agents into +N before status labels go icon-only (#23689) On narrow windows the right-side status labels (update ready, memory, keep awake) went icon-only while every agent stayed in full, so the +N badge never appeared until much narrower. Add a density level that collapses calm agents into +N while the right side keeps its labels; it fits by the width with urgent agents pinned, and only when even that doesn't fit do the segments go icon-only. --- .../status-bar/status-bar-density.test.ts | 50 ++++++++++++++++--- .../status-bar/status-bar-density.ts | 46 ++++++++++------- .../status-bar/status-bar-usage-collapse.ts | 20 +++++++- 3 files changed, 88 insertions(+), 28 deletions(-) diff --git a/src/renderer/src/components/status-bar/status-bar-density.test.ts b/src/renderer/src/components/status-bar/status-bar-density.test.ts index 2197e74fef9f..27b905e962d2 100644 --- a/src/renderer/src/components/status-bar/status-bar-density.test.ts +++ b/src/renderer/src/components/status-bar/status-bar-density.test.ts @@ -6,38 +6,72 @@ import { } from './status-bar-density' const TIGHTEST = STATUS_BAR_DENSITY_LEVELS.length - 1 +const w = (natural: number, fit = natural) => ({ natural, fit }) + +describe('STATUS_BAR_DENSITY_LEVELS', () => { + it('collapses usage into "+N" before right-side segments lose their labels', () => { + const firstCollapse = STATUS_BAR_DENSITY_LEVELS.findIndex((level) => level.collapseUsage) + const firstIconOnly = STATUS_BAR_DENSITY_LEVELS.findIndex((level) => level.segmentsIconOnly) + expect(firstCollapse).toBeGreaterThan(-1) + expect(firstCollapse).toBeLessThan(firstIconOnly) + }) +}) describe('pickStatusBarDensityLevel', () => { it('keeps the roomiest level that fits', () => { - expect(pickStatusBarDensityLevel([700, 600, 500, 400, 300], 800)).toBe(0) - expect(pickStatusBarDensityLevel([700, 600, 500, 400, 300], 550)).toBe(2) + expect(pickStatusBarDensityLevel([w(700), w(600), w(500), w(400), w(300)], 800)).toBe(0) + expect(pickStatusBarDensityLevel([w(700), w(600), w(500), w(400), w(300)], 550)).toBe(2) + }) + + it('fits a collapsing level by its collapsed width, not its natural width', () => { + // Level 3 would need 500 with every chip, but 380 with calm chips folded into "+N". + expect(pickStatusBarDensityLevel([w(700), w(600), w(500), w(500, 380), w(300)], 400)).toBe(3) }) it('probes an unmeasured level before settling on a tighter one', () => { - expect(pickStatusBarDensityLevel([700, undefined, 500], 650)).toBe(1) + expect(pickStatusBarDensityLevel([w(700), undefined, w(500)], 650)).toBe(1) expect(pickStatusBarDensityLevel([], 650)).toBe(0) }) it('falls back to the tightest level when nothing fits', () => { - expect(pickStatusBarDensityLevel([700, 600, 500, 400, 300], 200)).toBe(TIGHTEST) + expect(pickStatusBarDensityLevel([w(700), w(600), w(500), w(400), w(300)], 200)).toBe(TIGHTEST) }) it('tolerates sub-pixel rounding at the boundary', () => { - expect(pickStatusBarDensityLevel([600.6], 600)).toBe(0) + expect(pickStatusBarDensityLevel([w(600.6)], 600)).toBe(0) }) }) describe('recordStatusBarDensityWidth', () => { it('fills in a level without disturbing the others', () => { - expect(recordStatusBarDensityWidth([700, undefined, 500], 1, 600)).toEqual([700, 600, 500]) + expect(recordStatusBarDensityWidth([w(700), undefined, w(500)], 1, w(600))).toEqual([ + w(700), + w(600), + w(500) + ]) }) it('forgets other levels when a level re-measures differently', () => { // A segment appeared or vanished, so the other levels' widths no longer describe the bar. - expect(recordStatusBarDensityWidth([700, 600, 500], 1, 640)).toEqual([undefined, 640]) + expect(recordStatusBarDensityWidth([w(700), w(600), w(500)], 1, w(640))).toEqual([ + undefined, + w(640) + ]) + }) + + it('keeps other levels when only the collapsed width moves', () => { + // Collapsing different chips changes the fit width, never the natural one. + expect(recordStatusBarDensityWidth([w(700), w(600, 450)], 1, w(600, 430))).toEqual([ + w(700), + w(600, 430) + ]) }) it('keeps other levels on a sub-pixel re-measure', () => { - expect(recordStatusBarDensityWidth([700, 600, 500], 1, 600.5)).toEqual([700, 600.5, 500]) + expect(recordStatusBarDensityWidth([w(700), w(600), w(500)], 1, w(600.5))).toEqual([ + w(700), + w(600.5), + w(500) + ]) }) }) diff --git a/src/renderer/src/components/status-bar/status-bar-density.ts b/src/renderer/src/components/status-bar/status-bar-density.ts index 078a4cf44df7..17748c19d45b 100644 --- a/src/renderer/src/components/status-bar/status-bar-density.ts +++ b/src/renderer/src/components/status-bar/status-bar-density.ts @@ -13,27 +13,36 @@ export type StatusBarDensity = { collapseUsage: boolean } -// Why: ordered roomiest → tightest so each step gives up the least useful detail first; -// usage verbosity goes before right-side labels because the Usage popover holds it all. +// Why: ordered roomiest → tightest so each step gives up the least useful detail first. +// Usage gives way before right-side labels (collapsing into "+N" before those go +// icon-only) because the Usage popover holds everything the bar drops. export const STATUS_BAR_DENSITY_LEVELS: readonly StatusBarDensity[] = [ { compact: false, usageTightestOnly: false, segmentsIconOnly: false, collapseUsage: false }, { compact: true, usageTightestOnly: false, segmentsIconOnly: false, collapseUsage: false }, { compact: true, usageTightestOnly: true, segmentsIconOnly: false, collapseUsage: false }, + { compact: true, usageTightestOnly: true, segmentsIconOnly: false, collapseUsage: true }, { compact: true, usageTightestOnly: true, segmentsIconOnly: true, collapseUsage: true } ] + +export type StatusBarLevelWidth = { + /** Width with every usage chip shown; a change here means the content changed. */ + natural: number + /** Narrowest the level can get: natural, or with calm chips collapsed where the level allows it. */ + fit: number +} const NO_COLLAPSED_USAGE: readonly string[] = [] const WIDTH_TOLERANCE_PX = 1 /** Roomiest level known to fit; an unmeasured level is returned so it gets probed. */ export function pickStatusBarDensityLevel( - requiredWidths: readonly (number | undefined)[], + levelWidths: readonly (StatusBarLevelWidth | undefined)[], availableWidth: number ): number { const tightest = STATUS_BAR_DENSITY_LEVELS.length - 1 for (let level = 0; level < tightest; level++) { - const required = requiredWidths[level] - if (required === undefined || required <= availableWidth + WIDTH_TOLERANCE_PX) { + const width = levelWidths[level] + if (width === undefined || width.fit <= availableWidth + WIDTH_TOLERANCE_PX) { return level } } @@ -42,16 +51,16 @@ export function pickStatusBarDensityLevel( /** A level measuring differently than before means the content changed, so every other level's width is stale. */ export function recordStatusBarDensityWidth( - requiredWidths: readonly (number | undefined)[], + levelWidths: readonly (StatusBarLevelWidth | undefined)[], level: number, - required: number -): (number | undefined)[] { - const previous = requiredWidths[level] + width: StatusBarLevelWidth +): (StatusBarLevelWidth | undefined)[] { + const previous = levelWidths[level] const next = - previous !== undefined && Math.abs(previous - required) > WIDTH_TOLERANCE_PX + previous !== undefined && Math.abs(previous.natural - width.natural) > WIDTH_TOLERANCE_PX ? [] - : [...requiredWidths] - next[level] = required + : [...levelWidths] + next[level] = width return next } @@ -65,7 +74,7 @@ function measureWidth(ref: ElementRef): number { * Picks the roomiest density at which the usage cluster and the right-side segments fit * on one line. Widths are measured from the rendered content, so a transient segment * (update ready, chats to resume) condenses the bar only while it is present. At the - * tightest level it also names the usage chips that give way to a "+N" chip. + * collapsing levels it also names the usage chips that give way to a "+N" chip. */ export function useStatusBarDensity(): { density: StatusBarDensity @@ -81,7 +90,7 @@ export function useStatusBarDensity(): { const committedLevelRef = useRef(0) const overflowingRef = useRef(false) const collapsedUsageRef = useRef(NO_COLLAPSED_USAGE) - const requiredWidthsRef = useRef<(number | undefined)[]>([]) + const levelWidthsRef = useRef<(StatusBarLevelWidth | undefined)[]>([]) const barElementRef = useRef(null) const usageElementRef = useRef(null) const segmentsElementRef = useRef(null) @@ -98,12 +107,13 @@ export function useStatusBarDensity(): { const usage = measureUsageRow(usageElementRef.current) const fixedWidth = (Number.parseFloat(style.columnGap) || 0) + measureWidth(segmentsElementRef) const required = usage.naturalWidth + fixedWidth - requiredWidthsRef.current = recordStatusBarDensityWidth( - requiredWidthsRef.current, + const collapses = STATUS_BAR_DENSITY_LEVELS[committedLevelRef.current].collapseUsage + levelWidthsRef.current = recordStatusBarDensityWidth( + levelWidthsRef.current, committedLevelRef.current, - required + { natural: required, fit: collapses ? usage.pinnedWidth + fixedWidth : required } ) - const nextLevel = pickStatusBarDensityLevel(requiredWidthsRef.current, available) + const nextLevel = pickStatusBarDensityLevel(levelWidthsRef.current, available) if (nextLevel !== committedLevelRef.current) { setLevel(nextLevel) } diff --git a/src/renderer/src/components/status-bar/status-bar-usage-collapse.ts b/src/renderer/src/components/status-bar/status-bar-usage-collapse.ts index 581b1b3643d9..4a08acd8f126 100644 --- a/src/renderer/src/components/status-bar/status-bar-usage-collapse.ts +++ b/src/renderer/src/components/status-bar/status-bar-usage-collapse.ts @@ -8,6 +8,8 @@ export type UsageChipMeasure = { export type UsageRowMeasure = { /** Width of the usage row as if every chip were shown, so collapsing never reads as a content change. */ naturalWidth: number + /** Width with every calm chip collapsed into "+N", keeping urgent ones. */ + pinnedWidth: number /** Width the row actually occupies right now. */ renderedWidth: number chips: UsageChipMeasure[] @@ -49,7 +51,14 @@ export function pickCollapsedUsageChips( /** Reads the `data-usage-*` markers the status bar renders on its usage chips and "+N" chip. */ export function measureUsageRow(usage: HTMLElement | null): UsageRowMeasure { if (!usage) { - return { naturalWidth: 0, renderedWidth: 0, chips: [], moreChipWidth: 0, chipGap: 0 } + return { + naturalWidth: 0, + pinnedWidth: 0, + renderedWidth: 0, + chips: [], + moreChipWidth: 0, + chipGap: 0 + } } const renderedWidth = usage.getBoundingClientRect().width const chipElements = [...usage.querySelectorAll('[data-usage-chip]')] @@ -67,8 +76,15 @@ export function measureUsageRow(usage: HTMLElement | null): UsageRowMeasure { const collapsedWidth = chips .filter((chip) => chip.collapsed) .reduce((sum, chip) => sum + chip.width + chipGap, 0) + const naturalWidth = renderedWidth + collapsedWidth - (moreInRow ? moreChipWidth + chipGap : 0) + const calmChips = chips.filter((chip) => !chip.urgent) + const pinnedWidth = + naturalWidth - + calmChips.reduce((sum, chip) => sum + chip.width + chipGap, 0) + + (calmChips.length > 0 ? moreChipWidth + chipGap : 0) return { - naturalWidth: renderedWidth + collapsedWidth - (moreInRow ? moreChipWidth + chipGap : 0), + naturalWidth, + pinnedWidth, renderedWidth, chips, moreChipWidth, From fe34acda3bb420699b40146fc7eb25722df6c234 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:58:15 -0400 Subject: [PATCH 21/90] fix(mobile): truncate oversize markdown reads instead of failing them (#23676) * fix(mobile): truncate oversize markdown reads instead of failing them The desktop bridge refused markdown over a private 512 KiB cap with file_too_large, which reached the phone as a generic runtime_error that the reader discarded, so a 632 KB file showed "Couldn't load markdown". Reads now return a UTF-8-boundary prefix under one shared 2 MiB budget, marked truncated with the full byteLength and read-only. The phone shows the truncation like file tabs do and maps refusal codes to real copy, so an older desktop's refusal reads "File too large for mobile preview". Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): pin that a truncated markdown read is never editable The read budget sits above the edit budget, so every truncated document is already read-only as file_too_large. Pin that ordering so a future budget change cannot make a prefix editable, and name the constant as the markdown preview budget, separate from the file preview's own. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * test(mobile): refuse saves from a truncated markdown read A phone holding a truncated prefix must not write it back; the 256 KiB save guard refuses it as file_too_large before any version check. The shared budget test shrinks to the ordering it pins and names the bridge test as the behavioural pin. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): tighten markdown truncation types and measure once The read truncation measures the document once. The disk fallback drops its truncated-only read-only text, which the status line never showed, and both truncation fields are optional there. A markdown doc's flag is only ever true, and the schema comment names the hook, not line numbers. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * docs(mobile): drop a stale disk-fallback comment Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * chore: retrigger CI after #23675 landed on main Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- .../session/MobileSessionMarkdownReader.tsx | 9 +- .../mobile-markdown-disk-fallback.test.ts | 7 +- .../session/mobile-markdown-disk-fallback.ts | 21 ++-- .../mobile-markdown-reader-status.test.ts | 30 ++++++ .../session/mobile-markdown-reader-status.ts | 20 ++++ .../mobile-session-route-parity.test.ts | 8 +- .../src/session/mobile-session-route-types.ts | 2 + .../src/session/session-read-reply-schema.ts | 13 ++- ...se-mobile-session-document-readers.test.ts | 95 +++++++++++++++++++ .../use-mobile-session-document-readers.ts | 37 +++++--- .../runtime/mobile-markdown-bridge.test.ts | 68 ++++++++++++- .../src/runtime/mobile-markdown-bridge.ts | 13 ++- src/shared/mobile-markdown-document.test.ts | 6 ++ src/shared/mobile-markdown-document.ts | 25 +++++ 14 files changed, 306 insertions(+), 48 deletions(-) create mode 100644 mobile/src/session/mobile-markdown-reader-status.test.ts create mode 100644 mobile/src/session/mobile-markdown-reader-status.ts create mode 100644 mobile/src/session/use-mobile-session-document-readers.test.ts diff --git a/mobile/src/session/MobileSessionMarkdownReader.tsx b/mobile/src/session/MobileSessionMarkdownReader.tsx index 4e1d380c9a36..134dc34b87a7 100644 --- a/mobile/src/session/MobileSessionMarkdownReader.tsx +++ b/mobile/src/session/MobileSessionMarkdownReader.tsx @@ -3,6 +3,7 @@ import { View, Text, Pressable, ActivityIndicator } from 'react-native' import { RefreshCw } from 'lucide-react-native' import { MobileRichMarkdownEditor } from '../components/MobileRichMarkdownEditor' import { resolveMarkdownFloatingActionsBottom } from './markdown-floating-actions-layout' +import { markdownReaderStatusText } from './mobile-markdown-reader-status' import { colors, spacing } from '../theme/mobile-theme' import { styles } from './mobile-session-styles' import type { MarkdownDocState } from './mobile-session-route-types' @@ -48,13 +49,7 @@ export function MarkdownReader({ ) } - const statusText = doc.saveError - ? doc.saveError - : doc.readOnlyReason - ? 'Read only' - : doc.stale - ? 'Changed on desktop' - : null + const statusText = markdownReaderStatusText(doc) const showRefresh = (doc.stale && !doc.isDirty) || !doc.editable const showCopy = doc.saveError || !doc.editable const showSave = doc.isDirty || doc.saving diff --git a/mobile/src/session/mobile-markdown-disk-fallback.test.ts b/mobile/src/session/mobile-markdown-disk-fallback.test.ts index 04de6c7f14ff..fb172e1a4250 100644 --- a/mobile/src/session/mobile-markdown-disk-fallback.test.ts +++ b/mobile/src/session/mobile-markdown-disk-fallback.test.ts @@ -75,17 +75,20 @@ describe('buildMarkdownDiskFallbackDoc', () => { }) }) - it('warns when the disk read is truncated', () => { + it('marks a truncated disk read so the status line names it', () => { expect( buildMarkdownDiskFallbackDoc({ content: '# Partial', truncated: true, + byteLength: 700_000, tabIsDirty: true }) ).toMatchObject({ editable: false, stale: true, - readOnlyReason: 'File too large for mobile preview' + readOnlyReason: 'Desktop has unsaved changes. Showing disk content.', + truncated: true, + byteLength: 700_000 }) }) }) diff --git a/mobile/src/session/mobile-markdown-disk-fallback.ts b/mobile/src/session/mobile-markdown-disk-fallback.ts index 910fb0725641..81fa55e14cd6 100644 --- a/mobile/src/session/mobile-markdown-disk-fallback.ts +++ b/mobile/src/session/mobile-markdown-disk-fallback.ts @@ -1,4 +1,5 @@ import type { RpcFailure } from '../transport/types' +import type { MarkdownDocState } from './mobile-session-route-types' const RENDERER_UNAVAILABLE = 'renderer_unavailable' @@ -9,26 +10,24 @@ export function shouldReadMarkdownFromDiskAfterReadTabFailure(response: RpcFailu ) } -// `truncated` is optional because the preview reader salvages it: an absent flag reads as not -// truncated here, which is the branch main took for a reply that omitted it. export function buildMarkdownDiskFallbackDoc(args: { content: string - truncated: boolean | undefined + truncated?: boolean + byteLength?: number tabIsDirty: boolean -}) { - const readOnlyReason = args.truncated - ? 'File too large for mobile preview' - : args.tabIsDirty - ? 'Desktop has unsaved changes. Showing disk content.' - : 'Editing needs Orca desktop running.' +}): Extract { + const readOnlyReason = args.tabIsDirty + ? 'Desktop has unsaved changes. Showing disk content.' + : 'Editing needs Orca desktop running.' return { - status: 'ready' as const, + status: 'ready', content: args.content, localContent: args.content, baseVersion: '', isDirty: false, editable: false, stale: args.tabIsDirty, - readOnlyReason + readOnlyReason, + ...(args.truncated ? { truncated: true, byteLength: args.byteLength } : {}) } } diff --git a/mobile/src/session/mobile-markdown-reader-status.test.ts b/mobile/src/session/mobile-markdown-reader-status.test.ts new file mode 100644 index 000000000000..8bee01b44d63 --- /dev/null +++ b/mobile/src/session/mobile-markdown-reader-status.test.ts @@ -0,0 +1,30 @@ +import { describe, expect, it } from 'vitest' +import { markdownReaderStatusText } from './mobile-markdown-reader-status' + +const readOnlyDoc = { + status: 'ready' as const, + content: '# head', + localContent: '# head', + baseVersion: 'v1', + isDirty: false, + editable: false, + readOnlyReason: 'file_too_large' +} + +describe('markdownReaderStatusText', () => { + it('names a truncated preview and the full file size the way file tabs do', () => { + expect( + markdownReaderStatusText({ ...readOnlyDoc, truncated: true, byteLength: 3_000_000 }) + ).toBe('Preview truncated. File size: 2.9 MB.') + }) + + it('keeps read-only, stale, and save-error states as before', () => { + expect(markdownReaderStatusText(readOnlyDoc)).toBe('Read only') + expect( + markdownReaderStatusText({ ...readOnlyDoc, readOnlyReason: undefined, stale: true }) + ).toBe('Changed on desktop') + expect(markdownReaderStatusText({ ...readOnlyDoc, saveError: 'Save failed' })).toBe( + 'Save failed' + ) + }) +}) diff --git a/mobile/src/session/mobile-markdown-reader-status.ts b/mobile/src/session/mobile-markdown-reader-status.ts new file mode 100644 index 000000000000..060b73beffb8 --- /dev/null +++ b/mobile/src/session/mobile-markdown-reader-status.ts @@ -0,0 +1,20 @@ +import { formatPreviewByteLength } from '../files/mobile-file-preview-response' +import type { MarkdownDocState } from './mobile-session-route-types' + +/** The markdown floating bar's status line; a truncated preview reads like a file tab's note. */ +export function markdownReaderStatusText( + doc: Extract +): string | null { + if (doc.saveError) { + return doc.saveError + } + if (doc.truncated) { + return doc.byteLength === undefined + ? 'Preview truncated.' + : `Preview truncated. File size: ${formatPreviewByteLength(doc.byteLength)}.` + } + if (doc.readOnlyReason) { + return 'Read only' + } + return doc.stale ? 'Changed on desktop' : null +} diff --git a/mobile/src/session/mobile-session-route-parity.test.ts b/mobile/src/session/mobile-session-route-parity.test.ts index 6083ecbcd683..7c0ac36e4532 100644 --- a/mobile/src/session/mobile-session-route-parity.test.ts +++ b/mobile/src/session/mobile-session-route-parity.test.ts @@ -137,7 +137,8 @@ const HEAD_CALLBACK_IDENTITY_SHA256 = // Again when an init took one options object. // Again when the frame's layout became one `notifyTerminalFrame`. // Again when the init option took the message's name, `initialData`. -const HEAD_CALLBACK_BODY_SHA256 = '4848e925f478f1656f26031c1bdebbb9f2da60811c7e91cfd732fc9da9764079' +// Again when the document readers mapped refusal codes through one function and kept truncation. +const HEAD_CALLBACK_BODY_SHA256 = 'ff818790399c8532ead38d047d072caf715070b21311538932da2dc811312b06' // Refreshed for the startup effect: both `worktree.activate` sends became `worktreeActivate`, and // the sleeping-agent check reads that operation's verdict instead of the reply envelope. Refreshed // again when the reporter took the reply and interpreted it itself, retiring the hand-built @@ -203,8 +204,9 @@ const HEAD_TIMER_CLEANUP_SHA256 = 'c73f1d1c2cc89642f3d727d6f3b6b81860a9d6f342345 // 530 -> 532, and the host-JSX hash: the tab bar and the accessory bar take a ref that gives the // page `keyboardShouldPersistTaps` ('handled', 'always'), which react-native-web ignores. Natively // the ref is undefined. 532 -> 531: the live input's reopen flag reads the host OS, not an 'android' literal. +// 531 -> 529: the markdown status line moved to `markdownReaderStatusText`. const HEAD_RUNTIME_STRING_SHA256 = - 'ab8cc43940d3a3e0fdb8df3bdc178b9b61e51c7ccd55a944933862a3c290e8e3' + '4ab2f316f60c234480615136c02273675543f24d653eb76a62b76f6bc986d985' // Moved by both of the dock's fields: their refs, and the live one's submit handler, are the seam's now; // their keyboard type and remount key read the host OS. // Moved again when the terminal frame kept its laid-out width unrounded, for every fit. @@ -654,7 +656,7 @@ describe('mobile session route extraction parity', () => { it('preserves runtime strings, styles, and the expanded JSX tree', () => { const strings = readRuntimeStrings() - expect(strings).toHaveLength(531) + expect(strings).toHaveLength(529) expect(hash(strings)).toBe(HEAD_RUNTIME_STRING_SHA256) const jsx = readJsxFacts(readDefinitions()) expect(jsx.host).toHaveLength(125) diff --git a/mobile/src/session/mobile-session-route-types.ts b/mobile/src/session/mobile-session-route-types.ts index a584049360a0..b28583bd0378 100644 --- a/mobile/src/session/mobile-session-route-types.ts +++ b/mobile/src/session/mobile-session-route-types.ts @@ -91,6 +91,8 @@ export type MarkdownDocState = saving?: boolean saveError?: string readOnlyReason?: string + truncated?: true + byteLength?: number } | { status: 'error'; message: string } diff --git a/mobile/src/session/session-read-reply-schema.ts b/mobile/src/session/session-read-reply-schema.ts index 2a2417c66731..14d163360a0e 100644 --- a/mobile/src/session/session-read-reply-schema.ts +++ b/mobile/src/session/session-read-reply-schema.ts @@ -106,17 +106,20 @@ export const sessionWorktreeRecordSchema = z /** * A markdown tab's document, read the same way on load and on save. * - * `content`, `version` and `isDirty` are required: use-mobile-session-document-readers.ts:38-45 - * publishes all three into the tab's ready state with no guard, so a reply missing one rendered - * `undefined` in the editor and saved against an undefined base version. - * `editable` and `readOnlyReason` are guarded on the same lines and stay optional. + * `content`, `version` and `isDirty` are required: `readMarkdownTab` in + * `useMobileSessionDocumentReaders` publishes all three into the tab's ready state with no guard, + * so a reply missing one rendered `undefined` in the editor and saved against an undefined base + * version. `editable` and `readOnlyReason` are guarded there and stay optional, as are + * `truncated` and `byteLength`, which only a host that truncates oversize documents sends. */ export const markdownTabDocumentSchema = z.looseObject({ content: z.string(), version: z.string(), isDirty: z.boolean(), editable: salvagedOptional('editable', z.boolean()), - readOnlyReason: salvagedOptional('readOnlyReason', z.string()) + readOnlyReason: salvagedOptional('readOnlyReason', z.string()), + truncated: salvagedOptional('truncated', z.boolean()), + byteLength: salvagedOptional('byteLength', z.number()) }) /** diff --git a/mobile/src/session/use-mobile-session-document-readers.test.ts b/mobile/src/session/use-mobile-session-document-readers.test.ts new file mode 100644 index 000000000000..70de6de02a3d --- /dev/null +++ b/mobile/src/session/use-mobile-session-document-readers.test.ts @@ -0,0 +1,95 @@ +import { describe, expect, it, vi } from 'vitest' +import { hookMount, performHookAction } from '../test-support/rpc-recording/hook-mount' +import { mountFixture } from '../test-support/rpc-recording/recorder-fixture-shape' +import type { RpcResponse } from '../transport/types' +import type { MarkdownDocState } from './mobile-session-route-types' +import { useMobileSessionDocumentReaders } from './use-mobile-session-document-readers' + +const META = { runtimeId: 'runtime-1' } + +async function readMarkdown(reply: RpcResponse): Promise { + let docs = new Map() + let readers: ReturnType | undefined + const hook = hookMount(() => { + readers = useMobileSessionDocumentReaders( + mountFixture[0]>({ + worktreeId: 'wt-1', + client: { sendRequest: vi.fn(async (): Promise => reply) }, + setMarkdownDocs: (update) => { + docs = typeof update === 'function' ? update(docs) : update + }, + setFileDocs: () => {} + }) + ) + }) + hook.mount() + await performHookAction(() => + readers?.readMarkdownTab( + mountFixture[0]>({ + type: 'markdown', + id: 'tab-md', + relativePath: 'README.md', + isDirty: false + }) + ) + ) + hook.unmount() + return docs.get('tab-md') +} + +function readTabResult(extra: Record = {}): RpcResponse { + return { + id: 'frame-1', + ok: true, + result: { + tabId: 'tab-md', + content: '# head', + version: 'content:6:0', + isDirty: false, + editable: false, + readOnlyReason: 'file_too_large', + ...extra + }, + _meta: META + } +} + +describe('useMobileSessionDocumentReaders markdown reads', () => { + it('shows an older desktop refusing an oversize file as too large', async () => { + const doc = await readMarkdown({ + id: 'frame-1', + ok: false, + error: { code: 'runtime_error', message: 'file_too_large' }, + _meta: META + }) + expect(doc).toEqual({ status: 'error', message: 'File too large for mobile preview' }) + }) + + it('keeps the generic message for an unknown refusal', async () => { + const doc = await readMarkdown({ + id: 'frame-1', + ok: false, + error: { code: 'tab_not_found', message: 'No such tab' }, + _meta: META + }) + expect(doc).toEqual({ status: 'error', message: "Couldn't load markdown" }) + }) + + it('carries a truncated prefix and the full size into the document', async () => { + const doc = await readMarkdown(readTabResult({ truncated: true, byteLength: 3_000_000 })) + expect(doc).toMatchObject({ + status: 'ready', + content: '# head', + editable: false, + truncated: true, + byteLength: 3_000_000 + }) + }) + + it('adds no truncation fields for a whole document', async () => { + const doc = await readMarkdown(readTabResult()) + expect(doc).toMatchObject({ status: 'ready', content: '# head' }) + expect(doc).not.toHaveProperty('truncated') + expect(doc).not.toHaveProperty('byteLength') + }) +}) diff --git a/mobile/src/session/use-mobile-session-document-readers.ts b/mobile/src/session/use-mobile-session-document-readers.ts index 857d19815700..bc2e3d69e8e0 100644 --- a/mobile/src/session/use-mobile-session-document-readers.ts +++ b/mobile/src/session/use-mobile-session-document-readers.ts @@ -34,7 +34,10 @@ export function useMobileSessionDocumentReaders(scope: MobileSessionTabApplicati isDirty: false, editable: result.editable === true, stale: result.isDirty, - readOnlyReason: result.readOnlyReason + readOnlyReason: result.readOnlyReason, + ...(result.truncated === true + ? { truncated: true, byteLength: result.byteLength } + : {}) }) ) return @@ -59,15 +62,16 @@ export function useMobileSessionDocumentReaders(scope: MobileSessionTabApplicati buildMarkdownDiskFallbackDoc({ content: fileResult.content, truncated: fileResult.truncated, + byteLength: fileResult.byteLength, tabIsDirty: tab.isDirty }) ) ) - } catch { + } catch (err) { setMarkdownDocs((prev) => new Map(prev).set(tab.id, { status: 'error', - message: "Couldn't load markdown" + message: documentReadErrorMessage(err, "Couldn't load markdown") }) ) } @@ -89,15 +93,12 @@ export function useMobileSessionDocumentReaders(scope: MobileSessionTabApplicati }) setFileDocs((prev) => new Map(prev).set(tab.id, doc)) } catch (err) { - const message = err instanceof Error ? err.message : '' - const previewMessage = - message === 'binary_file' - ? 'Binary preview unavailable' - : message === 'file_too_large' - ? 'File too large for mobile preview' - : tab.diffSource === 'staged' || tab.diffSource === 'unstaged' - ? "Couldn't load diff preview" - : "Couldn't load file preview" + const previewMessage = documentReadErrorMessage( + err, + tab.diffSource === 'staged' || tab.diffSource === 'unstaged' + ? "Couldn't load diff preview" + : "Couldn't load file preview" + ) setFileDocs((prev) => new Map(prev).set(tab.id, { status: 'error', @@ -114,5 +115,17 @@ export function useMobileSessionDocumentReaders(scope: MobileSessionTabApplicati } } +// Why: older desktops refuse oversize markdown as a bare runtime_error whose message is the code. +function documentReadErrorMessage(err: unknown, fallback: string): string { + const message = err instanceof Error ? err.message : '' + if (message === 'binary_file') { + return 'Binary preview unavailable' + } + if (message === 'file_too_large') { + return 'File too large for mobile preview' + } + return fallback +} + export type MobileSessionDocumentReadersModel = MobileSessionTabApplicationModel & ReturnType diff --git a/src/renderer/src/runtime/mobile-markdown-bridge.test.ts b/src/renderer/src/runtime/mobile-markdown-bridge.test.ts index 2e5abd834e42..e039cc515ebb 100644 --- a/src/renderer/src/runtime/mobile-markdown-bridge.test.ts +++ b/src/renderer/src/runtime/mobile-markdown-bridge.test.ts @@ -1,7 +1,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { hashMarkdownContent, - MOBILE_MARKDOWN_EDIT_MAX_BYTES + MOBILE_MARKDOWN_EDIT_MAX_BYTES, + MOBILE_MARKDOWN_READ_MAX_BYTES } from '../../../shared/mobile-markdown-document' import { attachEditorAutosaveController } from '../components/editor/editor-autosave-controller' import { registerPendingEditorFlush } from '../components/editor/editor-pending-flush' @@ -157,4 +158,69 @@ describe('mobile markdown bridge', () => { detach() } }) + + it('reads a markdown file between the edit and read budgets whole, as read-only', async () => { + openMarkdownFile() + const content = 'a'.repeat(632 * 1024) + setupWindow({ readFile: vi.fn().mockResolvedValue({ content, isBinary: false }) }) + const detach = attachMobileMarkdownBridge() + + try { + const response = await sendRequest({ + id: 'read-632k', + operation: 'read', + worktreeId: 'wt-1', + tabId: 'tab-md' + }) + + expect(response).toMatchObject({ + ok: true, + result: { content, editable: false, readOnlyReason: 'file_too_large' } + }) + expect(response).not.toHaveProperty('result.truncated') + } finally { + detach() + } + }) + + it('truncates a markdown file over the read budget on a UTF-8 boundary', async () => { + openMarkdownFile() + // The 3-byte euro sign straddles the budget, so the cut must drop it whole. + const prefix = 'a'.repeat(MOBILE_MARKDOWN_READ_MAX_BYTES - 1) + const content = `${prefix}\u20actail` + setupWindow({ readFile: vi.fn().mockResolvedValue({ content, isBinary: false }) }) + const detach = attachMobileMarkdownBridge() + + try { + const response = await sendRequest({ + id: 'read-over-budget', + operation: 'read', + worktreeId: 'wt-1', + tabId: 'tab-md' + }) + + expect(response).toMatchObject({ + ok: true, + result: { + editable: false, + readOnlyReason: 'file_too_large', + truncated: true, + byteLength: MOBILE_MARKDOWN_READ_MAX_BYTES - 1 + 3 + 4, + version: hashMarkdownContent(prefix) + } + }) + expect(response).toHaveProperty('result.content', prefix) + const save = await sendRequest({ + id: 'save-truncated', + operation: 'save', + worktreeId: 'wt-1', + tabId: 'tab-md', + baseVersion: hashMarkdownContent(prefix), + content: prefix + }) + expect(save).toMatchObject({ ok: false, error: 'file_too_large' }) + } finally { + detach() + } + }) }) diff --git a/src/renderer/src/runtime/mobile-markdown-bridge.ts b/src/renderer/src/runtime/mobile-markdown-bridge.ts index b605c014801d..c51a76568432 100644 --- a/src/renderer/src/runtime/mobile-markdown-bridge.ts +++ b/src/renderer/src/runtime/mobile-markdown-bridge.ts @@ -15,13 +15,13 @@ import { hashMarkdownContent, isMarkdownContentByteLengthOverLimit, MOBILE_MARKDOWN_EDIT_MAX_BYTES, + truncateMobileMarkdownRead, type RuntimeMarkdownReadTabResult, type RuntimeMarkdownSaveTabResult, type RuntimeMobileMarkdownRequest, type RuntimeMobileMarkdownResponse } from '../../../shared/mobile-markdown-document' -const MOBILE_MARKDOWN_READ_MAX_BYTES = 512 * 1024 const saveQueues = new Map>() type FileContent = { @@ -67,16 +67,18 @@ async function readMobileMarkdownTab( flushEditorState(target.sourceFile.id) const { content, source } = await readCurrentContent(target.sourceFile) const readOnlyReason = getReadOnlyReason(target.tab, target.sourceFile, content) + const preview = truncateMobileMarkdownRead(content) return { tabId, filePath: target.sourceFile.filePath, relativePath: target.sourceFile.relativePath, - content, + content: preview.content, isDirty: target.sourceFile.isDirty || source === 'draft', - version: hashMarkdownContent(content), + version: hashMarkdownContent(preview.content), source, editable: readOnlyReason === undefined, - ...(readOnlyReason ? { readOnlyReason } : {}) + ...(readOnlyReason ? { readOnlyReason } : {}), + ...(preview.truncated ? { truncated: true, byteLength: preview.byteLength } : {}) } } @@ -252,9 +254,6 @@ async function readFileContent(file: OpenFile): Promise { if (result.isBinary) { throw new Error('binary_file') } - if (isMarkdownContentByteLengthOverLimit(result.content, MOBILE_MARKDOWN_READ_MAX_BYTES)) { - throw new Error('file_too_large') - } return result.content } diff --git a/src/shared/mobile-markdown-document.test.ts b/src/shared/mobile-markdown-document.test.ts index f4d2a0032619..a44191edf914 100644 --- a/src/shared/mobile-markdown-document.test.ts +++ b/src/shared/mobile-markdown-document.test.ts @@ -3,6 +3,7 @@ import { hashMarkdownContent, isMarkdownContentByteLengthOverLimit, MOBILE_MARKDOWN_EDIT_MAX_BYTES, + MOBILE_MARKDOWN_READ_MAX_BYTES, utf8ByteLength } from './mobile-markdown-document' @@ -45,4 +46,9 @@ describe('mobile markdown document byte accounting', () => { it('keeps content hashes prefixed with exact byte length', () => { expect(hashMarkdownContent('😀')).toMatch(/^content:4:/) }) + + it('keeps the read budget above the edit budget', () => { + // Behavioural pin for truncated => not editable: the bridge's over-budget read test. + expect(MOBILE_MARKDOWN_READ_MAX_BYTES).toBeGreaterThan(MOBILE_MARKDOWN_EDIT_MAX_BYTES) + }) }) diff --git a/src/shared/mobile-markdown-document.ts b/src/shared/mobile-markdown-document.ts index dced4bb8c851..14a6474cf5dc 100644 --- a/src/shared/mobile-markdown-document.ts +++ b/src/shared/mobile-markdown-document.ts @@ -1,6 +1,11 @@ import { getClipboardTextByteLength, isClipboardTextByteLengthOverLimit } from './clipboard-text' +import { clampUtf8TextPrefix } from './utf8-byte-limits' export const MOBILE_MARKDOWN_EDIT_MAX_BYTES = 256 * 1024 +/** Markdown preview budget; the file preview keeps its own. Above it a mobile read returns a + * UTF-8-boundary prefix marked `truncated`, never a refusal. Sized like the 2 MiB terminal + * snapshot; the relay splice frame cap is 8 MiB. */ +export const MOBILE_MARKDOWN_READ_MAX_BYTES = 2 * 1024 * 1024 export type RuntimeMarkdownReadOnlyReason = | 'unsupported_preview' @@ -46,6 +51,10 @@ export type RuntimeMarkdownReadTabResult = { source: 'draft' | 'file' editable: boolean readOnlyReason?: RuntimeMarkdownReadOnlyReason + /** Present only when `content` is a prefix; older phones ignore both fields. */ + truncated?: boolean + /** The full document's UTF-8 size, sent with `truncated`. */ + byteLength?: number } export type RuntimeMarkdownSaveTabResult = { @@ -71,3 +80,19 @@ export function isMarkdownContentByteLengthOverLimit(content: string, maxBytes: export function utf8ByteLength(content: string): number { return getClipboardTextByteLength(content) } + +export function truncateMobileMarkdownRead( + content: string +): + | { content: string; truncated: false } + | { content: string; truncated: true; byteLength: number } { + const byteLength = utf8ByteLength(content) + if (byteLength <= MOBILE_MARKDOWN_READ_MAX_BYTES) { + return { content, truncated: false } + } + return { + content: clampUtf8TextPrefix(content, MOBILE_MARKDOWN_READ_MAX_BYTES), + truncated: true, + byteLength + } +} From 0f52bb8be5c0f3cdbfa0f98bd259e8d0425d8591 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:05:30 -0700 Subject: [PATCH 22/90] perf(ci): use four ARM test workers and remove repeated compilation (#23685) * ci: benchmark per-job Node compile caching on full unit shards * ci: measure unit shards with three and four workers * ci: benchmark localization extraction CLI patch * perf(build): reuse identical relay bundles across platforms * ci: compare Vitest 4 and 5 on complete ARM shards * perf(ci): upgrade localization extraction to skip irrelevant syntax walks * perf(ci): use all four ARM cores and remove benchmark workflows * ci: preserve failures while capturing unit source revision * fix(ci): preserve commented and escaped localization calls * ci: remove corrected localization benchmark harness --- .github/workflows/unit-tests.yml | 6 +- config/patches/i18next-cli@1.74.2.patch | 44 +++++++++++++ config/scripts/build-relay.mjs | 62 ++++++++++++------- ...calization-extraction-call-syntax.test.mjs | 56 +++++++++++++++++ .../scripts/relay-artifact-manifest.test.mjs | 16 ++++- package.json | 2 +- pnpm-lock.yaml | 21 ++++--- pnpm-workspace.yaml | 2 + 8 files changed, 172 insertions(+), 37 deletions(-) create mode 100644 config/patches/i18next-cli@1.74.2.patch create mode 100644 config/scripts/localization-extraction-call-syntax.test.mjs diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 2691f4907bcc..9ed968476773 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -83,9 +83,11 @@ jobs: ORCA_BALANCE_UNIT_SHARDS: '1' ORCA_BACKGROUND_LAUNCH: '1' run: | - export ORCA_SHARD_SOURCE_SHA="$(git rev-parse HEAD)" + ORCA_SHARD_SOURCE_SHA="$(git rev-parse HEAD)" + export ORCA_SHARD_SOURCE_SHA pnpm exec vitest run --config config/vitest.config.ts \ - --shard=${{ matrix.shard.index }}/${{ matrix.shard.count }} + --shard=${{ matrix.shard.index }}/${{ matrix.shard.count }} \ + ${{ inputs.runner == 'ubuntu-24.04-arm' && '--maxWorkers=4' || '' }} - name: Upload unit shard assignment if: always() diff --git a/config/patches/i18next-cli@1.74.2.patch b/config/patches/i18next-cli@1.74.2.patch new file mode 100644 index 000000000000..e4eb976d1ec7 --- /dev/null +++ b/config/patches/i18next-cli@1.74.2.patch @@ -0,0 +1,44 @@ +diff --git a/dist/cjs/extractor/core/extractor.js b/dist/cjs/extractor/core/extractor.js +index 6d61ade2471c20bf1a253e3784bfadcb01440545..c1b001e78a215f89a8d4da1756a87562a5a6e723 100644 +--- a/dist/cjs/extractor/core/extractor.js ++++ b/dist/cjs/extractor/core/extractor.js +@@ -143,6 +143,8 @@ const extractionSiteRegexes = new WeakMap(); + * @internal + */ + function mayContainExtractionSite(code, config) { ++ // Escaped identifiers need the parser; comments can separate a name from its call. ++ if (code.includes('\\u')) return true; + let re = extractionSiteRegexes.get(config); + if (!re) { + const calls = new Set(['t']); +@@ -160,7 +162,7 @@ function mayContainExtractionSite(code, config) { + for (const component of config.extract.transComponents || ['Trans']) + names.add(component.split('.').pop()); + const alt = (set) => [...set].map(s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'); +- re = new RegExp(`(? [...set].map(s => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'); +- re = new RegExp(`(?('probe.generic', 'Generic')", + dollar: "$api.t /* member */ ('probe.dollar', 'Dollar')", + unicode: "transl\\u0061te('probe.unicode', 'Unicode')" +} + +describe.each([ + ['ES module', findKeys], + ['CommonJS', commonJsFindKeys] +])('localization extraction through %s', (_name, extractKeys) => { + it('keeps keys in calls containing comments or escaped identifiers', async () => { + const directory = mkdtempSync(join(tmpdir(), 'orca-extraction-syntax-')) + try { + for (const [name, source] of Object.entries(calls)) { + writeFileSync(join(directory, `${name}.ts`), source) + } + const errors = [] + const result = await extractKeys( + { + locales: ['en'], + extract: { + input: [join(directory, '*.ts').replaceAll('\\', '/')], + defaultNS: false, + functions: ['t', '*.t', 'translate'], + disablePlurals: true + } + }, + undefined, + errors + ) + expect(errors).toEqual([]) + expect([...result.allKeys.values()].map((entry) => entry.key).sort()).toEqual( + Object.keys(calls) + .map((name) => `probe.${name}`) + .sort() + ) + } finally { + rmSync(directory, { recursive: true, force: true }) + } + }) +}) diff --git a/config/scripts/relay-artifact-manifest.test.mjs b/config/scripts/relay-artifact-manifest.test.mjs index 7177b9821f8f..5f66ee7136f8 100644 --- a/config/scripts/relay-artifact-manifest.test.mjs +++ b/config/scripts/relay-artifact-manifest.test.mjs @@ -5,7 +5,15 @@ // and never forks. import { execFileSync } from 'node:child_process' import { createHash } from 'node:crypto' -import { existsSync, mkdtempSync, readdirSync, readFileSync, rmSync } from 'node:fs' +import { + existsSync, + mkdirSync, + mkdtempSync, + readdirSync, + readFileSync, + rmSync, + writeFileSync +} from 'node:fs' import { tmpdir } from 'node:os' import { join, resolve } from 'node:path' import { afterAll, beforeAll, describe, expect, it } from 'vitest' @@ -23,6 +31,12 @@ const projectDir = resolve(import.meta.dirname, '../..') const relayOutDir = mkdtempSync(join(tmpdir(), 'orca-relay-contract-')) beforeAll(() => { + // A repeated build must not copy stale companions into the other platform bundles. + for (const platform of RELAY_BUILD_PLATFORMS) { + const outDir = join(relayOutDir, platform) + mkdirSync(outDir, { recursive: true }) + writeFileSync(join(outDir, 'stale-companion.js'), 'throw new Error("stale")') + } execFileSync('node', [join(projectDir, 'config', 'scripts', 'build-relay.mjs')], { cwd: projectDir, stdio: 'pipe', diff --git a/package.json b/package.json index feec79fee07e..0b41ed3980ac 100644 --- a/package.json +++ b/package.json @@ -266,7 +266,7 @@ "happy-dom": "^20.11.8", "html-to-image": "^1.11.13", "husky": "^9.1.7", - "i18next-cli": "1.74.1", + "i18next-cli": "1.74.2", "katex": "^0.16.45", "lint-staged": "^16.4.0", "lowlight": "^3.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d82edc51bfc..02422ea3f196 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -109,6 +109,7 @@ overrides: monaco-editor>dompurify: 3.4.15 patchedDependencies: + i18next-cli@1.74.2: 7955b89d3aa229f477408608d331f78c85148a85a85913729f89fac65ad8b207 '@vscode/windows-process-tree@0.8.0': b4be93859cefb159949d9cf05f97fa91a221dff0f793a6f03d02d78ae5b32035 '@xterm/addon-image@0.10.0-beta.300': 5fc280019957573eefe8daa2969534d6090ddb29c6b5842b8f22e99dc1ce3146 '@xterm/addon-ligatures@0.11.0-beta.300': 47405b9994b5acf1b4e90b49250358c1ca03649854d59560e7732b72fe336920 @@ -395,8 +396,8 @@ importers: specifier: ^9.1.7 version: 9.1.7 i18next-cli: - specifier: 1.74.1 - version: 1.74.1(@types/node@25.9.5)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(typescript@7.0.2) + specifier: 1.74.2 + version: 1.74.2(patch_hash=7955b89d3aa229f477408608d331f78c85148a85a85913729f89fac65ad8b207)(@types/node@25.9.5)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(typescript@7.0.2) katex: specifier: ^0.16.45 version: 0.16.45 @@ -5339,13 +5340,13 @@ packages: engines: {node: '>=18'} hasBin: true - i18next-cli@1.74.1: - resolution: {integrity: sha512-8OEbo4jfn4r4/QwieyAvoLWV/rJW2OR6SG09I12jA6kffyhUNsyrH6OaA4bumLIWkdBaGySbiFm0wj1k19N/jA==} + i18next-cli@1.74.2: + resolution: {integrity: sha512-y32hOiVNLs85f+TKCl4XqERjD0dFy274IOEXe7/Zyp+WMaQC9VhF33JLO0hQZZKK4PUmYwbRDXaSObeE3PbsmA==} engines: {node: '>=22'} hasBin: true - i18next-resources-for-ts@2.1.0: - resolution: {integrity: sha512-n5UexwEVt0OoIAhG2MWpSnAVJW1U8mQrQTmXyxc5DMAx+NLhcLZhSMJo/FnUsA5JQ3obTYqTgB7YIuZKWpDgow==} + i18next-resources-for-ts@2.1.1: + resolution: {integrity: sha512-Xhz8S8dtNIPawzeWdmssnsII1JYsbvPWOLmstJakNcgKSFLCneA+xN7qajj/zlk5nf9sx1KGDTx8RNZ73h68tw==} hasBin: true i18next@26.3.1: @@ -12377,7 +12378,7 @@ snapshots: husky@9.1.7: {} - i18next-cli@1.74.1(@types/node@25.9.5)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(typescript@7.0.2): + i18next-cli@1.74.2(patch_hash=7955b89d3aa229f477408608d331f78c85148a85a85913729f89fac65ad8b207)(@types/node@25.9.5)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(typescript@7.0.2): dependencies: '@croct/json5-parser': 0.2.2 '@swc/core': 1.16.2 @@ -12386,7 +12387,7 @@ snapshots: execa: 10.0.1 glob: 13.0.6 i18next: 26.4.2(typescript@7.0.2) - i18next-resources-for-ts: 2.1.0 + i18next-resources-for-ts: 2.1.1 inquirer: 14.2.2(@types/node@25.9.5) jiti: 2.7.0 jsonc-parser: 3.3.1 @@ -12403,10 +12404,10 @@ snapshots: - react-native - typescript - i18next-resources-for-ts@2.1.0: + i18next-resources-for-ts@2.1.1: dependencies: '@babel/runtime': 7.29.7 - '@swc/core': 1.15.46 + '@swc/core': 1.16.2 chokidar: 5.0.0 yaml: 2.9.1 transitivePeerDependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e8a845e1975e..cbb3e10ad4c1 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -17,6 +17,7 @@ minimumReleaseAgeExclude: - pdfjs-dist@6.3.289 - zod@4.5.4 - '@shadcn/lint@0.1.0' + - i18next-cli@1.74.2 shamefullyHoist: true # Orca always launches the user's own resolved Claude CLI via @@ -68,3 +69,4 @@ patchedDependencies: '@xterm/xterm@6.1.0-beta.303': config/patches/@xterm__xterm@6.1.0-beta.303.patch lint-staged@16.4.0: config/patches/lint-staged@16.4.0.patch '@vscode/windows-process-tree@0.8.0': config/patches/@vscode__windows-process-tree@0.8.0.patch + i18next-cli@1.74.2: config/patches/i18next-cli@1.74.2.patch From 0ceb3fa2af7e51ae6e4cc5c8b6d2c416fe2f886e Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:12:24 -0700 Subject: [PATCH 23/90] test(e2e): give wheel probes a running TUI fixture (#23691) --- tests/e2e/terminal-tui-wheel-reports.spec.ts | 28 +++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/e2e/terminal-tui-wheel-reports.spec.ts b/tests/e2e/terminal-tui-wheel-reports.spec.ts index ab02cf7a98b4..f3259409cdbd 100644 --- a/tests/e2e/terminal-tui-wheel-reports.spec.ts +++ b/tests/e2e/terminal-tui-wheel-reports.spec.ts @@ -47,8 +47,6 @@ async function probeSmallMouseWheelReports( const reports: string[] = [] const disposable = pane.terminal.onData((data) => reports.push(data)) try { - await new Promise((resolve) => pane.terminal.write('\x1b[?1003h\x1b[?1006h', resolve)) - await new Promise((resolve) => requestAnimationFrame(() => resolve(undefined))) if (!pane.terminal.element.classList.contains('enable-mouse-events')) { throw new Error('Mouse reporting mode did not activate') } @@ -139,8 +137,6 @@ async function probeTimedSmallMouseWheelReports( const reports: string[] = [] const disposable = pane.terminal.onData((data) => reports.push(data)) try { - await new Promise((resolve) => pane.terminal.write('\x1b[?1003h\x1b[?1006h', resolve)) - await new Promise((resolve) => requestAnimationFrame(() => resolve(undefined))) if (!pane.terminal.element.classList.contains('enable-mouse-events')) { throw new Error('Mouse reporting mode did not activate') } @@ -284,6 +280,18 @@ async function dispatchTuiWheel( }, options) } +// Let a running TUI own mouse mode; late shell startup output can reset injected modes. +async function startTuiFixture(page: Page): Promise { + const ptyId = await waitForActivePanePtyId(page) + await execInTerminal(page, ptyId, `node ${JSON.stringify(VISIBLE_TUI_FIXTURE_PATH)}`) + await expect + .poll(() => readVisibleTuiOffset(page), { + timeout: 10_000, + message: 'fullscreen TUI did not render numbered rows' + }) + .toBe(0) +} + test.describe('terminal TUI wheel reports', () => { test('notched mouse wheel ticks produce immediate mouse-reporting TUI scroll reports', async ({ orcaPage @@ -296,6 +304,7 @@ test.describe('terminal TUI wheel reports', () => { window.__store?.getState().updateSettings({ terminalTuiScrollSensitivity: 1 }) ) + await startTuiFixture(orcaPage) const samples = await probeSmallMouseWheelReports(orcaPage, 4) expect( @@ -338,15 +347,7 @@ test.describe('terminal TUI wheel reports', () => { window.__store?.getState().updateSettings({ terminalTuiScrollSensitivity: 1 }) ) - const ptyId = await waitForActivePanePtyId(orcaPage) - await execInTerminal(orcaPage, ptyId, `node ${JSON.stringify(VISIBLE_TUI_FIXTURE_PATH)}`) - - await expect - .poll(() => readVisibleTuiOffset(orcaPage), { - timeout: 10_000, - message: 'visible fullscreen TUI did not render numbered rows' - }) - .toBe(0) + await startTuiFixture(orcaPage) await dispatchTuiWheel(orcaPage, { deltaY: 10, @@ -399,6 +400,7 @@ test.describe('terminal TUI wheel reports', () => { window.__store?.getState().updateSettings({ terminalTuiScrollSensitivity: 5 }) ) + await startTuiFixture(orcaPage) const slow = await probeTimedSmallMouseWheelReports(orcaPage, { drainWaitMs: 120, intervalMs: 220, From 1a0ff42eb16c17c619f256fb4f7ee43a9df68dbf Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:16:40 -0700 Subject: [PATCH 24/90] test: finish sidebar lazy imports before teardown (#23694) --- .../WorktreeList.lineage-agent-expansion-coupling.test.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/renderer/src/components/sidebar/WorktreeList.lineage-agent-expansion-coupling.test.tsx b/src/renderer/src/components/sidebar/WorktreeList.lineage-agent-expansion-coupling.test.tsx index a68908e56189..f3cbe8ff0e79 100644 --- a/src/renderer/src/components/sidebar/WorktreeList.lineage-agent-expansion-coupling.test.tsx +++ b/src/renderer/src/components/sidebar/WorktreeList.lineage-agent-expansion-coupling.test.tsx @@ -463,6 +463,8 @@ describe('WorktreeCard agent-list <-> child-worktrees expansion coupling', () => for (const root of mountedRoots.splice(0)) { root.unmount() } + // Lazy markdown imports must finish before Vitest tears down the module environment. + await vi.dynamicImportSettled() }) document.body.innerHTML = '' clearWorktreeAgentExpansionStateForTests() From dbc4e21d9cd830f9e4dba77d253711f5d20e5f4a Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:27:29 -0700 Subject: [PATCH 25/90] fix(sidebar): move agent child disclosure to the right (#23577) * fix(sidebar): move agent child disclosure to the timestamp slot * fix(sidebar): align agent disclosure with summary caret --- src/renderer/src/assets/main.css | 25 +++ .../DashboardAgentChildDisclosure.test.tsx | 157 ++++++++++++++++++ .../DashboardAgentChildDisclosure.tsx | 68 +++++--- .../dashboard/DashboardAgentRow.tsx | 17 +- .../DashboardAgentRowTrailingControls.tsx | 35 +++- .../sidebar/WorktreeCardAgents.test.tsx | 5 - .../components/sidebar/WorktreeCardAgents.tsx | 7 +- .../worktree-card-compact-agent-row.tsx | 80 +++------ 8 files changed, 284 insertions(+), 110 deletions(-) create mode 100644 src/renderer/src/components/dashboard/DashboardAgentChildDisclosure.test.tsx diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css index 05ffc6607320..7f555bf724d4 100644 --- a/src/renderer/src/assets/main.css +++ b/src/renderer/src/assets/main.css @@ -1626,6 +1626,31 @@ html.native-shell .app-layout { animation: compact-agent-expansion-reveal 180ms cubic-bezier(0.16, 1, 0.3, 1) both; } +/* Keep the disclosure in the timestamp slot without moving adjacent content. */ +.agent-child-disclosure-time { + visibility: hidden; +} + +@media (hover: hover) { + .agent-child-disclosure[data-expanded='false'] .agent-child-disclosure-time { + visibility: visible; + } + + .agent-child-disclosure[data-expanded='false'] [data-agent-child-disclosure-button] { + opacity: 0; + } + + .agent-disclosure-row:hover .agent-child-disclosure-time, + .agent-disclosure-row:focus-within .agent-child-disclosure-time { + visibility: hidden; + } + + .agent-disclosure-row:hover [data-agent-child-disclosure-button], + .agent-disclosure-row:focus-within [data-agent-child-disclosure-button] { + opacity: 1; + } +} + /* Why: the collapsed summary still uses pill spacing, while expanded compact agents read as a quiet tree inside the existing worktree card. */ .compact-agent-summary-panel { diff --git a/src/renderer/src/components/dashboard/DashboardAgentChildDisclosure.test.tsx b/src/renderer/src/components/dashboard/DashboardAgentChildDisclosure.test.tsx new file mode 100644 index 000000000000..6d0994eb7604 --- /dev/null +++ b/src/renderer/src/components/dashboard/DashboardAgentChildDisclosure.test.tsx @@ -0,0 +1,157 @@ +/** @vitest-environment happy-dom */ +import { fireEvent, render, screen, cleanup } from '@testing-library/react' +import { afterEach, describe, expect, it, vi } from 'vitest' +import { CompactAgentRow } from '../sidebar/worktree-card-compact-agent-row' +import { TooltipProvider } from '../ui/tooltip' +import DashboardAgentRow from './DashboardAgentRow' +import type { DashboardAgentRow as AgentRow } from './useDashboardData' +import { DashboardAgentChildDisclosure } from './DashboardAgentChildDisclosure' + +vi.mock('./use-agent-row-conversation-name', () => ({ useAgentRowConversationName: () => null })) +vi.mock('../sidebar/CacheTimer', () => ({ + default: () => null, + usePromptCacheCountdownForPane: () => null +})) + +afterEach(cleanup) + +const agent: AgentRow = { + paneKey: 'tab:leaf', + agentType: 'claude', + state: 'working', + startedAt: 60000, + entry: { + paneKey: 'tab:leaf', + state: 'working', + prompt: 'Review the change', + updatedAt: 60000, + stateStartedAt: 60000, + stateHistory: [] + }, + tab: { + id: 'tab', + ptyId: null, + worktreeId: 'workspace', + title: 'Agent', + customTitle: null, + color: null, + sortOrder: 0, + createdAt: 1 + } +} + +describe('agent child disclosure', () => { + it('toggles children without activating the surrounding agent or workspace', () => { + const activate = vi.fn() + const toggle = vi.fn() + const pointerDown = vi.fn() + const keyDown = vi.fn() + render( +

+ +
+ ) + const button = screen.getByRole('button', { name: 'Show 2 child agents' }) + fireEvent.pointerDown(button) + fireEvent.keyDown(button, { key: 'Enter' }) + fireEvent.keyDown(button, { key: ' ' }) + fireEvent.click(button) + expect(toggle).toHaveBeenCalledTimes(1) + expect(activate).not.toHaveBeenCalled() + expect(pointerDown).not.toHaveBeenCalled() + expect(keyDown).not.toHaveBeenCalled() + }) + + it('updates the accessible action and retains the timestamp when expanded', () => { + const toggle = vi.fn() + const { rerender } = render( + + ) + expect( + screen.getByRole('button', { name: 'Show 1 child agent' }).getAttribute('aria-expanded') + ).toBe('false') + rerender( + + ) + expect( + screen.getByRole('button', { name: 'Hide 1 child agent' }).getAttribute('aria-expanded') + ).toBe('true') + expect(screen.getByText('5m')).toBeTruthy() + }) + + it('does not offer a disclosure without children or a toggle action', () => { + const { rerender } = render( + + ) + expect(screen.queryByRole('button')).toBeNull() + rerender() + expect(screen.queryByRole('button')).toBeNull() + }) +}) + +describe.each(['compact', 'full'] as const)('%s row disclosure actions', (mode) => { + it.each([undefined, 'eligible'] as const)( + 'keeps child expansion separate from row actions in %s send mode', + (sendTargetStatus) => { + const onActivate = vi.fn(), + onSendTargetClick = vi.fn(), + onDismiss = vi.fn(), + onToggleChildAgents = vi.fn() + const props = { + agent, + now: 120000, + childAgentCount: 2, + childAgentsExpanded: false, + onToggleChildAgents, + onActivate, + sendTargetStatus, + onSendTargetClick + } + render( + + {mode === 'compact' ? ( + + ) : ( + + )} + + ) + fireEvent.click(screen.getByRole('button', { name: 'Show 2 child agents' })) + expect(onToggleChildAgents).toHaveBeenCalledTimes(1) + expect(onActivate).not.toHaveBeenCalled() + expect(onSendTargetClick).not.toHaveBeenCalled() + expect(onDismiss).not.toHaveBeenCalled() + fireEvent.click(screen.getByText('Review the change')) + if (sendTargetStatus) { + expect(onSendTargetClick).toHaveBeenCalledWith(agent.paneKey) + expect(onActivate).not.toHaveBeenCalled() + } else { + expect(onActivate).toHaveBeenCalledWith(agent.tab.id, agent.paneKey) + if (mode === 'full') { + fireEvent.click(screen.getByRole('button', { name: 'Dismiss agent' })) + expect(onDismiss).toHaveBeenCalledWith(agent.paneKey) + expect(onActivate).toHaveBeenCalledTimes(1) + } + } + } + ) +}) diff --git a/src/renderer/src/components/dashboard/DashboardAgentChildDisclosure.tsx b/src/renderer/src/components/dashboard/DashboardAgentChildDisclosure.tsx index fb8e45b42168..4e225a287dda 100644 --- a/src/renderer/src/components/dashboard/DashboardAgentChildDisclosure.tsx +++ b/src/renderer/src/components/dashboard/DashboardAgentChildDisclosure.tsx @@ -1,18 +1,21 @@ import React, { useCallback } from 'react' -import { ChevronRight } from 'lucide-react' +import { ChevronDown } from 'lucide-react' import { cn } from '@/lib/utils' +import { Button } from '@/components/ui/button' import { translate } from '@/i18n/i18n' type Props = { childAgentCount?: number childAgentsExpanded: boolean onToggleChildAgents?: () => void + timestamp?: React.ReactNode } export function DashboardAgentChildDisclosure({ childAgentCount, childAgentsExpanded, - onToggleChildAgents + onToggleChildAgents, + timestamp }: Props) { const hasChildDisclosure = typeof childAgentCount === 'number' && @@ -40,29 +43,46 @@ export function DashboardAgentChildDisclosure({ } return ( - + aria-expanded={childAgentsExpanded} + > + + + ) } diff --git a/src/renderer/src/components/dashboard/DashboardAgentRow.tsx b/src/renderer/src/components/dashboard/DashboardAgentRow.tsx index 4b38d8d1b0df..1b64ec6af836 100644 --- a/src/renderer/src/components/dashboard/DashboardAgentRow.tsx +++ b/src/renderer/src/components/dashboard/DashboardAgentRow.tsx @@ -4,7 +4,6 @@ import { AgentStateDot, agentStateLabel, type AgentDotState } from '@/components import { AgentIcon } from '@/lib/agent-catalog' import { agentTypeToIconAgent, formatAgentTypeLabel } from '@/lib/agent-status' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' -import { DashboardAgentChildDisclosure } from './DashboardAgentChildDisclosure' import { DashboardAgentRowMessage } from './DashboardAgentRowMessage' import { DashboardAgentRowTrailingControls } from './DashboardAgentRowTrailingControls' import { DashboardAgentRowToolStep } from './DashboardAgentRowToolStep' @@ -56,12 +55,10 @@ type Props = { hideExpand?: boolean /** Reuse the row's hover tint to show the focused terminal pane's agent. */ isFocusedPane?: boolean - // Why: inline-card orchestration rows fold children under a leading chevron. + // Why: inline-card orchestration rows can fold their child agents. childAgentCount?: number childAgentsExpanded?: boolean onToggleChildAgents?: () => void - // Why: a top-level chevron hangs in the card gutter so the state dot keeps the column of chevron-less rows. - disclosureInGutter?: boolean // Why: chevron indentation replaces fixed-offset lineage connector art. hideLineageConnectors?: boolean // Why: send-popover target mode makes row clicks send/no-op instead of navigating. @@ -83,7 +80,6 @@ const DashboardAgentRow = React.memo(function DashboardAgentRow({ childAgentCount, childAgentsExpanded = false, onToggleChildAgents, - disclosureInGutter = false, hideLineageConnectors = false, sendTargetStatus, sendTargetDisabledReason, @@ -185,8 +181,7 @@ const DashboardAgentRow = React.memo(function DashboardAgentRow({ onClick={handleActivate} className={cn( // Why: named group scopes the X-reveal to this row, not every row in the card. - 'group/agent-row relative flex flex-col py-1', - hasChildDisclosure && disclosureInGutter ? '-ml-7' : '-ml-2', + 'agent-disclosure-row group/agent-row relative -ml-2 flex flex-col py-1', isLineageChild ? 'pl-5 pr-2' : 'px-2', // Why: hover wash stays softer than the enclosing card's highlight. 'cursor-pointer rounded-sm worktree-agent-row-hover', @@ -229,11 +224,6 @@ const DashboardAgentRow = React.memo(function DashboardAgentRow({ ) : null}
- {/* Why: state dot sits in the leading gutter so the eye can scan one column for row state. */} @@ -288,6 +278,9 @@ const DashboardAgentRow = React.memo(function DashboardAgentRow({ void paneKey: string relativeTimestamp: string | null expanded: boolean @@ -18,6 +22,9 @@ type DashboardAgentRowTrailingControlsProps = { } export function DashboardAgentRowTrailingControls({ + childAgentCount, + childAgentsExpanded = false, + onToggleChildAgents, paneKey, relativeTimestamp, expanded, @@ -64,8 +71,15 @@ export function DashboardAgentRowTrailingControls({ [onSendTargetClick, paneKey, sendTargetStatus] ) + const hasChildDisclosure = Boolean(childAgentCount && onToggleChildAgents) + return ( - + {(sendTargetStatus === 'eligible' || sendTargetStatus === 'sending') && ( )} - {!sendTargetStatus && hideDismiss && relativeTimestamp !== null && ( + {!hasChildDisclosure && !sendTargetStatus && hideDismiss && relativeTimestamp !== null && ( )} - {!sendTargetStatus && !hideDismiss && relativeTimestamp === null && ( + {!sendTargetStatus && !hideDismiss && (hasChildDisclosure || relativeTimestamp === null) && ( )} + {hasChildDisclosure && ( + + {relativeTimestamp} + + } + /> + )} {!hideExpand && ( - ) : null} {/* Why: the row's actionable disabled reason must win on every hit area. */} )} {cacheTimer && } - {shortTime && ( - - {shortTime} - + {hasChildDisclosure ? ( + + ) : ( + timestamp )} ) @@ -293,11 +257,9 @@ export const CompactAgentRow = React.memo(function CompactAgentRow({
Date: Mon, 28 Sep 2026 14:28:09 -0700 Subject: [PATCH 26/90] fix(mobile): start AI-button agents through agent.launch, never a bare shell (#22762) * fix(mobile): start AI-button agents through agent.launch, never a bare shell "Fix checks with AI", "Resolve conflicts with AI", commit-failure recovery and diff review's "New Agent Session" created a terminal with no agent and typed the multi-line prompt into the shell, so each line ran as a shell command. They now call agent.launchReplay into the existing workspace with the prompt; the host picks chat or terminal from the user's default and delivers the prompt. Hosts without the launch capabilities get the buttons disabled with update copy. The agent comes from the desktop's own resolution (moved to src/shared). The replay loop and capability read are shared with the workspace-create launch. * test(mobile): repin bridged-parity tallies for the AI-button launch goldens The corpus goes from 787 to 790 goldens: five shell-path goldens are removed and eight agent.launch ones added; one lands in identical and two in result-absent-settlement. * test(mobile): re-record goldens for AI-button launches through agent.launch Repinned baseline to 514ab7f868 and re-recorded all goldens. Against the branch point: 781 header-only (baseline on all; adapterSha256 on the 48 goldens whose adapter module changed; scenarioSha256 on 3), one body moved (pr-triage-launch: createTerminal + terminal.send becomes agent.launchReplay), eight added (the new launch outcomes and their reply matrices) and five deleted (the shell-path scenarios and their matrices). * fix(mobile): show review notes' agent launch progress and failures, once "New Agent Session" left the sheet open with no progress for the whole launch (up to a minute while a terminal agent readies), so a second tap started a second agent, and a launch that never started or could not be confirmed rejected an unobserved promise, showing nothing. The sheet now closes on tap, the review screen says "Starting an agent...", one launch runs at a time, and every outcome lands in the review screen's status line. Marking notes sent now reads the screen state when the launch settles, so a note written during the wait is not dropped by the whole-list save. * test(mobile): re-record goldens for review notes' launch outcome on the review screen Repins the corpus to 6f3018576d. One golden body moves: review-create-agent-refused now fulfils with "Workspace not found" in the review screen's status line and the sheet closed, where it previously rejected an unobserved promise and left the status line empty. The other 789 goldens move only their baseline header. * test(agent-status): drop the retired PR-triage terminal send from the identity inventory The phone's AI buttons no longer create a terminal and send the prompt into it (`createTerminalAndSendPrompt` is gone); the host's agent launch delivers it. There is no terminal action consumer left in that file to pin. * fix(runtime): publish saved source-control launch recipes to paired clients settings.get is an allowlist and omitted sourceControlAi, so the phone never saw an agent saved globally for "Fix checks", "Resolve conflicts" or commit recovery and always fell back to the default agent. The host now publishes the launch actions' recipes (agent, prompt template, agent args), normalized so legacy saved defaults are already migrated. A new optional reply field: older clients ignore it, and a client talking to an older host sees none and keeps using the default agent. * fix(mobile): ask to update Orca only when the host answered without agent launch An unread or failed status read settles with no capabilities, which the AI buttons read as an old host and showed "Update Orca on your computer". The update copy now needs a status the host actually returned; an unread one keeps the buttons disabled without blaming the desktop's version. * fix(mobile): send an AI button's saved agent arguments with its launch The desktop's direct launches for "Fix checks", "Resolve conflicts" and commit recovery pass the action's saved agent arguments to agent.launch; the phone honoured the saved agent but dropped its arguments. It now sends them the same way: absent when none are saved, so the host keeps the user's configured defaults. A host that predates the field ignores it. * test(mobile): repin the RPC recording corpus after the launch recipe and availability fixes Repins to fe85e0346f. All 790 goldens move only their baseline header: no scenario saves agent arguments or reads an unreadable status, so no recorded behaviour changes. * fix(mobile): say the host status is unreadable instead of nothing when it is With the update copy now reserved for a host that answered without agent launch, an unread status left the AI buttons disabled with no explanation. They now say "Could not read this host's status. Go back and reopen it.", the words the mobile web shell already uses for the same failure; leaving the host re-reads its status. * fix(mobile): wrap an AI button's prompt in the action's saved template The desktop renders every source-control launch's prompt through the action's saved template (buildSourceControlRecoveryAgentCommandInput); the phone sent its built-in prompt as is. Now that the host publishes the recipes, the phone renders through the same shared function, refuses an empty result as the desktop does, and offers the rendered text when it could not be delivered. Review notes have no recipe and are unchanged. * test(mobile): re-record goldens for the templated AI-button prompt Repins to 7fd1555d20. One golden body moves: pr-triage-prompt-not-delivered now carries the prompt as sent (rendered through the action's template) on its prompt-not-sent result, which is what Copy prompt offers. The other 789 goldens move only their baseline header. * fix(mobile): re-read a host status that failed while the connection stayed up A status.get that timed out or was cut over settled the host's gates closed and was never asked again until the connection state changed, so the phone's AI buttons stayed disabled behind "Could not read this host's status" on a link that was working. The gate still settles closed at once, so a failed read never holds the host screen, but it now re-asks in the background with the same backoff the runtime capability probe uses, and opens once a status lands. A reply this app cannot decode is not re-asked. * test(mobile): repin the RPC recording corpus after the host status re-read The status gate change moves no recorded behavior: every golden's body is unchanged and only its baseline header moves to the new pin. * fix(mobile): show a launch's host warning as a note, not an error A launch that went ahead can carry a host warning (a structured chat ignores saved agent arguments, including the '' a template-only save writes). The AI buttons rendered it in the red error line beside a success haptic. The notice now carries it separately as secondary text, and review notes keep saying they were sent. Commit recovery also takes the synchronous in-flight lock the PR triage buttons use, so two taps before a re-render start one agent. * chore(mobile): record the host status re-read timer for React Doctor The status re-read arms one retry timer from inside its read and clears it in the effect's cleanup. React Doctor reports that self-rescheduling shape even in its minimal form, which failed both changed-lines gates. Suppressed the same way as the session startup timers. * fix(mobile): say review notes are waiting for the desktop instead of doing nothing With no live connection, New Agent Session threw from a handler whose promise the sheet drops, so the tap did nothing visible while the button stayed enabled (proven capabilities survive a drop). It now closes the sheet and shows "Waiting for desktop..." as the other AI buttons do. * fix(mobile): stop sending an AI button's saved agent arguments Whether saved arguments apply depends on the route and shell the host settles after the request (a chat ignores them and warns; malformed ones fail after admission), and the desktop sends them only when they apply. The phone cannot know that, so it now leaves them out and the agent's default arguments apply, as before this series. The saved agent and prompt template still apply. * fix(mobile): mark review notes sent through the latest save The sent marks after an agent launch went through the save callback captured at tap time, whose rollback restores the screen from that moment, so a failed save could drop notes written during the launch. It now uses the latest render's save, as it already did for the screen state. * refactor(mobile): own the host status re-read outside the effect The re-read loop lived inside the effect body, so React Doctor could not see its cleanup and needed an inline suppression plus a config allowlist entry. The loop is now a plain function that returns its stop handle, and the effect returns that handle, the same shape every caller of the runtime capability probe uses. Both suppressions are removed; behaviour is unchanged. * test(mobile): record the host descriptor from a background status re-read Pins that the status read records the host descriptor when a re-read succeeds after a failed first read, not only on the first answer. * fix(mobile): show a PR AI launch notice only under the button that launched it Fix checks and Resolve conflicts shared one error, warning and undelivered prompt, so a Fix checks launch whose prompt was not sent also offered "Copy prompt" under Resolve conflicts, copying the fix-checks prompt. Notices are now kept per button. The host availability notice stays under each disabled button, since it explains why that button cannot be tapped. * fix(mobile): say the host status is being retried instead of asking to reopen it The host status gate now re-reads a failed status in the background, so "Go back and reopen it" asked the user for a step that is no longer needed. The review sheet hint uses the same words. The mobile web shell keeps its own copy. * refactor(mobile): run the host status gate on the shared status probe The gate had its own copy of the status probe's retry loop (same delays, same cutover and backoff split, same stop on an undecodable status). The probe now takes an optional callback for each failed attempt, which the gate uses to settle closed on the first failure, and the duplicate loop and its now-unused reader are removed. Existing probe callers are unchanged. * test(mobile): repin the RPC recording corpus after merging main Re-records every golden against the merge commit and drops the three goldens whose scenarios this branch removed, which the merge had restored from main. * test(mobile): re-record the RPC goldens on the merge with main Conflicted goldens were seeded from main and re-recorded against the merged tree; every value either side recorded survives except main's terminal.send in the PR triage launch, which this branch removes. Drops three goldens main still had for scenarios this branch deleted. * feat(mobile): confirm an AI button's agent started, naming the workspace Fix checks, Resolve conflicts and commit recovery now show "Agent started in " under the button once the host started the agent with its prompt, so a tap is no longer silent. The workspace label comes from the Source Control panel and falls back to the branch. * test(mobile): repin the recording baseline to the success-confirmation commit (header-only) * fix(mobile): name the workspace in the diff review's AI-button confirmation The diff review screen mounted the PR sidebar without a workspace label, so "Agent started in ..." under Fix checks and Resolve conflicts named the branch while the screen header named the workspace. The sidebar now requires the label so no screen can drop it, and the diff review passes the one its header shows. * test(mobile): re-record the RPC goldens on the merge with main Repins baseline to the merge commit, the last commit to touch a fenced path. Against this branch before the merge, only header fields move: baseline on every golden, and adapterSha256 on the 14 review-action goldens whose adapter main now drives through the review sheet state. No recorded body changed. * test(mobile): re-record the RPC goldens on the merge with main Repins baseline to the merge commit, the last commit to touch a fenced path. Against this branch before the merge only the baseline header moves, on every golden; no recorded body changed. * test(mobile): give the send-sheet stacking test the review controller's host status inputs The merge with main brought in #22951's stacking test, which builds the review controller without the host capability and status inputs this branch made required, so the mobile test typecheck ratchet failed. * test(mobile): re-record the RPC goldens on the merge with main Repins baseline to the merge commit 03995ae29d, the last commit to touch a fenced path. Against this branch before the merge only headers move: baseline on every golden, and adapterSha256 on the 14 goldens recorded through the terminal adapter main changed in #23080. No recorded body changed, and the merged corpus differs from main exactly as this branch did before. --- .../aivault-history-scan-fulfilled.json | 2 +- .../aivault-history-scan-unsupported.json | 2 +- .../aivault-history-scan-worktrees-late.json | 2 +- .../aivault-history-screen-listed.json | 2 +- .../aivault-history-screen-worktrees.json | 2 +- .../aivault-resume-launch-create-refused.json | 2 +- .../aivault-resume-launch-invalid-tab.json | 2 +- .../goldens/aivault-resume-launch-locked.json | 2 +- .../goldens/aivault-resume-launch-sent.json | 2 +- .../aivault-resume-prepare-refused.json | 2 +- .../goldens/aivault-resume-prepare-repin.json | 2 +- .../aivault-resume-prepare-skipped.json | 2 +- .../aivault-resume-prepare-unavailable.json | 2 +- mobile/rpc-foundation/goldens/b1.json | 2 +- mobile/rpc-foundation/goldens/b2.json | 2 +- mobile/rpc-foundation/goldens/b3.json | 2 +- .../goldens/browser-dialog-accepted.json | 2 +- .../goldens/browser-dialog-dismissed.json | 2 +- .../goldens/browser-keyboard-input.json | 2 +- .../browser-pointer-click-accepted.json | 2 +- .../browser-pointer-click-fallback.json | 2 +- .../goldens/browser-wheel-scrolled.json | 2 +- .../clipboard-image-attachment-anonymous.json | 2 +- ...-image-attachment-blocked-before-send.json | 2 +- .../clipboard-image-attachment-cancelled.json | 2 +- .../clipboard-image-attachment-pasted.json | 2 +- ...board-image-attachment-upload-refused.json | 2 +- ...-image-upload-aborts-on-chunk-failure.json | 2 +- .../clipboard-image-upload-chunked.json | 2 +- ...rd-image-upload-single-frame-fallback.json | 2 +- .../clipboard-image-upload-start-refused.json | 2 +- .../goldens/codex-reset-credit-consumed.json | 2 +- .../goldens/codex-reset-credit-resumed.json | 2 +- .../goldens/components-codex-capability.json | 2 +- .../goldens/components-setup-ask.json | 2 +- .../goldens/components-target-local.json | 2 +- .../goldens/components-target-ssh.json | 2 +- .../goldens/diff-review-branch-compare.json | 2 +- .../goldens/diff-review-branch-file-diff.json | 2 +- ...f-review-notes-refused-before-compare.json | 2 +- .../diff-review-refused-file-diff.json | 2 +- .../goldens/diff-review-snapshot.json | 2 +- .../diff-review-status-unavailable.json | 2 +- .../diff-review-worktree-file-diff.json | 2 +- .../goldens/file-tap-open-refused.json | 2 +- .../goldens/file-tap-opens-worktree-file.json | 2 +- .../file-tap-previews-absolute-artifact.json | 2 +- .../goldens/file-tap-resolve-miss.json | 2 +- .../goldens/file-tap-resolve-refused.json | 2 +- .../files-explorer-legacy-fallback.json | 2 +- .../goldens/files-explorer-readdir.json | 2 +- .../goldens/files-ownership-local.json | 2 +- .../goldens/files-ownership-ssh.json | 2 +- .../files-preview-artifact-direct.json | 2 +- .../files-preview-artifact-image-read.json | 2 +- .../goldens/files-preview-artifact-image.json | 2 +- .../goldens/files-preview-grant-refresh.json | 2 +- .../files-preview-worktree-image-read.json | 2 +- .../goldens/files-preview-worktree-image.json | 2 +- .../files-preview-worktree-text-read.json | 2 +- .../goldens/files-preview-worktree.json | 2 +- .../goldens/files-save-blind.json | 2 +- .../goldens/files-save-verified.json | 2 +- .../goldens/files-tab-doc-shapes.json | 2 +- .../goldens/home-host-accounts.json | 2 +- .../goldens/home-host-stats.json | 2 +- .../goldens/host-view-settings-sync.json | 2 +- ...host-worktree-actions-pin-open-delete.json | 2 +- .../goldens/host-worktree-delete-refused.json | 2 +- .../goldens/host-worktree-refresh-stream.json | 2 +- .../interruptions-inventory-lifecycle.json | 2 +- ...ions-settings-bot-overrides-fulfilled.json | 2 +- .../goldens/inventory-lifecycle.json | 2 +- .../goldens/inventory-repeat-query.json | 2 +- .../rpc-foundation/goldens/lifecycle-b3.json | 2 +- .../lifecycle-inventory-lifecycle.json | 2 +- ...ycle-settings-bot-overrides-fulfilled.json | 2 +- ...cle-settings-task-hydration-fulfilled.json | 2 +- ...-settings-workspace-context-fulfilled.json | 2 +- .../goldens/linear-select-workspace.json | 2 +- .../goldens/live-worktree-name-stream.json | 2 +- ...ructured-create-agentsession.create-1.json | 2 +- ...d-create-agentsession.createsupport-1.json | 2 +- ...d-launch-agentsession.createsupport-1.json | 2 +- ...ivault.history-aivault.listsessions-1.json | 2 +- ...ivault.history-screen-platform-status.json | 2 +- ...x-aivault.history-screen-status.get-2.json | 2 +- ...-aivault.history-screen-worktree.ps-1.json | 2 +- .../matrix-aivault.history-status.get-1.json | 2 +- ...-launch-session.tabs.createterminal-1.json | 2 +- ...aivault.resume-launch-terminal.send-1.json | 2 +- ...ration-aivault.preparesessionresume-1.json | 2 +- ...browser.dialog-browser.dialogaccept-1.json | 2 +- ...keyboard-browser.keyboardinserttext-1.json | 2 +- ...x-browser.keyboard-browser.keypress-1.json | 2 +- ...er.pointer-click-browser.mouseclick-1.json | 2 +- ...ser.pointer-click-browser.mousedown-1.json | 2 +- ...ser.pointer-click-browser.mousemove-1.json | 2 +- ...owser.pointer-click-browser.mouseup-1.json | 2 +- ...rix-browser.wheel-browser.mousemove-1.json | 2 +- ...ix-browser.wheel-browser.mousewheel-1.json | 2 +- ...tachment-clipboard.startimageupload-1.json | 2 +- ...pload-clipboard.saveimageastempfile-1.json | 2 +- ...e-upload-clipboard.startimageupload-1.json | 2 +- ...s.codex-reset-capability-status.get-1.json | 2 +- ...it-accounts.consumecodexresetcredit-1.json | 2 +- ...target-local-preflight.detectagents-1.json | 2 +- ...target-preflight.detectremoteagents-1.json | 2 +- ...onents.execution-target-ssh.connect-1.json | 2 +- ...nents.execution-target-ssh.getstate-1.json | 2 +- ...ew-workspace-repositories-repo.list-1.json | 2 +- ...-components.setup-script-repo.hooks-1.json | 2 +- ...ix-files.explorer-screen-files.list-1.json | 2 +- ...files.explorer-screen-files.readdir-1.json | 2 +- ...les.mutation-ownership-ssh.getstate-1.json | 2 +- ...files.mutation-ownership-status.get-1.json | 2 +- ...es.mutation-ownership-worktree.show-1.json | 2 +- ...e-files.readterminalartifactpreview-1.json | 2 +- ...iew-load-files.readterminalartifact-1.json | 2 +- ...iew-load-files.readterminalartifact-2.json | 2 +- ...view-load-files.resolveterminalpath-1.json | 2 +- ...iew-save-files.readterminalartifact-1.json | 2 +- ...ew-save-files.writeterminalartifact-1.json | 2 +- ...ew-worktree-image-files.readpreview-1.json | 2 +- ...es.preview-worktree-text-files.read-1.json | 2 +- .../matrix-files.tab-doc-files.read-1.json | 2 +- ...rix-files.tab-doc-files.readpreview-1.json | 2 +- .../matrix-files.tab-doc-git.diff-1.json | 2 +- ...-files.terminal-path-tap-files.open-1.json | 2 +- ...-path-tap-files.resolveterminalpath-1.json | 2 +- ....base-ref-chain-repo.baserefdefault-1.json | 2 +- ...matrix-git.base-ref-chain-repo.list-1.json | 2 +- ...ix-git.base-ref-chain-worktree.show-1.json | 2 +- ....branch-diff-preview-git.branchdiff-1.json | 2 +- ...-git.changes-load-git.branchcompare-1.json | 2 +- .../matrix-git.changes-load-git.status-1.json | 2 +- .../matrix-git.changes-load-repo.list-1.json | 2 +- ...trix-git.changes-load-worktree.show-1.json | 2 +- ...essage-ai-git.generatecommitmessage-1.json | 2 +- ...tory-commit-files-git.commitcompare-1.json | 2 +- ...it.history-commit-files-git.history-1.json | 2 +- ...matrix-git.history-read-git.history-1.json | 2 +- ...ix-git.remote-prerequisite-git.push-1.json | 2 +- ...x-git.review-preparation-git.status-1.json | 2 +- ...ent-mutation-github.addissuecomment-1.json | 4 +- ...tion-github.addprreviewcommentreply-1.json | 4 +- ...ub.project.deleteissuecommentbyslug-1.json | 4 +- ...ub.project.updateissuecommentbyslug-1.json | 4 +- ...mutation-github.resolvereviewthread-1.json | 4 +- ...x-github.pr-mutation-github.mergepr-1.json | 4 +- ...r-mutation-github.removeprreviewers-1.json | 4 +- ...-mutation-github.requestprreviewers-1.json | 4 +- ...ub.pr-mutation-github.rerunprchecks-1.json | 4 +- ...b.pr-mutation-github.setprautomerge-1.json | 4 +- ...ub.pr-mutation-github.updateprstate-1.json | 4 +- ....pr-read-github.listassignableusers-1.json | 4 +- ...ithub.pr-read-github.prcheckdetails-1.json | 4 +- ...trix-github.pr-read-github.prchecks-1.json | 4 +- ...x-github.pr-read-github.prforbranch-1.json | 4 +- ...trix-github.pr-read-github.reposlug-1.json | 4 +- ...thub.pr-read-github.workitemdetails-1.json | 4 +- ...thub.pr-read-hostedreview.forbranch-1.json | 4 +- ...title-mutation-github.updateprtitle-1.json | 4 +- ...ix-home.host-accounts-accounts.list-1.json | 2 +- ...atrix-home.host-stats-stats.summary-1.json | 2 +- ...sh-runtime.clientevents.subscribe-1-1.json | 2 +- ...sh-runtime.clientevents.subscribe-1-2.json | 2 +- ...sh-runtime.clientevents.subscribe-1-3.json | 2 +- ...sh-runtime.clientevents.subscribe-2-1.json | 2 +- .../matrix-host.view-settings-ui.get-1.json | 2 +- .../matrix-host.view-settings-ui.set-1.json | 2 +- ....worktree-actions-worktree.activate-1.json | 2 +- ...x-host.worktree-actions-worktree.rm-1.json | 2 +- ...-host.worktree-actions-worktree.set-1.json | 2 +- ...-hostedreview.create-chain-git.push-1.json | 2 +- ...ew.create-chain-hostedreview.create-1.json | 2 +- ...tedreview.create-chain-worktree.set-1.json | 2 +- ...dreview.create-intent-git.bulkstage-1.json | 2 +- ...stedreview.create-intent-git.commit-1.json | 2 +- ...te-intent-git.generatecommitmessage-1.json | 2 +- ...hostedreview.create-intent-git.push-1.json | 2 +- ...stedreview.create-intent-git.status-1.json | 2 +- ...stedreview.create-intent-git.status-2.json | 2 +- ...stedreview.create-intent-git.status-3.json | 2 +- ...stedreview.create-intent-git.status-4.json | 2 +- ...w.create-intent-hostedreview.create-1.json | 2 +- ...hostedreview.getcreationeligibility-1.json | 2 +- ...hostedreview.getcreationeligibility-2.json | 2 +- ...edreview.create-intent-worktree.set-1.json | 2 +- ...hostedreview.getcreationeligibility-1.json | 2 +- ...-legacy-inventory-files.searchpaths-1.json | 2 +- ...-legacy-inventory-files.searchpaths-2.json | 2 +- ...trix-legacy-inventory-fresh-inventory.json | 2 +- ...matrix-legacy-inventory-old-inventory.json | 2 +- ...near-detail-barrier-linear.getissue-1.json | 2 +- ...detail-barrier-linear.issuecomments-1.json | 2 +- ...space-picker-linear.selectworkspace-1.json | 2 +- ...me-runtime.clientevents.subscribe-1-1.json | 2 +- ...me-runtime.clientevents.subscribe-1-2.json | 2 +- ...me-runtime.clientevents.subscribe-2-1.json | 2 +- ...ix-live-worktree-name-worktree.show-1.json | 2 +- ...ix-live-worktree-name-worktree.show-2.json | 2 +- ...ix-live-worktree-name-worktree.show-3.json | 2 +- .../matrix-mobileweb.bundle-fetch-app-js.json | 2 +- ...rix-mobileweb.bundle-fetch-index-head.json | 2 +- ...rix-mobileweb.bundle-fetch-index-tail.json | 2 +- ...dle-fetch-mobileweb.bundle.manifest-1.json | 2 +- ...-manifest-mobileweb.bundle.manifest-1.json | 2 +- ...ativechat.image-paste-terminal.send-1.json | 2 +- ...ativechat.image-paste-terminal.send-2.json | 2 +- ...e-upload-clipboard.startimageupload-1.json | 2 +- ...ings.mutatenativechatsessionoptions-1.json | 2 +- ...chestration.workerterminaluserinput-1.json | 2 +- ...vechat.terminal-write-terminal.send-1.json | 2 +- ...stream-notifications.getmissedsince-1.json | 2 +- ...op-stream-notifications.subscribe-1-1.json | 2 +- ...op-stream-notifications.subscribe-1-2.json | 2 +- ...op-stream-notifications.unsubscribe-1.json | 2 +- ...-test-screen-notifications.testpush-1.json | 2 +- ...missal-notifications.getmissedsince-1.json | 2 +- ...stration-notifications.registerpush-1.json | 2 +- ...ration-notifications.unregisterpush-1.json | 2 +- ...rix-pairing.pre-profile-direct-status.json | 2 +- ...ng.pre-profile-pairing.getendpoints-1.json | 2 +- ....pre-profile-pairing.provisionrelay-1.json | 2 +- ...trix-pairing.pre-profile-relay-status.json | 2 +- ...se-github.project.updateissuebyslug-1.json | 2 +- ...ntial-rotation-pairing.getendpoints-1.json | 2 +- ...ntial-rotation-pairing.getendpoints-2.json | 2 +- ...ial-rotation-pairing.provisionrelay-1.json | 2 +- ...direct-upgrade-pairing.getendpoints-1.json | 2 +- ...direct-upgrade-pairing.getendpoints-2.json | 2 +- ...rect-upgrade-pairing.provisionrelay-1.json | 2 +- ...iring-recovery-pairing.getendpoints-1.json | 2 +- ...rowser-tab-create-browser.tabcreate-1.json | 2 +- ...ion.content-create-files.createfile-1.json | 2 +- ...x-session.content-create-files.open-1.json | 2 +- ...x-session.content-create-status.get-1.json | 2 +- ...ession.content-create-worktree.show-1.json | 2 +- ...erminal-session.tabs.createterminal-1.json | 2 +- ...ssion.create-terminal-terminal.send-1.json | 2 +- ...ix-session.diff-notes-worktree.show-1.json | 2 +- ...on.diff-review-actions-worktree.set-1.json | 4 +- ...rix-session.diff-review-base-ref-show.json | 2 +- ...ssion.diff-review-git.branchcompare-1.json | 2 +- ...trix-session.diff-review-git.status-1.json | 2 +- ...atrix-session.diff-review-repo.list-1.json | 2 +- ...atrix-session.diff-review-review-show.json | 2 +- ...n.markdown-disk-fallback-files.read-1.json | 2 +- ...down-disk-fallback-markdown.readtab-1.json | 2 +- ...sion.markdown-save-markdown.savetab-1.json | 2 +- ...ve-chat-page-nativechat.readsession-1.json | 2 +- ...ve-chat-page-nativechat.subscribe-1-1.json | 2 +- ...ve-chat-page-nativechat.subscribe-2-1.json | 2 +- ...n.native-chat-readability-repo.list-1.json | 2 +- ...chestration.workerterminaluserinput-1.json | 2 +- ...sion.native-chat-stop-terminal.send-1.json | 2 +- ...sion.native-chat-stop-terminal.send-2.json | 2 +- ...pr-branch-context-git.branchcompare-1.json | 4 +- ...ession.pr-branch-context-git.status-1.json | 4 +- ...session.pr-branch-context-repo.list-1.json | 4 +- ...ion.pr-branch-context-worktree.show-1.json | 4 +- ...-session.pr-sidebar-github.prchecks-1.json | 2 +- ...ssion.pr-sidebar-github.prforbranch-1.json | 2 +- ...n.pr-sidebar-hostedreview.forbranch-1.json | 2 +- ...ix-session.pr-sidebar-worktree.show-1.json | 2 +- ...ession.pr-triage-agent.launchreplay-1.json | 952 ++++++++++++++++++ ...on.pr-triage-preflight.detectagents-1.json | 793 +++++++++++++++ ...matrix-session.pr-triage-repo.list-1.json} | 606 ++++++----- ...rix-session.pr-triage-settings.get-1.json} | 596 ++++++----- ...n.review-branch-diff-git.branchdiff-1.json | 2 +- ...x-session.review-file-diff-git.diff-1.json | 2 +- ...x-session.review-file-diff-git.diff-2.json | 2 +- ...x-session.review-file-diff-git.diff-3.json | 2 +- ...on.review-git-mutations-git.discard-1.json | 4 +- ...sion.review-git-mutations-git.stage-1.json | 4 +- ...sion.review-git-mutations-git.stage-2.json | 4 +- ...review-send-sheet-session.tabs.list-1.json | 4 +- ...x-session.startup-worktree.activate-1.json | 2 +- ...x-session.startup-worktree.activate-2.json | 2 +- ...ab-activation-session.tabs.activate-1.json | 2 +- ...ssion.tab-activation-terminal.focus-1.json | 2 +- ...ab-close-session-session.tabs.close-1.json | 2 +- ...ix-session.tab-close-terminal.close-1.json | 2 +- ...sion.tab-documents-markdown.readtab-1.json | 2 +- ...-session.tab-rename-terminal.rename-1.json | 2 +- ...on.tab-reveal-session.tabs.activate-1.json | 2 +- ...ession.tab-reveal-session.tabs.list-1.json | 2 +- ...abs-stream-health-session.tabs.list-1.json | 2 +- ...isplay-mode-terminal.setdisplaymode-1.json | 2 +- ...chestration.workerterminaluserinput-1.json | 2 +- ...-gesture-input-terminal.clearbuffer-1.json | 2 +- ...erminal-gesture-input-terminal.send-1.json | 2 +- ...chestration.workerterminaluserinput-1.json | 2 +- ...n.terminal-input-send-terminal.send-1.json | 2 +- ...on.terminal-inventory-terminal.list-1.json | 2 +- ...chestration.workerterminaluserinput-1.json | 2 +- ...session.terminal-paste-settings.get-1.json | 2 +- ...ession.terminal-paste-terminal.send-1.json | 2 +- ...ssion.worktree-connection-repo.list-1.json | 2 +- ...on.worktree-connection-settings.get-1.json | 2 +- ...t-read-preflight.detectremoteagents-1.json | 2 +- ...atrix-settings-agent-read-repo.list-1.json | 2 +- ...ix-settings-agent-read-settings.get-1.json | 2 +- ...ettings-best-effort-settings.update-1.json | 2 +- ...settings.bot-overrides-settings.get-1.json | 2 +- ...ttings.home-providers-linear.status-1.json | 2 +- ...ings.home-providers-preflight.check-1.json | 2 +- ...ettings.home-providers-settings.get-1.json | 2 +- ...local-agents-preflight.detectagents-1.json | 2 +- ...ings.new-tab-local-agents-repo.list-1.json | 2 +- ...s.new-tab-local-agents-settings.get-1.json | 2 +- ...s-settings.getterminalquickcommands-1.json | 2 +- ...ettings.updateterminalquickcommands-1.json | 2 +- ...ettings.repo-metadata-host.platform-1.json | 2 +- ...ix-settings.repo-metadata-repo.list-1.json | 2 +- ...settings.repo-metadata-settings.get-1.json | 2 +- ...po-metadata-ssh.listtargetsummaries-1.json | 2 +- ...esume-metadata-folderworkspace.list-1.json | 2 +- ...s.resume-metadata-projectgroup.list-1.json | 2 +- ...-settings.resume-metadata-repo.list-1.json | 2 +- ...ttings.resume-metadata-settings.get-1.json | 2 +- ...ettings.resume-metadata-worktree.ps-1.json | 2 +- ...ttings.task-hydration-linear.status-1.json | 2 +- ...ings.task-hydration-preflight.check-1.json | 2 +- ...ettings.task-hydration-settings.get-1.json | 2 +- ...-settings.task-hydration-status.get-1.json | 2 +- ...trix-settings.task-hydration-ui.get-1.json | 2 +- ....task-workspace-create-settings.get-1.json | 2 +- ...sk-workspace-create-worktree.create-1.json | 2 +- ...ettings.task-workspace-settings.get-1.json | 2 +- ...ngs.workspace-context-linear.status-1.json | 2 +- ...s.workspace-context-preflight.check-1.json | 2 +- ...ings.workspace-context-settings.get-1.json | 2 +- ...x-settings.workspace-context-ui.get-1.json | 2 +- ...tings.workspace-submit-settings.get-1.json | 2 +- ...tation-chunk-speech.dictation.chunk-1.json | 2 +- ...ion-session-speech.dictation.finish-1.json | 2 +- ...tion-session-speech.dictation.start-1.json | 2 +- ...ation-start-speech.dictation.cancel-1.json | 2 +- ...tation-start-speech.dictation.start-1.json | 2 +- ....setup-sheet-speech.dictation.setup-1.json | 2 +- ...ch.setup-sheet-speech.models.delete-1.json | 2 +- ....setup-sheet-speech.models.download-1.json | 2 +- ...eech.setup-sheet-speech.models.list-1.json | 2 +- ...cks-files-github.addprreviewcomment-1.json | 2 +- ...-checks-files-github.prfilecontents-1.json | 2 +- ...m-checks-files-github.rerunprchecks-1.json | 2 +- ...ks-files-github.resolvereviewthread-1.json | 2 +- ...checks-files-github.setprfileviewed-1.json | 2 +- ...mment-github-github.addissuecomment-1.json | 2 +- ...mment-gitlab-gitlab.addissuecomment-1.json | 2 +- ...mment-gitlab-mr-gitlab.addmrcomment-1.json | 2 +- ...etail-github-github.workitemdetails-1.json | 2 +- ...etail-gitlab-gitlab.workitemdetails-1.json | 2 +- ....item-detail-linear-linear.getissue-1.json | 2 +- ...-detail-linear-linear.issuecomments-1.json | 2 +- ...metadata-github.listassignableusers-1.json | 2 +- ...m-detail-metadata-github.listlabels-1.json | 2 +- ...ks.item-merge-gitlab-gitlab.mergemr-1.json | 2 +- ...tem-metadata-github-github.updatepr-1.json | 2 +- ...-metadata-gitlab-gitlab.updateissue-1.json | 2 +- ...-metadata-gitlab-mr-gitlab.updatemr-1.json | 2 +- ...-reply-merge-github.addissuecomment-1.json | 2 +- ...erge-github.addprreviewcommentreply-1.json | 2 +- ...sks.item-reply-merge-github.mergepr-1.json | 2 +- ...item-reply-merge-linear.updateissue-1.json | 2 +- ....item-review-github-github.prchecks-1.json | 2 +- ...ew-github-github.requestprreviewers-1.json | 2 +- ...em-status-gitlab-github.updateissue-1.json | 2 +- ...em-status-gitlab-gitlab.updateissue-1.json | 2 +- ...atus-gitlab-mr-gitlab.updatemrstate-1.json | 2 +- ...tasks.linear-connect-linear.connect-1.json | 2 +- ....linear-item-linear.addissuecomment-1.json | 2 +- ...asks.linear-item-linear.createissue-1.json | 2 +- ...x-tasks.linear-item-linear.getissue-1.json | 2 +- ...inear-team-context-linear.listteams-1.json | 2 +- ...near-team-context-linear.teamstates-1.json | 2 +- ...-tasks.paste-lookup-github.reposlug-1.json | 2 +- ...-tasks.paste-lookup-github.workitem-1.json | 2 +- ...e-lookup-github.workitembyownerrepo-1.json | 2 +- ....paste-lookup-gitlab.workitembypath-1.json | 2 +- ...-load-github.project.listaccessible-1.json | 2 +- ...board-load-github.project.listviews-1.json | 2 +- ...board-load-github.project.listviews-2.json | 2 +- ...oard-load-github.project.resolveref-1.json | 2 +- ...board-load-github.project.viewtable-1.json | 2 +- ....project-repo-slugs-github.reposlug-1.json | 2 +- ...ithub.project.addissuecommentbyslug-1.json | 2 +- ...ue-github.project.updateissuebyslug-1.json | 2 +- ...ub.project.updateissuecommentbyslug-1.json | 2 +- ...hub.project.updatepullrequestbyslug-1.json | 2 +- ...ithub.project.workitemdetailsbyslug-1.json | 2 +- ...ields-github.project.clearitemfield-1.json | 2 +- ...ithub.project.updateissuetypebyslug-1.json | 2 +- ...elds-github.project.updateitemfield-1.json | 2 +- ...les-merge-github.addprreviewcomment-1.json | 2 +- ...ject-row-files-merge-github.mergepr-1.json | 2 +- ...w-files-merge-github.prfilecontents-1.json | 2 +- ...-row-files-merge-github.updateissue-1.json | 2 +- ...ow-files-merge-github.updateprstate-1.json | 2 +- ...b.project.listassignableusersbyslug-1.json | 2 +- ...github.project.listissuetypesbyslug-1.json | 2 +- ...oad-github.project.listlabelsbyslug-1.json | 2 +- ...t-row-review-checks-github.prchecks-1.json | 2 +- ...ew-checks-github.requestprreviewers-1.json | 2 +- ...-review-checks-github.rerunprchecks-1.json | 2 +- ...eview-checks-github.setprfileviewed-1.json | 2 +- ...-row-threads-github.addissuecomment-1.json | 2 +- ...eads-github.addprreviewcommentreply-1.json | 2 +- ...ub.project.deleteissuecommentbyslug-1.json | 2 +- ...-threads-github.resolvereviewthread-1.json | 2 +- ...provider-load-github.countworkitems-1.json | 2 +- ....provider-load-github.listworkitems-1.json | 2 +- ...asks.provider-load-linear.listteams-1.json | 2 +- ...x-tasks.provider-load-linear.status-1.json | 2 +- ...tasks.provider-load-settings.update-1.json | 2 +- ...rix-tasks.route-repo-list-repo.list-1.json | 2 +- ...-source-search-github.listworkitems-1.json | 2 +- ...-source-search-gitlab.listworkitems-1.json | 2 +- ...art-source-search-linear.listissues-1.json | 2 +- ...t-source-search-linear.searchissues-1.json | 2 +- ...smart-source-search-repo.searchrefs-1.json | 2 +- ...sk-create-github-github.createissue-1.json | 2 +- ...asks.task-create-github-repo.update-1.json | 2 +- ...sk-create-gitlab-gitlab.createissue-1.json | 2 +- ...sk-create-linear-linear.createissue-1.json | 2 +- ...t-gitlab-items-gitlab.listworkitems-1.json | 2 +- ...task-list-gitlab-todos-gitlab.todos-1.json | 2 +- ....task-list-linear-linear.listissues-1.json | 2 +- ...ask-list-linear-linear.searchissues-1.json | 2 +- ...ks.workspace-source-repo.searchrefs-1.json | 2 +- ...workspace-source-repo.sparsepresets-1.json | 2 +- ...kspace-sparse-repo.savesparsepreset-1.json | 2 +- ...tasks.workspace-sparse-ssh.getstate-1.json | 2 +- ...ce-ssh-local-preflight.detectagents-1.json | 2 +- ...ce-ssh-preflight.detectremoteagents-1.json | 2 +- ...trix-tasks.workspace-ssh-repo.hooks-1.json | 2 +- ...rix-tasks.workspace-ssh-ssh.connect-1.json | 2 +- ...-terminal.query-reply-terminal.send-1.json | 2 +- ...chestration.workerterminaluserinput-1.json | 2 +- ...ix-terminal.raw-input-terminal.send-1.json | 2 +- ...chestration.workerterminaluserinput-1.json | 2 +- ...chestration.workerterminaluserinput-2.json | 2 +- ...wport-refit-terminal.updateviewport-1.json | 2 +- ...ansport.capability-probe-status.get-1.json | 2 +- ...nsport.host-status-gates-status.get-1.json | 2 +- ...-transport.pairing-race-direct-status.json | 2 +- ...x-transport.pairing-race-relay-status.json | 2 +- ...ee.agent-launch-create-agent.launch-1.json | 4 +- ...rktree.catalog-snapshot-worktree.ps-1.json | 2 +- ...rktree.create-retry-worktree.create-1.json | 2 +- ...x-worktree.home-catalog-worktree.ps-1.json | 2 +- ....hosted-base-worktree.resolvemrbase-1.json | 2 +- ....hosted-base-worktree.resolveprbase-1.json | 2 +- ...red-names-worktree.listretirednames-1.json | 2 +- ...x-worktree.review-link-worktree.set-1.json | 2 +- ...ree.runtime-capabilities-status.get-1.json | 2 +- ...ix-worktree.setup-hook-trust-ui.set-1.json | 2 +- .../mobile-web-bundle-build-changed.json | 2 +- .../mobile-web-bundle-fetch-paged.json | 2 +- .../mobile-web-bundle-manifest-read.json | 2 +- .../mobile-web-bundle-unavailable.json | 2 +- .../native-chat-image-paste-single.json | 2 +- ...e-chat-image-paste-stops-on-rejection.json | 2 +- ...ative-chat-image-paste-trailing-image.json | 2 +- .../native-chat-image-paste-two-images.json | 2 +- .../native-chat-image-upload-cancelled.json | 2 +- ...native-chat-image-upload-second-fails.json | 2 +- .../native-chat-image-upload-single.json | 2 +- ...ative-chat-image-upload-start-refused.json | 2 +- .../goldens/native-chat-image-upload-two.json | 2 +- .../goldens/native-chat-page-earlier.json | 2 +- .../native-chat-readability-local-repo.json | 2 +- .../native-chat-readability-refused.json | 2 +- .../native-chat-readability-remote-repo.json | 2 +- ...native-chat-session-option-pick-empty.json | 2 +- ...tive-chat-session-option-pick-refused.json | 2 +- ...tive-chat-session-option-pick-written.json | 2 +- .../goldens/native-chat-stop-accepted.json | 2 +- .../native-chat-stop-both-rejected.json | 2 +- .../native-chat-stop-delivery-unknown.json | 2 +- .../goldens/native-chat-write-accepted.json | 2 +- .../goldens/native-chat-write-clear-line.json | 2 +- .../native-chat-write-delivery-unknown.json | 2 +- .../goldens/native-chat-write-rejected.json | 2 +- .../native-chat-write-typed-command.json | 2 +- .../goldens/new-tab-local-agents.json | 2 +- .../new-workspace-repositories-fulfilled.json | 2 +- .../notifications-desktop-stream-closed.json | 2 +- ...notifications-desktop-stream-replayed.json | 2 +- .../goldens/notifications-desktop-stream.json | 2 +- .../notifications-display-test-accepted.json | 2 +- ...fications-display-test-not-registered.json | 2 +- ...tifications-display-test-rate-limited.json | 2 +- ...fications-display-test-unknown-reason.json | 2 +- .../notifications-push-gateway-rejected.json | 2 +- .../notifications-push-registered.json | 2 +- ...re-profile-direct-wins-and-provisions.json | 2 +- ...ovision-unsupported-saves-direct-host.json | 2 +- .../pairing-pre-profile-times-out.json | 2 +- .../goldens/pr-branch-identity.json | 4 +- .../goldens/pr-branch-repo-context.json | 4 +- .../goldens/pr-comment-mutation.json | 4 +- .../pr-comment-resolve-unconfirmed.json | 4 +- .../goldens/pr-mutation-in-band-failure.json | 4 +- .../goldens/pr-mutation-status.json | 4 +- .../goldens/pr-read-fork-routing.json | 4 +- .../goldens/pr-read-surface.json | 4 +- .../goldens/pr-read-upstream-error.json | 4 +- .../goldens/pr-sidebar-checks-refused.json | 2 +- .../goldens/pr-sidebar-load.json | 2 +- .../goldens/pr-title-mutation.json | 4 +- .../goldens/pr-title-unconfirmed.json | 4 +- .../goldens/pr-triage-invalid-terminal.json | 91 -- .../goldens/pr-triage-launch-unconfirmed.json | 220 ++++ .../goldens/pr-triage-launch.json | 246 +++-- .../pr-triage-prompt-not-delivered.json | 233 +++++ .../goldens/pr-triage-send-locked.json | 137 --- .../goldens/pr-triage-update-required.json | 48 + .../goldens/probe-new-tab-both-refused.json | 2 +- .../probe-new-tab-null-sibling-refused.json | 2 +- ...probe-new-tab-refused-sibling-rejects.json | 2 +- ...probe-new-tab-rejects-sibling-refused.json | 2 +- .../push-dismissal-tray-reconciled.json | 2 +- .../goldens/quick-commands-load-refused.json | 2 +- .../quick-commands-loaded-and-saved.json | 2 +- ...uick-commands-save-refused-rolls-back.json | 2 +- .../goldens/relay-direct-upgrade-commits.json | 2 +- ...ect-upgrade-unsupported-host-declines.json | 2 +- ...ay-pairing-recovery-invite-authorizes.json | 2 +- ...lay-pairing-recovery-resume-committed.json | 2 +- .../relay-rotation-installs-and-commits.json | 2 +- ...ay-rotation-resumes-committed-pending.json | 2 +- .../goldens/review-branch-diff-shapes.json | 2 +- .../goldens/review-create-agent-refused.json | 249 +++++ .../review-create-terminal-refused.json | 122 --- .../goldens/review-file-diff-shapes.json | 2 +- .../goldens/review-git-mutations-run.json | 4 +- .../review-mark-reviewed-persists.json | 4 +- .../review-mark-reviewed-rolls-back.json | 4 +- .../goldens/review-open-in-session.json | 4 +- .../review-send-notes-heals-stale-input.json | 4 +- .../review-send-sheet-lists-terminals.json | 4 +- .../goldens/review-stage-file.json | 4 +- .../goldens/review-stage-refused.json | 4 +- .../goldens/sc-base-ref-default.json | 2 +- .../goldens/sc-base-ref-repo-fallback.json | 2 +- .../goldens/sc-base-ref-unavailable.json | 2 +- .../goldens/sc-base-ref-worktree-hit.json | 2 +- .../goldens/sc-branch-diff-previewed.json | 2 +- .../goldens/sc-changes-loaded.json | 2 +- .../sc-commit-message-cancel-rejected.json | 2 +- .../goldens/sc-commit-message-canceled.json | 2 +- .../goldens/sc-commit-message-generated.json | 2 +- .../goldens/sc-create-existing-review.json | 2 +- ...reate-intent-stage-commit-push-create.json | 2 +- .../sc-create-intent-unlisted-provider.json | 2 +- .../sc-create-link-failure-is-non-fatal.json | 2 +- .../sc-create-pushes-then-creates.json | 2 +- .../sc-create-refused-empty-message.json | 2 +- .../sc-create-rejected-empty-message.json | 2 +- .../goldens/sc-eligibility-fetched.json | 2 +- .../goldens/sc-history-commit-files.json | 2 +- .../goldens/sc-history-loaded.json | 2 +- .../goldens/sc-pr-link-hosted-review.json | 2 +- .../goldens/sc-pr-link-read.json | 2 +- .../goldens/sc-pr-link-set.json | 2 +- .../sc-prefill-unavailable-on-refusal.json | 2 +- .../sc-prefill-unavailable-on-rejection.json | 2 +- .../sc-prerequisite-force-with-lease.json | 2 +- .../goldens/sc-prerequisite-publish.json | 2 +- .../goldens/sc-prerequisite-push.json | 2 +- .../goldens/sc-prerequisite-skipped.json | 2 +- .../goldens/sc-reveal-first-poll.json | 2 +- .../goldens/sc-reveal-timeout.json | 2 +- .../sc-review-commit-inner-failure.json | 2 +- ...c-review-commit-refused-empty-message.json | 2 +- .../goldens/sc-review-commit-rejected.json | 2 +- .../goldens/sc-review-commit.json | 2 +- .../sc-review-status-entries-not-array.json | 2 +- .../goldens/sc-review-status-normalized.json | 2 +- .../rpc-foundation/goldens/schedules-b3.json | 2 +- ...les-settings-home-providers-fulfilled.json | 2 +- .../schedules-settings-new-tab-ssh.json | 2 +- ...ules-settings-repo-metadata-fulfilled.json | 2 +- ...es-settings-resume-metadata-fulfilled.json | 2 +- ...les-settings-task-hydration-fulfilled.json | 2 +- ...-settings-workspace-context-fulfilled.json | 2 +- .../goldens/session-browser-tab-created.json | 2 +- .../session-create-browser-refused.json | 2 +- .../goldens/session-create-browser-tab.json | 2 +- ...ession-create-markdown-name-collision.json | 2 +- .../goldens/session-create-markdown-note.json | 2 +- ...nal-ignores-a-second-create-in-flight.json | 2 +- ...minal-launches-an-agent-quick-command.json | 2 +- .../session-create-terminal-refused.json | 2 +- ...ssion-create-terminal-replaces-active.json | 2 +- ...-create-terminal-runs-a-quick-command.json | 2 +- .../session-create-terminal-with-prompt.json | 2 +- ...on-create-terminal-without-active-tab.json | 2 +- ...ession-create-terminal-without-handle.json | 2 +- .../session-diff-notes-load-refused.json | 2 +- .../goldens/session-diff-notes-loaded.json | 2 +- .../goldens/session-file-tab-read.json | 2 +- .../goldens/session-markdown-disk-read.json | 2 +- .../goldens/session-markdown-disk-served.json | 2 +- .../session-markdown-save-conflict.json | 2 +- .../goldens/session-markdown-saved.json | 2 +- .../session-markdown-tab-disk-fallback.json | 2 +- .../goldens/session-markdown-tab-read.json | 2 +- .../goldens/session-markdown-tab-refused.json | 2 +- ...session-startup-both-activation-sites.json | 2 +- ...artup-floating-route-skips-activation.json | 2 +- ...-keeps-terminals-visible-on-reconnect.json | 2 +- ...efused-tab-load-still-loads-terminals.json | 2 +- ...ion-tab-activation-focus-and-activate.json | 2 +- .../session-tab-activation-refused.json | 2 +- ...ession-tab-activation-transport-error.json | 2 +- .../session-tab-close-refused-keeps-tab.json | 2 +- .../session-tab-close-session-tab.json | 2 +- .../goldens/session-tab-close-terminal.json | 2 +- .../goldens/session-tab-closed.json | 2 +- .../goldens/session-tab-rename.json | 2 +- .../goldens/session-tab-renamed.json | 2 +- .../goldens/session-tabs-health-errored.json | 2 +- .../session-tabs-health-reconciled.json | 2 +- .../goldens/session-tabs-health-refused.json | 2 +- ...abs-health-stale-application-revision.json | 2 +- ...terminal-display-mode-auto-take-floor.json | 2 +- ...isplay-mode-auto-without-device-token.json | 2 +- ...al-display-mode-auto-without-viewport.json | 2 +- ...inal-display-mode-drops-second-toggle.json | 2 +- ...sion-terminal-display-mode-to-desktop.json | 2 +- ...session-terminal-list-dedupes-handles.json | 2 +- .../session-terminal-list-empty-guarded.json | 2 +- .../goldens/session-terminal-list-merged.json | 2 +- .../session-terminal-list-refused.json | 2 +- .../settings-bot-overrides-fulfilled.json | 2 +- ...ettings-bot-overrides-refresh-refused.json | 2 +- .../settings-bot-overrides-refused.json | 2 +- ...ettings-bot-overrides-transport-error.json | 2 +- .../goldens/settings-home-coalesced.json | 2 +- .../settings-home-providers-fulfilled.json | 2 +- ...ings-home-providers-refuse-after-data.json | 2 +- .../settings-home-providers-refused.json | 2 +- ...ttings-home-providers-transport-error.json | 2 +- .../goldens/settings-new-tab-refused.json | 2 +- .../goldens/settings-new-tab-ssh.json | 2 +- .../settings-new-tab-transport-error.json | 2 +- .../goldens/settings-repo-cache-expiry.json | 2 +- .../settings-repo-metadata-fulfilled.json | 2 +- .../goldens/settings-repo-metadata-icons.json | 2 +- ...tings-repo-metadata-refuse-after-data.json | 2 +- .../settings-repo-metadata-refused.json | 2 +- .../settings-repo-metadata-single-host.json | 2 +- ...ettings-repo-metadata-transport-error.json | 2 +- .../settings-resume-metadata-fulfilled.json | 2 +- ...ngs-resume-metadata-refuse-after-data.json | 2 +- .../settings-resume-metadata-refused.json | 2 +- ...tings-resume-metadata-transport-error.json | 2 +- .../settings-task-hydration-fulfilled.json | 2 +- ...ings-task-hydration-refuse-after-data.json | 2 +- .../settings-task-hydration-refused.json | 2 +- ...ttings-task-hydration-transport-error.json | 2 +- ...settings-task-workspace-create-linear.json | 2 +- ...-task-workspace-create-pr-start-point.json | 2 +- .../settings-task-workspace-fulfilled.json | 2 +- .../settings-task-workspace-refused.json | 2 +- ...ttings-task-workspace-transport-error.json | 2 +- .../goldens/settings-task-write.json | 2 +- .../settings-workspace-context-fulfilled.json | 2 +- ...s-workspace-context-refuse-after-data.json | 2 +- .../settings-workspace-context-refused.json | 2 +- ...ngs-workspace-context-transport-error.json | 2 +- .../settings-workspace-submit-fulfilled.json | 2 +- .../settings-workspace-submit-refused.json | 2 +- ...ings-workspace-submit-transport-error.json | 2 +- .../speech-audio-chunk-acknowledged.json | 2 +- .../speech-desktop-start-fulfilled.json | 2 +- ...speech-desktop-start-recording-failed.json | 2 +- .../speech-desktop-start-superseded.json | 2 +- .../speech-dictation-session-cancelled.json | 2 +- .../speech-dictation-session-transcript.json | 2 +- .../speech-setup-sheet-denied-to-mobile.json | 2 +- .../goldens/speech-setup-sheet-fulfilled.json | 2 +- .../speech-setup-sheet-legacy-desktop.json | 2 +- .../speech-setup-sheet-model-vocabulary.json | 2 +- .../structured-agent-session-created.json | 2 +- .../goldens/structured-launch-created.json | 2 +- .../structured-launch-definitive-refusal.json | 2 +- ...uctured-launch-replays-dropped-create.json | 2 +- .../structured-launch-support-refused.json | 2 +- .../structured-launch-unsupported.json | 2 +- .../goldens/tasks-route-repo-list.json | 2 +- .../terminal-gesture-flush-and-clear.json | 2 +- .../goldens/terminal-input-send-accepted.json | 2 +- .../goldens/terminal-input-send-refused.json | 2 +- .../goldens/terminal-live-input-accepted.json | 2 +- .../goldens/terminal-paste-accepted.json | 2 +- .../goldens/terminal-paste-refused.json | 2 +- .../terminal-query-reply-accepted.json | 2 +- .../terminal-query-reply-unsubscribed.json | 2 +- .../goldens/terminal-raw-input-refused.json | 2 +- .../goldens/terminal-raw-input-reported.json | 2 +- .../terminal-takeover-report-accepted.json | 2 +- .../terminal-takeover-report-retried.json | 2 +- .../terminal-viewport-refit-applied.json | 2 +- ...erminal-viewport-refit-legacy-desktop.json | 2 +- ...terminal-worktree-connection-resolved.json | 2 +- .../goldens/tk-create-github.json | 2 +- .../goldens/tk-create-gitlab.json | 2 +- .../goldens/tk-create-linear.json | 2 +- .../goldens/tk-item-checks-files.json | 2 +- .../goldens/tk-item-comment-github.json | 2 +- .../goldens/tk-item-comment-gitlab-mr.json | 2 +- .../goldens/tk-item-comment-gitlab.json | 2 +- .../tk-item-detail-github-reactions.json | 2 +- .../goldens/tk-item-detail-github.json | 2 +- .../tk-item-detail-gitlab-reactions.json | 2 +- .../goldens/tk-item-detail-gitlab.json | 2 +- .../goldens/tk-item-detail-linear.json | 2 +- .../goldens/tk-item-detail-metadata.json | 2 +- .../goldens/tk-item-merge-gitlab.json | 2 +- .../goldens/tk-item-metadata-github.json | 2 +- .../goldens/tk-item-metadata-gitlab-mr.json | 2 +- .../goldens/tk-item-metadata-gitlab.json | 2 +- .../goldens/tk-item-reply-merge.json | 2 +- .../goldens/tk-item-review-github.json | 2 +- .../goldens/tk-item-status-gitlab-mr.json | 2 +- .../goldens/tk-item-status-gitlab.json | 2 +- .../goldens/tk-linear-connect.json | 2 +- .../goldens/tk-linear-item.json | 2 +- .../goldens/tk-linear-team-context.json | 2 +- .../goldens/tk-list-gitlab-items.json | 2 +- .../goldens/tk-list-gitlab-todos.json | 2 +- .../goldens/tk-list-linear.json | 2 +- .../goldens/tk-project-board-load.json | 2 +- .../goldens/tk-project-repo-slugs.json | 2 +- .../tk-project-row-comments-issue.json | 2 +- .../goldens/tk-project-row-comments-pr.json | 2 +- .../goldens/tk-project-row-detail.json | 2 +- .../goldens/tk-project-row-fields.json | 2 +- .../goldens/tk-project-row-files-merge.json | 2 +- .../goldens/tk-project-row-metadata-load.json | 2 +- .../goldens/tk-project-row-review-checks.json | 2 +- .../goldens/tk-project-row-threads.json | 2 +- .../goldens/tk-provider-load.json | 2 +- ...-capability-probe-cutover-reasks-fast.json | 2 +- ...ty-probe-non-string-capabilities-drop.json | 2 +- .../transport-capability-probe-publishes.json | 2 +- ...rt-capability-probe-refused-backs-off.json | 2 +- ...-status-gates-drop-keeps-capabilities.json | 2 +- .../transport-host-status-gates-ready.json | 2 +- ...rt-host-status-gates-refused-degrades.json | 2 +- .../transport-pairing-race-both-refused.json | 2 +- ...t-pairing-race-direct-completes-first.json | 2 +- ...rt-pairing-race-relay-completes-first.json | 2 +- ...g-race-relay-wins-when-direct-refused.json | 2 +- .../goldens/tw-capabilities-advertised.json | 2 +- .../tw-capabilities-cutover-retried.json | 2 +- .../tw-capabilities-legacy-idempotency.json | 2 +- .../tw-create-retry-agent-launched.json | 4 +- .../tw-create-retry-ambiguous-after-drop.json | 2 +- ...reate-retry-ambiguous-while-connected.json | 2 +- ...e-retry-ambiguous-without-idempotency.json | 2 +- .../goldens/tw-create-retry-created.json | 2 +- .../tw-create-retry-name-collision.json | 2 +- .../tw-create-retry-unretryable-refusal.json | 2 +- .../goldens/tw-create-retry-warning-kept.json | 2 +- .../goldens/tw-hosted-base-resolved.json | 2 +- .../goldens/tw-hosted-base-soft-error.json | 2 +- .../goldens/tw-paste-lookup-resolved.json | 2 +- .../goldens/tw-paste-lookup-slug-refused.json | 2 +- .../tw-paste-lookup-slug-unsupported.json | 2 +- .../goldens/tw-setup-hook-trust-always.json | 2 +- .../goldens/tw-setup-hook-trust-approved.json | 2 +- .../tw-smart-search-all-providers.json | 2 +- ...tw-smart-search-gitlab-provider-error.json | 2 +- .../tw-smart-search-linear-listed.json | 2 +- .../tw-task-preferences-resume-write.json | 2 +- .../tw-workspace-source-presets-refused.json | 2 +- .../goldens/tw-workspace-source-presets.json | 2 +- .../tw-workspace-sparse-missing-preset.json | 2 +- .../goldens/tw-workspace-sparse-saved.json | 2 +- .../tw-workspace-ssh-connect-refused.json | 2 +- .../goldens/tw-workspace-ssh-connected.json | 2 +- .../tw-workspace-ssh-local-agents.json | 2 +- .../goldens/tw-workspace-ssh-not-ready.json | 2 +- .../worktree-catalog-snapshot-unreadable.json | 2 +- .../goldens/worktree-catalog-snapshot.json | 2 +- .../goldens/worktree-home-catalog.json | 2 +- .../goldens/worktree-retired-names.json | 2 +- mobile/rpc-foundation/pilot-scenarios.json | 303 +++++- .../src/components/AgentLaunchNotice.test.tsx | 94 ++ mobile/src/components/AgentLaunchNotice.tsx | 89 ++ .../components/MobileDiffReviewDrawers.tsx | 8 +- .../components/MobileDiffReviewScreenView.tsx | 2 + mobile/src/components/MobilePRSidebar.tsx | 28 +- ...le-diff-review-send-sheet-stacking.test.ts | 3 + .../pr-sidebar/MobilePrViewPanel.tsx | 5 +- .../components/pr-sidebar/PRChecksSection.tsx | 19 +- .../pr-sidebar/PRConflictingFilesSection.tsx | 17 +- .../pr-sidebar/PrSidebarCreateEmptyState.tsx | 4 + .../use-new-workspace-create-submit.ts | 2 +- .../mobile-web-shell-gates.ts | 4 +- .../session/MobileDiffReviewRouteScreen.tsx | 5 + .../mobile-agent-launch-availability.test.ts | 46 + .../mobile-agent-launch-availability.ts | 32 + .../session/mobile-diff-review-retry.test.tsx | 3 + .../mobile-existing-agent-launch.test.ts | 253 +++++ .../session/mobile-existing-agent-launch.ts | 126 +++ .../session/mobile-new-tab-agent-loader.ts | 34 +- .../mobile-source-control-launch-agent.ts | 89 ++ .../mobile-worker-takeover-send-sites.test.ts | 32 +- .../src/session/pr-ai-triage-launch.test.ts | 333 +++++- mobile/src/session/pr-ai-triage-launch.ts | 164 ++- .../use-mobile-diff-review-controller.test.ts | 3 + .../use-mobile-diff-review-controller.ts | 13 + .../use-mobile-diff-review-interactions.ts | 3 + ...se-mobile-diff-review-send-actions.test.ts | 198 +++- .../use-mobile-diff-review-send-actions.ts | 102 +- .../session/use-mobile-pr-ai-triage.test.ts | 120 +++ mobile/src/session/use-mobile-pr-ai-triage.ts | 98 +- .../MobileCommitFailurePanel.tsx | 17 +- .../MobileSourceControlPanel.tsx | 1 + ...use-mobile-commit-failure-recovery.test.ts | 124 +++ .../use-mobile-commit-failure-recovery.ts | 77 +- ...se-mobile-source-control-commit-failure.ts | 9 +- .../use-mobile-source-control-state.ts | 2 +- ...e.test.ts => agent-launch-request.test.ts} | 2 +- ...tree-create.ts => agent-launch-request.ts} | 51 +- mobile/src/tasks/blank-workspace-create.ts | 2 +- .../src/tasks/replay-on-ambiguous-delivery.ts | 115 +++ mobile/src/tasks/source-workspace-create.ts | 2 +- .../tasks/workspace-create-reply-schema.ts | 2 +- .../src/tasks/worktree-create-capability.ts | 11 +- .../src/tasks/worktree-create-retry.test.ts | 8 +- mobile/src/tasks/worktree-create-retry.ts | 133 +-- .../bridged-parity/divergence-classes.test.ts | 4 +- .../bridged-parity/divergence-classes.ts | 6 +- .../diff-review-action-mount-adapters.ts | 5 + .../adapters/github-pr-mount-adapters.ts | 17 +- .../rpc-recording-through-bridge.test.ts | 6 +- ...ost-status-capability-ignorability.test.ts | 6 +- .../src/transport/host-status-gates.test.ts | 148 +++ mobile/src/transport/host-status-gates.ts | 151 +-- .../transport/host-status-probe-operations.ts | 21 +- .../src/transport/host-status-reply-schema.ts | 2 +- .../transport/runtime-status-probe.test.ts | 27 + mobile/src/transport/runtime-status-probe.ts | 7 +- ...settings-source-control-projection.test.ts | 53 + src/main/runtime/runtime-client-settings.ts | 29 + src/main/runtime/runtime-store-contract.ts | 2 + .../editor/check-run-details-fix-with-ai.ts | 2 +- .../pull-request-page/checks/fix-dialog.tsx | 2 +- .../checks-panel/active-content.tsx | 2 +- .../source-control/ai/recovery-launch.ts | 2 +- .../source-control/commit/component-gates.ts | 2 +- .../source-control/commit/recovery-notice.tsx | 2 +- .../source-control/panel/panel-dialogs.tsx | 2 +- .../useSourceControlAgentActionDialog.ts | 2 +- ...urceControlActionRepoOverrideNote.test.tsx | 2 +- .../SourceControlActionRepoOverrideNote.tsx | 2 +- .../SourceControlAiActionRecipeDefaults.tsx | 2 +- .../src/lib/fix-checks-agent-launch.test.ts | 2 +- .../src/lib/fix-checks-agent-launch.ts | 2 +- .../pane-agent-identity-inventory.test.ts | 5 - ...rce-control-launch-agent-selection.test.ts | 8 +- .../source-control-launch-agent-selection.ts | 20 +- 870 files changed, 7015 insertions(+), 2269 deletions(-) create mode 100644 mobile/rpc-foundation/goldens/matrix-session.pr-triage-agent.launchreplay-1.json create mode 100644 mobile/rpc-foundation/goldens/matrix-session.pr-triage-preflight.detectagents-1.json rename mobile/rpc-foundation/goldens/{matrix-session.pr-triage-session.tabs.createterminal-1.json => matrix-session.pr-triage-repo.list-1.json} (55%) rename mobile/rpc-foundation/goldens/{matrix-session.pr-triage-terminal.send-1.json => matrix-session.pr-triage-settings.get-1.json} (53%) delete mode 100644 mobile/rpc-foundation/goldens/pr-triage-invalid-terminal.json create mode 100644 mobile/rpc-foundation/goldens/pr-triage-launch-unconfirmed.json create mode 100644 mobile/rpc-foundation/goldens/pr-triage-prompt-not-delivered.json delete mode 100644 mobile/rpc-foundation/goldens/pr-triage-send-locked.json create mode 100644 mobile/rpc-foundation/goldens/pr-triage-update-required.json create mode 100644 mobile/rpc-foundation/goldens/review-create-agent-refused.json delete mode 100644 mobile/rpc-foundation/goldens/review-create-terminal-refused.json create mode 100644 mobile/src/components/AgentLaunchNotice.test.tsx create mode 100644 mobile/src/components/AgentLaunchNotice.tsx create mode 100644 mobile/src/session/mobile-agent-launch-availability.test.ts create mode 100644 mobile/src/session/mobile-agent-launch-availability.ts create mode 100644 mobile/src/session/mobile-existing-agent-launch.test.ts create mode 100644 mobile/src/session/mobile-existing-agent-launch.ts create mode 100644 mobile/src/session/mobile-source-control-launch-agent.ts create mode 100644 mobile/src/session/use-mobile-pr-ai-triage.test.ts create mode 100644 mobile/src/source-control/use-mobile-commit-failure-recovery.test.ts rename mobile/src/tasks/{agent-launch-worktree-create.test.ts => agent-launch-request.test.ts} (98%) rename mobile/src/tasks/{agent-launch-worktree-create.ts => agent-launch-request.ts} (68%) create mode 100644 mobile/src/tasks/replay-on-ambiguous-delivery.ts create mode 100644 src/main/runtime/runtime-client-settings-source-control-projection.test.ts rename src/{renderer/src/lib => shared}/source-control-launch-agent-selection.test.ts (94%) rename src/{renderer/src/lib => shared}/source-control-launch-agent-selection.ts (88%) diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json b/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json index 14863eb6ed5e..419193c26342 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-unsupported.json b/mobile/rpc-foundation/goldens/aivault-history-scan-unsupported.json index 0fcee77ec0f3..88e8e31ab908 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-unsupported.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-unsupported.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json b/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json index 1db6d75eb73d..ebcfd83d05ec 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json b/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json index 5ffaa3c502ac..9b06260c75c6 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json +++ b/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json b/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json index 82e38d52e866..123c47efce25 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json +++ b/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-launch-create-refused.json b/mobile/rpc-foundation/goldens/aivault-resume-launch-create-refused.json index d5c046956b77..7273d7096427 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-launch-create-refused.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-launch-create-refused.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-launch-invalid-tab.json b/mobile/rpc-foundation/goldens/aivault-resume-launch-invalid-tab.json index a77c715a27b8..588b00e9d273 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-launch-invalid-tab.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-launch-invalid-tab.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-launch-locked.json b/mobile/rpc-foundation/goldens/aivault-resume-launch-locked.json index 8a9790b721a9..66ebfa061802 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-launch-locked.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-launch-locked.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-launch-sent.json b/mobile/rpc-foundation/goldens/aivault-resume-launch-sent.json index a892d7739a26..8906ed097a1e 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-launch-sent.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-launch-sent.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-prepare-refused.json b/mobile/rpc-foundation/goldens/aivault-resume-prepare-refused.json index f696b86ddea1..fa0884b18359 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-prepare-refused.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-prepare-refused.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-prepare-repin.json b/mobile/rpc-foundation/goldens/aivault-resume-prepare-repin.json index c121e0d54c70..6b10cde0937a 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-prepare-repin.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-prepare-repin.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-prepare-skipped.json b/mobile/rpc-foundation/goldens/aivault-resume-prepare-skipped.json index 2bc7cdb16d7e..241b9e64da01 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-prepare-skipped.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-prepare-skipped.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-prepare-unavailable.json b/mobile/rpc-foundation/goldens/aivault-resume-prepare-unavailable.json index 4262ba6f21e0..8697a194d782 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-prepare-unavailable.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-prepare-unavailable.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/b1.json b/mobile/rpc-foundation/goldens/b1.json index c980aacea104..e9857f7b6c8e 100644 --- a/mobile/rpc-foundation/goldens/b1.json +++ b/mobile/rpc-foundation/goldens/b1.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/b2.json b/mobile/rpc-foundation/goldens/b2.json index a8f0cbfbe91a..8412643f6a6c 100644 --- a/mobile/rpc-foundation/goldens/b2.json +++ b/mobile/rpc-foundation/goldens/b2.json @@ -3,7 +3,7 @@ "family": "project-explicit-false", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/b3.json b/mobile/rpc-foundation/goldens/b3.json index 9fe5cc5de1ab..922c2db368ec 100644 --- a/mobile/rpc-foundation/goldens/b3.json +++ b/mobile/rpc-foundation/goldens/b3.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/browser-dialog-accepted.json b/mobile/rpc-foundation/goldens/browser-dialog-accepted.json index 532bde414afe..5013ef328dee 100644 --- a/mobile/rpc-foundation/goldens/browser-dialog-accepted.json +++ b/mobile/rpc-foundation/goldens/browser-dialog-accepted.json @@ -3,7 +3,7 @@ "family": "browser.dialog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-dialog-dismissed.json b/mobile/rpc-foundation/goldens/browser-dialog-dismissed.json index 1080195516c0..4e23c9bbfb8c 100644 --- a/mobile/rpc-foundation/goldens/browser-dialog-dismissed.json +++ b/mobile/rpc-foundation/goldens/browser-dialog-dismissed.json @@ -3,7 +3,7 @@ "family": "browser.dialog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-keyboard-input.json b/mobile/rpc-foundation/goldens/browser-keyboard-input.json index 8a1f2b657bcc..0e5aab769a18 100644 --- a/mobile/rpc-foundation/goldens/browser-keyboard-input.json +++ b/mobile/rpc-foundation/goldens/browser-keyboard-input.json @@ -3,7 +3,7 @@ "family": "browser.keyboard", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-pointer-click-accepted.json b/mobile/rpc-foundation/goldens/browser-pointer-click-accepted.json index d82a129a2e61..e0918d566395 100644 --- a/mobile/rpc-foundation/goldens/browser-pointer-click-accepted.json +++ b/mobile/rpc-foundation/goldens/browser-pointer-click-accepted.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-pointer-click-fallback.json b/mobile/rpc-foundation/goldens/browser-pointer-click-fallback.json index c8b892ddb3c1..2a079f64ab80 100644 --- a/mobile/rpc-foundation/goldens/browser-pointer-click-fallback.json +++ b/mobile/rpc-foundation/goldens/browser-pointer-click-fallback.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-wheel-scrolled.json b/mobile/rpc-foundation/goldens/browser-wheel-scrolled.json index 1e647f8c0eb8..bcbc82088a6e 100644 --- a/mobile/rpc-foundation/goldens/browser-wheel-scrolled.json +++ b/mobile/rpc-foundation/goldens/browser-wheel-scrolled.json @@ -3,7 +3,7 @@ "family": "browser.wheel", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-anonymous.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-anonymous.json index 5bb1fc8916b2..e3c40477b441 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-anonymous.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-anonymous.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-blocked-before-send.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-blocked-before-send.json index 1a8293a8c112..e4a42c97e524 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-blocked-before-send.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-blocked-before-send.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-cancelled.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-cancelled.json index 1a055189ffc8..6ddb969723e2 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-cancelled.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-cancelled.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-pasted.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-pasted.json index 1e5eb1794790..acaf59fdb3c5 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-pasted.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-pasted.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-upload-refused.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-upload-refused.json index 73634ccd6143..5e6495076e05 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-upload-refused.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-upload-refused.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-upload-aborts-on-chunk-failure.json b/mobile/rpc-foundation/goldens/clipboard-image-upload-aborts-on-chunk-failure.json index 9d309faa74bf..7102d030df0a 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-upload-aborts-on-chunk-failure.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-upload-aborts-on-chunk-failure.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-upload-chunked.json b/mobile/rpc-foundation/goldens/clipboard-image-upload-chunked.json index a6138359ec46..5ec35b41464f 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-upload-chunked.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-upload-chunked.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-upload-single-frame-fallback.json b/mobile/rpc-foundation/goldens/clipboard-image-upload-single-frame-fallback.json index cedf2b33b695..11b545e8c874 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-upload-single-frame-fallback.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-upload-single-frame-fallback.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-upload-start-refused.json b/mobile/rpc-foundation/goldens/clipboard-image-upload-start-refused.json index abc62c495fe8..c5c41bb2d990 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-upload-start-refused.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-upload-start-refused.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/codex-reset-credit-consumed.json b/mobile/rpc-foundation/goldens/codex-reset-credit-consumed.json index ccea03279bcd..ae20906e3b90 100644 --- a/mobile/rpc-foundation/goldens/codex-reset-credit-consumed.json +++ b/mobile/rpc-foundation/goldens/codex-reset-credit-consumed.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-credit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "76b53dea504a688493843e23e8e7d052fc196f559bb1e2579d0fd38bf3156d0e", diff --git a/mobile/rpc-foundation/goldens/codex-reset-credit-resumed.json b/mobile/rpc-foundation/goldens/codex-reset-credit-resumed.json index 7379c82d88b9..c397c9741ac8 100644 --- a/mobile/rpc-foundation/goldens/codex-reset-credit-resumed.json +++ b/mobile/rpc-foundation/goldens/codex-reset-credit-resumed.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-credit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "76b53dea504a688493843e23e8e7d052fc196f559bb1e2579d0fd38bf3156d0e", diff --git a/mobile/rpc-foundation/goldens/components-codex-capability.json b/mobile/rpc-foundation/goldens/components-codex-capability.json index ead4dfee3d1c..bc682d8f7c65 100644 --- a/mobile/rpc-foundation/goldens/components-codex-capability.json +++ b/mobile/rpc-foundation/goldens/components-codex-capability.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-capability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/components-setup-ask.json b/mobile/rpc-foundation/goldens/components-setup-ask.json index f2afa228f1c9..626c1640ff19 100644 --- a/mobile/rpc-foundation/goldens/components-setup-ask.json +++ b/mobile/rpc-foundation/goldens/components-setup-ask.json @@ -3,7 +3,7 @@ "family": "components.setup-script", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/components-target-local.json b/mobile/rpc-foundation/goldens/components-target-local.json index da6c45d74941..de63b743df26 100644 --- a/mobile/rpc-foundation/goldens/components-target-local.json +++ b/mobile/rpc-foundation/goldens/components-target-local.json @@ -3,7 +3,7 @@ "family": "components.execution-target-local", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/components-target-ssh.json b/mobile/rpc-foundation/goldens/components-target-ssh.json index 041a0d4110af..6862b608e8c8 100644 --- a/mobile/rpc-foundation/goldens/components-target-ssh.json +++ b/mobile/rpc-foundation/goldens/components-target-ssh.json @@ -3,7 +3,7 @@ "family": "components.execution-target", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/diff-review-branch-compare.json b/mobile/rpc-foundation/goldens/diff-review-branch-compare.json index 4d04835ac8b7..2431b6b6bb57 100644 --- a/mobile/rpc-foundation/goldens/diff-review-branch-compare.json +++ b/mobile/rpc-foundation/goldens/diff-review-branch-compare.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-branch-file-diff.json b/mobile/rpc-foundation/goldens/diff-review-branch-file-diff.json index 67328b169864..3881b54995e3 100644 --- a/mobile/rpc-foundation/goldens/diff-review-branch-file-diff.json +++ b/mobile/rpc-foundation/goldens/diff-review-branch-file-diff.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-notes-refused-before-compare.json b/mobile/rpc-foundation/goldens/diff-review-notes-refused-before-compare.json index cd0b56a0dc20..0d66e1a803c5 100644 --- a/mobile/rpc-foundation/goldens/diff-review-notes-refused-before-compare.json +++ b/mobile/rpc-foundation/goldens/diff-review-notes-refused-before-compare.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-refused-file-diff.json b/mobile/rpc-foundation/goldens/diff-review-refused-file-diff.json index 4ac2f0398eb1..170207631f89 100644 --- a/mobile/rpc-foundation/goldens/diff-review-refused-file-diff.json +++ b/mobile/rpc-foundation/goldens/diff-review-refused-file-diff.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-snapshot.json b/mobile/rpc-foundation/goldens/diff-review-snapshot.json index bab97a02bdc8..56c1562d77a6 100644 --- a/mobile/rpc-foundation/goldens/diff-review-snapshot.json +++ b/mobile/rpc-foundation/goldens/diff-review-snapshot.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-status-unavailable.json b/mobile/rpc-foundation/goldens/diff-review-status-unavailable.json index f3630340c622..9029cc36b31d 100644 --- a/mobile/rpc-foundation/goldens/diff-review-status-unavailable.json +++ b/mobile/rpc-foundation/goldens/diff-review-status-unavailable.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-worktree-file-diff.json b/mobile/rpc-foundation/goldens/diff-review-worktree-file-diff.json index 16b90782cd81..c4db11ee7820 100644 --- a/mobile/rpc-foundation/goldens/diff-review-worktree-file-diff.json +++ b/mobile/rpc-foundation/goldens/diff-review-worktree-file-diff.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/file-tap-open-refused.json b/mobile/rpc-foundation/goldens/file-tap-open-refused.json index 2c53dc076b7d..ddbb1a4028a4 100644 --- a/mobile/rpc-foundation/goldens/file-tap-open-refused.json +++ b/mobile/rpc-foundation/goldens/file-tap-open-refused.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/file-tap-opens-worktree-file.json b/mobile/rpc-foundation/goldens/file-tap-opens-worktree-file.json index 5fc43a8f830a..9f0c24dc1cab 100644 --- a/mobile/rpc-foundation/goldens/file-tap-opens-worktree-file.json +++ b/mobile/rpc-foundation/goldens/file-tap-opens-worktree-file.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/file-tap-previews-absolute-artifact.json b/mobile/rpc-foundation/goldens/file-tap-previews-absolute-artifact.json index 53215f54c4cc..25480522f096 100644 --- a/mobile/rpc-foundation/goldens/file-tap-previews-absolute-artifact.json +++ b/mobile/rpc-foundation/goldens/file-tap-previews-absolute-artifact.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/file-tap-resolve-miss.json b/mobile/rpc-foundation/goldens/file-tap-resolve-miss.json index 8adb1d19d57b..8a5ca5a01607 100644 --- a/mobile/rpc-foundation/goldens/file-tap-resolve-miss.json +++ b/mobile/rpc-foundation/goldens/file-tap-resolve-miss.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/file-tap-resolve-refused.json b/mobile/rpc-foundation/goldens/file-tap-resolve-refused.json index 0b876017b9f9..ab76b124fb4b 100644 --- a/mobile/rpc-foundation/goldens/file-tap-resolve-refused.json +++ b/mobile/rpc-foundation/goldens/file-tap-resolve-refused.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/files-explorer-legacy-fallback.json b/mobile/rpc-foundation/goldens/files-explorer-legacy-fallback.json index 8f9c1b500f20..5c10140877d4 100644 --- a/mobile/rpc-foundation/goldens/files-explorer-legacy-fallback.json +++ b/mobile/rpc-foundation/goldens/files-explorer-legacy-fallback.json @@ -3,7 +3,7 @@ "family": "files.explorer-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "7a42a348f4407b94cf75ac77a4b6b783b7d28103b1ae1d111d2708dab0dd4a0c", diff --git a/mobile/rpc-foundation/goldens/files-explorer-readdir.json b/mobile/rpc-foundation/goldens/files-explorer-readdir.json index 2510dcb8da54..658cd1cba1cf 100644 --- a/mobile/rpc-foundation/goldens/files-explorer-readdir.json +++ b/mobile/rpc-foundation/goldens/files-explorer-readdir.json @@ -3,7 +3,7 @@ "family": "files.explorer-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "7a42a348f4407b94cf75ac77a4b6b783b7d28103b1ae1d111d2708dab0dd4a0c", diff --git a/mobile/rpc-foundation/goldens/files-ownership-local.json b/mobile/rpc-foundation/goldens/files-ownership-local.json index 3c8785507d4f..f3815b3c7f5e 100644 --- a/mobile/rpc-foundation/goldens/files-ownership-local.json +++ b/mobile/rpc-foundation/goldens/files-ownership-local.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-ownership-ssh.json b/mobile/rpc-foundation/goldens/files-ownership-ssh.json index 869b69ea732f..95aac7fc2462 100644 --- a/mobile/rpc-foundation/goldens/files-ownership-ssh.json +++ b/mobile/rpc-foundation/goldens/files-ownership-ssh.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-artifact-direct.json b/mobile/rpc-foundation/goldens/files-preview-artifact-direct.json index f7ad51f0bf42..4694bdef9d59 100644 --- a/mobile/rpc-foundation/goldens/files-preview-artifact-direct.json +++ b/mobile/rpc-foundation/goldens/files-preview-artifact-direct.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-artifact-image-read.json b/mobile/rpc-foundation/goldens/files-preview-artifact-image-read.json index 2d6eeb2be0ee..dcf696662f15 100644 --- a/mobile/rpc-foundation/goldens/files-preview-artifact-image-read.json +++ b/mobile/rpc-foundation/goldens/files-preview-artifact-image-read.json @@ -3,7 +3,7 @@ "family": "files.preview-artifact-image", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-artifact-image.json b/mobile/rpc-foundation/goldens/files-preview-artifact-image.json index dfdb817d9376..f9934fbb8415 100644 --- a/mobile/rpc-foundation/goldens/files-preview-artifact-image.json +++ b/mobile/rpc-foundation/goldens/files-preview-artifact-image.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-grant-refresh.json b/mobile/rpc-foundation/goldens/files-preview-grant-refresh.json index acedc84c06b9..c1ea1ae07af1 100644 --- a/mobile/rpc-foundation/goldens/files-preview-grant-refresh.json +++ b/mobile/rpc-foundation/goldens/files-preview-grant-refresh.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-worktree-image-read.json b/mobile/rpc-foundation/goldens/files-preview-worktree-image-read.json index 639277d8b566..ab57d829624e 100644 --- a/mobile/rpc-foundation/goldens/files-preview-worktree-image-read.json +++ b/mobile/rpc-foundation/goldens/files-preview-worktree-image-read.json @@ -3,7 +3,7 @@ "family": "files.preview-worktree-image", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-worktree-image.json b/mobile/rpc-foundation/goldens/files-preview-worktree-image.json index da550e85887a..fc900664173a 100644 --- a/mobile/rpc-foundation/goldens/files-preview-worktree-image.json +++ b/mobile/rpc-foundation/goldens/files-preview-worktree-image.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-worktree-text-read.json b/mobile/rpc-foundation/goldens/files-preview-worktree-text-read.json index 51a3d994d725..9f189b98b7cd 100644 --- a/mobile/rpc-foundation/goldens/files-preview-worktree-text-read.json +++ b/mobile/rpc-foundation/goldens/files-preview-worktree-text-read.json @@ -3,7 +3,7 @@ "family": "files.preview-worktree-text", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-worktree.json b/mobile/rpc-foundation/goldens/files-preview-worktree.json index 5589a7e33caa..5fd91b2b517f 100644 --- a/mobile/rpc-foundation/goldens/files-preview-worktree.json +++ b/mobile/rpc-foundation/goldens/files-preview-worktree.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-save-blind.json b/mobile/rpc-foundation/goldens/files-save-blind.json index a4aada230166..dc1209252f73 100644 --- a/mobile/rpc-foundation/goldens/files-save-blind.json +++ b/mobile/rpc-foundation/goldens/files-save-blind.json @@ -3,7 +3,7 @@ "family": "files.preview-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-save-verified.json b/mobile/rpc-foundation/goldens/files-save-verified.json index f457d594a067..3d370939df4c 100644 --- a/mobile/rpc-foundation/goldens/files-save-verified.json +++ b/mobile/rpc-foundation/goldens/files-save-verified.json @@ -3,7 +3,7 @@ "family": "files.preview-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-tab-doc-shapes.json b/mobile/rpc-foundation/goldens/files-tab-doc-shapes.json index 5e112a24495a..4ba829fd5139 100644 --- a/mobile/rpc-foundation/goldens/files-tab-doc-shapes.json +++ b/mobile/rpc-foundation/goldens/files-tab-doc-shapes.json @@ -3,7 +3,7 @@ "family": "files.tab-doc", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/home-host-accounts.json b/mobile/rpc-foundation/goldens/home-host-accounts.json index 138ee27c5788..b9c58502f53b 100644 --- a/mobile/rpc-foundation/goldens/home-host-accounts.json +++ b/mobile/rpc-foundation/goldens/home-host-accounts.json @@ -3,7 +3,7 @@ "family": "home.host-accounts", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c632fdbc4b730777ecb09f08bec14cca0586042b01ed99d40d0228806c7def4a", diff --git a/mobile/rpc-foundation/goldens/home-host-stats.json b/mobile/rpc-foundation/goldens/home-host-stats.json index 1a582a218848..53128ac55c86 100644 --- a/mobile/rpc-foundation/goldens/home-host-stats.json +++ b/mobile/rpc-foundation/goldens/home-host-stats.json @@ -3,7 +3,7 @@ "family": "home.host-stats", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/host-view-settings-sync.json b/mobile/rpc-foundation/goldens/host-view-settings-sync.json index 42c1e36b480b..ff27183bf088 100644 --- a/mobile/rpc-foundation/goldens/host-view-settings-sync.json +++ b/mobile/rpc-foundation/goldens/host-view-settings-sync.json @@ -3,7 +3,7 @@ "family": "host.view-settings", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/host-worktree-actions-pin-open-delete.json b/mobile/rpc-foundation/goldens/host-worktree-actions-pin-open-delete.json index 1783e6c491b7..49517faa0969 100644 --- a/mobile/rpc-foundation/goldens/host-worktree-actions-pin-open-delete.json +++ b/mobile/rpc-foundation/goldens/host-worktree-actions-pin-open-delete.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/host-worktree-delete-refused.json b/mobile/rpc-foundation/goldens/host-worktree-delete-refused.json index 7f7cad606f50..4d4f1c5da7b1 100644 --- a/mobile/rpc-foundation/goldens/host-worktree-delete-refused.json +++ b/mobile/rpc-foundation/goldens/host-worktree-delete-refused.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/host-worktree-refresh-stream.json b/mobile/rpc-foundation/goldens/host-worktree-refresh-stream.json index e10f751b1f33..0e711a5623ed 100644 --- a/mobile/rpc-foundation/goldens/host-worktree-refresh-stream.json +++ b/mobile/rpc-foundation/goldens/host-worktree-refresh-stream.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/interruptions-inventory-lifecycle.json b/mobile/rpc-foundation/goldens/interruptions-inventory-lifecycle.json index a1e43b0e0729..38f5f2d52db9 100644 --- a/mobile/rpc-foundation/goldens/interruptions-inventory-lifecycle.json +++ b/mobile/rpc-foundation/goldens/interruptions-inventory-lifecycle.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/interruptions-settings-bot-overrides-fulfilled.json b/mobile/rpc-foundation/goldens/interruptions-settings-bot-overrides-fulfilled.json index a80a49405f37..c113f4934a80 100644 --- a/mobile/rpc-foundation/goldens/interruptions-settings-bot-overrides-fulfilled.json +++ b/mobile/rpc-foundation/goldens/interruptions-settings-bot-overrides-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/inventory-lifecycle.json b/mobile/rpc-foundation/goldens/inventory-lifecycle.json index 86cc5a797be1..c8e58c17a54f 100644 --- a/mobile/rpc-foundation/goldens/inventory-lifecycle.json +++ b/mobile/rpc-foundation/goldens/inventory-lifecycle.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/inventory-repeat-query.json b/mobile/rpc-foundation/goldens/inventory-repeat-query.json index e13e271c53f6..cca240fab8a1 100644 --- a/mobile/rpc-foundation/goldens/inventory-repeat-query.json +++ b/mobile/rpc-foundation/goldens/inventory-repeat-query.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/lifecycle-b3.json b/mobile/rpc-foundation/goldens/lifecycle-b3.json index 70e4e2bbcbae..cf04a8e52cd4 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-b3.json +++ b/mobile/rpc-foundation/goldens/lifecycle-b3.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/lifecycle-inventory-lifecycle.json b/mobile/rpc-foundation/goldens/lifecycle-inventory-lifecycle.json index 70618945c1cd..7706e5c23b41 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-inventory-lifecycle.json +++ b/mobile/rpc-foundation/goldens/lifecycle-inventory-lifecycle.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/lifecycle-settings-bot-overrides-fulfilled.json b/mobile/rpc-foundation/goldens/lifecycle-settings-bot-overrides-fulfilled.json index 1b5f354c5f17..c02ba959c78a 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-settings-bot-overrides-fulfilled.json +++ b/mobile/rpc-foundation/goldens/lifecycle-settings-bot-overrides-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/lifecycle-settings-task-hydration-fulfilled.json b/mobile/rpc-foundation/goldens/lifecycle-settings-task-hydration-fulfilled.json index 32b971e6c965..233de8a64183 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-settings-task-hydration-fulfilled.json +++ b/mobile/rpc-foundation/goldens/lifecycle-settings-task-hydration-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/lifecycle-settings-workspace-context-fulfilled.json b/mobile/rpc-foundation/goldens/lifecycle-settings-workspace-context-fulfilled.json index bb177b8f14a8..6c7c5a921cda 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-settings-workspace-context-fulfilled.json +++ b/mobile/rpc-foundation/goldens/lifecycle-settings-workspace-context-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/linear-select-workspace.json b/mobile/rpc-foundation/goldens/linear-select-workspace.json index 6d66f10d6e72..c62341321b80 100644 --- a/mobile/rpc-foundation/goldens/linear-select-workspace.json +++ b/mobile/rpc-foundation/goldens/linear-select-workspace.json @@ -3,7 +3,7 @@ "family": "linear.select-workspace-picker", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b65996c152b632d553a31e07e31ea5c76f998eada42cf0966923d730da21908f", diff --git a/mobile/rpc-foundation/goldens/live-worktree-name-stream.json b/mobile/rpc-foundation/goldens/live-worktree-name-stream.json index 0eb76ef03a33..8aeb392fe07f 100644 --- a/mobile/rpc-foundation/goldens/live-worktree-name-stream.json +++ b/mobile/rpc-foundation/goldens/live-worktree-name-stream.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.create-1.json b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.create-1.json index 0dd95e326d02..4d2fe5a4e75e 100644 --- a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.create-1.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.createsupport-1.json b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.createsupport-1.json index 2aa03df5a0b1..c42f108854cf 100644 --- a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.createsupport-1.json +++ b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.createsupport-1.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-launch-agentsession.createsupport-1.json b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-launch-agentsession.createsupport-1.json index ff9b97185738..522a70669077 100644 --- a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-launch-agentsession.createsupport-1.json +++ b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-launch-agentsession.createsupport-1.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json index f1c1ee9933e5..53404a56db05 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json index 9abbabeb5455..a2daea98baa2 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-status.get-2.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-status.get-2.json index 7c7e63ff8e6b..ace3ee82e9e8 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-status.get-2.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-status.get-2.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json index 25f821fee695..6255151ee8ec 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json index 6873290ccf1a..2dc1ed6dd783 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-session.tabs.createterminal-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-session.tabs.createterminal-1.json index b35d25482ee0..512d5c031a19 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-session.tabs.createterminal-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-session.tabs.createterminal-1.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-terminal.send-1.json index f19801409636..de17109c6226 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.resume-preparation-aivault.preparesessionresume-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.resume-preparation-aivault.preparesessionresume-1.json index 41b607ed3f69..fa432bebe881 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.resume-preparation-aivault.preparesessionresume-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.resume-preparation-aivault.preparesessionresume-1.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.dialog-browser.dialogaccept-1.json b/mobile/rpc-foundation/goldens/matrix-browser.dialog-browser.dialogaccept-1.json index 675841953d70..0bbdd00cb21f 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.dialog-browser.dialogaccept-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.dialog-browser.dialogaccept-1.json @@ -3,7 +3,7 @@ "family": "browser.dialog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keyboardinserttext-1.json b/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keyboardinserttext-1.json index 82d458cc64b5..cd482560c1a3 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keyboardinserttext-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keyboardinserttext-1.json @@ -3,7 +3,7 @@ "family": "browser.keyboard", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keypress-1.json b/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keypress-1.json index d359fa7f8255..fb7f153f204b 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keypress-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keypress-1.json @@ -3,7 +3,7 @@ "family": "browser.keyboard", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseclick-1.json b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseclick-1.json index 0a86c5777cfd..29a9173986d2 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseclick-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseclick-1.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousedown-1.json b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousedown-1.json index d8ef9402bd4b..1e6456b1f023 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousedown-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousedown-1.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousemove-1.json b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousemove-1.json index e156567d6962..d6009d614a74 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousemove-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousemove-1.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseup-1.json b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseup-1.json index 480078b28956..facb0d19e0e9 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseup-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseup-1.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousemove-1.json b/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousemove-1.json index ac2d3276d30b..87ac6b7faaf7 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousemove-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousemove-1.json @@ -3,7 +3,7 @@ "family": "browser.wheel", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousewheel-1.json b/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousewheel-1.json index 4f6c047f4dc1..2c52ef6ec72a 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousewheel-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousewheel-1.json @@ -3,7 +3,7 @@ "family": "browser.wheel", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-clipboard.image-attachment-clipboard.startimageupload-1.json b/mobile/rpc-foundation/goldens/matrix-clipboard.image-attachment-clipboard.startimageupload-1.json index fe3c3c6a406e..2e7e89decf2f 100644 --- a/mobile/rpc-foundation/goldens/matrix-clipboard.image-attachment-clipboard.startimageupload-1.json +++ b/mobile/rpc-foundation/goldens/matrix-clipboard.image-attachment-clipboard.startimageupload-1.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.saveimageastempfile-1.json b/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.saveimageastempfile-1.json index 5f569d3594b8..300c0a1bb4f5 100644 --- a/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.saveimageastempfile-1.json +++ b/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.saveimageastempfile-1.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.startimageupload-1.json b/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.startimageupload-1.json index a6a213fa2e98..8599f5b2df99 100644 --- a/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.startimageupload-1.json +++ b/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.startimageupload-1.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-components.codex-reset-capability-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-components.codex-reset-capability-status.get-1.json index 1584210054ee..70fa3aaa0841 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.codex-reset-capability-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.codex-reset-capability-status.get-1.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-capability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.codex-reset-credit-accounts.consumecodexresetcredit-1.json b/mobile/rpc-foundation/goldens/matrix-components.codex-reset-credit-accounts.consumecodexresetcredit-1.json index 467f627c04ae..1829baa8edaa 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.codex-reset-credit-accounts.consumecodexresetcredit-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.codex-reset-credit-accounts.consumecodexresetcredit-1.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-credit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "76b53dea504a688493843e23e8e7d052fc196f559bb1e2579d0fd38bf3156d0e", diff --git a/mobile/rpc-foundation/goldens/matrix-components.execution-target-local-preflight.detectagents-1.json b/mobile/rpc-foundation/goldens/matrix-components.execution-target-local-preflight.detectagents-1.json index ad5a116fd680..a56cfbad645c 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.execution-target-local-preflight.detectagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.execution-target-local-preflight.detectagents-1.json @@ -3,7 +3,7 @@ "family": "components.execution-target-local", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.execution-target-preflight.detectremoteagents-1.json b/mobile/rpc-foundation/goldens/matrix-components.execution-target-preflight.detectremoteagents-1.json index ee80824dc831..4bc97abed12d 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.execution-target-preflight.detectremoteagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.execution-target-preflight.detectremoteagents-1.json @@ -3,7 +3,7 @@ "family": "components.execution-target", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.connect-1.json b/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.connect-1.json index ee6a81d855a2..53d45631f5f2 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.connect-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.connect-1.json @@ -3,7 +3,7 @@ "family": "components.execution-target", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.getstate-1.json b/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.getstate-1.json index 5b54a462fe2b..68684251c5ea 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.getstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.getstate-1.json @@ -3,7 +3,7 @@ "family": "components.execution-target", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.new-workspace-repositories-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-components.new-workspace-repositories-repo.list-1.json index ffd3f00d8559..19650d12990d 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.new-workspace-repositories-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.new-workspace-repositories-repo.list-1.json @@ -3,7 +3,7 @@ "family": "components.new-workspace-repositories", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "64c1772f0f95a3c43fbb14398a8804b2b4784f7f18874e4fd79767ae634c7faa", diff --git a/mobile/rpc-foundation/goldens/matrix-components.setup-script-repo.hooks-1.json b/mobile/rpc-foundation/goldens/matrix-components.setup-script-repo.hooks-1.json index ca1e153e8d73..18a8f25f5949 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.setup-script-repo.hooks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.setup-script-repo.hooks-1.json @@ -3,7 +3,7 @@ "family": "components.setup-script", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.list-1.json b/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.list-1.json index f1f02ac024c4..e3ae350bcd88 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.list-1.json @@ -3,7 +3,7 @@ "family": "files.explorer-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "7a42a348f4407b94cf75ac77a4b6b783b7d28103b1ae1d111d2708dab0dd4a0c", diff --git a/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.readdir-1.json b/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.readdir-1.json index 012059fdf035..131d7707a4e1 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.readdir-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.readdir-1.json @@ -3,7 +3,7 @@ "family": "files.explorer-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "7a42a348f4407b94cf75ac77a4b6b783b7d28103b1ae1d111d2708dab0dd4a0c", diff --git a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-ssh.getstate-1.json b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-ssh.getstate-1.json index 9958e76d69ac..9c6bccc96098 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-ssh.getstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-ssh.getstate-1.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-status.get-1.json index 4797219f6744..3b5bec1f7d56 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-status.get-1.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-worktree.show-1.json index 04ca092f7615..bbf0b3851731 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-artifact-image-files.readterminalartifactpreview-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-artifact-image-files.readterminalartifactpreview-1.json index b44c387ac7cf..732fbc1f4b94 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-artifact-image-files.readterminalartifactpreview-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-artifact-image-files.readterminalartifactpreview-1.json @@ -3,7 +3,7 @@ "family": "files.preview-artifact-image", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-1.json index 2a0289521209..0d0a849b2f8a 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-1.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-2.json b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-2.json index 86ecd0352f78..8760719727d4 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-2.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-2.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.resolveterminalpath-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.resolveterminalpath-1.json index edb175af8350..a25e815bce38 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.resolveterminalpath-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.resolveterminalpath-1.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.readterminalartifact-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.readterminalartifact-1.json index 701b00772ee0..51b9cf786282 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.readterminalartifact-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.readterminalartifact-1.json @@ -3,7 +3,7 @@ "family": "files.preview-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.writeterminalartifact-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.writeterminalartifact-1.json index 20d302012ccb..363e3c7dde8e 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.writeterminalartifact-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.writeterminalartifact-1.json @@ -3,7 +3,7 @@ "family": "files.preview-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-image-files.readpreview-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-image-files.readpreview-1.json index aae0ab561aa0..0408a9c3a586 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-image-files.readpreview-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-image-files.readpreview-1.json @@ -3,7 +3,7 @@ "family": "files.preview-worktree-image", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-text-files.read-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-text-files.read-1.json index c5e9f6407559..27825102bcec 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-text-files.read-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-text-files.read-1.json @@ -3,7 +3,7 @@ "family": "files.preview-worktree-text", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.read-1.json b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.read-1.json index b9704e0e7907..35d97c64c469 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.read-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.read-1.json @@ -3,7 +3,7 @@ "family": "files.tab-doc", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.readpreview-1.json b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.readpreview-1.json index 0ef791fe93e0..8a458180dd27 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.readpreview-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.readpreview-1.json @@ -3,7 +3,7 @@ "family": "files.tab-doc", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-git.diff-1.json b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-git.diff-1.json index 51c711d42336..c25f92c59f79 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-git.diff-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-git.diff-1.json @@ -3,7 +3,7 @@ "family": "files.tab-doc", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.open-1.json b/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.open-1.json index 1cba34985bc3..80494c6f26f7 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.open-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.open-1.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.resolveterminalpath-1.json b/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.resolveterminalpath-1.json index 86d83ddee9ec..1eea79733e92 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.resolveterminalpath-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.resolveterminalpath-1.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.baserefdefault-1.json b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.baserefdefault-1.json index 4772cb6adb59..aabcd9eac472 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.baserefdefault-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.baserefdefault-1.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.list-1.json index 33768d3d81c0..02f2730a3ce0 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.list-1.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-worktree.show-1.json index a5e802971810..81be16d5e784 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json b/mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json index 837fc221dc60..4e9c254248b0 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json @@ -3,7 +3,7 @@ "family": "git.branch-diff-preview", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json index 21f412d5aa64..acf44fb06060 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json index 505b519e89b1..be1ce32089c8 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json index fedb8e55d360..2d358a3e83b7 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json index 411a2b2d435c..9236f81f5d51 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.commit-message-ai-git.generatecommitmessage-1.json b/mobile/rpc-foundation/goldens/matrix-git.commit-message-ai-git.generatecommitmessage-1.json index 446ad90a026a..0ad229114d0a 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.commit-message-ai-git.generatecommitmessage-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.commit-message-ai-git.generatecommitmessage-1.json @@ -3,7 +3,7 @@ "family": "git.commit-message-ai", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.commitcompare-1.json b/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.commitcompare-1.json index a92368dd7257..be9e8c3ccbb4 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.commitcompare-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.commitcompare-1.json @@ -3,7 +3,7 @@ "family": "git.history-commit-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.history-1.json b/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.history-1.json index ebbc86490865..43b1e6f69701 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.history-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.history-1.json @@ -3,7 +3,7 @@ "family": "git.history-commit-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.history-read-git.history-1.json b/mobile/rpc-foundation/goldens/matrix-git.history-read-git.history-1.json index c4d29c3fb19b..4f3bd614da3a 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.history-read-git.history-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.history-read-git.history-1.json @@ -3,7 +3,7 @@ "family": "git.history-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.remote-prerequisite-git.push-1.json b/mobile/rpc-foundation/goldens/matrix-git.remote-prerequisite-git.push-1.json index 9c8ba886c2d6..b1c08de7bfc4 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.remote-prerequisite-git.push-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.remote-prerequisite-git.push-1.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-git.review-preparation-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-git.review-preparation-git.status-1.json index df9240be29f4..4bc338b638ca 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.review-preparation-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.review-preparation-git.status-1.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addissuecomment-1.json index 08746cbd4f9c..806b0ebafb43 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addissuecomment-1.json @@ -3,10 +3,10 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "0c8f09683408a919dd3ac2b7cd12197d8745882627134cde95ecee209575b027", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addprreviewcommentreply-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addprreviewcommentreply-1.json index 7a9473ab0d69..77d912eb07c9 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addprreviewcommentreply-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addprreviewcommentreply-1.json @@ -3,10 +3,10 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "4f2b61df5e59d2efe81d467214a78132654035cbcb4d929385410b53f735c9fe", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.deleteissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.deleteissuecommentbyslug-1.json index ac09e3a83440..76bc1ef55d15 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.deleteissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.deleteissuecommentbyslug-1.json @@ -3,10 +3,10 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "04b2052cce6f24d9e208c992f204355639409ddc9793b3044b394c0e38d3c284", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.updateissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.updateissuecommentbyslug-1.json index 569f79e8ba5b..8af2ce1ce222 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.updateissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.updateissuecommentbyslug-1.json @@ -3,10 +3,10 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "8f849437158296753a84a75dfdbaf69852bcdb6cdc6e8205496961ec16e4be21", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.resolvereviewthread-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.resolvereviewthread-1.json index c470f12d3857..30555b5ae0c0 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.resolvereviewthread-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.resolvereviewthread-1.json @@ -3,10 +3,10 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "77eba7deff3f15e64795cdcbefd009abfcf2379e7293eefb1f154ca1e99f4d5d", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.mergepr-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.mergepr-1.json index 1a47943d9873..396b4c7439ef 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.mergepr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.mergepr-1.json @@ -3,10 +3,10 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "2235d05e0d2c6f1a9518cfdd76870e303cccd35289d6a44334147b6a5b6b675e", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.removeprreviewers-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.removeprreviewers-1.json index d8415c0685cc..ab3f280a28ad 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.removeprreviewers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.removeprreviewers-1.json @@ -3,10 +3,10 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "2cea87c339b35daf62c963092c01c6379db43f2ee4ca5cb2b5f817975b0caf65", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.requestprreviewers-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.requestprreviewers-1.json index 45bf3d7fef0f..28b45178e0d6 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.requestprreviewers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.requestprreviewers-1.json @@ -3,10 +3,10 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "78de11de556c91782590725819b22821732a12d3769f493d165c80bc7fcc1f53", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.rerunprchecks-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.rerunprchecks-1.json index 9bf6a49bb387..973e5712cfc6 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.rerunprchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.rerunprchecks-1.json @@ -3,10 +3,10 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "ac7e91b4d35021eca63af8ce01f9a2c7959109e4cb824009881437cb94dbfe82", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.setprautomerge-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.setprautomerge-1.json index b4fffd04b695..336ae110059f 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.setprautomerge-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.setprautomerge-1.json @@ -3,10 +3,10 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "a85682e5009d634bf468b8dbe4f35a957988754ed9c2b07d57ad475c1590d1f6", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.updateprstate-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.updateprstate-1.json index d2b57069195d..a65428b8e2ca 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.updateprstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.updateprstate-1.json @@ -3,10 +3,10 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "30f321fcbfaf09505bc6e18e64c09ca49c0dcdb7c5e12c4e27c2429b3e1066ca", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.listassignableusers-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.listassignableusers-1.json index 8663551cd07d..3ba174a751d8 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.listassignableusers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.listassignableusers-1.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "507743a5925a37be32156b3d8df83ddb8e08c262d2c2f44bbd117dee4672bbc5", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prcheckdetails-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prcheckdetails-1.json index 8b47ed74b929..bf05e8646223 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prcheckdetails-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prcheckdetails-1.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "6efca320cf31a1de988110004a9fb7b67fdad279a789e046ad6b5141b66e5bf1", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prchecks-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prchecks-1.json index 6f528205be1c..a4102369042c 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prchecks-1.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "c77d7c7a05ecb9b27180ef28ca63a28e1c1ca42db2bb54a468699da77281ae35", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prforbranch-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prforbranch-1.json index a633598fa80b..d51a8e4a893e 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prforbranch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prforbranch-1.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "3b3d3032b992fc7461b13de8a42512affa12fb018ad583898179a9934c13b414", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.reposlug-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.reposlug-1.json index a54073d825e9..294612973795 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.reposlug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.reposlug-1.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "4ebe865f874b0b4a813860ec7356b8dc214ea02f0a9036cb003efe863d89b83e", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.workitemdetails-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.workitemdetails-1.json index c160111e9e8b..03b1f3af3d68 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.workitemdetails-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.workitemdetails-1.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "bc3350efc030f824fc21046aea8c6dc9a46993b6c75613c66874fde59af9171a", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-hostedreview.forbranch-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-hostedreview.forbranch-1.json index ce776c7f3400..9dfcea1975da 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-hostedreview.forbranch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-hostedreview.forbranch-1.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "9171e982babc4e56852fe35bafa7a9f3aeda2be5bd4648f29aaa04ca7119d5d2", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-title-mutation-github.updateprtitle-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-title-mutation-github.updateprtitle-1.json index 75497449e069..db37ecace105 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-title-mutation-github.updateprtitle-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-title-mutation-github.updateprtitle-1.json @@ -3,10 +3,10 @@ "family": "github.pr-title-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "fe91d5518501a078dff3010e74c4b9d70122f88a629e384336cd1b6a84de36a8", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-home.host-accounts-accounts.list-1.json b/mobile/rpc-foundation/goldens/matrix-home.host-accounts-accounts.list-1.json index b756f0e26eb7..8c3f240d5faa 100644 --- a/mobile/rpc-foundation/goldens/matrix-home.host-accounts-accounts.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-home.host-accounts-accounts.list-1.json @@ -3,7 +3,7 @@ "family": "home.host-accounts", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c632fdbc4b730777ecb09f08bec14cca0586042b01ed99d40d0228806c7def4a", diff --git a/mobile/rpc-foundation/goldens/matrix-home.host-stats-stats.summary-1.json b/mobile/rpc-foundation/goldens/matrix-home.host-stats-stats.summary-1.json index 860b9a4214b2..e808bddbe6fd 100644 --- a/mobile/rpc-foundation/goldens/matrix-home.host-stats-stats.summary-1.json +++ b/mobile/rpc-foundation/goldens/matrix-home.host-stats-stats.summary-1.json @@ -3,7 +3,7 @@ "family": "home.host-stats", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-1.json b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-1.json index 8509139ab93c..8188118fef3f 100644 --- a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-1.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-2.json b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-2.json index a35f134c9630..0ffb16350276 100644 --- a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-2.json +++ b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-2.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-3.json b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-3.json index efceb3aca89b..a7d857302e1f 100644 --- a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-3.json +++ b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-3.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-2-1.json b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-2-1.json index 4341e370fcea..122408a75f79 100644 --- a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-2-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-2-1.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.get-1.json b/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.get-1.json index 888840f25b2b..57adfc6c1949 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.get-1.json @@ -3,7 +3,7 @@ "family": "host.view-settings", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.set-1.json b/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.set-1.json index 4c6e4995ba1a..2cf5ee33fba8 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.set-1.json @@ -3,7 +3,7 @@ "family": "host.view-settings", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.activate-1.json b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.activate-1.json index cd25bda2a979..0cf874ee84e3 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.activate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.activate-1.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.rm-1.json b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.rm-1.json index aea83826f582..bf8d61caa050 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.rm-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.rm-1.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.set-1.json index 6b9dab5fdd93..ec3546ea2740 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.set-1.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-git.push-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-git.push-1.json index 36a506da6961..fb33a1c1e7dc 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-git.push-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-git.push-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-hostedreview.create-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-hostedreview.create-1.json index d1753f4425b7..b7b4f4e326e3 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-hostedreview.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-hostedreview.create-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-worktree.set-1.json index 0c5e2396e0e9..39ea426a9f66 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-worktree.set-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.bulkstage-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.bulkstage-1.json index 2df5db78fe11..445b6cee00a3 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.bulkstage-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.bulkstage-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.commit-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.commit-1.json index 56a0f6948ae2..425cb014bb3c 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.commit-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.commit-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.generatecommitmessage-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.generatecommitmessage-1.json index b32c45655df8..a7ec45c47ea8 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.generatecommitmessage-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.generatecommitmessage-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.push-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.push-1.json index 4a7a2504aba1..ca99bab6a01d 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.push-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.push-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-1.json index 2cf03eb5cbdf..11263c70c663 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-2.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-2.json index 053bc25523b0..13f402cfa973 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-2.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-2.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-3.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-3.json index b4a5e9c257f7..36e2ddbc10fc 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-3.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-3.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-4.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-4.json index 7a84c2dddc0e..4f6eb1557dc2 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-4.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-4.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.create-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.create-1.json index 01e9ec501a93..f3e587029bd1 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.create-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-1.json index 09368580565b..2bc0f6d3f4fb 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-2.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-2.json index eb0269a9e9d1..2380040f6684 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-2.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-2.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-worktree.set-1.json index df36974ab3c4..2beeb0ed5ab9 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-worktree.set-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.eligibility-hostedreview.getcreationeligibility-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.eligibility-hostedreview.getcreationeligibility-1.json index 3619df0912a4..c0176e343196 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.eligibility-hostedreview.getcreationeligibility-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.eligibility-hostedreview.getcreationeligibility-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.eligibility", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-1.json b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-1.json index e694b94eebd1..3c160667be93 100644 --- a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-1.json +++ b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-1.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-2.json b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-2.json index f69f771fd9c8..033302a64a24 100644 --- a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-2.json +++ b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-2.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-fresh-inventory.json b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-fresh-inventory.json index 09b3cbae8749..61665af7c473 100644 --- a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-fresh-inventory.json +++ b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-fresh-inventory.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-old-inventory.json b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-old-inventory.json index 5aca63619881..a75e8c682c51 100644 --- a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-old-inventory.json +++ b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-old-inventory.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.getissue-1.json b/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.getissue-1.json index 3d3020deaebd..60cc966dac40 100644 --- a/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.getissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.getissue-1.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.issuecomments-1.json b/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.issuecomments-1.json index 6a39e49786ab..d113789d15e8 100644 --- a/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.issuecomments-1.json +++ b/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.issuecomments-1.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/matrix-linear.select-workspace-picker-linear.selectworkspace-1.json b/mobile/rpc-foundation/goldens/matrix-linear.select-workspace-picker-linear.selectworkspace-1.json index b31443e09133..4f9be474280a 100644 --- a/mobile/rpc-foundation/goldens/matrix-linear.select-workspace-picker-linear.selectworkspace-1.json +++ b/mobile/rpc-foundation/goldens/matrix-linear.select-workspace-picker-linear.selectworkspace-1.json @@ -3,7 +3,7 @@ "family": "linear.select-workspace-picker", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b65996c152b632d553a31e07e31ea5c76f998eada42cf0966923d730da21908f", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-1.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-1.json index 74ffddc8b2b8..29589903a21a 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-1.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-1.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-2.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-2.json index 6d72e3913f26..8f6874667e42 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-2.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-2.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-2-1.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-2-1.json index 4017eb86085a..79ffed55a500 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-2-1.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-2-1.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-1.json index 783985104e7e..454bbe310918 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-2.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-2.json index 06af0bb3874f..6ec8daed6edb 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-2.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-2.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-3.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-3.json index df5294fc0338..bba304fd5101 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-3.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-3.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-app-js.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-app-js.json index fe736f7396da..b917722c7984 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-app-js.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-app-js.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-head.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-head.json index c2cbe4c9b80f..79b074049b61 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-head.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-head.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-tail.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-tail.json index 7f0da328ff60..338446476fe1 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-tail.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-tail.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-mobileweb.bundle.manifest-1.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-mobileweb.bundle.manifest-1.json index 129834bd4c18..19d7ac1f8814 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-mobileweb.bundle.manifest-1.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-mobileweb.bundle.manifest-1.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-manifest-mobileweb.bundle.manifest-1.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-manifest-mobileweb.bundle.manifest-1.json index d5d66e9516b4..8f7a243fa737 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-manifest-mobileweb.bundle.manifest-1.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-manifest-mobileweb.bundle.manifest-1.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-manifest", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-1.json index f802878a60a7..8952e42cef8c 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-2.json b/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-2.json index 01042c9b7550..81df706c7cad 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-2.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-2.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.image-upload-clipboard.startimageupload-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.image-upload-clipboard.startimageupload-1.json index 8aad2e65a2a2..fbf47253e12b 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.image-upload-clipboard.startimageupload-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.image-upload-clipboard.startimageupload-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.session-option-pick-settings.mutatenativechatsessionoptions-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.session-option-pick-settings.mutatenativechatsessionoptions-1.json index ea997ee12801..1f713a67286c 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.session-option-pick-settings.mutatenativechatsessionoptions-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.session-option-pick-settings.mutatenativechatsessionoptions-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.session-option-pick", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-orchestration.workerterminaluserinput-1.json index 72033dfd789c..09928edbacaa 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-terminal.send-1.json index e3f8dbb15280..2ad6a4c31683 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.getmissedsince-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.getmissedsince-1.json index 255c3d46378e..08806b12b125 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.getmissedsince-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.getmissedsince-1.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-1.json index 9561cf1c0fd2..2a1c1f9bf052 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-1.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-2.json b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-2.json index bc1ba1fca745..d70c83c9f1be 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-2.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-2.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.unsubscribe-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.unsubscribe-1.json index 580ba532dc6e..8ac93debb4bb 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.unsubscribe-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.unsubscribe-1.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.display-test-screen-notifications.testpush-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.display-test-screen-notifications.testpush-1.json index 9c021bd6b645..0b3f26918a6a 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.display-test-screen-notifications.testpush-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.display-test-screen-notifications.testpush-1.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.push-dismissal-notifications.getmissedsince-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.push-dismissal-notifications.getmissedsince-1.json index a25a4546f4ea..881d94162ed0 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.push-dismissal-notifications.getmissedsince-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.push-dismissal-notifications.getmissedsince-1.json @@ -3,7 +3,7 @@ "family": "notifications.push-dismissal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "595a3eb2994d0596b9fcd0707b175b4e978625053dfbc5c541b0350c0cbfb524", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.registerpush-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.registerpush-1.json index 3cde52720467..58b63cc91697 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.registerpush-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.registerpush-1.json @@ -3,7 +3,7 @@ "family": "notifications.push-registration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2e3d939dc162dbc5a38d8a7207111688204a825fd70348721917b3016e1c9470", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.unregisterpush-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.unregisterpush-1.json index 98b09225b58f..07b3c9a2796a 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.unregisterpush-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.unregisterpush-1.json @@ -3,7 +3,7 @@ "family": "notifications.push-registration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2e3d939dc162dbc5a38d8a7207111688204a825fd70348721917b3016e1c9470", diff --git a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json index 878a7b2dc423..ebe7a717cc02 100644 --- a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json +++ b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.getendpoints-1.json b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.getendpoints-1.json index a66ed6e69f5a..7810e8b15694 100644 --- a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.getendpoints-1.json +++ b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.getendpoints-1.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.provisionrelay-1.json b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.provisionrelay-1.json index b59204614958..44781877b880 100644 --- a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.provisionrelay-1.json +++ b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.provisionrelay-1.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json index 38a4ee6d5f08..e18957b26253 100644 --- a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json +++ b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-project-explicit-false-github.project.updateissuebyslug-1.json b/mobile/rpc-foundation/goldens/matrix-project-explicit-false-github.project.updateissuebyslug-1.json index 46d7585d11fa..69986253a7d3 100644 --- a/mobile/rpc-foundation/goldens/matrix-project-explicit-false-github.project.updateissuebyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-project-explicit-false-github.project.updateissuebyslug-1.json @@ -3,7 +3,7 @@ "family": "project-explicit-false", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-1.json b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-1.json index f1b5b508ccf4..bae589eabc76 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-1.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-2.json b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-2.json index 7698befb4c5a..90602fa2c0ef 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-2.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-2.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.provisionrelay-1.json b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.provisionrelay-1.json index edc674f77efb..bc46128a9c9c 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.provisionrelay-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.provisionrelay-1.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-1.json b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-1.json index 66c4a2477163..19896f3e5d69 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-1.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-2.json b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-2.json index 7bf353e83710..e249286364c6 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-2.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-2.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.provisionrelay-1.json b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.provisionrelay-1.json index a9ac9f36c10a..8450924573e5 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.provisionrelay-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.provisionrelay-1.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.pairing-recovery-pairing.getendpoints-1.json b/mobile/rpc-foundation/goldens/matrix-relay.pairing-recovery-pairing.getendpoints-1.json index c1b44082403d..3aa32fc8d3f6 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.pairing-recovery-pairing.getendpoints-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.pairing-recovery-pairing.getendpoints-1.json @@ -3,7 +3,7 @@ "family": "relay.pairing-recovery", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-session.browser-tab-create-browser.tabcreate-1.json b/mobile/rpc-foundation/goldens/matrix-session.browser-tab-create-browser.tabcreate-1.json index 52aca46c39ad..2dbf9fec5b3f 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.browser-tab-create-browser.tabcreate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.browser-tab-create-browser.tabcreate-1.json @@ -3,7 +3,7 @@ "family": "session.browser-tab-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.content-create-files.createfile-1.json b/mobile/rpc-foundation/goldens/matrix-session.content-create-files.createfile-1.json index ca2bf0d57abc..a5ca54c6d426 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.content-create-files.createfile-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.content-create-files.createfile-1.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.content-create-files.open-1.json b/mobile/rpc-foundation/goldens/matrix-session.content-create-files.open-1.json index b306aff0691c..44de88f38237 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.content-create-files.open-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.content-create-files.open-1.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.content-create-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-session.content-create-status.get-1.json index 6bd3875e6c6b..5cfb4c0388aa 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.content-create-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.content-create-status.get-1.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.content-create-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-session.content-create-worktree.show-1.json index 8b995a39f1d6..8ccbb539e5c3 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.content-create-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.content-create-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.create-terminal-session.tabs.createterminal-1.json b/mobile/rpc-foundation/goldens/matrix-session.create-terminal-session.tabs.createterminal-1.json index 89ea3ff7faf6..fec627b879a7 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.create-terminal-session.tabs.createterminal-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.create-terminal-session.tabs.createterminal-1.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/matrix-session.create-terminal-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.create-terminal-terminal.send-1.json index 66a448071178..298adc1fd190 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.create-terminal-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.create-terminal-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-notes-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-notes-worktree.show-1.json index 50dcddadb557..f79bfbbc9dbd 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-notes-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-notes-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "session.diff-notes", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-actions-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-actions-worktree.set-1.json index 039d20a56622..5b2fe3a57786 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-actions-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-actions-worktree.set-1.json @@ -3,10 +3,10 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "c583058382c949e977b7a1287895ed9ccb8cb408b684aef186b629976ff1da4d", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-base-ref-show.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-base-ref-show.json index 252347370060..8fecc94c5bc1 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-base-ref-show.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-base-ref-show.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.branchcompare-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.branchcompare-1.json index 3e636b0a1db1..a2f96d210d49 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.branchcompare-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.branchcompare-1.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.status-1.json index 377a84d8ec0c..692967ede256 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.status-1.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-repo.list-1.json index ea586be64af1..22dd9acc3692 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-repo.list-1.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-review-show.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-review-show.json index 1058b2aef3a8..742924867bf2 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-review-show.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-review-show.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-files.read-1.json b/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-files.read-1.json index b110bd884a1d..d284eca5984a 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-files.read-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-files.read-1.json @@ -3,7 +3,7 @@ "family": "session.markdown-disk-fallback", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-markdown.readtab-1.json b/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-markdown.readtab-1.json index 91909e865ffd..d070a4045a1d 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-markdown.readtab-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-markdown.readtab-1.json @@ -3,7 +3,7 @@ "family": "session.markdown-disk-fallback", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.markdown-save-markdown.savetab-1.json b/mobile/rpc-foundation/goldens/matrix-session.markdown-save-markdown.savetab-1.json index fb1c7e64b196..edd06be04501 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.markdown-save-markdown.savetab-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.markdown-save-markdown.savetab-1.json @@ -3,7 +3,7 @@ "family": "session.markdown-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.readsession-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.readsession-1.json index 7bcea9f41e34..0c86e7a752c3 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.readsession-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.readsession-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-page", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "60ce67f66134d6385aa7fb47f2135436a7b3ce0221e3b2514bea65e06dba5518", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-1-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-1-1.json index 301135042b25..9145e1b22ca5 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-1-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-1-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-page", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "60ce67f66134d6385aa7fb47f2135436a7b3ce0221e3b2514bea65e06dba5518", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-2-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-2-1.json index 1b63830b2deb..d55f04de28af 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-2-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-2-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-page", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "60ce67f66134d6385aa7fb47f2135436a7b3ce0221e3b2514bea65e06dba5518", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-readability-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-readability-repo.list-1.json index 1f825b99b809..70d62a56811e 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-readability-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-readability-repo.list-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-readability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-orchestration.workerterminaluserinput-1.json index 90bd2675ef3e..c1baafc684e8 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-1.json index a6ab1484dd11..f4be308503af 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-2.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-2.json index be04167eb324..ca1f9ce13dbe 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-2.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-2.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.branchcompare-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.branchcompare-1.json index 35356ae5376f..a51a2d5dd12b 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.branchcompare-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.branchcompare-1.json @@ -3,10 +3,10 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "af78542ad2c449b629f8705b940ec92fd16f879a9bcc81ff6ae3a192f804fa2c", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.status-1.json index 9190412e1683..3cae83bcc9e7 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.status-1.json @@ -3,10 +3,10 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "1e7cad00f4dfcda65a3830b0b2468020816b940611af1b68600de33cd8c1d7c2", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-repo.list-1.json index 4be13a32f11a..16d9172aae1c 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-repo.list-1.json @@ -3,10 +3,10 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "d456ec18056eb9663e99d4991784bd802422256d81ddd7509720814da06915f4", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-worktree.show-1.json index 8e9287ac1da8..8e9c61ff5a79 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-worktree.show-1.json @@ -3,10 +3,10 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "039f26cc90d2239028d6ad1d9ecae9cc976d48f386f2d29fbfa425afc702657d", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prchecks-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prchecks-1.json index c08ed1bbc216..db4488562903 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prchecks-1.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prforbranch-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prforbranch-1.json index d10ae826214f..37076b4d27b1 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prforbranch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prforbranch-1.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-hostedreview.forbranch-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-hostedreview.forbranch-1.json index a77e3f98f5a5..a8e8b1fda9a9 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-hostedreview.forbranch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-hostedreview.forbranch-1.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-worktree.show-1.json index 79217dcc90d2..096afff3ad43 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-agent.launchreplay-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-agent.launchreplay-1.json new file mode 100644 index 000000000000..d8c4acda08a8 --- /dev/null +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-agent.launchreplay-1.json @@ -0,0 +1,952 @@ +{ + "operation": "session.pr-triage-launch", + "family": "session.pr-triage", + "namedDeltas": [], + "runnerVersion": 1, + "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", + "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", + "scenarioSha256": "ce91b60bc94d61ac67714621cb88c1db62b51f1a6638325b985472eadfcca16b", + "platform": "darwin", + "scenarioVersion": 1, + "projectionVersion": 2, + "goldenFormatVersion": 5, + "values": { + "02188f091419": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-2", + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] + } + } + } + } + }, + "1c2564f1daca": { + "name": "settings.get#1", + "ordinal": 4, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"settings.get\"}" + }, + "28339abecf78": { + "name": "agent.launchReplay#1", + "ordinal": 8, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000001\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:repo-9::/w\"},\"prompt\":{\"text\":\"Fix the failing checks\",\"delivery\":\"submit\"},\"launchSource\":\"task_page\"}}" + }, + "331b3596787f": { + "launched": { + "kind": "not-started", + "message": "outer refused" + } + }, + "35f85fe3b71c": { + "name": "repo.list#1", + "ordinal": 1, + "args": [ + { + "name": "method", + "value": "repo.list" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, + "3b9fb3dfed63": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "transport failure", + "isRpcDeliveryUnknown": true + } + } + }, + "3e6a0417d2ee": { + "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": [ + { + "id": "repo-9" + } + ] + } + } + } + }, + "4a304acaf84f": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "refused", + "message": "" + }, + "id": "frame-4", + "ok": false + } + } + }, + "51d4cb56be85": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, + "5b817dac4c7d": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "error": "inner refused", + "ok": false + } + } + } + }, + "675c01bc8b85": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "", + "isRpcDeliveryUnknown": true + } + } + }, + "6d9b52e88b73": { + "launched": { + "kind": "not-started", + "message": "Couldn't start the agent." + } + }, + "7cdbda15d605": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "error": { + "message": "inner refused" + }, + "ok": false + } + } + } + }, + "8638ab90602a": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true + } + } + }, + "9270aeb7d9c6": { + "status": "pending", + "startedAt": 0 + }, + "9c16efc31903": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": ["codex"] + } + } + }, + "a4273b38df83": { + "launched": "unlaunched" + }, + "a8f475e8a3a8": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "refused", + "message": "outer refused" + }, + "id": "frame-4", + "ok": false + } + } + }, + "ab12d545c466": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "error": "refused" + } + } + } + }, + "b613a82cee3d": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "method_not_found", + "message": "Unknown method" + }, + "id": "frame-4", + "ok": false + } + } + }, + "b81eb9edc2b2": { + "name": "agent.launchReplay#2", + "ordinal": 9, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, + "ba3fac1eb199": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "outcome": { + "handle": "term-1", + "kind": "terminal" + }, + "prompt": { + "delivery": "submit", + "outcome": "handed-to-terminal" + }, + "receipt": { + "detail": "Started a terminal agent, the default for new agent tabs in your settings.", + "mode": "terminal", + "preferred": "terminal", + "reason": "user_default" + }, + "worktreeId": "repo-9::/w" + } + } + } + }, + "c2a44248892e": { + "launched": { + "kind": "not-started", + "message": "Update Orca on your computer to start an agent from your phone." + } + }, + "c39600966772": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "$rpc": "null" + } + } + } + }, + "dca101029f70": { + "name": "agent.launchReplay#2", + "ordinal": 10, + "json": "{\"id\":\"frame-5\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000001\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:repo-9::/w\"},\"prompt\":{\"text\":\"Fix the failing checks\",\"delivery\":\"submit\"},\"launchSource\":\"task_page\"}}" + }, + "e0eef7c9fafe": { + "name": "repo.list#1", + "ordinal": 3, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}" + }, + "eaa398d8c3aa": { + "launched": { + "kind": "unconfirmed", + "message": "Couldn't confirm the agent started. Check the workspace before trying again." + } + }, + "eb79a9b3682a": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "$rpc": "undefined" + } + }, + "eb8d47f90956": { + "launched": { + "kind": "sent" + } + }, + "f49d184679d1": { + "name": "preflight.detectAgents#1", + "ordinal": 6, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectAgents\"}" + } + }, + "recording": { + "scenario": "matrix-session.pr-triage-agent.launchreplay-1", + "checkpoints": [ + { + "id": "pr-triage-launch.prelude:pending", + "observation": { + "sender": ["35f85fe3b71c", "51d4cb56be85"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], + "settlements": { + "launch": "9270aeb7d9c6" + }, + "state": "a4273b38df83", + "effects": [] + } + }, + { + "id": "pr-triage-launch.normal:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "ba3fac1eb199"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "eb8d47f90956", + "effects": [] + } + }, + { + "id": "pr-triage-launch.result-absent:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "8638ab90602a"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "eaa398d8c3aa", + "effects": [] + } + }, + { + "id": "pr-triage-launch.result-null:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "c39600966772"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "eaa398d8c3aa", + "effects": [] + } + }, + { + "id": "pr-triage-launch.inner-ok-missing:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "ab12d545c466"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "eaa398d8c3aa", + "effects": [] + } + }, + { + "id": "pr-triage-launch.inner-false-string-error:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "5b817dac4c7d"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "eaa398d8c3aa", + "effects": [] + } + }, + { + "id": "pr-triage-launch.inner-false-object-error:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "7cdbda15d605"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "eaa398d8c3aa", + "effects": [] + } + }, + { + "id": "pr-triage-launch.outer-refused:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "a8f475e8a3a8"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "331b3596787f", + "effects": [] + } + }, + { + "id": "pr-triage-launch.outer-refused-no-message:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "4a304acaf84f"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "6d9b52e88b73", + "effects": [] + } + }, + { + "id": "pr-triage-launch.method-not-found:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "b613a82cee3d"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "c2a44248892e", + "effects": [] + } + }, + { + "id": "pr-triage-launch.transport-rejection:launched", + "observation": { + "sender": [ + "3e6a0417d2ee", + "02188f091419", + "9c16efc31903", + "3b9fb3dfed63", + "b81eb9edc2b2" + ], + "payloads": [ + "e0eef7c9fafe", + "1c2564f1daca", + "f49d184679d1", + "28339abecf78", + "dca101029f70" + ], + "settlements": { + "launch": "9270aeb7d9c6" + }, + "state": "a4273b38df83", + "effects": [] + } + }, + { + "id": "pr-triage-launch.transport-rejection-no-message:launched", + "observation": { + "sender": [ + "3e6a0417d2ee", + "02188f091419", + "9c16efc31903", + "675c01bc8b85", + "b81eb9edc2b2" + ], + "payloads": [ + "e0eef7c9fafe", + "1c2564f1daca", + "f49d184679d1", + "28339abecf78", + "dca101029f70" + ], + "settlements": { + "launch": "9270aeb7d9c6" + }, + "state": "a4273b38df83", + "effects": [] + } + } + ] + } +} diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-preflight.detectagents-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-preflight.detectagents-1.json new file mode 100644 index 000000000000..49674829a77b --- /dev/null +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-preflight.detectagents-1.json @@ -0,0 +1,793 @@ +{ + "operation": "session.pr-triage-launch", + "family": "session.pr-triage", + "namedDeltas": [], + "runnerVersion": 1, + "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", + "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", + "scenarioSha256": "53a83cb160e90a8be808d9f0bb31826e355d43dd1e42fa6cccf7ca5398b8b579", + "platform": "darwin", + "scenarioVersion": 1, + "projectionVersion": 2, + "goldenFormatVersion": 5, + "values": { + "02188f091419": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-2", + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] + } + } + } + } + }, + "0220267a7bca": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "method_not_found", + "message": "Unknown method" + }, + "id": "frame-3", + "ok": false + } + } + }, + "084fe2afb0ce": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "error": "refused" + } + } + } + }, + "1963ee2edae9": { + "launched": { + "kind": "not-started", + "message": "Unknown method" + } + }, + "1c2564f1daca": { + "name": "settings.get#1", + "ordinal": 4, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"settings.get\"}" + }, + "28339abecf78": { + "name": "agent.launchReplay#1", + "ordinal": 8, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000001\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:repo-9::/w\"},\"prompt\":{\"text\":\"Fix the failing checks\",\"delivery\":\"submit\"},\"launchSource\":\"task_page\"}}" + }, + "331b3596787f": { + "launched": { + "kind": "not-started", + "message": "outer refused" + } + }, + "35f85fe3b71c": { + "name": "repo.list#1", + "ordinal": 1, + "args": [ + { + "name": "method", + "value": "repo.list" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, + "3e6a0417d2ee": { + "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": [ + { + "id": "repo-9" + } + ] + } + } + } + }, + "4dd9713de1b0": { + "launched": { + "kind": "not-started", + "message": "The host sent a reply this app could not read (preflight.detectAgents)" + } + }, + "51d4cb56be85": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, + "570f5efcd445": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "refused", + "message": "outer refused" + }, + "id": "frame-3", + "ok": false + } + } + }, + "57f451cceda3": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "", + "isRpcDeliveryUnknown": true + } + } + }, + "585dfba86809": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true + } + } + }, + "6dd8724be3b1": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "$rpc": "null" + } + } + } + }, + "9270aeb7d9c6": { + "status": "pending", + "startedAt": 0 + }, + "9c16efc31903": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": ["codex"] + } + } + }, + "a4273b38df83": { + "launched": "unlaunched" + }, + "a9705081551e": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "error": { + "message": "inner refused" + }, + "ok": false + } + } + } + }, + "ac08a3ca5c67": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "error": "inner refused", + "ok": false + } + } + } + }, + "b13ddf18a62e": { + "launched": { + "kind": "not-started", + "message": "Could not load the available agents." + } + }, + "ba3fac1eb199": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "outcome": { + "handle": "term-1", + "kind": "terminal" + }, + "prompt": { + "delivery": "submit", + "outcome": "handed-to-terminal" + }, + "receipt": { + "detail": "Started a terminal agent, the default for new agent tabs in your settings.", + "mode": "terminal", + "preferred": "terminal", + "reason": "user_default" + }, + "worktreeId": "repo-9::/w" + } + } + } + }, + "e0eef7c9fafe": { + "name": "repo.list#1", + "ordinal": 3, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}" + }, + "e1b544c0b6ec": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "transport failure", + "isRpcDeliveryUnknown": true + } + } + }, + "e35d7003f64c": { + "launched": { + "kind": "not-started", + "message": "transport failure" + } + }, + "eb79a9b3682a": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "$rpc": "undefined" + } + }, + "eb8d47f90956": { + "launched": { + "kind": "sent" + } + }, + "efd2ac432554": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "refused", + "message": "" + }, + "id": "frame-3", + "ok": false + } + } + }, + "f49d184679d1": { + "name": "preflight.detectAgents#1", + "ordinal": 6, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectAgents\"}" + } + }, + "recording": { + "scenario": "matrix-session.pr-triage-preflight.detectagents-1", + "checkpoints": [ + { + "id": "pr-triage-launch.prelude:pending", + "observation": { + "sender": ["35f85fe3b71c", "51d4cb56be85"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], + "settlements": { + "launch": "9270aeb7d9c6" + }, + "state": "a4273b38df83", + "effects": [] + } + }, + { + "id": "pr-triage-launch.normal:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "ba3fac1eb199"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "eb8d47f90956", + "effects": [] + } + }, + { + "id": "pr-triage-launch.result-absent:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "585dfba86809"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "4dd9713de1b0", + "effects": [] + } + }, + { + "id": "pr-triage-launch.result-null:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "6dd8724be3b1"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "4dd9713de1b0", + "effects": [] + } + }, + { + "id": "pr-triage-launch.inner-ok-missing:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "084fe2afb0ce"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "4dd9713de1b0", + "effects": [] + } + }, + { + "id": "pr-triage-launch.inner-false-string-error:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "ac08a3ca5c67"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "4dd9713de1b0", + "effects": [] + } + }, + { + "id": "pr-triage-launch.inner-false-object-error:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "a9705081551e"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "4dd9713de1b0", + "effects": [] + } + }, + { + "id": "pr-triage-launch.outer-refused:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "570f5efcd445"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "331b3596787f", + "effects": [] + } + }, + { + "id": "pr-triage-launch.outer-refused-no-message:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "efd2ac432554"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "b13ddf18a62e", + "effects": [] + } + }, + { + "id": "pr-triage-launch.method-not-found:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "0220267a7bca"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "1963ee2edae9", + "effects": [] + } + }, + { + "id": "pr-triage-launch.transport-rejection:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "e1b544c0b6ec"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "e35d7003f64c", + "effects": [] + } + }, + { + "id": "pr-triage-launch.transport-rejection-no-message:launched", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "57f451cceda3"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "b13ddf18a62e", + "effects": [] + } + } + ] + } +} diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-session.tabs.createterminal-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-repo.list-1.json similarity index 55% rename from mobile/rpc-foundation/goldens/matrix-session.pr-triage-session.tabs.createterminal-1.json rename to mobile/rpc-foundation/goldens/matrix-session.pr-triage-repo.list-1.json index 02ec381a2681..e509c2f8eacb 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-session.tabs.createterminal-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-repo.list-1.json @@ -3,56 +3,34 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", - "scenarioSha256": "0d06d27000a8f6ad66480a16c7b84e8464f4b6e1d775326aeae005926e134cb4", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", + "scenarioSha256": "c9030f183de2c5e86c2ccdfd9d4527d6f2ed71855501ff061620cef2681c6b82", "platform": "darwin", "scenarioVersion": 1, "projectionVersion": 2, "goldenFormatVersion": 5, "values": { - "280ce0d6f832": { - "name": "terminal.send#1", - "ordinal": 4, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"terminal.send\",\"params\":{\"terminal\":\"term-1\",\"text\":\"Fix the failing checks\",\"enter\":true}}" - }, - "30ec57518c05": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Failed to create terminal", - "isRpcDeliveryUnknown": false + "01fc75db313f": { + "launched": { + "kind": "not-started", + "message": "The host sent a reply this app could not read (repo.list)" } }, - "32a7c0ae7918": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "outer refused", - "isRpcDeliveryUnknown": false - } - }, - "3f739faafdd4": { - "name": "session.tabs.createTerminal#1", - "ordinal": 1, + "02188f091419": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "settings.get" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -67,39 +45,29 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-1", + "id": "frame-2", "ok": true, "result": { - "$rpc": "null" + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] + } } } } }, - "478ad4afe83e": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "The host sent a reply this app could not read (session.tabs.createTerminal)", - "isRpcDeliveryUnknown": false - } - }, - "5093e98ba369": { - "name": "session.tabs.createTerminal#1", + "12e70439f294": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -114,34 +82,65 @@ "startedAt": 0, "settledAt": 0, "value": { + "error": { + "code": "method_not_found", + "message": "Unknown method" + }, "id": "frame-1", - "ok": true, - "result": { - "tab": { - "id": "tab-1", - "terminal": "term-1", - "title": "Agent", - "type": "terminal" - } + "ok": false + } + } + }, + "1321b4c8c0b8": { + "name": "repo.list#1", + "ordinal": 1, + "args": [ + { + "name": "method", + "value": "repo.list" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" } } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "", + "isRpcDeliveryUnknown": true + } + } + }, + "1963ee2edae9": { + "launched": { + "kind": "not-started", + "message": "Unknown method" } }, - "5422be2c33b6": { - "name": "session.tabs.createTerminal#1", + "1b23dab83fcf": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -159,27 +158,39 @@ "id": "frame-1", "ok": true, "result": { - "error": "inner refused", - "ok": false + "error": "refused" } } } }, - "6bf6a76b4bf4": { - "name": "session.tabs.createTerminal#1", + "1c2564f1daca": { + "name": "settings.get#1", + "ordinal": 4, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"settings.get\"}" + }, + "28339abecf78": { + "name": "agent.launchReplay#1", + "ordinal": 8, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000001\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:repo-9::/w\"},\"prompt\":{\"text\":\"Fix the failing checks\",\"delivery\":\"submit\"},\"launchSource\":\"task_page\"}}" + }, + "331b3596787f": { + "launched": { + "kind": "not-started", + "message": "outer refused" + } + }, + "35f85fe3b71c": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -190,31 +201,22 @@ } ], "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "", - "isRpcDeliveryUnknown": true - } + "status": "pending", + "startedAt": 0 } }, - "72295d1a7229": { - "name": "session.tabs.createTerminal#1", + "3e6a0417d2ee": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -232,26 +234,27 @@ "id": "frame-1", "ok": true, "result": { - "error": "refused" + "repos": [ + { + "id": "repo-9" + } + ] } } } }, - "76bc1a917546": { - "name": "session.tabs.createTerminal#1", + "48c68906a98a": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -262,43 +265,56 @@ } ], "settlement": { - "status": "rejected", + "status": "fulfilled", "startedAt": 0, "settledAt": 0, - "error": { - "category": "Error", - "message": "transport failure", - "isRpcDeliveryUnknown": true + "value": { + "id": "frame-1", + "ok": true, + "result": { + "$rpc": "null" + } } } }, - "9270aeb7d9c6": { - "status": "pending", - "startedAt": 0 - }, - "94d38f1838f6": { - "name": "session.tabs.createTerminal#1", + "51d4cb56be85": { + "name": "settings.get#1", "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}" - }, - "a4273b38df83": { - "launched": "unlaunched" + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } }, - "a46a4a08b27d": { - "name": "session.tabs.createTerminal#1", + "624ec4e5082c": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -314,39 +330,26 @@ "settledAt": 0, "value": { "error": { - "code": "method_not_found", - "message": "Unknown method" + "code": "refused", + "message": "outer refused" }, "id": "frame-1", "ok": false } } }, - "a947768bc0ed": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "transport failure", - "isRpcDeliveryUnknown": true - } - }, - "ae5875338dfe": { - "name": "session.tabs.createTerminal#1", + "747c556da67a": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -361,50 +364,23 @@ "startedAt": 0, "settledAt": 0, "value": { - "error": { - "code": "refused", - "message": "" - }, "id": "frame-1", - "ok": false + "ok": true } } }, - "b948e8307e81": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Unknown method", - "isRpcDeliveryUnknown": false - } - }, - "c7584e82c72f": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "", - "isRpcDeliveryUnknown": true - } - }, - "dea9ae4cf53d": { - "name": "session.tabs.createTerminal#1", + "8a72d3d14d44": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -419,30 +395,31 @@ "startedAt": 0, "settledAt": 0, "value": { - "error": { - "code": "refused", - "message": "outer refused" - }, "id": "frame-1", - "ok": false + "ok": true, + "result": { + "error": "inner refused", + "ok": false + } } } }, - "e3995d24a794": { - "name": "session.tabs.createTerminal#1", - "ordinal": 1, + "9270aeb7d9c6": { + "status": "pending", + "startedAt": 0 + }, + "9c16efc31903": { + "name": "preflight.detectAgents#1", + "ordinal": 5, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "preflight.detectAgents" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -457,63 +434,91 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-1", - "ok": true + "id": "frame-3", + "ok": true, + "result": ["codex"] } } }, - "eb79a9b3682a": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "$rpc": "undefined" + "a4273b38df83": { + "launched": "unlaunched" + }, + "b13ddf18a62e": { + "launched": { + "kind": "not-started", + "message": "Could not load the available agents." } }, - "f9b284ac2424": { - "name": "session.tabs.createTerminal#1", - "ordinal": 1, + "ba3fac1eb199": { + "name": "agent.launchReplay#1", + "ordinal": 7, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "agent.launchReplay" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } } }, { "name": "options", "value": { - "$rpc": "absent" + "timeoutMs": 90000 } } ], "settlement": { - "status": "pending", - "startedAt": 0 + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "outcome": { + "handle": "term-1", + "kind": "terminal" + }, + "prompt": { + "delivery": "submit", + "outcome": "handed-to-terminal" + }, + "receipt": { + "detail": "Started a terminal agent, the default for new agent tabs in your settings.", + "mode": "terminal", + "preferred": "terminal", + "reason": "user_default" + }, + "worktreeId": "repo-9::/w" + } + } } }, - "fbddf84c2257": { - "name": "session.tabs.createTerminal#1", + "d68475063b62": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -539,23 +544,74 @@ } } }, - "fe1fe746e77a": { - "launched": "sent" + "dae756300589": { + "name": "repo.list#1", + "ordinal": 1, + "args": [ + { + "name": "method", + "value": "repo.list" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "transport failure", + "isRpcDeliveryUnknown": true + } + } }, - "fe53d3bce307": { - "name": "terminal.send#1", + "e0eef7c9fafe": { + "name": "repo.list#1", "ordinal": 3, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}" + }, + "e35d7003f64c": { + "launched": { + "kind": "not-started", + "message": "transport failure" + } + }, + "eb79a9b3682a": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "$rpc": "undefined" + } + }, + "eb8d47f90956": { + "launched": { + "kind": "sent" + } + }, + "f1d579dd459c": { + "name": "repo.list#1", + "ordinal": 1, "args": [ { "name": "method", - "value": "terminal.send" + "value": "repo.list" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -570,25 +626,29 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-2", - "ok": true, - "result": { - "send": { - "accepted": true - } - } + "error": { + "code": "refused", + "message": "" + }, + "id": "frame-1", + "ok": false } } + }, + "f49d184679d1": { + "name": "preflight.detectAgents#1", + "ordinal": 6, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectAgents\"}" } }, "recording": { - "scenario": "matrix-session.pr-triage-session.tabs.createterminal-1", + "scenario": "matrix-session.pr-triage-repo.list-1", "checkpoints": [ { "id": "pr-triage-launch.prelude:pending", "observation": { - "sender": ["f9b284ac2424"], - "payloads": ["94d38f1838f6"], + "sender": ["35f85fe3b71c", "51d4cb56be85"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { "launch": "9270aeb7d9c6" }, @@ -599,132 +659,132 @@ { "id": "pr-triage-launch.normal:launched", "observation": { - "sender": ["5093e98ba369", "fe53d3bce307"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "ba3fac1eb199"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], "settlements": { "launch": "eb79a9b3682a" }, - "state": "fe1fe746e77a", + "state": "eb8d47f90956", "effects": [] } }, { "id": "pr-triage-launch.result-absent:launched", "observation": { - "sender": ["e3995d24a794"], - "payloads": ["94d38f1838f6"], + "sender": ["747c556da67a", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "478ad4afe83e" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "01fc75db313f", "effects": [] } }, { "id": "pr-triage-launch.result-null:launched", "observation": { - "sender": ["3f739faafdd4"], - "payloads": ["94d38f1838f6"], + "sender": ["48c68906a98a", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "478ad4afe83e" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "01fc75db313f", "effects": [] } }, { "id": "pr-triage-launch.inner-ok-missing:launched", "observation": { - "sender": ["72295d1a7229"], - "payloads": ["94d38f1838f6"], + "sender": ["1b23dab83fcf", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "478ad4afe83e" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "01fc75db313f", "effects": [] } }, { "id": "pr-triage-launch.inner-false-string-error:launched", "observation": { - "sender": ["5422be2c33b6"], - "payloads": ["94d38f1838f6"], + "sender": ["8a72d3d14d44", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "478ad4afe83e" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "01fc75db313f", "effects": [] } }, { "id": "pr-triage-launch.inner-false-object-error:launched", "observation": { - "sender": ["fbddf84c2257"], - "payloads": ["94d38f1838f6"], + "sender": ["d68475063b62", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "478ad4afe83e" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "01fc75db313f", "effects": [] } }, { "id": "pr-triage-launch.outer-refused:launched", "observation": { - "sender": ["dea9ae4cf53d"], - "payloads": ["94d38f1838f6"], + "sender": ["624ec4e5082c", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "32a7c0ae7918" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "331b3596787f", "effects": [] } }, { "id": "pr-triage-launch.outer-refused-no-message:launched", "observation": { - "sender": ["ae5875338dfe"], - "payloads": ["94d38f1838f6"], + "sender": ["f1d579dd459c", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "30ec57518c05" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "b13ddf18a62e", "effects": [] } }, { "id": "pr-triage-launch.method-not-found:launched", "observation": { - "sender": ["a46a4a08b27d"], - "payloads": ["94d38f1838f6"], + "sender": ["12e70439f294", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "b948e8307e81" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "1963ee2edae9", "effects": [] } }, { "id": "pr-triage-launch.transport-rejection:launched", "observation": { - "sender": ["76bc1a917546"], - "payloads": ["94d38f1838f6"], + "sender": ["dae756300589", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "a947768bc0ed" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "e35d7003f64c", "effects": [] } }, { "id": "pr-triage-launch.transport-rejection-no-message:launched", "observation": { - "sender": ["6bf6a76b4bf4"], - "payloads": ["94d38f1838f6"], + "sender": ["1321b4c8c0b8", "02188f091419"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { - "launch": "c7584e82c72f" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "b13ddf18a62e", "effects": [] } } diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-settings.get-1.json similarity index 53% rename from mobile/rpc-foundation/goldens/matrix-session.pr-triage-terminal.send-1.json rename to mobile/rpc-foundation/goldens/matrix-session.pr-triage-settings.get-1.json index 742a1fd1da60..5aa2ac949f8d 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-settings.get-1.json @@ -3,30 +3,65 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", - "scenarioSha256": "a288e105a0af6dbbd9657b84f7c4860826184fb7f50dabc6e31b114a70d7ca44", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", + "scenarioSha256": "39923c0faa941865cc9aead881fef91ce5db117120033fe73665356a61a2ecc6", "platform": "darwin", "scenarioVersion": 1, "projectionVersion": 2, "goldenFormatVersion": 5, "values": { - "0fddcb81d17c": { - "name": "terminal.send#1", - "ordinal": 3, + "02188f091419": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-2", + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] + } + } + } + } + }, + "0ba58e9fadf7": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "terminal.send" + "value": "settings.get" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -42,54 +77,69 @@ "settledAt": 0, "value": { "error": { - "code": "refused", - "message": "outer refused" + "code": "method_not_found", + "message": "Unknown method" }, "id": "frame-2", "ok": false } } }, - "1953443d1eef": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "The host sent a reply this app could not read (terminal.send)", - "isRpcDeliveryUnknown": false + "0ca529648be4": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "", + "isRpcDeliveryUnknown": true + } } }, - "280ce0d6f832": { - "name": "terminal.send#1", - "ordinal": 4, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"terminal.send\",\"params\":{\"terminal\":\"term-1\",\"text\":\"Fix the failing checks\",\"enter\":true}}" - }, - "32a7c0ae7918": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "outer refused", - "isRpcDeliveryUnknown": false + "1963ee2edae9": { + "launched": { + "kind": "not-started", + "message": "Unknown method" } }, - "5093e98ba369": { - "name": "session.tabs.createTerminal#1", - "ordinal": 1, + "1c2564f1daca": { + "name": "settings.get#1", + "ordinal": 4, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"settings.get\"}" + }, + "1c5359ea3f7d": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "settings.get" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -104,33 +154,40 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-1", + "id": "frame-2", "ok": true, "result": { - "tab": { - "id": "tab-1", - "terminal": "term-1", - "title": "Agent", - "type": "terminal" - } + "error": { + "message": "inner refused" + }, + "ok": false } } } }, - "5101a111b6fc": { - "name": "terminal.send#1", - "ordinal": 3, + "28339abecf78": { + "name": "agent.launchReplay#1", + "ordinal": 8, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000001\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:repo-9::/w\"},\"prompt\":{\"text\":\"Fix the failing checks\",\"delivery\":\"submit\"},\"launchSource\":\"task_page\"}}" + }, + "331b3596787f": { + "launched": { + "kind": "not-started", + "message": "outer refused" + } + }, + "34f3a5b8bd78": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "terminal.send" + "value": "settings.get" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -145,25 +202,53 @@ "startedAt": 0, "settledAt": 0, "value": { + "error": { + "code": "refused", + "message": "" + }, "id": "frame-2", - "ok": true + "ok": false } } }, - "52f741886b88": { - "name": "terminal.send#1", - "ordinal": 3, + "35f85fe3b71c": { + "name": "repo.list#1", + "ordinal": 1, + "args": [ + { + "name": "method", + "value": "repo.list" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, + "3e6a0417d2ee": { + "name": "repo.list#1", + "ordinal": 1, "args": [ { "name": "method", - "value": "terminal.send" + "value": "repo.list" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -178,28 +263,56 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-2", + "id": "frame-1", "ok": true, "result": { - "error": "refused" + "repos": [ + { + "id": "repo-9" + } + ] } } } }, - "6ccc8bb71fd9": { - "name": "terminal.send#1", - "ordinal": 3, + "51d4cb56be85": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "terminal.send" + "value": "settings.get" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, + "566d8202b582": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" } }, { @@ -220,20 +333,18 @@ } } }, - "75252c821440": { - "name": "terminal.send#1", - "ordinal": 3, + "69518e60477b": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "terminal.send" + "value": "settings.get" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -256,29 +367,24 @@ } } }, - "9270aeb7d9c6": { - "status": "pending", - "startedAt": 0 + "753cc167886c": { + "launched": { + "kind": "not-started", + "message": "Cannot read properties of null (reading 'settings')" + } }, - "94d38f1838f6": { - "name": "session.tabs.createTerminal#1", + "86798e4821d1": { + "name": "settings.get#1", "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}" - }, - "94fd7b6e1923": { - "name": "terminal.send#1", - "ordinal": 3, "args": [ { "name": "method", - "value": "terminal.send" + "value": "settings.get" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -289,30 +395,35 @@ } ], "settlement": { - "status": "rejected", + "status": "fulfilled", "startedAt": 0, "settledAt": 0, - "error": { - "category": "Error", - "message": "", - "isRpcDeliveryUnknown": true + "value": { + "id": "frame-2", + "ok": true, + "result": { + "error": "inner refused", + "ok": false + } } } }, - "9d6948ff3085": { - "name": "terminal.send#1", - "ordinal": 3, + "9270aeb7d9c6": { + "status": "pending", + "startedAt": 0 + }, + "98bd3a5fda2b": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "terminal.send" + "value": "settings.get" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -327,42 +438,29 @@ "startedAt": 0, "settledAt": 0, "value": { - "error": { - "code": "method_not_found", - "message": "Unknown method" - }, "id": "frame-2", - "ok": false + "ok": true } } }, - "a21f478354cc": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Failed to send prompt", - "isRpcDeliveryUnknown": false + "9b538e8b95f3": { + "launched": { + "kind": "not-started", + "message": "Cannot read properties of undefined (reading 'settings')" } }, - "a4273b38df83": { - "launched": "unlaunched" - }, - "a89e0dd4a790": { - "name": "terminal.send#1", - "ordinal": 3, + "9c16efc31903": { + "name": "preflight.detectAgents#1", + "ordinal": 5, "args": [ { "name": "method", - "value": "terminal.send" + "value": "preflight.detectAgents" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -377,55 +475,49 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-2", + "id": "frame-3", "ok": true, - "result": { - "error": "inner refused", - "ok": false - } + "result": ["codex"] } } }, - "a947768bc0ed": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "transport failure", - "isRpcDeliveryUnknown": true - } + "a4273b38df83": { + "launched": "unlaunched" }, - "b948e8307e81": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Unknown method", - "isRpcDeliveryUnknown": false + "b13ddf18a62e": { + "launched": { + "kind": "not-started", + "message": "Could not load the available agents." } }, - "bccc77511918": { - "name": "terminal.send#1", - "ordinal": 3, + "ba3fac1eb199": { + "name": "agent.launchReplay#1", + "ordinal": 7, "args": [ { "name": "method", - "value": "terminal.send" + "value": "agent.launchReplay" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } } }, { "name": "options", "value": { - "$rpc": "absent" + "timeoutMs": 90000 } } ], @@ -434,31 +526,40 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-2", + "id": "frame-4", "ok": true, "result": { - "error": { - "message": "inner refused" + "outcome": { + "handle": "term-1", + "kind": "terminal" }, - "ok": false + "prompt": { + "delivery": "submit", + "outcome": "handed-to-terminal" + }, + "receipt": { + "detail": "Started a terminal agent, the default for new agent tabs in your settings.", + "mode": "terminal", + "preferred": "terminal", + "reason": "user_default" + }, + "worktreeId": "repo-9::/w" } } } }, - "bf156998a035": { - "name": "terminal.send#1", - "ordinal": 3, + "ceb5fe72c101": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "terminal.send" + "value": "settings.get" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -475,21 +576,22 @@ "value": { "error": { "code": "refused", - "message": "" + "message": "outer refused" }, "id": "frame-2", "ok": false } } }, - "c7584e82c72f": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "", - "isRpcDeliveryUnknown": true + "e0eef7c9fafe": { + "name": "repo.list#1", + "ordinal": 3, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}" + }, + "e35d7003f64c": { + "launched": { + "kind": "not-started", + "message": "transport failure" } }, "eb79a9b3682a": { @@ -500,52 +602,28 @@ "$rpc": "undefined" } }, - "f9b284ac2424": { - "name": "session.tabs.createTerminal#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "session.tabs.createTerminal" - }, - { - "name": "params", - "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 + "eb8d47f90956": { + "launched": { + "kind": "sent" } }, - "fe1fe746e77a": { - "launched": "sent" + "f49d184679d1": { + "name": "preflight.detectAgents#1", + "ordinal": 6, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectAgents\"}" }, - "fe53d3bce307": { - "name": "terminal.send#1", - "ordinal": 3, + "fb9f08890f70": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "terminal.send" + "value": "settings.get" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -563,22 +641,20 @@ "id": "frame-2", "ok": true, "result": { - "send": { - "accepted": true - } + "error": "refused" } } } } }, "recording": { - "scenario": "matrix-session.pr-triage-terminal.send-1", + "scenario": "matrix-session.pr-triage-settings.get-1", "checkpoints": [ { "id": "pr-triage-launch.prelude:pending", "observation": { - "sender": ["f9b284ac2424"], - "payloads": ["94d38f1838f6"], + "sender": ["35f85fe3b71c", "51d4cb56be85"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { "launch": "9270aeb7d9c6" }, @@ -589,132 +665,132 @@ { "id": "pr-triage-launch.normal:launched", "observation": { - "sender": ["5093e98ba369", "fe53d3bce307"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "ba3fac1eb199"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], "settlements": { "launch": "eb79a9b3682a" }, - "state": "fe1fe746e77a", + "state": "eb8d47f90956", "effects": [] } }, { "id": "pr-triage-launch.result-absent:launched", "observation": { - "sender": ["5093e98ba369", "5101a111b6fc"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "98bd3a5fda2b", "9c16efc31903"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], "settlements": { - "launch": "1953443d1eef" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "9b538e8b95f3", "effects": [] } }, { "id": "pr-triage-launch.result-null:launched", "observation": { - "sender": ["5093e98ba369", "75252c821440"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "69518e60477b", "9c16efc31903"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], "settlements": { - "launch": "1953443d1eef" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "753cc167886c", "effects": [] } }, { "id": "pr-triage-launch.inner-ok-missing:launched", "observation": { - "sender": ["5093e98ba369", "52f741886b88"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "fb9f08890f70", "9c16efc31903", "ba3fac1eb199"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], "settlements": { "launch": "eb79a9b3682a" }, - "state": "fe1fe746e77a", + "state": "eb8d47f90956", "effects": [] } }, { "id": "pr-triage-launch.inner-false-string-error:launched", "observation": { - "sender": ["5093e98ba369", "a89e0dd4a790"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "86798e4821d1", "9c16efc31903", "ba3fac1eb199"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], "settlements": { "launch": "eb79a9b3682a" }, - "state": "fe1fe746e77a", + "state": "eb8d47f90956", "effects": [] } }, { "id": "pr-triage-launch.inner-false-object-error:launched", "observation": { - "sender": ["5093e98ba369", "bccc77511918"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "1c5359ea3f7d", "9c16efc31903", "ba3fac1eb199"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], "settlements": { "launch": "eb79a9b3682a" }, - "state": "fe1fe746e77a", + "state": "eb8d47f90956", "effects": [] } }, { "id": "pr-triage-launch.outer-refused:launched", "observation": { - "sender": ["5093e98ba369", "0fddcb81d17c"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "ceb5fe72c101", "9c16efc31903"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], "settlements": { - "launch": "32a7c0ae7918" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "331b3596787f", "effects": [] } }, { "id": "pr-triage-launch.outer-refused-no-message:launched", "observation": { - "sender": ["5093e98ba369", "bf156998a035"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "34f3a5b8bd78", "9c16efc31903"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], "settlements": { - "launch": "a21f478354cc" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "b13ddf18a62e", "effects": [] } }, { "id": "pr-triage-launch.method-not-found:launched", "observation": { - "sender": ["5093e98ba369", "9d6948ff3085"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "0ba58e9fadf7", "9c16efc31903"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], "settlements": { - "launch": "b948e8307e81" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "1963ee2edae9", "effects": [] } }, { "id": "pr-triage-launch.transport-rejection:launched", "observation": { - "sender": ["5093e98ba369", "6ccc8bb71fd9"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "566d8202b582", "9c16efc31903"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], "settlements": { - "launch": "a947768bc0ed" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "e35d7003f64c", "effects": [] } }, { "id": "pr-triage-launch.transport-rejection-no-message:launched", "observation": { - "sender": ["5093e98ba369", "94fd7b6e1923"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "0ca529648be4", "9c16efc31903"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1"], "settlements": { - "launch": "c7584e82c72f" + "launch": "eb79a9b3682a" }, - "state": "a4273b38df83", + "state": "b13ddf18a62e", "effects": [] } } diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-branch-diff-git.branchdiff-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-branch-diff-git.branchdiff-1.json index c527ee5d6df5..202974916ecc 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-branch-diff-git.branchdiff-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-branch-diff-git.branchdiff-1.json @@ -3,7 +3,7 @@ "family": "session.review-branch-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-1.json index 85ff63d13804..ddce30f62073 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-1.json @@ -3,7 +3,7 @@ "family": "session.review-file-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-2.json b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-2.json index 478e6a02d9f2..98445d79d7cf 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-2.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-2.json @@ -3,7 +3,7 @@ "family": "session.review-file-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-3.json b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-3.json index 517dc85458e8..aaecef28a47e 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-3.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-3.json @@ -3,7 +3,7 @@ "family": "session.review-file-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.discard-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.discard-1.json index 333dd05532fe..f1ed4ede3492 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.discard-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.discard-1.json @@ -3,10 +3,10 @@ "family": "session.review-git-mutations", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "651cb070a4b4ba7deddeb37c08886094b83f006e7cbe2bef65d5433ce0430dff", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-1.json index 99b29c020507..adab151675ca 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-1.json @@ -3,10 +3,10 @@ "family": "session.review-git-mutations", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "e0ce643010302d304ba3611bd43932c6cdd0fa9290a3ecd4fffb4fc92c758b77", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json index 155da273f955..2088f1a68736 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json @@ -3,10 +3,10 @@ "family": "session.review-git-mutations", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "c6b3b4be6b55daf53ee1f5ff755e73a032c4da5379f90f4973736c032eb79414", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-send-sheet-session.tabs.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-send-sheet-session.tabs.list-1.json index 814dc73c7215..c8a098ebd1de 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-send-sheet-session.tabs.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-send-sheet-session.tabs.list-1.json @@ -3,10 +3,10 @@ "family": "session.review-send-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "a71815661dee6129a1b133c398b37ea89a9e4939b45626dada16889acabb2afe", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-1.json b/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-1.json index 0b7469973d7e..9e73c7944750 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-1.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-2.json b/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-2.json index a16c896c67c0..9cceccbbca98 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-2.json +++ b/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-2.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-activation-session.tabs.activate-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-activation-session.tabs.activate-1.json index d204255a15cd..9c18b6bdac57 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-activation-session.tabs.activate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-activation-session.tabs.activate-1.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-activation-terminal.focus-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-activation-terminal.focus-1.json index cb428c4052e6..ba95e6b4929f 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-activation-terminal.focus-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-activation-terminal.focus-1.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-close-session-session.tabs.close-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-close-session-session.tabs.close-1.json index df02aacec85c..47641477c4cd 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-close-session-session.tabs.close-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-close-session-session.tabs.close-1.json @@ -3,7 +3,7 @@ "family": "session.tab-close-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-close-terminal.close-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-close-terminal.close-1.json index e597a6f9f16f..977ff3841f0a 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-close-terminal.close-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-close-terminal.close-1.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-documents-markdown.readtab-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-documents-markdown.readtab-1.json index b9ac10cf846c..f47e18d311aa 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-documents-markdown.readtab-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-documents-markdown.readtab-1.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-rename-terminal.rename-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-rename-terminal.rename-1.json index c40cd3ce1d7d..a58857328443 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-rename-terminal.rename-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-rename-terminal.rename-1.json @@ -3,7 +3,7 @@ "family": "session.tab-rename", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json index 61a4f4d6888f..cd84ae0abe6f 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json @@ -3,7 +3,7 @@ "family": "session.tab-reveal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json index 7df475361a6c..8b0befd6e0de 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json @@ -3,7 +3,7 @@ "family": "session.tab-reveal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tabs-stream-health-session.tabs.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.tabs-stream-health-session.tabs.list-1.json index a5ecdf8b11ff..404188bcf84a 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tabs-stream-health-session.tabs.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tabs-stream-health-session.tabs.list-1.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-display-mode-terminal.setdisplaymode-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-display-mode-terminal.setdisplaymode-1.json index b3ded358b098..f61034b9179b 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-display-mode-terminal.setdisplaymode-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-display-mode-terminal.setdisplaymode-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-orchestration.workerterminaluserinput-1.json index 4bfb3cabab29..44dab067c503 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-gesture-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9d119d5ec320e2538105d6ff673b9f4b8e3decbe46527947489dffbcf2ac0472", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.clearbuffer-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.clearbuffer-1.json index ecd75782f2a8..2017c3d2293c 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.clearbuffer-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.clearbuffer-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-gesture-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9d119d5ec320e2538105d6ff673b9f4b8e3decbe46527947489dffbcf2ac0472", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.send-1.json index 4b946df5abce..ea57143fce58 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-gesture-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9d119d5ec320e2538105d6ff673b9f4b8e3decbe46527947489dffbcf2ac0472", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-orchestration.workerterminaluserinput-1.json index e1ab54e2c80f..32d753e4d37e 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-terminal.send-1.json index 4914564da47e..1fc9c0d763d0 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-inventory-terminal.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-inventory-terminal.list-1.json index 66c429b0b5a5..c31a784f8fa7 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-inventory-terminal.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-inventory-terminal.list-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-orchestration.workerterminaluserinput-1.json index 3a3a461aa6c4..d22fb0fdc640 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-settings.get-1.json index 5fe5ca6205d5..506014b1006b 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-settings.get-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-terminal.send-1.json index e00618c25882..286180c735bc 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-repo.list-1.json index f55a57ea30f6..95f4b417020a 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-repo.list-1.json @@ -3,7 +3,7 @@ "family": "session.worktree-connection", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-settings.get-1.json index b609575e82b4..60cfe697dbbd 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-settings.get-1.json @@ -3,7 +3,7 @@ "family": "session.worktree-connection", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-preflight.detectremoteagents-1.json b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-preflight.detectremoteagents-1.json index e2c2a2758fe8..397713fe1265 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-preflight.detectremoteagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-preflight.detectremoteagents-1.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-repo.list-1.json index 9b07de546862..4e767dd1a337 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-repo.list-1.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-settings.get-1.json index 928a5696fe57..cea0626169fc 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings-best-effort-settings.update-1.json b/mobile/rpc-foundation/goldens/matrix-settings-best-effort-settings.update-1.json index c2338edc9440..fd1810fc815f 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings-best-effort-settings.update-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings-best-effort-settings.update-1.json @@ -3,7 +3,7 @@ "family": "settings-best-effort", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.bot-overrides-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.bot-overrides-settings.get-1.json index 8787f9554dda..9da2716daf33 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.bot-overrides-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.bot-overrides-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-linear.status-1.json b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-linear.status-1.json index 242f9a062fa0..038768002943 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-linear.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-linear.status-1.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-preflight.check-1.json b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-preflight.check-1.json index 962c677e9616..00fbe373437c 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-preflight.check-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-preflight.check-1.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-settings.get-1.json index 9ff81d7ad4c6..4ec63277e7b3 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-preflight.detectagents-1.json b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-preflight.detectagents-1.json index 8dc8f21eee71..60b06fdff096 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-preflight.detectagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-preflight.detectagents-1.json @@ -3,7 +3,7 @@ "family": "settings.new-tab-local-agents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-repo.list-1.json index 726c2e195b64..62132561c941 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-repo.list-1.json @@ -3,7 +3,7 @@ "family": "settings.new-tab-local-agents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-settings.get-1.json index a07fee8e62ba..5451b05d18fa 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.new-tab-local-agents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.getterminalquickcommands-1.json b/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.getterminalquickcommands-1.json index ee6f101dc92c..89782795dafb 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.getterminalquickcommands-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.getterminalquickcommands-1.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.updateterminalquickcommands-1.json b/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.updateterminalquickcommands-1.json index 79cfe0654437..b73c3a1f849c 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.updateterminalquickcommands-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.updateterminalquickcommands-1.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-host.platform-1.json b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-host.platform-1.json index bad9a30e3fc9..75d9f21869d0 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-host.platform-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-host.platform-1.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-repo.list-1.json index 4d7b5884e1d5..07523015bbcc 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-repo.list-1.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-settings.get-1.json index f536a3066a8b..e09d27b0474d 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-ssh.listtargetsummaries-1.json b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-ssh.listtargetsummaries-1.json index 89a64b9a3f31..b7ebb1568e87 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-ssh.listtargetsummaries-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-ssh.listtargetsummaries-1.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-folderworkspace.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-folderworkspace.list-1.json index a8a4078b3cf9..3e2592a3ac35 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-folderworkspace.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-folderworkspace.list-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-projectgroup.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-projectgroup.list-1.json index 58c72c88352b..8dd1dca24e12 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-projectgroup.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-projectgroup.list-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-repo.list-1.json index 845f19803257..ed55d3d1d924 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-repo.list-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-settings.get-1.json index f1add389a64d..52ac338f82f5 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-worktree.ps-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-worktree.ps-1.json index 9ac803e5454c..85b57c953e80 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-worktree.ps-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-worktree.ps-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-linear.status-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-linear.status-1.json index 59f98f665627..0dc0ce5cc96a 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-linear.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-linear.status-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-preflight.check-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-preflight.check-1.json index 65ff795fd27f..4cb11452989b 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-preflight.check-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-preflight.check-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-settings.get-1.json index addcac907422..66a4bef76dd2 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-status.get-1.json index 1acf99da567b..fefa73e4d26d 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-status.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-ui.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-ui.get-1.json index fd1bc8d0aacc..473d944a4264 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-ui.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-ui.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-settings.get-1.json index 9eeab114d696..a2043d110523 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-worktree.create-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-worktree.create-1.json index 7b47f7e06cb1..0ef8104890fe 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-worktree.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-worktree.create-1.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-settings.get-1.json index abbe895d7b53..2d1d3bf86dc4 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-linear.status-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-linear.status-1.json index 61fab66b2eb8..7aeed9bed047 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-linear.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-linear.status-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-preflight.check-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-preflight.check-1.json index b73f7398e80d..8efd8dec7ecf 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-preflight.check-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-preflight.check-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-settings.get-1.json index a958e3713eb7..02f6a42e0c04 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-ui.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-ui.get-1.json index 878f43bf3b27..77d12ae27d1d 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-ui.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-ui.get-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-submit-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-submit-settings.get-1.json index a876a198ba62..16ffdd39382f 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-submit-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-submit-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-submit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-chunk-speech.dictation.chunk-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-chunk-speech.dictation.chunk-1.json index 72181fa566b8..cae4f6c8a6c2 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-chunk-speech.dictation.chunk-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-chunk-speech.dictation.chunk-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-chunk", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.finish-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.finish-1.json index 3471fb8e012e..b9510ec635a2 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.finish-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.finish-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.start-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.start-1.json index c72dcfe532f0..522399376898 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.start-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.start-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.cancel-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.cancel-1.json index b8d799efd24c..ff3ed7f91ec2 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.cancel-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.cancel-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.start-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.start-1.json index f33b22916acb..dcab290e4d8d 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.start-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.start-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.dictation.setup-1.json b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.dictation.setup-1.json index 0a0c8289994f..f89d9e16871b 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.dictation.setup-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.dictation.setup-1.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.delete-1.json b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.delete-1.json index 86ba9fcd4701..b2735a96daff 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.delete-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.delete-1.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.download-1.json b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.download-1.json index 3409286301b5..8423a565108f 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.download-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.download-1.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.list-1.json b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.list-1.json index c53ad0dc95b5..09a5deb80f1c 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.list-1.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.addprreviewcomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.addprreviewcomment-1.json index b67b7af9961c..4407db97ff31 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.addprreviewcomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.addprreviewcomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.prfilecontents-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.prfilecontents-1.json index 21054a03d14b..aec93d1a133b 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.prfilecontents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.prfilecontents-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.rerunprchecks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.rerunprchecks-1.json index 320e22d281e1..5d4e010a551b 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.rerunprchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.rerunprchecks-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.resolvereviewthread-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.resolvereviewthread-1.json index 8e6b46a0e8de..75e7284e2ac9 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.resolvereviewthread-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.resolvereviewthread-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.setprfileviewed-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.setprfileviewed-1.json index b03c44c060ab..b9b3901bf1b6 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.setprfileviewed-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.setprfileviewed-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-github-github.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-github-github.addissuecomment-1.json index 95155ad41678..b91a7a117db0 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-github-github.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-github-github.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-gitlab.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-gitlab.addissuecomment-1.json index 031fe3d00f99..bcdc8c570174 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-gitlab.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-gitlab.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-mr-gitlab.addmrcomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-mr-gitlab.addmrcomment-1.json index d11a120012f2..3ea4b1565b86 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-mr-gitlab.addmrcomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-mr-gitlab.addmrcomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-github-github.workitemdetails-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-github-github.workitemdetails-1.json index dfde030a09ce..1f5033517652 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-github-github.workitemdetails-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-github-github.workitemdetails-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-gitlab-gitlab.workitemdetails-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-gitlab-gitlab.workitemdetails-1.json index 7d0b97060637..cebe79fac8c6 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-gitlab-gitlab.workitemdetails-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-gitlab-gitlab.workitemdetails-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.getissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.getissue-1.json index 443860d4591d..479b6bb3cb73 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.getissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.getissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.issuecomments-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.issuecomments-1.json index eca351d61b28..692c92b4a957 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.issuecomments-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.issuecomments-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listassignableusers-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listassignableusers-1.json index ad93b3ea025c..217259e6eea2 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listassignableusers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listassignableusers-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listlabels-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listlabels-1.json index 96bc25cec251..7ecd3c1f64a9 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listlabels-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listlabels-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-merge-gitlab-gitlab.mergemr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-merge-gitlab-gitlab.mergemr-1.json index cbb4de4f6bcd..8598bb2eb902 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-merge-gitlab-gitlab.mergemr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-merge-gitlab-gitlab.mergemr-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-merge-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-github-github.updatepr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-github-github.updatepr-1.json index 9bcdd6808696..091a41ca2bea 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-github-github.updatepr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-github-github.updatepr-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-gitlab.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-gitlab.updateissue-1.json index 077b75b17d5e..993dcc5bc056 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-gitlab.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-gitlab.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-mr-gitlab.updatemr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-mr-gitlab.updatemr-1.json index 0b807b5ed225..0365dac61b3c 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-mr-gitlab.updatemr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-mr-gitlab.updatemr-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addissuecomment-1.json index 9a9603a28117..54bb28c24d92 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addprreviewcommentreply-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addprreviewcommentreply-1.json index a474ac6a30bf..d942b505dd7f 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addprreviewcommentreply-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addprreviewcommentreply-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.mergepr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.mergepr-1.json index b3dda42772f7..262ac06aa9f6 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.mergepr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.mergepr-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-linear.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-linear.updateissue-1.json index 405d54c6c108..3706568bc118 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-linear.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-linear.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.prchecks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.prchecks-1.json index 8e6247874d26..9e9f3fdc9699 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.prchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.prchecks-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-review-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.requestprreviewers-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.requestprreviewers-1.json index ded345480f92..fab6368f1cc3 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.requestprreviewers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.requestprreviewers-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-review-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-github.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-github.updateissue-1.json index c087e542b0f9..201345362fab 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-github.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-github.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-gitlab.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-gitlab.updateissue-1.json index 281a32427592..de8d7b29d9c1 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-gitlab.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-gitlab.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-mr-gitlab.updatemrstate-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-mr-gitlab.updatemrstate-1.json index 5e7e0f495014..2313bcada882 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-mr-gitlab.updatemrstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-mr-gitlab.updatemrstate-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-connect-linear.connect-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-connect-linear.connect-1.json index c593debdb83e..e63fb9d9ec31 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-connect-linear.connect-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-connect-linear.connect-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-connect", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.addissuecomment-1.json index 7007ebff9184..3dc191ea2365 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-item", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.createissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.createissue-1.json index 1aba541766f6..42a8a9da83e2 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.createissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.createissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-item", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.getissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.getissue-1.json index 0d1d7b376ca6..8c86d3699a33 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.getissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.getissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-item", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.listteams-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.listteams-1.json index d6fa613a3d96..c890e39d3b51 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.listteams-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.listteams-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-team-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.teamstates-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.teamstates-1.json index b0424264674f..9e03b251fad8 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.teamstates-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.teamstates-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-team-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.reposlug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.reposlug-1.json index 13d5fb72afac..931ea2fade2c 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.reposlug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.reposlug-1.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitem-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitem-1.json index 8ca021156ec4..637173184022 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitem-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitem-1.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitembyownerrepo-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitembyownerrepo-1.json index 2d182d0a0d92..dc0d62a270bb 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitembyownerrepo-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitembyownerrepo-1.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-gitlab.workitembypath-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-gitlab.workitembypath-1.json index a06701de86e6..73bc0b32d4e4 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-gitlab.workitembypath-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-gitlab.workitembypath-1.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json index 0fbdd02524a4..74ea4e9fe248 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json index ff472ef25946..ebf2dd2af6f8 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json index 1e07891bcd87..d48ef4e13a85 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json index ccd800b30010..52bdefcb2e6d 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json index e3a2bb532512..fe298fad20b2 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-repo-slugs-github.reposlug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-repo-slugs-github.reposlug-1.json index 9a2392eb024c..a103ef69b393 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-repo-slugs-github.reposlug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-repo-slugs-github.reposlug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-repo-slugs", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.addissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.addissuecommentbyslug-1.json index 9e4ad5923869..d44e17060342 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.addissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.addissuecommentbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-issue", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuebyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuebyslug-1.json index f26251dd6277..bfe8fbaa0965 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuebyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuebyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-issue", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuecommentbyslug-1.json index 77f447daa8da..839d2b79d001 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuecommentbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-issue", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-pr-github.project.updatepullrequestbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-pr-github.project.updatepullrequestbyslug-1.json index 8d8ecf09a955..3af7b7c0fcbc 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-pr-github.project.updatepullrequestbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-pr-github.project.updatepullrequestbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-pr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-detail-github.project.workitemdetailsbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-detail-github.project.workitemdetailsbyslug-1.json index e210a9781f15..6952ea391c11 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-detail-github.project.workitemdetailsbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-detail-github.project.workitemdetailsbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-detail", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.clearitemfield-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.clearitemfield-1.json index ee80800548e9..9443a4e4e590 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.clearitemfield-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.clearitemfield-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-fields", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateissuetypebyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateissuetypebyslug-1.json index 29a69fc4ecd4..c9b7ebe5dd98 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateissuetypebyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateissuetypebyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-fields", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateitemfield-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateitemfield-1.json index 396a5ef5a7a3..9ca91ae714f8 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateitemfield-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateitemfield-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-fields", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.addprreviewcomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.addprreviewcomment-1.json index 348fa5d00bad..7f2ccefaff31 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.addprreviewcomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.addprreviewcomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.mergepr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.mergepr-1.json index d43f59244e4c..95a5d3f8d708 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.mergepr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.mergepr-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.prfilecontents-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.prfilecontents-1.json index e7e09e99bff9..e2ca43b1f7ed 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.prfilecontents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.prfilecontents-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateissue-1.json index 01e655d36eac..054bbe2bbe69 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateprstate-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateprstate-1.json index cf97438c9459..343ed063a81d 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateprstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateprstate-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listassignableusersbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listassignableusersbyslug-1.json index 94f6d229695f..e7063174ca8b 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listassignableusersbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listassignableusersbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-metadata-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listissuetypesbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listissuetypesbyslug-1.json index dd49f3079ea3..e6e41eb79ea4 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listissuetypesbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listissuetypesbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-metadata-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listlabelsbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listlabelsbyslug-1.json index 7d1fcbc4ae32..49d83e4c5e14 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listlabelsbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listlabelsbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-metadata-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.prchecks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.prchecks-1.json index 840421c8cf0b..c9d08c7b4904 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.prchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.prchecks-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.requestprreviewers-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.requestprreviewers-1.json index 7a4bc5ee2f8b..923aaa358eb7 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.requestprreviewers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.requestprreviewers-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.rerunprchecks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.rerunprchecks-1.json index 4f65f491d23e..edcc72154244 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.rerunprchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.rerunprchecks-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.setprfileviewed-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.setprfileviewed-1.json index d8ea88595a7c..522877d7d81c 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.setprfileviewed-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.setprfileviewed-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addissuecomment-1.json index 6fa2add9b38d..b52daff4a4f6 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addprreviewcommentreply-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addprreviewcommentreply-1.json index 7cdf2f5e692a..bc67329ebf26 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addprreviewcommentreply-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addprreviewcommentreply-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.project.deleteissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.project.deleteissuecommentbyslug-1.json index 5f1530f55842..c05895e52dd8 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.project.deleteissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.project.deleteissuecommentbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.resolvereviewthread-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.resolvereviewthread-1.json index fe59a15359a3..05f4e492aa9f 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.resolvereviewthread-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.resolvereviewthread-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.json index 1ba3862369cf..1458e3fccf16 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.json index 57ed5a30f4b7..432ad890d8fd 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.json index 7b3c99dd7d56..cd4756238103 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.json index 34dde76dcc53..c953fc2c0c9e 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.json index 193eb1794813..75c390b30175 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.route-repo-list-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.route-repo-list-repo.list-1.json index 37c8aa87aadb..4b9a718cf8c1 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.route-repo-list-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.route-repo-list-repo.list-1.json @@ -3,7 +3,7 @@ "family": "tasks.route-repo-list", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "23f974df8b57c723069605de1db80c339ead286b18aae38e67fce03ea50c5180", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-github.listworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-github.listworkitems-1.json index 1b3d8a1fb84e..d0c8375d5fff 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-github.listworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-github.listworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-gitlab.listworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-gitlab.listworkitems-1.json index 9d4c9c75b925..be5a8106e913 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-gitlab.listworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-gitlab.listworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.listissues-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.listissues-1.json index de1e8ec39ec7..ab65ad2d6dc7 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.listissues-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.listissues-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.searchissues-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.searchissues-1.json index f8e8159ffa72..521c5b196104 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.searchissues-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.searchissues-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-repo.searchrefs-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-repo.searchrefs-1.json index 2f560b10ebb2..f810797ad0ea 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-repo.searchrefs-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-repo.searchrefs-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-github.createissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-github.createissue-1.json index fca4fce1197a..21c3b6102d05 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-github.createissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-github.createissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-repo.update-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-repo.update-1.json index fa23c0c10fb5..14d72690a4a3 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-repo.update-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-repo.update-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-gitlab-gitlab.createissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-gitlab-gitlab.createissue-1.json index 91964a45c8a7..4bcf523af7f0 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-gitlab-gitlab.createissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-gitlab-gitlab.createissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-linear-linear.createissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-linear-linear.createissue-1.json index 098d6ee570fe..5c832f181095 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-linear-linear.createissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-linear-linear.createissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-items-gitlab.listworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-items-gitlab.listworkitems-1.json index ac71243b86cb..96d94fe89b07 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-items-gitlab.listworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-items-gitlab.listworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-gitlab-items", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-todos-gitlab.todos-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-todos-gitlab.todos-1.json index 02a4a5205251..69ec73d45763 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-todos-gitlab.todos-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-todos-gitlab.todos-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-gitlab-todos", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.listissues-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.listissues-1.json index 39c5056378be..fd06d7c167ca 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.listissues-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.listissues-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.searchissues-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.searchissues-1.json index 07b47c3b8751..bfa64ad35e69 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.searchissues-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.searchissues-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.searchrefs-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.searchrefs-1.json index f5568be42586..f94ad51fb203 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.searchrefs-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.searchrefs-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-source", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.sparsepresets-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.sparsepresets-1.json index 164dbc2c3859..33370383b418 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.sparsepresets-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.sparsepresets-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-source", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-repo.savesparsepreset-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-repo.savesparsepreset-1.json index 0e4bb3020873..e946c8f2198e 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-repo.savesparsepreset-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-repo.savesparsepreset-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-sparse", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-ssh.getstate-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-ssh.getstate-1.json index 4626bfa69e43..3c600719aed2 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-ssh.getstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-ssh.getstate-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-sparse", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-local-preflight.detectagents-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-local-preflight.detectagents-1.json index bbd02ec0d5c7..15bbff4736b9 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-local-preflight.detectagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-local-preflight.detectagents-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh-local", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-preflight.detectremoteagents-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-preflight.detectremoteagents-1.json index 83cb2175e336..e90ddc051349 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-preflight.detectremoteagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-preflight.detectremoteagents-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-repo.hooks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-repo.hooks-1.json index 328d3a78b15d..5f61f25da60b 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-repo.hooks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-repo.hooks-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-ssh.connect-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-ssh.connect-1.json index bc40f5401eb2..ac44344dfd5d 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-ssh.connect-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-ssh.connect-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.query-reply-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.query-reply-terminal.send-1.json index c821da19b595..e3305afb2d6d 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.query-reply-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.query-reply-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "terminal.query-reply", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-orchestration.workerterminaluserinput-1.json index 30d583e8a304..9bd2e8592bec 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "terminal.raw-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-terminal.send-1.json index 5204b12e3a82..e88711a965a0 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "terminal.raw-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-1.json index f505e5796bf2..e7c7180a762d 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "terminal.takeover-report", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-2.json b/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-2.json index b9c439efcb8c..231c885875e9 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-2.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-2.json @@ -3,7 +3,7 @@ "family": "terminal.takeover-report", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.viewport-refit-terminal.updateviewport-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.viewport-refit-terminal.updateviewport-1.json index 2a108be84ca1..fd19dde7c145 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.viewport-refit-terminal.updateviewport-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.viewport-refit-terminal.updateviewport-1.json @@ -3,7 +3,7 @@ "family": "terminal.viewport-refit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-transport.capability-probe-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-transport.capability-probe-status.get-1.json index 6db96292ba91..8b0f00d34da0 100644 --- a/mobile/rpc-foundation/goldens/matrix-transport.capability-probe-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-transport.capability-probe-status.get-1.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/matrix-transport.host-status-gates-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-transport.host-status-gates-status.get-1.json index c8b59e0185e7..130b385ed119 100644 --- a/mobile/rpc-foundation/goldens/matrix-transport.host-status-gates-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-transport.host-status-gates-status.get-1.json @@ -3,7 +3,7 @@ "family": "transport.host-status-gates", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json b/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json index 79cb47a8caa9..987029285eac 100644 --- a/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json +++ b/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json b/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json index 8f82062e0178..7d12b01799f6 100644 --- a/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json +++ b/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.agent-launch-create-agent.launch-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.agent-launch-create-agent.launch-1.json index eefc85fe1a2b..1c78ae16d267 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.agent-launch-create-agent.launch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.agent-launch-create-agent.launch-1.json @@ -3,11 +3,11 @@ "family": "worktree.agent-launch-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", - "scenarioSha256": "887b5d16b4bee027edf5e2f1122a79a34b223f6926322a99f6e3de83f40bf6ee", + "scenarioSha256": "b3d017cee84fc133ab0b0a8d588750f8af907d4688e6c2900a307de25fab8473", "platform": "darwin", "scenarioVersion": 1, "projectionVersion": 2, diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.catalog-snapshot-worktree.ps-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.catalog-snapshot-worktree.ps-1.json index ae509cdf5250..9ea63e634081 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.catalog-snapshot-worktree.ps-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.catalog-snapshot-worktree.ps-1.json @@ -3,7 +3,7 @@ "family": "worktree.catalog-snapshot", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.create-retry-worktree.create-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.create-retry-worktree.create-1.json index ffe4a7ef2a87..5ca6a3915270 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.create-retry-worktree.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.create-retry-worktree.create-1.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.home-catalog-worktree.ps-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.home-catalog-worktree.ps-1.json index 61a36e1b3261..9b9e360cde14 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.home-catalog-worktree.ps-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.home-catalog-worktree.ps-1.json @@ -3,7 +3,7 @@ "family": "worktree.home-catalog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolvemrbase-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolvemrbase-1.json index 23a6359dd93c..849ec115f436 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolvemrbase-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolvemrbase-1.json @@ -3,7 +3,7 @@ "family": "worktree.hosted-base", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolveprbase-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolveprbase-1.json index 4bbc628922c0..96a309cf8cfb 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolveprbase-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolveprbase-1.json @@ -3,7 +3,7 @@ "family": "worktree.hosted-base", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.retired-names-worktree.listretirednames-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.retired-names-worktree.listretirednames-1.json index 1ea68b390786..99471df513d1 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.retired-names-worktree.listretirednames-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.retired-names-worktree.listretirednames-1.json @@ -3,7 +3,7 @@ "family": "worktree.retired-names", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.review-link-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.review-link-worktree.set-1.json index a388f5c0775e..700460486381 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.review-link-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.review-link-worktree.set-1.json @@ -3,7 +3,7 @@ "family": "worktree.review-link", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.runtime-capabilities-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.runtime-capabilities-status.get-1.json index d26247dff58d..f00cb36ffe96 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.runtime-capabilities-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.runtime-capabilities-status.get-1.json @@ -3,7 +3,7 @@ "family": "worktree.runtime-capabilities", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.setup-hook-trust-ui.set-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.setup-hook-trust-ui.set-1.json index 2596e9690722..db230f77b3cb 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.setup-hook-trust-ui.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.setup-hook-trust-ui.set-1.json @@ -3,7 +3,7 @@ "family": "worktree.setup-hook-trust", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/mobile-web-bundle-build-changed.json b/mobile/rpc-foundation/goldens/mobile-web-bundle-build-changed.json index 04df881a60ab..c11ee140d4ff 100644 --- a/mobile/rpc-foundation/goldens/mobile-web-bundle-build-changed.json +++ b/mobile/rpc-foundation/goldens/mobile-web-bundle-build-changed.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/mobile-web-bundle-fetch-paged.json b/mobile/rpc-foundation/goldens/mobile-web-bundle-fetch-paged.json index d194ccbaf4d2..70190efa3642 100644 --- a/mobile/rpc-foundation/goldens/mobile-web-bundle-fetch-paged.json +++ b/mobile/rpc-foundation/goldens/mobile-web-bundle-fetch-paged.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/mobile-web-bundle-manifest-read.json b/mobile/rpc-foundation/goldens/mobile-web-bundle-manifest-read.json index 71c57191f47e..dcc0762fae91 100644 --- a/mobile/rpc-foundation/goldens/mobile-web-bundle-manifest-read.json +++ b/mobile/rpc-foundation/goldens/mobile-web-bundle-manifest-read.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-manifest", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/mobile-web-bundle-unavailable.json b/mobile/rpc-foundation/goldens/mobile-web-bundle-unavailable.json index 9467539ba39a..f73605c72b08 100644 --- a/mobile/rpc-foundation/goldens/mobile-web-bundle-unavailable.json +++ b/mobile/rpc-foundation/goldens/mobile-web-bundle-unavailable.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-paste-single.json b/mobile/rpc-foundation/goldens/native-chat-image-paste-single.json index c600880dba7f..f934aa288473 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-paste-single.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-paste-single.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-paste-stops-on-rejection.json b/mobile/rpc-foundation/goldens/native-chat-image-paste-stops-on-rejection.json index 77c453270f5f..0f39c92ab9d2 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-paste-stops-on-rejection.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-paste-stops-on-rejection.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-paste-trailing-image.json b/mobile/rpc-foundation/goldens/native-chat-image-paste-trailing-image.json index e2e1c2d81f90..0b8bb809580a 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-paste-trailing-image.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-paste-trailing-image.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-paste-two-images.json b/mobile/rpc-foundation/goldens/native-chat-image-paste-two-images.json index fa156646e3e4..bce6493283e3 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-paste-two-images.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-paste-two-images.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-cancelled.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-cancelled.json index 2603c1af994e..1074bd2f3907 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-cancelled.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-cancelled.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.json index d3022a44345e..7115e1b0ea1d 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-single.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-single.json index 6efedc9f7f91..cf18ef24a043 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-single.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-single.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-start-refused.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-start-refused.json index eec517f79f42..42628ce2bd70 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-start-refused.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-start-refused.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-two.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-two.json index ee8acc72bf0f..eed5822bd38e 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-two.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-two.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-page-earlier.json b/mobile/rpc-foundation/goldens/native-chat-page-earlier.json index 4622a00d4524..fdbf4e6cb296 100644 --- a/mobile/rpc-foundation/goldens/native-chat-page-earlier.json +++ b/mobile/rpc-foundation/goldens/native-chat-page-earlier.json @@ -3,7 +3,7 @@ "family": "session.native-chat-page", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "60ce67f66134d6385aa7fb47f2135436a7b3ce0221e3b2514bea65e06dba5518", diff --git a/mobile/rpc-foundation/goldens/native-chat-readability-local-repo.json b/mobile/rpc-foundation/goldens/native-chat-readability-local-repo.json index 5d7e2a8b35e4..dfea737f9e29 100644 --- a/mobile/rpc-foundation/goldens/native-chat-readability-local-repo.json +++ b/mobile/rpc-foundation/goldens/native-chat-readability-local-repo.json @@ -3,7 +3,7 @@ "family": "session.native-chat-readability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-readability-refused.json b/mobile/rpc-foundation/goldens/native-chat-readability-refused.json index c95d2e51fda1..82e7ce1df095 100644 --- a/mobile/rpc-foundation/goldens/native-chat-readability-refused.json +++ b/mobile/rpc-foundation/goldens/native-chat-readability-refused.json @@ -3,7 +3,7 @@ "family": "session.native-chat-readability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-readability-remote-repo.json b/mobile/rpc-foundation/goldens/native-chat-readability-remote-repo.json index 9082a47d7320..63174dde0ff7 100644 --- a/mobile/rpc-foundation/goldens/native-chat-readability-remote-repo.json +++ b/mobile/rpc-foundation/goldens/native-chat-readability-remote-repo.json @@ -3,7 +3,7 @@ "family": "session.native-chat-readability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-empty.json b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-empty.json index 2485293b4a1a..bdfaaf078f11 100644 --- a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-empty.json +++ b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-empty.json @@ -3,7 +3,7 @@ "family": "nativeChat.session-option-pick", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-refused.json b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-refused.json index 5aa52c6bd244..069b6d69e2d7 100644 --- a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-refused.json +++ b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-refused.json @@ -3,7 +3,7 @@ "family": "nativeChat.session-option-pick", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-written.json b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-written.json index cebae58375e4..5c62652b35fa 100644 --- a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-written.json +++ b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-written.json @@ -3,7 +3,7 @@ "family": "nativeChat.session-option-pick", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-stop-accepted.json b/mobile/rpc-foundation/goldens/native-chat-stop-accepted.json index aaadf20e0742..c6404815bb3d 100644 --- a/mobile/rpc-foundation/goldens/native-chat-stop-accepted.json +++ b/mobile/rpc-foundation/goldens/native-chat-stop-accepted.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-stop-both-rejected.json b/mobile/rpc-foundation/goldens/native-chat-stop-both-rejected.json index dfed38ee14f7..780a884a188b 100644 --- a/mobile/rpc-foundation/goldens/native-chat-stop-both-rejected.json +++ b/mobile/rpc-foundation/goldens/native-chat-stop-both-rejected.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-stop-delivery-unknown.json b/mobile/rpc-foundation/goldens/native-chat-stop-delivery-unknown.json index 2c966e243ce0..0838364830d6 100644 --- a/mobile/rpc-foundation/goldens/native-chat-stop-delivery-unknown.json +++ b/mobile/rpc-foundation/goldens/native-chat-stop-delivery-unknown.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-accepted.json b/mobile/rpc-foundation/goldens/native-chat-write-accepted.json index 8e934e9492b9..5228ed6c3a74 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-accepted.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-accepted.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-clear-line.json b/mobile/rpc-foundation/goldens/native-chat-write-clear-line.json index 55168585b18a..b3b7b21e1d8e 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-clear-line.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-clear-line.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-delivery-unknown.json b/mobile/rpc-foundation/goldens/native-chat-write-delivery-unknown.json index 5544bb4877bf..5ef0e31f3c43 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-delivery-unknown.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-delivery-unknown.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-rejected.json b/mobile/rpc-foundation/goldens/native-chat-write-rejected.json index 90d3789a3710..d8d9ad5cd338 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-rejected.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-rejected.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-typed-command.json b/mobile/rpc-foundation/goldens/native-chat-write-typed-command.json index 5d9bcbd1c1d6..927f2e222e2d 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-typed-command.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-typed-command.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/new-tab-local-agents.json b/mobile/rpc-foundation/goldens/new-tab-local-agents.json index 27e7b91e5cad..b07cb0d02ccd 100644 --- a/mobile/rpc-foundation/goldens/new-tab-local-agents.json +++ b/mobile/rpc-foundation/goldens/new-tab-local-agents.json @@ -3,7 +3,7 @@ "family": "settings.new-tab-local-agents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/new-workspace-repositories-fulfilled.json b/mobile/rpc-foundation/goldens/new-workspace-repositories-fulfilled.json index d77510ab2b16..71b41beb8e41 100644 --- a/mobile/rpc-foundation/goldens/new-workspace-repositories-fulfilled.json +++ b/mobile/rpc-foundation/goldens/new-workspace-repositories-fulfilled.json @@ -3,7 +3,7 @@ "family": "components.new-workspace-repositories", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "64c1772f0f95a3c43fbb14398a8804b2b4784f7f18874e4fd79767ae634c7faa", diff --git a/mobile/rpc-foundation/goldens/notifications-desktop-stream-closed.json b/mobile/rpc-foundation/goldens/notifications-desktop-stream-closed.json index 893a8ccbc6f8..b48df7e7da29 100644 --- a/mobile/rpc-foundation/goldens/notifications-desktop-stream-closed.json +++ b/mobile/rpc-foundation/goldens/notifications-desktop-stream-closed.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/notifications-desktop-stream-replayed.json b/mobile/rpc-foundation/goldens/notifications-desktop-stream-replayed.json index 3adabb6ea405..d1f2d80cd581 100644 --- a/mobile/rpc-foundation/goldens/notifications-desktop-stream-replayed.json +++ b/mobile/rpc-foundation/goldens/notifications-desktop-stream-replayed.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/notifications-desktop-stream.json b/mobile/rpc-foundation/goldens/notifications-desktop-stream.json index 2095440edb6c..eb1dc29e84d6 100644 --- a/mobile/rpc-foundation/goldens/notifications-desktop-stream.json +++ b/mobile/rpc-foundation/goldens/notifications-desktop-stream.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/notifications-display-test-accepted.json b/mobile/rpc-foundation/goldens/notifications-display-test-accepted.json index 40d0e5a55b66..b2b379a3fdd0 100644 --- a/mobile/rpc-foundation/goldens/notifications-display-test-accepted.json +++ b/mobile/rpc-foundation/goldens/notifications-display-test-accepted.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/notifications-display-test-not-registered.json b/mobile/rpc-foundation/goldens/notifications-display-test-not-registered.json index 623c63fc50a2..6f6eca1bd325 100644 --- a/mobile/rpc-foundation/goldens/notifications-display-test-not-registered.json +++ b/mobile/rpc-foundation/goldens/notifications-display-test-not-registered.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/notifications-display-test-rate-limited.json b/mobile/rpc-foundation/goldens/notifications-display-test-rate-limited.json index fe0f81c73c92..edc61beb60ca 100644 --- a/mobile/rpc-foundation/goldens/notifications-display-test-rate-limited.json +++ b/mobile/rpc-foundation/goldens/notifications-display-test-rate-limited.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/notifications-display-test-unknown-reason.json b/mobile/rpc-foundation/goldens/notifications-display-test-unknown-reason.json index 1efb5baabdcb..d705ad25f9b1 100644 --- a/mobile/rpc-foundation/goldens/notifications-display-test-unknown-reason.json +++ b/mobile/rpc-foundation/goldens/notifications-display-test-unknown-reason.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/notifications-push-gateway-rejected.json b/mobile/rpc-foundation/goldens/notifications-push-gateway-rejected.json index 8ff714c172e2..fa92cf8b9025 100644 --- a/mobile/rpc-foundation/goldens/notifications-push-gateway-rejected.json +++ b/mobile/rpc-foundation/goldens/notifications-push-gateway-rejected.json @@ -3,7 +3,7 @@ "family": "notifications.push-registration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2e3d939dc162dbc5a38d8a7207111688204a825fd70348721917b3016e1c9470", diff --git a/mobile/rpc-foundation/goldens/notifications-push-registered.json b/mobile/rpc-foundation/goldens/notifications-push-registered.json index e355038f68e3..f49f196bb93c 100644 --- a/mobile/rpc-foundation/goldens/notifications-push-registered.json +++ b/mobile/rpc-foundation/goldens/notifications-push-registered.json @@ -3,7 +3,7 @@ "family": "notifications.push-registration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2e3d939dc162dbc5a38d8a7207111688204a825fd70348721917b3016e1c9470", diff --git a/mobile/rpc-foundation/goldens/pairing-pre-profile-direct-wins-and-provisions.json b/mobile/rpc-foundation/goldens/pairing-pre-profile-direct-wins-and-provisions.json index d2fa56dad74c..6d9e71fefc68 100644 --- a/mobile/rpc-foundation/goldens/pairing-pre-profile-direct-wins-and-provisions.json +++ b/mobile/rpc-foundation/goldens/pairing-pre-profile-direct-wins-and-provisions.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/pairing-pre-profile-provision-unsupported-saves-direct-host.json b/mobile/rpc-foundation/goldens/pairing-pre-profile-provision-unsupported-saves-direct-host.json index 49dabc4919c2..24e83a8eb977 100644 --- a/mobile/rpc-foundation/goldens/pairing-pre-profile-provision-unsupported-saves-direct-host.json +++ b/mobile/rpc-foundation/goldens/pairing-pre-profile-provision-unsupported-saves-direct-host.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/pairing-pre-profile-times-out.json b/mobile/rpc-foundation/goldens/pairing-pre-profile-times-out.json index 5d4f2a3b7e14..d662e9711822 100644 --- a/mobile/rpc-foundation/goldens/pairing-pre-profile-times-out.json +++ b/mobile/rpc-foundation/goldens/pairing-pre-profile-times-out.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/pr-branch-identity.json b/mobile/rpc-foundation/goldens/pr-branch-identity.json index f66cf79630a8..68711e3bc42f 100644 --- a/mobile/rpc-foundation/goldens/pr-branch-identity.json +++ b/mobile/rpc-foundation/goldens/pr-branch-identity.json @@ -3,10 +3,10 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "d1b208a7bee947a603949fdc1f0d145e8c5576926f89f3e32330585f3a115290", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-branch-repo-context.json b/mobile/rpc-foundation/goldens/pr-branch-repo-context.json index 82069390082b..4c1f18b58266 100644 --- a/mobile/rpc-foundation/goldens/pr-branch-repo-context.json +++ b/mobile/rpc-foundation/goldens/pr-branch-repo-context.json @@ -3,10 +3,10 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "bd715681a856254e0c374b504cece07e5df4c9a75fa2b97c35498df12210fbab", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-comment-mutation.json b/mobile/rpc-foundation/goldens/pr-comment-mutation.json index 4f4943938a73..98fb81fb43e1 100644 --- a/mobile/rpc-foundation/goldens/pr-comment-mutation.json +++ b/mobile/rpc-foundation/goldens/pr-comment-mutation.json @@ -3,10 +3,10 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "73cc5da2649b9687bb0d8247fa4ecf3c085746cf398515e8d2b40be2ed0da688", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-comment-resolve-unconfirmed.json b/mobile/rpc-foundation/goldens/pr-comment-resolve-unconfirmed.json index 2be5190aebbc..e4d974974f72 100644 --- a/mobile/rpc-foundation/goldens/pr-comment-resolve-unconfirmed.json +++ b/mobile/rpc-foundation/goldens/pr-comment-resolve-unconfirmed.json @@ -3,10 +3,10 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "f425131d29fee8826c00a550fb537d0bd1a37bbaf3b33992984d5e04a990a512", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-mutation-in-band-failure.json b/mobile/rpc-foundation/goldens/pr-mutation-in-band-failure.json index feafcb833d37..80210632f25d 100644 --- a/mobile/rpc-foundation/goldens/pr-mutation-in-band-failure.json +++ b/mobile/rpc-foundation/goldens/pr-mutation-in-band-failure.json @@ -3,10 +3,10 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "70a94f45dbf7d58d9024c1cc4c94edd98fa48cd5ccffe8f2b7c53fa3e55d18d3", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-mutation-status.json b/mobile/rpc-foundation/goldens/pr-mutation-status.json index 2a139a74c951..9df9ebbc08f7 100644 --- a/mobile/rpc-foundation/goldens/pr-mutation-status.json +++ b/mobile/rpc-foundation/goldens/pr-mutation-status.json @@ -3,10 +3,10 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "e9291209234bacab12201f4c13bb592e06bd405215389e19f0754c23e79eb197", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-read-fork-routing.json b/mobile/rpc-foundation/goldens/pr-read-fork-routing.json index c715b9fcc2ca..82ae04bdf19c 100644 --- a/mobile/rpc-foundation/goldens/pr-read-fork-routing.json +++ b/mobile/rpc-foundation/goldens/pr-read-fork-routing.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "ba21f7fc3966cb1e3c1e59d6e8a8b184fa0559bf3037365391ce23e364befd7f", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-read-surface.json b/mobile/rpc-foundation/goldens/pr-read-surface.json index 68f5d6391b44..beb3caed1aa3 100644 --- a/mobile/rpc-foundation/goldens/pr-read-surface.json +++ b/mobile/rpc-foundation/goldens/pr-read-surface.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "4246e7ffa62e85aac489c561171a6468f862b7f18eefac9926b65073616b6d35", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-read-upstream-error.json b/mobile/rpc-foundation/goldens/pr-read-upstream-error.json index 81fc076d446d..921b277e4051 100644 --- a/mobile/rpc-foundation/goldens/pr-read-upstream-error.json +++ b/mobile/rpc-foundation/goldens/pr-read-upstream-error.json @@ -3,10 +3,10 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "b2445b299e18664b698d659c5041860b8a253314687666ae467aab441ab07235", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-sidebar-checks-refused.json b/mobile/rpc-foundation/goldens/pr-sidebar-checks-refused.json index cc88806225f2..d02fb4fe5988 100644 --- a/mobile/rpc-foundation/goldens/pr-sidebar-checks-refused.json +++ b/mobile/rpc-foundation/goldens/pr-sidebar-checks-refused.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/pr-sidebar-load.json b/mobile/rpc-foundation/goldens/pr-sidebar-load.json index 6164f9f3891c..0a6b876e2030 100644 --- a/mobile/rpc-foundation/goldens/pr-sidebar-load.json +++ b/mobile/rpc-foundation/goldens/pr-sidebar-load.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/pr-title-mutation.json b/mobile/rpc-foundation/goldens/pr-title-mutation.json index 7ea0aadadca7..3025207a91b3 100644 --- a/mobile/rpc-foundation/goldens/pr-title-mutation.json +++ b/mobile/rpc-foundation/goldens/pr-title-mutation.json @@ -3,10 +3,10 @@ "family": "github.pr-title-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "071e745453795d18d683aaab63e810783e3cee4927b47425c20a3d915397d0dd", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-title-unconfirmed.json b/mobile/rpc-foundation/goldens/pr-title-unconfirmed.json index 9c1f08180fd4..76543bd73473 100644 --- a/mobile/rpc-foundation/goldens/pr-title-unconfirmed.json +++ b/mobile/rpc-foundation/goldens/pr-title-unconfirmed.json @@ -3,10 +3,10 @@ "family": "github.pr-title-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", "scenarioSha256": "669260c675021b37252dc5023a7a78e4e90536c2f35d9a5da3e53778e6a0cf52", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/pr-triage-invalid-terminal.json b/mobile/rpc-foundation/goldens/pr-triage-invalid-terminal.json deleted file mode 100644 index c8553aded664..000000000000 --- a/mobile/rpc-foundation/goldens/pr-triage-invalid-terminal.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "operation": "session.pr-triage-launch", - "family": "session.pr-triage", - "namedDeltas": [], - "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", - "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", - "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", - "scenarioSha256": "58ad4e4d5b0200c44f329236e10fd81918a1cc36b33b22cba24662c79dd61b4e", - "platform": "darwin", - "scenarioVersion": 1, - "projectionVersion": 2, - "goldenFormatVersion": 5, - "values": { - "2540affc8fa5": { - "name": "session.tabs.createTerminal#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "session.tabs.createTerminal" - }, - { - "name": "params", - "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-1", - "ok": true, - "result": { - "tab": { - "id": "tab-1" - } - } - } - } - }, - "478ad4afe83e": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "The host sent a reply this app could not read (session.tabs.createTerminal)", - "isRpcDeliveryUnknown": false - } - }, - "94d38f1838f6": { - "name": "session.tabs.createTerminal#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}" - }, - "a4273b38df83": { - "launched": "unlaunched" - } - }, - "recording": { - "scenario": "pr-triage-invalid-terminal", - "checkpoints": [ - { - "id": "invalid", - "observation": { - "sender": ["2540affc8fa5"], - "payloads": ["94d38f1838f6"], - "settlements": { - "launch": "478ad4afe83e" - }, - "state": "a4273b38df83", - "effects": [] - } - } - ] - } -} diff --git a/mobile/rpc-foundation/goldens/pr-triage-launch-unconfirmed.json b/mobile/rpc-foundation/goldens/pr-triage-launch-unconfirmed.json new file mode 100644 index 000000000000..541634775ca9 --- /dev/null +++ b/mobile/rpc-foundation/goldens/pr-triage-launch-unconfirmed.json @@ -0,0 +1,220 @@ +{ + "operation": "session.pr-triage-launch", + "family": "session.pr-triage", + "namedDeltas": [], + "runnerVersion": 1, + "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", + "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", + "scenarioSha256": "ca8e7ca631e72fbec9f3264a2ece10f171c258dc888922e4931ea481a70ecc62", + "platform": "darwin", + "scenarioVersion": 1, + "projectionVersion": 2, + "goldenFormatVersion": 5, + "values": { + "02188f091419": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-2", + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] + } + } + } + } + }, + "1c2564f1daca": { + "name": "settings.get#1", + "ordinal": 4, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"settings.get\"}" + }, + "28339abecf78": { + "name": "agent.launchReplay#1", + "ordinal": 8, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000001\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:repo-9::/w\"},\"prompt\":{\"text\":\"Fix the failing checks\",\"delivery\":\"submit\"},\"launchSource\":\"task_page\"}}" + }, + "3e6a0417d2ee": { + "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": [ + { + "id": "repo-9" + } + ] + } + } + } + }, + "9c16efc31903": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": ["codex"] + } + } + }, + "c15f33d27bd2": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "agent_session_operation_unknown", + "message": "agent_session_operation_unknown" + }, + "id": "frame-4", + "ok": false + } + } + }, + "e0eef7c9fafe": { + "name": "repo.list#1", + "ordinal": 3, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}" + }, + "eaa398d8c3aa": { + "launched": { + "kind": "unconfirmed", + "message": "Couldn't confirm the agent started. Check the workspace before trying again." + } + }, + "eb79a9b3682a": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "$rpc": "undefined" + } + }, + "f49d184679d1": { + "name": "preflight.detectAgents#1", + "ordinal": 6, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectAgents\"}" + } + }, + "recording": { + "scenario": "pr-triage-launch-unconfirmed", + "checkpoints": [ + { + "id": "unconfirmed", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "c15f33d27bd2"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "eaa398d8c3aa", + "effects": [] + } + } + ] + } +} diff --git a/mobile/rpc-foundation/goldens/pr-triage-launch.json b/mobile/rpc-foundation/goldens/pr-triage-launch.json index cf7698c10cf6..e98c39ee06a7 100644 --- a/mobile/rpc-foundation/goldens/pr-triage-launch.json +++ b/mobile/rpc-foundation/goldens/pr-triage-launch.json @@ -3,36 +3,28 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", - "scenarioSha256": "8bb2ff4e899ee873289fed7c1ef12e7f9dba91949125b1f0e4336d378ceb071e", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", + "scenarioSha256": "b7c9498eea67df2f670911e3b868a44ba77833813c17e7800dba52ebff530350", "platform": "darwin", "scenarioVersion": 1, "projectionVersion": 2, "goldenFormatVersion": 5, "values": { - "280ce0d6f832": { - "name": "terminal.send#1", - "ordinal": 4, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"terminal.send\",\"params\":{\"terminal\":\"term-1\",\"text\":\"Fix the failing checks\",\"enter\":true}}" - }, - "5093e98ba369": { - "name": "session.tabs.createTerminal#1", - "ordinal": 1, + "02188f091419": { + "name": "settings.get#1", + "ordinal": 2, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "settings.get" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" } }, { @@ -47,54 +39,103 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-1", + "id": "frame-2", "ok": true, "result": { - "tab": { - "id": "tab-1", - "terminal": "term-1", - "title": "Agent", - "type": "terminal" + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] } } } } }, - "9270aeb7d9c6": { - "status": "pending", - "startedAt": 0 - }, - "94d38f1838f6": { - "name": "session.tabs.createTerminal#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}" + "1c2564f1daca": { + "name": "settings.get#1", + "ordinal": 4, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"settings.get\"}" }, - "a4273b38df83": { - "launched": "unlaunched" + "28339abecf78": { + "name": "agent.launchReplay#1", + "ordinal": 8, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000001\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:repo-9::/w\"},\"prompt\":{\"text\":\"Fix the failing checks\",\"delivery\":\"submit\"},\"launchSource\":\"task_page\"}}" }, - "eb79a9b3682a": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "$rpc": "undefined" + "35f85fe3b71c": { + "name": "repo.list#1", + "ordinal": 1, + "args": [ + { + "name": "method", + "value": "repo.list" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 } }, - "f9b284ac2424": { - "name": "session.tabs.createTerminal#1", + "3e6a0417d2ee": { + "name": "repo.list#1", "ordinal": 1, "args": [ { "name": "method", - "value": "session.tabs.createTerminal" + "value": "repo.list" }, { "name": "params", "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-1", + "ok": true, + "result": { + "repos": [ + { + "id": "repo-9" + } + ] + } + } + } + }, + "51d4cb56be85": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" } }, { @@ -109,23 +150,22 @@ "startedAt": 0 } }, - "fe1fe746e77a": { - "launched": "sent" + "9270aeb7d9c6": { + "status": "pending", + "startedAt": 0 }, - "fe53d3bce307": { - "name": "terminal.send#1", - "ordinal": 3, + "9c16efc31903": { + "name": "preflight.detectAgents#1", + "ordinal": 5, "args": [ { "name": "method", - "value": "terminal.send" + "value": "preflight.detectAgents" }, { "name": "params", "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" + "$rpc": "absent" } }, { @@ -140,15 +180,95 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-2", + "id": "frame-3", "ok": true, - "result": { - "send": { - "accepted": true + "result": ["codex"] + } + } + }, + "a4273b38df83": { + "launched": "unlaunched" + }, + "ba3fac1eb199": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" } } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "outcome": { + "handle": "term-1", + "kind": "terminal" + }, + "prompt": { + "delivery": "submit", + "outcome": "handed-to-terminal" + }, + "receipt": { + "detail": "Started a terminal agent, the default for new agent tabs in your settings.", + "mode": "terminal", + "preferred": "terminal", + "reason": "user_default" + }, + "worktreeId": "repo-9::/w" + } } } + }, + "e0eef7c9fafe": { + "name": "repo.list#1", + "ordinal": 3, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}" + }, + "eb79a9b3682a": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "$rpc": "undefined" + } + }, + "eb8d47f90956": { + "launched": { + "kind": "sent" + } + }, + "f49d184679d1": { + "name": "preflight.detectAgents#1", + "ordinal": 6, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectAgents\"}" } }, "recording": { @@ -157,8 +277,8 @@ { "id": "pending", "observation": { - "sender": ["f9b284ac2424"], - "payloads": ["94d38f1838f6"], + "sender": ["35f85fe3b71c", "51d4cb56be85"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca"], "settlements": { "launch": "9270aeb7d9c6" }, @@ -169,12 +289,12 @@ { "id": "launched", "observation": { - "sender": ["5093e98ba369", "fe53d3bce307"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "ba3fac1eb199"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], "settlements": { "launch": "eb79a9b3682a" }, - "state": "fe1fe746e77a", + "state": "eb8d47f90956", "effects": [] } } diff --git a/mobile/rpc-foundation/goldens/pr-triage-prompt-not-delivered.json b/mobile/rpc-foundation/goldens/pr-triage-prompt-not-delivered.json new file mode 100644 index 000000000000..093aa0d0036d --- /dev/null +++ b/mobile/rpc-foundation/goldens/pr-triage-prompt-not-delivered.json @@ -0,0 +1,233 @@ +{ + "operation": "session.pr-triage-launch", + "family": "session.pr-triage", + "namedDeltas": [], + "runnerVersion": 1, + "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", + "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", + "scenarioSha256": "8307180e88773739a587bb3000327888da9ab609554ec66ea46d92b5a816221a", + "platform": "darwin", + "scenarioVersion": 1, + "projectionVersion": 2, + "goldenFormatVersion": 5, + "values": { + "02188f091419": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-2", + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] + } + } + } + } + }, + "1c2564f1daca": { + "name": "settings.get#1", + "ordinal": 4, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"settings.get\"}" + }, + "28339abecf78": { + "name": "agent.launchReplay#1", + "ordinal": 8, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000001\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:repo-9::/w\"},\"prompt\":{\"text\":\"Fix the failing checks\",\"delivery\":\"submit\"},\"launchSource\":\"task_page\"}}" + }, + "29436402d701": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "codex", + "launchSource": "task_page", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "Fix the failing checks" + }, + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-4", + "ok": true, + "result": { + "outcome": { + "handle": "term-1", + "kind": "terminal" + }, + "prompt": { + "delivery": "submit", + "outcome": "not-delivered" + }, + "receipt": { + "detail": "Started a terminal agent, the default for new agent tabs in your settings.", + "mode": "terminal", + "preferred": "terminal", + "reason": "user_default" + }, + "worktreeId": "repo-9::/w" + } + } + } + }, + "3e6a0417d2ee": { + "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": [ + { + "id": "repo-9" + } + ] + } + } + } + }, + "3fde28ed6a57": { + "launched": { + "kind": "prompt-not-sent", + "prompt": "Fix the failing checks" + } + }, + "9c16efc31903": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": ["codex"] + } + } + }, + "e0eef7c9fafe": { + "name": "repo.list#1", + "ordinal": 3, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}" + }, + "eb79a9b3682a": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "$rpc": "undefined" + } + }, + "f49d184679d1": { + "name": "preflight.detectAgents#1", + "ordinal": 6, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectAgents\"}" + } + }, + "recording": { + "scenario": "pr-triage-prompt-not-delivered", + "checkpoints": [ + { + "id": "prompt-not-sent", + "observation": { + "sender": ["3e6a0417d2ee", "02188f091419", "9c16efc31903", "29436402d701"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "28339abecf78"], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "3fde28ed6a57", + "effects": [] + } + } + ] + } +} diff --git a/mobile/rpc-foundation/goldens/pr-triage-send-locked.json b/mobile/rpc-foundation/goldens/pr-triage-send-locked.json deleted file mode 100644 index 306a128f2b55..000000000000 --- a/mobile/rpc-foundation/goldens/pr-triage-send-locked.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "operation": "session.pr-triage-launch", - "family": "session.pr-triage", - "namedDeltas": [], - "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", - "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", - "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "f560ff1582487c118756c527faa1fb1f65e37ce22ca9573491fd4b2dbcedf38d", - "scenarioSha256": "d80bc346e84bc35e6dce70643dcd3af3ea9e5a7f8a1f2b7a9e92c71c0c30d4c9", - "platform": "darwin", - "scenarioVersion": 1, - "projectionVersion": 2, - "goldenFormatVersion": 5, - "values": { - "0f026fafa7e1": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Terminal input is locked", - "isRpcDeliveryUnknown": false - } - }, - "280ce0d6f832": { - "name": "terminal.send#1", - "ordinal": 4, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"terminal.send\",\"params\":{\"terminal\":\"term-1\",\"text\":\"Fix the failing checks\",\"enter\":true}}" - }, - "438dbb654f4e": { - "name": "terminal.send#1", - "ordinal": 3, - "args": [ - { - "name": "method", - "value": "terminal.send" - }, - { - "name": "params", - "value": { - "enter": true, - "terminal": "term-1", - "text": "Fix the failing checks" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-2", - "ok": true, - "result": { - "send": { - "accepted": false - } - } - } - } - }, - "5093e98ba369": { - "name": "session.tabs.createTerminal#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "session.tabs.createTerminal" - }, - { - "name": "params", - "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:repo-9::/w" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-1", - "ok": true, - "result": { - "tab": { - "id": "tab-1", - "terminal": "term-1", - "title": "Agent", - "type": "terminal" - } - } - } - } - }, - "94d38f1838f6": { - "name": "session.tabs.createTerminal#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:repo-9::/w\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}" - }, - "a4273b38df83": { - "launched": "unlaunched" - } - }, - "recording": { - "scenario": "pr-triage-send-locked", - "checkpoints": [ - { - "id": "locked", - "observation": { - "sender": ["5093e98ba369", "438dbb654f4e"], - "payloads": ["94d38f1838f6", "280ce0d6f832"], - "settlements": { - "launch": "0f026fafa7e1" - }, - "state": "a4273b38df83", - "effects": [] - } - } - ] - } -} diff --git a/mobile/rpc-foundation/goldens/pr-triage-update-required.json b/mobile/rpc-foundation/goldens/pr-triage-update-required.json new file mode 100644 index 000000000000..2abc1f20f771 --- /dev/null +++ b/mobile/rpc-foundation/goldens/pr-triage-update-required.json @@ -0,0 +1,48 @@ +{ + "operation": "session.pr-triage-launch", + "family": "session.pr-triage", + "namedDeltas": [], + "runnerVersion": 1, + "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", + "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", + "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", + "scenarioSha256": "7fc74743e625d338b27a32280692132b5b085cfbb43ecfd0a1ac7caaddbcd459", + "platform": "darwin", + "scenarioVersion": 1, + "projectionVersion": 2, + "goldenFormatVersion": 5, + "values": { + "c2a44248892e": { + "launched": { + "kind": "not-started", + "message": "Update Orca on your computer to start an agent from your phone." + } + }, + "eb79a9b3682a": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "$rpc": "undefined" + } + } + }, + "recording": { + "scenario": "pr-triage-update-required", + "checkpoints": [ + { + "id": "update-required", + "observation": { + "sender": [], + "payloads": [], + "settlements": { + "launch": "eb79a9b3682a" + }, + "state": "c2a44248892e", + "effects": [] + } + } + ] + } +} diff --git a/mobile/rpc-foundation/goldens/probe-new-tab-both-refused.json b/mobile/rpc-foundation/goldens/probe-new-tab-both-refused.json index 7c910ca21b2d..3a0831c480e7 100644 --- a/mobile/rpc-foundation/goldens/probe-new-tab-both-refused.json +++ b/mobile/rpc-foundation/goldens/probe-new-tab-both-refused.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/probe-new-tab-null-sibling-refused.json b/mobile/rpc-foundation/goldens/probe-new-tab-null-sibling-refused.json index 45df1788131a..8976f58317bd 100644 --- a/mobile/rpc-foundation/goldens/probe-new-tab-null-sibling-refused.json +++ b/mobile/rpc-foundation/goldens/probe-new-tab-null-sibling-refused.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/probe-new-tab-refused-sibling-rejects.json b/mobile/rpc-foundation/goldens/probe-new-tab-refused-sibling-rejects.json index 222aaccca170..b4fe98c09e74 100644 --- a/mobile/rpc-foundation/goldens/probe-new-tab-refused-sibling-rejects.json +++ b/mobile/rpc-foundation/goldens/probe-new-tab-refused-sibling-rejects.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/probe-new-tab-rejects-sibling-refused.json b/mobile/rpc-foundation/goldens/probe-new-tab-rejects-sibling-refused.json index 09fe006b04b5..8dd63775a206 100644 --- a/mobile/rpc-foundation/goldens/probe-new-tab-rejects-sibling-refused.json +++ b/mobile/rpc-foundation/goldens/probe-new-tab-rejects-sibling-refused.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/push-dismissal-tray-reconciled.json b/mobile/rpc-foundation/goldens/push-dismissal-tray-reconciled.json index afd8573259e2..f4055dac19ae 100644 --- a/mobile/rpc-foundation/goldens/push-dismissal-tray-reconciled.json +++ b/mobile/rpc-foundation/goldens/push-dismissal-tray-reconciled.json @@ -3,7 +3,7 @@ "family": "notifications.push-dismissal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "595a3eb2994d0596b9fcd0707b175b4e978625053dfbc5c541b0350c0cbfb524", diff --git a/mobile/rpc-foundation/goldens/quick-commands-load-refused.json b/mobile/rpc-foundation/goldens/quick-commands-load-refused.json index 6f8973598fb9..4b66792f8801 100644 --- a/mobile/rpc-foundation/goldens/quick-commands-load-refused.json +++ b/mobile/rpc-foundation/goldens/quick-commands-load-refused.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/quick-commands-loaded-and-saved.json b/mobile/rpc-foundation/goldens/quick-commands-loaded-and-saved.json index 6e5f97a0d5af..db28cbb0b9d3 100644 --- a/mobile/rpc-foundation/goldens/quick-commands-loaded-and-saved.json +++ b/mobile/rpc-foundation/goldens/quick-commands-loaded-and-saved.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/quick-commands-save-refused-rolls-back.json b/mobile/rpc-foundation/goldens/quick-commands-save-refused-rolls-back.json index d0873be6ba1f..d2fd843f5b19 100644 --- a/mobile/rpc-foundation/goldens/quick-commands-save-refused-rolls-back.json +++ b/mobile/rpc-foundation/goldens/quick-commands-save-refused-rolls-back.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/relay-direct-upgrade-commits.json b/mobile/rpc-foundation/goldens/relay-direct-upgrade-commits.json index 3a75dffa1a1a..86fff0ea1fcf 100644 --- a/mobile/rpc-foundation/goldens/relay-direct-upgrade-commits.json +++ b/mobile/rpc-foundation/goldens/relay-direct-upgrade-commits.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/relay-direct-upgrade-unsupported-host-declines.json b/mobile/rpc-foundation/goldens/relay-direct-upgrade-unsupported-host-declines.json index a3070e19e8f2..cbdc1ed67585 100644 --- a/mobile/rpc-foundation/goldens/relay-direct-upgrade-unsupported-host-declines.json +++ b/mobile/rpc-foundation/goldens/relay-direct-upgrade-unsupported-host-declines.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/relay-pairing-recovery-invite-authorizes.json b/mobile/rpc-foundation/goldens/relay-pairing-recovery-invite-authorizes.json index 71306eca520f..e9f548846ff6 100644 --- a/mobile/rpc-foundation/goldens/relay-pairing-recovery-invite-authorizes.json +++ b/mobile/rpc-foundation/goldens/relay-pairing-recovery-invite-authorizes.json @@ -3,7 +3,7 @@ "family": "relay.pairing-recovery", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/relay-pairing-recovery-resume-committed.json b/mobile/rpc-foundation/goldens/relay-pairing-recovery-resume-committed.json index f3f2cd6770b7..462f491de850 100644 --- a/mobile/rpc-foundation/goldens/relay-pairing-recovery-resume-committed.json +++ b/mobile/rpc-foundation/goldens/relay-pairing-recovery-resume-committed.json @@ -3,7 +3,7 @@ "family": "relay.pairing-recovery", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/relay-rotation-installs-and-commits.json b/mobile/rpc-foundation/goldens/relay-rotation-installs-and-commits.json index d889372f3a6e..516a4c0e51c2 100644 --- a/mobile/rpc-foundation/goldens/relay-rotation-installs-and-commits.json +++ b/mobile/rpc-foundation/goldens/relay-rotation-installs-and-commits.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/relay-rotation-resumes-committed-pending.json b/mobile/rpc-foundation/goldens/relay-rotation-resumes-committed-pending.json index 551bbd469bfb..c1ba267c15e6 100644 --- a/mobile/rpc-foundation/goldens/relay-rotation-resumes-committed-pending.json +++ b/mobile/rpc-foundation/goldens/relay-rotation-resumes-committed-pending.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/review-branch-diff-shapes.json b/mobile/rpc-foundation/goldens/review-branch-diff-shapes.json index 989e935206ea..59f4d1f8fa6d 100644 --- a/mobile/rpc-foundation/goldens/review-branch-diff-shapes.json +++ b/mobile/rpc-foundation/goldens/review-branch-diff-shapes.json @@ -3,7 +3,7 @@ "family": "session.review-branch-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/review-create-agent-refused.json b/mobile/rpc-foundation/goldens/review-create-agent-refused.json new file mode 100644 index 000000000000..46eacedfb031 --- /dev/null +++ b/mobile/rpc-foundation/goldens/review-create-agent-refused.json @@ -0,0 +1,249 @@ +{ + "operation": "session.diff-review-actions", + "family": "session.diff-review-actions", + "namedDeltas": [], + "runnerVersion": 1, + "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", + "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", + "scenarioSha256": "0816742351babdb260fcdba92d0020e0216c8ec0d106b560357f295671c83fe2", + "platform": "darwin", + "scenarioVersion": 1, + "projectionVersion": 2, + "goldenFormatVersion": 5, + "values": { + "1c2564f1daca": { + "name": "settings.get#1", + "ordinal": 4, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"settings.get\"}" + }, + "5ee9e7b49320": { + "name": "agent.launchReplay#1", + "ordinal": 8, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"claude\",\"operationId\":\"1767225600000-00000000000040008000000000000001\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:workspace-1\"},\"prompt\":{\"text\":\"You are reviewing the current worktree. Address the following mobile review notes.\\n\\nFile: src/app.ts\\nLine: 4\\nUser comment: \\\"needs a test\\\"\\n\\nAfter applying fixes:\\n1. Summarize changed files.\\n2. Run relevant tests.\\n3. Tell me if anything remains risky.\",\"delivery\":\"submit\"},\"launchSource\":\"notes_send\"}}" + }, + "9239a4f232b8": { + "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": [ + { + "id": "workspace-1" + } + ] + } + } + } + }, + "96a9a954e28f": { + "name": "settings.get#1", + "ordinal": 2, + "args": [ + { + "name": "method", + "value": "settings.get" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-2", + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": { + "$rpc": "null" + }, + "disabledTuiAgents": [] + } + } + } + } + }, + "bcb5111e6012": { + "name": "agent.launchReplay#1", + "ordinal": 7, + "args": [ + { + "name": "method", + "value": "agent.launchReplay" + }, + { + "name": "params", + "value": { + "agent": "claude", + "launchSource": "notes_send", + "operationId": "1767225600000-00000000000040008000000000000001", + "prompt": { + "delivery": "submit", + "text": "You are reviewing the current worktree. Address the following mobile review notes.\n\nFile: src/app.ts\nLine: 4\nUser comment: \"needs a test\"\n\nAfter applying fixes:\n1. Summarize changed files.\n2. Run relevant tests.\n3. Tell me if anything remains risky." + }, + "target": { + "kind": "existing", + "worktree": "id:workspace-1" + } + } + }, + { + "name": "options", + "value": { + "timeoutMs": 90000 + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "selector_not_found", + "message": "Workspace not found" + }, + "id": "frame-4", + "ok": false + } + } + }, + "e0eef7c9fafe": { + "name": "repo.list#1", + "ordinal": 3, + "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}" + }, + "eb79a9b3682a": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "$rpc": "undefined" + } + }, + "f49d184679d1": { + "name": "preflight.detectAgents#1", + "ordinal": 6, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"preflight.detectAgents\"}" + }, + "fc1691a7deca": { + "actionError": "Workspace not found", + "busyAction": { + "$rpc": "null" + }, + "screenState": { + "branchCompare": { + "$rpc": "null" + }, + "comments": [ + { + "body": "needs a test", + "createdAt": 0, + "filePath": "src/app.ts", + "id": "note-1", + "lineNumber": 4, + "side": "modified", + "worktreeId": "workspace-1" + } + ], + "kind": "ready", + "reviewState": { + "files": {}, + "version": 1 + }, + "status": { + "entries": [] + } + }, + "sendSheet": { + "$rpc": "null" + } + }, + "fc3974e714de": { + "name": "preflight.detectAgents#1", + "ordinal": 5, + "args": [ + { + "name": "method", + "value": "preflight.detectAgents" + }, + { + "name": "params", + "value": { + "$rpc": "absent" + } + }, + { + "name": "options", + "value": { + "$rpc": "absent" + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": ["claude"] + } + } + } + }, + "recording": { + "scenario": "review-create-agent-refused", + "checkpoints": [ + { + "id": "refused", + "observation": { + "sender": ["9239a4f232b8", "96a9a954e28f", "fc3974e714de", "bcb5111e6012"], + "payloads": ["e0eef7c9fafe", "1c2564f1daca", "f49d184679d1", "5ee9e7b49320"], + "settlements": { + "create-and-send": "eb79a9b3682a" + }, + "state": "fc1691a7deca", + "effects": [] + } + } + ] + } +} diff --git a/mobile/rpc-foundation/goldens/review-create-terminal-refused.json b/mobile/rpc-foundation/goldens/review-create-terminal-refused.json deleted file mode 100644 index 4eb6cbae8164..000000000000 --- a/mobile/rpc-foundation/goldens/review-create-terminal-refused.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "operation": "session.diff-review-actions", - "family": "session.diff-review-actions", - "namedDeltas": [], - "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", - "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", - "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", - "scenarioSha256": "af837de2e273c5f03130b51d6e1a9bff9ff99a4e8d1c9554a53134acb5924c72", - "platform": "darwin", - "scenarioVersion": 1, - "projectionVersion": 2, - "goldenFormatVersion": 5, - "values": { - "2fc890e4b748": { - "actionError": { - "$rpc": "null" - }, - "busyAction": { - "$rpc": "null" - }, - "screenState": { - "branchCompare": { - "$rpc": "null" - }, - "comments": [ - { - "body": "needs a test", - "createdAt": 0, - "filePath": "src/app.ts", - "id": "note-1", - "lineNumber": 4, - "side": "modified", - "worktreeId": "workspace-1" - } - ], - "kind": "ready", - "reviewState": { - "files": {}, - "version": 1 - }, - "status": { - "entries": [] - } - }, - "sendSheet": { - "$rpc": "null" - } - }, - "6e913cd7b306": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Workspace is busy", - "isRpcDeliveryUnknown": false - } - }, - "88cd0d2b1302": { - "name": "session.tabs.createTerminal#1", - "ordinal": 2, - "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:workspace-1\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}" - }, - "fff91a37bc65": { - "name": "session.tabs.createTerminal#1", - "ordinal": 1, - "args": [ - { - "name": "method", - "value": "session.tabs.createTerminal" - }, - { - "name": "params", - "value": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:workspace-1" - } - }, - { - "name": "options", - "value": { - "$rpc": "absent" - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "error": { - "code": "worktree_busy", - "message": "Workspace is busy" - }, - "id": "frame-1", - "ok": false - } - } - } - }, - "recording": { - "scenario": "review-create-terminal-refused", - "checkpoints": [ - { - "id": "refused", - "observation": { - "sender": ["fff91a37bc65"], - "payloads": ["88cd0d2b1302"], - "settlements": { - "create-and-send": "6e913cd7b306" - }, - "state": "2fc890e4b748", - "effects": [] - } - } - ] - } -} diff --git a/mobile/rpc-foundation/goldens/review-file-diff-shapes.json b/mobile/rpc-foundation/goldens/review-file-diff-shapes.json index 4ac8364c7741..52d497f4ff62 100644 --- a/mobile/rpc-foundation/goldens/review-file-diff-shapes.json +++ b/mobile/rpc-foundation/goldens/review-file-diff-shapes.json @@ -3,7 +3,7 @@ "family": "session.review-file-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/review-git-mutations-run.json b/mobile/rpc-foundation/goldens/review-git-mutations-run.json index bbf3e6e48003..6c7223e82840 100644 --- a/mobile/rpc-foundation/goldens/review-git-mutations-run.json +++ b/mobile/rpc-foundation/goldens/review-git-mutations-run.json @@ -3,10 +3,10 @@ "family": "session.review-git-mutations", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "7981ac87c4397b9703330835327c70828cb5a76633f1c4803ded1b66520d184d", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/review-mark-reviewed-persists.json b/mobile/rpc-foundation/goldens/review-mark-reviewed-persists.json index 903c81db2eb1..23eb48c754e9 100644 --- a/mobile/rpc-foundation/goldens/review-mark-reviewed-persists.json +++ b/mobile/rpc-foundation/goldens/review-mark-reviewed-persists.json @@ -3,10 +3,10 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "9f1c39e91a97266b0a550d2b2d061592ae050078401ef23177dd2e00db67bf04", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/review-mark-reviewed-rolls-back.json b/mobile/rpc-foundation/goldens/review-mark-reviewed-rolls-back.json index 2123c9832873..38014ac78eed 100644 --- a/mobile/rpc-foundation/goldens/review-mark-reviewed-rolls-back.json +++ b/mobile/rpc-foundation/goldens/review-mark-reviewed-rolls-back.json @@ -3,10 +3,10 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "c858cfca59148548146b4c0a775e9518d3ab826ef268ccc9af60b04e52cc9e3d", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/review-open-in-session.json b/mobile/rpc-foundation/goldens/review-open-in-session.json index 8762e9163ca5..b76d69a3b931 100644 --- a/mobile/rpc-foundation/goldens/review-open-in-session.json +++ b/mobile/rpc-foundation/goldens/review-open-in-session.json @@ -3,10 +3,10 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "2f0a6aa8ce100edbce9ccf64c81efe64356fccbdcd2e16f561360e2b11b5700f", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/review-send-notes-heals-stale-input.json b/mobile/rpc-foundation/goldens/review-send-notes-heals-stale-input.json index c63f3eb74064..102af74f4ab6 100644 --- a/mobile/rpc-foundation/goldens/review-send-notes-heals-stale-input.json +++ b/mobile/rpc-foundation/goldens/review-send-notes-heals-stale-input.json @@ -3,10 +3,10 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "7099d7311b2046dde21a2750201718995c0869bc4f17fb7f3ce2b997ce0e6506", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/review-send-sheet-lists-terminals.json b/mobile/rpc-foundation/goldens/review-send-sheet-lists-terminals.json index 04e253838be3..6ef0285d6062 100644 --- a/mobile/rpc-foundation/goldens/review-send-sheet-lists-terminals.json +++ b/mobile/rpc-foundation/goldens/review-send-sheet-lists-terminals.json @@ -3,10 +3,10 @@ "family": "session.review-send-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "8b4a06c1b2918d5ed5f40102c1c7cb411e02aba5e7601e98658d673634784bb0", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/review-stage-file.json b/mobile/rpc-foundation/goldens/review-stage-file.json index 5ec53a81a4a5..1e943bc5d44e 100644 --- a/mobile/rpc-foundation/goldens/review-stage-file.json +++ b/mobile/rpc-foundation/goldens/review-stage-file.json @@ -3,10 +3,10 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "793e954960d371c6477d4cd3d70a5215c0bd90764684eafdb1e1a2e09790cc86", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/review-stage-refused.json b/mobile/rpc-foundation/goldens/review-stage-refused.json index aef207226d14..0a1e6a8a534c 100644 --- a/mobile/rpc-foundation/goldens/review-stage-refused.json +++ b/mobile/rpc-foundation/goldens/review-stage-refused.json @@ -3,10 +3,10 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", - "adapterSha256": "86ef3d98ee6c11726bf0991e1a40400b60666b0a2e24d137abe66562fe5876bc", + "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", "scenarioSha256": "46b720fed417d29f79dbde4cc7941579f2d6a2f920bae24234537480079e7de5", "platform": "darwin", "scenarioVersion": 1, diff --git a/mobile/rpc-foundation/goldens/sc-base-ref-default.json b/mobile/rpc-foundation/goldens/sc-base-ref-default.json index 6df3080de543..a01f9f2b924e 100644 --- a/mobile/rpc-foundation/goldens/sc-base-ref-default.json +++ b/mobile/rpc-foundation/goldens/sc-base-ref-default.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-base-ref-repo-fallback.json b/mobile/rpc-foundation/goldens/sc-base-ref-repo-fallback.json index f3dc9ae7834c..3bf23f0d0bac 100644 --- a/mobile/rpc-foundation/goldens/sc-base-ref-repo-fallback.json +++ b/mobile/rpc-foundation/goldens/sc-base-ref-repo-fallback.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-base-ref-unavailable.json b/mobile/rpc-foundation/goldens/sc-base-ref-unavailable.json index 1dbdb118320b..8c8eeb7fd8cf 100644 --- a/mobile/rpc-foundation/goldens/sc-base-ref-unavailable.json +++ b/mobile/rpc-foundation/goldens/sc-base-ref-unavailable.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-base-ref-worktree-hit.json b/mobile/rpc-foundation/goldens/sc-base-ref-worktree-hit.json index 11a6308c70a8..02b22c13ae77 100644 --- a/mobile/rpc-foundation/goldens/sc-base-ref-worktree-hit.json +++ b/mobile/rpc-foundation/goldens/sc-base-ref-worktree-hit.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json b/mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json index ba10deb68d43..fd257bbff10c 100644 --- a/mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json +++ b/mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json @@ -3,7 +3,7 @@ "family": "git.branch-diff-preview", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/sc-changes-loaded.json b/mobile/rpc-foundation/goldens/sc-changes-loaded.json index c016cf328bbe..898491e315a7 100644 --- a/mobile/rpc-foundation/goldens/sc-changes-loaded.json +++ b/mobile/rpc-foundation/goldens/sc-changes-loaded.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/sc-commit-message-cancel-rejected.json b/mobile/rpc-foundation/goldens/sc-commit-message-cancel-rejected.json index f5400fc135ff..5243f30ae1b7 100644 --- a/mobile/rpc-foundation/goldens/sc-commit-message-cancel-rejected.json +++ b/mobile/rpc-foundation/goldens/sc-commit-message-cancel-rejected.json @@ -3,7 +3,7 @@ "family": "git.commit-message-ai", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-commit-message-canceled.json b/mobile/rpc-foundation/goldens/sc-commit-message-canceled.json index 20e5cbead2db..82c4dc0b73bb 100644 --- a/mobile/rpc-foundation/goldens/sc-commit-message-canceled.json +++ b/mobile/rpc-foundation/goldens/sc-commit-message-canceled.json @@ -3,7 +3,7 @@ "family": "git.commit-message-ai", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-commit-message-generated.json b/mobile/rpc-foundation/goldens/sc-commit-message-generated.json index c1ed89ff9d2a..50e21b494515 100644 --- a/mobile/rpc-foundation/goldens/sc-commit-message-generated.json +++ b/mobile/rpc-foundation/goldens/sc-commit-message-generated.json @@ -3,7 +3,7 @@ "family": "git.commit-message-ai", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-create-existing-review.json b/mobile/rpc-foundation/goldens/sc-create-existing-review.json index 33de7f54a839..d924c7310d5d 100644 --- a/mobile/rpc-foundation/goldens/sc-create-existing-review.json +++ b/mobile/rpc-foundation/goldens/sc-create-existing-review.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-intent-stage-commit-push-create.json b/mobile/rpc-foundation/goldens/sc-create-intent-stage-commit-push-create.json index e93034cccbad..9361f82b5289 100644 --- a/mobile/rpc-foundation/goldens/sc-create-intent-stage-commit-push-create.json +++ b/mobile/rpc-foundation/goldens/sc-create-intent-stage-commit-push-create.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-intent-unlisted-provider.json b/mobile/rpc-foundation/goldens/sc-create-intent-unlisted-provider.json index ad6511c94ea1..f7e1ffd4130c 100644 --- a/mobile/rpc-foundation/goldens/sc-create-intent-unlisted-provider.json +++ b/mobile/rpc-foundation/goldens/sc-create-intent-unlisted-provider.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-link-failure-is-non-fatal.json b/mobile/rpc-foundation/goldens/sc-create-link-failure-is-non-fatal.json index d2e07b8bd5f1..12d758d9b8b9 100644 --- a/mobile/rpc-foundation/goldens/sc-create-link-failure-is-non-fatal.json +++ b/mobile/rpc-foundation/goldens/sc-create-link-failure-is-non-fatal.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-pushes-then-creates.json b/mobile/rpc-foundation/goldens/sc-create-pushes-then-creates.json index ec8982ed6dd1..53a865285b6a 100644 --- a/mobile/rpc-foundation/goldens/sc-create-pushes-then-creates.json +++ b/mobile/rpc-foundation/goldens/sc-create-pushes-then-creates.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-refused-empty-message.json b/mobile/rpc-foundation/goldens/sc-create-refused-empty-message.json index d6ac8f188565..95754691012b 100644 --- a/mobile/rpc-foundation/goldens/sc-create-refused-empty-message.json +++ b/mobile/rpc-foundation/goldens/sc-create-refused-empty-message.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-rejected-empty-message.json b/mobile/rpc-foundation/goldens/sc-create-rejected-empty-message.json index 1aa2aed3cada..be82322d1d8f 100644 --- a/mobile/rpc-foundation/goldens/sc-create-rejected-empty-message.json +++ b/mobile/rpc-foundation/goldens/sc-create-rejected-empty-message.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-eligibility-fetched.json b/mobile/rpc-foundation/goldens/sc-eligibility-fetched.json index 8c69f7504ae0..5b8de2f15efe 100644 --- a/mobile/rpc-foundation/goldens/sc-eligibility-fetched.json +++ b/mobile/rpc-foundation/goldens/sc-eligibility-fetched.json @@ -3,7 +3,7 @@ "family": "hostedReview.eligibility", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-history-commit-files.json b/mobile/rpc-foundation/goldens/sc-history-commit-files.json index 23f2847f93c7..cc1728d3d824 100644 --- a/mobile/rpc-foundation/goldens/sc-history-commit-files.json +++ b/mobile/rpc-foundation/goldens/sc-history-commit-files.json @@ -3,7 +3,7 @@ "family": "git.history-commit-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/sc-history-loaded.json b/mobile/rpc-foundation/goldens/sc-history-loaded.json index 893640bc704a..cefe8dec69e8 100644 --- a/mobile/rpc-foundation/goldens/sc-history-loaded.json +++ b/mobile/rpc-foundation/goldens/sc-history-loaded.json @@ -3,7 +3,7 @@ "family": "git.history-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-pr-link-hosted-review.json b/mobile/rpc-foundation/goldens/sc-pr-link-hosted-review.json index 1feb3cb1814d..52f6a72ef9a0 100644 --- a/mobile/rpc-foundation/goldens/sc-pr-link-hosted-review.json +++ b/mobile/rpc-foundation/goldens/sc-pr-link-hosted-review.json @@ -3,7 +3,7 @@ "family": "worktree.review-link", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-pr-link-read.json b/mobile/rpc-foundation/goldens/sc-pr-link-read.json index e275ba742315..baa447adcc8d 100644 --- a/mobile/rpc-foundation/goldens/sc-pr-link-read.json +++ b/mobile/rpc-foundation/goldens/sc-pr-link-read.json @@ -3,7 +3,7 @@ "family": "worktree.review-link", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-pr-link-set.json b/mobile/rpc-foundation/goldens/sc-pr-link-set.json index 97668379bf5c..b03e46c09340 100644 --- a/mobile/rpc-foundation/goldens/sc-pr-link-set.json +++ b/mobile/rpc-foundation/goldens/sc-pr-link-set.json @@ -3,7 +3,7 @@ "family": "worktree.review-link", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-refusal.json b/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-refusal.json index e387920494d3..e450baf4fe50 100644 --- a/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-refusal.json +++ b/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-refusal.json @@ -3,7 +3,7 @@ "family": "hostedReview.eligibility", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-rejection.json b/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-rejection.json index 3215dff50ccd..22e03e7ae845 100644 --- a/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-rejection.json +++ b/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-rejection.json @@ -3,7 +3,7 @@ "family": "hostedReview.eligibility", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prerequisite-force-with-lease.json b/mobile/rpc-foundation/goldens/sc-prerequisite-force-with-lease.json index 26a535638b2f..c2be37143978 100644 --- a/mobile/rpc-foundation/goldens/sc-prerequisite-force-with-lease.json +++ b/mobile/rpc-foundation/goldens/sc-prerequisite-force-with-lease.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prerequisite-publish.json b/mobile/rpc-foundation/goldens/sc-prerequisite-publish.json index 0c9f8b46ab10..1782c716e34d 100644 --- a/mobile/rpc-foundation/goldens/sc-prerequisite-publish.json +++ b/mobile/rpc-foundation/goldens/sc-prerequisite-publish.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prerequisite-push.json b/mobile/rpc-foundation/goldens/sc-prerequisite-push.json index 5c78df7a2e0c..e57f5e8fbd77 100644 --- a/mobile/rpc-foundation/goldens/sc-prerequisite-push.json +++ b/mobile/rpc-foundation/goldens/sc-prerequisite-push.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prerequisite-skipped.json b/mobile/rpc-foundation/goldens/sc-prerequisite-skipped.json index d39070adb225..a6a3ccd115a9 100644 --- a/mobile/rpc-foundation/goldens/sc-prerequisite-skipped.json +++ b/mobile/rpc-foundation/goldens/sc-prerequisite-skipped.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-reveal-first-poll.json b/mobile/rpc-foundation/goldens/sc-reveal-first-poll.json index 519db73bcb31..4fbc890e10a0 100644 --- a/mobile/rpc-foundation/goldens/sc-reveal-first-poll.json +++ b/mobile/rpc-foundation/goldens/sc-reveal-first-poll.json @@ -3,7 +3,7 @@ "family": "session.tab-reveal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-reveal-timeout.json b/mobile/rpc-foundation/goldens/sc-reveal-timeout.json index feb0b6e2e430..e529b87d415f 100644 --- a/mobile/rpc-foundation/goldens/sc-reveal-timeout.json +++ b/mobile/rpc-foundation/goldens/sc-reveal-timeout.json @@ -3,7 +3,7 @@ "family": "session.tab-reveal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-review-commit-inner-failure.json b/mobile/rpc-foundation/goldens/sc-review-commit-inner-failure.json index 8d9358da2e1a..02bbd1d4f4aa 100644 --- a/mobile/rpc-foundation/goldens/sc-review-commit-inner-failure.json +++ b/mobile/rpc-foundation/goldens/sc-review-commit-inner-failure.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-commit-refused-empty-message.json b/mobile/rpc-foundation/goldens/sc-review-commit-refused-empty-message.json index 43259c0204c4..c4077e2331f4 100644 --- a/mobile/rpc-foundation/goldens/sc-review-commit-refused-empty-message.json +++ b/mobile/rpc-foundation/goldens/sc-review-commit-refused-empty-message.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-commit-rejected.json b/mobile/rpc-foundation/goldens/sc-review-commit-rejected.json index e93d03b75bcf..00dfc9065892 100644 --- a/mobile/rpc-foundation/goldens/sc-review-commit-rejected.json +++ b/mobile/rpc-foundation/goldens/sc-review-commit-rejected.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-commit.json b/mobile/rpc-foundation/goldens/sc-review-commit.json index 138f19fbe4da..523af3afd4f8 100644 --- a/mobile/rpc-foundation/goldens/sc-review-commit.json +++ b/mobile/rpc-foundation/goldens/sc-review-commit.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-status-entries-not-array.json b/mobile/rpc-foundation/goldens/sc-review-status-entries-not-array.json index 79c7440a0049..a39edfc8cf8b 100644 --- a/mobile/rpc-foundation/goldens/sc-review-status-entries-not-array.json +++ b/mobile/rpc-foundation/goldens/sc-review-status-entries-not-array.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-status-normalized.json b/mobile/rpc-foundation/goldens/sc-review-status-normalized.json index 3c4f90c59f95..1f1730fbf817 100644 --- a/mobile/rpc-foundation/goldens/sc-review-status-normalized.json +++ b/mobile/rpc-foundation/goldens/sc-review-status-normalized.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/schedules-b3.json b/mobile/rpc-foundation/goldens/schedules-b3.json index 22804fede528..38674f2cd5b7 100644 --- a/mobile/rpc-foundation/goldens/schedules-b3.json +++ b/mobile/rpc-foundation/goldens/schedules-b3.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-home-providers-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-home-providers-fulfilled.json index af7284442158..90ad47f260d1 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-home-providers-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-home-providers-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-new-tab-ssh.json b/mobile/rpc-foundation/goldens/schedules-settings-new-tab-ssh.json index c920fabd9396..ecdc4157c67b 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-new-tab-ssh.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-new-tab-ssh.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-repo-metadata-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-repo-metadata-fulfilled.json index 1b95c26e609d..8bf76be19f43 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-repo-metadata-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-repo-metadata-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-resume-metadata-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-resume-metadata-fulfilled.json index a2b54e456578..659e9c9623db 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-resume-metadata-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-resume-metadata-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-task-hydration-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-task-hydration-fulfilled.json index d220a0d5d717..a20253e0834d 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-task-hydration-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-task-hydration-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-workspace-context-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-workspace-context-fulfilled.json index fbee0b8b473f..962706318c83 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-workspace-context-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-workspace-context-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/session-browser-tab-created.json b/mobile/rpc-foundation/goldens/session-browser-tab-created.json index cd208d04e141..b9b271def77c 100644 --- a/mobile/rpc-foundation/goldens/session-browser-tab-created.json +++ b/mobile/rpc-foundation/goldens/session-browser-tab-created.json @@ -3,7 +3,7 @@ "family": "session.browser-tab-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-browser-refused.json b/mobile/rpc-foundation/goldens/session-create-browser-refused.json index b493cbe3b511..5bef4c17f0a7 100644 --- a/mobile/rpc-foundation/goldens/session-create-browser-refused.json +++ b/mobile/rpc-foundation/goldens/session-create-browser-refused.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-browser-tab.json b/mobile/rpc-foundation/goldens/session-create-browser-tab.json index b5a3eb306141..744c50b126cf 100644 --- a/mobile/rpc-foundation/goldens/session-create-browser-tab.json +++ b/mobile/rpc-foundation/goldens/session-create-browser-tab.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-markdown-name-collision.json b/mobile/rpc-foundation/goldens/session-create-markdown-name-collision.json index f758d48f2cf4..958d728be478 100644 --- a/mobile/rpc-foundation/goldens/session-create-markdown-name-collision.json +++ b/mobile/rpc-foundation/goldens/session-create-markdown-name-collision.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-markdown-note.json b/mobile/rpc-foundation/goldens/session-create-markdown-note.json index bb8f96bc9509..13afb8392894 100644 --- a/mobile/rpc-foundation/goldens/session-create-markdown-note.json +++ b/mobile/rpc-foundation/goldens/session-create-markdown-note.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-ignores-a-second-create-in-flight.json b/mobile/rpc-foundation/goldens/session-create-terminal-ignores-a-second-create-in-flight.json index 67c96e0e2aaf..bc49333a7504 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-ignores-a-second-create-in-flight.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-ignores-a-second-create-in-flight.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-launches-an-agent-quick-command.json b/mobile/rpc-foundation/goldens/session-create-terminal-launches-an-agent-quick-command.json index 0b133ccfa954..a5aa4d693f80 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-launches-an-agent-quick-command.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-launches-an-agent-quick-command.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-refused.json b/mobile/rpc-foundation/goldens/session-create-terminal-refused.json index 99cb58af8a12..ac3b01460832 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-refused.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-refused.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-replaces-active.json b/mobile/rpc-foundation/goldens/session-create-terminal-replaces-active.json index 7ff9bd442e79..b5354c9a8854 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-replaces-active.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-replaces-active.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-runs-a-quick-command.json b/mobile/rpc-foundation/goldens/session-create-terminal-runs-a-quick-command.json index 5d3ad4f5a5bd..33c777340181 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-runs-a-quick-command.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-runs-a-quick-command.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-with-prompt.json b/mobile/rpc-foundation/goldens/session-create-terminal-with-prompt.json index 38a47b44a8ea..4d2446390582 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-with-prompt.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-with-prompt.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-without-active-tab.json b/mobile/rpc-foundation/goldens/session-create-terminal-without-active-tab.json index 47ced3dad4bd..79dfa0e70c6e 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-without-active-tab.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-without-active-tab.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-without-handle.json b/mobile/rpc-foundation/goldens/session-create-terminal-without-handle.json index 0a369faee451..7c3df89b6a4f 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-without-handle.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-without-handle.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-diff-notes-load-refused.json b/mobile/rpc-foundation/goldens/session-diff-notes-load-refused.json index 662eaa4289c4..7e41166ae672 100644 --- a/mobile/rpc-foundation/goldens/session-diff-notes-load-refused.json +++ b/mobile/rpc-foundation/goldens/session-diff-notes-load-refused.json @@ -3,7 +3,7 @@ "family": "session.diff-notes", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/session-diff-notes-loaded.json b/mobile/rpc-foundation/goldens/session-diff-notes-loaded.json index ceababf7aee1..a7bb8ff898a3 100644 --- a/mobile/rpc-foundation/goldens/session-diff-notes-loaded.json +++ b/mobile/rpc-foundation/goldens/session-diff-notes-loaded.json @@ -3,7 +3,7 @@ "family": "session.diff-notes", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/session-file-tab-read.json b/mobile/rpc-foundation/goldens/session-file-tab-read.json index d994300f6503..eb7eb1cbc5a7 100644 --- a/mobile/rpc-foundation/goldens/session-file-tab-read.json +++ b/mobile/rpc-foundation/goldens/session-file-tab-read.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-disk-read.json b/mobile/rpc-foundation/goldens/session-markdown-disk-read.json index bc585366f512..4d42d84c8a0a 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-disk-read.json +++ b/mobile/rpc-foundation/goldens/session-markdown-disk-read.json @@ -3,7 +3,7 @@ "family": "session.markdown-disk-fallback", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-disk-served.json b/mobile/rpc-foundation/goldens/session-markdown-disk-served.json index a58b982b032a..5405ef59f382 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-disk-served.json +++ b/mobile/rpc-foundation/goldens/session-markdown-disk-served.json @@ -3,7 +3,7 @@ "family": "session.markdown-disk-fallback", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-save-conflict.json b/mobile/rpc-foundation/goldens/session-markdown-save-conflict.json index 05ef486efd39..dadd4338f0df 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-save-conflict.json +++ b/mobile/rpc-foundation/goldens/session-markdown-save-conflict.json @@ -3,7 +3,7 @@ "family": "session.markdown-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/session-markdown-saved.json b/mobile/rpc-foundation/goldens/session-markdown-saved.json index 2ca7429d6878..7572025304ea 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-saved.json +++ b/mobile/rpc-foundation/goldens/session-markdown-saved.json @@ -3,7 +3,7 @@ "family": "session.markdown-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/session-markdown-tab-disk-fallback.json b/mobile/rpc-foundation/goldens/session-markdown-tab-disk-fallback.json index 8e1d814c42f6..35e69380af4a 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-tab-disk-fallback.json +++ b/mobile/rpc-foundation/goldens/session-markdown-tab-disk-fallback.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-tab-read.json b/mobile/rpc-foundation/goldens/session-markdown-tab-read.json index bb8d4d1c3cc2..3aa03329f501 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-tab-read.json +++ b/mobile/rpc-foundation/goldens/session-markdown-tab-read.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-tab-refused.json b/mobile/rpc-foundation/goldens/session-markdown-tab-refused.json index 7fc0d4c23163..0eaf1fe08c89 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-tab-refused.json +++ b/mobile/rpc-foundation/goldens/session-markdown-tab-refused.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-startup-both-activation-sites.json b/mobile/rpc-foundation/goldens/session-startup-both-activation-sites.json index 140568a674b4..f42c64c4432a 100644 --- a/mobile/rpc-foundation/goldens/session-startup-both-activation-sites.json +++ b/mobile/rpc-foundation/goldens/session-startup-both-activation-sites.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/session-startup-floating-route-skips-activation.json b/mobile/rpc-foundation/goldens/session-startup-floating-route-skips-activation.json index e4ba7d6609e2..f2dc1d61fcac 100644 --- a/mobile/rpc-foundation/goldens/session-startup-floating-route-skips-activation.json +++ b/mobile/rpc-foundation/goldens/session-startup-floating-route-skips-activation.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/session-startup-keeps-terminals-visible-on-reconnect.json b/mobile/rpc-foundation/goldens/session-startup-keeps-terminals-visible-on-reconnect.json index 47c68de8a4e1..f877cbf30bdd 100644 --- a/mobile/rpc-foundation/goldens/session-startup-keeps-terminals-visible-on-reconnect.json +++ b/mobile/rpc-foundation/goldens/session-startup-keeps-terminals-visible-on-reconnect.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/session-startup-refused-tab-load-still-loads-terminals.json b/mobile/rpc-foundation/goldens/session-startup-refused-tab-load-still-loads-terminals.json index b74a116393ab..0d7223f52f5b 100644 --- a/mobile/rpc-foundation/goldens/session-startup-refused-tab-load-still-loads-terminals.json +++ b/mobile/rpc-foundation/goldens/session-startup-refused-tab-load-still-loads-terminals.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/session-tab-activation-focus-and-activate.json b/mobile/rpc-foundation/goldens/session-tab-activation-focus-and-activate.json index 237eb95ba4e5..e318448da70c 100644 --- a/mobile/rpc-foundation/goldens/session-tab-activation-focus-and-activate.json +++ b/mobile/rpc-foundation/goldens/session-tab-activation-focus-and-activate.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tab-activation-refused.json b/mobile/rpc-foundation/goldens/session-tab-activation-refused.json index 4a08a057eb85..b568ef3c28c4 100644 --- a/mobile/rpc-foundation/goldens/session-tab-activation-refused.json +++ b/mobile/rpc-foundation/goldens/session-tab-activation-refused.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tab-activation-transport-error.json b/mobile/rpc-foundation/goldens/session-tab-activation-transport-error.json index d7816c487bf6..840aeb36c5f5 100644 --- a/mobile/rpc-foundation/goldens/session-tab-activation-transport-error.json +++ b/mobile/rpc-foundation/goldens/session-tab-activation-transport-error.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tab-close-refused-keeps-tab.json b/mobile/rpc-foundation/goldens/session-tab-close-refused-keeps-tab.json index 3729c8a4e0db..d7965799fb68 100644 --- a/mobile/rpc-foundation/goldens/session-tab-close-refused-keeps-tab.json +++ b/mobile/rpc-foundation/goldens/session-tab-close-refused-keeps-tab.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-close-session-tab.json b/mobile/rpc-foundation/goldens/session-tab-close-session-tab.json index 890988141f10..a0c45cf4c9aa 100644 --- a/mobile/rpc-foundation/goldens/session-tab-close-session-tab.json +++ b/mobile/rpc-foundation/goldens/session-tab-close-session-tab.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-close-terminal.json b/mobile/rpc-foundation/goldens/session-tab-close-terminal.json index d0c0b4e1e54c..51951642c40f 100644 --- a/mobile/rpc-foundation/goldens/session-tab-close-terminal.json +++ b/mobile/rpc-foundation/goldens/session-tab-close-terminal.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-closed.json b/mobile/rpc-foundation/goldens/session-tab-closed.json index 58f7d2c89b56..d69e9d539d55 100644 --- a/mobile/rpc-foundation/goldens/session-tab-closed.json +++ b/mobile/rpc-foundation/goldens/session-tab-closed.json @@ -3,7 +3,7 @@ "family": "session.tab-close-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-rename.json b/mobile/rpc-foundation/goldens/session-tab-rename.json index 25d6dd7ff728..666d9de75f62 100644 --- a/mobile/rpc-foundation/goldens/session-tab-rename.json +++ b/mobile/rpc-foundation/goldens/session-tab-rename.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-renamed.json b/mobile/rpc-foundation/goldens/session-tab-renamed.json index ed066a874232..b67716fba428 100644 --- a/mobile/rpc-foundation/goldens/session-tab-renamed.json +++ b/mobile/rpc-foundation/goldens/session-tab-renamed.json @@ -3,7 +3,7 @@ "family": "session.tab-rename", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tabs-health-errored.json b/mobile/rpc-foundation/goldens/session-tabs-health-errored.json index 6da5f28240a5..099094e7c06c 100644 --- a/mobile/rpc-foundation/goldens/session-tabs-health-errored.json +++ b/mobile/rpc-foundation/goldens/session-tabs-health-errored.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tabs-health-reconciled.json b/mobile/rpc-foundation/goldens/session-tabs-health-reconciled.json index 9329f6d81518..6f608d136457 100644 --- a/mobile/rpc-foundation/goldens/session-tabs-health-reconciled.json +++ b/mobile/rpc-foundation/goldens/session-tabs-health-reconciled.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tabs-health-refused.json b/mobile/rpc-foundation/goldens/session-tabs-health-refused.json index 157fefada794..952c1fca8cff 100644 --- a/mobile/rpc-foundation/goldens/session-tabs-health-refused.json +++ b/mobile/rpc-foundation/goldens/session-tabs-health-refused.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tabs-health-stale-application-revision.json b/mobile/rpc-foundation/goldens/session-tabs-health-stale-application-revision.json index 611c202a7584..0d3f2650bdb1 100644 --- a/mobile/rpc-foundation/goldens/session-tabs-health-stale-application-revision.json +++ b/mobile/rpc-foundation/goldens/session-tabs-health-stale-application-revision.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-take-floor.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-take-floor.json index a9d96292fd25..8bb2d688a1a5 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-take-floor.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-take-floor.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-device-token.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-device-token.json index 53323a00850a..4122e8803acb 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-device-token.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-device-token.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-viewport.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-viewport.json index fc57e97eb1fc..8240ec9c4a9b 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-viewport.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-viewport.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-drops-second-toggle.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-drops-second-toggle.json index fa0f936bac57..08b6c1b0cc6f 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-drops-second-toggle.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-drops-second-toggle.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-to-desktop.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-to-desktop.json index 267ee68b793c..732087cdc448 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-to-desktop.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-to-desktop.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-list-dedupes-handles.json b/mobile/rpc-foundation/goldens/session-terminal-list-dedupes-handles.json index dde7b4e2b1dd..a076ae6cc9f8 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-list-dedupes-handles.json +++ b/mobile/rpc-foundation/goldens/session-terminal-list-dedupes-handles.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-terminal-list-empty-guarded.json b/mobile/rpc-foundation/goldens/session-terminal-list-empty-guarded.json index 1304b6d2d153..b7d2c3e2eed3 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-list-empty-guarded.json +++ b/mobile/rpc-foundation/goldens/session-terminal-list-empty-guarded.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-terminal-list-merged.json b/mobile/rpc-foundation/goldens/session-terminal-list-merged.json index 2466a6acb857..3a893faff395 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-list-merged.json +++ b/mobile/rpc-foundation/goldens/session-terminal-list-merged.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-terminal-list-refused.json b/mobile/rpc-foundation/goldens/session-terminal-list-refused.json index 3060f266068a..7d034cea715f 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-list-refused.json +++ b/mobile/rpc-foundation/goldens/session-terminal-list-refused.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/settings-bot-overrides-fulfilled.json b/mobile/rpc-foundation/goldens/settings-bot-overrides-fulfilled.json index ea89099af12a..b1b174597abb 100644 --- a/mobile/rpc-foundation/goldens/settings-bot-overrides-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-bot-overrides-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-bot-overrides-refresh-refused.json b/mobile/rpc-foundation/goldens/settings-bot-overrides-refresh-refused.json index 7b34727382f7..e1f4e3224adc 100644 --- a/mobile/rpc-foundation/goldens/settings-bot-overrides-refresh-refused.json +++ b/mobile/rpc-foundation/goldens/settings-bot-overrides-refresh-refused.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-bot-overrides-refused.json b/mobile/rpc-foundation/goldens/settings-bot-overrides-refused.json index 289cea6a4dd0..6d281b4f23bd 100644 --- a/mobile/rpc-foundation/goldens/settings-bot-overrides-refused.json +++ b/mobile/rpc-foundation/goldens/settings-bot-overrides-refused.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-bot-overrides-transport-error.json b/mobile/rpc-foundation/goldens/settings-bot-overrides-transport-error.json index 469cc04e8ba2..342ac6c4620c 100644 --- a/mobile/rpc-foundation/goldens/settings-bot-overrides-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-bot-overrides-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-coalesced.json b/mobile/rpc-foundation/goldens/settings-home-coalesced.json index 4bbda1487af0..4dd791f1a90e 100644 --- a/mobile/rpc-foundation/goldens/settings-home-coalesced.json +++ b/mobile/rpc-foundation/goldens/settings-home-coalesced.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-providers-fulfilled.json b/mobile/rpc-foundation/goldens/settings-home-providers-fulfilled.json index 6331f10b5b11..90cb00d86a48 100644 --- a/mobile/rpc-foundation/goldens/settings-home-providers-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-home-providers-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-providers-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-home-providers-refuse-after-data.json index fc844d3e4c5a..f1c9d5f27cdd 100644 --- a/mobile/rpc-foundation/goldens/settings-home-providers-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-home-providers-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-providers-refused.json b/mobile/rpc-foundation/goldens/settings-home-providers-refused.json index a33e64c910dd..142f90c69bea 100644 --- a/mobile/rpc-foundation/goldens/settings-home-providers-refused.json +++ b/mobile/rpc-foundation/goldens/settings-home-providers-refused.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-providers-transport-error.json b/mobile/rpc-foundation/goldens/settings-home-providers-transport-error.json index d226228b33c2..2b5c55a18bc0 100644 --- a/mobile/rpc-foundation/goldens/settings-home-providers-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-home-providers-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-new-tab-refused.json b/mobile/rpc-foundation/goldens/settings-new-tab-refused.json index 0fd8b5c545fa..0a6362bc82da 100644 --- a/mobile/rpc-foundation/goldens/settings-new-tab-refused.json +++ b/mobile/rpc-foundation/goldens/settings-new-tab-refused.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/settings-new-tab-ssh.json b/mobile/rpc-foundation/goldens/settings-new-tab-ssh.json index dd636c43ac7b..dbdb53084d81 100644 --- a/mobile/rpc-foundation/goldens/settings-new-tab-ssh.json +++ b/mobile/rpc-foundation/goldens/settings-new-tab-ssh.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/settings-new-tab-transport-error.json b/mobile/rpc-foundation/goldens/settings-new-tab-transport-error.json index 0e85224755f3..4306706463b0 100644 --- a/mobile/rpc-foundation/goldens/settings-new-tab-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-new-tab-transport-error.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/settings-repo-cache-expiry.json b/mobile/rpc-foundation/goldens/settings-repo-cache-expiry.json index 284bb8dccb92..30457d0762ec 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-cache-expiry.json +++ b/mobile/rpc-foundation/goldens/settings-repo-cache-expiry.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-fulfilled.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-fulfilled.json index 7dc7dafba2d1..523da4245773 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-icons.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-icons.json index 74b9b368ead1..b41a07f9ffa1 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-icons.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-icons.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-refuse-after-data.json index 048e91bc4a8a..9116d51c643b 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-refused.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-refused.json index ab5ab06802b1..4681e027614f 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-refused.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-refused.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-single-host.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-single-host.json index 295f1a89e66d..656207c38f88 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-single-host.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-single-host.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-transport-error.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-transport-error.json index 762aa3301824..c02040b8b0f5 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-resume-metadata-fulfilled.json b/mobile/rpc-foundation/goldens/settings-resume-metadata-fulfilled.json index 59f943199945..f339231a8812 100644 --- a/mobile/rpc-foundation/goldens/settings-resume-metadata-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-resume-metadata-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-resume-metadata-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-resume-metadata-refuse-after-data.json index 238e05b697f3..d6beaa00054d 100644 --- a/mobile/rpc-foundation/goldens/settings-resume-metadata-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-resume-metadata-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-resume-metadata-refused.json b/mobile/rpc-foundation/goldens/settings-resume-metadata-refused.json index 0d2aea110fec..77d6d3713ca0 100644 --- a/mobile/rpc-foundation/goldens/settings-resume-metadata-refused.json +++ b/mobile/rpc-foundation/goldens/settings-resume-metadata-refused.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-resume-metadata-transport-error.json b/mobile/rpc-foundation/goldens/settings-resume-metadata-transport-error.json index b493d8301c26..3deb52b2b44b 100644 --- a/mobile/rpc-foundation/goldens/settings-resume-metadata-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-resume-metadata-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-hydration-fulfilled.json b/mobile/rpc-foundation/goldens/settings-task-hydration-fulfilled.json index f7402150df1c..e634538fa165 100644 --- a/mobile/rpc-foundation/goldens/settings-task-hydration-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-task-hydration-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-hydration-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-task-hydration-refuse-after-data.json index 675935e6a07c..83efbfab3712 100644 --- a/mobile/rpc-foundation/goldens/settings-task-hydration-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-task-hydration-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-hydration-refused.json b/mobile/rpc-foundation/goldens/settings-task-hydration-refused.json index 6f8b89786547..c0984fe9e71e 100644 --- a/mobile/rpc-foundation/goldens/settings-task-hydration-refused.json +++ b/mobile/rpc-foundation/goldens/settings-task-hydration-refused.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-hydration-transport-error.json b/mobile/rpc-foundation/goldens/settings-task-hydration-transport-error.json index 6f16b412587e..898195b8983f 100644 --- a/mobile/rpc-foundation/goldens/settings-task-hydration-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-task-hydration-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-create-linear.json b/mobile/rpc-foundation/goldens/settings-task-workspace-create-linear.json index d1e31a418e89..b7df634d4901 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-create-linear.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-create-linear.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-create-pr-start-point.json b/mobile/rpc-foundation/goldens/settings-task-workspace-create-pr-start-point.json index 6f6ad5a0181a..ae87f0db1516 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-create-pr-start-point.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-create-pr-start-point.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-fulfilled.json b/mobile/rpc-foundation/goldens/settings-task-workspace-fulfilled.json index fe964a2851b2..b24de99905e4 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-refused.json b/mobile/rpc-foundation/goldens/settings-task-workspace-refused.json index a4cf15ec20de..b70fcbd41492 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-refused.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-refused.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-transport-error.json b/mobile/rpc-foundation/goldens/settings-task-workspace-transport-error.json index bf1825fc881d..849918850b6e 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-write.json b/mobile/rpc-foundation/goldens/settings-task-write.json index 16b50f96b152..c2427e4abd2e 100644 --- a/mobile/rpc-foundation/goldens/settings-task-write.json +++ b/mobile/rpc-foundation/goldens/settings-task-write.json @@ -3,7 +3,7 @@ "family": "settings-best-effort", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-context-fulfilled.json b/mobile/rpc-foundation/goldens/settings-workspace-context-fulfilled.json index 6d9360e04cb9..9fd051522b7c 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-context-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-context-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-context-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-workspace-context-refuse-after-data.json index 5a194a928fc8..26fd43778bff 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-context-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-context-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-context-refused.json b/mobile/rpc-foundation/goldens/settings-workspace-context-refused.json index 66dfc1b18a61..ff80fcec21e6 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-context-refused.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-context-refused.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-context-transport-error.json b/mobile/rpc-foundation/goldens/settings-workspace-context-transport-error.json index a4355d8caed2..cb3847b4becb 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-context-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-context-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-submit-fulfilled.json b/mobile/rpc-foundation/goldens/settings-workspace-submit-fulfilled.json index cceb0745c9b2..77dee7e13d73 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-submit-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-submit-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.workspace-submit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-submit-refused.json b/mobile/rpc-foundation/goldens/settings-workspace-submit-refused.json index 3de0a24d8558..a05ffe0f8ecb 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-submit-refused.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-submit-refused.json @@ -3,7 +3,7 @@ "family": "settings.workspace-submit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-submit-transport-error.json b/mobile/rpc-foundation/goldens/settings-workspace-submit-transport-error.json index 0e4952a9c408..5249b50344ff 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-submit-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-submit-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.workspace-submit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/speech-audio-chunk-acknowledged.json b/mobile/rpc-foundation/goldens/speech-audio-chunk-acknowledged.json index 9dc8018eb3a3..bbe5dfede8f4 100644 --- a/mobile/rpc-foundation/goldens/speech-audio-chunk-acknowledged.json +++ b/mobile/rpc-foundation/goldens/speech-audio-chunk-acknowledged.json @@ -3,7 +3,7 @@ "family": "speech.dictation-chunk", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-desktop-start-fulfilled.json b/mobile/rpc-foundation/goldens/speech-desktop-start-fulfilled.json index 5829932c84a2..87c4248cd47c 100644 --- a/mobile/rpc-foundation/goldens/speech-desktop-start-fulfilled.json +++ b/mobile/rpc-foundation/goldens/speech-desktop-start-fulfilled.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-desktop-start-recording-failed.json b/mobile/rpc-foundation/goldens/speech-desktop-start-recording-failed.json index c357fd080b1b..38c3993f7c55 100644 --- a/mobile/rpc-foundation/goldens/speech-desktop-start-recording-failed.json +++ b/mobile/rpc-foundation/goldens/speech-desktop-start-recording-failed.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-desktop-start-superseded.json b/mobile/rpc-foundation/goldens/speech-desktop-start-superseded.json index ff341a979c27..c412fe2e6ba0 100644 --- a/mobile/rpc-foundation/goldens/speech-desktop-start-superseded.json +++ b/mobile/rpc-foundation/goldens/speech-desktop-start-superseded.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-dictation-session-cancelled.json b/mobile/rpc-foundation/goldens/speech-dictation-session-cancelled.json index 33dce7408fe7..2e9f7373bffa 100644 --- a/mobile/rpc-foundation/goldens/speech-dictation-session-cancelled.json +++ b/mobile/rpc-foundation/goldens/speech-dictation-session-cancelled.json @@ -3,7 +3,7 @@ "family": "speech.dictation-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-dictation-session-transcript.json b/mobile/rpc-foundation/goldens/speech-dictation-session-transcript.json index bbdd26362055..f850611e6c25 100644 --- a/mobile/rpc-foundation/goldens/speech-dictation-session-transcript.json +++ b/mobile/rpc-foundation/goldens/speech-dictation-session-transcript.json @@ -3,7 +3,7 @@ "family": "speech.dictation-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-setup-sheet-denied-to-mobile.json b/mobile/rpc-foundation/goldens/speech-setup-sheet-denied-to-mobile.json index e074e2b00fb9..fb2d8d4f7ce6 100644 --- a/mobile/rpc-foundation/goldens/speech-setup-sheet-denied-to-mobile.json +++ b/mobile/rpc-foundation/goldens/speech-setup-sheet-denied-to-mobile.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-setup-sheet-fulfilled.json b/mobile/rpc-foundation/goldens/speech-setup-sheet-fulfilled.json index ad2c2b29997a..2195bfb30d7a 100644 --- a/mobile/rpc-foundation/goldens/speech-setup-sheet-fulfilled.json +++ b/mobile/rpc-foundation/goldens/speech-setup-sheet-fulfilled.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-setup-sheet-legacy-desktop.json b/mobile/rpc-foundation/goldens/speech-setup-sheet-legacy-desktop.json index f9ff05f9bfae..30e2fffee620 100644 --- a/mobile/rpc-foundation/goldens/speech-setup-sheet-legacy-desktop.json +++ b/mobile/rpc-foundation/goldens/speech-setup-sheet-legacy-desktop.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-setup-sheet-model-vocabulary.json b/mobile/rpc-foundation/goldens/speech-setup-sheet-model-vocabulary.json index a861cd3df34f..7ac10312b69c 100644 --- a/mobile/rpc-foundation/goldens/speech-setup-sheet-model-vocabulary.json +++ b/mobile/rpc-foundation/goldens/speech-setup-sheet-model-vocabulary.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/structured-agent-session-created.json b/mobile/rpc-foundation/goldens/structured-agent-session-created.json index c6ee43ea4892..affd710223a7 100644 --- a/mobile/rpc-foundation/goldens/structured-agent-session-created.json +++ b/mobile/rpc-foundation/goldens/structured-agent-session-created.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-created.json b/mobile/rpc-foundation/goldens/structured-launch-created.json index fee02228fc6d..37241af0e8c6 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-created.json +++ b/mobile/rpc-foundation/goldens/structured-launch-created.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-definitive-refusal.json b/mobile/rpc-foundation/goldens/structured-launch-definitive-refusal.json index a8ee592e54e4..25ba8d1df898 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-definitive-refusal.json +++ b/mobile/rpc-foundation/goldens/structured-launch-definitive-refusal.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-replays-dropped-create.json b/mobile/rpc-foundation/goldens/structured-launch-replays-dropped-create.json index 682e73782d98..5e88d8eac711 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-replays-dropped-create.json +++ b/mobile/rpc-foundation/goldens/structured-launch-replays-dropped-create.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-support-refused.json b/mobile/rpc-foundation/goldens/structured-launch-support-refused.json index 11a1ae08e72f..f43915d8e835 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-support-refused.json +++ b/mobile/rpc-foundation/goldens/structured-launch-support-refused.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-unsupported.json b/mobile/rpc-foundation/goldens/structured-launch-unsupported.json index 1d2957a23943..f7faf6b482d5 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-unsupported.json +++ b/mobile/rpc-foundation/goldens/structured-launch-unsupported.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/tasks-route-repo-list.json b/mobile/rpc-foundation/goldens/tasks-route-repo-list.json index f8ef9c417d67..3e084c448c7f 100644 --- a/mobile/rpc-foundation/goldens/tasks-route-repo-list.json +++ b/mobile/rpc-foundation/goldens/tasks-route-repo-list.json @@ -3,7 +3,7 @@ "family": "tasks.route-repo-list", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "23f974df8b57c723069605de1db80c339ead286b18aae38e67fce03ea50c5180", diff --git a/mobile/rpc-foundation/goldens/terminal-gesture-flush-and-clear.json b/mobile/rpc-foundation/goldens/terminal-gesture-flush-and-clear.json index 3f3a88e9bae4..53f0662a808e 100644 --- a/mobile/rpc-foundation/goldens/terminal-gesture-flush-and-clear.json +++ b/mobile/rpc-foundation/goldens/terminal-gesture-flush-and-clear.json @@ -3,7 +3,7 @@ "family": "session.terminal-gesture-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9d119d5ec320e2538105d6ff673b9f4b8e3decbe46527947489dffbcf2ac0472", diff --git a/mobile/rpc-foundation/goldens/terminal-input-send-accepted.json b/mobile/rpc-foundation/goldens/terminal-input-send-accepted.json index 10cd3e655730..af9abae2cc6a 100644 --- a/mobile/rpc-foundation/goldens/terminal-input-send-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-input-send-accepted.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-input-send-refused.json b/mobile/rpc-foundation/goldens/terminal-input-send-refused.json index 7ffb62337a0c..b56cd3f63949 100644 --- a/mobile/rpc-foundation/goldens/terminal-input-send-refused.json +++ b/mobile/rpc-foundation/goldens/terminal-input-send-refused.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-live-input-accepted.json b/mobile/rpc-foundation/goldens/terminal-live-input-accepted.json index ca673c6d5965..2dc412990ce0 100644 --- a/mobile/rpc-foundation/goldens/terminal-live-input-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-live-input-accepted.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-paste-accepted.json b/mobile/rpc-foundation/goldens/terminal-paste-accepted.json index e8fd3b767c4e..63c315bedaef 100644 --- a/mobile/rpc-foundation/goldens/terminal-paste-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-paste-accepted.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-paste-refused.json b/mobile/rpc-foundation/goldens/terminal-paste-refused.json index f488db77f385..49d2d72949c1 100644 --- a/mobile/rpc-foundation/goldens/terminal-paste-refused.json +++ b/mobile/rpc-foundation/goldens/terminal-paste-refused.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-query-reply-accepted.json b/mobile/rpc-foundation/goldens/terminal-query-reply-accepted.json index 19d2effe75d2..267c1fba6eef 100644 --- a/mobile/rpc-foundation/goldens/terminal-query-reply-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-query-reply-accepted.json @@ -3,7 +3,7 @@ "family": "terminal.query-reply", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-query-reply-unsubscribed.json b/mobile/rpc-foundation/goldens/terminal-query-reply-unsubscribed.json index d7676e22d1c0..ff7f371a4c43 100644 --- a/mobile/rpc-foundation/goldens/terminal-query-reply-unsubscribed.json +++ b/mobile/rpc-foundation/goldens/terminal-query-reply-unsubscribed.json @@ -3,7 +3,7 @@ "family": "terminal.query-reply", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-raw-input-refused.json b/mobile/rpc-foundation/goldens/terminal-raw-input-refused.json index 9946ad0e68dd..26ffb508c4a4 100644 --- a/mobile/rpc-foundation/goldens/terminal-raw-input-refused.json +++ b/mobile/rpc-foundation/goldens/terminal-raw-input-refused.json @@ -3,7 +3,7 @@ "family": "terminal.raw-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-raw-input-reported.json b/mobile/rpc-foundation/goldens/terminal-raw-input-reported.json index 3c20eb9d6a9d..aee36c3ce7c0 100644 --- a/mobile/rpc-foundation/goldens/terminal-raw-input-reported.json +++ b/mobile/rpc-foundation/goldens/terminal-raw-input-reported.json @@ -3,7 +3,7 @@ "family": "terminal.raw-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-takeover-report-accepted.json b/mobile/rpc-foundation/goldens/terminal-takeover-report-accepted.json index e3fab46651aa..123147a10b4e 100644 --- a/mobile/rpc-foundation/goldens/terminal-takeover-report-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-takeover-report-accepted.json @@ -3,7 +3,7 @@ "family": "terminal.takeover-report", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-takeover-report-retried.json b/mobile/rpc-foundation/goldens/terminal-takeover-report-retried.json index 58e97af466f4..006504661396 100644 --- a/mobile/rpc-foundation/goldens/terminal-takeover-report-retried.json +++ b/mobile/rpc-foundation/goldens/terminal-takeover-report-retried.json @@ -3,7 +3,7 @@ "family": "terminal.takeover-report", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-viewport-refit-applied.json b/mobile/rpc-foundation/goldens/terminal-viewport-refit-applied.json index 174eef0fa8f8..bfceb4f8565d 100644 --- a/mobile/rpc-foundation/goldens/terminal-viewport-refit-applied.json +++ b/mobile/rpc-foundation/goldens/terminal-viewport-refit-applied.json @@ -3,7 +3,7 @@ "family": "terminal.viewport-refit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-viewport-refit-legacy-desktop.json b/mobile/rpc-foundation/goldens/terminal-viewport-refit-legacy-desktop.json index 8ea1c81bd6b6..d2517fbbb0d8 100644 --- a/mobile/rpc-foundation/goldens/terminal-viewport-refit-legacy-desktop.json +++ b/mobile/rpc-foundation/goldens/terminal-viewport-refit-legacy-desktop.json @@ -3,7 +3,7 @@ "family": "terminal.viewport-refit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-worktree-connection-resolved.json b/mobile/rpc-foundation/goldens/terminal-worktree-connection-resolved.json index b60492b1439f..ffbc1b58c98a 100644 --- a/mobile/rpc-foundation/goldens/terminal-worktree-connection-resolved.json +++ b/mobile/rpc-foundation/goldens/terminal-worktree-connection-resolved.json @@ -3,7 +3,7 @@ "family": "session.worktree-connection", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/tk-create-github.json b/mobile/rpc-foundation/goldens/tk-create-github.json index 9edbf4c7c5b7..9830170d67b8 100644 --- a/mobile/rpc-foundation/goldens/tk-create-github.json +++ b/mobile/rpc-foundation/goldens/tk-create-github.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-create-gitlab.json b/mobile/rpc-foundation/goldens/tk-create-gitlab.json index 9ac18768f93d..8f1f8a62a986 100644 --- a/mobile/rpc-foundation/goldens/tk-create-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-create-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-create-linear.json b/mobile/rpc-foundation/goldens/tk-create-linear.json index 23757a18f58e..2a9126f46c34 100644 --- a/mobile/rpc-foundation/goldens/tk-create-linear.json +++ b/mobile/rpc-foundation/goldens/tk-create-linear.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-item-checks-files.json b/mobile/rpc-foundation/goldens/tk-item-checks-files.json index 15de8ca97705..114fedc21e0a 100644 --- a/mobile/rpc-foundation/goldens/tk-item-checks-files.json +++ b/mobile/rpc-foundation/goldens/tk-item-checks-files.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/tk-item-comment-github.json b/mobile/rpc-foundation/goldens/tk-item-comment-github.json index 37c608059188..937620fb1714 100644 --- a/mobile/rpc-foundation/goldens/tk-item-comment-github.json +++ b/mobile/rpc-foundation/goldens/tk-item-comment-github.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-comment-gitlab-mr.json b/mobile/rpc-foundation/goldens/tk-item-comment-gitlab-mr.json index 3ba00962b59e..11fec15f8f1c 100644 --- a/mobile/rpc-foundation/goldens/tk-item-comment-gitlab-mr.json +++ b/mobile/rpc-foundation/goldens/tk-item-comment-gitlab-mr.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-comment-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-comment-gitlab.json index d2149f2bbb81..8a390b7186a8 100644 --- a/mobile/rpc-foundation/goldens/tk-item-comment-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-comment-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-github-reactions.json b/mobile/rpc-foundation/goldens/tk-item-detail-github-reactions.json index ec05baaebff0..b3d2c0fd311b 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-github-reactions.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-github-reactions.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-github.json b/mobile/rpc-foundation/goldens/tk-item-detail-github.json index b9c0b5cf4d9a..6a8dfa8fcf1c 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-github.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-github.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-gitlab-reactions.json b/mobile/rpc-foundation/goldens/tk-item-detail-gitlab-reactions.json index 3a85e9dfb3bc..7588e2b55743 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-gitlab-reactions.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-gitlab-reactions.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-detail-gitlab.json index 85466d2d9a5d..57bb99c0af6c 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-linear.json b/mobile/rpc-foundation/goldens/tk-item-detail-linear.json index 4104e9807b09..02a387d6fd09 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-linear.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-linear.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-metadata.json b/mobile/rpc-foundation/goldens/tk-item-detail-metadata.json index b7d3c3548a8b..bd56fe66b9d9 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-metadata.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-metadata.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/tk-item-merge-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-merge-gitlab.json index f0f1cee85a66..f5ff4f3bfe27 100644 --- a/mobile/rpc-foundation/goldens/tk-item-merge-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-merge-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-merge-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-metadata-github.json b/mobile/rpc-foundation/goldens/tk-item-metadata-github.json index 5baef64f2e6d..e8db3fab93e9 100644 --- a/mobile/rpc-foundation/goldens/tk-item-metadata-github.json +++ b/mobile/rpc-foundation/goldens/tk-item-metadata-github.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab-mr.json b/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab-mr.json index 084b033b3961..e7574077a8bc 100644 --- a/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab-mr.json +++ b/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab-mr.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab.json index ce49d95e7478..75f62fb2bc81 100644 --- a/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/tk-item-reply-merge.json b/mobile/rpc-foundation/goldens/tk-item-reply-merge.json index 0b84be2a477c..c20fe0cd3cab 100644 --- a/mobile/rpc-foundation/goldens/tk-item-reply-merge.json +++ b/mobile/rpc-foundation/goldens/tk-item-reply-merge.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-review-github.json b/mobile/rpc-foundation/goldens/tk-item-review-github.json index 4f77e5964ab6..13691d478568 100644 --- a/mobile/rpc-foundation/goldens/tk-item-review-github.json +++ b/mobile/rpc-foundation/goldens/tk-item-review-github.json @@ -3,7 +3,7 @@ "family": "tasks.item-review-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-status-gitlab-mr.json b/mobile/rpc-foundation/goldens/tk-item-status-gitlab-mr.json index fd4bf42ab43f..589b2509acab 100644 --- a/mobile/rpc-foundation/goldens/tk-item-status-gitlab-mr.json +++ b/mobile/rpc-foundation/goldens/tk-item-status-gitlab-mr.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/tk-item-status-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-status-gitlab.json index f1f85970c988..0575f6fb77b1 100644 --- a/mobile/rpc-foundation/goldens/tk-item-status-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-status-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/tk-linear-connect.json b/mobile/rpc-foundation/goldens/tk-linear-connect.json index 74b99af9a036..88ed753809b0 100644 --- a/mobile/rpc-foundation/goldens/tk-linear-connect.json +++ b/mobile/rpc-foundation/goldens/tk-linear-connect.json @@ -3,7 +3,7 @@ "family": "tasks.linear-connect", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-linear-item.json b/mobile/rpc-foundation/goldens/tk-linear-item.json index ed7a2a596aba..2be2f8b7b8b3 100644 --- a/mobile/rpc-foundation/goldens/tk-linear-item.json +++ b/mobile/rpc-foundation/goldens/tk-linear-item.json @@ -3,7 +3,7 @@ "family": "tasks.linear-item", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/tk-linear-team-context.json b/mobile/rpc-foundation/goldens/tk-linear-team-context.json index a6770bfc5ac5..f95a5921fb73 100644 --- a/mobile/rpc-foundation/goldens/tk-linear-team-context.json +++ b/mobile/rpc-foundation/goldens/tk-linear-team-context.json @@ -3,7 +3,7 @@ "family": "tasks.linear-team-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/tk-list-gitlab-items.json b/mobile/rpc-foundation/goldens/tk-list-gitlab-items.json index 37eff4e25338..17075a6ac7e6 100644 --- a/mobile/rpc-foundation/goldens/tk-list-gitlab-items.json +++ b/mobile/rpc-foundation/goldens/tk-list-gitlab-items.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-gitlab-items", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-list-gitlab-todos.json b/mobile/rpc-foundation/goldens/tk-list-gitlab-todos.json index 2cbfdc71345d..105030cfffcf 100644 --- a/mobile/rpc-foundation/goldens/tk-list-gitlab-todos.json +++ b/mobile/rpc-foundation/goldens/tk-list-gitlab-todos.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-gitlab-todos", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-list-linear.json b/mobile/rpc-foundation/goldens/tk-list-linear.json index 2cdee6f7f840..e59427608a02 100644 --- a/mobile/rpc-foundation/goldens/tk-list-linear.json +++ b/mobile/rpc-foundation/goldens/tk-list-linear.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-project-board-load.json b/mobile/rpc-foundation/goldens/tk-project-board-load.json index d495876e45a7..34f6c223cb83 100644 --- a/mobile/rpc-foundation/goldens/tk-project-board-load.json +++ b/mobile/rpc-foundation/goldens/tk-project-board-load.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/tk-project-repo-slugs.json b/mobile/rpc-foundation/goldens/tk-project-repo-slugs.json index 13bea2fa111a..a8da1a688d3a 100644 --- a/mobile/rpc-foundation/goldens/tk-project-repo-slugs.json +++ b/mobile/rpc-foundation/goldens/tk-project-repo-slugs.json @@ -3,7 +3,7 @@ "family": "tasks.project-repo-slugs", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-comments-issue.json b/mobile/rpc-foundation/goldens/tk-project-row-comments-issue.json index ad2609c4a53b..e0551419589f 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-comments-issue.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-comments-issue.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-issue", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-comments-pr.json b/mobile/rpc-foundation/goldens/tk-project-row-comments-pr.json index cc93506baee5..4dc462a452db 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-comments-pr.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-comments-pr.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-pr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-detail.json b/mobile/rpc-foundation/goldens/tk-project-row-detail.json index f81ea5085c2d..77e96fd0a809 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-detail.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-detail.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-detail", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-fields.json b/mobile/rpc-foundation/goldens/tk-project-row-fields.json index ecf900b7b9b4..4b6aca5c43f3 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-fields.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-fields.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-fields", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-files-merge.json b/mobile/rpc-foundation/goldens/tk-project-row-files-merge.json index 50770208962d..3ce1d9fe9843 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-files-merge.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-files-merge.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-metadata-load.json b/mobile/rpc-foundation/goldens/tk-project-row-metadata-load.json index b22f912af37d..18af22344d0e 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-metadata-load.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-metadata-load.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-metadata-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-review-checks.json b/mobile/rpc-foundation/goldens/tk-project-row-review-checks.json index 065975ecbd28..a0c52914a8fc 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-review-checks.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-review-checks.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-threads.json b/mobile/rpc-foundation/goldens/tk-project-row-threads.json index 3f77cab43cf5..edfa9242eef2 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-threads.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-threads.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/tk-provider-load.json b/mobile/rpc-foundation/goldens/tk-provider-load.json index ad1489bb3ad3..3d3e4ad8534b 100644 --- a/mobile/rpc-foundation/goldens/tk-provider-load.json +++ b/mobile/rpc-foundation/goldens/tk-provider-load.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/transport-capability-probe-cutover-reasks-fast.json b/mobile/rpc-foundation/goldens/transport-capability-probe-cutover-reasks-fast.json index fc3e688a0d54..cfbce33331d5 100644 --- a/mobile/rpc-foundation/goldens/transport-capability-probe-cutover-reasks-fast.json +++ b/mobile/rpc-foundation/goldens/transport-capability-probe-cutover-reasks-fast.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-capability-probe-non-string-capabilities-drop.json b/mobile/rpc-foundation/goldens/transport-capability-probe-non-string-capabilities-drop.json index c5f1d44911e2..59e0b1ec0d12 100644 --- a/mobile/rpc-foundation/goldens/transport-capability-probe-non-string-capabilities-drop.json +++ b/mobile/rpc-foundation/goldens/transport-capability-probe-non-string-capabilities-drop.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-capability-probe-publishes.json b/mobile/rpc-foundation/goldens/transport-capability-probe-publishes.json index 4283db94a478..8cd9d2180288 100644 --- a/mobile/rpc-foundation/goldens/transport-capability-probe-publishes.json +++ b/mobile/rpc-foundation/goldens/transport-capability-probe-publishes.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-capability-probe-refused-backs-off.json b/mobile/rpc-foundation/goldens/transport-capability-probe-refused-backs-off.json index ebb9d1fb9328..363f217f67e3 100644 --- a/mobile/rpc-foundation/goldens/transport-capability-probe-refused-backs-off.json +++ b/mobile/rpc-foundation/goldens/transport-capability-probe-refused-backs-off.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-host-status-gates-drop-keeps-capabilities.json b/mobile/rpc-foundation/goldens/transport-host-status-gates-drop-keeps-capabilities.json index 9aa6562f39ff..d19121177929 100644 --- a/mobile/rpc-foundation/goldens/transport-host-status-gates-drop-keeps-capabilities.json +++ b/mobile/rpc-foundation/goldens/transport-host-status-gates-drop-keeps-capabilities.json @@ -3,7 +3,7 @@ "family": "transport.host-status-gates", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-host-status-gates-ready.json b/mobile/rpc-foundation/goldens/transport-host-status-gates-ready.json index 40132e9e1ecc..0d313eb204a3 100644 --- a/mobile/rpc-foundation/goldens/transport-host-status-gates-ready.json +++ b/mobile/rpc-foundation/goldens/transport-host-status-gates-ready.json @@ -3,7 +3,7 @@ "family": "transport.host-status-gates", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-host-status-gates-refused-degrades.json b/mobile/rpc-foundation/goldens/transport-host-status-gates-refused-degrades.json index 99d4963780df..daafc2f194a5 100644 --- a/mobile/rpc-foundation/goldens/transport-host-status-gates-refused-degrades.json +++ b/mobile/rpc-foundation/goldens/transport-host-status-gates-refused-degrades.json @@ -3,7 +3,7 @@ "family": "transport.host-status-gates", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-pairing-race-both-refused.json b/mobile/rpc-foundation/goldens/transport-pairing-race-both-refused.json index 3d655a8f42bd..1b02fe839e6f 100644 --- a/mobile/rpc-foundation/goldens/transport-pairing-race-both-refused.json +++ b/mobile/rpc-foundation/goldens/transport-pairing-race-both-refused.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-pairing-race-direct-completes-first.json b/mobile/rpc-foundation/goldens/transport-pairing-race-direct-completes-first.json index 92a2b4eecd70..adcfd69373f9 100644 --- a/mobile/rpc-foundation/goldens/transport-pairing-race-direct-completes-first.json +++ b/mobile/rpc-foundation/goldens/transport-pairing-race-direct-completes-first.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-pairing-race-relay-completes-first.json b/mobile/rpc-foundation/goldens/transport-pairing-race-relay-completes-first.json index 2feb84554d1a..d65876fc4ecc 100644 --- a/mobile/rpc-foundation/goldens/transport-pairing-race-relay-completes-first.json +++ b/mobile/rpc-foundation/goldens/transport-pairing-race-relay-completes-first.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-pairing-race-relay-wins-when-direct-refused.json b/mobile/rpc-foundation/goldens/transport-pairing-race-relay-wins-when-direct-refused.json index 957af87f1608..86f3ee3ab582 100644 --- a/mobile/rpc-foundation/goldens/transport-pairing-race-relay-wins-when-direct-refused.json +++ b/mobile/rpc-foundation/goldens/transport-pairing-race-relay-wins-when-direct-refused.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/tw-capabilities-advertised.json b/mobile/rpc-foundation/goldens/tw-capabilities-advertised.json index 556c4b649c22..34dd6a265cac 100644 --- a/mobile/rpc-foundation/goldens/tw-capabilities-advertised.json +++ b/mobile/rpc-foundation/goldens/tw-capabilities-advertised.json @@ -3,7 +3,7 @@ "family": "worktree.runtime-capabilities", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-capabilities-cutover-retried.json b/mobile/rpc-foundation/goldens/tw-capabilities-cutover-retried.json index 8573b4902c7d..7f8e6c35efed 100644 --- a/mobile/rpc-foundation/goldens/tw-capabilities-cutover-retried.json +++ b/mobile/rpc-foundation/goldens/tw-capabilities-cutover-retried.json @@ -3,7 +3,7 @@ "family": "worktree.runtime-capabilities", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-capabilities-legacy-idempotency.json b/mobile/rpc-foundation/goldens/tw-capabilities-legacy-idempotency.json index 12ac26904e2b..3ec385f6f9d5 100644 --- a/mobile/rpc-foundation/goldens/tw-capabilities-legacy-idempotency.json +++ b/mobile/rpc-foundation/goldens/tw-capabilities-legacy-idempotency.json @@ -3,7 +3,7 @@ "family": "worktree.runtime-capabilities", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-agent-launched.json b/mobile/rpc-foundation/goldens/tw-create-retry-agent-launched.json index 35bcbfa6500d..6d54ac9bd0f9 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-agent-launched.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-agent-launched.json @@ -3,11 +3,11 @@ "family": "worktree.agent-launch-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", - "scenarioSha256": "85595f5fdde16441d22bf07c14c65edda6cb90019d036aae2c5031d19664e66f", + "scenarioSha256": "d193972745f28b4a8da9b19176ba9825b7b6eb78f28802c6f6eea99e155fdfe6", "platform": "darwin", "scenarioVersion": 1, "projectionVersion": 2, diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-after-drop.json b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-after-drop.json index 0e109a4c28c4..a339da97815f 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-after-drop.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-after-drop.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-while-connected.json b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-while-connected.json index 5174ee540e1c..f3a296d40383 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-while-connected.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-while-connected.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-without-idempotency.json b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-without-idempotency.json index 1937c32ae842..226e3704417a 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-without-idempotency.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-without-idempotency.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-created.json b/mobile/rpc-foundation/goldens/tw-create-retry-created.json index b419ccb9433d..328da8b46637 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-created.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-created.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-name-collision.json b/mobile/rpc-foundation/goldens/tw-create-retry-name-collision.json index addd1959fa95..8e2f03728146 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-name-collision.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-name-collision.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-unretryable-refusal.json b/mobile/rpc-foundation/goldens/tw-create-retry-unretryable-refusal.json index 38dfeaf46a9c..79d832aa93cb 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-unretryable-refusal.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-unretryable-refusal.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-warning-kept.json b/mobile/rpc-foundation/goldens/tw-create-retry-warning-kept.json index 6516a11579da..2f6fb9691fe4 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-warning-kept.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-warning-kept.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-hosted-base-resolved.json b/mobile/rpc-foundation/goldens/tw-hosted-base-resolved.json index ee87403dcdd0..8a68e2be5b0b 100644 --- a/mobile/rpc-foundation/goldens/tw-hosted-base-resolved.json +++ b/mobile/rpc-foundation/goldens/tw-hosted-base-resolved.json @@ -3,7 +3,7 @@ "family": "worktree.hosted-base", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-hosted-base-soft-error.json b/mobile/rpc-foundation/goldens/tw-hosted-base-soft-error.json index ca34001ac4f2..a5a19cb97450 100644 --- a/mobile/rpc-foundation/goldens/tw-hosted-base-soft-error.json +++ b/mobile/rpc-foundation/goldens/tw-hosted-base-soft-error.json @@ -3,7 +3,7 @@ "family": "worktree.hosted-base", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-paste-lookup-resolved.json b/mobile/rpc-foundation/goldens/tw-paste-lookup-resolved.json index 74e3431b0c56..9fa9a5c28864 100644 --- a/mobile/rpc-foundation/goldens/tw-paste-lookup-resolved.json +++ b/mobile/rpc-foundation/goldens/tw-paste-lookup-resolved.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-refused.json b/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-refused.json index 382f8b47a988..4636455e202c 100644 --- a/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-refused.json +++ b/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-refused.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-unsupported.json b/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-unsupported.json index 5cf0fb3c664d..893cca287b6f 100644 --- a/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-unsupported.json +++ b/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-unsupported.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-setup-hook-trust-always.json b/mobile/rpc-foundation/goldens/tw-setup-hook-trust-always.json index 07943ec88643..267496fd5558 100644 --- a/mobile/rpc-foundation/goldens/tw-setup-hook-trust-always.json +++ b/mobile/rpc-foundation/goldens/tw-setup-hook-trust-always.json @@ -3,7 +3,7 @@ "family": "worktree.setup-hook-trust", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-setup-hook-trust-approved.json b/mobile/rpc-foundation/goldens/tw-setup-hook-trust-approved.json index e9c9c89dd104..b7502a2fbd9d 100644 --- a/mobile/rpc-foundation/goldens/tw-setup-hook-trust-approved.json +++ b/mobile/rpc-foundation/goldens/tw-setup-hook-trust-approved.json @@ -3,7 +3,7 @@ "family": "worktree.setup-hook-trust", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-smart-search-all-providers.json b/mobile/rpc-foundation/goldens/tw-smart-search-all-providers.json index eb5eec8394d4..4495984796dd 100644 --- a/mobile/rpc-foundation/goldens/tw-smart-search-all-providers.json +++ b/mobile/rpc-foundation/goldens/tw-smart-search-all-providers.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-smart-search-gitlab-provider-error.json b/mobile/rpc-foundation/goldens/tw-smart-search-gitlab-provider-error.json index c5a55c67575f..0dcb43858260 100644 --- a/mobile/rpc-foundation/goldens/tw-smart-search-gitlab-provider-error.json +++ b/mobile/rpc-foundation/goldens/tw-smart-search-gitlab-provider-error.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-smart-search-linear-listed.json b/mobile/rpc-foundation/goldens/tw-smart-search-linear-listed.json index a1b1cdd02478..6dba57e250b5 100644 --- a/mobile/rpc-foundation/goldens/tw-smart-search-linear-listed.json +++ b/mobile/rpc-foundation/goldens/tw-smart-search-linear-listed.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-task-preferences-resume-write.json b/mobile/rpc-foundation/goldens/tw-task-preferences-resume-write.json index 6184077cf597..52720072511e 100644 --- a/mobile/rpc-foundation/goldens/tw-task-preferences-resume-write.json +++ b/mobile/rpc-foundation/goldens/tw-task-preferences-resume-write.json @@ -3,7 +3,7 @@ "family": "settings-best-effort", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-source-presets-refused.json b/mobile/rpc-foundation/goldens/tw-workspace-source-presets-refused.json index 0b246c454262..b65f14ebf0ab 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-source-presets-refused.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-source-presets-refused.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-source", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-source-presets.json b/mobile/rpc-foundation/goldens/tw-workspace-source-presets.json index ada7e73f2320..e6674e63ca30 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-source-presets.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-source-presets.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-source", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-sparse-missing-preset.json b/mobile/rpc-foundation/goldens/tw-workspace-sparse-missing-preset.json index aa5fb681f76f..d908aa970ff1 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-sparse-missing-preset.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-sparse-missing-preset.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-sparse", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-sparse-saved.json b/mobile/rpc-foundation/goldens/tw-workspace-sparse-saved.json index a9a0adfbd305..f7c7b9d3509b 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-sparse-saved.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-sparse-saved.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-sparse", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-ssh-connect-refused.json b/mobile/rpc-foundation/goldens/tw-workspace-ssh-connect-refused.json index f77e63d59d40..6b4d1c0fcb43 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-ssh-connect-refused.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-ssh-connect-refused.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-ssh-connected.json b/mobile/rpc-foundation/goldens/tw-workspace-ssh-connected.json index dbdf3aa282df..c93bbbcdef57 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-ssh-connected.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-ssh-connected.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-ssh-local-agents.json b/mobile/rpc-foundation/goldens/tw-workspace-ssh-local-agents.json index 42ab1548b5c2..ccfccc512c36 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-ssh-local-agents.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-ssh-local-agents.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh-local", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-ssh-not-ready.json b/mobile/rpc-foundation/goldens/tw-workspace-ssh-not-ready.json index 31f60e7b6355..acd77a24c78a 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-ssh-not-ready.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-ssh-not-ready.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/worktree-catalog-snapshot-unreadable.json b/mobile/rpc-foundation/goldens/worktree-catalog-snapshot-unreadable.json index 14d129b25f20..44cec939c661 100644 --- a/mobile/rpc-foundation/goldens/worktree-catalog-snapshot-unreadable.json +++ b/mobile/rpc-foundation/goldens/worktree-catalog-snapshot-unreadable.json @@ -3,7 +3,7 @@ "family": "worktree.catalog-snapshot", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/worktree-catalog-snapshot.json b/mobile/rpc-foundation/goldens/worktree-catalog-snapshot.json index 79b9fd77f2ab..c09e3cbce452 100644 --- a/mobile/rpc-foundation/goldens/worktree-catalog-snapshot.json +++ b/mobile/rpc-foundation/goldens/worktree-catalog-snapshot.json @@ -3,7 +3,7 @@ "family": "worktree.catalog-snapshot", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/worktree-home-catalog.json b/mobile/rpc-foundation/goldens/worktree-home-catalog.json index 596cae592e75..c0b50f6fdb90 100644 --- a/mobile/rpc-foundation/goldens/worktree-home-catalog.json +++ b/mobile/rpc-foundation/goldens/worktree-home-catalog.json @@ -3,7 +3,7 @@ "family": "worktree.home-catalog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/worktree-retired-names.json b/mobile/rpc-foundation/goldens/worktree-retired-names.json index 4d24bf3cb445..14cdb3646167 100644 --- a/mobile/rpc-foundation/goldens/worktree-retired-names.json +++ b/mobile/rpc-foundation/goldens/worktree-retired-names.json @@ -3,7 +3,7 @@ "family": "worktree.retired-names", "namedDeltas": [], "runnerVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/pilot-scenarios.json b/mobile/rpc-foundation/pilot-scenarios.json index 58bb048ec615..254c36272b10 100644 --- a/mobile/rpc-foundation/pilot-scenarios.json +++ b/mobile/rpc-foundation/pilot-scenarios.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "baseline": "2077956254c707d904c066ca890dc25f3671fb70", + "baseline": "03995ae29d28dd39bd2546423831987db68985de", "scenarios": [ { "id": "b1", @@ -5939,7 +5939,7 @@ "family": "worktree.agent-launch-create", "sites": [ "mobile/src/tasks/worktree-create-retry.ts", - "mobile/src/tasks/agent-launch-worktree-create.ts" + "mobile/src/tasks/agent-launch-request.ts" ], "schedules": [], "steps": [ @@ -9382,37 +9382,78 @@ "checkpoint": "pending" }, { - "complete": "session.tabs.createTerminal#1", + "complete": "repo.list#1", "params": { - "worktree": "id:repo-9::/w", - "activate": false, - "select": true, - "navigation": "caller" + "$undefined": true }, "reply": { "ok": true, "result": { - "tab": { - "id": "tab-1", - "type": "terminal", - "terminal": "term-1", - "title": "Agent" + "repos": [ + { + "id": "repo-9" + } + ] + } + } + }, + { + "complete": "settings.get#1", + "params": { + "$undefined": true + }, + "reply": { + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] } } } }, { - "complete": "terminal.send#1", + "complete": "preflight.detectAgents#1", "params": { - "terminal": "term-1", - "text": "Fix the failing checks", - "enter": true + "$undefined": true + }, + "reply": { + "ok": true, + "result": ["codex"] + } + }, + { + "complete": "agent.launchReplay#1", + "params": { + "agent": "codex", + "operationId": "1767225600000-00000000000040008000000000000001", + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + }, + "prompt": { + "text": "Fix the failing checks", + "delivery": "submit" + }, + "launchSource": "task_page" }, "reply": { "ok": true, "result": { - "send": { - "accepted": true + "outcome": { + "kind": "terminal", + "handle": "term-1" + }, + "worktreeId": "repo-9::/w", + "receipt": { + "mode": "terminal", + "preferred": "terminal", + "reason": "user_default", + "detail": "Started a terminal agent, the default for new agent tabs in your settings." + }, + "prompt": { + "delivery": "submit", + "outcome": "handed-to-terminal" } } } @@ -9423,7 +9464,7 @@ ] }, { - "id": "pr-triage-send-locked", + "id": "pr-triage-prompt-not-delivered", "operation": "session.pr-triage-launch", "version": 1, "family": "session.pr-triage", @@ -9435,48 +9476,89 @@ "id": "launch" }, { - "complete": "session.tabs.createTerminal#1", + "complete": "repo.list#1", "params": { - "worktree": "id:repo-9::/w", - "activate": false, - "select": true, - "navigation": "caller" + "$undefined": true }, "reply": { "ok": true, "result": { - "tab": { - "id": "tab-1", - "type": "terminal", - "terminal": "term-1", - "title": "Agent" + "repos": [ + { + "id": "repo-9" + } + ] + } + } + }, + { + "complete": "settings.get#1", + "params": { + "$undefined": true + }, + "reply": { + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] } } } }, { - "complete": "terminal.send#1", + "complete": "preflight.detectAgents#1", "params": { - "terminal": "term-1", - "text": "Fix the failing checks", - "enter": true + "$undefined": true + }, + "reply": { + "ok": true, + "result": ["codex"] + } + }, + { + "complete": "agent.launchReplay#1", + "params": { + "agent": "codex", + "operationId": "1767225600000-00000000000040008000000000000001", + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + }, + "prompt": { + "text": "Fix the failing checks", + "delivery": "submit" + }, + "launchSource": "task_page" }, "reply": { "ok": true, "result": { - "send": { - "accepted": false + "outcome": { + "kind": "terminal", + "handle": "term-1" + }, + "worktreeId": "repo-9::/w", + "receipt": { + "mode": "terminal", + "preferred": "terminal", + "reason": "user_default", + "detail": "Started a terminal agent, the default for new agent tabs in your settings." + }, + "prompt": { + "delivery": "submit", + "outcome": "not-delivered" } } } }, { - "checkpoint": "locked" + "checkpoint": "prompt-not-sent" } ] }, { - "id": "pr-triage-invalid-terminal", + "id": "pr-triage-launch-unconfirmed", "operation": "session.pr-triage-launch", "version": 1, "family": "session.pr-triage", @@ -9488,24 +9570,91 @@ "id": "launch" }, { - "complete": "session.tabs.createTerminal#1", + "complete": "repo.list#1", "params": { - "worktree": "id:repo-9::/w", - "activate": false, - "select": true, - "navigation": "caller" + "$undefined": true }, "reply": { "ok": true, "result": { - "tab": { - "id": "tab-1" + "repos": [ + { + "id": "repo-9" + } + ] + } + } + }, + { + "complete": "settings.get#1", + "params": { + "$undefined": true + }, + "reply": { + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": "codex", + "disabledTuiAgents": [] } } } }, { - "checkpoint": "invalid" + "complete": "preflight.detectAgents#1", + "params": { + "$undefined": true + }, + "reply": { + "ok": true, + "result": ["codex"] + } + }, + { + "complete": "agent.launchReplay#1", + "params": { + "agent": "codex", + "operationId": "1767225600000-00000000000040008000000000000001", + "target": { + "kind": "existing", + "worktree": "id:repo-9::/w" + }, + "prompt": { + "text": "Fix the failing checks", + "delivery": "submit" + }, + "launchSource": "task_page" + }, + "reply": { + "ok": false, + "error": { + "code": "agent_session_operation_unknown", + "message": "agent_session_operation_unknown" + } + } + }, + { + "checkpoint": "unconfirmed" + } + ] + }, + { + "id": "pr-triage-update-required", + "operation": "session.pr-triage-launch", + "version": 1, + "family": "session.pr-triage", + "sites": ["mobile/src/session/pr-ai-triage-launch.ts"], + "schedules": [], + "steps": [ + { + "action": "launch", + "id": "launch", + "args": { + "legacyHost": true + } + }, + { + "checkpoint": "update-required" } ] }, @@ -18657,7 +18806,7 @@ ] }, { - "id": "review-create-terminal-refused", + "id": "review-create-agent-refused", "operation": "session.diff-review-actions", "version": 1, "family": "session.diff-review-actions", @@ -18675,18 +18824,66 @@ "id": "create-and-send" }, { - "complete": "session.tabs.createTerminal#1", + "complete": "repo.list#1", "params": { - "activate": false, - "navigation": "caller", - "select": true, - "worktree": "id:workspace-1" + "$undefined": true + }, + "reply": { + "ok": true, + "result": { + "repos": [ + { + "id": "workspace-1" + } + ] + } + } + }, + { + "complete": "settings.get#1", + "params": { + "$undefined": true + }, + "reply": { + "ok": true, + "result": { + "settings": { + "defaultTuiAgent": null, + "disabledTuiAgents": [] + } + } + } + }, + { + "complete": "preflight.detectAgents#1", + "params": { + "$undefined": true + }, + "reply": { + "ok": true, + "result": ["claude"] + } + }, + { + "complete": "agent.launchReplay#1", + "params": { + "agent": "claude", + "operationId": "1767225600000-00000000000040008000000000000001", + "target": { + "kind": "existing", + "worktree": "id:workspace-1" + }, + "prompt": { + "delivery": "submit", + "text": "You are reviewing the current worktree. Address the following mobile review notes.\n\nFile: src/app.ts\nLine: 4\nUser comment: \"needs a test\"\n\nAfter applying fixes:\n1. Summarize changed files.\n2. Run relevant tests.\n3. Tell me if anything remains risky." + }, + "launchSource": "notes_send" }, "reply": { "ok": false, "error": { - "code": "worktree_busy", - "message": "Workspace is busy" + "code": "selector_not_found", + "message": "Workspace not found" } } }, diff --git a/mobile/src/components/AgentLaunchNotice.test.tsx b/mobile/src/components/AgentLaunchNotice.test.tsx new file mode 100644 index 000000000000..e1b7b07efce3 --- /dev/null +++ b/mobile/src/components/AgentLaunchNotice.test.tsx @@ -0,0 +1,94 @@ +import { createElement, type ReactNode } from 'react' +import { act, create, type ReactTestRenderer } from 'react-test-renderer' +import { afterEach, describe, expect, it, vi } from 'vitest' + +vi.mock('react-native', async () => { + const React = await import('react') + return { + Pressable: ({ children, ...props }: { children?: ReactNode }) => + React.createElement('Pressable', props, children), + Text: ({ children, ...props }: { children?: ReactNode }) => + React.createElement('Text', props, children), + View: ({ children, ...props }: { children?: ReactNode }) => + React.createElement('View', props, children), + StyleSheet: { create: (styles: unknown) => styles } + } +}) +vi.mock('../platform/clipboard', () => ({ + useClipboardWriter: () => ({ writeText: async () => {} }) +})) + +import { AgentLaunchNotice } from './AgentLaunchNotice' +import { AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE } from '../session/mobile-existing-agent-launch' +import type { MobileAgentLaunchAvailability } from '../session/mobile-agent-launch-availability' + +const ERROR_STYLE = { color: 'red' } + +describe('AgentLaunchNotice', () => { + let renderer: ReactTestRenderer | null = null + + afterEach(() => { + act(() => renderer?.unmount()) + renderer = null + }) + + function lines(props: { + availability?: MobileAgentLaunchAvailability + success?: string | null + error?: string | null + warning?: string | null + }): { text: string; isError: boolean }[] { + act(() => { + renderer = create( + createElement(AgentLaunchNotice, { + availability: props.availability ?? 'available', + success: props.success ?? null, + error: props.error ?? null, + warning: props.warning ?? null, + undeliveredPrompt: null, + errorStyle: ERROR_STYLE + }) + ) + }) + return (renderer?.root.findAll((node) => String(node.type) === 'Text') ?? []).map((node) => ({ + text: String(node.props.children), + isError: node.props.style === ERROR_STYLE + })) + } + + it('shows the host warning on a launch that went ahead as secondary text, not an error', () => { + expect(lines({ warning: 'the requested arguments were ignored.' })).toEqual([ + { text: 'the requested arguments were ignored.', isError: false } + ]) + }) + + it('keeps a real failure in the error style beside a warning', () => { + expect( + lines({ error: "The agent started, but the prompt wasn't sent.", warning: 'w' }) + ).toEqual([ + { text: "The agent started, but the prompt wasn't sent.", isError: true }, + { text: 'w', isError: false } + ]) + }) + + it('drops a stale warning while the host cannot take a launch', () => { + expect(lines({ availability: 'update-required', warning: 'w' })).toEqual([ + { text: AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE, isError: true } + ]) + }) + + it('confirms a launch that went ahead, with any host note beneath it', () => { + expect(lines({ success: 'Agent started in feature-login', warning: 'w' })).toEqual([ + { text: 'Agent started in feature-login', isError: false }, + { text: 'w', isError: false } + ]) + }) + + it('never confirms beside an error', () => { + expect(lines({ success: 'Agent started', error: 'e' })).toEqual([{ text: 'e', isError: true }]) + }) + + it('renders nothing with nothing to say', () => { + expect(lines({})).toEqual([]) + }) +}) diff --git a/mobile/src/components/AgentLaunchNotice.tsx b/mobile/src/components/AgentLaunchNotice.tsx new file mode 100644 index 000000000000..00d309477efa --- /dev/null +++ b/mobile/src/components/AgentLaunchNotice.tsx @@ -0,0 +1,89 @@ +import { useState } from 'react' +import { Pressable, StyleSheet, Text, View, type StyleProp, type TextStyle } from 'react-native' +import { useClipboardWriter } from '../platform/clipboard' +import { + AGENT_LAUNCH_STATUS_UNREADABLE_MESSAGE, + AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE +} from '../session/mobile-existing-agent-launch' +import type { MobileAgentLaunchAvailability } from '../session/mobile-agent-launch-availability' +import { colors, spacing, typography } from '../theme/mobile-theme' + +type Props = { + availability: MobileAgentLaunchAvailability + /** The confirmation that the agent started with its prompt. */ + success: string | null + error: string | null + /** The host's note on a launch that went ahead; secondary text, not an error. */ + warning: string | null + /** The prompt of an agent that started without it, offered for the user to paste in. */ + undeliveredPrompt: string | null + errorStyle: StyleProp +} + +/** The status line under an AI button that starts an agent with a prompt. */ +export function AgentLaunchNotice({ + availability, + success, + error, + warning, + undeliveredPrompt, + errorStyle +}: Props) { + const clipboard = useClipboardWriter() + const [copyState, setCopyState] = useState<{ prompt: string; label: string } | null>(null) + const availabilityMessage = + availability === 'update-required' + ? AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE + : availability === 'unverified' + ? AGENT_LAUNCH_STATUS_UNREADABLE_MESSAGE + : null + const message = availabilityMessage ?? error + const note = availabilityMessage ? null : warning + const confirmation = message ? null : success + if (!message && !note && !confirmation) { + return null + } + const copyLabel = + copyState && copyState.prompt === undeliveredPrompt ? copyState.label : 'Copy prompt' + return ( + + {confirmation ? {confirmation} : null} + {message ? {message} : null} + {note ? {note} : null} + {undeliveredPrompt ? ( + { + clipboard.writeText(undeliveredPrompt).then( + () => setCopyState({ prompt: undeliveredPrompt, label: 'Copied' }), + () => setCopyState({ prompt: undeliveredPrompt, label: "Couldn't copy" }) + ) + }} + accessibilityRole="button" + accessibilityLabel="Copy prompt" + hitSlop={spacing.sm} + > + {copyLabel} + + ) : null} + + ) +} + +const styles = StyleSheet.create({ + notice: { + gap: spacing.xs + }, + successText: { + color: colors.statusGreen, + fontSize: typography.metaSize + }, + warningText: { + color: colors.textSecondary, + fontSize: typography.metaSize + }, + copyText: { + color: colors.accentBlue, + fontSize: typography.metaSize, + fontWeight: '600' + } +}) diff --git a/mobile/src/components/MobileDiffReviewDrawers.tsx b/mobile/src/components/MobileDiffReviewDrawers.tsx index b3c418a8fb70..828a09beaec7 100644 --- a/mobile/src/components/MobileDiffReviewDrawers.tsx +++ b/mobile/src/components/MobileDiffReviewDrawers.tsx @@ -7,6 +7,7 @@ import type { ActionSheetAction } from './ActionSheetModal' import { ActionSheetContent } from './ActionSheetModal' import { ConfirmContent } from './ConfirmModal' import { KeyedBottomDrawer } from './keyed-bottom-drawer' +import { AGENT_LAUNCH_STATUS_UNREADABLE_MESSAGE } from '../session/mobile-existing-agent-launch' import { mobileReviewCountLabel, type ComposerState, @@ -110,7 +111,12 @@ function useSendActions( { label: 'New Agent Session', icon: Plus, - disabled: comments.length === 0, + disabled: comments.length === 0 || controller.agentLaunchAvailability !== 'available', + ...(controller.agentLaunchAvailability === 'update-required' + ? { hint: 'Update Orca on your computer' } + : controller.agentLaunchAvailability === 'unverified' + ? { hint: AGENT_LAUNCH_STATUS_UNREADABLE_MESSAGE } + : {}), skipAutoClose: true, onPress: () => void controller.createTerminalAndSend(comments) }, diff --git a/mobile/src/components/MobileDiffReviewScreenView.tsx b/mobile/src/components/MobileDiffReviewScreenView.tsx index 6fda33f76c58..06b24f3f5e76 100644 --- a/mobile/src/components/MobileDiffReviewScreenView.tsx +++ b/mobile/src/components/MobileDiffReviewScreenView.tsx @@ -124,6 +124,7 @@ export function MobileDiffReviewScreenView({ controller, onBack }: Props) { gitStatus={gitStatus} headSha={controller.prSidebarHeadSha} bottomInset={insets.bottom} + workspaceLabel={controller.worktreeLabel} /> ) : null} @@ -144,6 +145,7 @@ export function MobileDiffReviewScreenView({ controller, onBack }: Props) { gitBranch={controller.prSidebarBranch} gitStatus={gitStatus} headSha={controller.prSidebarHeadSha} + workspaceLabel={controller.worktreeLabel} /> ) : null} diff --git a/mobile/src/components/MobilePRSidebar.tsx b/mobile/src/components/MobilePRSidebar.tsx index 710adb685945..4f0aed5b28d9 100644 --- a/mobile/src/components/MobilePRSidebar.tsx +++ b/mobile/src/components/MobilePRSidebar.tsx @@ -14,6 +14,7 @@ import { type MobilePrTitleAction } from '../session/use-mobile-pr-title-action' import { useMobilePrAiTriage, type MobilePrAiTriage } from '../session/use-mobile-pr-ai-triage' +import { useHostProtocolGates } from './HostProtocolGate' import { usePRBotAuthorOverrides } from '../session/use-pr-bot-author-overrides' import { buildFixChecksPrompt, buildResolveConflictsPrompt } from '../session/pr-ai-triage-prompt' import { prSidebarRenderBranch } from './mobile-pr-sidebar-presentation' @@ -42,6 +43,8 @@ type Props = { bottomInset?: number // Hub chrome already shows open-on-web; hide the in-body icon there. showOpenOnWeb?: boolean + /** Named when an AI button's agent starts; the branch stands in when absent. */ + workspaceLabel: string | null } // Mutation hooks run unconditionally here and gate internally until a PR is ready. @@ -56,8 +59,10 @@ export function MobilePRSidebar({ gitStatus, headSha, bottomInset = 0, - showOpenOnWeb = true + showOpenOnWeb = true, + workspaceLabel }: Props) { + const launchWorkspaceLabel = workspaceLabel || gitBranch const branch = prSidebarRenderBranch(state) // prNumber is 0 until ready; the hook gates on `ready` so it never fires early. const prNumber = state.kind === 'ready' ? state.data.pr.number : 0 @@ -89,7 +94,16 @@ export function MobilePRSidebar({ prRepo, refetch }) - const triage = useMobilePrAiTriage({ client, connState, worktreeId }) + const { hostCapabilities, statusPending, statusReadable } = useHostProtocolGates() + const triage = useMobilePrAiTriage({ + client, + connState, + worktreeId, + workspaceLabel: launchWorkspaceLabel, + hostCapabilities, + hostStatusPending: statusPending, + hostStatusReadable: statusReadable + }) // Keyed on the PR payload identity so overrides re-fetch with each PR refetch // instead of staying a stale one-shot snapshot for the whole session. const botAuthorOverrides = usePRBotAuthorOverrides( @@ -122,6 +136,7 @@ export function MobilePRSidebar({ commentActions={commentActions} titleAction={titleAction} triage={triage} + workspaceLabel={launchWorkspaceLabel} botAuthorOverrides={botAuthorOverrides} showOpenOnWeb={showOpenOnWeb} /> @@ -143,6 +158,7 @@ function PrSidebarContent({ commentActions, titleAction, triage, + workspaceLabel, showOpenOnWeb, botAuthorOverrides }: { @@ -159,6 +175,7 @@ function PrSidebarContent({ commentActions: MobilePrCommentActions titleAction: MobilePrTitleAction triage: MobilePrAiTriage + workspaceLabel: string | null showOpenOnWeb: boolean botAuthorOverrides: ReadonlySet }) { @@ -211,6 +228,7 @@ function PrSidebarContent({ gitBranch={gitBranch} gitStatus={gitStatus} connState={connState} + workspaceLabel={workspaceLabel} onCreated={refetch} /> ) @@ -271,7 +289,8 @@ function PrSidebarSections({ }) ), isBusy: triage.isBusy('fix-checks'), - error: triage.error + availability: triage.availability, + ...triage.noticeFor('fix-checks') } const conflictsTriage = { resolveConflicts: () => @@ -283,7 +302,8 @@ function PrSidebarSections({ }) ), isBusy: triage.isBusy('resolve-conflicts'), - error: triage.error + availability: triage.availability, + ...triage.noticeFor('resolve-conflicts') } // One card for identity + actions so the ready PR isn't a stack of thin // duplicate blocks (badge row, title, branches, then another action band). diff --git a/mobile/src/components/mobile-diff-review-send-sheet-stacking.test.ts b/mobile/src/components/mobile-diff-review-send-sheet-stacking.test.ts index 017f57b28db2..f0e865dd4d12 100644 --- a/mobile/src/components/mobile-diff-review-send-sheet-stacking.test.ts +++ b/mobile/src/components/mobile-diff-review-send-sheet-stacking.test.ts @@ -108,6 +108,9 @@ function Screen({ client }: { client: RpcClient }) { controller = useMobileDiffReviewController({ client, connState: 'connected', + hostCapabilities: [], + hostStatusPending: false, + hostStatusReadable: true, hostId: 'host-1', worktreeId: 'wt-1', name: 'review', diff --git a/mobile/src/components/pr-sidebar/MobilePrViewPanel.tsx b/mobile/src/components/pr-sidebar/MobilePrViewPanel.tsx index f587074e12ee..4f76073e7cbe 100644 --- a/mobile/src/components/pr-sidebar/MobilePrViewPanel.tsx +++ b/mobile/src/components/pr-sidebar/MobilePrViewPanel.tsx @@ -17,6 +17,7 @@ type Props = { isGithubRepo?: boolean branchContextLoaded?: boolean controller: MobilePrSidebarController + workspaceLabel: string | null } // Chromeless PR sidebar body for the source-control hub's Pull Request segment. @@ -31,7 +32,8 @@ export function MobilePrViewPanelBody({ gitStatus, isGithubRepo = true, branchContextLoaded = true, - controller + controller, + workspaceLabel }: Props) { const insets = useSafeAreaInsets() @@ -64,6 +66,7 @@ export function MobilePrViewPanelBody({ bottomInset={insets.bottom} // Hub header already hosts open-on-web while this segment is active. showOpenOnWeb={false} + workspaceLabel={workspaceLabel} /> ) diff --git a/mobile/src/components/pr-sidebar/PRChecksSection.tsx b/mobile/src/components/pr-sidebar/PRChecksSection.tsx index 881c3c60bde5..67c4a71ed878 100644 --- a/mobile/src/components/pr-sidebar/PRChecksSection.tsx +++ b/mobile/src/components/pr-sidebar/PRChecksSection.tsx @@ -22,12 +22,18 @@ import { PRSection } from './PRSection' import { PRCheckDetailView, type DetailEntry } from './PRCheckDetail' import { mobilePrSidebarStyles as styles } from './mobile-pr-sidebar-styles' import { prAiTriageStyles as triageStyles } from './pr-ai-triage-styles' +import { AgentLaunchNotice } from '../AgentLaunchNotice' +import type { MobileAgentLaunchAvailability } from '../../session/mobile-agent-launch-availability' // Launches the "Fix checks with AI" agent. Absent for display-only usages. export type PrChecksTriage = { fixChecks: () => void isBusy: boolean + availability: MobileAgentLaunchAvailability + success: string | null error: string | null + warning: string | null + undeliveredPrompt: string | null } type Props = { @@ -190,7 +196,7 @@ export function PRChecksSection({ [triageStyles.triageStripButton, pressed && { opacity: 0.7 }]} onPress={triage.fixChecks} - disabled={triage.isBusy} + disabled={triage.isBusy || triage.availability !== 'available'} accessibilityRole="button" accessibilityLabel="Fix failing checks with AI" > @@ -203,7 +209,16 @@ export function PRChecksSection({ ) : null} - {triage?.error ? {triage.error} : null} + {triage ? ( + 0 ? triage.availability : 'available'} + success={triage.success} + error={triage.error} + warning={triage.warning} + undeliveredPrompt={triage.undeliveredPrompt} + errorStyle={triageStyles.triageError} + /> + ) : null} {checksError ? {checksError} : null} {sorted.map((check) => { const key = prCheckKey(check) diff --git a/mobile/src/components/pr-sidebar/PRConflictingFilesSection.tsx b/mobile/src/components/pr-sidebar/PRConflictingFilesSection.tsx index badb33a6fd07..99996fa1baf6 100644 --- a/mobile/src/components/pr-sidebar/PRConflictingFilesSection.tsx +++ b/mobile/src/components/pr-sidebar/PRConflictingFilesSection.tsx @@ -8,12 +8,18 @@ import { PRSection } from './PRSection' import { resolveConflictDisplay } from './pr-conflict-presentation' import { prConflictStyles as styles } from './pr-conflict-styles' import { prAiTriageStyles as triageStyles } from './pr-ai-triage-styles' +import { AgentLaunchNotice } from '../AgentLaunchNotice' +import type { MobileAgentLaunchAvailability } from '../../session/mobile-agent-launch-availability' // Launches the "Resolve conflicts with AI" agent. Absent for display-only usages. export type PrConflictsTriage = { resolveConflicts: () => void isBusy: boolean + availability: MobileAgentLaunchAvailability + success: string | null error: string | null + warning: string | null + undeliveredPrompt: string | null } type Props = { @@ -157,7 +163,7 @@ export function PRConflictingFilesSection({ pr, isRefreshing = false, triage }: pressed && triageStyles.triageButtonPressed ]} onPress={triage.resolveConflicts} - disabled={triage.isBusy} + disabled={triage.isBusy || triage.availability !== 'available'} accessibilityRole="button" accessibilityLabel="Resolve conflicts with AI" > @@ -168,7 +174,14 @@ export function PRConflictingFilesSection({ pr, isRefreshing = false, triage }: )} Resolve conflicts with AI - {triage.error ? {triage.error} : null} + ) : null} diff --git a/mobile/src/components/pr-sidebar/PrSidebarCreateEmptyState.tsx b/mobile/src/components/pr-sidebar/PrSidebarCreateEmptyState.tsx index cffde86ea5b3..ac07248f9259 100644 --- a/mobile/src/components/pr-sidebar/PrSidebarCreateEmptyState.tsx +++ b/mobile/src/components/pr-sidebar/PrSidebarCreateEmptyState.tsx @@ -28,6 +28,8 @@ type Props = { gitBranch: string | null gitStatus: MobileGitStatusResult | null connState: ConnectionState + /** Named when the commit-recovery agent starts. */ + workspaceLabel: string | null // Refetches the sidebar after create or an explicit empty-state refresh. onCreated: () => void } @@ -43,6 +45,7 @@ export function PrSidebarCreateEmptyState({ gitBranch, gitStatus, connState, + workspaceLabel, onCreated }: Props) { const [mode, setMode] = useState('choose') @@ -57,6 +60,7 @@ export function PrSidebarCreateEmptyState({ client, connState, worktreeId, + workspaceLabel, failure: commitFailureRecovery }) diff --git a/mobile/src/components/use-new-workspace-create-submit.ts b/mobile/src/components/use-new-workspace-create-submit.ts index df47a69b65a0..5ea89f23efc0 100644 --- a/mobile/src/components/use-new-workspace-create-submit.ts +++ b/mobile/src/components/use-new-workspace-create-submit.ts @@ -14,7 +14,7 @@ import { import { createWorkspaceFromComposerSource } from '../tasks/source-workspace-create' import { normalizeWorkspaceAgent } from '../tasks/workspace-agent-selection' import type { WorkspaceCreateSetupDecision } from '../tasks/workspace-create-params' -import type { AgentLaunchSupport } from '../tasks/agent-launch-worktree-create' +import type { AgentLaunchSupport } from '../tasks/agent-launch-request' import type { WorkspaceSshGate } from '../tasks/workspace-ssh-gate' import type { useMobileComposerSource } from '../tasks/use-mobile-composer-source' import type { WorktreeCreateIdempotencySupport } from '../tasks/worktree-create-idempotency-policy' diff --git a/mobile/src/mobile-web-shell/mobile-web-shell-gates.ts b/mobile/src/mobile-web-shell/mobile-web-shell-gates.ts index 9850161ff204..26e505743096 100644 --- a/mobile/src/mobile-web-shell/mobile-web-shell-gates.ts +++ b/mobile/src/mobile-web-shell/mobile-web-shell-gates.ts @@ -65,8 +65,8 @@ export function gateVerdict(gates: MobileWebShellGates): MobileWebShellGateVerdi } // Never a wall on an unreadable status: the empty capability list it leaves behind is // indistinguishable from a desktop that ships no bundle, and that wall tells the wrong story. It - // is not a wait either — the gate settles once per host screen and does not probe again — so the - // one honest answer is to say the status could not be read and let a fresh gate reopen it. + // is not a wait either — the gate settles closed and only re-asks in the background — so the one + // honest answer is to say the status could not be read; a later readable status reopens it. if (!gates.statusReadable) { return { kind: 'status-unreadable' } } diff --git a/mobile/src/session/MobileDiffReviewRouteScreen.tsx b/mobile/src/session/MobileDiffReviewRouteScreen.tsx index f457bd4f64d0..58c19b19da6d 100644 --- a/mobile/src/session/MobileDiffReviewRouteScreen.tsx +++ b/mobile/src/session/MobileDiffReviewRouteScreen.tsx @@ -5,6 +5,7 @@ import { firstReviewParam, normalizeReviewFilterParam } from './mobile-diff-revi import { normalizeReviewAreaParam } from './mobile-diff-review-positioning' import { useMobileDiffReviewController } from './use-mobile-diff-review-controller' import { useForceReconnect, useHostClient } from '../transport/client-context' +import { useHostProtocolGates } from '../components/HostProtocolGate' import { useRouteHandoff } from '../navigation/route-handoff' /** @@ -51,9 +52,13 @@ export function MobileDiffReviewRouteScreen() { ) }, [hostId, name, router, worktreeId]) + const { hostCapabilities, statusPending, statusReadable } = useHostProtocolGates() const controller = useMobileDiffReviewController({ client, connState, + hostCapabilities, + hostStatusPending: statusPending, + hostStatusReadable: statusReadable, hostId, worktreeId, name, diff --git a/mobile/src/session/mobile-agent-launch-availability.test.ts b/mobile/src/session/mobile-agent-launch-availability.test.ts new file mode 100644 index 000000000000..b1775f13311f --- /dev/null +++ b/mobile/src/session/mobile-agent-launch-availability.test.ts @@ -0,0 +1,46 @@ +import { describe, expect, it } from 'vitest' +import { resolveMobileAgentLaunchAvailability } from './mobile-agent-launch-availability' + +const LAUNCH = ['agent.launch.v2', 'agent.launch.replay.v1', 'agent.launch.replay-required.v1'] + +describe('resolveMobileAgentLaunchAvailability', () => { + it('is available when the host advertises the replay-required launch', () => { + expect( + resolveMobileAgentLaunchAvailability({ + hostCapabilities: LAUNCH, + statusPending: false, + statusReadable: true + }) + ).toBe('available') + }) + + it('asks for an update only when the host answered without the capability', () => { + expect( + resolveMobileAgentLaunchAvailability({ + hostCapabilities: ['agent.launch.v2'], + statusPending: false, + statusReadable: true + }) + ).toBe('update-required') + }) + + it('does not blame the host version when its status could not be read', () => { + expect( + resolveMobileAgentLaunchAvailability({ + hostCapabilities: [], + statusPending: false, + statusReadable: false + }) + ).toBe('unverified') + }) + + it('waits while the status is being read', () => { + expect( + resolveMobileAgentLaunchAvailability({ + hostCapabilities: [], + statusPending: true, + statusReadable: false + }) + ).toBe('checking') + }) +}) diff --git a/mobile/src/session/mobile-agent-launch-availability.ts b/mobile/src/session/mobile-agent-launch-availability.ts new file mode 100644 index 000000000000..81871fb7ab9e --- /dev/null +++ b/mobile/src/session/mobile-agent-launch-availability.ts @@ -0,0 +1,32 @@ +import { supportsMobileExistingAgentLaunch } from './mobile-existing-agent-launch' + +/** + * Whether an AI button that starts an agent with a prompt can be used on this host. There is no + * older-host fallback: the path before `agent.launch` typed the prompt into a bare shell. + * `unverified`: the host's status could not be read, so whether it is too old is unknown. + */ +export type MobileAgentLaunchAvailability = + | 'checking' + | 'available' + | 'update-required' + | 'unverified' + +/** The host status gates this reads (`useHostProtocolGates`). */ +export type MobileAgentLaunchHostStatus = { + hostCapabilities: readonly string[] + statusPending: boolean + statusReadable: boolean +} + +export function resolveMobileAgentLaunchAvailability( + host: MobileAgentLaunchHostStatus +): MobileAgentLaunchAvailability { + if (supportsMobileExistingAgentLaunch(host.hostCapabilities)) { + return 'available' + } + if (host.statusPending) { + return 'checking' + } + // Only a host that answered without the capability is too old to update. + return host.statusReadable ? 'update-required' : 'unverified' +} diff --git a/mobile/src/session/mobile-diff-review-retry.test.tsx b/mobile/src/session/mobile-diff-review-retry.test.tsx index 093a66b29a46..c7d8f3fb8680 100644 --- a/mobile/src/session/mobile-diff-review-retry.test.tsx +++ b/mobile/src/session/mobile-diff-review-retry.test.tsx @@ -55,6 +55,9 @@ function ReviewWhileUnreachable({ const controller = useMobileDiffReviewController({ client, connState, + hostCapabilities: [], + hostStatusPending: false, + hostStatusReadable: true, hostId: 'host-1', worktreeId: 'wt-1', name: 'review', diff --git a/mobile/src/session/mobile-existing-agent-launch.test.ts b/mobile/src/session/mobile-existing-agent-launch.test.ts new file mode 100644 index 000000000000..ce54670151b8 --- /dev/null +++ b/mobile/src/session/mobile-existing-agent-launch.test.ts @@ -0,0 +1,253 @@ +import { describe, expect, it, vi } from 'vitest' +import type { RpcClient } from '../transport/rpc-client' +import { markRpcDeliveryUnknown } from '../transport/rpc-delivery-ambiguity' +import type { RpcResponse } from '../transport/types' +import { + AGENT_LAUNCH_UNCONFIRMED_MESSAGE, + PROMPTED_AGENT_LAUNCH_TIMEOUT_MS, + launchAgentInExistingWorkspace, + supportsMobileExistingAgentLaunch +} from './mobile-existing-agent-launch' + +// A connected client whose only behaviour is the scripted `sendRequest`. +function requestPortRpcClient(sendRequest: RpcClient['sendRequest']): RpcClient { + return { + sendRequest, + subscribe: () => () => {}, + updateTerminalSubscriptionViewport: () => {}, + getState: () => 'connected', + getReconnectAttempt: () => 0, + getLastConnectedAt: () => null, + onStateChange: () => () => {}, + notifyForeground: () => {}, + close: () => {} + } +} + +function requestParam(params: unknown, key: string): unknown { + return params && typeof params === 'object' && key in params + ? Object.getOwnPropertyDescriptor(params, key)?.value + : undefined +} + +const LAUNCH_CAPABILITIES = [ + 'agent.launch.v2', + 'agent.launch.replay.v1', + 'agent.launch.replay-required.v1' +] +const RECEIPT = { + mode: 'terminal', + preferred: 'terminal', + reason: 'user_default', + detail: 'Started a terminal agent.' +} + +function launched(result: Record): RpcResponse { + return { + id: '1', + ok: true, + result: { + outcome: { kind: 'terminal', handle: 'term-1' }, + worktreeId: 'wt-1', + receipt: RECEIPT, + ...result + }, + _meta: { runtimeId: 'r' } + } +} + +function refused(code: string, message = code): RpcResponse { + return { id: '1', ok: false, error: { code, message }, _meta: { runtimeId: 'r' } } +} + +function scriptedClient(...outcomes: Array) { + let call = 0 + const sendRequest = vi.fn(async (_method: string, _params?: unknown, _options?: unknown) => { + const outcome = outcomes[Math.min(call, outcomes.length - 1)]! + call += 1 + if ('throws' in outcome) { + throw outcome.throws + } + return outcome + }) + return { client: requestPortRpcClient(sendRequest), sendRequest } +} + +function launch( + client: RpcClient, + extra: Partial[0]> = {} +) { + return launchAgentInExistingWorkspace({ + client, + hostCapabilities: LAUNCH_CAPABILITIES, + worktreeId: 'wt-1', + agent: 'claude', + mintOperationId: () => 'op-1', + ...extra + }) +} + +describe('supportsMobileExistingAgentLaunch', () => { + it('requires the replay ledger, not just agent.launch', () => { + expect(supportsMobileExistingAgentLaunch(LAUNCH_CAPABILITIES)).toBe(true) + expect(supportsMobileExistingAgentLaunch(['agent.launch.v2'])).toBe(false) + expect(supportsMobileExistingAgentLaunch([])).toBe(false) + expect(supportsMobileExistingAgentLaunch(undefined)).toBe(false) + }) +}) + +describe('launchAgentInExistingWorkspace', () => { + it('sends nothing to a host without the launch capabilities', async () => { + const { client, sendRequest } = scriptedClient(launched({})) + await expect(launch(client, { hostCapabilities: ['agent.launch.v2'] })).resolves.toEqual({ + kind: 'unsupported' + }) + expect(sendRequest).not.toHaveBeenCalled() + }) + + it('launches through agent.launchReplay into the existing workspace with the prompt', async () => { + const { client, sendRequest } = scriptedClient( + launched({ prompt: { delivery: 'submit', outcome: 'handed-to-terminal' } }) + ) + const result = await launch(client, { + prompt: { text: 'Fix it', delivery: 'submit' }, + launchSource: 'task_page' + }) + expect(sendRequest).toHaveBeenCalledWith( + 'agent.launchReplay', + { + agent: 'claude', + operationId: 'op-1', + target: { kind: 'existing', worktree: 'id:wt-1' }, + prompt: { text: 'Fix it', delivery: 'submit' }, + launchSource: 'task_page' + }, + // The host may wait 60s for the agent before pasting; the default 30s would give up first. + { timeoutMs: PROMPTED_AGENT_LAUNCH_TIMEOUT_MS } + ) + expect(result).toMatchObject({ kind: 'launched', promptDelivered: true }) + }) + + it('keeps the default timeout for a launch with no prompt', async () => { + const { client, sendRequest } = scriptedClient(launched({})) + await expect(launch(client)).resolves.toMatchObject({ + kind: 'launched', + promptDelivered: null + }) + expect(sendRequest.mock.calls[0]![2]).toBeUndefined() + }) + + it('reports a journaled prompt as delivered', async () => { + const { client } = scriptedClient( + launched({ + outcome: { kind: 'structured', sessionId: 'claude_s1', handle: 'h' }, + prompt: { delivery: 'submit', outcome: 'journaled', messageId: 'm-1' } + }) + ) + await expect( + launch(client, { prompt: { text: 'Fix it', delivery: 'submit' } }) + ).resolves.toMatchObject({ kind: 'launched', promptDelivered: true }) + }) + + it('reports not-delivered so the caller keeps the prompt', async () => { + const { client } = scriptedClient( + launched({ prompt: { delivery: 'submit', outcome: 'not-delivered' } }) + ) + await expect( + launch(client, { prompt: { text: 'Fix it', delivery: 'submit' } }) + ).resolves.toMatchObject({ kind: 'launched', promptDelivered: false }) + }) + + it('under-claims a prompted launch whose receipt carries no prompt disposal', async () => { + const { client } = scriptedClient(launched({})) + await expect( + launch(client, { prompt: { text: 'Fix it', delivery: 'submit' } }) + ).resolves.toMatchObject({ kind: 'launched', promptDelivered: false }) + }) + + it('treats a refusal of the first send as an unsupported host', async () => { + const { client } = scriptedClient(refused('agent_launch_replay_unsupported')) + await expect(launch(client)).resolves.toEqual({ kind: 'unsupported' }) + }) + + it('never reads a refusal after a replay as unsupported: the first attempt may have run', async () => { + const { client, sendRequest } = scriptedClient( + { throws: markRpcDeliveryUnknown(new Error('Connection interrupted')) }, + refused('agent_launch_replay_unsupported') + ) + await expect(launch(client)).resolves.toEqual({ + kind: 'unknown', + message: AGENT_LAUNCH_UNCONFIRMED_MESSAGE + }) + // The replay reuses the same operation id. + expect(sendRequest.mock.calls.map(([, params]) => requestParam(params, 'operationId'))).toEqual( + ['op-1', 'op-1'] + ) + }) + + it('maps an unknown outcome to readable copy instead of the raw code', async () => { + const { client } = scriptedClient(refused('agent_session_operation_unknown')) + await expect(launch(client)).resolves.toEqual({ + kind: 'unknown', + message: AGENT_LAUNCH_UNCONFIRMED_MESSAGE + }) + }) + + it('surfaces a refusal from before the launch with the host message', async () => { + const { client } = scriptedClient(refused('selector_not_found', 'Workspace not found')) + await expect(launch(client)).resolves.toEqual({ + kind: 'failed', + message: 'Workspace not found' + }) + }) + + it('reports unknown when no answer arrives at all', async () => { + const { client } = scriptedClient({ throws: new Error('Request timed out') }) + await expect(launch(client)).resolves.toEqual({ + kind: 'unknown', + message: AGENT_LAUNCH_UNCONFIRMED_MESSAGE + }) + }) + + it('mints a new operation for every call so a later tap is a new launch', async () => { + const { client, sendRequest } = scriptedClient(launched({})) + const ids = ['op-a', 'op-b'] + await launch(client, { mintOperationId: () => ids.shift()! }) + await launch(client, { mintOperationId: () => ids.shift()! }) + expect(sendRequest.mock.calls.map(([, params]) => requestParam(params, 'operationId'))).toEqual( + ['op-a', 'op-b'] + ) + }) + + it('works against a v1.4.206-shaped host', async () => { + // v1.4.206 (the first release with these capabilities) parses a plain object that knows only + // these keys and strips the rest; its terminal arm starts the agent without the prompt. + const v1_4_206Keys = new Set([ + 'agent', + 'operationId', + 'target', + 'prompt', + 'sessionOptions', + 'reuseTerminal' + ]) + let parsed: Record | null = null + const client = requestPortRpcClient(async (_method, params) => { + parsed = Object.fromEntries( + Object.entries(params ?? {}).filter(([key]) => v1_4_206Keys.has(key)) + ) + return launched({ prompt: { delivery: 'submit', outcome: 'not-delivered' } }) + }) + const result = await launch(client, { + prompt: { text: 'Fix it', delivery: 'submit' }, + launchSource: 'task_page' + }) + // Only telemetry is lost; the launch itself carries nothing that host would drop. + expect(parsed).toEqual({ + agent: 'claude', + operationId: 'op-1', + target: { kind: 'existing', worktree: 'id:wt-1' }, + prompt: { text: 'Fix it', delivery: 'submit' } + }) + expect(result).toMatchObject({ kind: 'launched', promptDelivered: false }) + }) +}) diff --git a/mobile/src/session/mobile-existing-agent-launch.ts b/mobile/src/session/mobile-existing-agent-launch.ts new file mode 100644 index 000000000000..2a7d23071ad4 --- /dev/null +++ b/mobile/src/session/mobile-existing-agent-launch.ts @@ -0,0 +1,126 @@ +/** + * Starting an agent in a workspace that already exists, through the host's `agent.launch`. + * + * The phone states intent (which agent, where, what to say) and the host decides whether it runs + * as a structured chat or a terminal agent, and how the prompt reaches it. Kept free of React so + * every outcome is unit-testable. + */ + +import type { AgentLaunchPrompt, AgentLaunchResult } from '../../../src/shared/agent-launch-intent' +import type { TuiAgent } from '../../../src/shared/tui-agent' +import type { RpcClient } from '../transport/rpc-client' +import { agentLaunchReplayRun } from '../tasks/mobile-workspace-create-operations' +import { + agentLaunchExistingParams, + isAgentLaunchReplayUnsupportedRefusal, + readAgentLaunchSupport +} from '../tasks/agent-launch-request' +import { sendReplayingAmbiguousDelivery } from '../tasks/replay-on-ambiguous-delivery' +import { structuredSessionOperationId } from './structured-session-operation-id' + +// Why: the host waits up to 60s for a terminal agent to become ready before pasting the prompt, +// so a prompted launch must outlive that wait or the phone reports a launch that is still running. +export const PROMPTED_AGENT_LAUNCH_TIMEOUT_MS = 90_000 + +export const AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE = + 'Update Orca on your computer to start an agent from your phone.' + +// host-status-gates keeps re-reading a failed status in the background, so the user need not act. +export const AGENT_LAUNCH_STATUS_UNREADABLE_MESSAGE = "Could not read this host's status. Retrying…" + +export const AGENT_LAUNCH_UNCONFIRMED_MESSAGE = + "Couldn't confirm the agent started. Check the workspace before trying again." + +export type MobileExistingAgentLaunch = + /** The host answered. `promptDelivered` is null when no prompt was sent. */ + | { kind: 'launched'; result: AgentLaunchResult; promptDelivered: boolean | null } + /** This host can't take the launch; nothing was started. */ + | { kind: 'unsupported' } + /** The host refused before starting anything. */ + | { kind: 'failed'; message: string } + /** The agent may or may not be running; the caller must not launch again on its own. */ + | { kind: 'unknown'; message: string } + +export function supportsMobileExistingAgentLaunch( + hostCapabilities: readonly string[] | null | undefined +): boolean { + const support = readAgentLaunchSupport(hostCapabilities) + return support !== false && support.replay +} + +export async function launchAgentInExistingWorkspace(args: { + client: RpcClient + hostCapabilities: readonly string[] | null | undefined + worktreeId: string + agent: TuiAgent + prompt?: AgentLaunchPrompt + launchSource?: string + // Injected in tests; each call is one new operation, so a later tap never replays this one. + mintOperationId?: () => string +}): Promise { + if (!supportsMobileExistingAgentLaunch(args.hostCapabilities)) { + return { kind: 'unsupported' } + } + const params = agentLaunchExistingParams({ + agent: args.agent, + worktreeId: args.worktreeId, + operationId: (args.mintOperationId ?? structuredSessionOperationId)(), + ...(args.prompt ? { prompt: args.prompt } : {}), + ...(args.launchSource ? { launchSource: args.launchSource } : {}) + }) + let sent + try { + sent = await sendReplayingAmbiguousDelivery( + args.client, + () => + agentLaunchReplayRun.request( + args.client, + params, + args.prompt ? { timeoutMs: PROMPTED_AGENT_LAUNCH_TIMEOUT_MS } : undefined + ), + { kind: 'durable' } + ) + } catch { + // The request reached the wire and no answer came back, even after replays. + return { kind: 'unknown', message: AGENT_LAUNCH_UNCONFIRMED_MESSAGE } + } + const { response, replayed } = sent + if (!response.ok) { + return classifyLaunchRefusal(response.error, replayed) + } + let result: AgentLaunchResult + try { + result = agentLaunchReplayRun.interpret(response) + } catch { + return { kind: 'unknown', message: AGENT_LAUNCH_UNCONFIRMED_MESSAGE } + } + return { + kind: 'launched', + result, + // A receipt missing from a prompted launch under-claims: the phone keeps the text. + promptDelivered: args.prompt + ? result.prompt !== undefined && result.prompt.outcome !== 'not-delivered' + : null + } +} + +function classifyLaunchRefusal( + error: { code?: string; message?: string }, + replayed: boolean +): MobileExistingAgentLaunch { + if (isAgentLaunchReplayUnsupportedRefusal(error)) { + // Only a refusal of the first send proves nothing ran; after a replay it may be a replacement + // connection whose capability list hasn't landed, answering for an attempt that did start. + return replayed + ? { kind: 'unknown', message: AGENT_LAUNCH_UNCONFIRMED_MESSAGE } + : { kind: 'unsupported' } + } + if ( + error.code === 'agent_session_operation_unknown' || + error.code === 'agent_session_operation_expired' + ) { + return { kind: 'unknown', message: AGENT_LAUNCH_UNCONFIRMED_MESSAGE } + } + const message = error.message?.trim() + return { kind: 'failed', message: message || "Couldn't start the agent." } +} diff --git a/mobile/src/session/mobile-new-tab-agent-loader.ts b/mobile/src/session/mobile-new-tab-agent-loader.ts index f22ebda59908..5cc02b544214 100644 --- a/mobile/src/session/mobile-new-tab-agent-loader.ts +++ b/mobile/src/session/mobile-new-tab-agent-loader.ts @@ -15,10 +15,18 @@ import { type MobileNewTabAgentSettings } from './mobile-new-tab-agent-options' -export async function loadMobileNewTabAgentOptions(args: { +/** What a launch in this workspace can choose from: the host's settings, the agents detected on + * the workspace's execution host, and the workspace's repo (absent for the floating workspace). */ +export type MobileAgentLaunchContext = { + settings: unknown + detectedAgents: unknown[] + repo: MobileRuntimeRepoSummary | null +} + +export async function loadMobileAgentLaunchContext(args: { client: RpcClient worktreeId: string -}): Promise { +}): Promise { const { client, worktreeId } = args // Started before the settings read, not inside the array: the detection request goes on the wire // first, and the recorded sender order is what says so. @@ -31,10 +39,18 @@ export async function loadMobileNewTabAgentOptions(args: { // Interpreted after the group, not inside it: whichever peer failed first must not decide the // error the sheet shows, and main raised the detection refusal only once settings had settled. const detected = detectedAgents.interpret(detectedAgents.reply) + return { settings: readSettings(), detectedAgents: detected, repo: detectedAgents.repo } +} + +export async function loadMobileNewTabAgentOptions(args: { + client: RpcClient + worktreeId: string +}): Promise { + const context = await loadMobileAgentLaunchContext(args) return buildMobileNewTabAgentOptions( // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Preserve the established response shape at this boundary. - readSettings() as MobileNewTabAgentSettings | undefined, - detected + context.settings as MobileNewTabAgentSettings | undefined, + context.detectedAgents ) } @@ -42,6 +58,7 @@ export async function loadMobileNewTabAgentOptions(args: { type DetectedAgentsReply = { reply: RpcResponse interpret: (reply: RpcResponse) => unknown[] + repo: MobileRuntimeRepoSummary | null } async function loadDetectedAgents( @@ -52,7 +69,8 @@ async function loadDetectedAgents( if (isFloatingWorkspaceWorktreeId(worktreeId)) { return { reply: await preflightDetectAgentsRead.request(client), - interpret: preflightDetectAgentsRead.interpret + interpret: preflightDetectAgentsRead.interpret, + repo: null } } const repoResponse = await newTabRepoListRead.request(client) @@ -67,10 +85,12 @@ async function loadDetectedAgents( return connectionId ? { reply: await preflightDetectRemoteAgentsRead.request(client, { connectionId }), - interpret: preflightDetectRemoteAgentsRead.interpret + interpret: preflightDetectRemoteAgentsRead.interpret, + repo } : { reply: await preflightDetectAgentsRead.request(client), - interpret: preflightDetectAgentsRead.interpret + interpret: preflightDetectAgentsRead.interpret, + repo } } diff --git a/mobile/src/session/mobile-source-control-launch-agent.ts b/mobile/src/session/mobile-source-control-launch-agent.ts new file mode 100644 index 000000000000..e017c48410cb --- /dev/null +++ b/mobile/src/session/mobile-source-control-launch-agent.ts @@ -0,0 +1,89 @@ +/** + * Which agent a source-control AI button starts from the phone: the desktop's own resolution + * (`pickSourceControlLaunchAgent`), fed the same saved recipe, default agent and detected agents. + */ + +import type { GlobalSettings } from '../../../src/shared/global-settings-types' +import type { Repo } from '../../../src/shared/repo-types' +import type { + SourceControlActionRecipe, + SourceControlLaunchActionId +} from '../../../src/shared/source-control-ai-actions' +import { resolveSourceControlActionRecipe } from '../../../src/shared/source-control-ai' +import { + pickSourceControlLaunchAgent, + readSourceControlLaunchRecipeAgentId +} from '../../../src/shared/source-control-launch-agent-selection' +import { filterEnabledTuiAgents } from '../../../src/shared/tui-agent-selection' +import type { TuiAgent } from '../../../src/shared/tui-agent' +import { isMobileTuiAgent } from '../tasks/mobile-tui-agents' +import type { MobileAgentLaunchContext } from './mobile-new-tab-agent-loader' + +export type MobileSourceControlLaunchAgent = + /** `recipe`: the action's saved recipe, for its prompt template; null with no action. */ + | { kind: 'agent'; agent: TuiAgent; recipe: SourceControlActionRecipe | null } + | { kind: 'unavailable'; message: string } + +type LaunchAgentSettings = Pick< + GlobalSettings, + 'sourceControlAi' | 'commitMessageAi' | 'defaultTuiAgent' | 'disabledTuiAgents' +> + +export function resolveMobileSourceControlLaunchAgent( + context: MobileAgentLaunchContext, + // Null for a launch with no saved recipe, such as sending review notes. + actionId: SourceControlLaunchActionId | null +): MobileSourceControlLaunchAgent { + const settings = readLaunchAgentSettings(context.settings) + const detectedAgents = context.detectedAgents.filter(isMobileTuiAgent) + const recipe = actionId ? readSavedRecipe(settings, context.repo, actionId) : null + const savedAgent = readSourceControlLaunchRecipeAgentId(recipe) + // Why: the phone has no pre-launch dialog showing the pick, so a saved agent that can't run here + // is an error, as on the desktop's direct launch, rather than a silent swap to another agent. + if ( + savedAgent && + !filterEnabledTuiAgents(detectedAgents, settings?.disabledTuiAgents).includes(savedAgent) + ) { + return { + kind: 'unavailable', + message: 'The saved agent for this action is not available on this workspace host.' + } + } + const agent = pickSourceControlLaunchAgent({ + savedAgent, + defaultAgent: settings?.defaultTuiAgent, + detectedAgents, + disabledAgents: settings?.disabledTuiAgents + }) + return agent + ? { kind: 'agent', agent, recipe } + : { kind: 'unavailable', message: 'No enabled AI agent was detected on this workspace host.' } +} + +function readLaunchAgentSettings(settings: unknown): LaunchAgentSettings | null { + if (!settings || typeof settings !== 'object') { + return null + } + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: settings.get answers with the host's GlobalSettings, and every member read here goes through a normalizer or an enabled-agent filter. + return settings as LaunchAgentSettings +} + +function readSavedRecipe( + settings: LaunchAgentSettings | null, + repo: unknown, + actionId: SourceControlLaunchActionId +): SourceControlActionRecipe | null { + try { + return resolveSourceControlActionRecipe({ settings, repo: readRepoOverrides(repo), actionId }) + } catch { + // A recipe the phone cannot read must not block the button; the default agent still applies. + return null + } +} + +function readRepoOverrides(repo: unknown): Pick | null { + return repo && typeof repo === 'object' && 'sourceControlAi' in repo + ? // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the recipe resolver normalizes this member from unknown (normalizeRepoSourceControlAiOverrides). + { sourceControlAi: repo.sourceControlAi as Repo['sourceControlAi'] } + : null +} diff --git a/mobile/src/session/mobile-worker-takeover-send-sites.test.ts b/mobile/src/session/mobile-worker-takeover-send-sites.test.ts index d018495fdfa5..17175a5e139e 100644 --- a/mobile/src/session/mobile-worker-takeover-send-sites.test.ts +++ b/mobile/src/session/mobile-worker-takeover-send-sites.test.ts @@ -13,7 +13,6 @@ import { clearMobileNativeChatInput } from './mobile-native-chat-send' import { sendMobileTerminalQueryReply } from '../terminal/mobile-terminal-query-reply' -import { createTerminalAndSendPrompt } from './pr-ai-triage-launch' import { useMobileDiffReviewSendActions } from './use-mobile-diff-review-send-actions' import { pasteMobileNativeChatImagePaths } from './mobile-native-chat-image-send' @@ -179,7 +178,6 @@ function mountSendSites(client: ReturnType, handle = 'term imagePaths: ['/tmp/picture.png'], followedByText: true }), - 'PR triage': () => createTerminalAndSendPrompt(client, 'workspace', 'fix checks'), 'diff review': () => diff.sendPromptToTerminal(handle, []), programmatic: () => client.sendRequest('terminal.send') } @@ -240,23 +238,19 @@ it.each(realSites)('%s reports on its send target once per handle per 30 seconds expect(reports()[2][1]).toEqual({ terminal: 'term-2' }) }) -it.each([ - 'query reply', - 'image heal', - 'image attachment', - 'PR triage', - 'diff review', - 'programmatic' -] as const)('%s never reports takeover', async (site) => { - const client = clientFixture() - const sites = mountSendSites(client) - await act(async () => { - await sites[site]() - await sites[site]() - }) - expect(client.sendRequest.mock.calls.some(([method]) => method === 'terminal.send')).toBe(true) - expect(client.sendRequest.mock.calls.filter(([method]) => method === REPORT)).toHaveLength(0) -}) +it.each(['query reply', 'image heal', 'image attachment', 'diff review', 'programmatic'] as const)( + '%s never reports takeover', + async (site) => { + const client = clientFixture() + const sites = mountSendSites(client) + await act(async () => { + await sites[site]() + await sites[site]() + }) + expect(client.sendRequest.mock.calls.some(([method]) => method === 'terminal.send')).toBe(true) + expect(client.sendRequest.mock.calls.filter(([method]) => method === REPORT)).toHaveLength(0) + } +) it.each(realSites)('%s does not report a rejected send', async (site) => { const client = clientFixture() diff --git a/mobile/src/session/pr-ai-triage-launch.test.ts b/mobile/src/session/pr-ai-triage-launch.test.ts index 5641bbe37d4c..16c8132836f3 100644 --- a/mobile/src/session/pr-ai-triage-launch.test.ts +++ b/mobile/src/session/pr-ai-triage-launch.test.ts @@ -1,64 +1,319 @@ import { describe, expect, it, vi } from 'vitest' +import type { RpcClient } from '../transport/rpc-client' import type { RpcResponse } from '../transport/types' -import { createTerminalAndSendPrompt } from './pr-ai-triage-launch' +import { AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE } from './mobile-existing-agent-launch' +import { + AGENT_PROMPT_NOT_SENT_MESSAGE, + agentStartedMessage, + launchAgentWithPrompt, + promptedLaunchNotice +} from './pr-ai-triage-launch' -function success(result: unknown): RpcResponse { +// A connected client whose only behaviour is the scripted `sendRequest`. +function requestPortRpcClient(sendRequest: RpcClient['sendRequest']): RpcClient { + return { + sendRequest, + subscribe: () => () => {}, + updateTerminalSubscriptionViewport: () => {}, + getState: () => 'connected', + getReconnectAttempt: () => 0, + getLastConnectedAt: () => null, + onStateChange: () => () => {}, + notifyForeground: () => {}, + close: () => {} + } +} + +const LAUNCH_CAPABILITIES = [ + 'agent.launch.v2', + 'agent.launch.replay.v1', + 'agent.launch.replay-required.v1' +] +const RECEIPT = { + mode: 'terminal', + preferred: 'terminal', + reason: 'user_default', + detail: 'Started a terminal agent.' +} + +function ok(result: unknown): RpcResponse { return { id: 'x', ok: true, result, _meta: { runtimeId: 'r' } } } -function failure(message: string): RpcResponse { - return { id: 'x', ok: false, error: { code: 'E', message }, _meta: { runtimeId: 'r' } } +// Answers by method so the order of the agent loader's reads doesn't matter. +function hostClient(replies: { settings?: unknown; detected?: unknown[]; launch?: RpcResponse }) { + const sendRequest = vi.fn(async (method: string, _params?: unknown) => { + if (method === 'repo.list') { + return ok({ repos: [{ id: 'repo-1' }] }) + } + if (method === 'settings.get') { + return ok({ settings: replies.settings ?? {} }) + } + if (method === 'preflight.detectAgents') { + return ok(replies.detected ?? ['claude', 'codex']) + } + if (method === 'agent.launchReplay') { + return replies.launch ?? ok({}) + } + throw new Error(`unexpected ${method}`) + }) + return { client: requestPortRpcClient(sendRequest), sendRequest } } -const createdTerminal = success({ tab: { type: 'terminal', id: 't1', terminal: 'term-1' } }) -const sendAccepted = success({ send: { accepted: true } }) +function launchedWith(prompt: unknown, warning?: string): RpcResponse { + return ok({ + outcome: { kind: 'terminal', handle: 'term-1' }, + worktreeId: 'repo-1::/w', + receipt: RECEIPT, + ...(prompt ? { prompt } : {}), + ...(warning ? { warning } : {}) + }) +} -function clientReturning(...responses: RpcResponse[]) { - const sendRequest = vi.fn(async () => responses[sendRequest.mock.calls.length - 1]) - return { sendRequest } +function run(client: RpcClient, hostCapabilities: readonly string[] = LAUNCH_CAPABILITIES) { + return launchAgentWithPrompt({ + client, + hostCapabilities, + worktreeId: 'repo-1::/w', + actionId: 'fixChecks', + prompt: 'Fix the failing checks', + launchSource: 'task_page' + }) } -describe('createTerminalAndSendPrompt', () => { - it('creates a terminal then sends the prompt with enter', async () => { - const client = clientReturning(createdTerminal, sendAccepted) - await createTerminalAndSendPrompt(client, 'wt-1', 'do the thing') +function launchParams(sendRequest: ReturnType['sendRequest']) { + return sendRequest.mock.calls.find(([method]) => method === 'agent.launchReplay')?.[1] +} + +describe('launchAgentWithPrompt', () => { + it('never creates a bare shell: an older host gets update copy and no request', async () => { + const { client, sendRequest } = hostClient({}) + await expect(run(client, [])).resolves.toEqual({ + kind: 'not-started', + message: AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE + }) + expect(sendRequest).not.toHaveBeenCalled() + }) - expect(client.sendRequest).toHaveBeenNthCalledWith(1, 'session.tabs.createTerminal', { - worktree: 'id:wt-1', - activate: false, - select: true, - navigation: 'caller' + it('starts the default agent with the prompt through the host', async () => { + const { client, sendRequest } = hostClient({ + settings: { defaultTuiAgent: 'codex' }, + launch: launchedWith({ delivery: 'submit', outcome: 'handed-to-terminal' }) }) - expect(client.sendRequest).toHaveBeenNthCalledWith(2, 'terminal.send', { - terminal: 'term-1', - text: 'do the thing', - enter: true + await expect(run(client)).resolves.toEqual({ kind: 'sent' }) + expect(launchParams(sendRequest)).toMatchObject({ + agent: 'codex', + target: { kind: 'existing', worktree: 'id:repo-1::/w' }, + prompt: { text: 'Fix the failing checks', delivery: 'submit' }, + launchSource: 'task_page' }) + // No saved arguments: the host applies the user's configured defaults. + expect(launchParams(sendRequest)).not.toHaveProperty('agentArgs') + expect(sendRequest.mock.calls.some(([method]) => method === 'terminal.send')).toBe(false) + expect( + sendRequest.mock.calls.some(([method]) => method === 'session.tabs.createTerminal') + ).toBe(false) }) - it('throws and skips terminal.send when createTerminal fails', async () => { - const client = clientReturning(failure('boom')) - await expect(createTerminalAndSendPrompt(client, 'wt-1', 'p')).rejects.toThrow('boom') - expect(client.sendRequest).toHaveBeenCalledTimes(1) + it("honours the action's saved agent over the default", async () => { + const { client, sendRequest } = hostClient({ + settings: { + defaultTuiAgent: 'codex', + sourceControlAi: { actions: { fixChecks: { agentId: 'claude' } } } + }, + launch: launchedWith({ delivery: 'submit', outcome: 'handed-to-terminal' }) + }) + await run(client) + expect(launchParams(sendRequest)).toMatchObject({ agent: 'claude' }) }) - it('throws when the created-terminal response is malformed', async () => { - const client = clientReturning(success({ tab: { type: 'terminal' } })) - await expect(createTerminalAndSendPrompt(client, 'wt-1', 'p')).rejects.toThrow( - 'The host sent a reply this app could not read (session.tabs.createTerminal)' - ) - expect(client.sendRequest).toHaveBeenCalledTimes(1) + it("wraps the prompt in the action's saved template, as the desktop does", async () => { + const { client, sendRequest } = hostClient({ + settings: { + defaultTuiAgent: 'claude', + sourceControlAi: { + actions: { fixChecks: { commandInputTemplate: '/review first\n\n{basePrompt}' } } + } + }, + launch: launchedWith({ delivery: 'submit', outcome: 'handed-to-terminal' }) + }) + await run(client) + expect(launchParams(sendRequest)).toMatchObject({ + prompt: { text: '/review first\n\nFix the failing checks', delivery: 'submit' } + }) + }) + + it('refuses to launch with an empty saved template rather than send no prompt', async () => { + const { client, sendRequest } = hostClient({ + settings: { + defaultTuiAgent: 'claude', + sourceControlAi: { actions: { fixChecks: { commandInputTemplate: ' ' } } } + } + }) + await expect(run(client)).resolves.toMatchObject({ kind: 'not-started' }) + expect(launchParams(sendRequest)).toBeUndefined() }) - it('throws when terminal.send returns a failure', async () => { - const client = clientReturning(createdTerminal, failure('send failed')) - await expect(createTerminalAndSendPrompt(client, 'wt-1', 'p')).rejects.toThrow('send failed') + it('falls back to the default agent on an older host that publishes no recipes', async () => { + const { client, sendRequest } = hostClient({ + // A host before the recipe projection: settings.get carries no sourceControlAi at all. + settings: { defaultTuiAgent: 'codex', disabledTuiAgents: [] }, + launch: launchedWith({ delivery: 'submit', outcome: 'handed-to-terminal' }) + }) + await expect(run(client)).resolves.toEqual({ kind: 'sent' }) + expect(launchParams(sendRequest)).toMatchObject({ + agent: 'codex', + prompt: { text: 'Fix the failing checks' } + }) }) - it('throws when terminal input is locked', async () => { - const client = clientReturning(createdTerminal, success({ send: { accepted: false } })) - await expect(createTerminalAndSendPrompt(client, 'wt-1', 'p')).rejects.toThrow( - 'Terminal input is locked' + it("never sends the action's saved agent arguments; the agent's defaults apply", async () => { + const { client, sendRequest } = hostClient({ + settings: { + defaultTuiAgent: 'claude', + sourceControlAi: { actions: { fixChecks: { agentArgs: '--model opus' } } } + }, + launch: launchedWith({ delivery: 'submit', outcome: 'handed-to-terminal' }) + }) + await run(client) + expect(launchParams(sendRequest)).toMatchObject({ agent: 'claude' }) + expect(launchParams(sendRequest)).not.toHaveProperty('agentArgs') + }) + + it('refuses rather than swaps when the saved agent is not on this host', async () => { + const { client, sendRequest } = hostClient({ + settings: { sourceControlAi: { actions: { fixChecks: { agentId: 'gemini' } } } }, + detected: ['claude'] + }) + await expect(run(client)).resolves.toEqual({ + kind: 'not-started', + message: 'The saved agent for this action is not available on this workspace host.' + }) + expect(launchParams(sendRequest)).toBeUndefined() + }) + + it('still launches an agent when the default is a blank terminal', async () => { + const { client, sendRequest } = hostClient({ + settings: { defaultTuiAgent: 'blank' }, + detected: ['codex', 'claude'], + launch: launchedWith({ delivery: 'submit', outcome: 'handed-to-terminal' }) + }) + await run(client) + // Catalog order, as the desktop resolves it. + expect(launchParams(sendRequest)).toMatchObject({ agent: 'claude' }) + }) + + it('reports no agent when none is detected and enabled', async () => { + const { client } = hostClient({ + settings: { disabledTuiAgents: ['claude'] }, + detected: ['claude'] + }) + await expect(run(client)).resolves.toEqual({ + kind: 'not-started', + message: 'No enabled AI agent was detected on this workspace host.' + }) + }) + + it('reports prompt-not-sent when the agent started without its prompt (v1.4.206-207 hosts)', async () => { + // Those hosts start a terminal agent with no prompt and say so. + const { client } = hostClient({ + launch: launchedWith({ delivery: 'submit', outcome: 'not-delivered' }) + }) + await expect(run(client)).resolves.toEqual({ + kind: 'prompt-not-sent', + prompt: 'Fix the failing checks' + }) + }) + + it('passes the host warning through', async () => { + const { client } = hostClient({ + launch: launchedWith( + { delivery: 'submit', outcome: 'journaled', messageId: 'm' }, + ' launch arguments were ignored ' + ) + }) + await expect(run(client)).resolves.toEqual({ + kind: 'sent', + warning: 'launch arguments were ignored' + }) + }) + + it('reports an unknown outcome as unconfirmed', async () => { + const { client } = hostClient({ + launch: { + id: 'x', + ok: false, + error: { + code: 'agent_session_operation_unknown', + message: 'agent_session_operation_unknown' + }, + _meta: { runtimeId: 'r' } + } + }) + await expect(run(client)).resolves.toMatchObject({ kind: 'unconfirmed' }) + }) +}) + +describe('promptedLaunchNotice', () => { + it('keeps the prompt only when the agent started without it', () => { + expect(promptedLaunchNotice({ kind: 'prompt-not-sent', prompt: 'p' })).toEqual({ + succeeded: false, + success: null, + error: AGENT_PROMPT_NOT_SENT_MESSAGE, + warning: null, + undeliveredPrompt: 'p' + }) + expect(promptedLaunchNotice({ kind: 'sent' })).toEqual({ + succeeded: true, + success: 'Agent started', + error: null, + warning: null, + undeliveredPrompt: null + }) + expect(promptedLaunchNotice({ kind: 'unconfirmed', message: 'm' })).toEqual({ + succeeded: false, + success: null, + error: 'm', + warning: null, + undeliveredPrompt: null + }) + }) + + // The host can attach a warning to a launch it still carried out. + it('never reports the host warning on a launch that went ahead as an error', () => { + expect(promptedLaunchNotice({ kind: 'sent', warning: 'arguments were ignored' })).toEqual({ + succeeded: true, + success: 'Agent started', + error: null, + warning: 'arguments were ignored', + undeliveredPrompt: null + }) + expect( + promptedLaunchNotice({ + kind: 'prompt-not-sent', + prompt: 'p', + warning: 'arguments were ignored' + }) + ).toEqual({ + succeeded: false, + success: null, + error: AGENT_PROMPT_NOT_SENT_MESSAGE, + warning: 'arguments were ignored', + undeliveredPrompt: 'p' + }) + }) +}) + +describe('agentStartedMessage', () => { + // Issue #20543: a launch from the phone must say it happened, and where. + it('names the workspace the agent started in', () => { + expect(promptedLaunchNotice({ kind: 'sent' }, 'feature-login').success).toBe( + 'Agent started in feature-login' ) }) + + it('still confirms the launch when the screen knows no workspace name', () => { + expect(agentStartedMessage(null)).toBe('Agent started') + expect(agentStartedMessage(' ')).toBe('Agent started') + }) }) diff --git a/mobile/src/session/pr-ai-triage-launch.ts b/mobile/src/session/pr-ai-triage-launch.ts index 2e02b2998132..61c160b224ec 100644 --- a/mobile/src/session/pr-ai-triage-launch.ts +++ b/mobile/src/session/pr-ai-triage-launch.ts @@ -1,43 +1,139 @@ -import { refusedRpcMessageOrFallback } from '../transport/rpc-refusal-message' -import { reviewTerminalCreateRun, reviewTerminalSendRun } from './mobile-review-terminal-operations' -import type { RpcOperationSender } from '../transport/rpc-operation-sender' +import type { SourceControlLaunchActionId } from '../../../src/shared/source-control-ai-actions' +import { buildSourceControlRecoveryAgentCommandInput } from '../../../src/shared/source-control-recovery-agent-command' +import type { RpcClient } from '../transport/rpc-client' +import { + AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE, + launchAgentInExistingWorkspace, + supportsMobileExistingAgentLaunch +} from './mobile-existing-agent-launch' +import { loadMobileAgentLaunchContext } from './mobile-new-tab-agent-loader' +import { resolveMobileSourceControlLaunchAgent } from './mobile-source-control-launch-agent' -// Pure launch path for the PR triage actions ("Fix checks with AI" / "Resolve -// conflicts with AI"). Reuses the same two RPCs the diff-review send flow uses — -// session.tabs.createTerminal then terminal.send — so the prompt is dropped into a -// fresh agent terminal in the worktree. Kept free of react-native imports so it -// stays unit-testable in the node test environment. -export async function createTerminalAndSendPrompt( - client: RpcOperationSender, - worktreeId: string, +// Launch path for the phone's AI buttons ("Fix checks with AI", "Resolve conflicts with AI", commit +// recovery, review notes). The host starts the agent and delivers the prompt; the phone never +// types a prompt into a shell. Kept free of react-native imports so it unit-tests under node. + +export type MobilePromptedAgentLaunch = + | { kind: 'sent'; warning?: string } + /** The agent started but `prompt`, the text as sent, did not reach it; the caller offers it. */ + | { kind: 'prompt-not-sent'; prompt: string; warning?: string } + /** Nothing started; `message` says why. */ + | { kind: 'not-started'; message: string } + /** The agent may be running; do not launch again until the user has looked. */ + | { kind: 'unconfirmed'; message: string } + +export const AGENT_PROMPT_NOT_SENT_MESSAGE = "The agent started, but the prompt wasn't sent." + +export async function launchAgentWithPrompt(args: { + client: RpcClient + hostCapabilities: readonly string[] | null | undefined + worktreeId: string + actionId: SourceControlLaunchActionId | null prompt: string -): Promise { - // Each request is awaited outside its catch so a transport drop propagates as the original - // error object; only a refusal is rewritten into the step's own copy. - const createdReply = await reviewTerminalCreateRun.request(client, { - worktree: `id:${worktreeId}`, - activate: false, - select: true, - navigation: 'caller' - }) - let terminalTab + launchSource: string +}): Promise { + if (!supportsMobileExistingAgentLaunch(args.hostCapabilities)) { + return { kind: 'not-started', message: AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE } + } + let resolved try { - terminalTab = reviewTerminalCreateRun.interpret(createdReply) + resolved = resolveMobileSourceControlLaunchAgent( + await loadMobileAgentLaunchContext({ client: args.client, worktreeId: args.worktreeId }), + args.actionId + ) } catch (error) { - throw new Error(refusedRpcMessageOrFallback(error, 'Failed to create terminal')) + const message = error instanceof Error ? error.message.trim() : '' + return { kind: 'not-started', message: message || 'Could not load the available agents.' } + } + if (resolved.kind === 'unavailable') { + return { kind: 'not-started', message: resolved.message } + } + const { recipe } = resolved + // The desktop wraps each action's prompt in the user's saved template the same way. + const text = args.actionId + ? buildSourceControlRecoveryAgentCommandInput({ + actionId: args.actionId, + commandInputTemplate: recipe?.commandInputTemplate, + basePrompt: args.prompt + }) + : args.prompt + if (!text) { + return { + kind: 'not-started', + message: + "This action's saved prompt is empty. Update Source Control AI settings on your computer." + } } - const sentReply = await reviewTerminalSendRun.request(client, { - terminal: terminalTab.terminal, - text: prompt, - enter: true + const launched = await launchAgentInExistingWorkspace({ + client: args.client, + hostCapabilities: args.hostCapabilities, + worktreeId: args.worktreeId, + agent: resolved.agent, + // Why no saved agent arguments: whether they apply depends on the route and shell the host picks + // after this request, so the phone leaves them out and the agent's default arguments apply. + prompt: { text, delivery: 'submit' }, + launchSource: args.launchSource }) - let accepted - try { - accepted = reviewTerminalSendRun.interpret(sentReply) - } catch (error) { - throw new Error(refusedRpcMessageOrFallback(error, 'Failed to send prompt')) + switch (launched.kind) { + case 'launched': { + const warning = launched.result.warning?.trim() + const extra = warning ? { warning } : {} + return launched.promptDelivered + ? { kind: 'sent', ...extra } + : { kind: 'prompt-not-sent', prompt: text, ...extra } + } + case 'unsupported': + return { kind: 'not-started', message: AGENT_LAUNCH_UPDATE_REQUIRED_MESSAGE } + case 'failed': + return { kind: 'not-started', message: launched.message } + case 'unknown': + return { kind: 'unconfirmed', message: launched.message } } - if (!accepted) { - throw new Error('Terminal input is locked') +} + +/** The confirmation under an AI button, naming the workspace when the screen knows it. */ +export function agentStartedMessage(workspaceLabel: string | null | undefined): string { + const label = workspaceLabel?.trim() + return label ? `Agent started in ${label}` : 'Agent started' +} + +/** What the button shows after a launch; one mapping so every AI button reads the same. + * `warning` is the host's note on a launch that went ahead, so it is never shown as a failure. */ +export function promptedLaunchNotice( + result: MobilePromptedAgentLaunch, + workspaceLabel?: string | null +): { + succeeded: boolean + success: string | null + error: string | null + warning: string | null + undeliveredPrompt: string | null +} { + switch (result.kind) { + case 'sent': + return { + succeeded: true, + success: agentStartedMessage(workspaceLabel), + error: null, + warning: result.warning ?? null, + undeliveredPrompt: null + } + case 'prompt-not-sent': + return { + succeeded: false, + success: null, + error: AGENT_PROMPT_NOT_SENT_MESSAGE, + warning: result.warning ?? null, + undeliveredPrompt: result.prompt + } + case 'not-started': + case 'unconfirmed': + return { + succeeded: false, + success: null, + error: result.message, + warning: null, + undeliveredPrompt: null + } } } diff --git a/mobile/src/session/use-mobile-diff-review-controller.test.ts b/mobile/src/session/use-mobile-diff-review-controller.test.ts index 5056b3cb546f..31db5abf9115 100644 --- a/mobile/src/session/use-mobile-diff-review-controller.test.ts +++ b/mobile/src/session/use-mobile-diff-review-controller.test.ts @@ -43,6 +43,9 @@ describe('useMobileDiffReviewController', () => { const controller = useMobileDiffReviewController({ client, connState, + hostCapabilities: [], + hostStatusPending: false, + hostStatusReadable: true, hostId: 'host-1', worktreeId: 'wt-1', name: 'review', diff --git a/mobile/src/session/use-mobile-diff-review-controller.ts b/mobile/src/session/use-mobile-diff-review-controller.ts index 3ce6481dc2db..ae5648f60539 100644 --- a/mobile/src/session/use-mobile-diff-review-controller.ts +++ b/mobile/src/session/use-mobile-diff-review-controller.ts @@ -27,11 +27,15 @@ import { reviewSheetIntents } from './mobile-diff-review-sheets' import { useMobileDiffReviewInteractions } from './use-mobile-diff-review-interactions' +import { resolveMobileAgentLaunchAvailability } from './mobile-agent-launch-availability' import { useMobilePrSidebarController } from './use-mobile-pr-sidebar-controller' type ControllerInput = { client: RpcClient | null connState: ConnectionState + hostCapabilities: readonly string[] + hostStatusPending: boolean + hostStatusReadable: boolean hostId: string worktreeId: string name: string @@ -46,6 +50,9 @@ export function useMobileDiffReviewController(input: ControllerInput) { const { client, connState, + hostCapabilities, + hostStatusPending, + hostStatusReadable, hostId, worktreeId, name, @@ -225,6 +232,7 @@ export function useMobileDiffReviewController(input: ControllerInput) { const interactions = useMobileDiffReviewInteractions({ client, connState, + hostCapabilities, hostId, worktreeId, screenState, @@ -255,6 +263,11 @@ export function useMobileDiffReviewController(input: ControllerInput) { ...interactions, ...prSidebar, ...sheetIntents, + agentLaunchAvailability: resolveMobileAgentLaunchAvailability({ + hostCapabilities, + statusPending: hostStatusPending, + statusReadable: hostStatusReadable + }), // Exposed so the screen can thread the RPC client + worktree into the PR // sidebar's lazy check-detail fetches (U5) and mutation actions (U6). client, diff --git a/mobile/src/session/use-mobile-diff-review-interactions.ts b/mobile/src/session/use-mobile-diff-review-interactions.ts index 1f8c78e1f195..f3a5d855eaa7 100644 --- a/mobile/src/session/use-mobile-diff-review-interactions.ts +++ b/mobile/src/session/use-mobile-diff-review-interactions.ts @@ -25,6 +25,7 @@ import { connectionRetryAction } from '../transport/connection-retry-action' type InteractionInput = { client: RpcClient | null connState: ConnectionState + hostCapabilities: readonly string[] hostId: string worktreeId: string screenState: ReviewScreenState @@ -55,6 +56,7 @@ export function useMobileDiffReviewInteractions(input: InteractionInput) { const { client, connState, + hostCapabilities, hostId, worktreeId, screenState, @@ -123,6 +125,7 @@ export function useMobileDiffReviewInteractions(input: InteractionInput) { useMobileDiffReviewSendActions({ client, connState, + hostCapabilities, worktreeId, screenState, setActionError, diff --git a/mobile/src/session/use-mobile-diff-review-send-actions.test.ts b/mobile/src/session/use-mobile-diff-review-send-actions.test.ts index ab41abb6b4bd..125e2e583504 100644 --- a/mobile/src/session/use-mobile-diff-review-send-actions.test.ts +++ b/mobile/src/session/use-mobile-diff-review-send-actions.test.ts @@ -3,6 +3,7 @@ import { act, create, type ReactTestRenderer } from 'react-test-renderer' import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from 'vitest' import type { DiffComment } from '../../../src/shared/diff-comment-types' import type { RpcClient } from '../transport/rpc-client' +import type { RpcResponse } from '../transport/types' import type { ReviewScreenState } from './mobile-diff-review-screen-model' import type { ReviewSheetIntents } from './mobile-diff-review-sheets' import { @@ -12,6 +13,21 @@ import { } from './mobile-native-chat-stale-input' import { useMobileDiffReviewSendActions } from './use-mobile-diff-review-send-actions' +// A connected client whose only behaviour is the scripted `sendRequest`. +function requestPortRpcClient(sendRequest: RpcClient['sendRequest']): RpcClient { + return { + sendRequest, + subscribe: () => () => {}, + updateTerminalSubscriptionViewport: () => {}, + getState: () => 'connected', + getReconnectAttempt: () => 0, + getLastConnectedAt: () => null, + onStateChange: () => () => {}, + notifyForeground: () => {}, + close: () => {} + } +} + type SendActions = ReturnType vi.mock('../platform/haptics', () => ({ triggerSuccess: vi.fn() })) @@ -39,6 +55,46 @@ const COMMENT: DiffComment = { side: 'modified' } +const LAUNCH_CAPABILITIES = [ + 'agent.launch.v2', + 'agent.launch.replay.v1', + 'agent.launch.replay-required.v1' +] + +function rpcReply(result: unknown) { + return { id: 'rpc', ok: true as const, result, _meta: { runtimeId: 'r' } } +} + +function launchedReply(promptOutcome: 'handed-to-terminal' | 'not-delivered', warning?: string) { + return rpcReply({ + outcome: { kind: 'terminal', handle: 'term-1' }, + worktreeId: 'wt-1', + receipt: { mode: 'terminal', preferred: 'terminal', reason: 'user_default', detail: 'd' }, + prompt: { delivery: 'submit', outcome: promptOutcome }, + ...(warning ? { warning } : {}) + }) +} + +// Answers the agent loader's reads and the launch, by method. +function launchClient( + promptOutcome: 'handed-to-terminal' | 'not-delivered', + launchReply: () => Promise = async () => launchedReply(promptOutcome) +) { + const sendRequest = vi.fn(async (method: string, _params?: unknown): Promise => { + if (method === 'repo.list') { + return rpcReply({ repos: [{ id: 'wt-1' }] }) + } + if (method === 'settings.get') { + return rpcReply({ settings: { defaultTuiAgent: 'codex' } }) + } + if (method === 'preflight.detectAgents') { + return rpcReply(['codex']) + } + return launchReply() + }) + return { client: requestPortRpcClient(sendRequest), sendRequest } +} + const READY: ReviewScreenState = { kind: 'ready', status: { entries: [], conflictOperation: 'none' }, @@ -58,8 +114,10 @@ describe('useMobileDiffReviewSendActions', () => { updateSendSheet: Mock } let saveCommentsAndReviewState: ReturnType + let screenState: ReviewScreenState = READY beforeEach(() => { + screenState = READY clipboardMock.setStringAsync.mockReset().mockResolvedValue(true) resetMobileNativeChatStaleInputForTests() setActionError = vi.fn() @@ -78,8 +136,9 @@ describe('useMobileDiffReviewSendActions', () => { actions = useMobileDiffReviewSendActions({ client: mountedClient, connState: 'connected', + hostCapabilities: LAUNCH_CAPABILITIES, worktreeId: 'wt-1', - screenState: READY, + screenState, setActionError, sheets, saveCommentsAndReviewState @@ -244,4 +303,141 @@ describe('useMobileDiffReviewSendActions', () => { expect((error as Error).message).toBe('pane gone') expect(saveCommentsAndReviewState).not.toHaveBeenCalled() }) + + it('starts a new agent with the notes through the host and marks them sent', async () => { + const { client, sendRequest } = launchClient('handed-to-terminal') + await mount(client) + await act(async () => { + await actions?.createTerminalAndSend([COMMENT]) + }) + const launch = sendRequest.mock.calls.find(([method]) => method === 'agent.launchReplay') + expect(launch?.[1]).toMatchObject({ + agent: 'codex', + target: { kind: 'existing', worktree: 'id:wt-1' }, + prompt: { delivery: 'submit' }, + launchSource: 'notes_send' + }) + expect(sendRequest.mock.calls.some(([method]) => method === 'terminal.send')).toBe(false) + expect(saveCommentsAndReviewState).toHaveBeenCalledOnce() + expect(setActionError).toHaveBeenLastCalledWith('Review notes sent') + }) + + it('keeps saying the notes were sent when the host adds a warning', async () => { + await mount( + launchClient('handed-to-terminal', async () => + launchedReply('handed-to-terminal', 'the requested arguments were ignored.') + ).client + ) + await act(async () => { + await actions?.createTerminalAndSend([COMMENT]) + }) + expect(saveCommentsAndReviewState).toHaveBeenCalledOnce() + expect(setActionError).toHaveBeenLastCalledWith( + 'Review notes sent. the requested arguments were ignored.' + ) + }) + + it('says it is waiting for the desktop instead of rejecting when there is no connection', async () => { + await mountWithoutClient() + await act(async () => { + await expect(actions?.createTerminalAndSend([COMMENT])).resolves.toBeUndefined() + }) + expect(sheets.closeSheet).toHaveBeenCalledWith('send') + expect(setActionError).toHaveBeenLastCalledWith('Waiting for desktop...') + }) + + it('keeps the notes unsent when the agent started without them', async () => { + await mount(launchClient('not-delivered').client) + await act(async () => { + await actions?.createTerminalAndSend([COMMENT]) + }) + expect(saveCommentsAndReviewState).not.toHaveBeenCalled() + expect(setActionError).toHaveBeenLastCalledWith( + "The agent started, but the notes weren't sent. Use Copy Notes to paste them." + ) + }) + + it('shows a launch that did not start on the review screen instead of rejecting', async () => { + await mount( + launchClient('handed-to-terminal', async () => ({ + id: 'rpc', + ok: false, + error: { code: 'selector_not_found', message: 'Workspace not found' }, + _meta: { runtimeId: 'r' } + })).client + ) + await act(async () => { + await actions?.createTerminalAndSend([COMMENT]) + }) + expect(sheets.closeSheet).toHaveBeenCalledWith('send') + expect(setActionError).toHaveBeenLastCalledWith('Workspace not found') + expect(saveCommentsAndReviewState).not.toHaveBeenCalled() + }) + + it('starts one agent for a double tap and keeps notes written while it starts', async () => { + let answerLaunch: (reply: RpcResponse) => void = () => {} + const { client, sendRequest } = launchClient( + 'handed-to-terminal', + () => + new Promise((resolve) => { + answerLaunch = resolve + }) + ) + await mount(client) + let first: Promise | undefined + await act(async () => { + first = actions?.createTerminalAndSend([COMMENT]) + await actions?.createTerminalAndSend([COMMENT]) + }) + expect(setActionError).toHaveBeenLastCalledWith('Starting an agent...') + const written: DiffComment = { ...COMMENT, id: 'comment-2', body: 'written meanwhile' } + screenState = { ...READY, comments: [COMMENT, written] } + await act(async () => { + renderer?.update(createElement(Harness)) + }) + await act(async () => { + answerLaunch(launchedReply('handed-to-terminal')) + await first + }) + expect( + sendRequest.mock.calls.filter(([method]) => method === 'agent.launchReplay') + ).toHaveLength(1) + expect(saveCommentsAndReviewState).toHaveBeenCalledWith( + [ + expect.objectContaining({ id: 'comment-1', sentAt: expect.any(Number) }), + expect.not.objectContaining({ sentAt: expect.anything() }) + ], + READY.reviewState + ) + expect(saveCommentsAndReviewState.mock.calls[0]?.[0]?.[1]?.id).toBe('comment-2') + expect(setActionError).toHaveBeenLastCalledWith('Review notes sent') + }) + + // The save rolls back to the screen it was created with, so a stale one would drop newer notes. + it('marks the notes sent through the save of the latest render, not the one from the tap', async () => { + let answerLaunch: (reply: RpcResponse) => void = () => {} + const { client } = launchClient( + 'handed-to-terminal', + () => + new Promise((resolve) => { + answerLaunch = resolve + }) + ) + await mount(client) + let first: Promise | undefined + await act(async () => { + first = actions?.createTerminalAndSend([COMMENT]) + }) + const tapTimeSave = saveCommentsAndReviewState + saveCommentsAndReviewState = vi.fn().mockResolvedValue(undefined) + await act(async () => { + renderer?.update(createElement(Harness)) + }) + await act(async () => { + answerLaunch(launchedReply('handed-to-terminal')) + await first + }) + expect(tapTimeSave).not.toHaveBeenCalled() + expect(saveCommentsAndReviewState).toHaveBeenCalledOnce() + }) }) diff --git a/mobile/src/session/use-mobile-diff-review-send-actions.ts b/mobile/src/session/use-mobile-diff-review-send-actions.ts index 90ddd591300d..bea344cd3874 100644 --- a/mobile/src/session/use-mobile-diff-review-send-actions.ts +++ b/mobile/src/session/use-mobile-diff-review-send-actions.ts @@ -1,4 +1,4 @@ -import { useCallback, type Dispatch, type SetStateAction } from 'react' +import { useCallback, useEffect, useRef, type Dispatch, type SetStateAction } from 'react' import type { DiffComment, MobileDiffReviewState } from '../../../src/shared/diff-comment-types' import type { ConnectionState } from '../transport/types' import type { RpcClient } from '../transport/rpc-client' @@ -6,11 +6,8 @@ import { useClipboardWriter } from '../platform/clipboard' import { triggerSuccess } from '../platform/haptics' import { formatDiffComments, formatMobileDiffReviewPrompt } from './mobile-diff-comments' import { clearSentMobileDiffComments, markMobileDiffCommentsSent } from './mobile-diff-comment-edit' -import { - reviewTerminalCreateRun, - reviewTerminalListRead, - reviewTerminalSendRun -} from './mobile-review-terminal-operations' +import { reviewTerminalListRead, reviewTerminalSendRun } from './mobile-review-terminal-operations' +import { launchAgentWithPrompt } from './pr-ai-triage-launch' import { interpretOrThrowRefusalMessage } from '../transport/rpc-refusal-message' import { healMobileNativeChatStaleInput } from './mobile-native-chat-stale-input' import type { ReviewScreenState } from './mobile-diff-review-screen-model' @@ -19,6 +16,7 @@ import type { ReviewSheetIntents } from './mobile-diff-review-sheets' type SendActionsInput = { client: RpcClient | null connState: ConnectionState + hostCapabilities: readonly string[] worktreeId: string screenState: ReviewScreenState setActionError: Dispatch> @@ -36,6 +34,7 @@ export function useMobileDiffReviewSendActions(input: SendActionsInput) { const { client, connState, + hostCapabilities, worktreeId, screenState, setActionError, @@ -68,20 +67,27 @@ export function useMobileDiffReviewSendActions(input: SendActionsInput) { await saveCommentsAndReviewState(nextComments, screenState.reviewState) }, [saveCommentsAndReviewState, screenState]) - const markNotesSent = useCallback( - async (comments: readonly DiffComment[]) => { - if (screenState.kind !== 'ready') { - return - } - const next = markMobileDiffCommentsSent( - screenState.comments, - new Set(comments.map((comment) => comment.id)), - Date.now() - ) - await saveCommentsAndReviewState(next, screenState.reviewState) - }, - [saveCommentsAndReviewState, screenState] - ) + // Read when a send settles, not when it was tapped: an agent launch can take a minute, and notes + // written meanwhile must survive the whole-list save below, and its rollback if that save fails. + const latestRef = useRef({ screenState, save: saveCommentsAndReviewState }) + useEffect(() => { + latestRef.current = { screenState, save: saveCommentsAndReviewState } + }, [saveCommentsAndReviewState, screenState]) + // One launch at a time: each tap is a new operation, so a second tap would start a second agent. + const agentLaunchInFlightRef = useRef(false) + + const markNotesSent = useCallback(async (comments: readonly DiffComment[]) => { + const { screenState: current, save } = latestRef.current + if (current.kind !== 'ready') { + return + } + const next = markMobileDiffCommentsSent( + current.comments, + new Set(comments.map((comment) => comment.id)), + Date.now() + ) + await save(next, current.reviewState) + }, []) const sendPromptToTerminal = useCallback( async (terminal: string, comments: readonly DiffComment[]) => { @@ -116,23 +122,51 @@ export function useMobileDiffReviewSendActions(input: SendActionsInput) { const createTerminalAndSend = useCallback( async (comments: readonly DiffComment[]) => { + // Reported, not thrown: the sheet's caller drops the promise, so a throw would show nothing. if (!client || connState !== 'connected') { - throw new Error('Waiting for desktop...') + closeSheet('send') + setActionError('Waiting for desktop...') + return } - const response = await reviewTerminalCreateRun.request(client, { - worktree: `id:${worktreeId}`, - activate: false, - select: true, - navigation: 'caller' - }) - let created - created = interpretOrThrowRefusalMessage( - () => reviewTerminalCreateRun.interpret(response), - 'Failed to create terminal' - ) - await sendPromptToTerminal(created.terminal, comments) + if (agentLaunchInFlightRef.current) { + return + } + agentLaunchInFlightRef.current = true + // Closed up front so the wait (up to a minute for a terminal agent) shows its progress here. + closeSheet('send') + setActionError('Starting an agent...') + let result + try { + // The desktop asks which agent to use; the review screen has no picker, so this takes the + // desktop's own default resolution with no saved recipe. + result = await launchAgentWithPrompt({ + client, + hostCapabilities, + worktreeId, + prompt: formatMobileDiffReviewPrompt(comments), + actionId: null, + launchSource: 'notes_send' + }) + } finally { + agentLaunchInFlightRef.current = false + } + if (result.kind === 'not-started' || result.kind === 'unconfirmed') { + setActionError(result.message) + return + } + if (result.kind === 'prompt-not-sent') { + // Notes stay unsent so Copy Notes and a later send still carry them. + setActionError( + "The agent started, but the notes weren't sent. Use Copy Notes to paste them." + ) + return + } + await markNotesSent(comments) + triggerSuccess() + // The warning is a note on a launch that went ahead, so it follows the success, not replaces it. + setActionError(result.warning ? `Review notes sent. ${result.warning}` : 'Review notes sent') }, - [client, connState, sendPromptToTerminal, worktreeId] + [client, closeSheet, connState, hostCapabilities, markNotesSent, setActionError, worktreeId] ) const openSendSheet = useCallback(async () => { diff --git a/mobile/src/session/use-mobile-pr-ai-triage.test.ts b/mobile/src/session/use-mobile-pr-ai-triage.test.ts new file mode 100644 index 000000000000..d3e284fe882f --- /dev/null +++ b/mobile/src/session/use-mobile-pr-ai-triage.test.ts @@ -0,0 +1,120 @@ +import { createElement } from 'react' +import { act, create, type ReactTestRenderer } from 'react-test-renderer' +import { afterEach, describe, expect, it, vi } from 'vitest' +import type { RpcClient } from '../transport/rpc-client' +import type { ConnectionState, RpcResponse } from '../transport/types' + +vi.mock('../platform/haptics', () => ({ triggerError: vi.fn(), triggerSuccess: vi.fn() })) + +import { useMobilePrAiTriage, type MobilePrAiTriage } from './use-mobile-pr-ai-triage' + +const LAUNCH_CAPABILITIES = [ + 'agent.launch.v2', + 'agent.launch.replay.v1', + 'agent.launch.replay-required.v1' +] + +function rpcReply(result: unknown): RpcResponse { + return { id: 'rpc', ok: true, result, _meta: { runtimeId: 'r' } } +} + +const LAUNCHED_WITH_PROMPT = rpcReply({ + outcome: { kind: 'terminal', handle: 'term-1' }, + worktreeId: 'wt-1', + receipt: { mode: 'terminal', preferred: 'terminal', reason: 'user_default', detail: 'd' }, + prompt: { delivery: 'submit', outcome: 'handed-to-terminal' } +}) + +const LAUNCHED_WITHOUT_PROMPT = rpcReply({ + outcome: { kind: 'terminal', handle: 'term-1' }, + worktreeId: 'wt-1', + receipt: { mode: 'terminal', preferred: 'terminal', reason: 'user_default', detail: 'd' }, + prompt: { delivery: 'submit', outcome: 'not-delivered' } +}) + +function hostClient(launchReply: RpcResponse = LAUNCHED_WITHOUT_PROMPT): RpcClient { + const sendRequest = vi.fn(async (method: string): Promise => { + if (method === 'repo.list') { + return rpcReply({ repos: [{ id: 'wt-1' }] }) + } + if (method === 'settings.get') { + return rpcReply({ settings: { defaultTuiAgent: 'codex' } }) + } + if (method === 'preflight.detectAgents') { + return rpcReply(['codex']) + } + return launchReply + }) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the hook reaches the client only through sendRequest. + return { sendRequest } as unknown as RpcClient +} + +describe('useMobilePrAiTriage', () => { + let renderer: ReactTestRenderer | null = null + let triage: MobilePrAiTriage | null = null + + afterEach(() => { + act(() => renderer?.unmount()) + renderer = null + triage = null + }) + + function mount(client: RpcClient | null, connState: ConnectionState = 'connected') { + function Harness(): null { + triage = useMobilePrAiTriage({ + client, + connState, + worktreeId: 'wt-1', + workspaceLabel: 'feature-login', + hostCapabilities: LAUNCH_CAPABILITIES, + hostStatusPending: false, + hostStatusReadable: true + }) + return null + } + act(() => { + renderer = create(createElement(Harness)) + }) + } + + it('shows an undelivered prompt only under the button that launched it', async () => { + mount(hostClient()) + await act(async () => { + await triage?.launch('fix-checks', () => 'fix the failing checks') + }) + expect(triage?.noticeFor('fix-checks')).toMatchObject({ + error: "The agent started, but the prompt wasn't sent." + }) + expect(triage?.noticeFor('fix-checks').undeliveredPrompt).toContain('fix the failing checks') + expect(triage?.noticeFor('fix-checks').success).toBeNull() + expect(triage?.noticeFor('resolve-conflicts')).toEqual({ + success: null, + error: null, + warning: null, + undeliveredPrompt: null + }) + }) + + it('confirms a launch that delivered its prompt under the tapped button, naming the workspace', async () => { + mount(hostClient(LAUNCHED_WITH_PROMPT)) + await act(async () => { + await triage?.launch('resolve-conflicts', () => 'resolve the conflicts') + }) + expect(triage?.noticeFor('resolve-conflicts')).toEqual({ + success: 'Agent started in feature-login', + error: null, + warning: null, + undeliveredPrompt: null + }) + expect(triage?.noticeFor('fix-checks').success).toBeNull() + }) + + it('shows a refusal before launch only under the tapped button', async () => { + mount(null, 'disconnected') + await act(async () => { + await triage?.launch('resolve-conflicts', () => 'resolve') + }) + expect(triage?.noticeFor('resolve-conflicts').error).toBe('Waiting for desktop…') + expect(triage?.noticeFor('fix-checks').error).toBeNull() + }) +}) diff --git a/mobile/src/session/use-mobile-pr-ai-triage.ts b/mobile/src/session/use-mobile-pr-ai-triage.ts index d3186f36ab11..70215d9bbf02 100644 --- a/mobile/src/session/use-mobile-pr-ai-triage.ts +++ b/mobile/src/session/use-mobile-pr-ai-triage.ts @@ -2,61 +2,131 @@ import { useCallback, useRef, useState } from 'react' import type { ConnectionState } from '../transport/types' import type { RpcClient } from '../transport/rpc-client' import { triggerError, triggerSuccess } from '../platform/haptics' -import { createTerminalAndSendPrompt } from './pr-ai-triage-launch' +import { launchAgentWithPrompt, promptedLaunchNotice } from './pr-ai-triage-launch' +import { + resolveMobileAgentLaunchAvailability, + type MobileAgentLaunchAvailability +} from './mobile-agent-launch-availability' // Launches an agent for the PR triage actions ("Fix checks with AI" / "Resolve -// conflicts with AI") via createTerminalAndSendPrompt; see pr-ai-triage-launch.ts. +// conflicts with AI") via launchAgentWithPrompt; see pr-ai-triage-launch.ts. export type PrAiTriageKey = 'fix-checks' | 'resolve-conflicts' +// The desktop's saved-recipe ids and telemetry sources for the same two buttons. +const TRIAGE_LAUNCH = { + 'fix-checks': { actionId: 'fixChecks', launchSource: 'task_page' }, + 'resolve-conflicts': { actionId: 'resolveConflicts', launchSource: 'conflict_resolution' } +} as const + +/** What the last launch from one button left to show under that button. */ +export type PrAiTriageLaunchNotice = { + success: string | null + error: string | null + warning: string | null + /** The agent started without its prompt; kept so the user can paste it in themselves. */ + undeliveredPrompt: string | null +} + +const NO_LAUNCH_NOTICE: PrAiTriageLaunchNotice = { + success: null, + error: null, + warning: null, + undeliveredPrompt: null +} + type Input = { client: RpcClient | null connState: ConnectionState worktreeId: string + /** Named in the confirmation; the screen's workspace label, else its branch. */ + workspaceLabel: string | null + hostCapabilities: readonly string[] + hostStatusPending: boolean + hostStatusReadable: boolean } export function useMobilePrAiTriage(input: Input) { - const { client, connState, worktreeId } = input + const { + client, + connState, + worktreeId, + workspaceLabel, + hostCapabilities, + hostStatusPending, + hostStatusReadable + } = input const [busyKey, setBusyKey] = useState(null) - const [error, setError] = useState(null) + // Keyed by button, so one button's launch never shows (or offers to copy) under the other. + const [notices, setNotices] = useState>>({}) // Synchronous lock: setBusyKey commits async, so a fast double-tap could pass the // busyKey check twice before either render. The ref flips immediately and dedupes. const inFlightRef = useRef(false) + const availability: MobileAgentLaunchAvailability = resolveMobileAgentLaunchAvailability({ + hostCapabilities, + statusPending: hostStatusPending, + statusReadable: hostStatusReadable + }) + + const setNotice = useCallback((key: PrAiTriageKey, notice: PrAiTriageLaunchNotice) => { + setNotices((current) => ({ ...current, [key]: notice })) + }, []) const launch = useCallback( async (key: PrAiTriageKey, buildPrompt: () => string): Promise => { // Guard re-entry: one triage launch at a time keeps us from opening a pile - // of terminals on a fast double-tap. + // of agents on a fast double-tap. if (inFlightRef.current || busyKey !== null) { return false } if (!client || connState !== 'connected') { - setError('Waiting for desktop…') + setNotice(key, { ...NO_LAUNCH_NOTICE, error: 'Waiting for desktop…' }) triggerError() return false } inFlightRef.current = true setBusyKey(key) - setError(null) + setNotice(key, NO_LAUNCH_NOTICE) try { - await createTerminalAndSendPrompt(client, worktreeId, buildPrompt()) - triggerSuccess() - return true + const prompt = buildPrompt() + const result = await launchAgentWithPrompt({ + client, + hostCapabilities, + worktreeId, + prompt, + ...TRIAGE_LAUNCH[key] + }) + const notice = promptedLaunchNotice(result, workspaceLabel) + if (notice.succeeded) { + triggerSuccess() + } else { + triggerError() + } + setNotice(key, { + success: notice.success, + error: notice.error, + warning: notice.warning, + undeliveredPrompt: notice.undeliveredPrompt + }) + return notice.succeeded } catch (err) { triggerError() - setError(err instanceof Error ? err.message : 'Failed to launch agent') + setNotice(key, { + ...NO_LAUNCH_NOTICE, + error: err instanceof Error ? err.message : 'Failed to launch agent' + }) return false } finally { inFlightRef.current = false setBusyKey(null) } }, - [busyKey, client, connState, worktreeId] + [busyKey, client, connState, hostCapabilities, setNotice, workspaceLabel, worktreeId] ) return { - error, - clearError: useCallback(() => setError(null), []), + availability, + noticeFor: (key: PrAiTriageKey): PrAiTriageLaunchNotice => notices[key] ?? NO_LAUNCH_NOTICE, isBusy: useCallback((key: PrAiTriageKey) => busyKey === key, [busyKey]), launch } diff --git a/mobile/src/source-control/MobileCommitFailurePanel.tsx b/mobile/src/source-control/MobileCommitFailurePanel.tsx index 451d61db9e54..26fa6b964ba4 100644 --- a/mobile/src/source-control/MobileCommitFailurePanel.tsx +++ b/mobile/src/source-control/MobileCommitFailurePanel.tsx @@ -2,6 +2,7 @@ import { useState } from 'react' import { ActivityIndicator, Pressable, Text, View } from 'react-native' import { ChevronDown, ChevronRight, Sparkles } from 'lucide-react-native' import { colors } from '../theme/mobile-theme' +import { AgentLaunchNotice } from '../components/AgentLaunchNotice' import type { MobileCommitFailureRecovery } from './mobile-commit-failure-recovery' import type { MobileCommitFailureRecoveryAction } from './use-mobile-commit-failure-recovery' import { styles } from './mobile-source-control-styles' @@ -28,11 +29,12 @@ export function MobileCommitFailurePanel({ failure, action }: Props) { [ styles.commitFailureFixButton, - action.launching && styles.commitFailureFixButtonDisabled, + (action.launching || action.availability !== 'available') && + styles.commitFailureFixButtonDisabled, pressed && styles.commitFailureFixButtonPressed ]} onPress={() => void action.launch()} - disabled={action.launching} + disabled={action.launching || action.availability !== 'available'} accessibilityRole="button" accessibilityLabel="Fix commit failure with AI" > @@ -65,9 +67,14 @@ export function MobileCommitFailurePanel({ failure, action }: Props) { {expanded ? {detailsText} : null} ) : null} - {action.launchError ? ( - {action.launchError} - ) : null} + ) } diff --git a/mobile/src/source-control/MobileSourceControlPanel.tsx b/mobile/src/source-control/MobileSourceControlPanel.tsx index c223510184e4..f63885ac7c59 100644 --- a/mobile/src/source-control/MobileSourceControlPanel.tsx +++ b/mobile/src/source-control/MobileSourceControlPanel.tsx @@ -328,6 +328,7 @@ export function MobileSourceControlPanel({ // Gate on the probe too: isGithubRepo=false mid-probe must render loading, not flash "unavailable". branchContextLoaded={ready && prController.prSidebarRepoProbeLoaded} controller={prController} + workspaceLabel={worktreeLabel} /> ) : activeTab === 'pr' ? ( diff --git a/mobile/src/source-control/use-mobile-commit-failure-recovery.test.ts b/mobile/src/source-control/use-mobile-commit-failure-recovery.test.ts new file mode 100644 index 000000000000..157a87b7448d --- /dev/null +++ b/mobile/src/source-control/use-mobile-commit-failure-recovery.test.ts @@ -0,0 +1,124 @@ +import { createElement } from 'react' +import { act, create, type ReactTestRenderer } from 'react-test-renderer' +import { afterEach, describe, expect, it, vi } from 'vitest' +import type { RpcClient } from '../transport/rpc-client' +import type { RpcResponse } from '../transport/types' +import type { MobileCommitFailureRecovery } from './mobile-commit-failure-recovery' + +vi.mock('../platform/haptics', () => ({ triggerError: vi.fn(), triggerSuccess: vi.fn() })) +vi.mock('../components/HostProtocolGate', () => ({ + useHostProtocolGates: () => ({ + hostCapabilities: [ + 'agent.launch.v2', + 'agent.launch.replay.v1', + 'agent.launch.replay-required.v1' + ], + statusPending: false, + statusReadable: true + }) +})) + +import { useMobileCommitFailureRecovery } from './use-mobile-commit-failure-recovery' + +type Recovery = ReturnType + +function rpcReply(result: unknown): RpcResponse { + return { id: 'rpc', ok: true, result, _meta: { runtimeId: 'r' } } +} + +const LAUNCHED_WITH_WARNING = rpcReply({ + outcome: { kind: 'terminal', handle: 'term-1' }, + worktreeId: 'wt-1', + receipt: { mode: 'terminal', preferred: 'terminal', reason: 'user_default', detail: 'd' }, + prompt: { delivery: 'submit', outcome: 'handed-to-terminal' }, + warning: 'the requested arguments were ignored.' +}) + +function hostClient(launchReply: () => Promise) { + const sendRequest = vi.fn(async (method: string): Promise => { + if (method === 'repo.list') { + return rpcReply({ repos: [{ id: 'wt-1' }] }) + } + if (method === 'settings.get') { + return rpcReply({ settings: { defaultTuiAgent: 'codex' } }) + } + if (method === 'preflight.detectAgents') { + return rpcReply(['codex']) + } + return launchReply() + }) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the hook reaches the client only through sendRequest. + return { client: { sendRequest } as unknown as RpcClient, sendRequest } +} + +const FAILURE: MobileCommitFailureRecovery = { + error: 'pre-commit hook failed', + commitMessage: 'wip', + stagedEntries: [] +} + +describe('useMobileCommitFailureRecovery', () => { + let renderer: ReactTestRenderer | null = null + let recovery: Recovery | null = null + + afterEach(() => { + act(() => renderer?.unmount()) + renderer = null + recovery = null + }) + + function mount(client: RpcClient, failure: MobileCommitFailureRecovery | null = FAILURE) { + function Harness(props: { failure: MobileCommitFailureRecovery | null }): null { + recovery = useMobileCommitFailureRecovery({ + client, + connState: 'connected', + worktreeId: 'wt-1', + workspaceLabel: 'feature-login', + failure: props.failure + }) + return null + } + act(() => { + renderer = create(createElement(Harness, { failure })) + }) + return (next: MobileCommitFailureRecovery | null) => + act(() => renderer?.update(createElement(Harness, { failure: next }))) + } + + it('reports the host warning on a launch that went ahead as a warning, not an error', async () => { + const rerender = mount(hostClient(async () => LAUNCHED_WITH_WARNING).client) + let succeeded: boolean | undefined + await act(async () => { + succeeded = await recovery?.launch() + }) + expect(succeeded).toBe(true) + expect(recovery?.launchError).toBeNull() + expect(recovery?.launchWarning).toBe('the requested arguments were ignored.') + expect(recovery?.launchSuccess).toBe('Agent started in feature-login') + // A new failure is a new launch; the old one's note does not carry over. + rerender({ ...FAILURE, error: 'another hook failed' }) + expect(recovery?.launchWarning).toBeNull() + expect(recovery?.launchSuccess).toBeNull() + }) + + it('starts one agent for two taps before the first one re-renders', async () => { + let release: () => void = () => {} + const answered = new Promise((resolve) => (release = resolve)) + const { client, sendRequest } = hostClient(async () => { + await answered + return LAUNCHED_WITH_WARNING + }) + mount(client) + const launch = recovery?.launch + let taps: boolean[] = [] + await act(async () => { + const both = Promise.all([launch?.(), launch?.()]) + release() + taps = (await both).map(Boolean) + }) + expect(taps).toEqual([true, false]) + expect( + sendRequest.mock.calls.filter(([method]) => method === 'agent.launchReplay') + ).toHaveLength(1) + }) +}) diff --git a/mobile/src/source-control/use-mobile-commit-failure-recovery.ts b/mobile/src/source-control/use-mobile-commit-failure-recovery.ts index a2332fbca514..fb19f7495ee2 100644 --- a/mobile/src/source-control/use-mobile-commit-failure-recovery.ts +++ b/mobile/src/source-control/use-mobile-commit-failure-recovery.ts @@ -1,8 +1,10 @@ -import { useCallback, useEffect, useMemo, useState } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import type { ConnectionState } from '../transport/types' import type { RpcClient } from '../transport/rpc-client' import { triggerError, triggerSuccess } from '../platform/haptics' -import { createTerminalAndSendPrompt } from '../session/pr-ai-triage-launch' +import { useHostProtocolGates } from '../components/HostProtocolGate' +import { launchAgentWithPrompt, promptedLaunchNotice } from '../session/pr-ai-triage-launch' +import { resolveMobileAgentLaunchAvailability } from '../session/mobile-agent-launch-availability' import { buildFixCommitFailurePrompt, type MobileCommitFailureRecovery, @@ -14,13 +16,45 @@ type Params = { client: RpcClient | null connState: ConnectionState worktreeId: string + /** Named in the confirmation; the screen's workspace label, else its branch. */ + workspaceLabel: string | null failure: MobileCommitFailureRecovery | null } -export function useMobileCommitFailureRecovery({ client, connState, worktreeId, failure }: Params) { +export function useMobileCommitFailureRecovery({ + client, + connState, + worktreeId, + workspaceLabel, + failure +}: Params) { + const hostStatus = useHostProtocolGates() + const { hostCapabilities } = hostStatus const [launching, setLaunching] = useState(false) + // `launching` commits on the next render; each tap is a new operation, so a second one in that gap + // would start a second agent. + const inFlightRef = useRef(false) const [launchError, setLaunchError] = useState(null) + // The agent started without its prompt; kept so the user can paste it in themselves. Keyed by the + // failure it was built for, so a new failure never shows the previous one's prompt. + const [undelivered, setUndelivered] = useState<{ + failure: MobileCommitFailureRecovery + prompt: string + } | null>(null) + const undeliveredPrompt = undelivered?.failure === failure ? undelivered.prompt : null + // The host's note on a launch that went ahead, keyed the same way. + const [warning, setWarning] = useState<{ + failure: MobileCommitFailureRecovery + text: string + } | null>(null) + const launchWarning = warning?.failure === failure ? warning.text : null + const [success, setSuccess] = useState<{ + failure: MobileCommitFailureRecovery + text: string + } | null>(null) + const launchSuccess = success?.failure === failure ? success.text : null const summary = useMemo(() => (failure ? summarizeCommitFailure(failure.error) : null), [failure]) + const availability = resolveMobileAgentLaunchAvailability(hostStatus) useEffect(() => { setLaunchError(null) @@ -45,7 +79,7 @@ export function useMobileCommitFailureRecovery({ client, connState, worktreeId, ) const launch = useCallback(async (): Promise => { - if (launching || !prompt) { + if (inFlightRef.current || launching || !prompt) { return false } if (!client || connState !== 'connected') { @@ -53,26 +87,53 @@ export function useMobileCommitFailureRecovery({ client, connState, worktreeId, triggerError() return false } + inFlightRef.current = true setLaunching(true) setLaunchError(null) + setWarning(null) + setSuccess(null) + setUndelivered(null) try { - await createTerminalAndSendPrompt(client, worktreeId, prompt) - triggerSuccess() - return true + const result = await launchAgentWithPrompt({ + client, + hostCapabilities, + worktreeId, + prompt, + actionId: 'fixCommitFailure', + launchSource: 'source_control_recovery' + }) + const notice = promptedLaunchNotice(result, workspaceLabel) + if (notice.succeeded) { + triggerSuccess() + } else { + triggerError() + } + setLaunchError(notice.error) + setWarning(failure && notice.warning ? { failure, text: notice.warning } : null) + setSuccess(failure && notice.success ? { failure, text: notice.success } : null) + setUndelivered( + failure && notice.undeliveredPrompt ? { failure, prompt: notice.undeliveredPrompt } : null + ) + return notice.succeeded } catch (err) { triggerError() setLaunchError(err instanceof Error ? err.message : 'Failed to launch agent') return false } finally { + inFlightRef.current = false setLaunching(false) } - }, [client, connState, launching, prompt, worktreeId]) + }, [client, connState, failure, hostCapabilities, launching, prompt, workspaceLabel, worktreeId]) return { summary, hasDetails, launching, + availability, launchError, + launchWarning, + launchSuccess, + undeliveredPrompt, launch } } diff --git a/mobile/src/source-control/use-mobile-source-control-commit-failure.ts b/mobile/src/source-control/use-mobile-source-control-commit-failure.ts index 32b92f248546..bde245667cf3 100644 --- a/mobile/src/source-control/use-mobile-source-control-commit-failure.ts +++ b/mobile/src/source-control/use-mobile-source-control-commit-failure.ts @@ -11,9 +11,15 @@ type Params = { client: RpcClient | null connState: ConnectionState worktreeId: string + worktreeLabel: string | null } -export function useMobileSourceControlCommitFailure({ client, connState, worktreeId }: Params): { +export function useMobileSourceControlCommitFailure({ + client, + connState, + worktreeId, + worktreeLabel +}: Params): { commitFailureRecovery: MobileCommitFailureRecovery | null commitFailureRecoveryAction: ReturnType recordCommitFailure: RecordMobileCommitFailure @@ -25,6 +31,7 @@ export function useMobileSourceControlCommitFailure({ client, connState, worktre client, connState, worktreeId, + workspaceLabel: worktreeLabel, failure: commitFailureRecovery }) return { commitFailureRecovery, commitFailureRecoveryAction, recordCommitFailure } diff --git a/mobile/src/source-control/use-mobile-source-control-state.ts b/mobile/src/source-control/use-mobile-source-control-state.ts index 1f541739d9a4..1e55dfe79efd 100644 --- a/mobile/src/source-control/use-mobile-source-control-state.ts +++ b/mobile/src/source-control/use-mobile-source-control-state.ts @@ -78,7 +78,7 @@ export function useMobileSourceControlState(params: MobileSourceControlStatePara const worktreeLabel = getWorktreeLabel(name, worktreeId) const statusIdentityKey = `${hostId}\0${worktreeId}` const { commitFailureRecovery, commitFailureRecoveryAction, recordCommitFailure } = - useMobileSourceControlCommitFailure({ client, connState, worktreeId }) + useMobileSourceControlCommitFailure({ client, connState, worktreeId, worktreeLabel }) const clearCommitFailureRecovery = useCallback(() => { recordCommitFailure(null) }, [recordCommitFailure]) diff --git a/mobile/src/tasks/agent-launch-worktree-create.test.ts b/mobile/src/tasks/agent-launch-request.test.ts similarity index 98% rename from mobile/src/tasks/agent-launch-worktree-create.test.ts rename to mobile/src/tasks/agent-launch-request.test.ts index ada5becd4cae..b9b25f17757e 100644 --- a/mobile/src/tasks/agent-launch-worktree-create.test.ts +++ b/mobile/src/tasks/agent-launch-request.test.ts @@ -3,7 +3,7 @@ import { agentLaunchCreateParams, isAgentLaunchUnsupportedRefusal, readAgentLaunchCreateOutcome -} from './agent-launch-worktree-create' +} from './agent-launch-request' describe('agentLaunchCreateParams', () => { it('carries the create payload verbatim minus the reserved agent fields', () => { diff --git a/mobile/src/tasks/agent-launch-worktree-create.ts b/mobile/src/tasks/agent-launch-request.ts similarity index 68% rename from mobile/src/tasks/agent-launch-worktree-create.ts rename to mobile/src/tasks/agent-launch-request.ts index 3348d471ce13..ddd0d85383e0 100644 --- a/mobile/src/tasks/agent-launch-worktree-create.ts +++ b/mobile/src/tasks/agent-launch-request.ts @@ -1,5 +1,9 @@ /** - * Issuing a mobile workspace create through `agent.launch` rather than `worktree.create`. + * Building mobile's `agent.launch` requests and reading their answers: a workspace create, and a + * launch into a workspace that already exists. + * + * The create half issues a mobile workspace create through `agent.launch` rather than + * `worktree.create`. * * `worktree.create` + `startupAgent` means "create the worktree agent-first": its startup terminal * IS the agent, so the structured branch below it is unreachable. That is why picking an agent on @@ -14,8 +18,13 @@ import { withoutReservedAgentCreateFields, + type AgentLaunchPrompt, type AgentLaunchResult } from '../../../src/shared/agent-launch-intent' +import { + AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY, + AGENT_LAUNCH_RUNTIME_CAPABILITY +} from '../../../src/shared/protocol-version' import type { TuiAgent } from '../../../src/shared/tui-agent' import type { RpcSendParams } from '../transport/rpc-params-contract' import type { WorkspaceCreateParams } from './workspace-create-params' @@ -27,6 +36,16 @@ export type AgentLaunchSupport = { replay: boolean } +/** Reads the host's advertised capabilities; unsupported stays plain `false`. */ +export function readAgentLaunchSupport( + capabilities: readonly string[] | null | undefined +): AgentLaunchSupport | false { + if (!capabilities?.includes(AGENT_LAUNCH_RUNTIME_CAPABILITY)) { + return false + } + return { replay: capabilities.includes(AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY) } +} + export type WorktreeCreateAgentLaunch = { agent: TuiAgent /** Resolved before the first create: an older host has no `agent.launch` at all. */ @@ -52,6 +71,27 @@ export function agentLaunchCreateParams( } } +/** + * A launch into a workspace that already exists. Always sent as `agent.launchReplay`: a host that + * predates `operationId` would strip it and run the launch unprotected, while the separate method + * makes such a host refuse instead. + */ +export function agentLaunchExistingParams(args: { + agent: TuiAgent + worktreeId: string + operationId: string + prompt?: AgentLaunchPrompt + launchSource?: string +}): RpcSendParams<'agent.launchReplay'> { + return { + agent: args.agent, + operationId: args.operationId, + target: { kind: 'existing', worktree: `id:${args.worktreeId}` }, + ...(args.prompt ? { prompt: args.prompt } : {}), + ...(args.launchSource ? { launchSource: args.launchSource } : {}) + } +} + /** * Reads the launch receipt. * @@ -97,3 +137,12 @@ export function isAgentLaunchUnsupportedRefusal(error: { } return (error.message ?? '').includes('agent_launch_unsupported') } + +/** The `agent.launchReplay` twin: an older host rejects the method rather than a field. */ +export function isAgentLaunchReplayUnsupportedRefusal(error: { code?: string }): boolean { + return ( + error.code === 'method_not_found' || + error.code === 'forbidden' || + error.code === 'agent_launch_replay_unsupported' + ) +} diff --git a/mobile/src/tasks/blank-workspace-create.ts b/mobile/src/tasks/blank-workspace-create.ts index af59df31822d..0bdd056533ea 100644 --- a/mobile/src/tasks/blank-workspace-create.ts +++ b/mobile/src/tasks/blank-workspace-create.ts @@ -1,7 +1,7 @@ import type { TuiAgent } from '../../../src/shared/tui-agent' import type { RpcClient } from '../transport/rpc-client' import { createWorktreeWithNameRetry, type WorktreeCreateResult } from './worktree-create-retry' -import type { WorktreeCreateAgentLaunch } from './agent-launch-worktree-create' +import type { WorktreeCreateAgentLaunch } from './agent-launch-request' import type { WorktreeCreateIdempotencyProbe } from './worktree-create-idempotency-policy' import { startupAgentCreateFields, diff --git a/mobile/src/tasks/replay-on-ambiguous-delivery.ts b/mobile/src/tasks/replay-on-ambiguous-delivery.ts new file mode 100644 index 000000000000..5179bdcb4920 --- /dev/null +++ b/mobile/src/tasks/replay-on-ambiguous-delivery.ts @@ -0,0 +1,115 @@ +import type { RpcClient } from '../transport/rpc-client' +import type { RpcResponse } from '../transport/types' +import { isRpcDeliveryUnknown } from '../transport/rpc-delivery-ambiguity' +import { waitForRpcClientReconnected } from '../transport/rpc-client-reconnect-wait' +import { isLogicalClientCutoverError } from '../transport/stable-logical-rpc-client' +import { + getWorktreeCreateReplayWindowMs, + type WorktreeCreateIdempotencySupport +} from './worktree-create-idempotency-policy' + +// Why: a request in flight when the mobile transport migrates (relay/direct hand-off on shoddy +// cellular, relay lease rotation) rejects with a cutover error even though the host may have +// completed it. The caller's replay identity makes a resend safe, so re-issue on the fresh session a +// bounded number of times instead of surfacing "RPC interrupted by connection migration". +const CUTOVER_MAX_RETRIES = 5 + +// Why: a plain socket close (cellular flap, relay drop, the phone backgrounding) also rejects the +// in-flight frame as delivery-unknown with no generation bump. The host may well have acted, so +// replay on the same identity instead of reporting a failure. +const AMBIGUOUS_MAX_RETRIES = 2 + +// Bounded so a spinner doesn't sit for the whole window; the deadline still caps it. +export const AMBIGUOUS_RECONNECT_WAIT_MS = 20_000 + +/** + * What makes resending the SAME request safe after an ambiguous delivery. + * + * `durable`: the host keeps a ledger row for the caller's operation id and answers a replay from it + * (or refuses an unknown outcome), so a resend is safe at any time. `window`: the host only caches a + * result in memory for a bounded time, so a resend is safe only while that record is guaranteed. + */ +export type AmbiguousDeliveryReplay = + | { kind: 'durable' } + | { kind: 'window'; support: WorktreeCreateIdempotencySupport } + +/** + * Sends, re-issuing the identical request whenever it went delivery-ambiguous. `send` must resend + * the same identity every call: a new one would be a new operation and defeat the replay. + * + * A definite answer (a success or a refusal) is returned untouched; `replayed` says whether it came + * from a resend, because a refusal on a replacement connection says nothing about what the first + * attempt did. With no replay policy the first transport error is rethrown. + */ +export async function sendReplayingAmbiguousDelivery( + client: RpcClient, + send: () => Promise, + replay: AmbiguousDeliveryReplay | null +): Promise<{ response: RpcResponse; replayed: boolean }> { + let migrationRetry = 0 + let ambiguousRetry = 0 + const firstSentAt = Date.now() + let replayDeadlineAt: number | null = null + for (;;) { + try { + // `send` must hand back the transport promise itself, so a delivery-unknown rejection reaches + // the catch below as the object the transport marked — the WeakSet cannot see through a wrapper. + const response = await send() + return { response, replayed: migrationRetry > 0 || ambiguousRetry > 0 } + } catch (error) { + if (!replay) { + throw error + } + if (isLogicalClientCutoverError(error)) { + if (migrationRetry >= CUTOVER_MAX_RETRIES) { + throw error + } + migrationRetry += 1 + // Why: LogicalClientCutoverError is raised only after migrateTo installs an + // authenticated replacement, so retry immediately instead of adding UI lag. + continue + } + if (!isRpcDeliveryUnknown(error) || ambiguousRetry >= AMBIGUOUS_MAX_RETRIES) { + throw error + } + // A legacy cache may expire before a request timeout; durable receipts refuse unsafe replay. + if (replay.kind === 'window' && client.getState() === 'connected') { + throw error + } + // Keep the legacy deadline fixed; the host itself refuses expired durable operation IDs. + replayDeadlineAt ??= + replay.kind === 'durable' + ? Infinity + : resolveReplayDeadline(client, firstSentAt, replay.support) + const remainingWindowMs = replayDeadlineAt - Date.now() + if (remainingWindowMs <= 0) { + throw error + } + ambiguousRetry += 1 + // Disconnected transports must reconnect before resend; bound the wait even for durable IDs. + if ( + !(await waitForRpcClientReconnected( + client, + Math.min(AMBIGUOUS_RECONNECT_WAIT_MS, remainingWindowMs) + )) + ) { + throw error + } + } + } +} + +// Latest instant the host's dedupe record is still guaranteed to exist, from the earliest +// point the request could have resolved. lastInboundAt stamps a frame that really arrived, +// so it stays honest across a suspension in a way a timer budget cannot; the send is the +// fallback, and a sound floor either way, because the host cannot resolve a request it has +// not yet received. +function resolveReplayDeadline( + client: RpcClient, + firstSentAt: number, + support: WorktreeCreateIdempotencySupport +): number { + const lastInboundAt = client.getLastInboundAt?.() ?? null + const anchor = lastInboundAt !== null && lastInboundAt > firstSentAt ? lastInboundAt : firstSentAt + return anchor + getWorktreeCreateReplayWindowMs(support) +} diff --git a/mobile/src/tasks/source-workspace-create.ts b/mobile/src/tasks/source-workspace-create.ts index fb86701707af..143f2dde752a 100644 --- a/mobile/src/tasks/source-workspace-create.ts +++ b/mobile/src/tasks/source-workspace-create.ts @@ -15,7 +15,7 @@ import { type WorkspaceCreateTaskItem } from './workspace-create-params' import { createWorktreeWithNameRetry, type WorktreeCreateResult } from './worktree-create-retry' -import type { WorktreeCreateAgentLaunch } from './agent-launch-worktree-create' +import type { WorktreeCreateAgentLaunch } from './agent-launch-request' import type { WorktreeCreateIdempotencyProbe } from './worktree-create-idempotency-policy' // The agent bundle the modal resolved: `choice` drives launch resolution — the diff --git a/mobile/src/tasks/workspace-create-reply-schema.ts b/mobile/src/tasks/workspace-create-reply-schema.ts index c632bfee0832..647ae3572b68 100644 --- a/mobile/src/tasks/workspace-create-reply-schema.ts +++ b/mobile/src/tasks/workspace-create-reply-schema.ts @@ -34,7 +34,7 @@ export const worktreeCreateReceiptSchema = z.looseObject({ * * Nothing under the container is required, because readAgentLaunchCreateOutcome already guards * every member it reads — `'worktreeId' in result` and a `typeof`/`trim` pair - * (agent-launch-worktree-create.ts:55-:64) — and answers `null` when either fails, which + * (agent-launch-request.ts, readAgentLaunchCreateOutcome) — and answers `null` when either fails, which * worktree-create-retry.ts:123 turns into "Failed to create workspace". That arm is preserved. * * What the container adds is the reply main could not name: a string, a number or `null` receipt diff --git a/mobile/src/tasks/worktree-create-capability.ts b/mobile/src/tasks/worktree-create-capability.ts index 636cb9a4832b..ed354522b307 100644 --- a/mobile/src/tasks/worktree-create-capability.ts +++ b/mobile/src/tasks/worktree-create-capability.ts @@ -1,9 +1,5 @@ import { useCallback, useEffect, useRef, useState } from 'react' -import { - AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY, - AGENT_LAUNCH_RUNTIME_CAPABILITY -} from '../../../src/shared/protocol-version' -import type { AgentLaunchSupport } from './agent-launch-worktree-create' +import { readAgentLaunchSupport, type AgentLaunchSupport } from './agent-launch-request' import type { RpcClient } from '../transport/rpc-client' import { isLogicalClientCutoverError } from '../transport/stable-logical-rpc-client' import { readMobileRuntimeHostPlatform } from '../transport/mobile-runtime-host-platform' @@ -59,10 +55,7 @@ export async function readNewWorktreeRuntimeCapabilities( const advertisedIdempotency = result.worktreeCreateIdempotency return { tasksSupported: capabilities.includes(MOBILE_TASKS_CAPABILITY), - // Unsupported stays plain `false`, the same shape `worktreeCreateIdempotency` uses. - agentLaunch: capabilities.includes(AGENT_LAUNCH_RUNTIME_CAPABILITY) - ? { replay: capabilities.includes(AGENT_LAUNCH_REPLAY_REQUIRED_RUNTIME_CAPABILITY) } - : false, + agentLaunch: readAgentLaunchSupport(capabilities), worktreeCreateIdempotency: supportsIdempotency ? advertisedIdempotency === undefined ? { dedupeTtlMs: WORKTREE_CREATE_DEDUPE_TTL_LEGACY_HOST_MS } diff --git a/mobile/src/tasks/worktree-create-retry.test.ts b/mobile/src/tasks/worktree-create-retry.test.ts index b61ab20c30e8..a42a0b1e84b4 100644 --- a/mobile/src/tasks/worktree-create-retry.test.ts +++ b/mobile/src/tasks/worktree-create-retry.test.ts @@ -8,10 +8,8 @@ import { WORKTREE_CREATE_DEDUPE_TTL_LEGACY_HOST_MS, type WorktreeCreateIdempotencySupport } from './worktree-create-idempotency-policy' -import { - createWorktreeWithNameRetry, - WORKTREE_CREATE_AMBIGUOUS_RECONNECT_WAIT_MS -} from './worktree-create-retry' +import { createWorktreeWithNameRetry } from './worktree-create-retry' +import { AMBIGUOUS_RECONNECT_WAIT_MS } from './replay-on-ambiguous-delivery' import { WORKTREE_CREATE_TIMEOUT_MS } from './workspace-create-timeout' type Attempt = { method: string; params: Record } @@ -840,6 +838,6 @@ describe('createWorktreeWithNameRetry', () => { expect(LEGACY_HOST_REPLAY_WINDOW_MS).toBeLessThan(WORKTREE_CREATE_DEDUPE_TTL_LEGACY_HOST_MS) // A reconnect wait is clamped when a short advertisement leaves less time. const shortReplayWindowMs = getWorktreeCreateReplayWindowMs({ dedupeTtlMs: 20_000 }) - expect(Math.min(WORKTREE_CREATE_AMBIGUOUS_RECONNECT_WAIT_MS, shortReplayWindowMs)).toBe(10_000) + expect(Math.min(AMBIGUOUS_RECONNECT_WAIT_MS, shortReplayWindowMs)).toBe(10_000) }) }) diff --git a/mobile/src/tasks/worktree-create-retry.ts b/mobile/src/tasks/worktree-create-retry.ts index 19c2b79ead0b..7ba680ba6356 100644 --- a/mobile/src/tasks/worktree-create-retry.ts +++ b/mobile/src/tasks/worktree-create-retry.ts @@ -1,14 +1,11 @@ import type { TuiAgent } from '../../../src/shared/tui-agent' import type { RpcClient } from '../transport/rpc-client' import type { RpcResponse } from '../transport/types' -import { isRpcDeliveryUnknown } from '../transport/rpc-delivery-ambiguity' import { agentLaunchRun, agentLaunchReplayRun, worktreeCreateRun } from './mobile-workspace-create-operations' -import { waitForRpcClientReconnected } from '../transport/rpc-client-reconnect-wait' -import { isLogicalClientCutoverError } from '../transport/stable-logical-rpc-client' import { CLIENT_WORKTREE_CREATE_MAX_ATTEMPTS, getClientWorktreeCreateCandidate, @@ -17,18 +14,22 @@ import { } from '../../../src/shared/new-workspace/worktree-create-retry-policy' import { agentLaunchCreateParams, + isAgentLaunchReplayUnsupportedRefusal, isAgentLaunchUnsupportedRefusal, readAgentLaunchCreateOutcome, type WorktreeCreateAgentLaunch -} from './agent-launch-worktree-create' +} from './agent-launch-request' import { structuredSessionOperationId } from '../session/structured-session-operation-id' import { WORKTREE_CREATE_TIMEOUT_MS } from './workspace-create-timeout' import type { WorkspaceCreateParams } from './workspace-create-params' -import { - getWorktreeCreateReplayWindowMs, - type WorktreeCreateIdempotencyProbe, - type WorktreeCreateIdempotencySupport +import type { + WorktreeCreateIdempotencyProbe, + WorktreeCreateIdempotencySupport } from './worktree-create-idempotency-policy' +import { + sendReplayingAmbiguousDelivery, + type AmbiguousDeliveryReplay +} from './replay-on-ambiguous-delivery' // Why: server-side collision checks (branch already exists locally / on a remote // / already has PR #N) can fire even after a pre-flight basename dedupe — @@ -39,26 +40,6 @@ export type WorktreeCreateResult = | { worktreeId: string; name: string; warning?: string } | { error: string } -// Why: a create in flight when the mobile transport migrates (relay/direct -// hand-off on shoddy cellular, relay lease rotation) rejects with a cutover error -// even though the host may have completed it. The shared clientMutationId makes a -// retry idempotent, so re-issue on the fresh session a bounded number of times -// instead of surfacing "RPC interrupted by connection migration" with the -// worktree silently created. -const WORKTREE_CREATE_CUTOVER_MAX_RETRIES = 5 - -// Why: a connection migration is not the only way a create goes delivery-ambiguous. -// A plain socket close (cellular flap, relay drop, the phone backgrounding and the -// supervisor suspending a billed relay splice) rejects the in-flight frame as -// delivery-unknown with no generation bump, and create holds the longest budget of -// any mobile RPC — 10 minutes of clone/fetch/setup — so it is the likeliest request -// to be caught by one. Surfacing that as a failure is wrong: the host may well have -// finished the worktree. Replay on the same clientMutationId instead. -const WORKTREE_CREATE_AMBIGUOUS_MAX_RETRIES = 2 - -// Bounded so the Create spinner doesn't sit for the whole window; the deadline still caps it. -export const WORKTREE_CREATE_AMBIGUOUS_RECONNECT_WAIT_MS = 20_000 - export type CreateWorktreeWithNameRetryArgs = { client: RpcClient baseName: string @@ -120,9 +101,7 @@ export async function createWorktreeWithNameRetry( !sent.replayed && launch && (launchOperationId - ? response.error.code === 'method_not_found' || - response.error.code === 'forbidden' || - response.error.code === 'agent_launch_replay_unsupported' + ? isAgentLaunchReplayUnsupportedRefusal(response.error) : isAgentLaunchUnsupportedRefusal(response.error)) ) { // The probe said the host knows `agent.launch` but it refused the call — most likely this @@ -196,10 +175,9 @@ function readCreateResult( } } -// Sends the create, re-issuing whenever the request went delivery-ambiguous — -// the frame reached the wire but no response came back, so the host may already have -// built the worktree. Every arm below re-sends the SAME two names: a new one would be a new -// operation and would defeat both mechanisms. +// Sends the create, re-issuing whenever the request went delivery-ambiguous — the frame reached the +// wire but no response came back, so the host may already have built the worktree. Every resend +// carries the SAME two names: a new one would be a new operation and would defeat both mechanisms. // // On the `worktree.create` route the shared clientMutationId keeps the retry idempotent host-side. // On the launch route it does NOT reach the ledger: `agent.launch` caches the whole launch — the @@ -207,7 +185,7 @@ function readCreateResult( // and outside it adds both. `launchOperationId` is what makes the replay durably safe, and it is // only sent when the host advertised the ledger. // A definite failure (never sent, or a server error response) is returned to the caller untouched. -async function sendWorktreeCreateResilient( +function sendWorktreeCreateResilient( client: RpcClient, launchAgent: TuiAgent | null, launchOperationId: string | null, @@ -215,16 +193,17 @@ async function sendWorktreeCreateResilient( worktreeCreateIdempotency: WorktreeCreateIdempotencySupport | false ): Promise<{ response: RpcResponse; replayed: boolean }> { // Only the selected method's receipt can authorize replay after an ambiguous delivery. - const replaySupport = launchAgent ? launchOperationId : worktreeCreateIdempotency - let migrationRetry = 0 - let ambiguousRetry = 0 - const firstSentAt = Date.now() - let replayDeadlineAt: number | null = null - for (;;) { - try { - // `request` is the transport promise itself, so a delivery-unknown rejection reaches the - // catch below as the object the transport marked — the WeakSet cannot see through a wrapper. - const response = await (launchAgent + const replay: AmbiguousDeliveryReplay | null = launchAgent + ? launchOperationId + ? { kind: 'durable' } + : null + : worktreeCreateIdempotency + ? { kind: 'window', support: worktreeCreateIdempotency } + : null + return sendReplayingAmbiguousDelivery( + client, + () => + launchAgent ? launchOperationId ? agentLaunchReplayRun.request( client, @@ -241,65 +220,9 @@ async function sendWorktreeCreateResilient( ) : worktreeCreateRun.request(client, params, { timeoutMs: WORKTREE_CREATE_TIMEOUT_MS - })) - // A refusal on the replacement connection says nothing about what the first call created. - return { response, replayed: migrationRetry > 0 || ambiguousRetry > 0 } - } catch (error) { - if (!replaySupport) { - throw error - } - if (isLogicalClientCutoverError(error)) { - if (migrationRetry >= WORKTREE_CREATE_CUTOVER_MAX_RETRIES) { - throw error - } - migrationRetry += 1 - // Why: LogicalClientCutoverError is raised only after migrateTo installs an - // authenticated replacement, so retry immediately instead of adding UI lag. - continue - } - if (!isRpcDeliveryUnknown(error) || ambiguousRetry >= WORKTREE_CREATE_AMBIGUOUS_MAX_RETRIES) { - throw error - } - // A legacy cache may expire before a request timeout; durable receipts refuse unsafe replay. - if (typeof replaySupport !== 'string' && client.getState() === 'connected') { - throw error - } - // Keep the legacy deadline fixed; the host itself refuses expired durable operation IDs. - replayDeadlineAt ??= - typeof replaySupport === 'string' - ? Infinity - : resolveReplayDeadline(client, firstSentAt, replaySupport) - const remainingWindowMs = replayDeadlineAt - Date.now() - if (remainingWindowMs <= 0) { - throw error - } - ambiguousRetry += 1 - // Disconnected transports must reconnect before resend; bound the wait even for durable IDs. - if ( - !(await waitForRpcClientReconnected( - client, - Math.min(WORKTREE_CREATE_AMBIGUOUS_RECONNECT_WAIT_MS, remainingWindowMs) - )) - ) { - throw error - } - } - } -} - -// Latest instant the host's dedupe record is still guaranteed to exist, from the earliest -// point the create could have resolved. lastInboundAt stamps a frame that really arrived, -// so it stays honest across a suspension in a way a timer budget cannot; the send is the -// fallback, and a sound floor either way, because the host cannot resolve a create it has -// not yet received. -function resolveReplayDeadline( - client: RpcClient, - firstSentAt: number, - support: WorktreeCreateIdempotencySupport -): number { - const lastInboundAt = client.getLastInboundAt?.() ?? null - const anchor = lastInboundAt !== null && lastInboundAt > firstSentAt ? lastInboundAt : firstSentAt - return anchor + getWorktreeCreateReplayWindowMs(support) + }), + replay + ) } function defaultWorktreeCreateMutationId(): string { diff --git a/mobile/src/test-support/bridged-parity/divergence-classes.test.ts b/mobile/src/test-support/bridged-parity/divergence-classes.test.ts index 58d3e12efc58..ac5fd17cb707 100644 --- a/mobile/src/test-support/bridged-parity/divergence-classes.test.ts +++ b/mobile/src/test-support/bridged-parity/divergence-classes.test.ts @@ -236,7 +236,7 @@ describe('what the pin still admits', () => { it('goes red on a golden that stopped diverging, which every other check lets through', () => { // The direction the rest of the suite cannot see. One `result-absent-settlement` golden // reported `identical` instead: nothing is unclassified, every diverging golden is still in an - // excluded class, and the corpus is still 787. Only these two numbers moved. + // excluded class, and the corpus is still 790. Only these two numbers moved. const tally = asCounted() const moved: BridgedParityTally = { identical: tally.identical + 1, @@ -250,7 +250,7 @@ describe('what the pin still admits', () => { expect(drift.join('\n')).toContain( `identical: pinned ${tally.identical}, ran ${moved.identical}` ) - expect(drift.join('\n')).toContain('result-absent-settlement: pinned 341, ran 340') + expect(drift.join('\n')).toContain('result-absent-settlement: pinned 343, ran 342') }) it('goes red on a class that grew and on the corpus losing a golden', () => { diff --git a/mobile/src/test-support/bridged-parity/divergence-classes.ts b/mobile/src/test-support/bridged-parity/divergence-classes.ts index 5d16e7a09e93..bd450d52b163 100644 --- a/mobile/src/test-support/bridged-parity/divergence-classes.ts +++ b/mobile/src/test-support/bridged-parity/divergence-classes.ts @@ -165,7 +165,7 @@ export const BRIDGED_PARITY_EXCLUSIONS: Readonly> = { - identical: 396, + identical: 397, // Closed by the `_meta` widening: the page's reader is `isRpcResponse` itself. 'reply-meta-required': 0, // Settling a refused reply moved three goldens here out of `write-ordinal`: a rejection that // now arrives differs before the ordinal that also moved does. Nothing stopped replaying // identically, and the corpus is a fixed size, so a shuffle between two excluded classes cannot // hide one. - 'result-absent-settlement': 341, + 'result-absent-settlement': 343, // Four left here and two left `write-ordinal` for the class below, which is the `cancel` a // refused stream frame now posts: the run stops at a renamed occurrence before it reaches the // checkpoint or the ordinal that used to be what differed first. diff --git a/mobile/src/test-support/rpc-recording/adapters/diff-review-action-mount-adapters.ts b/mobile/src/test-support/rpc-recording/adapters/diff-review-action-mount-adapters.ts index 8dd7d816fc3a..681caa946f91 100644 --- a/mobile/src/test-support/rpc-recording/adapters/diff-review-action-mount-adapters.ts +++ b/mobile/src/test-support/rpc-recording/adapters/diff-review-action-mount-adapters.ts @@ -90,6 +90,11 @@ export function diffReviewActionMountAdapters( mountFixture[0]>({ client, connState: 'connected', + hostCapabilities: [ + 'agent.launch.v2', + 'agent.launch.replay.v1', + 'agent.launch.replay-required.v1' + ], hostId: HOST, worktreeId: WORKSPACE, screenState, diff --git a/mobile/src/test-support/rpc-recording/adapters/github-pr-mount-adapters.ts b/mobile/src/test-support/rpc-recording/adapters/github-pr-mount-adapters.ts index f61d9b6eb6c4..94e604d90e1a 100644 --- a/mobile/src/test-support/rpc-recording/adapters/github-pr-mount-adapters.ts +++ b/mobile/src/test-support/rpc-recording/adapters/github-pr-mount-adapters.ts @@ -171,12 +171,23 @@ export function githubPrMountAdapters( 'session.pr-triage-launch': ({ client }) => { const launch = modules.load( 'mobile/src/session/pr-ai-triage-launch.ts' - ).createTerminalAndSendPrompt + ).launchAgentWithPrompt let launched: unknown = 'unlaunched' return { action: (_name, args) => - launch(client, WORKTREE, String(args.prompt ?? 'Fix the failing checks')).then(() => { - launched = 'sent' + launch({ + client, + // A host older than the launch capabilities advertises neither. + hostCapabilities: + args.legacyHost === true + ? [] + : ['agent.launch.v2', 'agent.launch.replay.v1', 'agent.launch.replay-required.v1'], + worktreeId: WORKTREE, + actionId: 'fixChecks', + prompt: String(args.prompt ?? 'Fix the failing checks'), + launchSource: 'task_page' + }).then((result) => { + launched = result }), state: () => ({ launched }), dispose: () => {} diff --git a/mobile/src/test-support/rpc-recording/rpc-recording-through-bridge.test.ts b/mobile/src/test-support/rpc-recording/rpc-recording-through-bridge.test.ts index 0ae92040e68f..502925a900b8 100644 --- a/mobile/src/test-support/rpc-recording/rpc-recording-through-bridge.test.ts +++ b/mobile/src/test-support/rpc-recording/rpc-recording-through-bridge.test.ts @@ -74,12 +74,12 @@ import { vitestRecordingScheduler } from './vitest-recording-scheduler' * `BRIDGED_PARITY_MEMBERS` pins which goldens are in it — a count alone cannot see one golden * leaving a class as another arrives. * - * 396 of the 787 replay byte for byte. The other 391 fall in five classes, 341 / 3 / 6 / 33 / 8, + * 397 of the 790 replay byte for byte. The other 393 fall in five classes, 343 / 3 / 6 / 33 / 8, * and none of them is a reason to re-record anything. `c1-page-closure.ts` then pins, golden by - * golden, the 103 recorded at a call site the C1 page owns, because a count over 787 cannot tell a + * golden, the 103 recorded at a call site the C1 page owns, because a count over 790 cannot tell a * domain's regression from another domain's improvement. * - * 1. **result-absent-settlement, 341** and **2. result-absent-observation, 3.** + * 1. **result-absent-settlement, 343** and **2. result-absent-observation, 3.** * `{ ok: true }` with no `result` key is refused by the page's reader and by `isRpcResponse` * alike, so this one is not a bridge defect: the recorder injects that partition at the scripted * sender port, below the frame validation both sides do, which is what the README means by not diff --git a/mobile/src/transport/host-status-capability-ignorability.test.ts b/mobile/src/transport/host-status-capability-ignorability.test.ts index 03477a3a918d..35762e8699cc 100644 --- a/mobile/src/transport/host-status-capability-ignorability.test.ts +++ b/mobile/src/transport/host-status-capability-ignorability.test.ts @@ -11,8 +11,8 @@ import { supportsMobileQuickCommands } from '../terminal/quick-commands' import { useHostStatusGates, type HostStatusGates } from './host-status-gates' import { hostAnsweredStatusProbe, - readHostStatusGates, - readProbedHostCapabilities + readProbedHostCapabilities, + readProbedHostStatus } from './host-status-probe-operations' import type { HostStatusReply } from './host-status-reply-schema' import type { RpcClient } from './rpc-client' @@ -107,7 +107,7 @@ async function readEverything(capabilities: readonly string[]): Promise { renderer?.unmount() } }) + + it('re-reads a status that failed while the connection stayed up', async () => { + vi.useFakeTimers() + const sendRequest = vi + .fn() + .mockRejectedValueOnce(new Error('request timed out')) + .mockResolvedValueOnce({ + ok: true, + result: { + capabilities: ['browser.screencast.v1'], + floatingWorkspaceEnabled: true, + machineName: 'studio' + } + }) + const client = { sendRequest } as unknown as RpcClient + let gates: HostStatusGates | null = null + let renderer: ReactTestRenderer | null = null + + function Probe(): null { + gates = useHostStatusGates({ hostId: 'host-1', client, connState: 'connected' }) + return null + } + + try { + await act(async () => { + renderer = create(createElement(Probe)) + await Promise.resolve() + }) + // Settled closed rather than pending, so a failed read never traps the host screen. + expect(gates).toMatchObject({ + hostCapabilities: [], + statusPending: false, + statusReadable: false + }) + expect(recordDescriptorFromStatusMock).not.toHaveBeenCalled() + + await act(async () => { + await vi.advanceTimersByTimeAsync(1_000) + }) + expect(sendRequest).toHaveBeenCalledTimes(2) + expect(gates).toMatchObject({ + hostCapabilities: ['browser.screencast.v1'], + statusPending: false, + statusReadable: true + }) + expect(recordDescriptorFromStatusMock).toHaveBeenCalledWith( + 'host-1', + expect.objectContaining({ machineName: 'studio' }) + ) + } finally { + renderer?.unmount() + vi.useRealTimers() + } + }) + + it('settles closed on a refusal and re-reads until the host answers', async () => { + vi.useFakeTimers() + const sendRequest = vi + .fn() + .mockResolvedValueOnce({ ok: false, error: { code: 'unavailable', message: 'busy' } }) + .mockResolvedValueOnce({ ok: true, result: { capabilities: ['browser.screencast.v1'] } }) + const client = { sendRequest } as unknown as RpcClient + let gates: HostStatusGates | null = null + let renderer: ReactTestRenderer | null = null + + function Probe(): null { + gates = useHostStatusGates({ hostId: 'host-1', client, connState: 'connected' }) + return null + } + + try { + await act(async () => { + renderer = create(createElement(Probe)) + await Promise.resolve() + }) + expect(gates).toMatchObject({ statusPending: false, statusReadable: false }) + + await act(async () => { + await vi.advanceTimersByTimeAsync(1_000) + }) + expect(sendRequest).toHaveBeenCalledTimes(2) + expect(gates).toMatchObject({ + hostCapabilities: ['browser.screencast.v1'], + statusReadable: true + }) + } finally { + renderer?.unmount() + vi.useRealTimers() + } + }) + + it('settles closed and stops on a status this app cannot decode', async () => { + vi.useFakeTimers() + const sendRequest = vi.fn().mockResolvedValue({ ok: true, result: 'not a status' }) + const client = { sendRequest } as unknown as RpcClient + let gates: HostStatusGates | null = null + let renderer: ReactTestRenderer | null = null + + function Probe(): null { + gates = useHostStatusGates({ hostId: 'host-1', client, connState: 'connected' }) + return null + } + + try { + await act(async () => { + renderer = create(createElement(Probe)) + await Promise.resolve() + }) + expect(gates).toMatchObject({ statusPending: false, statusReadable: false }) + await act(async () => { + await vi.advanceTimersByTimeAsync(60_000) + }) + expect(sendRequest).toHaveBeenCalledOnce() + } finally { + renderer?.unmount() + vi.useRealTimers() + } + }) + + it('stops re-reading once the host screen unmounts', async () => { + vi.useFakeTimers() + const sendRequest = vi.fn().mockRejectedValue(new Error('request timed out')) + const client = { sendRequest } as unknown as RpcClient + let renderer: ReactTestRenderer | null = null + + function Probe(): null { + useHostStatusGates({ hostId: 'host-1', client, connState: 'connected' }) + return null + } + + try { + await act(async () => { + renderer = create(createElement(Probe)) + await Promise.resolve() + }) + await act(async () => { + renderer?.unmount() + renderer = null + }) + await act(async () => { + await vi.advanceTimersByTimeAsync(60_000) + }) + expect(sendRequest).toHaveBeenCalledOnce() + } finally { + renderer?.unmount() + vi.useRealTimers() + } + }) }) diff --git a/mobile/src/transport/host-status-gates.ts b/mobile/src/transport/host-status-gates.ts index 21407d809123..7051f7c7018f 100644 --- a/mobile/src/transport/host-status-gates.ts +++ b/mobile/src/transport/host-status-gates.ts @@ -1,12 +1,12 @@ import { useEffect, useState } from 'react' import type { RpcClient } from './rpc-client' import type { ConnectionState } from './types' -import { hostStatusProbe, readHostStatusGates } from './host-status-probe-operations' import { evaluateCompat, type CompatVerdict } from './protocol-compat' import type { HostStatusReply } from './host-status-reply-schema' import { normalizeHostAppVersion } from './host-app-version' import { recordHostAppVersion } from './host-app-version-store' import { recordHostDescriptorFromStatus } from './host-descriptor-recorder' +import { startRuntimeStatusProbe } from './runtime-status-probe' export type HostStatusGates = { hostCapabilities: string[] @@ -46,6 +46,15 @@ const EMPTY_HOST_PROTOCOL_WINDOW: HostProtocolWindow = { minCompatibleMobileVersion: undefined } +const UNREADABLE_STATUS_GATES: Omit = { + hostCapabilities: EMPTY_HOST_CAPABILITIES, + floatingWorkspaceEnabled: false, + desktopAppVersion: null, + compatVerdict: { kind: 'ok' }, + hostProtocolWindow: EMPTY_HOST_PROTOCOL_WINDOW, + statusReadable: false +} + // Reads status.get on connect for capabilities, protocol-compat verdict, and the // floating-workspace flag. Compat constants are wide-open today so this never blocks yet. export function useHostStatusGates(args: { @@ -64,80 +73,10 @@ export function useHostStatusGates(args: { setUnverified(true) return } - let cancelled = false - const requestClient = client - const settle = (gates: Omit) => { - setLoaded({ hostId, client: requestClient, ...gates }) + return startHostStatusRead(client, hostId, (gates) => { + setLoaded({ hostId, client, ...gates }) setUnverified(false) - } - void (async () => { - try { - const reply = await hostStatusProbe.request(requestClient) - if (cancelled) { - return - } - const status = readHostStatusGates(reply) - if (!status) { - settle({ - hostCapabilities: [], - floatingWorkspaceEnabled: false, - desktopAppVersion: null, - compatVerdict: { kind: 'ok' }, - hostProtocolWindow: EMPTY_HOST_PROTOCOL_WINDOW, - statusReadable: false - }) - return - } - const verdict = evaluateCompat({ - desktopProtocolVersion: status.protocolVersion, - desktopMinCompatibleMobileVersion: status.minCompatibleMobileVersion - }) - const desktopAppVersion = normalizeHostAppVersion(status.appVersion) - if (hostId && desktopAppVersion) { - void recordHostAppVersion(hostId, desktopAppVersion) - } - if (hostId) { - // Why also here: the web page never runs the connection layer's probe, and the host - // screen should not wait for it; the recorder is idempotent across the two feeds. - recordHostDescriptorFromStatus(hostId, status) - } - settle({ - hostCapabilities: status.capabilities ?? [], - floatingWorkspaceEnabled: status.floatingWorkspaceEnabled === true, - desktopAppVersion, - compatVerdict: verdict, - hostProtocolWindow: { - protocolVersion: status.protocolVersion, - minCompatibleMobileVersion: status.minCompatibleMobileVersion - }, - statusReadable: true - }) - if (verdict.kind === 'blocked') { - // Why: support breadcrumb to confirm a block fired vs a render bug; no PII, just version ints. - console.warn('[protocol-compat] blocked', { - reason: verdict.reason, - desktopVersion: verdict.desktopVersion, - requiredMobileVersion: verdict.requiredMobileVersion, - requiredDesktopVersion: verdict.requiredDesktopVersion - }) - } - } catch { - // Why: a transient status failure must not trap navigation; conservative feature gates remain disabled. - if (!cancelled) { - settle({ - hostCapabilities: [], - floatingWorkspaceEnabled: false, - desktopAppVersion: null, - compatVerdict: { kind: 'ok' }, - hostProtocolWindow: EMPTY_HOST_PROTOCOL_WINDOW, - statusReadable: false - }) - } - } - })() - return () => { - cancelled = true - } + }) }, [client, connState, hostId]) // Why: effects run after render, so key loaded gates by host and client to fail closed during route reuse. @@ -165,3 +104,67 @@ export function useHostStatusGates(args: { statusPending: connState === 'connected' && unverified } } + +/** + * Reads status.get until it lands, settling closed on the first failure. Returns the stop function + * the effect hands back, so the probe's retry timer is owned outside React. + */ +function startHostStatusRead( + client: RpcClient, + hostId: string | undefined, + settle: (gates: Omit) => void +): () => void { + let settledClosed = false + // Why: a transient status failure must not trap navigation; conservative feature gates remain + // disabled. Later failures keep the first one's answer rather than re-render the same closed gates. + const settleClosed = () => { + if (!settledClosed) { + settledClosed = true + settle(UNREADABLE_STATUS_GATES) + } + } + return startRuntimeStatusProbe( + client, + (status) => { + // A status this app cannot decode reads the same on every retry, so the probe stops on it. + if (!status) { + settleClosed() + return + } + const verdict = evaluateCompat({ + desktopProtocolVersion: status.protocolVersion, + desktopMinCompatibleMobileVersion: status.minCompatibleMobileVersion + }) + const desktopAppVersion = normalizeHostAppVersion(status.appVersion) + if (hostId && desktopAppVersion) { + void recordHostAppVersion(hostId, desktopAppVersion) + } + if (hostId) { + // Why also here: the web page never runs the connection layer's probe, and the host + // screen should not wait for it; the recorder is idempotent across the two feeds. + recordHostDescriptorFromStatus(hostId, status) + } + settle({ + hostCapabilities: status.capabilities ?? [], + floatingWorkspaceEnabled: status.floatingWorkspaceEnabled === true, + desktopAppVersion, + compatVerdict: verdict, + hostProtocolWindow: { + protocolVersion: status.protocolVersion, + minCompatibleMobileVersion: status.minCompatibleMobileVersion + }, + statusReadable: true + }) + if (verdict.kind === 'blocked') { + // Why: support breadcrumb to confirm a block fired vs a render bug; no PII, just version ints. + console.warn('[protocol-compat] blocked', { + reason: verdict.reason, + desktopVersion: verdict.desktopVersion, + requiredMobileVersion: verdict.requiredMobileVersion, + requiredDesktopVersion: verdict.requiredDesktopVersion + }) + } + }, + settleClosed + ) +} diff --git a/mobile/src/transport/host-status-probe-operations.ts b/mobile/src/transport/host-status-probe-operations.ts index ec9d1ac0e587..0fd13f2c95aa 100644 --- a/mobile/src/transport/host-status-probe-operations.ts +++ b/mobile/src/transport/host-status-probe-operations.ts @@ -14,12 +14,11 @@ import type { RpcResponse } from './types' * surfaces the host's message, `status.create-capabilities-or-skip` is the create drawer's) because * an operation name is what a decode failure reports, and because transport must not import tasks. * - * One reader, but three different meanings for an unreadable status, which is why the three - * readers below exist rather than each caller calling `interpret` directly. The gate wants the - * failure (its own `catch` degrades to closed gates), and the probe and the race must not have it: - * both call `interpret` inside a `.then` fulfilment handler, where a throw becomes a detached - * rejection instead of reaching their rejection handler — the probe would latch capability-gated UI - * hidden with no retry, and the race would never count the candidate at all. + * The readers below exist rather than each caller calling `interpret` directly because neither the + * probe (which the gate also runs on) nor the race may have an unreadable status thrown at it: both + * call `interpret` inside a `.then` fulfilment handler, where a throw becomes a detached rejection + * instead of reaching their rejection handler — the probe would latch capability-gated UI hidden + * with no retry, and the race would never count the candidate at all. */ export const hostStatusProbe = bindDeferredRpcOperation( defineRpcOperation({ @@ -31,16 +30,6 @@ export const hostStatusProbe = bindDeferredRpcOperation( }) ) -/** - * The gate's read. An unreadable status raises `RpcIncompatibleReplyError` naming `status.get`, - * which host-status-gates.ts already catches into the same closed gates a property read on a null - * status used to throw its way to. - */ -export function readHostStatusGates(reply: RpcResponse): HostStatusReply | null { - const accepted = hostStatusProbe.interpret(reply) - return accepted.accepted ? accepted.value : null -} - /** * The status the retrying probe delivers, or `null` for a refusal it should back off from. * diff --git a/mobile/src/transport/host-status-reply-schema.ts b/mobile/src/transport/host-status-reply-schema.ts index 041cbf6a6b9e..7f8d834e6451 100644 --- a/mobile/src/transport/host-status-reply-schema.ts +++ b/mobile/src/transport/host-status-reply-schema.ts @@ -20,7 +20,7 @@ import { NODE_PLATFORM_NAMES } from './mobile-runtime-host-platform' * `transport-capability-probe-non-string-capabilities-drop` golden records as `published: [[]]`. * * The object itself is required, and the three callers each keep the guard that decides what an - * unreadable status means to them: see `readHostStatusGates`, `readProbedHostCapabilities` and + * unreadable status means to them: see `readProbedHostStatus`, `readProbedHostCapabilities` and * `hostAnsweredStatusProbe` in host-status-probe-operations.ts. */ export const hostStatusSchema = z.looseObject({ diff --git a/mobile/src/transport/runtime-status-probe.test.ts b/mobile/src/transport/runtime-status-probe.test.ts index 93b36d6dc2f0..697a0e7d85f1 100644 --- a/mobile/src/transport/runtime-status-probe.test.ts +++ b/mobile/src/transport/runtime-status-probe.test.ts @@ -92,4 +92,31 @@ describe('startRuntimeStatusProbe', () => { expect(calls()).toBe(3) cancel() }) + + it('reports each failed attempt once its retry is scheduled, and never an answer', async () => { + const { client } = makeClient([ + new Error('request timed out'), + new LogicalClientCutoverError(), + ok(null) + ]) + const seen: (HostStatusReply | null)[] = [] + let failed = 0 + const cancel = startRuntimeStatusProbe( + client, + (status) => seen.push(status), + () => { + failed += 1 + } + ) + await flushMicrotasks() + expect(failed).toBe(1) + await vi.advanceTimersByTimeAsync(1_000) + await flushMicrotasks() + expect(failed).toBe(2) + await vi.advanceTimersByTimeAsync(250) + await flushMicrotasks() + expect(seen).toEqual([null]) + expect(failed).toBe(2) + cancel() + }) }) diff --git a/mobile/src/transport/runtime-status-probe.ts b/mobile/src/transport/runtime-status-probe.ts index 1d748e1e6852..08e0943e1b0b 100644 --- a/mobile/src/transport/runtime-status-probe.ts +++ b/mobile/src/transport/runtime-status-probe.ts @@ -15,12 +15,16 @@ const FAILURE_RETRY_MAX_DELAY_MS = 15_000 * answered something this build cannot decode — an answer, not a failure, so it is delivered * rather than retried. A refusal or transport rejection schedules a retry instead. * + * `onAttemptFailed` runs on each refusal or rejection, once its retry is scheduled, for a caller + * that must show something while the probe keeps asking. + * * The parameter names the raw port rather than RpcClient because one of the capability callers * holds only the sender; the request itself goes through hostStatusProbe. */ export function startRuntimeStatusProbe( client: UnvalidatedRpcRequestPort, - onStatus: (status: HostStatusReply | null) => void + onStatus: (status: HostStatusReply | null) => void, + onAttemptFailed?: () => void ): () => void { let cancelled = false let retryTimer: ReturnType | null = null @@ -55,6 +59,7 @@ export function startRuntimeStatusProbe( ? CUTOVER_RETRY_DELAY_MS : Math.min(FAILURE_RETRY_BASE_DELAY_MS * 2 ** failureRetries++, FAILURE_RETRY_MAX_DELAY_MS) retryTimer = setTimeout(attempt, delay) + onAttemptFailed?.() } attempt() diff --git a/src/main/runtime/runtime-client-settings-source-control-projection.test.ts b/src/main/runtime/runtime-client-settings-source-control-projection.test.ts new file mode 100644 index 000000000000..c1868df74bd5 --- /dev/null +++ b/src/main/runtime/runtime-client-settings-source-control-projection.test.ts @@ -0,0 +1,53 @@ +import { describe, expect, it } from 'vitest' +import { RuntimeClientSettingsController } from './runtime-client-settings' +import { createGlobalSettingsFixture } from '../../shared/global-settings-test-fixture' +import type { GlobalSettings } from '../../shared/global-settings-types' +import { getDefaultSourceControlAiSettings } from '../../shared/source-control-ai' + +// Why: `settings.get` is an explicit allowlist. A paired client's AI buttons resolve their agent +// from the saved per-action recipe, and a recipe missing here reads as "none saved" on the client. +function projectionOf(settings: Partial) { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: get() reads nothing but store.getSettings(); every other RuntimeStore member is unreachable from that path. + return new RuntimeClientSettingsController({ getSettings: () => settings } as never).get() +} + +function hostSettings(sourceControlAi: GlobalSettings['sourceControlAi']): Partial { + return { ...createGlobalSettingsFixture({ workspaceDir: '/w' }), sourceControlAi } +} + +describe('RuntimeClientSettingsController source control launch recipes', () => { + it('publishes the recipe saved for a launch action', () => { + const projected = projectionOf( + hostSettings({ + ...getDefaultSourceControlAiSettings(), + actions: { fixChecks: { agentId: 'codex', agentArgs: '--fast' } } + }) + ) + expect(projected.sourceControlAi.actions.fixChecks).toMatchObject({ + agentId: 'codex', + agentArgs: '--fast' + }) + }) + + it('publishes a recipe saved under the legacy launch defaults key', () => { + const projected = projectionOf( + hostSettings({ + ...getDefaultSourceControlAiSettings(), + actions: undefined, + launchActionDefaults: { resolveConflicts: { agentId: 'claude' } } + }) + ) + expect(projected.sourceControlAi.actions.resolveConflicts).toMatchObject({ agentId: 'claude' }) + }) + + it('publishes launch actions only, not the text generation recipes', () => { + const projected = projectionOf(hostSettings(getDefaultSourceControlAiSettings())) + expect(Object.keys(projected.sourceControlAi.actions).sort()).toEqual([ + 'fixChecks', + 'fixCommitFailure', + 'fixPushFailure', + 'resolveComments', + 'resolveConflicts' + ]) + }) +}) diff --git a/src/main/runtime/runtime-client-settings.ts b/src/main/runtime/runtime-client-settings.ts index 76c7e772e5ce..c932e59a9043 100644 --- a/src/main/runtime/runtime-client-settings.ts +++ b/src/main/runtime/runtime-client-settings.ts @@ -9,6 +9,11 @@ import { type TerminalQuickCommandMutation } from '../../shared/terminal-quick-commands' import { haveSameDisabledTuiAgents } from '../../shared/tui-agent-selection' +import { normalizeSourceControlAiSettings } from '../../shared/source-control-ai' +import { + SOURCE_CONTROL_LAUNCH_ACTION_IDS, + type SourceControlAiActionDefaults +} from '../../shared/source-control-ai-actions' import type { GlobalSettings } from '../../shared/global-settings-types' import { applyNativeChatSessionOptionSettingsMutation } from '../../shared/native-chat-session-option-defaults' import type { NativeChatSessionOptionSettingsMutation } from '../../shared/native-chat-session-options' @@ -49,8 +54,12 @@ export type RuntimeClientSettings = Pick< | 'machineName' > & { hostSettingOverrides: RuntimeHostDisplayLabelOverrides + sourceControlAi: RuntimeClientSourceControlAi } +/** The saved per-action launch recipes (agent, prompt template, agent args), already migrated. */ +export type RuntimeClientSourceControlAi = { actions: SourceControlAiActionDefaults } + /** Safe paired projection: host labels only; filesystem defaults stay host-private. */ export type RuntimeHostDisplayLabelOverrides = Partial< Record @@ -127,6 +136,9 @@ export class RuntimeClientSettingsController { worktreeVisibilityDefaults: settings.worktreeVisibilityDefaults ?? { external: 'hide' }, agentSkillSharingEnabled: isAgentSkillSharingEnabled(settings), machineName: settings.machineName ?? '', + // Why projected: a paired client's AI buttons start these actions' agents, and must honour + // the agent saved for each one as the desktop does. Absent on older hosts. + sourceControlAi: projectSourceControlLaunchRecipes(settings), hostSettingOverrides: Object.fromEntries( [ ...getHostDisplayLabelOverrides({ hostSettingOverrides: settings.hostSettingOverrides }) @@ -233,3 +245,20 @@ export class RuntimeClientSettingsController { return reconciliation } } + +function projectSourceControlLaunchRecipes( + settings: Partial> +): RuntimeClientSourceControlAi { + const { actions } = normalizeSourceControlAiSettings( + settings.sourceControlAi, + settings.commitMessageAi + ) + return { + actions: Object.fromEntries( + SOURCE_CONTROL_LAUNCH_ACTION_IDS.flatMap((actionId) => { + const recipe = actions?.[actionId] + return recipe ? [[actionId, recipe]] : [] + }) + ) + } +} diff --git a/src/main/runtime/runtime-store-contract.ts b/src/main/runtime/runtime-store-contract.ts index 86af6d3e15f8..43fe59b34e1a 100644 --- a/src/main/runtime/runtime-store-contract.ts +++ b/src/main/runtime/runtime-store-contract.ts @@ -125,6 +125,8 @@ export type RuntimeStore = { nativeChatInheritShellEnvironment?: GlobalSettings['nativeChatInheritShellEnvironment'] nativeChatShellEnvironmentVariables?: GlobalSettings['nativeChatShellEnvironmentVariables'] aiVaultSearch?: GlobalSettings['aiVaultSearch'] + sourceControlAi?: GlobalSettings['sourceControlAi'] + commitMessageAi?: GlobalSettings['commitMessageAi'] } // Why: narrow to `unknown` return so test mocks can return void without // a cast. The runtime never reads the return value — the persisted value diff --git a/src/renderer/src/components/editor/check-run-details-fix-with-ai.ts b/src/renderer/src/components/editor/check-run-details-fix-with-ai.ts index 48cae27613a7..394bcac8123e 100644 --- a/src/renderer/src/components/editor/check-run-details-fix-with-ai.ts +++ b/src/renderer/src/components/editor/check-run-details-fix-with-ai.ts @@ -11,7 +11,7 @@ import { import { openSourceControlAiSettingsTarget } from '@/components/right-sidebar/source-control-ai-settings-navigation' import { getConnectionId } from '@/lib/connection-context' import { startFixChecksAgent } from '@/lib/fix-checks-agent-launch' -import { readSourceControlLaunchRecipeAgentId } from '@/lib/source-control-launch-agent-selection' +import { readSourceControlLaunchRecipeAgentId } from '../../../../shared/source-control-launch-agent-selection' import { resolveSourceControlLaunchPlatform } from '@/lib/source-control-launch-platform' import { useAppStore } from '@/store' import { findWorktreeById } from '@/store/slices/worktree-helpers' diff --git a/src/renderer/src/components/pull-request-page/checks/fix-dialog.tsx b/src/renderer/src/components/pull-request-page/checks/fix-dialog.tsx index b779c22574a7..f43c6f6be53a 100644 --- a/src/renderer/src/components/pull-request-page/checks/fix-dialog.tsx +++ b/src/renderer/src/components/pull-request-page/checks/fix-dialog.tsx @@ -2,7 +2,7 @@ import React from 'react' import { toast } from 'sonner' import type { useAppStore } from '@/store' import { SourceControlAgentActionDialog } from '@/components/right-sidebar/SourceControlAgentActionDialog' -import { readSourceControlLaunchRecipeAgentId } from '@/lib/source-control-launch-agent-selection' +import { readSourceControlLaunchRecipeAgentId } from '../../../../../shared/source-control-launch-agent-selection' import type { SourceControlActionRecipe } from '../../../../../shared/source-control-ai-actions' import { translate } from '@/i18n/i18n' import type { GitHubWorkItem } from '../../../../../shared/github/work-item-types' diff --git a/src/renderer/src/components/right-sidebar/checks-panel/active-content.tsx b/src/renderer/src/components/right-sidebar/checks-panel/active-content.tsx index caf3c074ea34..9f1cc498e312 100644 --- a/src/renderer/src/components/right-sidebar/checks-panel/active-content.tsx +++ b/src/renderer/src/components/right-sidebar/checks-panel/active-content.tsx @@ -8,7 +8,7 @@ import { SourceControlAgentActionDialog } from '../SourceControlAgentActionDialo import { ChecksPanelUpdatedAtMetadata } from '../checks-panel-updated-at-metadata' import { getChecksPanelRefreshErrorBannerLine } from '../github-refresh-error-copy' import { resolveChecksPanelHostedReviewModifierDestination } from '../checks-panel-hosted-review-click-routing' -import { readSourceControlLaunchRecipeAgentId } from '@/lib/source-control-launch-agent-selection' +import { readSourceControlLaunchRecipeAgentId } from '../../../../../shared/source-control-launch-agent-selection' import { resolveSourceControlActionRecipe } from '../../../../../shared/source-control-ai' import { clearPendingPRCommentAiAck } from '../pr-comments-ai-launch-ack' import { getBrokenChecks } from '../../pr-checks-fix-prompt' diff --git a/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts b/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts index ec1a71698250..4a055a613eec 100644 --- a/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts +++ b/src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts @@ -7,7 +7,7 @@ import { planAgentCliArgsSuffix } from '@/lib/tui-agent-startup' import { pickSourceControlLaunchAgent, readSourceControlLaunchRecipeAgentId -} from '@/lib/source-control-launch-agent-selection' +} from '../../../../../../shared/source-control-launch-agent-selection' import { isTuiAgentEnabled } from '../../../../../../shared/tui-agent-selection' import type { SourceControlActionRecipe, diff --git a/src/renderer/src/components/right-sidebar/source-control/commit/component-gates.ts b/src/renderer/src/components/right-sidebar/source-control/commit/component-gates.ts index e5b59366ce9e..aca9e0ca192d 100644 --- a/src/renderer/src/components/right-sidebar/source-control/commit/component-gates.ts +++ b/src/renderer/src/components/right-sidebar/source-control/commit/component-gates.ts @@ -1,4 +1,4 @@ -import { pickSourceControlLaunchAgent } from '@/lib/source-control-launch-agent-selection' +import { pickSourceControlLaunchAgent } from '../../../../../../shared/source-control-launch-agent-selection' import type { GitConflictOperation } from '../../../../../../shared/git-status-types' import type { TuiAgent } from '../../../../../../shared/tui-agent' diff --git a/src/renderer/src/components/right-sidebar/source-control/commit/recovery-notice.tsx b/src/renderer/src/components/right-sidebar/source-control/commit/recovery-notice.tsx index 0afb3c49befc..a86ac2697c14 100644 --- a/src/renderer/src/components/right-sidebar/source-control/commit/recovery-notice.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/commit/recovery-notice.tsx @@ -11,7 +11,7 @@ import { DialogTitle } from '@/components/ui/dialog' import { translate } from '@/i18n/i18n' -import { readSourceControlLaunchRecipeAgentId } from '@/lib/source-control-launch-agent-selection' +import { readSourceControlLaunchRecipeAgentId } from '../../../../../../shared/source-control-launch-agent-selection' import type { SourceControlActionRecipe, SourceControlLaunchActionId diff --git a/src/renderer/src/components/right-sidebar/source-control/panel/panel-dialogs.tsx b/src/renderer/src/components/right-sidebar/source-control/panel/panel-dialogs.tsx index b5a414431ed2..2dc2ee71f9aa 100644 --- a/src/renderer/src/components/right-sidebar/source-control/panel/panel-dialogs.tsx +++ b/src/renderer/src/components/right-sidebar/source-control/panel/panel-dialogs.tsx @@ -1,4 +1,4 @@ -import { readSourceControlLaunchRecipeAgentId } from '@/lib/source-control-launch-agent-selection' +import { readSourceControlLaunchRecipeAgentId } from '../../../../../../shared/source-control-launch-agent-selection' import { SourceControlDialogLayer } from './dialog-layer' import type { SourceControlPanelReadyProps } from './panel-props' diff --git a/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts b/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts index cfe413b0392a..60e7a45bb1bb 100644 --- a/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts +++ b/src/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.ts @@ -3,7 +3,7 @@ import { getAgentCatalog } from '@/lib/agent-catalog' import { pickSourceControlLaunchAgent, resolveSourceControlLaunchAgentScope -} from '@/lib/source-control-launch-agent-selection' +} from '../../../../shared/source-control-launch-agent-selection' import { useAppStore } from '@/store' import { useRepoById } from '@/store/selectors' import { renderSourceControlActionCommandTemplate } from '../../../../shared/source-control-ai-actions' diff --git a/src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.test.tsx b/src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.test.tsx index 095cfc4b550f..c0cc25498194 100644 --- a/src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.test.tsx +++ b/src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.test.tsx @@ -5,7 +5,7 @@ import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { TooltipProvider } from '../ui/tooltip' import { SourceControlActionRepoOverrideNote } from './SourceControlActionRepoOverrideNote' -import type { SourceControlActionRecipeOverrideSummary } from '@/lib/source-control-launch-agent-selection' +import type { SourceControlActionRecipeOverrideSummary } from '../../../../shared/source-control-launch-agent-selection' let container: HTMLDivElement let root: Root diff --git a/src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.tsx b/src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.tsx index 28fd8cbcdcf9..6ec74d0ee355 100644 --- a/src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.tsx +++ b/src/renderer/src/components/settings/SourceControlActionRepoOverrideNote.tsx @@ -5,7 +5,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' import type { SourceControlActionRecipeOverrideField, SourceControlActionRecipeOverrideSummary -} from '@/lib/source-control-launch-agent-selection' +} from '../../../../shared/source-control-launch-agent-selection' import { translate } from '@/i18n/i18n' type SourceControlActionRepoOverrideNoteProps = { diff --git a/src/renderer/src/components/settings/SourceControlAiActionRecipeDefaults.tsx b/src/renderer/src/components/settings/SourceControlAiActionRecipeDefaults.tsx index 9d00e6505cd1..57f6787522a5 100644 --- a/src/renderer/src/components/settings/SourceControlAiActionRecipeDefaults.tsx +++ b/src/renderer/src/components/settings/SourceControlAiActionRecipeDefaults.tsx @@ -21,7 +21,7 @@ import { useRepos } from '@/store/selectors' import { summarizeReposOverridingActionRecipe, type SourceControlActionRecipeOverrideSummary -} from '@/lib/source-control-launch-agent-selection' +} from '../../../../shared/source-control-launch-agent-selection' import { SearchableSetting } from './SearchableSetting' import { getRepositorySourceControlAiActionRecipeSectionId } from './repository-settings-targets' import { matchesSettingsSearch } from './settings-search' diff --git a/src/renderer/src/lib/fix-checks-agent-launch.test.ts b/src/renderer/src/lib/fix-checks-agent-launch.test.ts index c044ae4b068b..32c636f13f7c 100644 --- a/src/renderer/src/lib/fix-checks-agent-launch.test.ts +++ b/src/renderer/src/lib/fix-checks-agent-launch.test.ts @@ -97,7 +97,7 @@ vi.mock('@/lib/new-workspace', () => ({ CLIENT_PLATFORM: 'win32' })) -vi.mock('@/lib/source-control-launch-agent-selection', () => ({ +vi.mock('../../../shared/source-control-launch-agent-selection', () => ({ pickSourceControlLaunchAgent: mocks.pickSourceControlLaunchAgent, readSourceControlLaunchRecipeAgentId: mocks.readSourceControlLaunchRecipeAgentId })) diff --git a/src/renderer/src/lib/fix-checks-agent-launch.ts b/src/renderer/src/lib/fix-checks-agent-launch.ts index 20a9db905373..1bfa1b78253f 100644 --- a/src/renderer/src/lib/fix-checks-agent-launch.ts +++ b/src/renderer/src/lib/fix-checks-agent-launch.ts @@ -10,7 +10,7 @@ import { planAgentCliArgsSuffix } from '@/lib/tui-agent-startup' import { pickSourceControlLaunchAgent, readSourceControlLaunchRecipeAgentId -} from '@/lib/source-control-launch-agent-selection' +} from '../../../shared/source-control-launch-agent-selection' import { resolveSourceControlLaunchPlatform } from '@/lib/source-control-launch-platform' import { activateAndRevealWorktree } from '@/lib/worktree-activation' import { useAppStore } from '@/store' diff --git a/src/shared/pane-agent-identity-inventory.test.ts b/src/shared/pane-agent-identity-inventory.test.ts index 8cb5a88f702c..41ca5090dafc 100644 --- a/src/shared/pane-agent-identity-inventory.test.ts +++ b/src/shared/pane-agent-identity-inventory.test.ts @@ -434,11 +434,6 @@ const DIRECT_SINGLE_SOURCE_SURFACES: readonly { path: 'mobile/src/session/mobile-native-chat-image-send.ts', classification: 'action-consumer', marker: 'pasteMobileNativeChatImagePaths' - }, - { - path: 'mobile/src/session/pr-ai-triage-launch.ts', - classification: 'action-consumer', - marker: 'createTerminalAndSendPrompt' } ] diff --git a/src/renderer/src/lib/source-control-launch-agent-selection.test.ts b/src/shared/source-control-launch-agent-selection.test.ts similarity index 94% rename from src/renderer/src/lib/source-control-launch-agent-selection.test.ts rename to src/shared/source-control-launch-agent-selection.test.ts index 3ef15b580d9a..1862122d8715 100644 --- a/src/renderer/src/lib/source-control-launch-agent-selection.test.ts +++ b/src/shared/source-control-launch-agent-selection.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' -import { getDefaultSettings } from '../../../shared/constants' -import type { GlobalSettings } from '../../../shared/global-settings-types' -import type { Repo } from '../../../shared/repo-types' -import type { TuiAgent } from '../../../shared/tui-agent' +import { getDefaultSettings } from './constants' +import type { GlobalSettings } from './global-settings-types' +import type { Repo } from './repo-types' +import type { TuiAgent } from './tui-agent' import { resolveSourceControlLaunchAgentScope, summarizeReposOverridingActionRecipe diff --git a/src/renderer/src/lib/source-control-launch-agent-selection.ts b/src/shared/source-control-launch-agent-selection.ts similarity index 88% rename from src/renderer/src/lib/source-control-launch-agent-selection.ts rename to src/shared/source-control-launch-agent-selection.ts index 379f56405442..4a408b2ffc64 100644 --- a/src/renderer/src/lib/source-control-launch-agent-selection.ts +++ b/src/shared/source-control-launch-agent-selection.ts @@ -1,17 +1,13 @@ -import { getAgentCatalog } from '@/lib/agent-catalog' -import { isCustomAgentId } from '../../../shared/commit-message-agent-spec' +import { isCustomAgentId } from './commit-message-agent-spec' import { normalizeRepoSourceControlAiOverrides, resolveSourceControlActionRecipe -} from '../../../shared/source-control-ai' -import type { - SourceControlActionId, - SourceControlActionRecipe -} from '../../../shared/source-control-ai-actions' -import { filterEnabledTuiAgents } from '../../../shared/tui-agent-selection' -import type { GlobalSettings } from '../../../shared/global-settings-types' -import type { Repo } from '../../../shared/repo-types' -import type { TuiAgent } from '../../../shared/tui-agent' +} from './source-control-ai' +import type { SourceControlActionId, SourceControlActionRecipe } from './source-control-ai-actions' +import { filterEnabledTuiAgents, TUI_AGENT_AUTO_PICK_ORDER } from './tui-agent-selection' +import type { GlobalSettings } from './global-settings-types' +import type { Repo } from './repo-types' +import type { TuiAgent } from './tui-agent' export function readSourceControlLaunchRecipeAgentId( recipe: Pick | null | undefined @@ -37,7 +33,7 @@ export function pickSourceControlLaunchAgent(args: { ) { return args.defaultAgent } - return getAgentCatalog().find((entry) => enabledAgents.includes(entry.id))?.id ?? null + return TUI_AGENT_AUTO_PICK_ORDER.find((agent) => enabledAgents.includes(agent)) ?? null } export type SourceControlLaunchAgentScope = { From 8c61a5df1f921155f0f902f1f527d706c19283d1 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:34:08 -0700 Subject: [PATCH 27/90] fix(windows): require signed release binaries and identify CLI launcher (#23680) --- .github/workflows/pr.yml | 4 +- .github/workflows/release-cut.yml | 186 ++++++++---------- .../workflows/windows-signing-rehearsal.yml | 43 ++-- config/scripts/build-windows-cli-launcher.mjs | 78 ++++++-- .../build-windows-cli-launcher.test.mjs | 112 +++++++++-- .../replace-cached-nsis-elevate.test.mjs | 5 +- .../skills-cli-package-workflow.test.mjs | 1 - ...ws-pty-native-capability-workflow.test.mjs | 1 - .../windows-signing-notification.test.mjs | 37 ++++ ...windows-signing-workflow-contract.test.mjs | 100 +++++++--- .../windows-cli-launcher/OrcaCliLauncher.cs | 9 + native/windows-cli-launcher/app.manifest | 18 ++ 12 files changed, 402 insertions(+), 192 deletions(-) create mode 100644 config/scripts/windows-signing-notification.test.mjs create mode 100644 native/windows-cli-launcher/app.manifest diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 27fc5215044d..4c6f68147c40 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1106,11 +1106,9 @@ jobs: uses: actions/cache@v5 with: path: native/windows-cli-launcher/.build - key: windows-cli-launcher-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('native/windows-cli-launcher/**', 'config/scripts/build-windows-cli-launcher.mjs') }} + key: windows-cli-launcher-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('native/windows-cli-launcher/**', 'config/scripts/build-windows-cli-launcher.mjs', 'resources/build/icon.ico', 'package.json') }} - name: Build package inputs - env: - ORCA_REUSE_WINDOWS_CLI_LAUNCHER: '1' run: pnpm run build:release:parallel - name: Restore compiled Electron native modules diff --git a/.github/workflows/release-cut.yml b/.github/workflows/release-cut.yml index 2490d39af39b..01f90060c5eb 100644 --- a/.github/workflows/release-cut.yml +++ b/.github/workflows/release-cut.yml @@ -1540,6 +1540,7 @@ jobs: } - name: Install SignPath PowerShell module + id: install-signpath if: matrix.platform == 'win' && github.run_attempt == 1 uses: ./.github/actions/install-signpath-module @@ -1550,18 +1551,14 @@ jobs: # existing installer signing request below. The NSIS uninstaller rides # this same request (it is the MDE update cluster: old-uninstaller.exe / # Uninstall Orca.exe), captured through electron-builder's sign hook and - # swapped back in during the rebuild — no third approval wait. Every step is - # fail-open (continue-on-error + outcome gating): any failure ships the - # original installer with unsigned inner binaries, exactly like releases - # did before this chain existed. Rehearsed end to end in run 28988432001 - # (.github/workflows/windows-signing-rehearsal.yml). + # swapped back in during the rebuild — no third approval wait. Production + # releases require the entire signing chain to succeed (#23383). # Why: only unsigned PE files go to SignPath. Files that already carry a # valid signature (Microsoft's OpenConsole.exe) must keep their signer. - name: Stage unsigned inner PE files for signing id: stage-inner if: matrix.platform == 'win' && github.run_attempt == 1 - continue-on-error: true shell: pwsh run: | $root = Resolve-Path 'dist/win-unpacked' @@ -1603,34 +1600,18 @@ jobs: # out of inner-signing-list.txt: that list drives the copy-back into # dist/win-unpacked, and the uninstaller does not live there — it is # re-injected through the sign hook during the rebuild instead. - # Why this name and not "Uninstall Orca.exe": the restore loop below - # matches staged files by suffix (`-like "*$relative"`) and takes the - # first hit, so any staged path ending in "Orca.exe" is separated from - # the real Orca.exe only by Get-ChildItem's enumeration order. That - # order happens to favour the root file today, but it is not a - # documented guarantee; a name that cannot suffix-match is. - # Why the whole block is caught rather than just Test-Path'd: this - # step's outcome gates the upload of every inner binary, so a locked - # file or a full disk here would cost all of them their signatures - - # worse than shipping no uninstaller signature at all. - try { - $exportedUninstaller = Join-Path $env:RUNNER_TEMP 'uninstaller-signing\unsigned\orca-uninstaller.exe' - if (Test-Path -LiteralPath $exportedUninstaller) { - $uninstallerStagePath = Join-Path $stage.FullName 'uninstaller\orca-uninstaller.exe' - New-Item -ItemType Directory -Force -Path (Split-Path $uninstallerStagePath) -ErrorAction Stop | Out-Null - Copy-Item -LiteralPath $exportedUninstaller -Destination $uninstallerStagePath -Force -ErrorAction Stop - Write-Host 'Staged the NSIS uninstaller for signing: uninstaller\orca-uninstaller.exe' - } else { - Write-Host "::warning::No exported NSIS uninstaller at $exportedUninstaller; this release ships an unsigned uninstaller (fail-open)." - } - } catch { - Write-Host "::warning::Could not stage the NSIS uninstaller ($_); this release ships an unsigned uninstaller (fail-open)." + $exportedUninstaller = Join-Path $env:RUNNER_TEMP 'uninstaller-signing\unsigned\orca-uninstaller.exe' + if (-not (Test-Path -LiteralPath $exportedUninstaller)) { + throw "No exported NSIS uninstaller at $exportedUninstaller." } + $uninstallerStagePath = Join-Path $stage.FullName 'uninstaller\orca-uninstaller.exe' + New-Item -ItemType Directory -Force -Path (Split-Path $uninstallerStagePath) -ErrorAction Stop | Out-Null + Copy-Item -LiteralPath $exportedUninstaller -Destination $uninstallerStagePath -Force -ErrorAction Stop + Write-Host 'Staged the NSIS uninstaller for signing: uninstaller\orca-uninstaller.exe' - name: Upload unsigned inner binaries for SignPath id: upload-unsigned-inner if: matrix.platform == 'win' && github.run_attempt == 1 && steps.stage-inner.outcome == 'success' - continue-on-error: true uses: actions/upload-artifact@v7 with: name: orca-windows-inner-unsigned-${{ needs.cut.outputs.tag }} @@ -1640,7 +1621,6 @@ jobs: - name: Submit inner binaries signing request id: submit-inner-signing if: matrix.platform == 'win' && github.run_attempt == 1 && steps.upload-unsigned-inner.outcome == 'success' - continue-on-error: true uses: signpath/github-action-submit-signing-request@v2 with: api-token: ${{ secrets.SIGNPATH_API_TOKEN }} @@ -1653,8 +1633,8 @@ jobs: - name: Notify Slack that inner-binary signing is waiting for approval id: notify-inner-signing - if: matrix.platform == 'win' && github.run_attempt == 1 && steps.submit-inner-signing.outcome == 'success' continue-on-error: true + if: matrix.platform == 'win' && github.run_attempt == 1 && steps.submit-inner-signing.outcome == 'success' shell: pwsh env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} @@ -1714,15 +1694,10 @@ jobs: Invoke-RestMethod -Method Post -Uri $env:SLACK_WEBHOOK_URL -ContentType 'application/json' -Body $payload - # Why gate on the notify outcome too: if nobody was told to approve, - # don't hold the release for the approval window — fall through and - # ship like today instead. The 1h wait (vs the installer's 4h) keeps - # both waits plus the build inside the 360-minute job cap; missing it - # falls through to today's unsigned-inner flow rather than blocking. + # Approval remains required even when the notification service is unavailable. - name: Download signed inner binaries from SignPath id: download-signed-inner - if: matrix.platform == 'win' && github.run_attempt == 1 && steps.submit-inner-signing.outcome == 'success' && steps.notify-inner-signing.outcome == 'success' - continue-on-error: true + if: matrix.platform == 'win' && github.run_attempt == 1 && steps.submit-inner-signing.outcome == 'success' shell: pwsh env: SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_TOKEN }} @@ -1740,27 +1715,31 @@ jobs: Expand-Archive -Path signed-inner.zip -DestinationPath signed-inner -Force # Why: copy back strictly by the staged list so a layout mismatch in the - # returned artifact fails loudly (into fail-open) instead of silently + # returned artifact fails before publication instead of silently # shipping a mix of signed and unsigned binaries. - name: Restore signed inner binaries into unpacked app id: restore-signed-inner if: matrix.platform == 'win' && github.run_attempt == 1 && steps.download-signed-inner.outcome == 'success' - continue-on-error: true shell: pwsh + env: + SIGNING_POLICY: release-signing run: | + $requireValid = $env:SIGNING_POLICY -ne 'test-signing' $root = Resolve-Path 'dist/win-unpacked' $failures = New-Object System.Collections.Generic.List[string] foreach ($relative in Get-Content 'inner-signing-list.txt') { - $signed = Get-ChildItem -Path signed-inner -Recurse -File | - Where-Object { [System.IO.Path]::GetRelativePath((Resolve-Path 'signed-inner'), $_.FullName).TrimStart('\', '/') -like "*$relative" } | - Select-Object -First 1 - if ($null -eq $signed) { - $failures.Add("missing from signed artifact: $relative") + $candidates = @( + (Join-Path 'signed-inner' $relative), + (Join-Path 'signed-inner/signing-stage' $relative) + ) | Where-Object { Test-Path -LiteralPath $_ -PathType Leaf } + if (@($candidates).Count -ne 1) { + $failures.Add("missing or ambiguous signed artifact path: $relative") continue } + $signed = Get-Item -LiteralPath @($candidates)[0] $signature = Get-AuthenticodeSignature -FilePath $signed.FullName - if ($null -eq $signature.SignerCertificate) { - $failures.Add("returned without a signature: $relative") + if ($null -eq $signature.SignerCertificate -or ($requireValid -and ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notlike '*CN=SignPath Foundation*'))) { + $failures.Add("returned without a valid SignPath signature: $relative") continue } Copy-Item -Path $signed.FullName -Destination (Join-Path $root $relative) -Force @@ -1771,25 +1750,26 @@ jobs: throw "Signed inner artifact did not round-trip cleanly ($($failures.Count) failures)." } - # Why gated separately from the inner restore above: if SignPath's - # windows-inner-binaries-zip artifact configuration does not (yet) cover the - # uninstaller/ directory, the uninstaller comes back missing. That must cost - # only the uninstaller signature — the rebuild below still runs and still - # ships the signed inner binaries, exactly as it does today. + # The uninstaller must return signed before rebuilding the installer. - name: Restore signed uninstaller for the installer rebuild id: restore-signed-uninstaller if: matrix.platform == 'win' && github.run_attempt == 1 && steps.restore-signed-inner.outcome == 'success' - continue-on-error: true shell: pwsh + env: + SIGNING_POLICY: release-signing run: | - $signed = Get-ChildItem -Path signed-inner -Recurse -File -Filter 'orca-uninstaller.exe' | - Select-Object -First 1 - if ($null -eq $signed) { - throw 'SignPath did not return uninstaller/orca-uninstaller.exe; check the windows-inner-binaries-zip artifact configuration covers it.' + $requireValid = $env:SIGNING_POLICY -ne 'test-signing' + $candidates = @( + (Join-Path 'signed-inner' 'uninstaller\orca-uninstaller.exe'), + (Join-Path 'signed-inner/signing-stage' 'uninstaller\orca-uninstaller.exe') + ) | Where-Object { Test-Path -LiteralPath $_ -PathType Leaf } + if (@($candidates).Count -ne 1) { + throw 'Missing or ambiguous uninstaller/orca-uninstaller.exe in the signed artifact; check the windows-inner-binaries-zip configuration.' } + $signed = Get-Item -LiteralPath @($candidates)[0] $signature = Get-AuthenticodeSignature -FilePath $signed.FullName - if ($null -eq $signature.SignerCertificate) { - throw 'The returned NSIS uninstaller carries no signature.' + if ($null -eq $signature.SignerCertificate -or ($requireValid -and ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notlike '*CN=SignPath Foundation*'))) { + throw 'The returned NSIS uninstaller carries no valid SignPath signature.' } $signedDir = Join-Path $env:RUNNER_TEMP 'uninstaller-signing\signed' New-Item -ItemType Directory -Force -Path $signedDir | Out-Null @@ -1814,13 +1794,11 @@ jobs: - name: Replace cached elevate.exe with the signed copy id: sign-elevate-cache if: matrix.platform == 'win' && github.run_attempt == 1 && steps.restore-signed-inner.outcome == 'success' - continue-on-error: true shell: pwsh run: | $signed = 'dist/win-unpacked/resources/elevate.exe' if (-not (Test-Path $signed)) { - Write-Host '::warning::No elevate.exe in win-unpacked resources; nothing to protect from the rebuild clobber.' - exit 0 + throw 'No elevate.exe in win-unpacked resources.' } # Why this guard stays: windows-signing-rehearsal.yml shares the # electron-builder-win- cache key with this workflow, so a @@ -1828,8 +1806,7 @@ jobs: $signature = Get-AuthenticodeSignature -FilePath $signed $subject = if ($null -eq $signature.SignerCertificate) { '' } else { $signature.SignerCertificate.Subject } if ($signature.Status -ne 'Valid' -or $subject -notlike '*CN=SignPath Foundation*') { - Write-Host "::warning::win-unpacked elevate.exe is not SignPath-signed ($($signature.Status), $subject); skipping cache swap." - exit 0 + throw "win-unpacked elevate.exe is not SignPath-signed ($($signature.Status), $subject)." } node config/scripts/replace-cached-nsis-elevate.mjs $signed if ($LASTEXITCODE -ne 0) { @@ -1847,35 +1824,16 @@ jobs: - name: Rebuild NSIS installer from signed unpacked app id: rebuild-nsis-signed if: matrix.platform == 'win' && github.run_attempt == 1 && steps.restore-signed-inner.outcome == 'success' - continue-on-error: true shell: pwsh env: - # Why unconditional: the sign hook keys off the file existing, which it - # only does when the restore step above succeeded. A missing file logs a - # warning and embeds the freshly built unsigned uninstaller instead. ORCA_WIN_UNINSTALLER_SIGNED_PATH: ${{ runner.temp }}\uninstaller-signing\signed\orca-uninstaller.exe run: | - # Why: keep the pre-rebuild artifacts so a failed rebuild can fall - # back to shipping them unchanged (fail-open). - New-Item -ItemType Directory -Path prepack-backup -Force | Out-Null - Copy-Item 'dist/orca-windows-setup.exe' 'prepack-backup/orca-windows-setup.exe' -Force - Copy-Item 'dist/latest.yml' 'prepack-backup/latest.yml' -Force - pnpm exec electron-builder --config config/electron-builder.config.cjs --win --publish never --prepackaged "$env:GITHUB_WORKSPACE\dist\win-unpacked" if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if (-not (Test-Path 'dist/orca-windows-setup.exe')) { throw 'electron-builder --prepackaged did not produce dist/orca-windows-setup.exe' } - - name: Roll back to original installer after failed rebuild - if: matrix.platform == 'win' && github.run_attempt == 1 && steps.rebuild-nsis-signed.outcome == 'failure' - shell: pwsh - run: | - if (Test-Path 'prepack-backup/orca-windows-setup.exe') { - Copy-Item 'prepack-backup/orca-windows-setup.exe' 'dist/orca-windows-setup.exe' -Force - Copy-Item 'prepack-backup/latest.yml' 'dist/latest.yml' -Force - Write-Warning 'Restored pre-rebuild installer; this release ships with unsigned inner binaries.' - } # ── End Windows inner-binary signing ─────────────────────────────── - name: Upload unsigned Windows installer for SignPath if: matrix.platform == 'win' && github.run_attempt == 1 @@ -1929,7 +1887,7 @@ jobs: $requestUrl = "https://app.signpath.io/Web/$env:SIGNPATH_ORGANIZATION_ID/SigningRequests/$env:SIGNPATH_REQUEST_ID" } - # Why: releases where inner signing fell through have only this one request. + # Keep the two approval requests distinguishable in the notification. $stage = if ($env:INNER_SIGNING_SUBMITTED -eq 'true') { 'installer signing request (2 of 2)' } else { 'signing request' } # Why: approvers need tag + source ref/commit + who cut, not only the tag. $sourceRef = if (-not [string]::IsNullOrWhiteSpace($env:SOURCE_REF)) { $env:SOURCE_REF } else { 'unknown' } @@ -2036,24 +1994,18 @@ jobs: # Why: evidence gate for inner-binary signing (issue #7785, supersedes # PR #7170's Orca.exe-only gate — this covers every staged .exe/.dll/.node - # by extracting the shipped installer). Warn-only until the flow has been - # proven on a real release, then flip ORCA_WINDOWS_INNER_SIGNATURE_REQUIRED - # to 'true' so unsigned inner binaries block the release. + # by extracting the shipped installer). Unsigned binaries block publication. - name: Verify Windows inner binary signatures if: matrix.platform == 'win' && github.run_attempt == 1 shell: pwsh env: - ORCA_WINDOWS_INNER_SIGNATURE_REQUIRED: 'false' + ORCA_WINDOWS_INNER_SIGNATURE_REQUIRED: 'true' INNER_SIGNING_COMPLETED: ${{ steps.rebuild-nsis-signed.outcome == 'success' }} UNINSTALLER_SIGNING_COMPLETED: ${{ steps.restore-signed-uninstaller.outcome == 'success' }} run: | $required = $env:ORCA_WINDOWS_INNER_SIGNATURE_REQUIRED -eq 'true' - # Why: a fail-open gate that writes nothing is indistinguishable from a - # gate that passed. Always leave a verdict in the evidence artifact and - # the job summary so a silent degradation is visible (#6487). - # Why best-effort: while warn-only, a disk-full or permission error - # writing the verdict must not become the thing that fails the release. + # Keep diagnostics best-effort so they cannot mask a signature failure. function Add-GateEvidence([string]$line) { try { Add-Content -Path 'inner-signing-evidence.txt' -Value "`n$line" -ErrorAction Stop @@ -2081,19 +2033,14 @@ jobs: } if ($env:INNER_SIGNING_COMPLETED -ne 'true') { - $message = 'Windows inner-binary signing did not complete; this release ships unsigned inner binaries (fail-open, issue #7785).' + $message = 'Windows inner-binary signing did not complete; publication is blocked.' Write-GateVerdict "NOT VERIFIED — $message" if ($required) { throw $message } Write-Host "::warning::$message" exit 0 } - # Why try/catch: while the gate is warn-only, even an unexpected - # script error (extraction hiccup, missing file) must not block - # the release — only the flip to required makes failures fatal. - # Why tracked separately: a required-mode signature failure must not be - # rewritten as ERRORED by the catch below, which would replace the - # per-file report with an exception string and lose the diagnostics. + # Keep signature failures outside the catch to preserve the per-file report. $policyFailure = $null try { @@ -2115,14 +2062,19 @@ jobs: } New-Item -ItemType Directory -Path inner-evidence-extract -Force | Out-Null & $7za x 'dist/orca-windows-setup.exe' '-oinner-evidence-extract' -y | Out-Null + if ($LASTEXITCODE -ne 0) { throw 'Could not extract the shipped installer payload.' } $root = Resolve-Path 'inner-evidence-extract' + # Verify the CLI even when a cached signed copy bypassed staging (#23383). # Why elevate.exe is always appended: staging skips already-signed # files, and the persisted electron-builder cache can carry a # previously signed elevate.exe — so it may be absent from the list # in some runs, yet it is the file most at risk of losing its # signature in the NSIS rebuild. Verify it in every release. $targets = @(Get-Content 'inner-signing-list.txt') + foreach ($requiredTarget in @('Orca.exe', 'resources\bin\orca.exe')) { + if ($targets -notcontains $requiredTarget) { $targets += $requiredTarget } + } if ($targets -notcontains 'resources\elevate.exe') { $targets += 'resources\elevate.exe' } @@ -2157,7 +2109,7 @@ jobs: } } } else { - Write-Host '::warning::The NSIS uninstaller was not signed on this run; it is excluded from the evidence gate (fail-open).' + $failures.Add('The NSIS uninstaller signing did not complete.') } foreach ($relative in $targets) { $path = Join-Path $root $relative @@ -2207,6 +2159,38 @@ jobs: # Outside the catch so the FAILED evidence report survives intact. if ($policyFailure) { throw $policyFailure } + - name: Notify Slack when Windows signing fails + if: failure() && matrix.platform == 'win' && github.run_attempt == 1 && steps.install-signpath.outcome != '' && steps.install-signpath.outcome != 'skipped' + continue-on-error: true + shell: pwsh + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TAG: ${{ needs.cut.outputs.tag }} + GITHUB_RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + INNER_REQUEST_ID: ${{ steps.submit-inner-signing.outputs.signing-request-id }} + INSTALLER_REQUEST_ID: ${{ steps.submit-signing-request.outputs.signing-request-id }} + INSTALLER_SUBMISSION_OUTCOME: ${{ steps.submit-signing-request.outcome }} + run: | + if ([string]::IsNullOrWhiteSpace($env:SLACK_WEBHOOK_URL)) { + throw 'SLACK_WEBHOOK_URL is missing; cannot notify release approvers of the signing failure.' + } + $stage = 'inner-binary signing or installer rebuild' + if ($env:INSTALLER_SUBMISSION_OUTCOME -in @('success', 'failure')) { + $stage = 'installer signing or final signature verification' + } + $message = "Orca Windows release ``$($env:TAG)`` failed during $stage (including approval timeouts). Publication is blocked.`n<$($env:GITHUB_RUN_URL)|Open failed GitHub Actions run>" + foreach ($request in @( + @{ Id = $env:INNER_REQUEST_ID; Label = 'Inner-binary signing request' }, + @{ Id = $env:INSTALLER_REQUEST_ID; Label = 'Installer signing request' } + )) { + if (-not [string]::IsNullOrWhiteSpace($request.Id)) { + $message += "`n" + } + } + $message += "`nCheck the failed step before retrying. Late SignPath approval does not resume this run; missing Windows assets require a fresh release dispatch, not Re-run failed jobs." + $payload = @{ text = $message } | ConvertTo-Json + Invoke-RestMethod -Method Post -Uri $env:SLACK_WEBHOOK_URL -ContentType 'application/json' -Body $payload + - name: Upload Windows inner signing evidence if: always() && matrix.platform == 'win' && github.run_attempt == 1 uses: actions/upload-artifact@v7 diff --git a/.github/workflows/windows-signing-rehearsal.yml b/.github/workflows/windows-signing-rehearsal.yml index 0fa2a31cd979..c23643301646 100644 --- a/.github/workflows/windows-signing-rehearsal.yml +++ b/.github/workflows/windows-signing-rehearsal.yml @@ -210,20 +210,25 @@ jobs: # signed and unsigned binaries. - name: Restore signed inner binaries into unpacked app shell: pwsh + env: + SIGNING_POLICY: ${{ inputs.signing-policy-slug || 'test-signing' }} run: | + $requireValid = $env:SIGNING_POLICY -ne 'test-signing' $root = Resolve-Path 'dist/win-unpacked' $failures = New-Object System.Collections.Generic.List[string] foreach ($relative in Get-Content 'inner-signing-list.txt') { - $signed = Get-ChildItem -Path signed-inner -Recurse -File | - Where-Object { [System.IO.Path]::GetRelativePath((Resolve-Path 'signed-inner'), $_.FullName).TrimStart('\', '/') -like "*$relative" } | - Select-Object -First 1 - if ($null -eq $signed) { - $failures.Add("missing from signed artifact: $relative") + $candidates = @( + (Join-Path 'signed-inner' $relative), + (Join-Path 'signed-inner/signing-stage' $relative) + ) | Where-Object { Test-Path -LiteralPath $_ -PathType Leaf } + if (@($candidates).Count -ne 1) { + $failures.Add("missing or ambiguous signed artifact path: $relative") continue } + $signed = Get-Item -LiteralPath @($candidates)[0] $signature = Get-AuthenticodeSignature -FilePath $signed.FullName - if ($null -eq $signature.SignerCertificate) { - $failures.Add("returned without a signature: $relative") + if ($null -eq $signature.SignerCertificate -or ($requireValid -and ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notlike '*CN=SignPath Foundation*'))) { + $failures.Add("returned without a valid SignPath signature: $relative") continue } Copy-Item -Path $signed.FullName -Destination (Join-Path $root $relative) -Force @@ -236,15 +241,21 @@ jobs: - name: Restore signed uninstaller for the installer rebuild shell: pwsh + env: + SIGNING_POLICY: ${{ inputs.signing-policy-slug || 'test-signing' }} run: | - $signed = Get-ChildItem -Path signed-inner -Recurse -File -Filter 'orca-uninstaller.exe' | - Select-Object -First 1 - if ($null -eq $signed) { - throw 'SignPath did not return uninstaller/orca-uninstaller.exe; check the inner-binaries artifact configuration covers it.' + $requireValid = $env:SIGNING_POLICY -ne 'test-signing' + $candidates = @( + (Join-Path 'signed-inner' 'uninstaller\orca-uninstaller.exe'), + (Join-Path 'signed-inner/signing-stage' 'uninstaller\orca-uninstaller.exe') + ) | Where-Object { Test-Path -LiteralPath $_ -PathType Leaf } + if (@($candidates).Count -ne 1) { + throw 'Missing or ambiguous uninstaller/orca-uninstaller.exe in the signed artifact; check the windows-inner-binaries-zip configuration.' } + $signed = Get-Item -LiteralPath @($candidates)[0] $signature = Get-AuthenticodeSignature -FilePath $signed.FullName - if ($null -eq $signature.SignerCertificate) { - throw 'The returned NSIS uninstaller carries no signature.' + if ($null -eq $signature.SignerCertificate -or ($requireValid -and ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notlike '*CN=SignPath Foundation*'))) { + throw 'The returned NSIS uninstaller carries no valid SignPath signature.' } $signedDir = Join-Path $env:RUNNER_TEMP 'uninstaller-signing\signed' New-Item -ItemType Directory -Force -Path $signedDir | Out-Null @@ -487,7 +498,11 @@ jobs: Test-Signature "shipped: Uninstall Orca.exe (via $installedVia)" $installedUninstaller.FullName } - foreach ($relative in Get-Content 'inner-signing-list.txt') { + $targets = @(Get-Content 'inner-signing-list.txt') + foreach ($requiredTarget in @('Orca.exe', 'resources\bin\orca.exe')) { + if ($targets -notcontains $requiredTarget) { $targets += $requiredTarget } + } + foreach ($relative in $targets) { $path = Join-Path $root $relative if (-not (Test-Path $path)) { $failures.Add("missing from installer payload: $relative") diff --git a/config/scripts/build-windows-cli-launcher.mjs b/config/scripts/build-windows-cli-launcher.mjs index 9d3c9020706c..cc4e5ad3d0f1 100644 --- a/config/scripts/build-windows-cli-launcher.mjs +++ b/config/scripts/build-windows-cli-launcher.mjs @@ -1,24 +1,41 @@ #!/usr/bin/env node import { spawnSync } from 'node:child_process' -import { existsSync, mkdirSync, statSync } from 'node:fs' +import { createHash } from 'node:crypto' +import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { dirname, join, resolve } from 'node:path' import { pathToFileURL } from 'node:url' -export function shouldReuseCompiledWindowsCliLauncher( - outputPath, - sourcePath, - { reuseCached = false } = {} -) { - if (!existsSync(outputPath)) { - return false +export function windowsCliLauncherFingerprint(inputPaths, version) { + const hash = createHash('sha256').update(version) + for (const inputPath of inputPaths) { + hash.update('\0').update(readFileSync(inputPath)) } - // Why reuseCached: Actions cache keys already hash the C# source, but restore - // does not preserve mtimes, so a hit would look stale and recompile anyway. - if (reuseCached) { - return true + return hash.digest('hex') +} + +export function shouldReuseCompiledWindowsCliLauncher(outputPath, fingerprint) { + const fingerprintPath = `${outputPath}.sha256` + return ( + existsSync(outputPath) && + existsSync(fingerprintPath) && + readFileSync(fingerprintPath, 'utf8') === fingerprint + ) +} + +export function windowsCliLauncherVersionSource(version) { + const match = /^(\d+)\.(\d+)\.(\d+)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.exec(version) + if (!match || match.slice(1).some((part) => Number(part) > 65534)) { + throw new Error(`Invalid Windows CLI launcher version: ${version}`) } - return statSync(outputPath).mtimeMs >= statSync(sourcePath).mtimeMs + const fileVersion = `${match.slice(1).join('.')}.0` + return [ + 'using System.Reflection;', + `[assembly: AssemblyVersion("${fileVersion}")]`, + `[assembly: AssemblyFileVersion("${fileVersion}")]`, + `[assembly: AssemblyInformationalVersion("${version}")]`, + '' + ].join('\n') } function defaultOutputPath(projectRoot) { @@ -53,6 +70,19 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) const repoRoot = resolve(import.meta.dirname, '../..') const sourcePath = join(repoRoot, 'native', 'windows-cli-launcher', 'OrcaCliLauncher.cs') + const manifestPath = join(repoRoot, 'native', 'windows-cli-launcher', 'app.manifest') + const iconPath = join(repoRoot, 'resources', 'build', 'icon.ico') + const { version } = JSON.parse(readFileSync(join(repoRoot, 'package.json'), 'utf8')) + const versionSource = windowsCliLauncherVersionSource(version) + const fingerprint = windowsCliLauncherFingerprint( + [ + sourcePath, + manifestPath, + iconPath, + join(repoRoot, 'config/scripts/build-windows-cli-launcher.mjs') + ], + version + ) const outputPath = readArg('--output') ?? defaultOutputPath(repoRoot) const compilerPath = findFrameworkCompiler(process.env) @@ -61,17 +91,26 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) } mkdirSync(dirname(outputPath), { recursive: true }) - if ( - shouldReuseCompiledWindowsCliLauncher(outputPath, sourcePath, { - reuseCached: process.env.ORCA_REUSE_WINDOWS_CLI_LAUNCHER === '1' - }) - ) { + if (shouldReuseCompiledWindowsCliLauncher(outputPath, fingerprint)) { console.log(`[native-build] reusing Windows CLI launcher at ${outputPath}`) process.exit(0) } + const versionPath = join(dirname(outputPath), 'OrcaCliLauncher.Version.cs') + writeFileSync(versionPath, versionSource) + rmSync(`${outputPath}.sha256`, { force: true }) const result = spawnSync( compilerPath, - ['/nologo', '/target:exe', '/optimize+', '/warnaserror+', `/out:${outputPath}`, sourcePath], + [ + '/nologo', + '/target:exe', + '/optimize+', + '/warnaserror+', + `/win32manifest:${manifestPath}`, + `/win32icon:${iconPath}`, + `/out:${outputPath}`, + sourcePath, + versionPath + ], { cwd: repoRoot, stdio: 'inherit' } ) @@ -84,4 +123,5 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) if (result.status !== 0) { process.exit(result.status ?? 1) } + writeFileSync(`${outputPath}.sha256`, fingerprint) } diff --git a/config/scripts/build-windows-cli-launcher.test.mjs b/config/scripts/build-windows-cli-launcher.test.mjs index 823328977152..1e0f363acd03 100644 --- a/config/scripts/build-windows-cli-launcher.test.mjs +++ b/config/scripts/build-windows-cli-launcher.test.mjs @@ -5,7 +5,6 @@ import { mkdtempSync, readFileSync, rmSync, - statSync, utimesSync, writeFileSync } from 'node:fs' @@ -13,7 +12,11 @@ import { tmpdir } from 'node:os' import { dirname, join, resolve } from 'node:path' import { spawnSync } from 'node:child_process' import { describe, expect, it } from 'vitest' -import { shouldReuseCompiledWindowsCliLauncher } from './build-windows-cli-launcher.mjs' +import { + shouldReuseCompiledWindowsCliLauncher, + windowsCliLauncherFingerprint, + windowsCliLauncherVersionSource +} from './build-windows-cli-launcher.mjs' const itCrossHost = process.platform === 'win32' ? it.skip : it const projectRoot = resolve(import.meta.dirname, '../..') @@ -40,33 +43,102 @@ function itWindows(name, test) { } describe('Windows CLI launcher', () => { - it('reuses a compiled launcher that is at least as new as the C# source', () => { + it('reuses restored builds only while all embedded inputs and the release version match', () => { const root = mkdtempSync(join(tmpdir(), 'orca-cli-launcher-reuse-')) try { - const sourcePath = join(root, 'OrcaCliLauncher.cs') - const outputPath = join(root, '.build', 'orca.exe') - mkdirSync(join(root, '.build')) - writeFileSync(sourcePath, 'source\n') - writeFileSync(outputPath, 'binary\n') - const later = new Date(statSync(sourcePath).mtimeMs + 1_000) - utimesSync(outputPath, later, later) - - expect(shouldReuseCompiledWindowsCliLauncher(outputPath, sourcePath)).toBe(true) - writeFileSync(sourcePath, 'changed\n') - const sourceLater = new Date(statSync(outputPath).mtimeMs + 1_000) - utimesSync(sourcePath, sourceLater, sourceLater) - expect(shouldReuseCompiledWindowsCliLauncher(outputPath, sourcePath)).toBe(false) + const inputs = ['source.cs', 'app.manifest', 'icon.ico', 'build.mjs'].map((name) => { + const path = join(root, name) + writeFileSync(path, name) + return path + }) + const outputPath = join(root, 'orca.exe') + const fingerprint = windowsCliLauncherFingerprint(inputs, '1.4.214') + expect(shouldReuseCompiledWindowsCliLauncher(outputPath, fingerprint)).toBe(false) + writeFileSync(outputPath, 'binary') + expect(shouldReuseCompiledWindowsCliLauncher(outputPath, fingerprint)).toBe(false) + writeFileSync(`${outputPath}.sha256`, fingerprint) + for (const input of inputs) { + utimesSync(input, new Date(), new Date()) + } expect( - shouldReuseCompiledWindowsCliLauncher(outputPath, sourcePath, { reuseCached: true }) + shouldReuseCompiledWindowsCliLauncher( + outputPath, + windowsCliLauncherFingerprint(inputs, '1.4.214') + ) ).toBe(true) - expect(shouldReuseCompiledWindowsCliLauncher(join(root, 'missing.exe'), sourcePath)).toBe( - false - ) + expect( + shouldReuseCompiledWindowsCliLauncher( + outputPath, + windowsCliLauncherFingerprint(inputs, '1.4.215') + ) + ).toBe(false) + for (const input of inputs) { + const original = readFileSync(input) + writeFileSync(input, 'changed') + expect( + shouldReuseCompiledWindowsCliLauncher( + outputPath, + windowsCliLauncherFingerprint(inputs, '1.4.214') + ) + ).toBe(false) + writeFileSync(input, original) + } } finally { removeFixtureTree(root) } }) + it('keeps prerelease identity while emitting a valid Windows numeric version', () => { + const source = windowsCliLauncherVersionSource('1.4.214-daily.202609281300') + expect(source).toContain('AssemblyFileVersion("1.4.214.0")') + expect(source).toContain('AssemblyInformationalVersion("1.4.214-daily.202609281300")') + for (const version of ['1.4.65535', '1.4', '1.4.214"', undefined]) { + expect(() => windowsCliLauncherVersionSource(version)).toThrow('Invalid Windows') + } + }) + + itWindows( + 'embeds publisher, release version, icon and an unelevated application manifest', + () => { + const root = mkdtempSync(join(tmpdir(), 'orca launcher metadata ')) + try { + const launcherPath = join(root, 'orca.exe') + const build = spawnSync( + process.execPath, + ['config/scripts/build-windows-cli-launcher.mjs', '--output', launcherPath], + { cwd: projectRoot, encoding: 'utf8' } + ) + expect(build.status, `${build.stdout}\n${build.stderr}`).toBe(0) + const inspect = spawnSync( + 'powershell.exe', + [ + '-NoProfile', + '-NonInteractive', + '-Command', + '[Diagnostics.FileVersionInfo]::GetVersionInfo($env:ORCA_TEST_LAUNCHER) | ConvertTo-Json -Compress' + ], + { encoding: 'utf8', env: { ...process.env, ORCA_TEST_LAUNCHER: launcherPath } } + ) + expect(inspect.status, inspect.stderr).toBe(0) + const info = JSON.parse(inspect.stdout) + const { version } = JSON.parse(readFileSync(join(projectRoot, 'package.json'), 'utf8')) + expect(info.CompanyName).toBe('Stably AI') + expect(info.ProductName).toBe('Orca') + expect(info.FileDescription).toBe('Orca CLI Launcher') + expect(info.FileVersion).toBe(`${version.split(/[+-]/)[0]}.0`) + expect(info.ProductVersion).toBe(version) + const binary = readFileSync(launcherPath) + expect(binary.includes(Buffer.from('requestedExecutionLevel level="asInvoker"'))).toBe(true) + const icon = readFileSync(join(projectRoot, 'resources', 'build', 'icon.ico')) + const imageSize = icon.readUInt32LE(14) + const imageOffset = icon.readUInt32LE(18) + expect(binary.includes(icon.subarray(imageOffset, imageOffset + imageSize))).toBe(true) + } finally { + removeFixtureTree(root) + } + } + ) + itCrossHost('fails closed when the Windows launcher cannot be compiled on this host', () => { const outputRoot = mkdtempSync(join(tmpdir(), 'orca cross-host launcher ')) try { diff --git a/config/scripts/replace-cached-nsis-elevate.test.mjs b/config/scripts/replace-cached-nsis-elevate.test.mjs index a88461703c36..ffdcc0b4b5b1 100644 --- a/config/scripts/replace-cached-nsis-elevate.test.mjs +++ b/config/scripts/replace-cached-nsis-elevate.test.mjs @@ -357,8 +357,7 @@ describe('release-cut.yml swaps the cached elevate.exe through the resolver', () expect(step.run).toContain("$subject -notlike '*CN=SignPath Foundation*'") }) - // The inner-signing chain stays fail-open: a loud red step, not an unbuildable release. - it('keeps the step unable to fail the release job', () => { - expect(swapStep()['continue-on-error']).toBe(true) + it('blocks the release when the cache swap fails', () => { + expect(swapStep()['continue-on-error']).toBeUndefined() }) }) diff --git a/config/scripts/skills-cli-package-workflow.test.mjs b/config/scripts/skills-cli-package-workflow.test.mjs index 07f7beb46acf..489437dd61f2 100644 --- a/config/scripts/skills-cli-package-workflow.test.mjs +++ b/config/scripts/skills-cli-package-workflow.test.mjs @@ -14,7 +14,6 @@ describe('packaged skills CLI PR gates', () => { expect(job['runs-on']).toBe('windows-2022') expect(buildStep.run).toBe('pnpm run build:release:parallel') - expect(buildStep.env.ORCA_REUSE_WINDOWS_CLI_LAUNCHER).toBe('1') expect(prepareStep.run).toBe('node config/scripts/ensure-native-runtime.mjs --runtime=electron') expect(packageStep.run).toContain('electron-builder') expect(packageStep.run).toContain('--dir') diff --git a/config/scripts/windows-pty-native-capability-workflow.test.mjs b/config/scripts/windows-pty-native-capability-workflow.test.mjs index e1742a43bb09..e7b18363aeb9 100644 --- a/config/scripts/windows-pty-native-capability-workflow.test.mjs +++ b/config/scripts/windows-pty-native-capability-workflow.test.mjs @@ -58,7 +58,6 @@ describe('packaged Windows PTY native capability routing', () => { expect(ensureNativeRuntime).toContain("runPnpm(['exec', 'node-gyp', 'rebuild']") expect(ensureNativeRuntime).toContain("resolve(moduleDir, 'scripts', 'post-install.js')") expect(build.run).toBe('pnpm run build:release:parallel') - expect(build.env.ORCA_REUSE_WINDOWS_CLI_LAUNCHER).toBe('1') expect(prepare.run).toBe('node config/scripts/ensure-native-runtime.mjs --runtime=electron') expect(packageStep.env.ORCA_REUSE_PREPARED_NATIVE_RUNTIME).toBe('1') expect(workflow.jobs.verify.needs).toContain('package_windows') diff --git a/config/scripts/windows-signing-notification.test.mjs b/config/scripts/windows-signing-notification.test.mjs new file mode 100644 index 000000000000..d5b6671e9d02 --- /dev/null +++ b/config/scripts/windows-signing-notification.test.mjs @@ -0,0 +1,37 @@ +import { readFileSync } from 'node:fs' +import { describe, expect, it } from 'vitest' +import { parse } from 'yaml' + +const releaseSteps = () => + parse(readFileSync(new URL('../../.github/workflows/release-cut.yml', import.meta.url), 'utf8')) + .jobs.build.steps +const stepNamed = (steps, name) => steps.find((step) => step.name === name) + +describe('Windows signing failure notification', () => { + it('alerts Slack after signing failures without masking the release failure', () => { + const steps = releaseSteps() + const notify = stepNamed(steps, 'Notify Slack when Windows signing fails') + const names = steps.map((step) => step.name) + expect(stepNamed(steps, 'Install SignPath PowerShell module').id).toBe('install-signpath') + expect(notify.if).toBe( + "failure() && matrix.platform == 'win' && github.run_attempt == 1 && steps.install-signpath.outcome != '' && steps.install-signpath.outcome != 'skipped'" + ) + expect(notify['continue-on-error']).toBe(true) + expect(names.indexOf(notify.name)).toBeGreaterThan( + names.indexOf('Verify Windows inner binary signatures') + ) + expect(names.indexOf(notify.name)).toBeLessThan( + names.indexOf('Publish signed Windows release artifacts') + ) + expect(notify.env.SLACK_WEBHOOK_URL).toBe('${{ secrets.SLACK_WEBHOOK_URL }}') + expect(notify.env.INNER_REQUEST_ID).toContain( + 'steps.submit-inner-signing.outputs.signing-request-id' + ) + expect(notify.env.INSTALLER_REQUEST_ID).toContain( + 'steps.submit-signing-request.outputs.signing-request-id' + ) + expect(notify.run).toContain('Publication is blocked.') + expect(notify.run).toContain('Late SignPath approval does not resume this run') + expect(notify.run).toContain('Invoke-RestMethod -Method Post') + }) +}) diff --git a/config/scripts/windows-signing-workflow-contract.test.mjs b/config/scripts/windows-signing-workflow-contract.test.mjs index c321db8cfd23..98d0d5e8e88d 100644 --- a/config/scripts/windows-signing-workflow-contract.test.mjs +++ b/config/scripts/windows-signing-workflow-contract.test.mjs @@ -184,7 +184,7 @@ describe('Windows signing workflow contract', () => { ) }) - it('verifies Windows inner binary signatures fail-open before publishing', () => { + it('requires Windows inner binary signatures before publishing', () => { const parsedWorkflow = readWorkflow('.github/workflows/release-cut.yml') const steps = parsedWorkflow.jobs.build.steps const stepNames = steps.map((step) => step.name) @@ -195,22 +195,18 @@ describe('Windows signing workflow contract', () => { expect(outerVerifyIndex).toBeGreaterThan(-1) expect(innerVerifyIndex).toBe(outerVerifyIndex + 1) - expect(evidenceIndex).toBe(innerVerifyIndex + 1) + expect(stepNames[innerVerifyIndex + 1]).toBe('Notify Slack when Windows signing fails') + expect(evidenceIndex).toBe(innerVerifyIndex + 2) expect(publishIndex).toBe(evidenceIndex + 1) - // Why fail-open: unsigned inner binaries must warn, not block, until the - // flow is proven on a real release (issue #7785). Flip this to 'true' - // together with the workflow env to make the gate required. - expect(steps[innerVerifyIndex].env.ORCA_WINDOWS_INNER_SIGNATURE_REQUIRED).toBe('false') + expect(steps[innerVerifyIndex].env.ORCA_WINDOWS_INNER_SIGNATURE_REQUIRED).toBe('true') + expect(steps[innerVerifyIndex].run).toContain("@('Orca.exe', 'resources\\bin\\orca.exe')") + expect(stepNames).not.toContain('Roll back to original installer after failed rebuild') - // Why: every step in the inner-signing chain must be unable to fail the - // release — a SignPath outage or timeout falls through to today's - // unsigned-inner flow instead of blocking the cut. const innerChainStepNames = [ 'Stage unsigned inner PE files for signing', 'Upload unsigned inner binaries for SignPath', 'Submit inner binaries signing request', - 'Notify Slack that inner-binary signing is waiting for approval', 'Download signed inner binaries from SignPath', 'Restore signed inner binaries into unpacked app', 'Restore signed uninstaller for the installer rebuild', @@ -220,7 +216,7 @@ describe('Windows signing workflow contract', () => { for (const stepName of innerChainStepNames) { const step = steps[stepNames.indexOf(stepName)] expect(step, stepName).toBeDefined() - expect(step['continue-on-error'], stepName).toBe(true) + expect(step['continue-on-error'], stepName).toBeUndefined() } }) }) @@ -294,8 +290,6 @@ describe('Windows NSIS uninstaller signing', () => { expect(submissions).toHaveLength(2) }) - // A staged-but-unreturned uninstaller must not fail the inner chain, or a - // SignPath artifact-configuration gap would cost the inner-binary signatures. it('keeps the uninstaller out of the inner-binary copy-back list', () => { const stage = stepNamed(releaseSteps(), 'Stage unsigned inner PE files for signing') const restoreInner = stepNamed( @@ -307,26 +301,72 @@ describe('Windows NSIS uninstaller signing', () => { expect(restoreInner.run).not.toContain('orca-uninstaller.exe') }) - // This step's outcome gates the upload of every inner binary, so a filesystem - // error while staging the uninstaller must not escape — otherwise one - // uninstaller-specific failure costs every inner-binary signature, which is - // strictly worse than the behaviour before this chain existed. - it('cannot let an uninstaller staging failure cost the inner-binary signatures', () => { + it('blocks publication when the exported uninstaller is missing', () => { const stage = stepNamed(releaseSteps(), 'Stage unsigned inner PE files for signing') const uninstallerBlock = stage.run.slice(stage.run.indexOf('$exportedUninstaller')) - expect(stage.run).toMatch(/try \{[\s\S]*\$exportedUninstaller[\s\S]*\} catch \{/) - expect(uninstallerBlock).toContain('::warning::Could not stage the NSIS uninstaller') - expect(uninstallerBlock).not.toContain('throw') - // Explicit, so the catch does not silently depend on GitHub's - // $ErrorActionPreference='Stop' default for `shell: pwsh`. - expect(uninstallerBlock).toContain('New-Item -ItemType Directory -Force -Path (Split-Path') - expect(uninstallerBlock).toMatch(/New-Item[^\r\n]*-ErrorAction Stop/) + expect(uninstallerBlock).toContain('throw "No exported NSIS uninstaller') + expect(uninstallerBlock).not.toContain('catch') expect(uninstallerBlock).toMatch(/Copy-Item[^\r\n]*-ErrorAction Stop/) - // The upload it gates still keys off this step, so the catch is load-bearing. - expect(stepNamed(releaseSteps(), 'Upload unsigned inner binaries for SignPath').if).toContain( - "steps.stage-inner.outcome == 'success'" + }) + + it('restores exact artifact paths rather than suffix-matching another executable', () => { + for (const [name, path] of [ + ['Restore signed inner binaries into unpacked app', '$relative'], + [ + 'Restore signed uninstaller for the installer rebuild', + "'uninstaller\\orca-uninstaller.exe'" + ] + ]) { + const restore = stepNamed(releaseSteps(), name) + expect(restore.run).toContain(`(Join-Path 'signed-inner' ${path})`) + expect(restore.run).toContain(`(Join-Path 'signed-inner/signing-stage' ${path})`) + expect(restore.run).toContain('if (@($candidates).Count -ne 1)') + expect(restore.run).not.toContain('Select-Object -First 1') + expect(restore.run).not.toContain('-like "*$relative"') + const rehearsal = readWorkflow('.github/workflows/windows-signing-rehearsal.yml') + const rehearseRestore = stepNamed(rehearsal.jobs.rehearse.steps, name) + expect(rehearseRestore.run).toBe(restore.run) + expect(restore.env.SIGNING_POLICY).toBe('release-signing') + expect(rehearseRestore.env.SIGNING_POLICY).toBe( + "${{ inputs.signing-policy-slug || 'test-signing' }}" + ) + expect(restore.run).toContain("$requireValid = $env:SIGNING_POLICY -ne 'test-signing'") + expect(restore.run).toContain( + "if ($null -eq $signature.SignerCertificate -or ($requireValid -and ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notlike '*CN=SignPath Foundation*')))" + ) + } + }) + + it('requires the CLI signature at its electron-builder extraResources destination', () => { + const require = createRequire(import.meta.url) + const config = require('../electron-builder.config.cjs') + const cli = config.win.extraResources.find((resource) => resource.to === 'bin/orca.exe') + expect(cli).toBeDefined() + const payloadPath = `resources/${cli.to}`.replaceAll('/', '\\') + const rehearsal = readWorkflow('.github/workflows/windows-signing-rehearsal.yml') + for (const gate of [ + stepNamed(releaseSteps(), 'Verify Windows inner binary signatures'), + stepNamed(rehearsal.jobs.rehearse.steps, 'Verify signatures end to end') + ]) { + expect(gate.run).toContain(`foreach ($requiredTarget in @('Orca.exe', '${payloadPath}'))`) + expect(gate.run).toContain( + 'if ($targets -notcontains $requiredTarget) { $targets += $requiredTarget }' + ) + expect(gate.run).toContain('foreach ($relative in $targets)') + } + }) + + it('waits for approval even when the notification fails', () => { + const steps = releaseSteps() + const notify = stepNamed( + steps, + 'Notify Slack that inner-binary signing is waiting for approval' ) + const download = stepNamed(steps, 'Download signed inner binaries from SignPath') + expect(notify['continue-on-error']).toBe(true) + expect(download.if).not.toContain('notify-inner-signing') + expect(download.if).toContain("steps.submit-inner-signing.outcome == 'success'") }) it('re-injects the signed uninstaller into the rebuilt installer', () => { @@ -340,8 +380,7 @@ describe('Windows NSIS uninstaller signing', () => { expect(restore.run).toContain('orca-uninstaller.exe') expect(names.indexOf(restore.name)).toBeLessThan(names.indexOf(rebuild.name)) expect(rebuild.env[SIGNED_ENV]).toContain('uninstaller-signing') - // The rebuild must not depend on the uninstaller leg: a missing signed - // uninstaller ships today's installer, it does not skip the rebuild. + // Default success() gating blocks the rebuild after a failed restore. expect(rebuild.if).not.toContain('restore-signed-uninstaller') }) @@ -355,6 +394,7 @@ describe('Windows NSIS uninstaller signing', () => { "${{ steps.restore-signed-uninstaller.outcome == 'success' }}" ) expect(gate.run).toContain('.embedded-sha256') + expect(gate.run).toContain("$failures.Add('The NSIS uninstaller signing did not complete.')") expect(gate.run).toContain("$env:UNINSTALLER_SIGNING_COMPLETED -eq 'true'") expect(gate.run).toContain('not signed by SignPath Foundation: Uninstall Orca.exe') // The uninstaller must not join the 7z payload loop, which cannot see it. diff --git a/native/windows-cli-launcher/OrcaCliLauncher.cs b/native/windows-cli-launcher/OrcaCliLauncher.cs index 6261775859b1..3357c7b15963 100644 --- a/native/windows-cli-launcher/OrcaCliLauncher.cs +++ b/native/windows-cli-launcher/OrcaCliLauncher.cs @@ -2,6 +2,15 @@ using System.Diagnostics; using System.IO; using System.Text; +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Orca CLI Launcher")] +[assembly: AssemblyDescription("Command-line launcher for Orca")] +[assembly: AssemblyCompany("Stably AI")] +[assembly: AssemblyProduct("Orca")] +[assembly: AssemblyCopyright("Copyright © Stably AI")] +[assembly: ComVisible(false)] internal static class OrcaCliLauncher { diff --git a/native/windows-cli-launcher/app.manifest b/native/windows-cli-launcher/app.manifest new file mode 100644 index 000000000000..34f0426701c3 --- /dev/null +++ b/native/windows-cli-launcher/app.manifest @@ -0,0 +1,18 @@ + + + + Orca CLI Launcher + + + + + + + + + + + + + + From e87772b3a4b66797d53e1bb6d033d143a11a1aca Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:34:49 -0700 Subject: [PATCH 28/90] test: retire a dormant worker through host-owned status (#23686) * test(e2e): await renderer recovery after worker exit * test(e2e): publish worker recovery through authenticated hooks * test: keep retired background worker dormant before activation --- ...completed-worker-retirement-resume.spec.ts | 116 +++++------------- .../completed-worker-retirement-fixture.ts | 30 ++++- 2 files changed, 57 insertions(+), 89 deletions(-) diff --git a/tests/e2e/completed-worker-retirement-resume.spec.ts b/tests/e2e/completed-worker-retirement-resume.spec.ts index 6935cbe1895f..0af7ca46f123 100644 --- a/tests/e2e/completed-worker-retirement-resume.spec.ts +++ b/tests/e2e/completed-worker-retirement-resume.spec.ts @@ -160,21 +160,13 @@ for (const closeMode of ['terminal-close-cli', 'worker-release'] as const) { const workerBefore = terminalIdentity(worker) const workerPaneKey = `${worker.tabId}:${worker.leafId}` expect(worker.worktreeId).toBe(targetWorktreeId) - await orcaPage.evaluate( - ({ tabId, worktreeId }) => { - window.dispatchEvent( - new CustomEvent('orca-background-mount-terminal-worktree', { - detail: { worktreeId, tabIds: [tabId] } - }) - ) - }, - { tabId: worker.tabId, worktreeId: targetWorktreeId } - ) - await expect - .poll(() => - orcaPage.evaluate((tabId) => Boolean(window.__paneManagers?.get(tabId)), workerBefore.tabId) + // Keep the never-opened worker dormant so foreground-shell cleanup cannot retire it first. + expect( + await orcaPage.evaluate( + (tabId) => Boolean(window.__paneManagers?.get(tabId)), + workerBefore.tabId ) - .toBe(true) + ).toBe(false) expect( await orcaPage.evaluate( (worktreeId) => window.__store?.getState().everActivatedWorktreeIds.has(worktreeId), @@ -202,70 +194,13 @@ for (const closeMode of ['terminal-close-cli', 'worker-release'] as const) { throw new Error('Background worker did not receive its dispatch capability') } - const transcriptPath = seedCurrentCodexTranscript( - isolatedHome, - PROVIDER_SESSION_ID, - targetWorktreePath - ) + seedCurrentCodexTranscript(isolatedHome, PROVIDER_SESSION_ID, targetWorktreePath) - await orcaPage.evaluate( - ({ - agentCommand, - paneKey, - providerSessionId, - tabId, - terminalHandle, - transcriptPath, - worktreeId - }) => { - const state = window.__store?.getState() - if (!state) { - throw new Error('Renderer store unavailable') - } - const providerSession = { - key: 'session_id' as const, - id: providerSessionId, - transcriptPath - } - const metadata = { tabId, worktreeId, terminalHandle } - const recovery = { - providerSession, - launchConfig: { - // Why not bare 'codex': resume prefers the captured command over - // agentCmdOverrides, so a bare name would resolve the machine's real - // Codex off PATH and unpin the adoption leg this spec exercises. - agentCommand, - agentArgs: '--dangerously-bypass-approvals-and-sandbox', - agentEnv: {} - } - } - state.setAgentStatus( - paneKey, - { state: 'working', prompt: 'Report completion, then exit normally', agentType: 'codex' }, - 'Completed background worker', - undefined, - metadata, - recovery - ) - state.setAgentStatus( - paneKey, - { state: 'done', prompt: 'Report completion, then exit normally', agentType: 'codex' }, - 'Completed background worker', - undefined, - metadata, - recovery - ) - }, - { - agentCommand: completedWorkerFakeCodexCommand, - paneKey: workerPaneKey, - providerSessionId: PROVIDER_SESSION_ID, - tabId: worker.tabId, - terminalHandle: workerHandle, - transcriptPath, - worktreeId: targetWorktreeId - } - ) + await client.call('terminal.send', { + terminal: workerHandle, + text: 'ORCA_E2E_PUBLISH_DONE', + enter: true + }) const expectedRecovery = { origin: 'live', @@ -348,18 +283,23 @@ for (const closeMode of ['terminal-close-cli', 'worker-release'] as const) { await expect .poll(() => readCompletedWorkerLedger().filter((event) => event.event === 'normal-exit')) .toHaveLength(1) - expect( - await orcaPage.evaluate( - ({ paneKey, tabId, worktreeId }) => { - const state = window.__store?.getState() - return { - tabPresent: Boolean(state?.tabsByWorktree[worktreeId]?.some((tab) => tab.id === tabId)), - recoveryPresent: Boolean(state?.sleepingAgentSessionsByPaneKey[paneKey]) - } - }, - { paneKey: workerPaneKey, tabId: workerBefore.tabId, worktreeId: targetWorktreeId } + // The exit marker precedes the asynchronous renderer recovery update. + await expect + .poll(() => + orcaPage.evaluate( + ({ paneKey, tabId, worktreeId }) => { + const state = window.__store?.getState() + return { + tabPresent: Boolean( + state?.tabsByWorktree[worktreeId]?.some((tab) => tab.id === tabId) + ), + recoveryPresent: Boolean(state?.sleepingAgentSessionsByPaneKey[paneKey]) + } + }, + { paneKey: workerPaneKey, tabId: workerBefore.tabId, worktreeId: targetWorktreeId } + ) ) - ).toEqual({ tabPresent: true, recoveryPresent: true }) + .toEqual({ tabPresent: true, recoveryPresent: true }) await orcaPage.evaluate( ({ paneKey, tabId, worktreeId }) => { diff --git a/tests/e2e/helpers/completed-worker-retirement-fixture.ts b/tests/e2e/helpers/completed-worker-retirement-fixture.ts index 5ac0d8c1948e..89ae5297fe4e 100644 --- a/tests/e2e/helpers/completed-worker-retirement-fixture.ts +++ b/tests/e2e/helpers/completed-worker-retirement-fixture.ts @@ -20,14 +20,34 @@ import { buildFakeAgentCommandOverride } from './fake-agent-command-override' import { FAKE_AGENT_PASTE_END_SCANNER_SOURCE } from './fake-agent-paste-end-scanner' const fakeCliDir = mkdtempSync(path.join(os.tmpdir(), 'orca-e2e-retired-worker-')) +const recoveryConfigPath = path.join(fakeCliDir, 'recovery-config.json') const lifecycleLedgerPath = path.join(fakeCliDir, 'codex-lifecycle.jsonl') export const completedWorkerFakeCodexCommand = buildFakeAgentCommandOverride( path.join(fakeCliDir, process.platform === 'win32' ? 'codex.cmd' : 'codex') ) const fakeCodexSource = ` -const { appendFileSync } = require('node:fs') +const { appendFileSync, readFileSync } = require('node:fs') const ledger = process.env.ORCA_E2E_CODEX_LIFECYCLE_LEDGER const append = (event) => appendFileSync(ledger, JSON.stringify({ pid: process.pid, ...event }) + '\\n') +async function publishRecovery() { + const config = JSON.parse(readFileSync(${JSON.stringify(recoveryConfigPath)}, 'utf8')) + for (const hook_event_name of ['UserPromptSubmit', 'Stop']) { + const response = await fetch('http://127.0.0.1:' + process.env.ORCA_AGENT_HOOK_PORT + '/hook/codex', { + method: 'POST', + headers: { 'Content-Type': 'application/json', 'X-Orca-Agent-Hook-Token': process.env.ORCA_AGENT_HOOK_TOKEN }, + body: JSON.stringify({ + paneKey: process.env.ORCA_PANE_KEY, + tabId: process.env.ORCA_TAB_ID, + worktreeId: process.env.ORCA_WORKTREE_ID, + launchToken: process.env.ORCA_AGENT_LAUNCH_TOKEN, + env: process.env.ORCA_AGENT_HOOK_ENV, + version: process.env.ORCA_AGENT_HOOK_VERSION, + payload: { hook_event_name, prompt: 'Report completion, then exit normally', ...config } + }) + }) + if (response.status !== 204) throw new Error('Recovery hook rejected: ' + response.status) + } +} const args = process.argv.slice(2) if (args.includes('app-server')) { process.stderr.write("error: unrecognized subcommand 'app-server'\\n") @@ -44,6 +64,10 @@ process.stdin.on('data', (chunk) => { process.stdout.write('\\x1b[?25h') } append({ event: 'input', input }) + if (input.includes('ORCA_E2E_PUBLISH_DONE')) { + void publishRecovery().catch((error) => process.stderr.write(String(error))) + return + } if (input.includes('ORCA_E2E_EXIT_AFTER_DONE')) { append({ event: 'normal-exit' }) process.exit(0) @@ -179,6 +203,10 @@ export function seedCurrentCodexTranscript( payload: { id: providerSessionId, cwd } })}\n` ) + writeFileSync( + recoveryConfigPath, + JSON.stringify({ session_id: providerSessionId, transcript_path: transcriptPath }) + ) return transcriptPath } From b482b4d3b4d1292396aae16a63f0a76e60e73a92 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:34:53 -0700 Subject: [PATCH 29/90] test: measure pointer gestures on the isolated visible display (#23678) * test(claude): expect typed cancellation in queued-send settlements * fix(ci): respect disabled terminal links and await browser recovery * test(e2e): give legacy close client a profile authority * test(e2e): account for frame pacing in pointer latency budgets * test: compare pointer timing on isolated visible display --- tests/e2e/browser-pointer-input-dispatch.spec.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/e2e/browser-pointer-input-dispatch.spec.ts b/tests/e2e/browser-pointer-input-dispatch.spec.ts index 3068d0626805..6a797117a648 100644 --- a/tests/e2e/browser-pointer-input-dispatch.spec.ts +++ b/tests/e2e/browser-pointer-input-dispatch.spec.ts @@ -178,7 +178,9 @@ function clickSteps(x: number, y: number, button = 'left'): RpcStep[] { ] } -test('dispatches coordinate pointer input fast enough for real gestures', async ({ orcaPage }) => { +test('dispatches coordinate pointer input fast enough for real gestures @headful', async ({ + orcaPage +}) => { // Why: the measurement loop plus the gesture checks drive a few hundred serialized RPCs; // a loaded CI runner needs more than the default budget even when each one is fast. test.setTimeout(240_000) @@ -244,13 +246,11 @@ test('dispatches coordinate pointer input fast enough for real gestures', async // numbers ride along in the annotation where the failure artifact will carry them. test.info().annotations.push({ type: 'pointer-latency', description: latencyReport }) - // Why: absolute milliseconds vary by host, so compare against browser.eval on the same - // socket and queue — a pointer event that spawns the helper costs that plus a process - // launch. Measured multiples of the control: in process 1.5x/1.5x/4x, via the helper - // 5.7x/5.5x/20.5x. These thresholds sit between the two, not near either. - expect(latency.mouseMove, latencyReport).toBeLessThan(latency.evalControl * 3) - expect(latency.mouseWheel, latencyReport).toBeLessThan(latency.evalControl * 3) - expect(latency.click, latencyReport).toBeLessThan(latency.evalControl * 10) + // CDP pointer dispatch waits for a frame; fast evaluation can finish far below one. + const dispatchControlMs = Math.max(latency.evalControl, 1000 / 60) + expect(latency.mouseMove, latencyReport).toBeLessThan(dispatchControlMs * 3) + expect(latency.mouseWheel, latencyReport).toBeLessThan(dispatchControlMs * 3) + expect(latency.click, latencyReport).toBeLessThan(dispatchControlMs * 10) // ── Gesture fidelity ── From 813aff8f8a8b265e826be573a40eb8ee635f8f23 Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Mon, 28 Sep 2026 14:55:42 -0700 Subject: [PATCH 30/90] fix(opencode): stop OpenCode 2 loading a stale plugin from the retired shared hooks dir (#23500) * fix(opencode): stop OpenCode 2 loading a stale plugin from the retired shared hooks dir Before 1.4.209 Orca pointed OPENCODE_CONFIG_DIR at /opencode-hooks/shared and wrote a server()-only status plugin there. 1.4.209 moved the plugin to OpenCode's global config dir and 1.4.210 added the v2 setup() export, but nothing rewrote the old file. Shells, daemon-persisted panes and OpenCode 2 background services that still carry that OPENCODE_CONFIG_DIR load only that dir under OpenCode 2 (it replaces the global dir), so the v2 loader rejects the stale plugin with "Plugin must export a default definition with an id and an effect or setup function" and pane status dies. - Refresh the plugin in the retired shared dir (only when it already exists and its content differs) so OpenCode processes started later from old shells load the dual v1/v2 export. Runs on OpenCode pane spawns and on any spawn that inherits the retired dir, even with agent status hooks off. - Drop an inherited OPENCODE_CONFIG_DIR / ORCA_OPENCODE_* marker that points at the retired dir when building a new pane env, so new panes use global discovery. Limitation: an OpenCode 2 background service already running from an old pane keeps its cached copy of the stale module even after the file is rewritten (verified with opencode2 v2.0.18). It must be restarted (`opencode service restart`); a restart from a new Orca pane then picks up the global config because the env is stripped. * fix(opencode): harden legacy plugin repair and inherited config cleanup * fix(opencode): preserve daemon-owned user config during legacy cleanup * fix(opencode): sanitize inherited sources and repair unseen legacy copies * test(opencode): update shared PTY mocks for legacy repair * test(opencode): annotate shared repair mock signature --------- Co-authored-by: m4air --- .../pty-subprocess/spawn-environment.ts | 7 + .../pty-controller-process-inventory.test.ts | 11 +- src/main/ipc/pty-ipc-mock-registry.ts | 2 + src/main/ipc/pty/host-env/assembly.ts | 41 ++++-- .../opencode-hook-installation.test.ts | 128 ++++++++++++++++++ src/main/ipc/pty/host-env/pi-agent.ts | 9 +- src/main/ipc/pty/ipc/spawn-options.ts | 6 + .../opencode-legacy-spawn-deletions.test.ts | 64 +++++++++ src/main/ipc/pty/runtime/spawn-options.ts | 6 + src/main/opencode/hook-service.test.ts | 91 +++++++++++++ src/main/opencode/hook-service.ts | 33 ++++- .../opencode/legacy-shared-config-dir.test.ts | 38 ++++++ src/main/opencode/legacy-shared-config-dir.ts | 48 +++++++ src/main/providers/provider-dispatch.test.ts | 11 +- 14 files changed, 475 insertions(+), 20 deletions(-) create mode 100644 src/main/ipc/pty/opencode-legacy-spawn-deletions.test.ts create mode 100644 src/main/opencode/legacy-shared-config-dir.test.ts create mode 100644 src/main/opencode/legacy-shared-config-dir.ts diff --git a/src/main/daemon/pty-subprocess/spawn-environment.ts b/src/main/daemon/pty-subprocess/spawn-environment.ts index c8316bb383a0..a063ffb3dd60 100644 --- a/src/main/daemon/pty-subprocess/spawn-environment.ts +++ b/src/main/daemon/pty-subprocess/spawn-environment.ts @@ -1,3 +1,4 @@ +import { getLegacyOpenCodeEnvKeysToDelete } from '../../opencode/legacy-shared-config-dir' import { restoreOrStripOverlayEnv } from '../../../shared/agent-overlay-env' import { delimiter } from 'node:path' import { dropInheritedOrcaFishHistory } from '../../fish-history-session' @@ -54,6 +55,12 @@ function deleteRequestedDaemonEnvKeys( env: Record, keys: readonly string[] | undefined ): void { + const userDataPath = process.env.ORCA_USER_DATA_PATH + if (userDataPath) { + for (const key of getLegacyOpenCodeEnvKeysToDelete(env, userDataPath, {})) { + delete env[key] + } + } // Why: persistent daemon state can differ from Electron; delete CODEX_HOME only when its Orca overlay owns it. const deleteOrcaOwnedCodexHome = keys?.includes('ORCA_CODEX_HOME') === true && diff --git a/src/main/ipc/pty-controller-process-inventory.test.ts b/src/main/ipc/pty-controller-process-inventory.test.ts index e89d888978a5..004735c61cbc 100644 --- a/src/main/ipc/pty-controller-process-inventory.test.ts +++ b/src/main/ipc/pty-controller-process-inventory.test.ts @@ -47,7 +47,16 @@ vi.mock('node-pty', () => ({ })) vi.mock('../opencode/hook-service', () => ({ - openCodeHookService: { buildPtyEnv: () => ({}), clearPty: vi.fn() } + openCodeHookService: { + buildPtyEnv: () => ({}), + refreshLegacySharedPlugin: vi.fn(), + clearPty: vi.fn() + }, + openCode2HookService: { + buildPtyEnv: () => ({}), + refreshLegacySharedPlugin: vi.fn(), + clearPty: vi.fn() + } })) vi.mock('../pi/titlebar-extension-service', () => ({ diff --git a/src/main/ipc/pty-ipc-mock-registry.ts b/src/main/ipc/pty-ipc-mock-registry.ts index 71b77621b755..f49978843d56 100644 --- a/src/main/ipc/pty-ipc-mock-registry.ts +++ b/src/main/ipc/pty-ipc-mock-registry.ts @@ -108,12 +108,14 @@ export const childProcessModuleMock = (original: Record) => ({ export const openCodeHookServiceModuleMock = () => ({ openCodeHookService: { buildPtyEnv: openCodeBuildPtyEnvMock, + refreshLegacySharedPlugin: vi.fn<() => void>(), clearPty: openCodeClearPtyMock }, // Separate mock per variant: assembly.ts picks the service by variant, and a shared // mock would hide a regression that hands an OpenCode 2 pane the v1 plugin. openCode2HookService: { buildPtyEnv: openCode2BuildPtyEnvMock, + refreshLegacySharedPlugin: vi.fn<() => void>(), clearPty: openCodeClearPtyMock } }) diff --git a/src/main/ipc/pty/host-env/assembly.ts b/src/main/ipc/pty/host-env/assembly.ts index b6690b1cb83e..de61800c7eff 100644 --- a/src/main/ipc/pty/host-env/assembly.ts +++ b/src/main/ipc/pty/host-env/assembly.ts @@ -6,6 +6,10 @@ import { } from '../../../../shared/pi-agent-kind' import { applyTerminalGitCredentialPromptGuard } from '../../terminal-git-credential-guard' import { openCode2HookService, openCodeHookService } from '../../../opencode/hook-service' +import { + OPENCODE_CONFIG_DIR_ENV_KEYS, + isOpenCodeLegacySharedConfigDir +} from '../../../opencode/legacy-shared-config-dir' import { mimoCodeHookService } from '../../../mimo/hook-service' import { agentHookServer } from '../../../agent-hooks/server' import { wslHookRelayManager } from '../../../agent-hooks/wsl-hook-relay-manager' @@ -45,8 +49,25 @@ export function buildPtyHostEnv( mergePersistedWindowsPath(baseEnv) Object.assign(baseEnv, buildConfiguredProxyEnv(opts.networkProxySettings)) - // Why: local path's baseEnv includes process.env but the daemon path doesn't (fork inheritance, not IPC); check both sources so guards stay in lock-step across spawn paths. - const preexistingOpenCodeConfigDir = resolveOpenCodeSourceConfigDir(baseEnv) + // Why: pre-1.4.209 panes exported Orca's retired shared hooks dir; inheriting it hides the user's global OpenCode config. + const isLegacyOpenCodeHooksDir = (dir: string | undefined): boolean => + isOpenCodeLegacySharedConfigDir(dir, opts.userDataPath) + const inheritedOpenCodeEnv: NodeJS.ProcessEnv = {} + for (const key of OPENCODE_CONFIG_DIR_ENV_KEYS) { + if (isLegacyOpenCodeHooksDir(baseEnv[key])) { + delete baseEnv[key] + } + if (!isLegacyOpenCodeHooksDir(process.env[key])) { + inheritedOpenCodeEnv[key] = process.env[key] + } + } + // A daemon or sibling shell can retain a retired path that main no longer sees. + openCodeHookService.refreshLegacySharedPlugin() + openCode2HookService.refreshLegacySharedPlugin() + const resolvedOpenCodeConfigDir = resolveOpenCodeSourceConfigDir(baseEnv, inheritedOpenCodeEnv) + const preexistingOpenCodeConfigDir = isLegacyOpenCodeHooksDir(resolvedOpenCodeConfigDir) + ? undefined + : resolvedOpenCodeConfigDir const launchCommandHint = resolveSetupAgentSequenceLaunchCommand(baseEnv, opts.launchCommand) const openCodeAgent = selectOpenCodeHookAgent( opts.launchAgent, @@ -87,12 +108,16 @@ export function buildPtyHostEnv( ? resolvePiAgentSourceDir(baseEnv, 'prime-agent') : resolveScopedPiAgentSourceDir(baseEnv, 'prime-agent') - restoreOrStripOverlayEnv(baseEnv, { - primary: 'OPENCODE_CONFIG_DIR', - overlay: 'ORCA_OPENCODE_CONFIG_DIR', - source: 'ORCA_OPENCODE_SOURCE_CONFIG_DIR', - preserveExplicitPrimary: true - }) + restoreOrStripOverlayEnv( + baseEnv, + { + primary: 'OPENCODE_CONFIG_DIR', + overlay: 'ORCA_OPENCODE_CONFIG_DIR', + source: 'ORCA_OPENCODE_SOURCE_CONFIG_DIR', + preserveExplicitPrimary: true + }, + inheritedOpenCodeEnv + ) delete baseEnv.ORCA_OPENCODE_AGENT if (openCodeAgent) { // Why: OPENCODE_CONFIG_DIR is a single path, not a colon-list; mirror the user's value into an overlay so their plugins and Orca's status plugin coexist. See docs/opencode-config-dir-collision.md. diff --git a/src/main/ipc/pty/host-env/opencode-hook-installation.test.ts b/src/main/ipc/pty/host-env/opencode-hook-installation.test.ts index eb6b1faacd77..8a9114eb9427 100644 --- a/src/main/ipc/pty/host-env/opencode-hook-installation.test.ts +++ b/src/main/ipc/pty/host-env/opencode-hook-installation.test.ts @@ -365,3 +365,131 @@ it.each([true, false])( expect(existsSync(config)).toBe(false) } ) + +// Why: pre-1.4.209 panes exported Orca's retired /opencode-hooks/shared dir. OpenCode 2 +// treats OPENCODE_CONFIG_DIR as the only config dir, so inheriting it loaded a stale plugin and hid +// the user's global config. +describe.each([ + { name: 'marked', marked: true }, + { name: 'unmarked', marked: false } +])('inherited retired shared hooks dir ($name)', ({ marked }) => { + it.each([ + { agent: 'opencode', hooksDir: 'opencode-hooks' }, + { agent: 'opencode', hooksDir: 'opencode2-hooks' }, + { agent: 'opencode2', hooksDir: 'opencode-hooks' }, + { agent: 'opencode2', hooksDir: 'opencode2-hooks' } + ] as const)('drops $hooksDir for $agent panes', ({ agent, hooksDir }) => { + const legacy = join(fixture.userData, hooksDir, 'shared') + mkdirSync(join(legacy, 'plugins'), { recursive: true }) + const env = buildPtyHostEnv( + 'pane', + marked + ? { OPENCODE_CONFIG_DIR: legacy, ORCA_OPENCODE_CONFIG_DIR: legacy } + : { OPENCODE_CONFIG_DIR: legacy }, + { ...options, launchAgent: agent } + ) + expect(env.OPENCODE_CONFIG_DIR).toBeUndefined() + expect(env.ORCA_OPENCODE_CONFIG_DIR).toBeUndefined() + expect(env.ORCA_OPENCODE_SOURCE_CONFIG_DIR).toBeUndefined() + expect(existsSync(plugin(config, agent))).toBe(true) + expect(existsSync(join(fixture.userData, `${agent}-config-overlays`))).toBe(false) + }) +}) + +it('keeps a user config dir that merely sits beside the retired hooks dir', () => { + const neighbour = join(fixture.userData, 'opencode-hooks', 'mine') + mkdirSync(neighbour, { recursive: true }) + const env = buildPtyHostEnv('pane', { OPENCODE_CONFIG_DIR: neighbour }, options) + expect(env.ORCA_OPENCODE_SOURCE_CONFIG_DIR).toBe(neighbour) + expect(env.OPENCODE_CONFIG_DIR).not.toBeUndefined() +}) + +it.each(['explicit', 'inherited'])('refreshes the %s stale plugin with hooks off', (source) => { + const legacy = join(fixture.userData, 'opencode-hooks', 'shared') + const stalePlugin = join(legacy, 'plugins', 'orca-opencode-status.js') + mkdirSync(join(legacy, 'plugins'), { recursive: true }) + writeFileSync(stalePlugin, 'export default { id: "orca-opencode-status", server() {} }\n') + if (source === 'inherited') { + vi.stubEnv('OPENCODE_CONFIG_DIR', legacy) + } + const env = buildPtyHostEnv( + 'pane', + source === 'explicit' ? { OPENCODE_CONFIG_DIR: legacy } : {}, + { ...options, agentStatusHooksEnabled: false } + ) + expect(env.OPENCODE_CONFIG_DIR).toBeUndefined() + expect(readFileSync(stalePlugin, 'utf8')).toContain('setup') +}) + +it.each([true, false])('strips daemon-inherited retired paths (known to main: %s)', (known) => { + const legacy = join(fixture.userData, 'opencode-hooks', 'shared') + if (known) { + vi.stubEnv('OPENCODE_CONFIG_DIR', legacy) + } + const env = buildPtyHostEnv('pane', {}, { ...options, agentStatusHooksEnabled: false }) + vi.stubEnv('ORCA_USER_DATA_PATH', fixture.userData) + vi.stubEnv('OPENCODE_CONFIG_DIR', legacy) + const request = { sessionId: 'pane', cols: 80, rows: 24, cwd: root, env } + const result = createDaemonPtyEnvironment(request) + expect(result.OPENCODE_CONFIG_DIR).toBeUndefined() + result.OPENCODE_CONFIG_DIR = legacy + rescrubDaemonPtyEnvironment(result, request) + expect(result.OPENCODE_CONFIG_DIR).toBeUndefined() +}) + +it('preserves explicit user config over a retired daemon-inherited path', () => { + vi.stubEnv('ORCA_USER_DATA_PATH', fixture.userData) + vi.stubEnv('OPENCODE_CONFIG_DIR', join(fixture.userData, 'opencode-hooks', 'shared')) + const env = { OPENCODE_CONFIG_DIR: custom } + const result = createDaemonPtyEnvironment({ + sessionId: 'pane', + cols: 80, + rows: 24, + cwd: root, + env + }) + expect(result.OPENCODE_CONFIG_DIR).toBe(custom) +}) + +it('does not restore a retired source from process.env with hooks disabled', () => { + vi.stubEnv('ORCA_OPENCODE_SOURCE_CONFIG_DIR', join(fixture.userData, 'opencode-hooks', 'shared')) + const env = buildPtyHostEnv('pane', {}, { ...options, agentStatusHooksEnabled: false }) + expect(env.OPENCODE_CONFIG_DIR).toBeUndefined() +}) + +it.each([true, false])( + 'preserves explicit config with a retired parent source (hooks: %s)', + (enabled) => { + vi.stubEnv( + 'ORCA_OPENCODE_SOURCE_CONFIG_DIR', + join(fixture.userData, 'opencode-hooks', 'shared') + ) + const env = buildPtyHostEnv( + 'pane', + { OPENCODE_CONFIG_DIR: custom }, + { ...options, agentStatusHooksEnabled: enabled } + ) + if (enabled) { + expect(env.ORCA_OPENCODE_SOURCE_CONFIG_DIR).toBe(custom) + expect(readFileSync(join(env.OPENCODE_CONFIG_DIR, 'opencode.json'), 'utf8')).toBe( + '{"model":"fixture"}' + ) + } else { + expect(env.OPENCODE_CONFIG_DIR).toBe(custom) + } + } +) + +it('repairs both legacy variants without main inheriting any retired path or enabling hooks', () => { + for (const agent of ['opencode', 'opencode2']) { + const path = plugin(join(fixture.userData, `${agent}-hooks`, 'shared'), agent) + mkdirSync(join(path, '..'), { recursive: true }) + writeFileSync(path, '// old plugin') + } + buildPtyHostEnv('pane', {}, { ...options, agentStatusHooksEnabled: false }) + for (const agent of ['opencode', 'opencode2']) { + expect( + readFileSync(plugin(join(fixture.userData, `${agent}-hooks`, 'shared'), agent), 'utf8') + ).toContain('setup') + } +}) diff --git a/src/main/ipc/pty/host-env/pi-agent.ts b/src/main/ipc/pty/host-env/pi-agent.ts index 3c33c499c89a..05258f0bdc6c 100644 --- a/src/main/ipc/pty/host-env/pi-agent.ts +++ b/src/main/ipc/pty/host-env/pi-agent.ts @@ -170,15 +170,16 @@ export function resolveMimocodeSourceHome(baseEnv: Record): stri } export function resolveOpenCodeSourceConfigDir( - baseEnv: Record + baseEnv: Record, + inheritedEnv: NodeJS.ProcessEnv = process.env ): string | undefined { - const configDir = baseEnv.OPENCODE_CONFIG_DIR ?? process.env.OPENCODE_CONFIG_DIR - const orcaConfigDir = baseEnv.ORCA_OPENCODE_CONFIG_DIR ?? process.env.ORCA_OPENCODE_CONFIG_DIR + const configDir = baseEnv.OPENCODE_CONFIG_DIR ?? inheritedEnv.OPENCODE_CONFIG_DIR + const orcaConfigDir = baseEnv.ORCA_OPENCODE_CONFIG_DIR ?? inheritedEnv.ORCA_OPENCODE_CONFIG_DIR if (configDir && orcaConfigDir && configDir !== orcaConfigDir) { return configDir } const sourceDir = - baseEnv.ORCA_OPENCODE_SOURCE_CONFIG_DIR ?? process.env.ORCA_OPENCODE_SOURCE_CONFIG_DIR + baseEnv.ORCA_OPENCODE_SOURCE_CONFIG_DIR ?? inheritedEnv.ORCA_OPENCODE_SOURCE_CONFIG_DIR if (sourceDir) { return sourceDir } diff --git a/src/main/ipc/pty/ipc/spawn-options.ts b/src/main/ipc/pty/ipc/spawn-options.ts index a2adf48771b6..42d2aedf0084 100644 --- a/src/main/ipc/pty/ipc/spawn-options.ts +++ b/src/main/ipc/pty/ipc/spawn-options.ts @@ -1,3 +1,5 @@ +import { getAppEnvironment } from '../../../../shared/app-environment' +import { getLegacyOpenCodeEnvKeysToDelete } from '../../../opencode/legacy-shared-config-dir' import { isTuiAgent } from '../../../../shared/tui-agent-config' import { CLAUDE_AUTH_ENV_VARS } from '../../../claude-accounts/environment' import { LEGACY_TERMINAL_SHIM_REMOTE_ENV_KEYS } from '../../../pty/legacy-terminal-shim-dir' @@ -43,6 +45,10 @@ export async function buildPtyIpcSpawnOptions( // Why: disable old hosts without removing ORCA_REAL_* while their Windows shim remains on PATH. ctx.isDaemonHostSpawn || args.connectionId ? LEGACY_TERMINAL_SHIM_REMOTE_ENV_KEYS : [], ctx.isDaemonHostSpawn ? getInheritedAgentHookEnvKeysToDelete(ctx.spawnEnv) : [], + // The daemon must judge its own inherited value; main may have a different config. + !args.connectionId && !ctx.isDaemonHostSpawn + ? getLegacyOpenCodeEnvKeysToDelete(ctx.spawnEnv, getAppEnvironment().getPath('userData')) + : [], getInheritedClaudeSessionStampEnvKeysToDelete(ctx.spawnEnv), ctx.skipCodexHomeEnv ? CODEX_HOME_ENV_KEYS : [], // Why: the persistent daemon compares its own merged CODEX_HOME pair; diff --git a/src/main/ipc/pty/opencode-legacy-spawn-deletions.test.ts b/src/main/ipc/pty/opencode-legacy-spawn-deletions.test.ts new file mode 100644 index 000000000000..1c7203ab0467 --- /dev/null +++ b/src/main/ipc/pty/opencode-legacy-spawn-deletions.test.ts @@ -0,0 +1,64 @@ +import { afterEach, describe, expect, it, vi } from 'vitest' +import { join } from 'node:path' +import { createDaemonPtyEnvironment } from '../../daemon/pty-subprocess/spawn-environment' +import { getAppEnvironment } from '../../../shared/app-environment' +import { buildPtyIpcSpawnOptions } from './ipc/spawn-options' +import { createPtyIpcSpawnState } from './ipc/spawn-state' +import type { PtySpawnIpcDeps } from './ipc/spawn-types' +import { buildRuntimePtySpawnOptions } from './runtime/spawn-options' +import { createRuntimePtySpawnState } from './runtime/spawn-state' +import type { PtyRuntimeControllerDeps } from './runtime/controller-deps' + +afterEach(() => vi.unstubAllEnvs()) + +describe.each(['renderer', 'runtime'])('%s retired OpenCode environment deletion', (route) => { + it.each([ + { connectionId: undefined, daemon: false, explicit: undefined, deleted: true }, + { connectionId: undefined, daemon: true, explicit: undefined, deleted: false }, + { connectionId: undefined, daemon: true, explicit: '/user/config', deleted: false }, + { connectionId: 'ssh-host', daemon: false, explicit: undefined, deleted: false } + ])( + 'respects explicit=$explicit, daemon=$daemon, and connection=$connectionId', + async ({ connectionId, daemon, explicit, deleted }) => { + const legacy = join(getAppEnvironment().getPath('userData'), 'opencode-hooks', 'shared') + vi.stubEnv('OPENCODE_CONFIG_DIR', legacy) + const args = { cols: 80, rows: 24, connectionId } + const env: Record = explicit ? { OPENCODE_CONFIG_DIR: explicit } : {} + let deletions: string[] | undefined + if (route === 'renderer') { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: this option-only path reads no required dependency methods with no worktree or hidden pane. + const ctx = createPtyIpcSpawnState({} as PtySpawnIpcDeps, args) + ctx.env = env + ctx.isDaemonHostSpawn = daemon + await buildPtyIpcSpawnOptions(ctx) + deletions = ctx.spawnOptions.envToDelete + ctx.finishTerminalInstall() + } else { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: this option-only path reads no required dependency methods with no worktree or hidden pane. + const ctx = createRuntimePtySpawnState({} as PtyRuntimeControllerDeps, args) + ctx.env = env + ctx.isDaemonHostSpawn = daemon + await buildRuntimePtySpawnOptions(ctx) + deletions = ctx.spawnOptions.envToDelete + ctx.finishTerminalInstall() + } + expect(deletions?.includes('OPENCODE_CONFIG_DIR') ?? false).toBe(deleted) + expect(env.OPENCODE_CONFIG_DIR).toBe(explicit) + if (daemon) { + vi.stubEnv('ORCA_USER_DATA_PATH', getAppEnvironment().getPath('userData')) + for (const inherited of [legacy, '/daemon/user-config']) { + vi.stubEnv('OPENCODE_CONFIG_DIR', inherited) + const request = { sessionId: 'pane', cols: 80, rows: 24, env, envToDelete: deletions } + const result = createDaemonPtyEnvironment(request) + expect(result.OPENCODE_CONFIG_DIR).toBe( + explicit ?? (inherited === legacy ? undefined : inherited) + ) + expect( + createDaemonPtyEnvironment({ ...request, envToDelete: ['OPENCODE_CONFIG_DIR'] }) + .OPENCODE_CONFIG_DIR + ).toBeUndefined() + } + } + } + ) +}) diff --git a/src/main/ipc/pty/runtime/spawn-options.ts b/src/main/ipc/pty/runtime/spawn-options.ts index 67c633560e97..c544b9ac7c90 100644 --- a/src/main/ipc/pty/runtime/spawn-options.ts +++ b/src/main/ipc/pty/runtime/spawn-options.ts @@ -1,3 +1,5 @@ +import { getAppEnvironment } from '../../../../shared/app-environment' +import { getLegacyOpenCodeEnvKeysToDelete } from '../../../opencode/legacy-shared-config-dir' import type { IPtyProvider, PtySpawnResult } from '../../../providers/types' import { LocalPtyProvider } from '../../../providers/local-pty-provider' import { makePaneKey, isTerminalLeafId } from '../../../../shared/stable-pane-id' @@ -72,6 +74,10 @@ export async function buildRuntimePtySpawnOptions( // Why: disable old hosts without removing ORCA_REAL_* while their Windows shim remains on PATH. ctx.isDaemonHostSpawn || args.connectionId ? LEGACY_TERMINAL_SHIM_REMOTE_ENV_KEYS : [], ctx.isDaemonHostSpawn ? getInheritedAgentHookEnvKeysToDelete(ctx.env) : [], + // The daemon must judge its own inherited value; main may have a different config. + !args.connectionId && !ctx.isDaemonHostSpawn + ? getLegacyOpenCodeEnvKeysToDelete(ctx.env, getAppEnvironment().getPath('userData')) + : [], // Why: ungated, unlike the agent-hook keys — the local provider and the relay host also spread their own process.env into every spawn. getInheritedClaudeSessionStampEnvKeysToDelete(ctx.env) ) diff --git a/src/main/opencode/hook-service.test.ts b/src/main/opencode/hook-service.test.ts index 9b0db3b0621a..66fb3c86a47d 100644 --- a/src/main/opencode/hook-service.test.ts +++ b/src/main/opencode/hook-service.test.ts @@ -1,13 +1,17 @@ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest' import { existsSync, + openSync, + closeSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, + statSync, symlinkSync, + utimesSync, writeFileSync } from 'node:fs' import { createHash } from 'node:crypto' @@ -313,6 +317,93 @@ describe('OpenCodeHookService buildPtyEnv / clearPty round-trip', () => { expect(module.default?.setup).toBeTypeOf('function') }) + // Why: pre-1.4.209 Orca wrote a server()-only plugin into /opencode-hooks/shared and + // stopped maintaining it; shells and OpenCode 2 background services still pointing there got + // "Plugin must export a default definition with an id and an effect or setup function." + it('refreshes a stale plugin left in the retired shared hooks dir', async () => { + const legacyPluginPath = join( + userDataDir, + 'opencode-hooks', + 'shared', + 'plugins', + 'orca-opencode-status.js' + ) + mkdirSync(join(legacyPluginPath, '..'), { recursive: true }) + writeFileSync( + legacyPluginPath, + 'export default { id: "orca-opencode-status", server: async () => ({}) };\n' + ) + + new OpenCodeHookService().buildPtyEnv(daemonSessionId) + + const modulePath = join(userDataDir, `legacy-opencode-plugin-${Date.now()}.mjs`) + writeFileSync(modulePath, readFileSync(legacyPluginPath, 'utf8')) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the assertions below validate the shape this names. + const module = (await import(pathToFileURL(modulePath).href)) as { + default?: { id?: unknown; server?: unknown; setup?: unknown } + } + expect(module.default?.id).toBe('orca-opencode-status') + expect(module.default?.server).toBeTypeOf('function') + expect(module.default?.setup).toBeTypeOf('function') + }) + + it('repairs late and overwritten legacy plugins atomically on the same service', () => { + const service = new OpenCodeHookService() + service.refreshLegacySharedPlugin() + const path = join(userDataDir, 'opencode-hooks', 'shared', 'plugins', 'orca-opencode-status.js') + mkdirSync(join(path, '..'), { recursive: true }) + for (const stale of ['// late old install', '// old process overwrote repair']) { + writeFileSync(path, stale) + const reader = openSync(path, 'r') + try { + service.refreshLegacySharedPlugin() + expect(readFileSync(path, 'utf8')).toBe(getOpenCodePluginSource()) + expect(readFileSync(reader, 'utf8')).toBe(stale) + expect(readdirSync(join(path, '..'))).toEqual(['orca-opencode-status.js']) + } finally { + closeSync(reader) + } + } + }) + + it('reports repair failures and retries after the obstruction is removed', () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const path = join(userDataDir, 'opencode-hooks', 'shared', 'plugins', 'orca-opencode-status.js') + const service = new OpenCodeHookService() + try { + service.refreshLegacySharedPlugin() + expect(warn).not.toHaveBeenCalled() + mkdirSync(path, { recursive: true }) + service.refreshLegacySharedPlugin() + expect(warn).toHaveBeenCalledWith( + '[OpenCode] Failed to repair legacy status plugin:', + path, + expect.any(Error) + ) + rmSync(path, { recursive: true }) + writeFileSync(path, '// stale') + service.refreshLegacySharedPlugin() + expect(readFileSync(path, 'utf8')).toBe(getOpenCodePluginSource()) + } finally { + warn.mockRestore() + } + }) + + 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) + // Why: a running OpenCode 2 service re-runs its plugin load on every write to a watched plugin file. + expect(statSync(legacyPluginPath).mtimeMs).toBe(past.getTime()) + }) + // Why: #22506 — both variants install side by side in one global plugins dir, and // OpenCode 2 kills every plugin after the first that reuses an id ("Duplicate plugin // ID"). Discovery sorts by path, so orca-opencode-status.js always wins and the diff --git a/src/main/opencode/hook-service.ts b/src/main/opencode/hook-service.ts index f46667ed1b87..e7ec0cc8b2ff 100644 --- a/src/main/opencode/hook-service.ts +++ b/src/main/opencode/hook-service.ts @@ -1,3 +1,4 @@ +import { writeFileAtomically } from '../codex-accounts/fs-utils' import { getAppEnvironment } from '../../shared/app-environment' import { join } from 'node:path' import { @@ -22,11 +23,14 @@ import { getStatusPluginOwnershipSource } from './status-plugin-ownership-source import { getStatusPluginLifecycleSource } from './status-plugin-lifecycle-source' import { getStatusPluginFactorySource } from './status-plugin-factory-source' import { resolveOpenCodeConfigDirectory } from '../../shared/opencode-config-directory' +import { + getOpenCodeLegacySharedConfigDir, + OPENCODE2_LEGACY_HOOKS_DIR, + OPENCODE_LEGACY_HOOKS_DIR +} from './legacy-shared-config-dir' const ORCA_OPENCODE_PLUGIN_FILE = 'orca-opencode-status.js' -const OPENCODE_LEGACY_HOOKS_DIR = 'opencode-hooks' const OPENCODE_OVERLAY_DIR = 'opencode-config-overlays' -const OPENCODE_SHARED_CONFIG_DIR = 'shared' const OPENCODE_OVERLAY_MANIFEST_FILE = '.orca-opencode-overlay-manifest.json' type OpenCodeOverlayManifest = { @@ -127,6 +131,7 @@ export class OpenCodeHookService { return existingConfigDir ? { OPENCODE_CONFIG_DIR: existingConfigDir } : {} } + this.refreshLegacySharedPlugin() const managedConfigDir = this.getSharedConfigDir() if (!existingConfigDir || existingConfigDir === managedConfigDir) { try { @@ -150,6 +155,23 @@ export class OpenCodeHookService { } } + // Why: pre-1.4.209 Orca left a server()-only plugin here that OpenCode 2 rejects. Only helps + // processes that load it later; a running OpenCode 2 service keeps its cached module until restarted. + refreshLegacySharedPlugin(): void { + const pluginPath = join(this.getSharedConfigDir(), 'plugins', this.pluginFileName) + try { + const source = this.pluginSource() + if (readFileSync(pluginPath, 'utf8') !== source) { + writeFileAtomically(pluginPath, source) + } + } catch (error) { + if (error instanceof Error && 'code' in error && error.code === 'ENOENT') { + return + } + console.warn('[OpenCode] Failed to repair legacy status plugin:', pluginPath, error) + } + } + private getOverlayRoot(): string { return join(getAppEnvironment().getPath('userData'), this.overlayDir) } @@ -159,10 +181,9 @@ export class OpenCodeHookService { } private getSharedConfigDir(): string { - return join( + return getOpenCodeLegacySharedConfigDir( getAppEnvironment().getPath('userData'), - this.legacyHooksDir, - OPENCODE_SHARED_CONFIG_DIR + this.legacyHooksDir ) } @@ -275,7 +296,7 @@ export class OpenCodeHookService { export const openCodeHookService = new OpenCodeHookService() export const openCode2HookService = new OpenCodeHookService({ pluginFileName: 'orca-opencode2-status.js', - legacyHooksDir: 'opencode2-hooks', + legacyHooksDir: OPENCODE2_LEGACY_HOOKS_DIR, overlayDir: 'opencode2-config-overlays', pluginSource: getOpenCode2PluginSource }) diff --git a/src/main/opencode/legacy-shared-config-dir.test.ts b/src/main/opencode/legacy-shared-config-dir.test.ts new file mode 100644 index 000000000000..f4a20713e8b4 --- /dev/null +++ b/src/main/opencode/legacy-shared-config-dir.test.ts @@ -0,0 +1,38 @@ +import { describe, expect, it } from 'vitest' +import { join } from 'node:path' +import { isOpenCodeLegacySharedConfigDir } from './legacy-shared-config-dir' + +describe('retired config directory recognition', () => { + const root = join(process.cwd(), 'user-data') + it.each(['opencode-hooks', 'opencode2-hooks'])('normalizes %s paths', (hooks) => { + const path = join(root, hooks, 'shared') + expect(isOpenCodeLegacySharedConfigDir(`${path}/`, root)).toBe(true) + expect(isOpenCodeLegacySharedConfigDir(`${path}/../shared`, root)).toBe(true) + expect(isOpenCodeLegacySharedConfigDir(`${path}/../mine`, root)).toBe(false) + expect(isOpenCodeLegacySharedConfigDir(`${path}-custom`, root)).toBe(false) + expect(isOpenCodeLegacySharedConfigDir(undefined, root)).toBe(false) + }) + it.skipIf(process.platform !== 'win32')('handles Windows casing and separators', () => { + expect(isOpenCodeLegacySharedConfigDir('C:/ORCA/opencode-hooks/shared/', 'c:\\orca')).toBe(true) + }) +}) + +describe('isOpenCodeLegacySharedConfigDir', () => { + const userData = join('fixture', 'user-data') + + it('matches only the retired shared dirs of both OpenCode variants', () => { + expect( + isOpenCodeLegacySharedConfigDir(join(userData, 'opencode-hooks', 'shared'), userData) + ).toBe(true) + expect( + isOpenCodeLegacySharedConfigDir(join(userData, 'opencode2-hooks', 'shared'), userData) + ).toBe(true) + expect( + isOpenCodeLegacySharedConfigDir(join(userData, 'opencode-hooks', 'mine'), userData) + ).toBe(false) + expect( + isOpenCodeLegacySharedConfigDir(join('other', 'opencode-hooks', 'shared'), userData) + ).toBe(false) + expect(isOpenCodeLegacySharedConfigDir(undefined, userData)).toBe(false) + }) +}) diff --git a/src/main/opencode/legacy-shared-config-dir.ts b/src/main/opencode/legacy-shared-config-dir.ts new file mode 100644 index 000000000000..8b0c2b842e45 --- /dev/null +++ b/src/main/opencode/legacy-shared-config-dir.ts @@ -0,0 +1,48 @@ +import { join, resolve } from 'node:path' + +export const OPENCODE_LEGACY_HOOKS_DIR = 'opencode-hooks' +export const OPENCODE2_LEGACY_HOOKS_DIR = 'opencode2-hooks' + +// Why: before 1.4.209 Orca pointed OPENCODE_CONFIG_DIR at this dir; shells and OpenCode 2 background services from then can still load it. +export function getOpenCodeLegacySharedConfigDir( + userDataPath: string, + legacyHooksDir: string +): string { + return join(userDataPath, legacyHooksDir, 'shared') +} + +export function isOpenCodeLegacySharedConfigDir( + configDir: string | undefined, + userDataPath: string +): boolean { + return ( + configDir !== undefined && + [OPENCODE_LEGACY_HOOKS_DIR, OPENCODE2_LEGACY_HOOKS_DIR].some( + (hooksDir) => + normalizeConfigPath(configDir) === + normalizeConfigPath(getOpenCodeLegacySharedConfigDir(userDataPath, hooksDir)) + ) + ) +} + +function normalizeConfigPath(path: string): string { + const resolved = resolve(path) + return process.platform === 'win32' ? resolved.toLowerCase() : resolved +} + +export const OPENCODE_CONFIG_DIR_ENV_KEYS = [ + 'OPENCODE_CONFIG_DIR', + 'ORCA_OPENCODE_CONFIG_DIR', + 'ORCA_OPENCODE_SOURCE_CONFIG_DIR' +] as const + +/** Carries retired inherited paths through providers that merge their environment later. */ +export function getLegacyOpenCodeEnvKeysToDelete( + env: Record | undefined, + userDataPath: string, + inherited: Record = process.env +): string[] { + return OPENCODE_CONFIG_DIR_ENV_KEYS.filter((key) => + isOpenCodeLegacySharedConfigDir(env?.[key] ?? inherited[key], userDataPath) + ) +} diff --git a/src/main/providers/provider-dispatch.test.ts b/src/main/providers/provider-dispatch.test.ts index c6f00c98354a..c74358b89b0e 100644 --- a/src/main/providers/provider-dispatch.test.ts +++ b/src/main/providers/provider-dispatch.test.ts @@ -49,7 +49,16 @@ vi.mock('node-pty', () => ({ })) vi.mock('../opencode/hook-service', () => ({ - openCodeHookService: { buildPtyEnv: () => ({}), clearPty: vi.fn() } + openCodeHookService: { + buildPtyEnv: () => ({}), + refreshLegacySharedPlugin: vi.fn(), + clearPty: vi.fn() + }, + openCode2HookService: { + buildPtyEnv: () => ({}), + refreshLegacySharedPlugin: vi.fn(), + clearPty: vi.fn() + } })) vi.mock('../pi/titlebar-extension-service', () => ({ From 153d3fd3fafe9a5b85f2dc490cd6dfff3aacfc76 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:56:48 -0700 Subject: [PATCH 31/90] feat(native-chat): Codex sessions write their subagents into the host status store (#22553) * refactor(native-chat): the Codex acquire names its turn-boundary methods as a set Behavior-neutral: the same two methods stamp receipt time. Keeps the file under the size limit once the child-work sink lands. * feat(native-chat): Codex sessions write their subagents into the host status store A Codex child thread and each persistent command become host child records, fed through the same delivery, ingest and reducer the Claude lane uses. The child's own turn decides it: turn start is live, turn completion settles it with the outcome Codex reports, and a follow-up turn reopens the same record as a new run. Its open tool call, last message, usage and waiting-on-user flag come from its own thread's frames. A parent turn ending settles nothing. * fix(native-chat): close a Codex child's tool call by its item id alone A completion frame need not restate the tool it ran, so reading the tool name before closing left the call open and the record naming a finished tool. * test(native-chat): pin the Codex child-work evidence and every hop to the host's records Child turn start/end/follow-up, open tool call, last message, usage, waiting, the persistent command a child owns and its monitoring display, a primary turn end settling nothing, and session end. End to end through the real adapter: evidence after the journal and the legacy republish, and the parent state the records imply equals today's at every frame of a scripted session. Through the production runtime: a Codex session's child work reaches the status sink under its own address, and a provider exit ends it there. * test(native-chat): a Codex child's new run never inherits the last run's open call * test(native-chat): a Codex session with no child-work sink holds no evidence * test(native-chat): deliver a Codex child's announcement twice, as Codex does, before counting edges * refactor(native-chat): hand the Codex producer's pending edge over directly * fix(native-chat): name every Codex turn state in the outcome map; type the runtime test's fake opener * fix(native-chat): a Codex child's turn ends on the error that ends it, or on its thread closing Codex can end a child's turn with no turn/completed: an error it will not retry is that turn's own end (the verdict the transcript already settles the same turn on), and a closed thread ran its last turn. The executions, the one owner of child turn state, now end the turn on both, so the strip drops the child and its record settles (failed, or unknown for a close) together, instead of reading working for the life of the session. A systemError status is not an ending: Codex raises it for errors that leave the turn running. A child fact whose frame names no turn now belongs to the turn the child is running, instead of counting for every run. * test(native-chat): a Codex child's turn ending by fatal error or thread close settles strip and record together * test(native-chat): the Codex parity script reads a waiting child through the shared fold's waiting arm * test(native-chat): a Codex child row's journal attempt is its record's generation The journal numbers a Codex child's runs by the turns it observed on the child's thread; the host record numbers them by the runs its evidence opened. Both are keyed by the child's own turn id, so they must agree run for run, including when Codex reports the child's first turn before the spawn that announces it. * test(native-chat): a Codex session's end settles its live children and keeps the ended ones The host no longer erases a session's children when its provider goes away: a child still running settles with an outcome nobody reported, and a child that had already ended keeps what it said. The producer tests now expect exactly that, from the close path and from an unexpected exit. * fix(native-chat): a Codex subagent's shell is its open tool until the process exits Codex runs every agent shell through unified exec, so every subagent shell arrives with the source the persistent-command tracker keys on. The producer skipped those items, so a working subagent never named its shell, and an approved command (started on the approval path, completed from unified exec) stayed its open tool until the turn ended. The tracker still records the process separately, so a command that outlives the turn reads as monitoring. * fix(native-chat): a Codex shell becomes a subagent's own work only once it outlives its turn Codex runs every agent shell through unified exec and never says when one is left running, so the producer turned every shell, even a millisecond `rg`, into a command record the moment it started. Each settled into the session's pool of 32 settled records, so a busy turn evicted a finished subagent's record (its outcome row would vanish) and listed dozens of finished shells beside it. A command now becomes a record at the first turn boundary of the thread that launched it while its process still runs: until then it is the agent's open call. A shell that exits within its turn never becomes a record. * refactor(native-chat): child records keep every settled child and can be removed outright Settled child records now stay until the host drops the session's row; the 32-record trim is gone. A producer can say work stopped with nothing to report, and its record (and the handles it answered to) goes instead of settling. Evidence stays host-internal: the producer and the store share one process. * fix(native-chat): a Codex command is live work from its start until its process stops The command tracker is now the one owner of a Codex command's lifetime. It admits every command whatever `source` Codex tags it with (the approval path starts one as `agent`), and ends it when its process exits, when its thread closes (Codex stops the processes first, so no exit ever arrives), or when the session ends. The producer mirrors that one-to-one: a live record from the start, removed when the command stops, never settled. This removes the turn-boundary rule: a command that was only recorded at its turn's end left the parent reading done for one publish when the main agent's turn ended with a shell still running. The parity script now checks the parent at every journal write, not only at frame end. * fix(native-chat): a Codex command whose approval its turn abandoned never ran Codex starts an approval's command item before it asks, and when the turn ends with the question unanswered (the user stops at the approval), it drops the question and never completes the item. The command tracker admitted that start as a running process, so the strip kept a phantom command row and the session row read working until the session ended. The prompt registry, which owns which approvals are still unanswered, reports the command approvals a turn ended without; the tracker ends those commands with the frame that ended the turn. An answered approval keeps its command. * test(native-chat): start the Codex child-work runtime test without the removed hold Main no longer has host.hold: creating the session starts its child, and nothing a viewer does keeps it running. The test attaches and asserts the one child that attach started, then drives it as before. --- .../codex/codex-background-command-tracker.ts | 81 ++- .../codex/codex-background-task-frames.ts | 40 +- .../codex/codex-background-task-tracker.ts | 82 ++- .../codex/codex-child-work-evidence.test.ts | 623 ++++++++++++++++++ src/main/codex/codex-child-work-evidence.ts | 312 +++++++++ .../codex/codex-child-work-translation.ts | 88 +++ .../codex-prompt-registry-retention.test.ts | 19 + src/main/codex/codex-prompt-registry.ts | 23 + ...dex-structured-child-work-producer.test.ts | 525 +++++++++++++++ .../codex/codex-structured-session-acquire.ts | 14 +- .../codex/codex-structured-session-adapter.ts | 4 +- .../codex/codex-structured-session-close.ts | 2 + .../codex/codex-structured-session-state.ts | 3 + .../codex/codex-structured-thread-facts.ts | 10 + src/main/codex/codex-subagent-executions.ts | 19 + .../structured-agent-session-runtime.ts | 2 + ...tructured-codex-child-work-runtime.test.ts | 133 ++++ src/shared/agent-status-child-work-alias.ts | 14 +- ...t-status-child-work-evidence-resolution.ts | 26 +- .../agent-status-child-work-evidence.ts | 18 +- ...t-status-child-work-reconciliation.test.ts | 38 +- .../agent-status-child-work-reconciliation.ts | 52 +- src/shared/agent-status-child-work-view.ts | 3 +- 23 files changed, 2025 insertions(+), 106 deletions(-) create mode 100644 src/main/codex/codex-child-work-evidence.test.ts create mode 100644 src/main/codex/codex-child-work-evidence.ts create mode 100644 src/main/codex/codex-child-work-translation.ts create mode 100644 src/main/codex/codex-structured-child-work-producer.test.ts create mode 100644 src/main/runtime/structured-codex-child-work-runtime.test.ts diff --git a/src/main/codex/codex-background-command-tracker.ts b/src/main/codex/codex-background-command-tracker.ts index 844134881ad6..922743f1a831 100644 --- a/src/main/codex/codex-background-command-tracker.ts +++ b/src/main/codex/codex-background-command-tracker.ts @@ -1,15 +1,20 @@ import type { AgentSessionBackgroundTask } from '../../shared/agent-session-wire' import type { CodexBackgroundTaskEvent } from './codex-background-task-frames' -import { codexCommandOutlivesTurn } from './codex-command-lifecycle' import { readRecord, readString } from './codex-item-field-readers' import { readCodexThreadItem } from './codex-structured-item-translation' import { MAX_CODEX_ITEM_STREAM_METADATA_BYTES } from './codex-item-stream-retention' +import type { CodexAbandonedCommand } from './codex-prompt-registry' const MAX_SETTLED_COMMANDS = 128 const MAX_DESCRIPTION_CHARS = 512 type Command = { threadId: string; task: AgentSessionBackgroundTask; bytes: number } +/** A command process starting, or ending: it exited, its thread closed, or the session ended. */ +export type CodexBackgroundCommandChange = + | { type: 'started'; threadId: string; task: AgentSessionBackgroundTask } + | { type: 'ended'; threadId: string; taskId: string } + /** The label's reserved share of the description. Reserved, not merely capped: * a label free to spend the whole budget clips away the command it qualifies, * leaving a command row naming an agent and no command — the failure this @@ -65,28 +70,17 @@ export class CodexBackgroundCommandTracker { ) } - observe(event: CodexBackgroundTaskEvent): void { + observe(event: CodexBackgroundTaskEvent): CodexBackgroundCommandChange | null { const parsed = this.parse(event) if (!parsed || this.settled.has(parsed.key)) { - return + return null } const { key, command, completed } = parsed - const existing = this.commands.get(key) if (completed) { - if (existing) { - this.liveBytes -= existing.bytes - this.commands.delete(key) - } - const bytes = Buffer.byteLength(key, 'utf8') + 256 - if (this.liveBytes + bytes <= this.maxMetadataBytes) { - this.settled.set(key, bytes) - this.settledBytes += bytes - } - this.trimSettled() - return + return this.end(key) } - if (existing) { - return + if (this.commands.has(key)) { + return null } if (this.liveBytes + command.bytes > this.maxMetadataBytes) { throw new Error('Codex command metadata was not admitted before observation') @@ -94,6 +88,19 @@ export class CodexBackgroundCommandTracker { this.commands.set(key, command) this.liveBytes += command.bytes this.trimSettled() + return { type: 'started', threadId: command.threadId, task: command.task } + } + + /** The thread closed: Codex stops its processes first, so none of them can report an exit. */ + endThread(threadId: string): CodexBackgroundCommandChange[] { + return [...this.commands] + .filter(([, command]) => command.threadId === threadId) + .flatMap(([key]) => this.end(key) ?? []) + } + + /** Its approval went unanswered until its turn ended, so its process never started. */ + endUnapproved(command: CodexAbandonedCommand): CodexBackgroundCommandChange | null { + return this.end(JSON.stringify([command.threadId, command.itemId])) } tasks( @@ -113,11 +120,45 @@ export class CodexBackgroundCommandTracker { }) } - clear(): void { + /** The live commands one thread launched, as the strip would publish them. */ + threadTasks(threadId: string): AgentSessionBackgroundTask[] { + return [...this.commands.values()] + .filter((command) => command.threadId === threadId) + .map((command) => command.task) + } + + /** The session ended, and every command with it. */ + clear(): CodexBackgroundCommandChange[] { + const ended = [...this.commands.values()].map( + ({ threadId, task }): CodexBackgroundCommandChange => ({ + type: 'ended', + threadId, + taskId: task.id + }) + ) this.commands.clear() this.settled.clear() this.liveBytes = 0 this.settledBytes = 0 + return ended + } + + /** Retires the key so a replayed frame cannot start the command again. */ + private end(key: string): CodexBackgroundCommandChange | null { + const existing = this.commands.get(key) + if (existing) { + this.liveBytes -= existing.bytes + this.commands.delete(key) + } + const bytes = Buffer.byteLength(key, 'utf8') + 256 + if (this.liveBytes + bytes <= this.maxMetadataBytes) { + this.settled.set(key, bytes) + this.settledBytes += bytes + } + this.trimSettled() + return existing + ? { type: 'ended', threadId: existing.threadId, taskId: existing.task.id } + : null } private trimSettled(): void { @@ -140,8 +181,10 @@ export class CodexBackgroundCommandTracker { if (event.method !== 'item/started' && event.method !== 'item/completed') { return null } + // Any command may outlive its turn; `source` says only how Codex launched it. A stdin write + // starts no process: it reaches one already tracked. const item = readCodexThreadItem(readRecord(event.params).item) - if (!item || !codexCommandOutlivesTurn(item)) { + if (item?.type !== 'commandExecution' || item.source === 'unifiedExecInteraction') { return null } const key = JSON.stringify([event.threadId, item.id]) diff --git a/src/main/codex/codex-background-task-frames.ts b/src/main/codex/codex-background-task-frames.ts index a2e7a7e2151a..65f51846c247 100644 --- a/src/main/codex/codex-background-task-frames.ts +++ b/src/main/codex/codex-background-task-frames.ts @@ -7,6 +7,7 @@ import { import { codexChildTurnState } from './codex-subagent-executions' import { readRecord } from './codex-item-field-readers' import { readCodexThreadItem } from './codex-structured-item-translation' +import { readCodexProviderVerdict } from './codex-structured-journal-provider-verdicts' import { readCodexTurnId } from './codex-structured-thread-facts' export type CodexBackgroundTaskFrame = @@ -15,6 +16,8 @@ export type CodexBackgroundTaskFrame = agentThreadId: string label: string | null parentTurnId: string | null | undefined + /** The reporting thread, for a `started` activity: the agent that spawned the child. */ + spawnerThreadId: string | undefined } | { kind: 'turn' @@ -22,6 +25,15 @@ export type CodexBackgroundTaskFrame = turnId: string state: NativeChatSubagentState } + | { + /** A child turn that ended with no `turn/completed`. No `turnId`: the one it is running. */ + kind: 'turn-ended' + threadId: string + turnId: string | null + state: CodexChildTurnEnding + } + +type CodexChildTurnEnding = Extract export type CodexBackgroundTaskEvent = { method: string @@ -29,10 +41,34 @@ export type CodexBackgroundTaskEvent = { params: unknown } +/** + * The two ways Codex ends a child's turn without `turn/completed`. An `error` it will not retry is + * that turn's own end: the verdict the transcript settles the same turn on. A closed thread ran + * its last turn, and Codex never said how it went. A `systemError` status is neither: Codex raises + * it for errors that leave the turn running too (a refused steer), and a turn one ends also + * carries the `error`. + */ +function readCodexChildTurnEnding( + event: CodexBackgroundTaskEvent +): CodexBackgroundTaskFrame | null { + if (readCodexProviderVerdict(event.method, event.params) === 'turn-failed') { + const turnId = readCodexTurnId(event.params) + return { kind: 'turn-ended', threadId: event.threadId, turnId, state: 'failed' } + } + return event.method === 'thread/closed' + ? { kind: 'turn-ended', threadId: event.threadId, turnId: null, state: 'unverifiable' } + : null +} + export function readCodexBackgroundTaskFrame( event: CodexBackgroundTaskEvent, primaryThreadId: string ): CodexBackgroundTaskFrame | null { + // The session's own turn ends through the journal's turn boundaries, never here. + const ending = event.threadId === primaryThreadId ? null : readCodexChildTurnEnding(event) + if (ending) { + return ending + } if (event.method === 'turn/started' || event.method === 'turn/completed') { const turnId = readCodexTurnId(event.params) if (turnId === null) { @@ -67,6 +103,8 @@ export function readCodexBackgroundTaskFrame( parentTurnId: activity.kind === 'started' || activity.kind === 'interacted' ? readCodexTurnId(event.params) - : undefined + : undefined, + // Only `started` names the spawner: other kinds ride whichever agent acted. + spawnerThreadId: activity.kind === 'started' ? event.threadId : undefined } } diff --git a/src/main/codex/codex-background-task-tracker.ts b/src/main/codex/codex-background-task-tracker.ts index a972b7bb4c11..351b35e6b84a 100644 --- a/src/main/codex/codex-background-task-tracker.ts +++ b/src/main/codex/codex-background-task-tracker.ts @@ -2,25 +2,50 @@ import type { AgentSessionBackgroundTask, AgentSessionBackgroundTaskState } from '../../shared/agent-session-wire' +import type { AgentChildWorkEvidence } from '../../shared/agent-status-child-work-evidence' import { readCodexBackgroundTaskFrame, type CodexBackgroundTaskEvent } from './codex-background-task-frames' import { CodexSubagentExecutions } from './codex-subagent-executions' import { CodexBackgroundCommandTracker } from './codex-background-command-tracker' +import { CodexChildWorkEvidence } from './codex-child-work-evidence' +import type { CodexAbandonedCommand } from './codex-prompt-registry' +import type { CodexStructuredSessionAdapterDeps } from './codex-structured-session-state' import { boundSubagentField } from './codex-subagent-group-body' +/** Where a session's child-work evidence goes, and the host clock that stamps it. */ +export type CodexChildWorkSink = { + deliver: (evidence: AgentChildWorkEvidence[]) => void + now: () => number +} + +export function codexChildWorkSink( + sessionId: string, + deps: Pick +): CodexChildWorkSink { + return { + deliver: (evidence) => deps.onChildWorkEvidence?.(sessionId, evidence), + now: () => deps.now?.() ?? Date.now() + } +} + /** Projects the same child execution facts the durable roster consumes. */ export class CodexBackgroundTaskTracker { private publishedFingerprint = '[]' private publishedState: AgentSessionBackgroundTaskState | null = null private readonly commands: CodexBackgroundCommandTracker + private readonly childWork: CodexChildWorkEvidence constructor( private readonly primaryThreadId: string, - private readonly executions = new CodexSubagentExecutions() + private readonly executions = new CodexSubagentExecutions(), + private readonly childWorkSink?: CodexChildWorkSink ) { this.commands = new CodexBackgroundCommandTracker(primaryThreadId) + this.childWork = new CodexChildWorkEvidence(primaryThreadId, executions, (threadId) => + this.commands.threadTasks(threadId) + ) } get state(): AgentSessionBackgroundTaskState | null { @@ -32,20 +57,38 @@ export class CodexBackgroundTaskTracker { return this.commands.canObserve(event) } - observe(event: CodexBackgroundTaskEvent): boolean { + /** `unapproved`: commands whose approval the journal dropped with this frame's turn ending. */ + observe( + event: CodexBackgroundTaskEvent, + unapproved: readonly CodexAbandonedCommand[] = [] + ): boolean { const itemEvent = event.method === 'item/started' || event.method === 'item/completed' - if (itemEvent) { - this.commands.observe(event) - } + const command = itemEvent ? this.commands.observe(event) : null + const commands = [ + ...unapproved.flatMap((abandoned) => this.commands.endUnapproved(abandoned) ?? []), + ...(event.method === 'thread/closed' + ? this.commands.endThread(event.threadId) + : command + ? [command] + : []) + ] const frame = readCodexBackgroundTaskFrame(event, this.primaryThreadId) - if (!frame) { - return itemEvent ? this.refresh() : false - } - if (frame.kind === 'subagent') { - this.executions.register(frame.agentThreadId, frame.label, frame.parentTurnId) - } else if (frame.threadId !== this.primaryThreadId) { + if (frame?.kind === 'subagent') { + this.executions.register( + frame.agentThreadId, + frame.label, + frame.parentTurnId, + frame.spawnerThreadId + ) + } else if (frame?.kind === 'turn-ended') { + this.executions.endTurn(frame.threadId, frame.turnId, frame.state) + } else if (frame && frame.threadId !== this.primaryThreadId) { this.executions.observeTurn(frame.threadId, frame.turnId, frame.state) } + this.childWork.observe(event, frame, commands) + if (!frame) { + return itemEvent || commands.length > 0 ? this.refresh() : false + } // A primary-turn frame only prompts a republish: turn end reveals children, // it never settles them. Codex `spawn_agent` children keep reporting well // past their parent turn, so nothing here may sweep the roster. @@ -54,10 +97,25 @@ export class CodexBackgroundTaskTracker { clear(): boolean { this.executions.clear() - this.commands.clear() + this.childWork.clear(this.commands.clear()) return this.refresh() } + /** Everything the frames observed since the last drain said about the session's child work. */ + drainChildWorkEvidence(observedAt: number): AgentChildWorkEvidence[] { + return this.childWork.drain(observedAt) + } + + /** Hand the pending evidence to the host. Callers run this after the journal wrote the frame + * and the parent's own row republished, so a child record never lands ahead of either. */ + publishChildWork(): void { + // Drained even with no sink, so undelivered evidence never accumulates. + const evidence = this.drainChildWorkEvidence(this.childWorkSink?.now() ?? Date.now()) + if (evidence.length > 0) { + this.childWorkSink?.deliver(evidence) + } + } + private tasks(): AgentSessionBackgroundTask[] { const children = this.executions.workingChildren() const agents: AgentSessionBackgroundTask[] = children.map((child, index) => ({ diff --git a/src/main/codex/codex-child-work-evidence.test.ts b/src/main/codex/codex-child-work-evidence.test.ts new file mode 100644 index 000000000000..0f3605bee228 --- /dev/null +++ b/src/main/codex/codex-child-work-evidence.test.ts @@ -0,0 +1,623 @@ +import { describe, expect, it } from 'vitest' +import { createAgentChildWorkAdmission } from '../../shared/agent-status-child-work-admission' +import type { AgentChildWorkRecord } from '../../shared/agent-status-child-work' +import type { AgentChildWorkEvidence } from '../../shared/agent-status-child-work-evidence' +import { reconcileAgentChildWorkEvidence } from '../../shared/agent-status-child-work-reconciliation' +import { + agentChildWorkOwnedLiveness, + deriveAgentChildDisplayState, + projectAgentChildWorkViews +} from '../../shared/agent-status-child-work-view' +import { createAgentStatusStore } from '../../shared/agent-status-store' +import { makeStructuredAgentStatusSubject } from '../../shared/agent-status-subject' +import type { CodexBackgroundTaskEvent } from './codex-background-task-frames' +import { CodexBackgroundTaskTracker } from './codex-background-task-tracker' + +const PRIMARY = 'thread-parent' +const PARENT_TURN = 'turn-parent' +const CHILD = 'thread-child' +const parent = makeStructuredAgentStatusSubject( + { + executionHostId: 'local', + wslDistro: null, + workspaceId: 'workspace-1', + workspaceKind: 'folder' + }, + 'session-1' +) + +function turn( + method: 'turn/started' | 'turn/completed', + threadId: string, + turnId: string, + status = 'completed' +): CodexBackgroundTaskEvent { + return { method, threadId, params: { threadId, turn: { id: turnId, status } } } +} + +function spawned( + child = CHILD, + reporter = PRIMARY, + name = 'audit_build' +): CodexBackgroundTaskEvent { + return { + method: 'item/started', + threadId: reporter, + params: { + threadId: reporter, + turnId: PARENT_TURN, + item: { + type: 'subAgentActivity', + id: `activity-${child}`, + kind: 'started', + agentThreadId: child, + agentPath: `/root/${name}` + } + } + } +} + +function item( + method: 'item/started' | 'item/completed', + threadId: string, + turnId: string, + fields: Record +): CodexBackgroundTaskEvent { + return { method, threadId, params: { threadId, turnId, item: fields } } +} + +function shell(id: string, command: string, status = 'inProgress', source = 'agent') { + return { type: 'commandExecution', id, command, source, status } +} + +function harness() { + const tracker = new CodexBackgroundTaskTracker(PRIMARY) + const store = createAgentStatusStore({ epoch: 'epoch-1', mode: 'authority' }) + expect(store.applyMutation({ parent: { subject: parent } })).not.toBeNull() + let minted = 0 + const admission = createAgentChildWorkAdmission(store, { + mintChildWorkId: () => `child-${++minted}` + }) + let clock = 1_000 + const log: AgentChildWorkEvidence[][] = [] + const send = (...events: CodexBackgroundTaskEvent[]): void => { + for (const event of events) { + tracker.observe(event) + clock += 10 + const evidence = tracker.drainChildWorkEvidence(clock) + log.push(evidence) + reconcileAgentChildWorkEvidence({ store, admission, parent, provider: 'codex', evidence }) + } + } + const records = (): AgentChildWorkRecord[] => store.getChildren(parent) + const byKind = (kind: AgentChildWorkRecord['kind']) => + records().filter((record) => record.kind === kind) + const display = (childWorkId: string) => { + const children = records() + const views = projectAgentChildWorkViews( + children, + children.flatMap((child) => store.getAliasesForChild(child.childWorkId)) + ) + const view = views.find((candidate) => candidate.id === childWorkId) + return view && deriveAgentChildDisplayState(view, agentChildWorkOwnedLiveness(views, view.id)) + } + return { tracker, store, send, records, byKind, display, log } +} + +/** A child spawned by the parent turn and running its first turn. */ +function runningChild() { + const run = harness() + run.send(turn('turn/started', PRIMARY, PARENT_TURN), spawned(), turn('turn/started', CHILD, 'c1')) + return run +} + +describe('Codex child-work evidence', () => { + it('records a spawned child by its thread, with its turn as the run', () => { + const { records, store, log, send } = runningChild() + // Codex delivers the announcement a second time, on `item/completed`. + send({ ...spawned(), method: 'item/completed' }) + expect(records()).toEqual([ + expect.objectContaining({ + kind: 'agent', + membership: 'live', + state: 'working', + residency: 'background', + description: 'audit_build', + invocation: { invocationId: 'c1', generation: 1 }, + stoppable: false + }) + ]) + const aliases = store.getAliasesForChild(records()[0]!.childWorkId) + expect(aliases.map(({ aliasKind, alias }) => [aliasKind, alias])).toEqual([ + ['thread_id', CHILD], + ['turn_id', 'c1'] + ]) + // The host hears the child once. + expect(log.flat().filter((edge) => edge.type === 'live')).toHaveLength(1) + }) + + it('makes no record for a child whose turn began before its announcement, until it lands', () => { + const { send, records } = harness() + send(turn('turn/started', PRIMARY, PARENT_TURN), turn('turn/started', CHILD, 'c1')) + expect(records()).toEqual([]) + send(spawned()) + expect(records()).toEqual([expect.objectContaining({ membership: 'live', state: 'working' })]) + }) + + it.each([ + ['completed', 'succeeded'], + ['interrupted', 'cancelled'], + ['failed', 'failed'], + ['somethingNew', 'unknown'] + ])('settles a child whose own turn ended %s as %s', (status, outcome) => { + const { send, tracker, records } = runningChild() + send(turn('turn/completed', CHILD, 'c1', status)) + expect(records()).toEqual([ + expect.objectContaining({ membership: 'settled', state: 'done', outcome }) + ]) + // Today's strip drops the child the moment its turn ends; only the record keeps its ending. + expect(tracker.state).toBeNull() + }) + + const childError = ( + turnId: string | undefined, + willRetry: boolean + ): CodexBackgroundTaskEvent => ({ + method: 'error', + threadId: CHILD, + params: { + threadId: CHILD, + ...(turnId ? { turnId } : {}), + willRetry, + error: { message: 'boom' } + } + }) + const childClosed: CodexBackgroundTaskEvent = { + method: 'thread/closed', + threadId: CHILD, + params: { threadId: CHILD } + } + + it.each([ + ['an error naming its turn that Codex will not retry', childError('c1', false), 'failed'], + ['an error naming no turn that Codex will not retry', childError(undefined, false), 'failed'], + ['its thread closing', childClosed, 'unknown'] + ])( + 'settles a working child whose turn ended with no turn/completed, by %s, in the strip and the record together', + (_label, ending, outcome) => { + const { send, tracker, records } = runningChild() + expect(tracker.state?.tasks).toHaveLength(1) + send(ending) + expect(records()).toEqual([ + expect.objectContaining({ membership: 'settled', state: 'done', outcome }) + ]) + expect(tracker.state).toBeNull() + // The first ending a turn gets stands. + send(turn('turn/completed', CHILD, 'c1', 'completed')) + expect(records()).toEqual([expect.objectContaining({ outcome })]) + } + ) + + it('keeps a child working through a retried error and a systemError status: its turn runs on', () => { + const { send, tracker, records } = runningChild() + send(childError('c1', true), { + method: 'thread/status/changed', + threadId: CHILD, + params: { threadId: CHILD, status: { type: 'systemError' } } + }) + expect(records()).toEqual([expect.objectContaining({ membership: 'live', state: 'working' })]) + expect(tracker.state?.tasks).toHaveLength(1) + // A fatal error naming a turn the child already finished ends nothing. + send(turn('turn/completed', CHILD, 'c1'), childError('c1', false)) + expect(records()).toEqual([expect.objectContaining({ outcome: 'succeeded' })]) + }) + + it('never settles a child on its PARENT turn ending: children outlive the turn', () => { + const { send, records } = runningChild() + send(turn('turn/completed', PRIMARY, PARENT_TURN)) + expect(records()).toEqual([expect.objectContaining({ membership: 'live', state: 'working' })]) + }) + + it('reopens the same record for a follow-up turn on a finished child, as a new run', () => { + const { send, records } = runningChild() + send(turn('turn/completed', CHILD, 'c1')) + const [finished] = records() + send(turn('turn/started', CHILD, 'c2')) + expect(records()).toEqual([ + expect.objectContaining({ + childWorkId: finished!.childWorkId, + membership: 'live', + state: 'working', + invocation: { invocationId: 'c2', generation: 2 }, + previousInvocations: [ + expect.objectContaining({ + fence: { invocationId: 'c1', generation: 1 }, + outcome: 'succeeded' + }) + ] + }) + ]) + // A late ending of the first run neither ends nor restarts the second. + send(turn('turn/completed', CHILD, 'c1', 'failed')) + expect(records()).toEqual([ + expect.objectContaining({ + membership: 'live', + invocation: { invocationId: 'c2', generation: 2 } + }) + ]) + send(turn('turn/completed', CHILD, 'c2', 'interrupted')) + expect(records()).toEqual([ + expect.objectContaining({ + childWorkId: finished!.childWorkId, + membership: 'settled', + outcome: 'cancelled' + }) + ]) + }) + + it('says which tool the child has open, the way a CLI row names a Codex shell', () => { + const { send, byKind } = runningChild() + send(item('item/started', CHILD, 'c1', shell('cmd-1', 'npm test'))) + expect(byKind('agent')[0]?.operation).toEqual({ + toolName: 'Bash', + input: 'npm test', + basis: 'open', + observedAt: 1_040 + }) + send( + item('item/started', CHILD, 'c1', { + type: 'mcpToolCall', + id: 'mcp-1', + server: 'github', + tool: 'search_issues', + arguments: { query: 'flaky' }, + status: 'inProgress' + }) + ) + expect(byKind('agent')[0]?.operation).toMatchObject({ + toolName: 'mcp__github__search_issues', + input: 'flaky' + }) + // The newer call ends first: the child is still running the older one, since it opened. + send( + item('item/completed', CHILD, 'c1', { type: 'mcpToolCall', id: 'mcp-1', status: 'completed' }) + ) + expect(byKind('agent')[0]?.operation).toEqual({ + toolName: 'Bash', + input: 'npm test', + basis: 'open', + observedAt: 1_040 + }) + send(item('item/completed', CHILD, 'c1', shell('cmd-1', 'npm test', 'completed'))) + expect(byKind('agent')[0]?.operation).toBeUndefined() + }) + + it('names a unified-exec shell as the open call until its process exits', () => { + const { send, byKind } = runningChild() + // Codex runs every agent shell through unified exec, not only the ones that outlive a turn. + send( + item( + 'item/started', + CHILD, + 'c1', + shell('exec-1', 'npm test', 'inProgress', 'unifiedExecStartup') + ) + ) + expect(byKind('agent')[0]?.operation).toMatchObject({ toolName: 'Bash', input: 'npm test' }) + send( + item( + 'item/completed', + CHILD, + 'c1', + shell('exec-1', 'npm test', 'completed', 'unifiedExecStartup') + ) + ) + expect(byKind('agent')[0]?.operation).toBeUndefined() + // An approved command starts on the approval path and completes from unified exec. + send(item('item/started', CHILD, 'c1', shell('exec-2', 'touch ~/marker'))) + expect(byKind('agent')[0]?.operation).toMatchObject({ + toolName: 'Bash', + input: 'touch ~/marker' + }) + send( + item( + 'item/completed', + CHILD, + 'c1', + shell('exec-2', 'touch ~/marker', 'completed', 'unifiedExecStartup') + ) + ) + expect(byKind('agent')[0]?.operation).toBeUndefined() + }) + + it("never carries a run's open call into the next run when its ending was lost", () => { + const { send, byKind } = runningChild() + send(item('item/started', CHILD, 'c1', shell('cmd-1', 'npm test'))) + send(turn('turn/started', CHILD, 'c2')) + expect(byKind('agent')[0]).toMatchObject({ invocation: { invocationId: 'c2', generation: 2 } }) + expect(byKind('agent')[0]?.operation).toBeUndefined() + }) + + it('keeps what the child said last, and its usage, through to how it ended', () => { + const { send, byKind } = runningChild() + send( + item('item/completed', CHILD, 'c1', { + type: 'agentMessage', + id: 'msg-1', + text: 'Two tests\nflake on CI' + }), + { + method: 'thread/tokenUsage/updated', + threadId: CHILD, + params: { threadId: CHILD, tokenUsage: { total: { totalTokens: 4_200 } } } + } + ) + expect(byKind('agent')[0]).toMatchObject({ + lastMessage: 'Two tests flake on CI', + totalTokens: 4_200 + }) + send(turn('turn/completed', CHILD, 'c1')) + expect(byKind('agent')[0]).toMatchObject({ + membership: 'settled', + outcome: 'succeeded', + lastMessage: 'Two tests flake on CI', + totalTokens: 4_200 + }) + // A new run has said nothing yet. + send(turn('turn/started', CHILD, 'c2')) + expect(byKind('agent')[0]).not.toHaveProperty('lastMessage') + }) + + it('files a message whose frame names no turn under the run that said it, never the next', () => { + const { send, byKind } = runningChild() + send({ + method: 'item/completed', + threadId: CHILD, + params: { threadId: CHILD, item: { type: 'agentMessage', id: 'msg-1', text: 'Done' } } + }) + expect(byKind('agent')[0]?.lastMessage).toBe('Done') + send(turn('turn/completed', CHILD, 'c1'), turn('turn/started', CHILD, 'c2')) + send(turn('turn/completed', CHILD, 'c2')) + expect(byKind('agent')[0]).toMatchObject({ outcome: 'succeeded' }) + expect(byKind('agent')[0]).not.toHaveProperty('lastMessage') + }) + + it('reads a child waiting on the user from its own thread status', () => { + const { send, byKind } = runningChild() + const status = (status: unknown): CodexBackgroundTaskEvent => ({ + method: 'thread/status/changed', + threadId: CHILD, + params: { threadId: CHILD, status } + }) + send(status({ type: 'active', activeFlags: ['waitingOnApproval'] })) + expect(byKind('agent')[0]?.state).toBe('waiting') + send(status({ type: 'active', activeFlags: [] })) + expect(byKind('agent')[0]?.state).toBe('working') + send(status({ type: 'active', activeFlags: ['waitingOnUserInput'] })) + send(turn('turn/completed', CHILD, 'c1')) + send(turn('turn/started', CHILD, 'c2')) + // The wait ended with the turn that asked. + expect(byKind('agent')[0]?.state).toBe('working') + }) + + it('records a command from its start until its process exits, then removes it', () => { + const { send, byKind, display } = runningChild() + send( + item( + 'item/started', + CHILD, + 'c1', + shell('exec-1', 'npm run dev', 'inProgress', 'unifiedExecStartup') + ) + ) + const [agent] = byKind('agent') + // While the child's turn runs, the command is also the tool it has open. + expect(agent?.operation).toMatchObject({ toolName: 'Bash', input: 'npm run dev' }) + expect(byKind('command')).toEqual([ + expect.objectContaining({ + membership: 'live', + description: 'npm run dev', + residency: 'background', + parentChildWorkId: agent!.childWorkId, + firstObservedAt: 1_040 + }) + ]) + send(turn('turn/completed', CHILD, 'c1')) + expect(byKind('agent')[0]).toMatchObject({ membership: 'settled', outcome: 'succeeded' }) + expect(byKind('command')).toEqual([expect.objectContaining({ membership: 'live' })]) + expect(display(agent!.childWorkId)).toBe('monitoring') + send( + item('item/completed', CHILD, 'c1', { + ...shell('exec-1', 'npm run dev', 'completed', 'unifiedExecStartup'), + exitCode: 1 + }) + ) + expect(byKind('command')).toEqual([]) + expect(display(agent!.childWorkId)).toBe('done') + }) + + it('records an approved command while it runs, whatever source Codex starts it with', () => { + const { send, tracker, byKind, display } = runningChild() + // The approval path starts the item as `agent`; unified exec reports its exit. + send(item('item/started', CHILD, 'c1', shell('exec-2', 'npm run dev'))) + const [agent] = byKind('agent') + expect(byKind('command')).toEqual([ + expect.objectContaining({ membership: 'live', parentChildWorkId: agent!.childWorkId }) + ]) + send(turn('turn/completed', CHILD, 'c1')) + expect(display(agent!.childWorkId)).toBe('monitoring') + expect(tracker.state?.tasks).toEqual([expect.objectContaining({ kind: 'command' })]) + send( + item( + 'item/completed', + CHILD, + 'c1', + shell('exec-2', 'npm run dev', 'completed', 'unifiedExecStartup') + ) + ) + expect(byKind('command')).toEqual([]) + expect(display(agent!.childWorkId)).toBe('done') + expect(tracker.state).toBeNull() + }) + + it("removes a closed thread's running commands: Codex stops them and never reports their exit", () => { + const { send, tracker, byKind, display } = runningChild() + send( + item( + 'item/started', + CHILD, + 'c1', + shell('exec-1', 'npm run dev', 'inProgress', 'unifiedExecStartup') + ), + turn('turn/completed', CHILD, 'c1'), + turn('turn/completed', PRIMARY, PARENT_TURN) + ) + const [agent] = byKind('agent') + expect(display(agent!.childWorkId)).toBe('monitoring') + send({ method: 'thread/closed', threadId: CHILD, params: { threadId: CHILD } }) + expect(byKind('command')).toEqual([]) + expect(display(agent!.childWorkId)).toBe('done') + expect(tracker.state).toBeNull() + // The exit Codex could not deliver starts nothing if it ever arrives. + send( + item( + 'item/completed', + CHILD, + 'c1', + shell('exec-1', 'npm run dev', 'completed', 'unifiedExecStartup') + ) + ) + expect(byKind('command')).toEqual([]) + }) + + it("names the owner of a command launched before the host held its child's record", () => { + const { send, byKind } = harness() + send( + turn('turn/started', PRIMARY, PARENT_TURN), + turn('turn/started', CHILD, 'c1'), + item( + 'item/started', + CHILD, + 'c1', + shell('exec-1', 'tail -f log', 'inProgress', 'unifiedExecStartup') + ) + ) + expect(byKind('command')).toEqual([ + expect.not.objectContaining({ parentChildWorkId: expect.anything() }) + ]) + send(spawned()) + expect(byKind('command')).toEqual([ + expect.objectContaining({ + description: 'tail -f log', + parentChildWorkId: byKind('agent')[0]?.childWorkId + }) + ]) + }) + + it("records the session's own command with no owner from its start", () => { + const { send, byKind } = harness() + send( + turn('turn/started', PRIMARY, PARENT_TURN), + item( + 'item/started', + PRIMARY, + PARENT_TURN, + shell('exec-9', 'sleep 90', 'inProgress', 'unifiedExecStartup') + ) + ) + expect(byKind('command')).toEqual([ + expect.objectContaining({ membership: 'live', description: 'sleep 90' }) + ]) + expect(byKind('command')[0]).not.toHaveProperty('parentChildWorkId') + send(turn('turn/completed', PRIMARY, PARENT_TURN)) + expect(byKind('command')).toEqual([expect.objectContaining({ membership: 'live' })]) + }) + + it('leaves no record behind a finished shell, so none displaces a finished child', () => { + const { send, byKind, records, log } = runningChild() + send(turn('turn/completed', CHILD, 'c1')) + const before = log.length + // Codex runs every shell, however short, the way it runs one left running. + for (let index = 0; index < 40; index += 1) { + const id = `exec-${index}` + send( + item('item/started', PRIMARY, PARENT_TURN, { + ...shell(id, 'rg foo', 'inProgress', 'unifiedExecStartup'), + durationMs: 0 + }) + ) + expect(byKind('command')).toEqual([expect.objectContaining({ description: 'rg foo' })]) + send( + item('item/completed', PRIMARY, PARENT_TURN, { + ...shell(id, 'rg foo', 'completed', 'unifiedExecStartup'), + exitCode: 0 + }) + ) + expect(byKind('command')).toEqual([]) + } + send(turn('turn/completed', PRIMARY, PARENT_TURN)) + expect(records()).toEqual([ + expect.objectContaining({ kind: 'agent', membership: 'settled', outcome: 'succeeded' }) + ]) + // One edge when each shell starts and one when it exits, as the strip republishes today. + expect( + log + .slice(before) + .flat() + .map((edge) => edge.type) + ).toEqual(Array.from({ length: 40 }, () => ['live', 'removed']).flat()) + }) + + it('names the child that spawned a nested child as its owner', () => { + const { send, byKind } = runningChild() + send( + spawned('thread-grandchild', CHILD, 'lint'), + turn('turn/started', 'thread-grandchild', 'g1') + ) + const nested = byKind('agent').find((record) => record.description === 'lint') + const owner = byKind('agent').find((record) => record.description === 'audit_build') + expect(nested?.parentChildWorkId).toBe(owner?.childWorkId) + }) + + it('holds no evidence for a session with nowhere to deliver it', () => { + const tracker = new CodexBackgroundTaskTracker(PRIMARY) + tracker.observe(spawned()) + tracker.observe(turn('turn/started', CHILD, 'c1')) + tracker.publishChildWork() + expect(tracker.drainChildWorkEvidence(1)).toEqual([]) + }) + + it('settles every live child with no reported outcome, and removes every command, when the provider session ends', () => { + const { send, tracker, records, store } = runningChild() + send( + item( + 'item/started', + PRIMARY, + PARENT_TURN, + shell('exec-1', 'npm run dev', 'inProgress', 'unifiedExecStartup') + ), + turn('turn/completed', PRIMARY, PARENT_TURN) + ) + expect(records()).toHaveLength(2) + tracker.clear() + const evidence = tracker.drainChildWorkEvidence(9_000) + expect(evidence).toEqual([ + { + type: 'removed', + observedAt: 9_000, + handle: { idKind: 'task_id', id: 'codex-command:primary:exec-1' } + }, + { type: 'session-ended', observedAt: 9_000 } + ]) + reconcileAgentChildWorkEvidence({ + store, + admission: createAgentChildWorkAdmission(store, { mintChildWorkId: () => 'unused' }), + parent, + provider: 'codex', + evidence + }) + expect(records()).toEqual([ + expect.objectContaining({ kind: 'agent', membership: 'settled', outcome: 'unknown' }) + ]) + }) +}) diff --git a/src/main/codex/codex-child-work-evidence.ts b/src/main/codex/codex-child-work-evidence.ts new file mode 100644 index 000000000000..93bda7a54a1f --- /dev/null +++ b/src/main/codex/codex-child-work-evidence.ts @@ -0,0 +1,312 @@ +// Codex child threads, and the commands they leave running, decoded into child-work evidence for +// the host's records. +// +// The background-task tracker already follows which child exists, which turn it runs and how that +// turn ended (the executions), and which command process is still running (the command tracker). +// A command is a record from its process start until it stops, and then its record goes: the +// tracker says when, and this module only mirrors it. This module keeps what only the records +// read — the tool a child has open, what it said last, its usage, whether it waits on the user — +// and after each frame re-derives the whole observation of the child that frame was about. Edges +// are stamped with the host clock when drained, after the journal handled the frame, so the host +// never holds a record ahead of the frame's own rows. A parent turn ending is never evidence here: +// Codex children outlive the turn that spawned them, so only a child's own turn, or the session, +// ends it. + +import type { AgentSessionBackgroundTask } from '../../shared/agent-session-wire' +import type { + AgentChildWorkEvidence, + AgentChildWorkLiveObservation +} from '../../shared/agent-status-child-work-evidence' +import type { CodexBackgroundCommandChange } from './codex-background-command-tracker' +import type { + CodexBackgroundTaskEvent, + CodexBackgroundTaskFrame +} from './codex-background-task-frames' +import { + codexChildMessageText, + codexChildToolCall, + codexChildTurnOutcome, + codexToolCallEnded, + type CodexChildToolCall +} from './codex-child-work-translation' +import { readRecord } from './codex-item-field-readers' +import { readCodexThreadItem } from './codex-structured-item-translation' +import { codexThreadWaitsOnUser, readCodexTurnId } from './codex-structured-thread-facts' +import { CODEX_TOKEN_USAGE_METHOD, readCodexThreadTokenTotal } from './codex-subagent-activity' +import type { CodexExecutionChild, CodexSubagentExecutions } from './codex-subagent-executions' + +/** The executions' own child bound. */ +const MAX_CHILD_FACTS = 128 +const MAX_OPEN_CALLS_PER_CHILD = 16 +const CHILD_FRAME_METHODS: ReadonlySet = new Set([ + 'item/started', + 'item/completed', + 'thread/status/changed', + CODEX_TOKEN_USAGE_METHOD +]) + +/** A tool call a child has started and not finished. `openedAt` is the host clock of the first + * drain that carried it, so a later edge keeps the time the call opened. */ +type OpenCall = CodexChildToolCall & { turnId: string | null; openedAt?: number } + +type ChildFacts = { + openCalls: Map + lastMessage?: { turnId: string | null; text: string } + totalTokens?: number + waiting: boolean + /** The last observation handed to the host, so an unchanged re-derivation sends nothing. */ + published?: string +} + +export type CodexPendingChildWork = (observedAt: number) => AgentChildWorkEvidence + +/** Evidence from a run only counts for that run: a fact recorded under another turn is stale. */ +function ofTurn(fact: T | undefined, turnId: string) { + return fact?.turnId === turnId ? fact : undefined +} + +function commandLive(task: AgentSessionBackgroundTask, ownerId: string | null) { + return (observedAt: number): AgentChildWorkEvidence => ({ + type: 'live', + observedAt, + child: { + handle: { idKind: 'task_id', id: task.id }, + kind: 'command', + // Its own process, not a turn's: no turn ending may settle it. + residency: 'background', + state: 'working', + ...(task.description ? { description: task.description } : {}), + ...(ownerId !== null ? { ownerId } : {}), + stoppable: false + } + }) +} + +export class CodexChildWorkEvidence { + private readonly facts = new Map() + private pending: CodexPendingChildWork[] = [] + + constructor( + private readonly primaryThreadId: string, + private readonly executions: CodexSubagentExecutions, + private readonly liveCommands: (threadId: string) => readonly AgentSessionBackgroundTask[] + ) {} + + /** After the tracker applied the frame: which command processes it saw start or stop, and the + * child the frame is about. */ + observe( + event: CodexBackgroundTaskEvent, + frame: CodexBackgroundTaskFrame | null, + commands: readonly CodexBackgroundCommandChange[] + ): void { + this.queueCommands(commands) + const threadId = this.childThread(event, frame) + if (threadId === null) { + return + } + const facts = this.factsFor(threadId) + if (facts && event.threadId === threadId) { + this.record(facts, event) + } + this.queueChild(threadId) + } + + /** The provider session is gone, with the commands it ended: no child it still ran can report + * its own ending. */ + clear(commands: readonly CodexBackgroundCommandChange[]): void { + this.facts.clear() + this.queueCommands(commands) + this.pending.push((observedAt) => ({ type: 'session-ended', observedAt })) + } + + drain(observedAt: number): AgentChildWorkEvidence[] { + const pending = this.pending + this.pending = [] + return pending.map((edge) => edge(observedAt)) + } + + private childThread( + event: CodexBackgroundTaskEvent, + frame: CodexBackgroundTaskFrame | null + ): string | null { + const threadId = + frame?.kind === 'subagent' + ? frame.agentThreadId + : frame || CHILD_FRAME_METHODS.has(event.method) + ? event.threadId + : null + return threadId === this.primaryThreadId ? null : threadId + } + + /** A command belongs to the child thread that launched it; the session's own agent is no owner. + * A stopped command leaves no record: it has nothing left to report. */ + private queueCommands(commands: readonly CodexBackgroundCommandChange[]): void { + for (const command of commands) { + if (command.type === 'started') { + const ownerId = command.threadId === this.primaryThreadId ? null : command.threadId + this.pending.push(commandLive(command.task, ownerId)) + continue + } + const { taskId } = command + this.pending.push((observedAt) => ({ + type: 'removed', + observedAt, + handle: { idKind: 'task_id', id: taskId } + })) + } + } + + private record(facts: ChildFacts, event: CodexBackgroundTaskEvent): void { + if (event.method === CODEX_TOKEN_USAGE_METHOD) { + facts.totalTokens = readCodexThreadTokenTotal(event.params)?.totalTokens ?? facts.totalTokens + return + } + if (event.method === 'thread/status/changed') { + facts.waiting = codexThreadWaitsOnUser(event.params) + return + } + // Every Codex agent shell is unified exec: it is the open call until its process exits. + const item = readCodexThreadItem(readRecord(event.params).item) + if (!item) { + return + } + // A frame that names no turn belongs to the one the child is running. + const turnId = + readCodexTurnId(event.params) ?? + this.executions.find(event.threadId)?.execution?.turnId ?? + null + const text = event.method === 'item/completed' ? codexChildMessageText(item) : undefined + if (text) { + facts.lastMessage = { turnId, text } + } + // An end closes the call by id alone: its closing frame need not restate what it ran. + if (codexToolCallEnded(event.method, item)) { + facts.openCalls.delete(item.id) + return + } + const call = codexChildToolCall(item) + if (call && !facts.openCalls.has(item.id)) { + facts.openCalls.set(item.id, { ...call, turnId }) + for (const stale of [...facts.openCalls.keys()].slice(0, -MAX_OPEN_CALLS_PER_CHILD)) { + facts.openCalls.delete(stale) + } + } + } + + /** Re-derive the child's observation and hand it on when it changed. A child the provider has + * not announced, or that never ran a turn, is no record. */ + private queueChild(threadId: string): void { + const child = this.executions.find(threadId) + const facts = this.facts.get(threadId) + if (!child?.registered || !child.execution || !facts) { + return + } + const { turnId, state } = child.execution + if (state !== 'working') { + // The turn is over, and so is every call it had open. + facts.openCalls.clear() + facts.waiting = false + const lastMessage = ofTurn(facts.lastMessage, turnId)?.text + const { totalTokens } = facts + const outcome = codexChildTurnOutcome(state) + this.publish(facts, JSON.stringify(['ended', turnId, state]), (observedAt) => ({ + type: 'ended', + observedAt, + handle: { idKind: 'thread_id', id: threadId, runId: turnId }, + outcome, + ...(lastMessage ? { lastMessage } : {}), + ...(totalTokens !== undefined ? { totalTokens } : {}) + })) + return + } + for (const [itemId, call] of facts.openCalls) { + if (!ofTurn(call, turnId)) { + facts.openCalls.delete(itemId) + } + } + const observation = this.liveAgent(threadId, child, facts, turnId) + const openCall = [...facts.openCalls].at(-1) + const announced = facts.published !== undefined + this.publish(facts, JSON.stringify(['live', observation, openCall?.[0]]), (observedAt) => { + if (!openCall) { + return { type: 'live', observedAt, child: { ...observation, operation: null } } + } + const [, call] = openCall + call.openedAt ??= observedAt + const operation = { + toolName: call.toolName, + ...(call.input ? { input: call.input } : {}), + basis: 'open' as const, + observedAt: call.openedAt + } + return { type: 'live', observedAt, child: { ...observation, operation } } + }) + if (!announced) { + this.requeueOwnedBy(threadId) + } + } + + private liveAgent( + threadId: string, + child: Readonly, + facts: ChildFacts, + turnId: string + ): AgentChildWorkLiveObservation { + const lastMessage = ofTurn(facts.lastMessage, turnId)?.text + const spawner = child.spawnerThreadId + return { + handle: { idKind: 'thread_id', id: threadId, runId: turnId }, + kind: 'agent', + // A spawned child may outlive the turn that spawned it. + residency: 'background', + state: facts.waiting ? 'waiting' : 'working', + // The agent path's last segment is the child's only label; today's row shows it there. + ...(child.label ? { description: child.label } : {}), + ...(facts.totalTokens !== undefined ? { totalTokens: facts.totalTokens } : {}), + ...(lastMessage ? { lastMessage } : {}), + ...(spawner && spawner !== this.primaryThreadId ? { ownerId: spawner } : {}), + stoppable: false + } + } + + private publish(facts: ChildFacts, fingerprint: string, edge: CodexPendingChildWork): void { + if (facts.published !== fingerprint) { + facts.published = fingerprint + this.pending.push(edge) + } + } + + /** Work a child launched before the host held its record was admitted with no owner; now that + * the owner is recorded, say again whose it is. */ + private requeueOwnedBy(threadId: string): void { + for (const task of this.liveCommands(threadId)) { + this.pending.push(commandLive(task, threadId)) + } + for (const spawned of this.executions.workingChildren()) { + const facts = this.facts.get(spawned.agentThreadId) + if (spawned.spawnerThreadId === threadId && facts?.published !== undefined) { + facts.published = undefined + this.queueChild(spawned.agentThreadId) + } + } + } + + private factsFor(threadId: string): ChildFacts | undefined { + const existing = this.facts.get(threadId) + if (existing) { + return existing + } + if (this.facts.size >= MAX_CHILD_FACTS) { + const idle = [...this.facts.keys()].find( + (id) => this.executions.find(id)?.execution?.state !== 'working' + ) + if (idle === undefined) { + return undefined + } + this.facts.delete(idle) + } + const facts: ChildFacts = { openCalls: new Map(), waiting: false } + this.facts.set(threadId, facts) + return facts + } +} diff --git a/src/main/codex/codex-child-work-translation.ts b/src/main/codex/codex-child-work-translation.ts new file mode 100644 index 000000000000..2763ac53b1c7 --- /dev/null +++ b/src/main/codex/codex-child-work-translation.ts @@ -0,0 +1,88 @@ +// Codex items and statuses, read in the child-work vocabulary. +// +// A tool is named the way Codex names it to its own hooks (`Bash`, `apply_patch`, +// `mcp__server__tool`), so a structured Codex child running a shell reads exactly as a Codex +// CLI agent running one does. + +import type { AgentChildWorkOutcome } from '../../shared/agent-status-child-work' +import type { NativeChatSubagentState } from '../../shared/native-chat-types' +import { + deriveFallbackToolInputPreview, + deriveToolInputPreview +} from '../../shared/agent-hook-listener/tool-input-preview' +import { readRecord, readString, readTextContent } from './codex-item-field-readers' +import type { CodexThreadItem } from './codex-structured-item-translation' + +/** Raw provider text kept for a record; admission folds it to its own one-line bound. */ +export const CODEX_CHILD_WORK_TEXT_MAX_CHARS = 2_048 + +export type CodexChildToolCall = { toolName: string; input?: string } + +function bounded(text: string | null | undefined): string | undefined { + return text ? text.slice(0, CODEX_CHILD_WORK_TEXT_MAX_CHARS) : undefined +} + +function withInput(toolName: string, input: string | undefined): CodexChildToolCall { + const preview = bounded(input) + return preview ? { toolName, input: preview } : { toolName } +} + +function firstChangePath(changes: unknown): string | undefined { + const [first] = Array.isArray(changes) ? changes : [] + return readString(readRecord(first), 'path') ?? undefined +} + +/** The tool a thread item runs, or null for an item that is not a tool call (a message, a + * thought, a plan). */ +export function codexChildToolCall(item: CodexThreadItem): CodexChildToolCall | null { + switch (item.type) { + case 'commandExecution': + return withInput('Bash', deriveToolInputPreview('Bash', { command: item.command })) + case 'fileChange': + return withInput('apply_patch', firstChangePath(item.changes)) + case 'mcpToolCall': { + const server = readString(item, 'server') + const tool = readString(item, 'tool') + if (!tool) { + return null + } + return withInput( + server ? `mcp__${server}__${tool}` : tool, + deriveFallbackToolInputPreview(item.arguments) + ) + } + case 'webSearch': + return withInput('web_search', readString(item, 'query') ?? undefined) + default: + return null + } +} + +/** Whether an item frame says the call is over, whatever frame carried it. */ +export function codexToolCallEnded(method: string, item: CodexThreadItem): boolean { + const status = readString(item, 'status') + return method === 'item/completed' || (status !== null && status !== 'inProgress') +} + +/** What a child said: an assistant message's text. */ +export function codexChildMessageText(item: CodexThreadItem): string | undefined { + return item.type === 'agentMessage' + ? bounded(readString(item, 'text') ?? readTextContent(item, 'content')) + : undefined +} + +/** A child turn's ending. Codex states three; anything else is an ending nobody classified. */ +export function codexChildTurnOutcome(state: NativeChatSubagentState): AgentChildWorkOutcome { + switch (state) { + case 'completed': + return 'succeeded' + case 'failed': + return 'failed' + case 'stopped': + return 'cancelled' + case 'unverifiable': + case 'working': + case 'idle': + return 'unknown' + } +} diff --git a/src/main/codex/codex-prompt-registry-retention.test.ts b/src/main/codex/codex-prompt-registry-retention.test.ts index 78e10cbcc77d..4757d731dcf7 100644 --- a/src/main/codex/codex-prompt-registry-retention.test.ts +++ b/src/main/codex/codex-prompt-registry-retention.test.ts @@ -108,3 +108,22 @@ describe('Codex prompt claim lifetime', () => { expect(prompt.deref()).toBeUndefined() }) }) + +describe('Codex abandoned command approvals', () => { + it("reports only a command's own approval that its turn ended unanswered, once", () => { + const registry = new CodexPromptRegistry() + const ask = (id: number, method: string, params: Record) => + registry.register({ id, method, params: { threadId: 'thread', turnId: 'turn', ...params } }) + ask(1, 'item/commandExecution/requestApproval', { itemId: 'unanswered' }) + const answered = ask(2, 'item/commandExecution/requestApproval', { itemId: 'answered' }) + ask(3, 'item/commandExecution/requestApproval', { itemId: 'parent', approvalId: 'sub' }) + ask(4, 'item/fileChange/requestApproval', { itemId: 'patch' }) + if (!answered) { + throw new Error('Fixture prompt was refused') + } + registry.forget(answered) + registry.clearTurn('thread', 'turn') + expect(registry.takeAbandonedCommands()).toEqual([{ threadId: 'thread', itemId: 'unanswered' }]) + expect(registry.takeAbandonedCommands()).toEqual([]) + }) +}) diff --git a/src/main/codex/codex-prompt-registry.ts b/src/main/codex/codex-prompt-registry.ts index 059f8a7a0d31..eda1fa0bf306 100644 --- a/src/main/codex/codex-prompt-registry.ts +++ b/src/main/codex/codex-prompt-registry.ts @@ -31,6 +31,9 @@ export type CodexPendingPrompt = { answers: Map } +export type CodexAbandonedCommand = { threadId: string; itemId: string } +const NO_ABANDONED_COMMANDS: readonly CodexAbandonedCommand[] = [] + export type CodexPromptClaim = { readonly itemId: string readonly prompt: CodexPendingPrompt @@ -54,6 +57,7 @@ export class CodexPromptRegistry { private readonly journalItemIds = new Map() private readonly boundPrompts = new Map() private readonly claims = new Map() + private abandonedCommands: CodexAbandonedCommand[] = [] get sizes(): { prompts: number; journalBindings: number } { return { prompts: this.byAddress.size, journalBindings: this.journalItemIds.size } @@ -232,7 +236,25 @@ export class CodexPromptRegistry { ) for (const prompt of prompts) { this.forget(prompt) + // Codex abandons a turn's unanswered prompts: a command still awaiting approval never ran. + // An `approvalId` asks for a subcommand, not the item's own command. + if ( + prompt.method === CODEX_COMMAND_APPROVAL_METHOD && + prompt.promptKey === prompt.codexItemId + ) { + this.abandonedCommands.push({ threadId: prompt.threadId, itemId: prompt.codexItemId }) + } + } + } + + /** The commands whose approval a turn ended without, since the last call. */ + takeAbandonedCommands(): readonly CodexAbandonedCommand[] { + if (this.abandonedCommands.length === 0) { + return NO_ABANDONED_COMMANDS } + const taken = this.abandonedCommands + this.abandonedCommands = [] + return taken } clear(): void { @@ -240,6 +262,7 @@ export class CodexPromptRegistry { this.journalItemIds.clear() this.boundPrompts.clear() this.claims.clear() + this.abandonedCommands = [] } private address(threadId: string, promptKey: string): string { diff --git a/src/main/codex/codex-structured-child-work-producer.test.ts b/src/main/codex/codex-structured-child-work-producer.test.ts new file mode 100644 index 000000000000..44d4463a30d7 --- /dev/null +++ b/src/main/codex/codex-structured-child-work-producer.test.ts @@ -0,0 +1,525 @@ +// A Codex session's frames, through the real adapter, into the host's child records: the order the +// host receives them in, and whether the parent row the records imply is today's row. + +import { describe, expect, it } from 'vitest' +import { + foldAgentLeadStatus, + type AgentLeadStatusResolution +} from '../../shared/agent-lead-status-fold' +import { createAgentChildWorkAdmission } from '../../shared/agent-status-child-work-admission' +import type { AgentChildWorkRecord } from '../../shared/agent-status-child-work' +import { agentChildWorkLiveness } from '../../shared/agent-status-child-work-liveness' +import { reconcileAgentChildWorkEvidence } from '../../shared/agent-status-child-work-reconciliation' +import { + agentChildWorkOwnedLiveness, + deriveAgentChildDisplayState, + projectAgentChildWorkViews +} from '../../shared/agent-status-child-work-view' +import { createAgentStatusStore } from '../../shared/agent-status-store' +import { agentJournalLinkageFields } from '../../shared/agent-session-journal-producer' +import type { + AgentJournalItemBody, + AgentJournalProducerLinkage +} from '../../shared/agent-session-journal-types' +import { makeStructuredAgentStatusSubject } from '../../shared/agent-status-subject' +import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' +import { fakeCodex, identityFor, THREAD_ID } from './codex-structured-session-adapter-fixture' +import { CodexStructuredSessionAdapter } from './codex-structured-session-adapter' + +const parent = makeStructuredAgentStatusSubject( + { + executionHostId: 'local', + wslDistro: null, + workspaceId: 'workspace-1', + workspaceKind: 'folder' + }, + 'session-1' +) +const REVIEWER = 'thread-reviewer' +const TESTER = 'thread-tester' +const LINTER = 'thread-linter' + +type Frame = { method: string; params: Record } +type Delivery = { kind: 'journal' | 'legacy' | 'evidence'; detail: string } +type Liveness = ReturnType +/** What the records and today's strip each said when the journal wrote or published a row. */ +type JournalMoment = { recorded: Liveness; legacy: Liveness } + +const turn = ( + method: 'turn/started' | 'turn/completed', + threadId: string, + id: string, + status = 'completed' +): Frame => ({ + method, + params: { threadId, turn: { id, status } } +}) +const spawned = (child: string, name: string, parentTurn: string): Frame => ({ + method: 'item/started', + params: { + threadId: THREAD_ID, + turnId: parentTurn, + item: { + type: 'subAgentActivity', + id: `spawn-${child}`, + kind: 'started', + agentThreadId: child, + agentPath: `/root/${name}` + } + } +}) +const item = ( + method: 'item/started' | 'item/completed', + threadId: string, + turnId: string, + fields: Record +): Frame => ({ + method, + params: { threadId, turnId, item: fields } +}) +const status = (threadId: string, activeFlags: string[]): Frame => ({ + method: 'thread/status/changed', + params: { threadId, status: { type: 'active', activeFlags } } +}) + +async function producer() { + const codex = fakeCodex() + const store = createAgentStatusStore({ epoch: 'epoch-1', mode: 'authority' }) + expect(store.applyMutation({ parent: { subject: parent } })).not.toBeNull() + let minted = 0 + const admission = createAgentChildWorkAdmission(store, { + mintChildWorkId: () => `child-${++minted}` + }) + const deliveries: Delivery[] = [] + const moments: JournalMoment[] = [] + const records = (): AgentChildWorkRecord[] => store.getChildren(parent) + const recordedLiveness = () => + agentChildWorkLiveness(records().filter((record) => record.membership === 'live')) + // Each journal write publishes the parent's row, so the records must imply its state right then. + const moment = () => + moments.push({ + recorded: recordedLiveness(), + legacy: agentChildWorkLiveness(adapter.backgroundTaskState('session-1')?.tasks) + }) + const adapter = new CodexStructuredSessionAdapter({ + resolveLaunch: async () => ({ + command: 'codex', + args: ['app-server'], + cwd: '/work/repo', + codexHome: null, + resumeThreadId: null + }), + openConnection: codex.openConnection, + readProcessStartTime: async () => 1_700_000_000_000, + now: () => 1_700_000_000_500, + onBackgroundTasksChanged: (_sessionId, state) => + deliveries.push({ kind: 'legacy', detail: String(state?.tasks?.length ?? 0) }), + onChildWorkEvidence: (sessionId, evidence) => { + expect(sessionId).toBe('session-1') + deliveries.push({ kind: 'evidence', detail: evidence.map((edge) => edge.type).join(',') }) + reconcileAgentChildWorkEvidence({ store, admission, parent, provider: 'codex', evidence }) + } + }) + const rows: { body: AgentJournalItemBody; linkage: AgentJournalProducerLinkage }[] = [] + const journal: StructuredAgentSessionEventSink = { + appendItem: (identity, body, options) => { + deliveries.push({ kind: 'journal', detail: JSON.stringify(identity) }) + rows.push({ body, linkage: agentJournalLinkageFields(options) }) + moment() + }, + appendTombstone: () => {}, + publish: moment + } + await adapter.acquire({ + identity: identityFor('session-1'), + fence: 7, + spawnToken: 'spawn-9', + events: journal + }) + const send = (frame: Frame): Delivery[] => { + const from = deliveries.length + codex.connections[0]!.handlers.onNotification?.(frame.method, frame.params) + return deliveries.slice(from) + } + /** The journal moments one frame produced. */ + const momentsOf = (frame: Frame): JournalMoment[] => { + const from = moments.length + send(frame) + return moments.slice(from) + } + const byDescription = (description: string) => + records().find((record) => record.description === description) + const display = (description: string) => { + const children = records() + const views = projectAgentChildWorkViews( + children, + children.flatMap((child) => store.getAliasesForChild(child.childWorkId)) + ) + const view = views.find((candidate) => candidate.description === description) + return view && deriveAgentChildDisplayState(view, agentChildWorkOwnedLiveness(views, view.id)) + } + /** The producer stamp on the newest journal row that carries this text. */ + const stampOf = (text: string) => + rows.findLast((row) => JSON.stringify(row.body).includes(text))?.linkage + return { + adapter, + codex, + send, + momentsOf, + records, + recordedLiveness, + byDescription, + display, + stampOf + } +} + +const fold = ( + leadState: 'working' | 'done', + childWorkLiveness: Liveness +): AgentLeadStatusResolution => foldAgentLeadStatus({ leadState, childWorkLiveness }) +/** The strip has no word for a child waiting on a human: to it, that child is working. */ +const asStrip = (liveness: Liveness): Liveness => (liveness === 'waiting' ? 'working' : liveness) +const shellFrame = ( + method: 'item/started' | 'item/completed', + threadId: string, + turnId: string, + id: string, + command: string, + source = 'unifiedExecStartup' +): Frame => + item(method, threadId, turnId, { + type: 'commandExecution', + id, + command, + source, + status: method === 'item/started' ? 'inProgress' : 'completed', + ...(method === 'item/completed' ? { exitCode: 0 } : {}) + }) + +describe('Codex structured child-work producer', () => { + it('delivers evidence only after the journal wrote the frame and the legacy row republished', async () => { + const { send, records } = await producer() + send(turn('turn/started', THREAD_ID, 'p1')) + send(turn('turn/started', REVIEWER, 'r1')) + const deliveries = send(spawned(REVIEWER, 'review', 'p1')) + const kinds = deliveries.map((delivery) => delivery.kind) + // The frame's own rows, then the parent's republished row, and only then its children. + expect(kinds.filter((kind) => kind === 'journal').length).toBeGreaterThan(0) + expect(kinds.slice(kinds.indexOf('legacy'))).toEqual(['legacy', 'evidence']) + expect(records()).toEqual([ + expect.objectContaining({ description: 'review', membership: 'live' }) + ]) + }) + + it('records the parent state today reads, at every journal write, while adding outcome and activity', async () => { + const { adapter, momentsOf, records, recordedLiveness, byDescription, display } = + await producer() + const steps: { + frame: Frame + lead: 'working' | 'done' + childWaits?: true + check?: () => void + }[] = [ + { frame: turn('turn/started', THREAD_ID, 'p1'), lead: 'working' }, + // Codex reports the child's turn before its announcement. + { + frame: turn('turn/started', REVIEWER, 'r1'), + lead: 'working', + check: () => expect(records()).toEqual([]) + }, + { frame: spawned(REVIEWER, 'review', 'p1'), lead: 'working' }, + // An approved command: Codex starts it on the approval path and reports its exit from + // unified exec. + { + frame: shellFrame('item/started', REVIEWER, 'r1', 'cmd-1', 'npm test', 'agent'), + lead: 'working', + check: () => { + expect(byDescription('review')?.operation).toMatchObject({ + toolName: 'Bash', + input: 'npm test', + basis: 'open' + }) + expect(byDescription('npm test')).toMatchObject({ + membership: 'live', + parentChildWorkId: byDescription('review')?.childWorkId + }) + } + }, + // The child starts a dev server it will leave running past its own turn. + { + frame: shellFrame('item/started', REVIEWER, 'r1', 'exec-1', 'npm run dev'), + lead: 'working', + check: () => + expect(byDescription('npm run dev')).toMatchObject({ + membership: 'live', + parentChildWorkId: byDescription('review')?.childWorkId + }) + }, + { + frame: shellFrame('item/completed', REVIEWER, 'r1', 'cmd-1', 'npm test'), + lead: 'working', + check: () => { + // A finished command leaves nothing behind. + expect(byDescription('npm test')).toBeUndefined() + // The dev server is still the child's open call while its turn runs. + expect(byDescription('review')?.operation).toMatchObject({ + toolName: 'Bash', + input: 'npm run dev' + }) + } + }, + { + frame: item('item/completed', REVIEWER, 'r1', { + type: 'agentMessage', + id: 'msg-1', + text: 'Dev server is up' + }), + lead: 'working' + }, + // The parent's turn ends first; its child keeps running. + { + frame: turn('turn/completed', THREAD_ID, 'p1'), + lead: 'done', + check: () => + expect(byDescription('review')).toMatchObject({ membership: 'live', state: 'working' }) + }, + // The legacy task list carries no child state, so only the records can say a child waits, + // and the shared fold ranks that wait above the parent's own state. + { + frame: status(REVIEWER, ['waitingOnApproval']), + lead: 'done', + childWaits: true, + check: () => { + expect(byDescription('review')?.state).toBe('waiting') + expect(agentChildWorkLiveness(adapter.backgroundTaskState('session-1')?.tasks)).toBe( + 'working' + ) + } + }, + { frame: status(REVIEWER, []), lead: 'done' }, + { + frame: turn('turn/completed', REVIEWER, 'r1'), + lead: 'done', + check: () => { + expect(byDescription('review')).toMatchObject({ + membership: 'settled', + outcome: 'succeeded', + lastMessage: 'Dev server is up' + }) + expect(byDescription('npm run dev')).toMatchObject({ + membership: 'live', + parentChildWorkId: byDescription('review')?.childWorkId + }) + // Finished, but a shell it launched still runs: the CLI parent rule reads monitoring. + expect(display('review')).toBe('monitoring') + } + }, + { frame: turn('turn/started', THREAD_ID, 'p2'), lead: 'working' }, + // The parent asks the finished child a follow-up: the same record, a new run. + { + frame: turn('turn/started', REVIEWER, 'r2'), + lead: 'working', + check: () => + expect(byDescription('review')).toMatchObject({ + childWorkId: 'child-1', + membership: 'live', + invocation: { invocationId: 'r2', generation: 2 }, + previousInvocations: [expect.objectContaining({ outcome: 'succeeded' })] + }) + }, + { frame: spawned(TESTER, 'test', 'p2'), lead: 'working' }, + { frame: turn('turn/started', TESTER, 't1'), lead: 'working' }, + { frame: spawned(LINTER, 'lint', 'p2'), lead: 'working' }, + { frame: turn('turn/started', LINTER, 'l1'), lead: 'working' }, + // Codex ends this child's turn with an error it will not retry, and no turn/completed. + { + frame: { + method: 'error', + params: { threadId: LINTER, turnId: 'l1', willRetry: false, error: { message: 'boom' } } + }, + lead: 'working', + check: () => + expect(byDescription('lint')).toMatchObject({ membership: 'settled', outcome: 'failed' }) + }, + { + frame: turn('turn/completed', REVIEWER, 'r2', 'interrupted'), + lead: 'working', + check: () => + expect(byDescription('review')).toMatchObject({ + membership: 'settled', + outcome: 'cancelled' + }) + }, + { frame: turn('turn/completed', THREAD_ID, 'p2'), lead: 'done' }, + { + frame: turn('turn/completed', TESTER, 't1', 'failed'), + lead: 'done', + check: () => + expect(byDescription('test')).toMatchObject({ membership: 'settled', outcome: 'failed' }) + }, + { + frame: shellFrame('item/completed', REVIEWER, 'r1', 'exec-1', 'npm run dev'), + lead: 'done', + check: () => { + expect(byDescription('npm run dev')).toBeUndefined() + expect(display('review')).toBe('interrupted') + } + } + ] + let journalMoments = 0 + for (const [index, step] of steps.entries()) { + const frameMoments = momentsOf(step.frame) + journalMoments += frameMoments.length + for (const [at, { recorded, legacy }] of frameMoments.entries()) { + expect({ index, at, parent: fold(step.lead, asStrip(recorded)) }).toEqual({ + index, + at, + parent: fold(step.lead, legacy) + }) + } + const legacy = agentChildWorkLiveness(adapter.backgroundTaskState('session-1')?.tasks) + const recorded = recordedLiveness() + const expected = step.childWaits ? 'waiting' : legacy + expect({ index, parent: fold(step.lead, recorded) }).toEqual({ + index, + parent: fold(step.lead, expected) + }) + expect({ index, liveness: recorded }).toEqual({ index, liveness: expected }) + step.check?.() + } + expect(journalMoments).toBeGreaterThan(steps.length) + const settled = records() + await adapter.closeSession('session-1') + // Every child had already ended; closing the session changes none of what they said. + expect(records()).toEqual(settled) + expect( + records().map(({ description, membership, outcome }) => ({ + description, + membership, + outcome + })) + ).toEqual([ + { description: 'review', membership: 'settled', outcome: 'cancelled' }, + { description: 'test', membership: 'settled', outcome: 'failed' }, + { description: 'lint', membership: 'settled', outcome: 'failed' } + ]) + expect(adapter.backgroundTaskState('session-1')).toBeUndefined() + }) + + it("never reads done while the main agent's own shell runs past its turn", async () => { + const { momentsOf, send, recordedLiveness } = await producer() + send(turn('turn/started', THREAD_ID, 'p1')) + send(shellFrame('item/started', THREAD_ID, 'p1', 'exec-dev', 'npm run dev')) + const monitoring = { stateName: 'working', workingMode: 'monitoring' } + // The turn ends with the dev server running: straight to monitoring, never done in between. + const turnEnd = momentsOf(turn('turn/completed', THREAD_ID, 'p1')) + expect(turnEnd.length).toBeGreaterThan(0) + for (const { recorded } of turnEnd) { + expect(fold('done', recorded)).toEqual(monitoring) + } + expect(fold('done', recordedLiveness())).toEqual(monitoring) + momentsOf(shellFrame('item/completed', THREAD_ID, 'p1', 'exec-dev', 'npm run dev')) + expect(fold('done', recordedLiveness())).toEqual({ stateName: 'done' }) + }) + + it('ends an approval left unanswered when its turn ends: Codex never ran the command', async () => { + const { adapter, codex, send, records, recordedLiveness, display, byDescription } = + await producer() + const approve = (threadId: string, turnId: string, itemId: string, command: string) => { + // The approval path starts the item before it asks, and drops the question at turn end. + send(shellFrame('item/started', threadId, turnId, itemId, command, 'agent')) + codex.connections[0]!.handlers.onServerRequest?.({ + id: `approval-${itemId}`, + method: 'item/commandExecution/requestApproval', + params: { itemId, threadId, turnId } + }) + } + send(turn('turn/started', THREAD_ID, 'p1')) + send(turn('turn/started', REVIEWER, 'r1')) + send(spawned(REVIEWER, 'review', 'p1')) + approve(REVIEWER, 'r1', 'call-child', 'npm run e2e') + approve(THREAD_ID, 'p1', 'call-main', 'npm run dev') + expect(records().filter((record) => record.kind === 'command')).toHaveLength(2) + // The user stops the child, then the main agent, each at its approval. + send(turn('turn/completed', REVIEWER, 'r1', 'interrupted')) + expect(byDescription('npm run e2e')).toBeUndefined() + expect(display('review')).toBe('interrupted') + send(turn('turn/completed', THREAD_ID, 'p1', 'interrupted')) + expect(byDescription('npm run dev')).toBeUndefined() + expect(adapter.backgroundTaskState('session-1')).toBeNull() + expect(fold('done', recordedLiveness())).toEqual({ stateName: 'done' }) + }) + + it('keeps an answered approval running past its turn', async () => { + const { adapter, codex, send, byDescription } = await producer() + send(turn('turn/started', THREAD_ID, 'p1')) + send(shellFrame('item/started', THREAD_ID, 'p1', 'call-1', 'npm run dev', 'agent')) + codex.connections[0]!.handlers.onServerRequest?.({ + id: 'approval-1', + method: 'item/commandExecution/requestApproval', + params: { itemId: 'call-1', threadId: THREAD_ID, turnId: 'p1' } + }) + await adapter.answerPrompt({ + sessionId: 'session-1', + itemId: 'call-1', + kind: 'approval', + response: { kind: 'option', optionId: 'accept' }, + fence: 7, + commit: async () => {} + }) + send(turn('turn/completed', THREAD_ID, 'p1')) + expect(byDescription('npm run dev')).toMatchObject({ membership: 'live' }) + expect(adapter.backgroundTaskState('session-1')?.tasks).toEqual([ + expect.objectContaining({ kind: 'command', description: 'npm run dev' }) + ]) + }) + + it("numbers a child's runs as the journal does: a row's attempt is its record's generation", async () => { + const { send, byDescription, stampOf } = await producer() + const says = (turnId: string, text: string) => + item('item/completed', REVIEWER, turnId, { type: 'agentMessage', id: `msg-${text}`, text }) + // The journal stamps a child row with its run only once it is past the first. + const runs = (text: string) => { + const stamp = stampOf(text) + return { + agentId: stamp?.agentId, + attempt: stamp ? (stamp.attempt ?? 1) : undefined, + generation: byDescription('review')?.invocation.generation + } + } + send(turn('turn/started', THREAD_ID, 'p1')) + // Codex reports the child's first turn before the spawn that announces it. + send(turn('turn/started', REVIEWER, 'r1')) + send(spawned(REVIEWER, 'review', 'p1')) + send(says('r1', 'run 1')) + expect(runs('run 1')).toEqual({ agentId: REVIEWER, attempt: 1, generation: 1 }) + send(turn('turn/completed', REVIEWER, 'r1')) + // Each follow-up the parent sends is the child's next run, on both sides. + for (const run of [2, 3]) { + send(turn('turn/started', REVIEWER, `r${run}`)) + send(says(`r${run}`, `run ${run}`)) + expect(runs(`run ${run}`)).toEqual({ agentId: REVIEWER, attempt: run, generation: run }) + send(turn('turn/completed', REVIEWER, `r${run}`)) + } + }) + + it('settles a live child with no reported outcome when the provider exits unexpectedly', async () => { + const { codex, send, records } = await producer() + send(turn('turn/started', THREAD_ID, 'p1')) + send(spawned(REVIEWER, 'review', 'p1')) + send(turn('turn/started', REVIEWER, 'r1')) + expect(records()).toEqual([ + expect.objectContaining({ description: 'review', membership: 'live', state: 'working' }) + ]) + codex.connections[0]!.handlers.onExit?.(new Error('provider exited')) + expect(records()).toEqual([ + expect.objectContaining({ + description: 'review', + membership: 'settled', + state: 'done', + outcome: 'unknown' + }) + ]) + }) +}) diff --git a/src/main/codex/codex-structured-session-acquire.ts b/src/main/codex/codex-structured-session-acquire.ts index b7262ea6fee2..0cbe62224c56 100644 --- a/src/main/codex/codex-structured-session-acquire.ts +++ b/src/main/codex/codex-structured-session-acquire.ts @@ -8,7 +8,7 @@ import { closeFailedCodexAcquisition, stopSupersededCodexAcquisition } from './codex-structured-acquisition-lifecycle' -import { CodexBackgroundTaskTracker } from './codex-background-task-tracker' +import { CodexBackgroundTaskTracker, codexChildWorkSink } from './codex-background-task-tracker' import { CodexSubagentExecutions } from './codex-subagent-executions' import { createCodexDispatchEchoes } from './codex-structured-dispatch-echo' import { createCodexJournalTranslator } from './codex-structured-journal-translation' @@ -44,6 +44,8 @@ import type { CodexStructuredTurnCancellation } from './codex-structured-turn-ca import type { CodexStructuredNotificationRetry } from './codex-structured-notification-retry' import type { deliverCodexServerRequest } from './codex-structured-provider-events' +const TURN_BOUNDARIES: ReadonlySet = new Set(['turn/started', 'turn/completed']) + export async function acquireCodexStructuredSession(input: { input: StructuredAgentSessionAcquireInput deps: CodexStructuredSessionAdapterDeps @@ -138,7 +140,7 @@ export async function acquireCodexStructuredSession(input: { { onNotification: (method, params) => { // Stamped at receipt, ahead of any pre-publication buffering or retry. - const observedAt = isCodexTurnBoundary(method) ? (deps.now?.() ?? Date.now()) : undefined + const observedAt = TURN_BOUNDARIES.has(method) ? (deps.now?.() ?? Date.now()) : undefined const dispatchSequenceAtReceipt = method === 'turn/started' ? dispatchEchoes.latestSequence() : undefined input.deliver( @@ -240,6 +242,8 @@ export async function acquireCodexStructuredSession(input: { throw new Error(`codex app-server for session ${sessionId} exited while being acquired`) } acquisitions.deleteIfCurrent(sessionId, attempt) + // Where this session's child work goes: the host's records, after each frame is journaled. + const sink = codexChildWorkSink(sessionId, deps) const session: CodexSession = { connection, ...codexSessionLifecycle(acquireInput.fence, acquired.acquisitionGeneration as string), @@ -254,7 +258,7 @@ export async function acquireCodexStructuredSession(input: { ...(catalogAccess ? { catalogAccess } : {}), dispatchEchoes, translator, - backgroundTasks: new CodexBackgroundTaskTracker(opened.threadId, subagentExecutions), + backgroundTasks: new CodexBackgroundTaskTracker(opened.threadId, subagentExecutions, sink), forceCloseUnexpected: (reason) => input.forceCloseUnexpected( sessionId, @@ -299,7 +303,3 @@ export async function acquireCodexStructuredSession(input: { attempt.finish() } } - -function isCodexTurnBoundary(method: string): boolean { - return method === 'turn/started' || method === 'turn/completed' -} diff --git a/src/main/codex/codex-structured-session-adapter.ts b/src/main/codex/codex-structured-session-adapter.ts index 0b1b8145fcc5..eebebe3aa441 100644 --- a/src/main/codex/codex-structured-session-adapter.ts +++ b/src/main/codex/codex-structured-session-adapter.ts @@ -161,9 +161,11 @@ export class CodexStructuredSessionAdapter implements StructuredAgentSessionAdap ) // After the admission check, so a refused frame is observed by the strip // only on the retry that also reaches the journal. - if (session.backgroundTasks.observe(event)) { + if (session.backgroundTasks.observe(event, session.prompts.takeAbandonedCommands())) { this.deps.onBackgroundTasksChanged?.(event.sessionId, session.backgroundTasks.state) } + // After the journal and the parent's republished row, never ahead of either. + session.backgroundTasks.publishChildWork() } if (event.type === 'ended') { this.compactions.ended(event.sessionId) diff --git a/src/main/codex/codex-structured-session-close.ts b/src/main/codex/codex-structured-session-close.ts index 56e1855c60f3..91d6c8ff04d2 100644 --- a/src/main/codex/codex-structured-session-close.ts +++ b/src/main/codex/codex-structured-session-close.ts @@ -56,6 +56,8 @@ export function handleCodexSessionExit(input: { session.dispatchEchoes.clear() session.backgroundTasks.clear() input.onBackgroundTasksChanged?.(input.sessionId, null) + // Every close path funnels here, so the session's children end with it on each one. + session.backgroundTasks.publishChildWork() session.unbindReadingControl?.() input.onEvent?.(event) session.prompts.clear() diff --git a/src/main/codex/codex-structured-session-state.ts b/src/main/codex/codex-structured-session-state.ts index 4fff94431e56..7f40407e3ffd 100644 --- a/src/main/codex/codex-structured-session-state.ts +++ b/src/main/codex/codex-structured-session-state.ts @@ -12,6 +12,7 @@ import type { import { CodexAcquisitionWindow } from './codex-structured-acquisition-window' import type { CodexDispatchEchoes } from './codex-structured-dispatch-echo' import type { AgentSessionBackgroundTaskState } from '../../shared/agent-session-wire' +import type { AgentChildWorkEvidence } from '../../shared/agent-status-child-work-evidence' import type { CodexBackgroundTaskTracker } from './codex-background-task-tracker' import type { CodexJournalTranslator } from './codex-structured-journal-translation' import type { CodexTurnProcessSnapshot } from './codex-structured-turn-processes' @@ -78,6 +79,8 @@ export type CodexStructuredSessionAdapterDeps = { sessionId: string, state: AgentSessionBackgroundTaskState | null ) => void + /** What the session's child work did, delivered after the journal handled the frame. */ + onChildWorkEvidence?: (sessionId: string, evidence: AgentChildWorkEvidence[]) => void /** A send admitted earlier: its identity once Codex echoes it, or its rejection when the turn * Codex answered it into ended without taking it. */ onDispatchSettledLate?: ( diff --git a/src/main/codex/codex-structured-thread-facts.ts b/src/main/codex/codex-structured-thread-facts.ts index 8db0bbeec612..755006d17fa2 100644 --- a/src/main/codex/codex-structured-thread-facts.ts +++ b/src/main/codex/codex-structured-thread-facts.ts @@ -75,3 +75,13 @@ export function codexThreadStoppedRunning(payload: unknown): boolean { const type = record(record(payload)?.status)?.type return type === 'idle' || type === 'systemError' } + +/** An `active` thread flags each request it has open on the user (an approval, a question). */ +export function codexThreadWaitsOnUser(payload: unknown): boolean { + const status = record(record(payload)?.status) + const flags = status?.type === 'active' ? status.activeFlags : null + return ( + Array.isArray(flags) && + flags.some((flag) => flag === 'waitingOnApproval' || flag === 'waitingOnUserInput') + ) +} diff --git a/src/main/codex/codex-subagent-executions.ts b/src/main/codex/codex-subagent-executions.ts index 0f74babe7341..939d1b903317 100644 --- a/src/main/codex/codex-subagent-executions.ts +++ b/src/main/codex/codex-subagent-executions.ts @@ -94,6 +94,20 @@ export class CodexSubagentExecutions { return { child, execution } } + /** A child turn that ended with no `turn/completed`. With no turn named, the one the child is + * running ended; a child running none has nothing to end. The first ending a turn gets stands. */ + endTurn( + agentThreadId: string, + turnId: string | null, + state: Exclude + ): void { + const current = this.children.get(agentThreadId)?.execution + const ended = turnId ?? (current?.state === 'working' ? current.turnId : null) + if (current && ended !== null) { + this.observeTurn(agentThreadId, ended, state) + } + } + /** Survives the child's turn, so a row outliving that turn can still name it. */ label(agentThreadId: string): string | null { return this.children.get(agentThreadId)?.label ?? null @@ -109,6 +123,11 @@ export class CodexSubagentExecutions { return this.children.get(agentThreadId)?.turnOrdinals.get(turnId) ?? null } + /** The child as last observed, without creating one. */ + find(agentThreadId: string): Readonly | undefined { + return this.children.get(agentThreadId) + } + workingChildren(): CodexExecutionChild[] { return [...this.children.values()].filter( (child) => child.registered && child.execution?.state === 'working' diff --git a/src/main/runtime/structured-agent-session-runtime.ts b/src/main/runtime/structured-agent-session-runtime.ts index e6b458eb2602..f4a1d1b81850 100644 --- a/src/main/runtime/structured-agent-session-runtime.ts +++ b/src/main/runtime/structured-agent-session-runtime.ts @@ -247,6 +247,8 @@ async function install(deps: StructuredAgentSessionRuntimeDeps): Promise host?.publishBackgroundTaskState(sessionId, state), + onChildWorkEvidence: (sessionId, evidence) => + host?.publishChildWorkEvidence(sessionId, evidence), onDispatchSettledLate, onPrimaryThreadStoppedRunning: ({ sessionId }) => { void host diff --git a/src/main/runtime/structured-codex-child-work-runtime.test.ts b/src/main/runtime/structured-codex-child-work-runtime.test.ts new file mode 100644 index 000000000000..d03ab6f1be5d --- /dev/null +++ b/src/main/runtime/structured-codex-child-work-runtime.test.ts @@ -0,0 +1,133 @@ +// The production runtime hands a Codex session's child work to the status sink, under the address +// the session's own row landed under, and ends it with the provider. + +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' +import type { + CodexAppServerConnection, + CodexAppServerConnectionHandlers, + openCodexAppServerConnection +} from '../codex/codex-app-server-connection' +import { + HOST_TEST_SESSION as SESSION, + hostTestAttachParams +} from '../native-chat/agent-session-wire/structured-agent-session-host-test-data' +import type { StructuredAgentSessionStatusSink } from '../native-chat/agent-session-wire/structured-agent-session-status-feed' +import { + ensureStructuredAgentSessionHost, + stopStructuredAgentSessionRuntime +} from './structured-agent-session-runtime' + +const THREAD = 'thread-runtime-child-work' +const CHILD = 'thread-runtime-reviewer' +const ROUTES: Record = { + 'thread/start': { thread: { id: THREAD } }, + 'model/list': { + data: [ + { + model: 'gpt-test', + displayName: 'GPT Test', + hidden: false, + supportedReasoningEfforts: [], + defaultReasoningEffort: null, + isDefault: true + } + ], + nextCursor: null + } +} + +describe('structured Codex child work through the production runtime', () => { + let root: string | null = null + + afterEach(async () => { + await stopStructuredAgentSessionRuntime() + if (root) { + await rm(root, { recursive: true, force: true }) + root = null + } + }) + + it("hands its subagents to the status sink under the session's own address", async () => { + root = await mkdtemp(join(tmpdir(), 'orca-runtime-codex-child-work-')) + const connections: CodexAppServerConnectionHandlers[] = [] + const openConnection: typeof openCodexAppServerConnection = async (_launch, handlers = {}) => { + connections.push(handlers) + const connection: CodexAppServerConnection = { + pid: 4321, + closed: false, + request: async (method) => (method in ROUTES ? ROUTES[method] : {}), + notify: () => {}, + respond: () => {}, + respondWithError: () => {}, + close: async () => true + } + return connection + } + const childWork: Parameters< + NonNullable + >[] = [] + const host = await ensureStructuredAgentSessionHost({ + stateDirectory: root, + hostId: 'local', + claimKeyId: 'key-1', + resolveWorkspacePath: async () => root!, + resolveClaudeAuthPolicy: () => ({ stripAuthEnv: true }), + resolveCodexCommand: () => 'codex', + resolveEnvironment: async () => ({ PATH: process.env.PATH }), + openCodexConnection: openConnection, + readProcessStartTime: async () => 1_700_000_000_000, + statusSink: { + publish: () => {}, + forget: () => {}, + publishChildWork: (...args) => childWork.push(args) + } + }) + const attachParams = hostTestAttachParams(null, { providerHandle: undefined }) + attachParams.envelope.clientOperationId = `${Date.now()}-${'1'.padStart(32, '0')}` + const attached = await host.attach({ callerKey: 'runtime-test' }, attachParams) + expect(attached).toMatchObject({ ok: true }) + // Creating the session starts its child; nothing else has to keep it running. + expect(connections).toHaveLength(1) + const notify = (method: string, params: Record) => + connections[0]?.onNotification?.(method, params) + notify('turn/started', { threadId: THREAD, turn: { id: 'turn-1' } }) + notify('turn/started', { threadId: CHILD, turn: { id: 'child-turn-1' } }) + notify('item/started', { + threadId: THREAD, + turnId: 'turn-1', + item: { + type: 'subAgentActivity', + id: 'spawn-1', + kind: 'started', + agentThreadId: CHILD, + agentPath: '/root/review' + } + }) + const subject = expect.objectContaining({ kind: 'structured-session', sessionId: SESSION }) + expect(childWork).toEqual([ + [ + subject, + [ + expect.objectContaining({ + type: 'live', + child: expect.objectContaining({ + handle: { idKind: 'thread_id', id: CHILD, runId: 'child-turn-1' }, + description: 'review' + }) + }) + ], + 'codex' + ] + ]) + // The provider dies: its session's end is reported under the same address. + connections[0]?.onExit?.(new Error('scripted provider exit')) + expect(childWork.at(-1)).toEqual([ + subject, + [expect.objectContaining({ type: 'session-ended' })], + 'codex' + ]) + }) +}) diff --git a/src/shared/agent-status-child-work-alias.ts b/src/shared/agent-status-child-work-alias.ts index 539c9c38214e..c7ff29a5c6a4 100644 --- a/src/shared/agent-status-child-work-alias.ts +++ b/src/shared/agent-status-child-work-alias.ts @@ -16,11 +16,17 @@ const CHILD_ALIAS_KEY_PREFIX = 'agent-child-work-alias-v1:' const MAX_ALIAS_PART_LENGTH = 512 /** - * `thread_id` names a child by its own provider thread (a Codex subagent). The hook lane registers - * a Claude `agent_id` under `task_id` (it is the same registry id) and a Codex `agent_id` under - * `thread_id`; no `agent_id` kind exists on purpose. + * `thread_id` names a child by its own provider thread (a Codex subagent); `turn_id` names one run + * of such a child, as `tool_use_id` names one run of a task. The hook lane registers a Claude + * `agent_id` under `task_id` (it is the same registry id) and a Codex `agent_id` under `thread_id`; + * no `agent_id` kind exists on purpose. */ -export const AGENT_CHILD_WORK_ALIAS_KINDS = ['task_id', 'tool_use_id', 'thread_id'] as const +export const AGENT_CHILD_WORK_ALIAS_KINDS = [ + 'task_id', + 'tool_use_id', + 'thread_id', + 'turn_id' +] as const export type AgentChildWorkAliasKind = (typeof AGENT_CHILD_WORK_ALIAS_KINDS)[number] const ALIAS_KIND_SET: ReadonlySet = new Set(AGENT_CHILD_WORK_ALIAS_KINDS) diff --git a/src/shared/agent-status-child-work-evidence-resolution.ts b/src/shared/agent-status-child-work-evidence-resolution.ts index 50c80e5bdbd7..14c31bee4b6b 100644 --- a/src/shared/agent-status-child-work-evidence-resolution.ts +++ b/src/shared/agent-status-child-work-evidence-resolution.ts @@ -20,7 +20,15 @@ import { agentStatusSubjectsEqual, type AgentStatusSubject } from './agent-statu * a handle is unique per parent and provider without being unique across producers. */ export const STRUCTURED_CHILD_WORK_PRODUCER_ID = 'structured-session-child-work' const SEGMENT_ID = STRUCTURED_CHILD_WORK_PRODUCER_ID -const RUN_ALIAS_KIND: AgentChildWorkAliasKind = 'tool_use_id' +/** A run is named in the provider's own terms: a task runs under its spawn call, a thread under + * its turn. The kinds stay apart so a turn id can never pass for a spawn call. */ +const RUN_ALIAS_KIND_BY_ID_KIND = { + task_id: 'tool_use_id', + thread_id: 'turn_id' +} as const satisfies Record +const RUN_ALIAS_KINDS: ReadonlySet = new Set( + Object.values(RUN_ALIAS_KIND_BY_ID_KIND) +) export const STRUCTURED_CHILD_WORK_PROVENANCE: AgentChildWorkProvenance = { source: 'structured-session', @@ -70,7 +78,13 @@ export function agentChildWorkHandleAliases( return [ { segmentId: SEGMENT_ID, aliasKind: handle.idKind, alias: handle.id }, ...(handle.runId !== undefined && handle.runId !== handle.id - ? [{ segmentId: SEGMENT_ID, aliasKind: RUN_ALIAS_KIND, alias: handle.runId }] + ? [ + { + segmentId: SEGMENT_ID, + aliasKind: RUN_ALIAS_KIND_BY_ID_KIND[handle.idKind], + alias: handle.runId + } + ] : []) ] } @@ -123,14 +137,14 @@ export function resolveAgentChildWorkHandle( : { child: child ?? null, ambiguous: false, highestGeneration } } -/** The owner a handle id names, by its stable id or by the run handle it spawned under. */ +/** The owner a handle id names, by its stable id or by the spawn call it runs under. */ export function resolveAgentChildWorkOwner( scope: AgentChildWorkEvidenceScope, ownerId: string ): string | undefined { const resolution = resolveAgentChildWorkHandle( scope, - ['task_id', 'thread_id', RUN_ALIAS_KIND], + ['task_id', 'thread_id', 'tool_use_id'], ownerId ) return resolution?.child?.childWorkId @@ -164,7 +178,7 @@ export function currentAgentChildWorkAliases( return { ...(stable ? { stable } : {}), stableId: stable?.id, - runId: current.find((alias) => alias.aliasKind === RUN_ALIAS_KIND)?.alias, + runId: current.find((alias) => RUN_ALIAS_KINDS.has(alias.aliasKind))?.alias, aliases: current.map((alias) => ({ segmentId: alias.segmentId, aliasKind: alias.aliasKind, @@ -183,7 +197,7 @@ export function isPreviousAgentChildWorkRun( .getAliasesForChild(child.childWorkId) .some( (alias) => - alias.aliasKind === RUN_ALIAS_KIND && + RUN_ALIAS_KINDS.has(alias.aliasKind) && alias.alias === runId && !agentChildWorkFencesEqual(alias.fence, child.invocation) ) diff --git a/src/shared/agent-status-child-work-evidence.ts b/src/shared/agent-status-child-work-evidence.ts index 06fe05d38a8c..8df08126827c 100644 --- a/src/shared/agent-status-child-work-evidence.ts +++ b/src/shared/agent-status-child-work-evidence.ts @@ -2,7 +2,8 @@ // // A producer decodes provider frames into these edges and the host folds them into the one // record per child it owns. Edges carry facts, not records: which child is live, what it is -// doing, how it ended. Only a child's own ending settles it, or the end of its session. +// doing, how it ended, or that it is gone. Only a child's own ending settles it, or the end of its +// session. Edges are host-internal: the producer and the store share one process. import type { AgentChildWorkAliasKind } from './agent-status-child-work-alias' import type { @@ -13,9 +14,9 @@ import type { AgentChildWorkState } from './agent-status-child-work' -/** How the provider names one child. `id` is the stable handle today's wire already publishes - * (a Claude task id); `runId` names the current run when the provider mints one per run (the - * spawn call), and a different one is the provider starting the child again. */ +/** How the provider names one child. `id` is the stable handle: a task id, or the child's own + * thread. `runId` names the current run when the provider mints one per run (a task's spawn + * call, a thread's turn), and a different one is the provider starting the child again. */ export type AgentChildWorkEvidenceHandle = { idKind: Extract id: string @@ -74,8 +75,17 @@ export type AgentChildWorkEndedEvidence = { * with an outcome nobody reported. Settled children stay; the parent's removal drops them. */ export type AgentChildWorkSessionEndedEvidence = { type: 'session-ended'; observedAt: number } +/** Work that leaves nothing to report once it stops, such as a command whose process exited: its + * record goes rather than settles. For work that owns no other record. */ +export type AgentChildWorkRemovedEvidence = { + type: 'removed' + observedAt: number + handle: AgentChildWorkEvidenceHandle +} + export type AgentChildWorkEvidence = | AgentChildWorkLiveEvidence | AgentChildWorkOperationEvidence | AgentChildWorkEndedEvidence + | AgentChildWorkRemovedEvidence | AgentChildWorkSessionEndedEvidence diff --git a/src/shared/agent-status-child-work-reconciliation.test.ts b/src/shared/agent-status-child-work-reconciliation.test.ts index 377c580fc41c..79ffc1c57616 100644 --- a/src/shared/agent-status-child-work-reconciliation.test.ts +++ b/src/shared/agent-status-child-work-reconciliation.test.ts @@ -5,10 +5,7 @@ import type { AgentChildWorkEvidence, AgentChildWorkLiveObservation } from './agent-status-child-work-evidence' -import { - reconcileAgentChildWorkEvidence, - STRUCTURED_CHILD_WORK_MAX_SETTLED -} from './agent-status-child-work-reconciliation' +import { reconcileAgentChildWorkEvidence } from './agent-status-child-work-reconciliation' import { STRUCTURED_CHILD_WORK_MAX_LIVE } from './agent-status-child-work-evidence-admission' import { createAgentStatusStore, type AgentStatusStore } from './agent-status-store' import { makeStructuredAgentStatusSubject } from './agent-status-subject' @@ -399,17 +396,9 @@ describe('structured child-work reconciliation', () => { expect(records(store)).toHaveLength(STRUCTURED_CHILD_WORK_MAX_LIVE) }) - it('keeps a bounded settled history, never dropping a child that owns live work', () => { + it('keeps every settled child until the parent row goes', () => { const { store, apply } = harness() - apply(live(child('owner'))) - apply(live(child('shell', { kind: 'command', ownerId: 'owner' }))) - apply({ - type: 'ended', - observedAt: 101, - handle: { idKind: 'task_id', id: 'owner' }, - outcome: 'succeeded' - }) - for (let index = 0; index < STRUCTURED_CHILD_WORK_MAX_SETTLED + 1; index += 1) { + for (let index = 0; index < 100; index += 1) { apply(live(child(`done-${index}`), 200 + index), { type: 'ended', observedAt: 200 + index, @@ -418,9 +407,22 @@ describe('structured child-work reconciliation', () => { }) } const settled = records(store).filter((record) => record.membership === 'settled') - expect(settled).toHaveLength(STRUCTURED_CHILD_WORK_MAX_SETTLED) - expect(settled.map((record) => record.description)).toContain('Task owner') - expect(settled.map((record) => record.description)).not.toContain('Task done-0') - expect(settled.map((record) => record.description)).not.toContain('Task done-1') + expect(settled).toHaveLength(100) + expect(settled.map((record) => record.description)).toContain('Task done-0') + }) + + it('removes work that stopped with nothing to report, and only the record it names', () => { + const { store, apply } = harness() + apply(live(child('owner')), live(child('shell', { kind: 'command', ownerId: 'owner' }))) + expect( + apply({ type: 'removed', observedAt: 200, handle: { idKind: 'task_id', id: 'shell' } }) + ).toMatchObject({ removed: 1, settled: 0 }) + expect(only(store)).toMatchObject({ description: 'Task owner', membership: 'live' }) + expect(store.getAliasesForChild('child-2')).toEqual([]) + // A handle it no longer answers to removes nothing. + expect( + apply({ type: 'removed', observedAt: 201, handle: { idKind: 'task_id', id: 'shell' } }) + ).toMatchObject({ removed: 0 }) + expect(records(store)).toHaveLength(1) }) }) diff --git a/src/shared/agent-status-child-work-reconciliation.ts b/src/shared/agent-status-child-work-reconciliation.ts index 08d057afc96b..43f23b85483a 100644 --- a/src/shared/agent-status-child-work-reconciliation.ts +++ b/src/shared/agent-status-child-work-reconciliation.ts @@ -1,14 +1,17 @@ // Fold one structured session's child-work evidence into the host's records. // // The store holds the only current record per child; evidence patches it. A child settles on its -// own ending, or `unknown` when its session ends while it is still live. It owns only the records -// its own producer admitted, and never claims an outcome the evidence did not report. +// own ending, or `unknown` when its session ends while it is still live; work with nothing to +// report once it stops is removed instead. Settled children stay until the host drops the parent's +// row. It owns only the records its own producer admitted, and never claims an outcome the +// evidence did not report. import type { AgentChildWorkAdmission } from './agent-status-child-work-admission' import type { AgentChildWorkEndedEvidence, AgentChildWorkEvidence, - AgentChildWorkOperationEvidence + AgentChildWorkOperationEvidence, + AgentChildWorkRemovedEvidence } from './agent-status-child-work-evidence' import { applyAgentChildWorkLive, @@ -26,9 +29,6 @@ import { export type { AgentChildWorkReconcileOutcome } from './agent-status-child-work-evidence-admission' -/** Settled children kept per session. The oldest go first, never one that owns live work. */ -export const STRUCTURED_CHILD_WORK_MAX_SETTLED = 32 - export type AgentChildWorkReconcileInput = AgentChildWorkEvidenceScope & { admission: AgentChildWorkAdmission evidence: readonly AgentChildWorkEvidence[] @@ -98,32 +98,20 @@ function settleLive(ctx: ReconcileContext, observedAt: number): void { } } -function removeChildren(ctx: ReconcileContext, childWorkIds: string[]): void { - if (childWorkIds.length > 0 && ctx.store.applyMutation({ removeChildren: childWorkIds })) { - ctx.outcome.removed += childWorkIds.length +/** The work is gone and has no ending to keep: its record, and the handles it answered to, go. */ +function applyRemoved(ctx: ReconcileContext, edge: AgentChildWorkRemovedEvidence): void { + const resolution = resolveAgentChildWorkHandle(ctx, [edge.handle.idKind], edge.handle.id) + if (resolution?.ambiguous) { + ctx.outcome.rejected.push({ handleId: edge.handle.id, reason: 'ambiguous' }) + return } -} - -/** Oldest-settled first; a settled child that still owns live work stays so its work keeps an owner. */ -function trimSettled(ctx: ReconcileContext): void { - const owned = ownedStructuredChildWork(ctx) - const settled = owned.filter((record) => record.membership === 'settled') - const excess = settled.length - STRUCTURED_CHILD_WORK_MAX_SETTLED - if (excess <= 0) { + const existing = resolution?.child + if (!existing || agentChildWorkRunVerdict(ctx, existing, edge.handle.runId) === 'previous') { return } - const owners = new Set( - owned.flatMap((record) => - record.membership === 'live' && record.parentChildWorkId ? [record.parentChildWorkId] : [] - ) - ) - const removable = settled - .filter((record) => !owners.has(record.childWorkId)) - .sort((a, b) => (a.settledAt ?? a.observedAt) - (b.settledAt ?? b.observedAt)) - removeChildren( - ctx, - removable.slice(0, excess).map((record) => record.childWorkId) - ) + if (ctx.store.applyMutation({ removeChildren: [existing.childWorkId] })) { + ctx.outcome.removed += 1 + } } /** Apply one batch of evidence. The parent must already be held: the store refuses a child whose @@ -145,13 +133,11 @@ export function reconcileAgentChildWorkEvidence( applyOperation(ctx, edge) } else if (edge.type === 'ended') { applyEnded(ctx, edge) + } else if (edge.type === 'removed') { + applyRemoved(ctx, edge) } else { settleLive(ctx, edge.observedAt) } } - // Only a settle adds settled history; skipping the scan otherwise keeps progress edges cheap. - if (ctx.outcome.settled > 0) { - trimSettled(ctx) - } return ctx.outcome } diff --git a/src/shared/agent-status-child-work-view.ts b/src/shared/agent-status-child-work-view.ts index 80324d854e43..8c70f6a3fea9 100644 --- a/src/shared/agent-status-child-work-view.ts +++ b/src/shared/agent-status-child-work-view.ts @@ -60,7 +60,8 @@ export type AgentChildWorkViewAlias = Pick< const PROVIDER_ID_ALIAS_RANK: Record = { task_id: 0, thread_id: 1, - tool_use_id: 2 + tool_use_id: 2, + turn_id: 3 } const PROVIDER_ID_ALIAS_ORDER = [...AGENT_CHILD_WORK_ALIAS_KINDS].sort( (left, right) => PROVIDER_ID_ALIAS_RANK[left] - PROVIDER_ID_ALIAS_RANK[right] From a880c885a61fba7af7ce9aeeef6e77acf6762ca5 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 14:59:29 -0700 Subject: [PATCH 32/90] test(browser): check grab scope through responsive chrome (#23709) --- .../browser-floating-shortcut-scope.spec.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/e2e/browser-floating-shortcut-scope.spec.ts b/tests/e2e/browser-floating-shortcut-scope.spec.ts index 653c81a0dd9b..a7df8992b441 100644 --- a/tests/e2e/browser-floating-shortcut-scope.spec.ts +++ b/tests/e2e/browser-floating-shortcut-scope.spec.ts @@ -69,16 +69,20 @@ function findInput(page: Page, browserTabId: string) { return browserOverlay(page, browserTabId).getByPlaceholder('Find in page...') } -function grabButton(page: Page, browserTabId: string) { +function cancelGrabButton(page: Page, browserTabId: string) { return browserOverlay(page, browserTabId).getByRole('button', { - name: 'Grab page element', + name: 'Cancel', exact: true }) } // Why: a non-editable chrome target, so reload and grab are not skipped as text-field keys. async function focusChrome(page: Page, browserTabId: string): Promise { - const target = grabButton(page, browserTabId) + // Reload stays in the toolbar when narrow panes fold their element tools into the menu. + const target = browserOverlay(page, browserTabId).getByRole('button', { + name: 'Reload', + exact: true + }) await expect(target).toBeEnabled() await target.focus() await expect(target).toBeFocused() @@ -148,10 +152,10 @@ test.describe('floating browser shortcut scope', () => { await focusChrome(orcaPage, owner) await orcaPage.keyboard.press(`${shortcutModifier}+c`) - await expect(grabButton(orcaPage, owner)).toHaveAttribute('data-variant', 'default') - await expect(grabButton(orcaPage, other)).toHaveAttribute('data-variant', 'ghost') - await grabButton(orcaPage, owner).click() - await expect(grabButton(orcaPage, owner)).toHaveAttribute('data-variant', 'ghost') + await expect(cancelGrabButton(orcaPage, owner)).toBeVisible() + await expect(cancelGrabButton(orcaPage, other)).toBeHidden() + await cancelGrabButton(orcaPage, owner).click() + await expect(cancelGrabButton(orcaPage, owner)).toBeHidden() }) } From 2ca4ecbc61cce7a467ce6b946c006d8d3f481031 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:19:44 -0700 Subject: [PATCH 33/90] feat(orchestration): let a structured chat run orchestration as itself (#22568) * feat(orchestration): inject the Orca session id into structured children and let the CLI act as it Every structured session's child (native Claude, native Codex, and the terminal view) carries ORCA_AGENT_SESSION_ID and reaches the Orca CLI. The CLI sends the id in the orchestration envelope; when present it is the caller, and a caller flag naming anyone else is refused before any request. The id is stripped from inherited PTY env and from the SSH host-CLI passthrough, and crosses into WSL so the host can refuse the cross-host claim. * test(orchestration): pin session id injection for native Claude, native Codex, the terminal view, WSL, PTY inheritance and SSH * test(orchestration): pin one caller precedence rule across every CLI verb that names its caller Adds the per-verb table (flagless acts as the session; a conflicting --from or --terminal is refused before any request; the session's own spellings are accepted), the enumerated guess population with its positive control, the structured worker's own handle, the identity-less refusal for an older child, the unchanged terminal agent, and the envelope. dispatch-show's --from only fills preview text, so it passes through unfenced and a session's flagless preview names the address the real dispatch writes. * refactor(orchestration): keep the identity-less marker reader to the marker; the id is checked first * test(orchestration): pin that a host refusal of the session surfaces verbatim from the CLI * fix(orchestration): keep the identity-less marker beside the id for CLIs that predate it A CLI older than the id, reached through a global install when a shell rc resets PATH, would otherwise guess a sibling's terminal in a chat that no longer carries the marker. It refuses on the marker instead; a current CLI checks the id first, so the marker never makes a session with an id identity-less. * fix(orchestration): refuse a conflicting --from on gate-list and task-list scoped by --run A --run listing needs no caller, so both handlers skipped the resolver and a --from naming another actor was dropped silently under a session. The conflict check now runs on that branch too; terminal callers are unchanged. * fix(orchestration): name this app's CLI by absolute path for a structured session's login shells A provider can run each command in a login shell: Codex runs zsh -lc, and the profile rebuilds PATH, putting a global install (possibly an older Orca) ahead of the directory Orca prepended. ORCA_CLI_COMMAND, which an agent resolves the CLI from first, is now the absolute launcher in that directory (the native launcher on Windows), so no shell's startup files can swap it. The PATH prepend stays for shells that read no profile. Found by the live coordinator run of the next PR. * test(orchestration): pin a structured worker's CLI command as this app's absolute launcher * test(orchestration): run the zsh login-shell arm in the real-shell lane that installs zsh The ordinary Linux unit lane has no /bin/zsh, so the zsh arm failed there with ENOENT. It moves to a live-shell file registered in the shell-contracts lane; the bash arm keeps running in every lane. The lane guard's detector now also sees a zsh spawned through the ProcessSpec program field, which is how this test escaped it. * fix(orchestration): omit a structured child's CLI command when no launcher resolves, and pin its instance A bare `orca` fallback named GNOME's screen reader on packaged Linux, and an inherited value named another app's CLI. The builder now deletes any inherited value, sets the absolute launcher only when one resolved, and pins ORCA_USER_DATA_PATH so a current CLI dials the instance that minted the id. Renames the marker reader to hasStructuredSessionMarker and records why the terminal view carries the id without the marker. * fix(terminal): name this app's CLI launcher by absolute path in every local terminal ORCA_CLI_COMMAND meant three things by lane: an absolute launcher for a structured session, a bare name for WSL, and nothing for any other terminal, so a structured session's terminal view lost it. Local terminals now get the same absolute launcher the structured lane gets; WSL keeps its guest command name, and a terminal whose launcher does not resolve still gets none. * feat(cli): hand a command to the session's own CLI when another Orca CLI was invoked A login shell can reorder PATH behind a global install, and an agent or its helper script can run bare `orca`, so the binary that answered depended on the agent following instructions. Orca's packaged launchers and bare-orca shims now export ORCA_CLI_SELF (outermost wins). At the CLI entry, when it names a different launcher than ORCA_CLI_COMMAND, the command re-runs once through the named launcher with ORCA_CLI_REEXEC=1 and exits with its status; both variables are consumed so no child inherits them. Dev launchers export no self on purpose, WSL and SSH names never qualify, and a launcher that cannot start leaves the command to run here. The Windows launcher no longer rewrites ORCA_CLI_COMMAND; the legacy ask protocol normalizes its resume command itself. * refactor(orchestration): declare which flag names the caller on each spec and refuse at the CLI entry Each handler hand-classified its --from/--terminal as the caller or a target, and the refusal of a conflicting caller flag ran inside the caller resolver plus two standalone calls for --run listings, so a new verb that read its flag raw would pass a sibling's handle to a pre-session host. Specs now declare identityFlagRoles, the CLI entry refuses a conflicting caller flag once from the spec, the resolver only applies the id-wins rule, and a test fails any orchestration verb that accepts --from or --terminal without classifying it. * perf(cli): keep the session caller check off the actor codec's module graph The check runs at the CLI entry for every command, and the actor codec pulls zod through the session record. Compare the session's own spellings as plain strings instead. * refactor(cli): spell a session's address from the one prefix constant, off the codec's module graph The Orca session address prefix moves to a leaf module with no imports, re-exported by the address codec, so the CLI entry check derives `session:` from that constant instead of re-typing it and still stays off the codec's zod graph. Prose and test names say caller or Orca session id, not actor. * refactor(orchestration): drop the session id's terminal-view spawn now that the handoff is gone The terminal handoff was removed, so no terminal is ever a structured session: - delete the terminal-view identity env and its WSL passthrough, and their tests; - strip the session caller keys from every terminal's env unconditionally; - the CLI's own-address spelling moves beside the injected id in src/shared, with a test pinning it to the address the host's party resolver gives that session. * fix(terminal): run the Codex launch preflight through the CLI the terminal names Packaged Linux names the userData shim in ORCA_CLI_COMMAND, while the preflight ran the bundled launcher behind it. The CLI saw a different launcher and handed the preflight off to the shim, booting Electron twice before every codex launch. * revert(terminal): keep terminals on main's ORCA_CLI_COMMAND and Codex preflight Only a structured session needs an absolute ORCA_CLI_COMMAND; local terminals go back to naming none (WSL keeps its guest command), and the Codex launch preflight goes back to the bundled launcher. The CLI handoff is scoped to sessions, so a terminal's preflight can no longer be handed off and start Electron twice. This reverts commit d2cefb6c035 and commit dd2853a5a9a. * fix(cli): hand off to the session's CLI only inside a structured session The handoff ran whenever an Orca launcher's ORCA_CLI_SELF differed from an absolute ORCA_CLI_COMMAND, so any process with both - a terminal, a script - ran another install's CLI instead of the one invoked: a beta's --version lied, and an AppImage command from a terminal that outlived its Orca failed. It now requires the injected session id, the identity it exists to deliver. The launcher variables are still consumed in every process. * fix(cli): name the packaged Windows command after the handoff decision The launcher stopped writing orca/orca-ide over ORCA_CLI_COMMAND so the handoff could see a session's absolute launcher, which also changed what every Windows terminal's CLI read. The CLI entry now applies the launcher's rule itself once the handoff is decided, so terminals and the legacy ask resume command see exactly what they saw before, and the resume-command reader goes back to its original form. * refactor(cli): decide the session handoff from the CLI's own entry, not a launcher export Every packaged launcher, shim and dispatcher exported ORCA_CLI_SELF so the CLI could tell which launcher ran it, and compared that with the session's ORCA_CLI_COMMAND. Two launchers of the same app are different files, so a session that reached its own app through a global orca-ide on Linux still handed off and started Electron twice, and the export rode artifacts every terminal uses. A structured session now also names the JS entry its launcher runs (ORCA_SESSION_CLI_ENTRY), and the CLI compares its own argv entry with it: any launcher of the same app stays, another install hands off. The launcher scripts, Linux shim and dispatcher go back to main; the Windows launcher keeps only leaving ORCA_CLI_COMMAND for the CLI to name after the handoff decision. * refactor(cli): drop the session CLI handoff; the pinned instance and injected id already bind any current CLI Every current Orca CLI dials the instance ORCA_USER_DATA_PATH names and sends the injected session id in the orchestration envelope, so a bare `orca` that reaches another install's current CLI already acts as the session. An older CLI has no handoff code and refuses on the marker. The handoff only lined up versions between two current CLIs, and comparing two separately derived paths kept misfiring (an AppImage's mount against its registered extraction started the CLI twice on every call). Removes the re-exec, ORCA_SESSION_CLI_ENTRY and ORCA_CLI_REEXEC, and the CLI-side Windows command naming; the packaged Windows launcher rewrites ORCA_CLI_COMMAND again, as on main, inside its own process only. resolveHostCliEntryPath goes back to the SSH passthrough. * test(orchestration): say why the registered worker case pins the handle, now that every session's env is populated --- .github/workflows/pr.yml | 1 + config/scripts/ci-unit-files.mjs | 1 + .../scripts/pr-workflow-parallelism.test.mjs | 3 +- .../vitest-caller-identity-env-setup.ts | 8 + config/tsconfig.node.json | 1 + config/vitest.config.ts | 3 +- src/cli/command-spec.ts | 5 + .../orchestration/dispatch-handlers.ts | 8 +- .../orchestration/message-check-handler.ts | 12 +- .../orchestration/message-send-handler.ts | 7 +- .../orchestration/question-handler.ts | 4 +- .../handlers/orchestration/run-handlers.ts | 4 +- .../orchestration/terminal-identity.ts | 28 +- src/cli/index-orchestration.test.ts | 19 + src/cli/index.ts | 5 + .../orchestration-session-caller-cli.test.ts | 636 ++++++++++++++++++ .../orchestration-compatibility-envelope.ts | 7 +- src/cli/session-caller-flags.ts | 57 ++ src/cli/specs/orchestration-worker-specs.ts | 1 + src/cli/specs/orchestration.ts | 33 +- .../claude-stream-json-connection.test.ts | 5 + ...laude-structured-launch-resolution.test.ts | 13 + .../claude-structured-launch-resolution.ts | 7 +- src/main/cli/orca-cli-child-path.ts | 16 +- ...codex-structured-child-environment.test.ts | 87 ++- .../codex-structured-child-environment.ts | 7 +- .../codex-structured-session-adapter.test.ts | 8 +- .../pty-daemon-spawn-agent-home-env.test.ts | 11 + .../ipc/pty-spawn-env-terminal-basics.test.ts | 10 + src/main/ipc/pty/host-env/pi-agent.ts | 17 +- src/main/ipc/pty/host-env/spawn-env-keys.ts | 9 + src/main/ipc/pty/ipc/spawn-options.ts | 4 +- src/main/ipc/pty/runtime/spawn-options.ts | 4 +- src/main/providers/provider-dispatch.test.ts | 8 +- .../orchestration-party-cli-address.test.ts | 50 ++ ...stration-structured-worker-session.test.ts | 18 +- ...uctured-session-child-identity-env.test.ts | 193 ++++++ .../structured-session-child-identity-env.ts | 93 +++ ...session-cli-login-shell.live-shell.test.ts | 34 + ...structured-session-cli-login-shell.test.ts | 38 ++ ...ctured-session-login-shell-test-harness.ts | 48 ++ ...ructured-worker-child-identity-env.test.ts | 146 ---- .../structured-worker-child-identity-env.ts | 74 -- .../structured-worker-identity.test.ts | 8 +- .../runtime/structured-worker-identity.ts | 15 +- .../ssh-remote-cli-host-passthrough.test.ts | 22 + .../ssh/ssh-remote-cli-host-passthrough.ts | 6 + src/shared/agent-session-caller-env.ts | 38 ++ src/shared/orca-session-address-prefix.ts | 2 + src/shared/orca-session-address.ts | 16 +- src/shared/structured-session-marker.ts | 17 +- src/shared/structured-worker-handle.ts | 7 + 52 files changed, 1568 insertions(+), 306 deletions(-) create mode 100644 config/scripts/vitest-caller-identity-env-setup.ts create mode 100644 src/cli/orchestration-session-caller-cli.test.ts create mode 100644 src/cli/session-caller-flags.ts create mode 100644 src/main/runtime/orchestration/orchestration-party-cli-address.test.ts create mode 100644 src/main/runtime/structured-session-child-identity-env.test.ts create mode 100644 src/main/runtime/structured-session-child-identity-env.ts create mode 100644 src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts create mode 100644 src/main/runtime/structured-session-cli-login-shell.test.ts create mode 100644 src/main/runtime/structured-session-login-shell-test-harness.ts delete mode 100644 src/main/runtime/structured-worker-child-identity-env.test.ts delete mode 100644 src/main/runtime/structured-worker-child-identity-env.ts create mode 100644 src/shared/agent-session-caller-env.ts create mode 100644 src/shared/orca-session-address-prefix.ts create mode 100644 src/shared/structured-worker-handle.ts diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4c6f68147c40..ba3ba7556ed1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -614,6 +614,7 @@ jobs: src/main/zsh-scoped-histfile.live-shell.test.ts \ src/main/zsh-startup-hook-user-config-equivalence.live-shell.test.ts \ src/main/zsh-wrapper-version-mismatch.live-shell.test.ts \ + src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts \ src/renderer/src/components/terminal-pane/fish-color-scheme-child-stdin.node-pty.test.ts \ src/shared/fish-query-reply-child-stdin.node-pty.test.ts \ src/shared/pty-reply-echo-shapes.node-pty.test.ts \ diff --git a/config/scripts/ci-unit-files.mjs b/config/scripts/ci-unit-files.mjs index ec7101b6ee30..ab8d5038aed9 100644 --- a/config/scripts/ci-unit-files.mjs +++ b/config/scripts/ci-unit-files.mjs @@ -24,6 +24,7 @@ export const UNIT_EXCLUDE = [ 'src/main/zsh-scoped-histfile.live-shell.test.ts', 'src/main/zsh-startup-hook-user-config-equivalence.live-shell.test.ts', 'src/main/zsh-wrapper-version-mismatch.live-shell.test.ts', + 'src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts', 'src/renderer/src/components/terminal-pane/fish-color-scheme-child-stdin.node-pty.test.ts', 'src/shared/fish-query-reply-child-stdin.node-pty.test.ts', 'src/shared/pty-reply-echo-shapes.node-pty.test.ts', diff --git a/config/scripts/pr-workflow-parallelism.test.mjs b/config/scripts/pr-workflow-parallelism.test.mjs index b08365f5baf2..6804527fe3cc 100644 --- a/config/scripts/pr-workflow-parallelism.test.mjs +++ b/config/scripts/pr-workflow-parallelism.test.mjs @@ -28,6 +28,7 @@ const shellContractFiles = [ 'src/main/zsh-scoped-histfile.live-shell.test.ts', 'src/main/zsh-startup-hook-user-config-equivalence.live-shell.test.ts', 'src/main/zsh-wrapper-version-mismatch.live-shell.test.ts', + 'src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts', 'src/shared/posix-command-path-lookup.test.ts' ] const patchedNodePtyContractFiles = [ @@ -46,7 +47,7 @@ const testFilePatterns = [ // rather than calling spawnSync('zsh') themselves. Without this branch the rule // silently stops noticing the very tests that need the lane's zsh install. const realZshUsage = - /(?:spawnSync|execFileSync|spawn)\(\s*['"](?:\/(?:usr\/)?bin\/)?zsh['"]|spawnSync\(\s*['"]which['"]\s*,\s*\[\s*['"]zsh['"]|name:\s*['"]zsh['"]\s*,\s*path:\s*executablePath|from '[^']*zsh-startup-hook-pty-harness'/ + /(?:spawnSync|execFileSync|spawn)\(\s*['"](?:\/(?:usr\/)?bin\/)?zsh['"]|program:\s*['"](?:\/(?:usr\/)?bin\/)?zsh['"]|spawnSync\(\s*['"]which['"]\s*,\s*\[\s*['"]zsh['"]|name:\s*['"]zsh['"]\s*,\s*path:\s*executablePath|from '[^']*zsh-startup-hook-pty-harness'/ describe('PR workflow parallelism', () => { it('keeps lightweight orchestration jobs on the free slim runner', () => { diff --git a/config/scripts/vitest-caller-identity-env-setup.ts b/config/scripts/vitest-caller-identity-env-setup.ts new file mode 100644 index 000000000000..1d14998e46c6 --- /dev/null +++ b/config/scripts/vitest-caller-identity-env-setup.ts @@ -0,0 +1,8 @@ +/** + * Why: a structured chat exports its own orchestration caller identity to every child, including a + * test runner it launches. Inherited, it would decide which CLI identity branch a test exercises + * depending on who ran the suite; suites that need one set it themselves. + */ +for (const name of ['ORCA_AGENT_SESSION_ID', 'ORCA_STRUCTURED_SESSION']) { + delete process.env[name] +} diff --git a/config/tsconfig.node.json b/config/tsconfig.node.json index 4f7cc41bcc1e..0d3077d8f0e1 100644 --- a/config/tsconfig.node.json +++ b/config/tsconfig.node.json @@ -4,6 +4,7 @@ "../electron.vite.config.*", "./build-plugins/**/*", "./scripts/vitest-host-ports-setup.ts", + "./scripts/vitest-caller-identity-env-setup.ts", "../src/main/**/*", "../src/renderer/src/lib/skill-freshness-display-status.ts", "../src/renderer/src/components/native-chat/native-chat-resolution-receipt.ts", diff --git a/config/vitest.config.ts b/config/vitest.config.ts index b81bbc2b0f3a..d2a586169340 100644 --- a/config/vitest.config.ts +++ b/config/vitest.config.ts @@ -32,7 +32,8 @@ export default defineConfig({ setupFiles: [ resolve('config/scripts/happy-dom-offscreen-canvas.ts'), resolve('config/scripts/happy-dom-mutation-observer-retention.ts'), - resolve('config/scripts/vitest-host-ports-setup.ts') + resolve('config/scripts/vitest-host-ports-setup.ts'), + resolve('config/scripts/vitest-caller-identity-env-setup.ts') ], include: UNIT_INCLUDE, ...(process.env.ORCA_BALANCE_UNIT_SHARDS === '1' ? { exclude: UNIT_EXCLUDE } : {}), diff --git a/src/cli/command-spec.ts b/src/cli/command-spec.ts index 1922888a2925..dbb28a66d71c 100644 --- a/src/cli/command-spec.ts +++ b/src/cli/command-spec.ts @@ -15,8 +15,13 @@ export type CommandSpec = { positionalArgs?: string[] examples?: string[] notes?: string[] + // Why: `--from`/`--terminal` names either the acting caller or a target, and only the spec can + // say which. An agent session refuses a caller flag naming anyone else before dispatch. + identityFlagRoles?: Partial> } +export type IdentityFlag = 'from' | 'terminal' + export function specPaths(spec: CommandSpec): string[][] { return spec.aliases ? [spec.path, ...spec.aliases] : [spec.path] } diff --git a/src/cli/handlers/orchestration/dispatch-handlers.ts b/src/cli/handlers/orchestration/dispatch-handlers.ts index afe79ab8e2f3..c8ade53e907a 100644 --- a/src/cli/handlers/orchestration/dispatch-handlers.ts +++ b/src/cli/handlers/orchestration/dispatch-handlers.ts @@ -6,6 +6,7 @@ import { orchestrationMigrationData } from '../../../shared/orchestration-rpc-co import { callOrchestrationMutation } from './mutation-request' import { isDevCliInvocation } from './runtime-compatibility' import { resolveCoordinatorTerminalHandle } from './terminal-identity' +import { injectedSessionAddress } from '../../../shared/agent-session-caller-env' export const ORCHESTRATION_DISPATCH_HANDLER: Record = { 'orchestration dispatch': async ({ flags, client, cwd, json }) => { @@ -42,9 +43,12 @@ export const ORCHESTRATION_DISPATCH_HANDLER: Record = { export const ORCHESTRATION_DISPATCH_INSPECTION_HANDLERS: Record = { 'orchestration dispatch-show': async ({ flags, client, cwd, json }) => { const showPreamble = flags.has('preamble') ? true : undefined - // Why: a preview must embed the same real coordinator handle as an actual dispatch. + // Why: a preview must embed the same real coordinator handle as an actual dispatch. Its --from + // only fills preview text and names no caller, so it passes through unfenced. const from = showPreamble - ? await resolveCoordinatorTerminalHandle(flags, cwd, client) + ? (getOptionalStringFlag(flags, 'from') ?? + injectedSessionAddress() ?? + (await resolveCoordinatorTerminalHandle(flags, cwd, client))) : undefined const result = await client.call<{ dispatch: { id: string; task_id: string; status: string } | null diff --git a/src/cli/handlers/orchestration/message-check-handler.ts b/src/cli/handlers/orchestration/message-check-handler.ts index f2af827ee048..6ace43eac31a 100644 --- a/src/cli/handlers/orchestration/message-check-handler.ts +++ b/src/cli/handlers/orchestration/message-check-handler.ts @@ -13,7 +13,7 @@ import { startCheckKeepalive } from './check-keepalive' import { callOrchestrationMutation } from './mutation-request' import { getOptionalPositiveIntegerValueFlag } from './numeric-flags' import { flushOrchestrationStdout, resolveCompatibilityCliCommand } from './runtime-compatibility' -import { resolveOrchestrationTerminalHandle } from './terminal-identity' +import { orchestrationCallerLabel, resolveOrchestrationTerminalHandle } from './terminal-identity' type CheckResult = { messages: MessageSummary[] @@ -41,12 +41,16 @@ export const ORCHESTRATION_CHECK_HANDLER: Record = { const timeoutMs = getOptionalPositiveIntegerValueFlag(flags, 'timeout-ms') const explicitTerminal = getOptionalStringFlag(flags, 'terminal') const terminal = await resolveOrchestrationTerminalHandle(flags, cwd, client, 'terminal') + // Why: a session names itself by its id alone; a pane key it inherited is not its identity. + const paneKey = + explicitTerminal || terminal === undefined ? undefined : process.env.ORCA_PANE_KEY + const callerLabel = orchestrationCallerLabel(terminal) const stopKeepalive = wait ? startCheckKeepalive(timeoutMs) : null let result: Awaited>> try { result = await callOrchestrationMutation(client, flags, 'orchestration.check', { terminal, - terminalPaneKey: explicitTerminal ? undefined : process.env.ORCA_PANE_KEY || undefined, + terminalPaneKey: paneKey || undefined, // Why: old runtimes degrade peek to non-consuming all mode instead of destructive mark-read. unread: flags.has('unread') ? true : peek ? false : undefined, peek: peek ? true : undefined, @@ -68,9 +72,9 @@ export const ORCHESTRATION_CHECK_HANDLER: Record = { } result = { ...result, - result: prepareOrchestrationCheckOutput(result.result, terminal, flags.has('format')) + result: prepareOrchestrationCheckOutput(result.result, callerLabel, flags.has('format')) } - printResult(result, json, (value) => formatOrchestrationCheckText(value, terminal)) + printResult(result, json, (value) => formatOrchestrationCheckText(value, callerLabel)) const compatibilityAck = result.result.legacyCompatibility?.ackMessageIds if (compatibilityAck && compatibilityAck.length > 0) { await flushOrchestrationStdout() diff --git a/src/cli/handlers/orchestration/message-send-handler.ts b/src/cli/handlers/orchestration/message-send-handler.ts index 088d1361e69e..f79a846328b8 100644 --- a/src/cli/handlers/orchestration/message-send-handler.ts +++ b/src/cli/handlers/orchestration/message-send-handler.ts @@ -2,6 +2,7 @@ import type { CommandHandler } from '../../dispatch' import { printResult } from '../../format' import { getOptionalStringFlag, getRequiredStringFlag } from '../../flags' import { RuntimeClientError } from '../../runtime-client' +import { readInjectedAgentSessionId } from '../../../shared/agent-session-caller-env' import { requireWorkerDoneSettlement } from '../orchestration-worker-settlement' import { getOptionalStructuredMessagePayload } from './message-payload' import { callOrchestrationMutation } from './mutation-request' @@ -75,7 +76,8 @@ export const ORCHESTRATION_SEND_HANDLER: Record = { if ( (type === 'worker_done' || type === 'heartbeat') && !getOptionalStringFlag(flags, 'from') && - !process.env.ORCA_TERMINAL_HANDLE + !process.env.ORCA_TERMINAL_HANDLE && + !readInjectedAgentSessionId() ) { // Why: focus isn't lifecycle authority — an identity-less subprocess must fail closed rather than guess the worker. throwNoActiveSenderTerminal() @@ -94,7 +96,8 @@ export const ORCHESTRATION_SEND_HANDLER: Record = { threadId: getOptionalStringFlag(flags, 'thread-id'), payload: getOptionalStructuredMessagePayload(flags), // Why: pane key is the remint-stable sender identity the runtime verifies lifecycle ownership against; older runtimes strip it. - senderPaneKey: process.env.ORCA_PANE_KEY || undefined, + // A session names itself by its id alone. + senderPaneKey: from === undefined ? undefined : process.env.ORCA_PANE_KEY || undefined, waitForLifecycleSettlement: type === 'worker_done' ? true : undefined, devMode: isDevCliInvocation() } diff --git a/src/cli/handlers/orchestration/question-handler.ts b/src/cli/handlers/orchestration/question-handler.ts index bd9e239b6d59..67aaeb16e4d8 100644 --- a/src/cli/handlers/orchestration/question-handler.ts +++ b/src/cli/handlers/orchestration/question-handler.ts @@ -103,8 +103,8 @@ export const ORCHESTRATION_QUESTION_HANDLER: Record = { resolveOrchestrationCliExecutable(), 'orchestration', 'ask', - '--from', - from, + // A session's resume is flagless: its injected id names it again. + ...(from ? ['--from', from] : []), ...(dispatchCapability ? ['--dispatch-capability', dispatchCapability] : []), '--resume', messageId, diff --git a/src/cli/handlers/orchestration/run-handlers.ts b/src/cli/handlers/orchestration/run-handlers.ts index 7c77913df158..d8abe3533c2c 100644 --- a/src/cli/handlers/orchestration/run-handlers.ts +++ b/src/cli/handlers/orchestration/run-handlers.ts @@ -39,7 +39,9 @@ export const ORCHESTRATION_RUN_HANDLERS: Record = { run: { id: string; objective: string } | null }>('orchestration.runCurrent', { from }) printResult(result, json, (r) => - r.run ? `${r.run.id} ${r.run.objective}` : 'No Run is bound to this terminal.' + r.run + ? `${r.run.id} ${r.run.objective}` + : `No Run is bound to this ${from === undefined ? 'session' : 'terminal'}.` ) }, diff --git a/src/cli/handlers/orchestration/terminal-identity.ts b/src/cli/handlers/orchestration/terminal-identity.ts index e693d99079df..b97500db89b2 100644 --- a/src/cli/handlers/orchestration/terminal-identity.ts +++ b/src/cli/handlers/orchestration/terminal-identity.ts @@ -2,15 +2,28 @@ import type { RuntimeClient } from '../../runtime-client' import { getOptionalStringFlag } from '../../flags' import { RuntimeClientError } from '../../runtime-client' import { getTerminalHandle } from '../../selectors' -import { isStructuredSessionWithoutIdentity } from '../../../shared/structured-session-marker' +import { hasStructuredSessionMarker } from '../../../shared/structured-session-marker' +import { + injectedSessionAddress, + readInjectedAgentSessionId +} from '../../../shared/agent-session-caller-env' +/** + * The caller's terminal handle, or `undefined` when an injected agent session id names the caller: + * the orchestration envelope carries that id and the host binds the caller param to it, so nothing + * is resolved or guessed here. + */ export async function resolveOrchestrationTerminalHandle( flags: Map, cwd: string, client: RuntimeClient, flagName: 'from' | 'terminal', options: { validateEnvHandle?: boolean } = {} -): Promise { +): Promise { + // A caller flag naming anyone else was already refused at the CLI entry, from the command's spec. + if (readInjectedAgentSessionId()) { + return undefined + } const explicit = getOptionalStringFlag(flags, flagName) if (explicit) { return explicit @@ -35,7 +48,7 @@ export async function resolveOrchestrationTerminalHandle( // default, so that guess consumed another pane's oldest unread batch and marked it read, and the // rightful worker never saw its mail. Refusing is the only honest answer: this child genuinely // cannot infer its own identity. - if (isStructuredSessionWithoutIdentity()) { + if (hasStructuredSessionMarker()) { throw structuredSessionRefusal(flagName) } if (flagName === 'from') { @@ -157,11 +170,16 @@ function getClientErrorMessage(err: unknown): string | undefined { return typeof message === 'string' ? message : undefined } +/** How check output names its caller: the handle, or the session's address. */ +export function orchestrationCallerLabel(handle: string | undefined): string { + return handle ?? injectedSessionAddress() ?? 'unknown' +} + export async function resolveCoordinatorTerminalHandle( flags: Map, cwd: string, client: RuntimeClient -): Promise { +): Promise { return await resolveOrchestrationTerminalHandle(flags, cwd, client, 'from', { validateEnvHandle: true }) @@ -204,7 +222,7 @@ export function throwNoActiveSenderTerminal(): never { // place left that would tell an identity-less session to pass a handle it does not have. A stale // ORCA_TERMINAL_HANDLE is a different case — that caller HAS an identity, so it keeps the advice // to re-run under a live one. - if (isStructuredSessionWithoutIdentity() && !process.env.ORCA_TERMINAL_HANDLE) { + if (hasStructuredSessionMarker() && !process.env.ORCA_TERMINAL_HANDLE) { throw structuredSessionRefusal('from') } throw new RuntimeClientError( diff --git a/src/cli/index-orchestration.test.ts b/src/cli/index-orchestration.test.ts index c4e4438f2e9e..bc7366f5b11c 100644 --- a/src/cli/index-orchestration.test.ts +++ b/src/cli/index-orchestration.test.ts @@ -85,6 +85,25 @@ describe('orca cli worktree awareness', () => { expect(logSpy).toHaveBeenCalledWith('Sent 2 messages to 2 recipients') }) + it("refuses an agent session's caller flag naming another caller before any request", async () => { + // One chokepoint for every verb: the spec says which flag names the caller. + process.env.ORCA_AGENT_SESSION_ID = 'f7a1c0de-1111-4222-8333-444455556666' + const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {}) + try { + await main(['orchestration', 'check', '--terminal', 'term_sibling', '--json'], '/tmp/repo') + } finally { + delete process.env.ORCA_AGENT_SESSION_ID + } + + expect(callMock).not.toHaveBeenCalled() + expect(process.exitCode).toBe(1) + expect(JSON.parse(String(logSpy.mock.calls[0]?.[0]))).toMatchObject({ + ok: false, + error: { code: 'consumer_fenced' } + }) + process.exitCode = undefined + }) + it('rejects no-flag orchestration reset before calling the runtime', async () => { await main(['orchestration', 'reset'], '/tmp/repo') diff --git a/src/cli/index.ts b/src/cli/index.ts index b2e01c04e56f..be5277278766 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -20,6 +20,7 @@ import { printHelp } from './help' import type { RuntimeClient } from './runtime-client' import { COMMAND_SPECS } from './specs' import { resolveOrchestrationCliExecutable } from './runtime/orchestration-recovery-command' +import { refuseConflictingSessionCallerFlags } from './session-caller-flags' export { COMMAND_SPECS } from './specs' export { buildCurrentWorktreeSelector, normalizeWorktreeSelector } from './selectors' @@ -111,6 +112,10 @@ export async function main( // lookup so users do not get misleading "Orca is not running" failures for // simple command typos or unsupported flags. validateCommandAndFlags(COMMAND_SPECS, parsed) + refuseConflictingSessionCallerFlags( + findCommandSpec(COMMAND_SPECS, parsed.commandPath), + parsed.flags + ) const RuntimeClientClass = await loadRuntimeClientClass() const ignoreRemoteSelection = shouldIgnoreRemoteSelection(parsed.commandPath) const pairingCode = ignoreRemoteSelection ? null : parsed.flags.get('pairing-code') diff --git a/src/cli/orchestration-session-caller-cli.test.ts b/src/cli/orchestration-session-caller-cli.test.ts new file mode 100644 index 000000000000..9922094a8c5f --- /dev/null +++ b/src/cli/orchestration-session-caller-cli.test.ts @@ -0,0 +1,636 @@ +/** + * A command that runs inside a structured agent session is that session: the injected + * `ORCA_AGENT_SESSION_ID` names the caller, and nothing resolves or guesses a terminal for it. + * + * One rule for every verb that names a caller: a caller flag may restate the session, but a flag + * naming anyone else is refused before any request — never silently dropped, never allowed to win. + * The #21097 accident was a chat that named a sibling's terminal and consumed that sibling's mail. + * + * The session env here is the hardest case, a chat that inherited a pane's `ORCA_TERMINAL_HANDLE` + * and `ORCA_PANE_KEY` (an Orca launched from an Orca terminal), and the implicit-terminal guess has + * a sibling to find. + */ + +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' + +const callMock = vi.hoisted(() => vi.fn()) +const getTerminalHandleMock = vi.hoisted(() => vi.fn()) + +vi.mock('./format', () => ({ printResult: vi.fn() })) +vi.mock('./selectors', () => ({ getTerminalHandle: getTerminalHandleMock })) + +import { ORCHESTRATION_HANDLERS } from './handlers/orchestration' +import { findCommandSpec } from './args' +import { COMMAND_SPECS } from './specs' +import { refuseConflictingSessionCallerFlags } from './session-caller-flags' +import { createOrchestrationCompatibilityEnvelope } from './runtime/orchestration-compatibility-envelope' +import { getDefaultUserDataPath } from './runtime/metadata' +import { formatCliError, reportCliError } from './cli-error' +import { RuntimeRpcFailureError } from './runtime/types' + +const SESSION = 'f7a1c0de-1111-4222-8333-444455556666' +const IDENTITY_ENV = [ + 'ORCA_AGENT_SESSION_ID', + 'ORCA_TERMINAL_HANDLE', + 'ORCA_PANE_KEY', + 'ORCA_STRUCTURED_SESSION' +] as const +const originalEnv = Object.fromEntries(IDENTITY_ENV.map((name) => [name, process.env[name]])) + +/** Enough of every receipt shape that each handler finishes after its RPC. */ +const RESULT = { + result: { + run: { id: 'run_1', objective: 'o', consumer_generation: 1 }, + runs: [], + nextCursor: null, + messages: [], + count: 0, + message: { id: 'msg_1' }, + lifecycle: { action: 'completed' }, + dispatch: { id: 'dispatch_1', task_id: 'task_1', status: 'dispatched' }, + gate: { id: 'gate_1', task_id: 'task_1', status: 'pending', resolution: 'r' }, + gates: [], + task: { id: 'task_1', status: 'pending' }, + tasks: [], + answer: 'yes', + messageId: 'msg_1', + threadId: 'thread_1', + timedOut: false, + state: 'ready', + runId: 'run_1', + taskId: 'task_1', + dispatchId: 'dispatch_1', + effects: [], + residualResources: [], + workers: [], + counts: {} + } +} + +type Verb = { + command: string + flags: Record + /** The flag that names the caller, when the verb has one. */ + callerFlag?: 'from' | 'terminal' + method: string + callerParam: 'from' | 'terminal' | 'callerTerminalHandle' +} + +/** Every verb whose request names its caller: the host's caller-param map, from the CLI side. + * `dispatch-show` is not one: its --from only fills preview text, so it is pinned on its own. */ +const CALLER_VERBS: Verb[] = [ + { + command: 'run-create', + flags: { objective: 'o' }, + callerFlag: 'from', + method: 'runCreate', + callerParam: 'from' + }, + { + command: 'run-use', + flags: { id: 'run_1' }, + callerFlag: 'from', + method: 'runUse', + callerParam: 'from' + }, + { + command: 'run-current', + flags: {}, + callerFlag: 'from', + method: 'runCurrent', + callerParam: 'from' + }, + { command: 'check', flags: {}, callerFlag: 'terminal', method: 'check', callerParam: 'terminal' }, + { + command: 'send', + flags: { to: 'term_worker', subject: 's', body: 'b' }, + callerFlag: 'from', + method: 'send', + callerParam: 'from' + }, + { + command: 'reply', + flags: { id: 'msg_1', body: 'b' }, + callerFlag: 'from', + method: 'reply', + callerParam: 'from' + }, + { + command: 'ask', + flags: { to: 'term_worker', question: 'q' }, + callerFlag: 'from', + method: 'ask', + callerParam: 'from' + }, + { + command: 'dispatch', + flags: { task: 'task_1', to: 'term_worker' }, + callerFlag: 'from', + method: 'dispatch', + callerParam: 'from' + }, + { + command: 'gate-create', + flags: { task: 'task_1', question: 'q' }, + callerFlag: 'from', + method: 'gateCreate', + callerParam: 'from' + }, + { + command: 'gate-resolve', + flags: { id: 'gate_1', resolution: 'r' }, + callerFlag: 'from', + method: 'gateResolve', + callerParam: 'from' + }, + { command: 'gate-list', flags: {}, callerFlag: 'from', method: 'gateList', callerParam: 'from' }, + { + command: 'task-create', + flags: { spec: 's' }, + callerFlag: 'from', + method: 'taskCreate', + callerParam: 'callerTerminalHandle' + }, + { + command: 'task-list', + flags: {}, + callerFlag: 'from', + method: 'taskList', + callerParam: 'callerTerminalHandle' + }, + { + command: 'task-update', + flags: { id: 'task_1', status: 'completed' }, + callerFlag: 'from', + method: 'taskUpdate', + callerParam: 'callerTerminalHandle' + }, + { + command: 'worker-start', + flags: { spec: 's' }, + callerFlag: 'from', + method: 'workerStart', + callerParam: 'from' + }, + // No caller flag: its spec takes none. It asks runCurrent for the caller's Run. + { command: 'worker-list', flags: {}, method: 'runCurrent', callerParam: 'from' } +] + +/** Enough flags for any verb to get past its own validation to identity resolution. */ +const EVERY_REQUIRED_FLAG = { + objective: 'o', + id: 'id_1', + task: 'task_1', + spec: 's', + question: 'q', + resolution: 'r', + subject: 's', + body: 'b', + to: 'term_worker', + status: 'completed', + preamble: true, + request: 'req_1' +} as const + +function flagMap(flags: Record): Map { + return new Map(Object.entries(flags)) +} + +/** What `main()` does between parsing and dispatch: the spec-driven caller check, then the handler. */ +async function invoke( + command: string, + flags: Map, + json = true +): Promise { + const handler = ORCHESTRATION_HANDLERS[`orchestration ${command}`] + if (!handler) { + throw new Error(`no handler for ${command}`) + } + refuseConflictingSessionCallerFlags( + findCommandSpec(COMMAND_SPECS, ['orchestration', command]), + flags + ) + await handler({ + flags, + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: these handlers read only `call`; RuntimeClient is a class, so a structural double cannot satisfy it without the cast. + client: { call: callMock } as never, + cwd: '/tmp/repo', + json + }) +} + +function isParams(value: unknown): value is Record { + return typeof value === 'object' && value !== null && !Array.isArray(value) +} + +function callsTo(method: string): Record[] { + return callMock.mock.calls + .filter(([name]) => name === `orchestration.${method}`) + .map(([, params]) => (isParams(params) ? params : {})) +} + +function setEnv(env: Partial>): void { + for (const name of IDENTITY_ENV) { + const value = env[name] + if (value === undefined) { + delete process.env[name] + } else { + process.env[name] = value + } + } +} + +/** A chat with its id, plus a pane identity it inherited from the Orca that launched it. */ +function asSessionWithInheritedPane(): void { + setEnv({ + ORCA_AGENT_SESSION_ID: SESSION, + ORCA_TERMINAL_HANDLE: 'term_inherited_pane', + ORCA_PANE_KEY: 'tab_inherited:11111111-1111-4111-8111-111111111111' + }) +} + +beforeEach(() => { + callMock.mockReset().mockResolvedValue(RESULT) + getTerminalHandleMock.mockReset().mockResolvedValue('term_sibling') + vi.spyOn(console, 'log').mockImplementation(() => {}) + vi.spyOn(console, 'error').mockImplementation(() => {}) +}) + +afterEach(() => { + vi.restoreAllMocks() + setEnv(originalEnv) + process.exitCode = undefined +}) + +describe.each(CALLER_VERBS)('orchestration $command run as an agent session', (verb) => { + beforeEach(asSessionWithInheritedPane) + + it('acts as the session: no terminal is resolved, guessed or sent', async () => { + await invoke(verb.command, flagMap(verb.flags)) + + const [params] = callsTo(verb.method) + expect(params, 'the verb reached its method').toBeDefined() + expect(params?.[verb.callerParam]).toBeUndefined() + // An inherited pane is not the session's identity. + expect(params?.terminalPaneKey).toBeUndefined() + expect(params?.senderPaneKey).toBeUndefined() + expect(getTerminalHandleMock).not.toHaveBeenCalled() + expect(callMock.mock.calls.map(([name]) => name)).not.toEqual( + expect.arrayContaining([expect.stringMatching(/^terminal\./)]) + ) + }) + + it.runIf(verb.callerFlag !== undefined)( + 'refuses a caller flag naming another caller, before any request', + async () => { + const flags = flagMap({ ...verb.flags, [verb.callerFlag ?? 'from']: 'term_sibling' }) + + await expect(invoke(verb.command, flags)).rejects.toMatchObject({ + code: 'consumer_fenced', + message: expect.stringContaining(`agent session ${SESSION}`) + }) + expect(callMock).not.toHaveBeenCalled() + expect(getTerminalHandleMock).not.toHaveBeenCalled() + } + ) + + it.runIf(verb.callerFlag !== undefined)( + 'refuses an inherited pane handle too: the session, not the pane, is the caller', + async () => { + const flags = flagMap({ ...verb.flags, [verb.callerFlag ?? 'from']: 'term_inherited_pane' }) + + await expect(invoke(verb.command, flags)).rejects.toMatchObject({ code: 'consumer_fenced' }) + expect(callMock).not.toHaveBeenCalled() + } + ) + + it.runIf(verb.callerFlag !== undefined).each([`session:${SESSION}`, SESSION])( + 'accepts a caller flag that restates the session (%s)', + async (restated) => { + await invoke(verb.command, flagMap({ ...verb.flags, [verb.callerFlag ?? 'from']: restated })) + + const [params] = callsTo(verb.method) + expect(params, 'the verb reached its method').toBeDefined() + expect(params?.[verb.callerParam]).toBeUndefined() + } + ) +}) + +describe.each([ + { command: 'gate-list', method: 'gateList', callerParam: 'from' }, + { command: 'task-list', method: 'taskList', callerParam: 'callerTerminalHandle' } +])('orchestration $command --run run as an agent session', ({ command, method, callerParam }) => { + beforeEach(asSessionWithInheritedPane) + + it('needs no caller, but refuses a --from naming another caller, before any request', async () => { + await invoke(command, flagMap({ run: 'run_1' })) + expect(callsTo(method)[0]).toMatchObject({ run: 'run_1' }) + expect(callsTo(method)[0]?.[callerParam]).toBeUndefined() + + callMock.mockClear() + await expect( + invoke(command, flagMap({ run: 'run_1', from: 'term_sibling' })) + ).rejects.toMatchObject({ code: 'consumer_fenced' }) + expect(callMock).not.toHaveBeenCalled() + }) + + it('accepts a --from that restates the session', async () => { + await invoke(command, flagMap({ run: 'run_1', from: `session:${SESSION}` })) + expect(callsTo(method)[0]?.[callerParam]).toBeUndefined() + }) +}) + +describe('the identity a session presents', () => { + it("lets a structured worker restate its own minted handle, and nobody else's", async () => { + setEnv({ ORCA_AGENT_SESSION_ID: SESSION, ORCA_TERMINAL_HANDLE: 'structworker_self' }) + + await invoke('send', flagMap({ from: 'structworker_self', to: 'run:run_1', subject: 's' })) + expect(callsTo('send')[0]?.from).toBeUndefined() + + callMock.mockClear() + await expect( + invoke('send', flagMap({ from: 'structworker_other', to: 'run:run_1', subject: 's' })) + ).rejects.toMatchObject({ code: 'consumer_fenced' }) + expect(callMock).not.toHaveBeenCalled() + }) + + it("sends a structured worker's lifecycle report as the session, not refused as identity-less", async () => { + setEnv({ ORCA_AGENT_SESSION_ID: SESSION }) + + await invoke( + 'send', + flagMap({ to: 'run:run_1', subject: 'done', type: 'worker_done', outcome: 'succeeded' }) + ) + + expect(callsTo('send')[0]).toMatchObject({ type: 'worker_done' }) + expect(callsTo('send')[0]?.from).toBeUndefined() + }) + + it('never treats a session that has an id as identity-less, even beside the old marker', async () => { + setEnv({ ORCA_AGENT_SESSION_ID: SESSION, ORCA_STRUCTURED_SESSION: '1' }) + + await invoke('check', flagMap({})) + + expect(callsTo('check')).toHaveLength(1) + expect(getTerminalHandleMock).not.toHaveBeenCalled() + }) + + it('keeps the identity-less refusal, without --from advice, for a child that has no id', async () => { + setEnv({ ORCA_STRUCTURED_SESSION: '1' }) + + await expect(invoke('reply', flagMap({ id: 'msg_1', body: 'b' }))).rejects.toMatchObject({ + code: 'no_active_sender_terminal', + message: expect.not.stringContaining('Pass --from') + }) + expect(getTerminalHandleMock).not.toHaveBeenCalled() + expect(callMock).not.toHaveBeenCalled() + }) + + it('leaves a terminal agent exactly as it was: its own handle is the caller', async () => { + setEnv({ ORCA_TERMINAL_HANDLE: 'term_pty', ORCA_PANE_KEY: 'tab_pty:1:2' }) + callMock.mockImplementation(async (name: string) => + name === 'terminal.resolveIdentity' ? { result: { identity: { live: true } } } : RESULT + ) + + await invoke('run-create', flagMap({ objective: 'o' })) + await invoke('check', flagMap({})) + + expect(callsTo('runCreate')[0]?.from).toBe('term_pty') + expect(callsTo('check')[0]).toMatchObject({ + terminal: 'term_pty', + terminalPaneKey: 'tab_pty:1:2' + }) + }) + + it('previews a dispatch with the coordinator address the real dispatch would write', async () => { + const preview = async (flags: Record) => { + callMock.mockClear() + await invoke('dispatch-show', flagMap({ task: 'task_1', preamble: true, ...flags })) + return callsTo('dispatchShow')[0]?.from + } + asSessionWithInheritedPane() + expect(await preview({})).toBe(`session:${SESSION}`) + // Not a caller flag: it names the text to preview, so it is never fenced. + expect(await preview({ from: 'term_sibling' })).toBe('term_sibling') + setEnv({ ORCA_AGENT_SESSION_ID: SESSION, ORCA_TERMINAL_HANDLE: 'structworker_self' }) + expect(await preview({})).toBe('structworker_self') + expect(getTerminalHandleMock).not.toHaveBeenCalled() + }) + + it('resumes a timed-out ask as the session, without naming a terminal', async () => { + asSessionWithInheritedPane() + callMock.mockResolvedValue({ result: { ...RESULT.result, answer: null, timedOut: true } }) + const errors = vi.mocked(console.error) + + await invoke('ask', flagMap({ to: 'term_worker', question: 'q' }), false) + + const advice = errors.mock.calls.map(([line]) => String(line)).join('\n') + expect(advice).toContain('--resume msg_1') + expect(advice).not.toContain('--from') + }) +}) + +describe('a host refusal of the session', () => { + const WORKER_GONE = new RuntimeRpcFailureError({ + id: 'rpc_1', + ok: false, + error: { + code: 'session_caller_not_live', + message: `Agent session ${SESSION} is a structured worker whose worker identity this host no longer has, so it cannot act in orchestration. No effects were applied.`, + data: { effectsApplied: false } + }, + _meta: { runtimeId: 'runtime_1' } + }) + + it.each(['check', 'run-current', 'worker-list'])( + 'surfaces from %s verbatim, never widened, retried or turned into a terminal guess', + async (command) => { + asSessionWithInheritedPane() + callMock.mockRejectedValue(WORKER_GONE) + + await expect(invoke(command, flagMap({}))).rejects.toBe(WORKER_GONE) + expect(getTerminalHandleMock).not.toHaveBeenCalled() + expect(formatCliError(WORKER_GONE)).toBe(WORKER_GONE.message) + } + ) + + it('keeps the Orca id a provider-id refusal names, for a JSON reader to branch on', () => { + const providerId = new RuntimeRpcFailureError({ + id: 'rpc_1', + ok: false, + error: { + code: 'session_caller_provider_id', + message: 'provider id', + data: { effectsApplied: false, orcaSessionId: SESSION } + }, + _meta: { runtimeId: 'runtime_1' } + }) + const printed: string[] = [] + vi.mocked(console.log).mockImplementation((line: string) => { + printed.push(line) + }) + + reportCliError(providerId, true) + + expect(JSON.parse(printed.join('\n'))).toMatchObject({ + ok: false, + error: { code: 'session_caller_provider_id', data: { orcaSessionId: SESSION } } + }) + }) +}) + +describe('the orchestration envelope', () => { + it('carries the injected id beside whatever terminal evidence the process also has', () => { + const envelope = createOrchestrationCompatibilityEnvelope({ + ORCA_AGENT_SESSION_ID: ` ${SESSION} `, + ORCA_TERMINAL_HANDLE: 'term_inherited_pane' + }) + + expect(envelope.orchestrationCompatibilityEvidence).toEqual({ + terminalHandle: 'term_inherited_pane', + agentSessionId: SESSION + }) + }) + + it('binds whichever current Orca CLI the agent reached, not only the one the session names', () => { + // A login shell can put another install's `orca` first, and the packaged Windows launcher + // rewrites ORCA_CLI_COMMAND in its own process. Neither matters: the id rides the envelope + // and the pinned instance is the one dialed. + vi.stubEnv('ORCA_USER_DATA_PATH', '/data/session-orca') + try { + const envelope = createOrchestrationCompatibilityEnvelope({ + ORCA_AGENT_SESSION_ID: SESSION, + ORCA_CLI_COMMAND: 'orca', + ORCA_WINDOWS_PACKAGED_CLI_LAUNCHER: '1', + ORCA_USER_DATA_PATH: '/data/session-orca' + }) + + expect(envelope.orchestrationCompatibilityEvidence).toEqual({ agentSessionId: SESSION }) + expect(getDefaultUserDataPath('linux', '/home/u')).toBe('/data/session-orca') + } finally { + vi.unstubAllEnvs() + } + }) + + it('claims no session without an injected id', () => { + expect( + createOrchestrationCompatibilityEnvelope({ ORCA_AGENT_SESSION_ID: ' ' }) + .orchestrationCompatibilityEvidence + ).toBeUndefined() + }) + + it('keeps a WSL stamp beside the id, so the host can refuse the cross-host claim', () => { + const envelope = createOrchestrationCompatibilityEnvelope({ + ORCA_AGENT_SESSION_ID: SESSION, + ORCA_ORCHESTRATION_COMPATIBILITY_HOST_KIND: 'wsl', + ORCA_ORCHESTRATION_COMPATIBILITY_HOST_ID: 'local', + ORCA_ORCHESTRATION_COMPATIBILITY_HOST_INCARNATION: 'Ubuntu' + }) + + expect(envelope.orchestrationCompatibilityEvidence).toEqual({ + agentSessionId: SESSION, + host: { kind: 'wsl', hostId: 'local', distro: 'Ubuntu' } + }) + }) +}) + +describe('which flag names the caller, declared on every spec', () => { + const ORCHESTRATION_SPECS = COMMAND_SPECS.filter((spec) => spec.path[0] === 'orchestration') + + it('classifies every --from and --terminal an orchestration verb accepts', () => { + // A new verb cannot take either flag without saying whether it names the caller, so the entry + // check covers it by construction instead of each handler remembering to refuse. + const unclassified = ORCHESTRATION_SPECS.flatMap((spec) => + (['from', 'terminal'] as const) + .filter((flag) => spec.allowedFlags.includes(flag) && !spec.identityFlagRoles?.[flag]) + .map((flag) => `${spec.path.join(' ')} --${flag}`) + ) + expect(unclassified).toEqual([]) + }) + + const callerFlagVerbs = ORCHESTRATION_SPECS.flatMap((spec) => + (['from', 'terminal'] as const) + .filter((flag) => spec.identityFlagRoles?.[flag] === 'caller') + .map((flag) => ({ command: spec.path[1] ?? '', flag })) + ) + + it('covers the verbs whose requests name a caller', () => { + expect(callerFlagVerbs.length).toBeGreaterThanOrEqual(CALLER_VERBS.length) + }) + + it.each(callerFlagVerbs)( + '$command refuses --$flag naming another caller, before any request', + async ({ command, flag }) => { + asSessionWithInheritedPane() + await expect( + invoke(command, flagMap({ ...EVERY_REQUIRED_FLAG, [flag]: 'term_sibling' })) + ).rejects.toMatchObject({ code: 'consumer_fenced' }) + expect(callMock).not.toHaveBeenCalled() + expect(getTerminalHandleMock).not.toHaveBeenCalled() + } + ) + + it.each( + ORCHESTRATION_SPECS.flatMap((spec) => + (['from', 'terminal'] as const) + .filter((flag) => spec.identityFlagRoles?.[flag] === 'target') + .map((flag) => ({ command: spec.path[1] ?? '', flag })) + ) + )('$command passes a --$flag target through unfenced', async ({ command, flag }) => { + asSessionWithInheritedPane() + await invoke(command, flagMap({ ...EVERY_REQUIRED_FLAG, [flag]: 'term_sibling' })).catch( + (error: unknown) => { + expect(error).not.toMatchObject({ code: 'consumer_fenced' }) + } + ) + expect(callMock.mock.calls.flatMap(([, params]) => Object.values(params ?? {}))).toContain( + 'term_sibling' + ) + }) +}) + +describe('every orchestration verb, enumerated', () => { + /** Runs every verb once; returns the ones that guessed an implicit terminal. */ + async function verbsThatGuess(): Promise { + const guessed: string[] = [] + for (const command of Object.keys(ORCHESTRATION_HANDLERS)) { + const verb = command.replace('orchestration ', '') + getTerminalHandleMock.mockClear() + callMock.mockClear() + await invoke(verb, flagMap(EVERY_REQUIRED_FLAG)).catch(() => undefined) + if (getTerminalHandleMock.mock.calls.length > 0) { + guessed.push(verb) + } + } + return guessed.sort() + } + + it('guesses a terminal for no verb when the session id is present', async () => { + // Positive control first: with no identity at all the same harness sees the guess, so an empty + // result below is about the id, not a harness that cannot observe a guess. + setEnv({}) + const population = await verbsThatGuess() + expect(population).toEqual([ + 'ask', + 'check', + 'dispatch', + 'dispatch-show', + 'gate-create', + 'gate-list', + 'gate-resolve', + 'reply', + 'run-create', + 'run-current', + 'run-use', + 'send', + 'task-create', + 'task-list', + 'task-update', + 'worker-list', + 'worker-start' + ]) + + asSessionWithInheritedPane() + expect(await verbsThatGuess()).toEqual([]) + }) +}) diff --git a/src/cli/runtime/orchestration-compatibility-envelope.ts b/src/cli/runtime/orchestration-compatibility-envelope.ts index 8172e556dc1e..7d6c0dfda80b 100644 --- a/src/cli/runtime/orchestration-compatibility-envelope.ts +++ b/src/cli/runtime/orchestration-compatibility-envelope.ts @@ -1,12 +1,17 @@ import { randomUUID } from 'node:crypto' +import { readInjectedAgentSessionId } from '../../shared/agent-session-caller-env' import { readOrchestrationCompatibilityEvidence } from '../../shared/orchestration-compatibility-evidence' import type { RuntimeOrchestrationEnvelope } from '../../shared/runtime-rpc-envelope' export function createOrchestrationCompatibilityEnvelope( env: NodeJS.ProcessEnv ): RuntimeOrchestrationEnvelope { + const evidence = readOrchestrationCompatibilityEvidence(env) + // Read here, from this CLI's own environment only: the SSH paths build evidence from a remote + // shell's environment, where a session id could never name a session on this host. + const agentSessionId = readInjectedAgentSessionId(env) return { compatibilityInvocationId: randomUUID(), - orchestrationCompatibilityEvidence: readOrchestrationCompatibilityEvidence(env) + orchestrationCompatibilityEvidence: agentSessionId ? { ...evidence, agentSessionId } : evidence } } diff --git a/src/cli/session-caller-flags.ts b/src/cli/session-caller-flags.ts new file mode 100644 index 000000000000..cbefa9ee2b8d --- /dev/null +++ b/src/cli/session-caller-flags.ts @@ -0,0 +1,57 @@ +/** + * An agent session is its own orchestration caller. A flag that names the caller may restate that + * session, but one naming anyone else is refused before any handler runs — never dropped, never + * allowed to win. Against a host that predates session callers this is the only guard: such a host + * would honor the flag as the caller, which is how a chat consumed a sibling's mail (#21097). + * + * Whether `--from`/`--terminal` names the caller or a target is declared on the command's spec + * (`identityFlagRoles`) and checked once, here, at the CLI entry, so a handler cannot forget it. + */ + +import type { CommandSpec, IdentityFlag } from './command-spec' +import { RuntimeClientError } from './runtime/types' +import { + injectedSessionAddress, + readInjectedAgentSessionId +} from '../shared/agent-session-caller-env' +import { ORCA_SESSION_ADDRESS_PREFIX } from '../shared/orca-session-address-prefix' + +export function refuseConflictingSessionCallerFlags( + spec: CommandSpec | undefined, + flags: ReadonlyMap, + env: NodeJS.ProcessEnv = process.env +): void { + const sessionId = readInjectedAgentSessionId(env) + if (!sessionId || !spec?.identityFlagRoles) { + return + } + for (const flagName of IDENTITY_FLAGS) { + const declared = flags.get(flagName) + if ( + spec.identityFlagRoles[flagName] === 'caller' && + typeof declared === 'string' && + !namesInjectedSession(declared, sessionId, env) + ) { + throw new RuntimeClientError( + 'consumer_fenced', + `This command runs as agent session ${sessionId}, so --${flagName} ${declared} would act as a ` + + `different caller. Drop --${flagName}: this session's orchestration commands already act as ` + + `${ORCA_SESSION_ADDRESS_PREFIX}${sessionId}. No request was sent.` + ) + } + } +} + +const IDENTITY_FLAGS: readonly IdentityFlag[] = ['from', 'terminal'] + +/** + * The session's own spellings, plus the handle a structured worker session was minted. Plain + * strings: this runs at the CLI entry for every command, before the address codec's module graph. + */ +function namesInjectedSession(value: string, sessionId: string, env: NodeJS.ProcessEnv): boolean { + return ( + value === sessionId || + value === `${ORCA_SESSION_ADDRESS_PREFIX}${sessionId}` || + value === injectedSessionAddress(env) + ) +} diff --git a/src/cli/specs/orchestration-worker-specs.ts b/src/cli/specs/orchestration-worker-specs.ts index 1448667e54ae..04423ffc6fb0 100644 --- a/src/cli/specs/orchestration-worker-specs.ts +++ b/src/cli/specs/orchestration-worker-specs.ts @@ -31,6 +31,7 @@ export const ORCHESTRATION_WORKER_COMMAND_SPECS: CommandSpec[] = [ 'from', 'retry-request' ], + identityFlagRoles: { from: 'caller', terminal: 'target' }, notes: [ 'Current and existing worktrees never rerun setup; a fresh agent terminal is created unless --terminal is explicit.', 'When reusing --terminal, pass --worktree for that terminal; current means the coordinator worktree.', diff --git a/src/cli/specs/orchestration.ts b/src/cli/specs/orchestration.ts index 458afa2e5257..8c4418f38ba5 100644 --- a/src/cli/specs/orchestration.ts +++ b/src/cli/specs/orchestration.ts @@ -9,6 +9,7 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ usage: 'orca orchestration run-create --objective [--from ] [--retry-request ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'objective', 'from', 'retry-request'], + identityFlagRoles: { from: 'caller' }, notes: [ 'A Run is a namespace and home inbox. It never schedules or places workers.', '--retry-request is only for exact recovery after an unknown mutation result.' @@ -20,6 +21,7 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ usage: 'orca orchestration run-use --id [--from ] [--takeover-legacy] [--retry-request ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'id', 'from', 'takeover-legacy', 'retry-request'], + identityFlagRoles: { from: 'caller' }, notes: [ '--takeover-legacy must run in the live coordinator agent terminal it binds; it preserves existing worker assignments.' ] @@ -28,7 +30,8 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ path: ['orchestration', 'run-current'], summary: 'Show the Run bound to this coordinator terminal', usage: 'orca orchestration run-current [--from ] [--json]', - allowedFlags: [...GLOBAL_FLAGS, 'from'] + allowedFlags: [...GLOBAL_FLAGS, 'from'], + identityFlagRoles: { from: 'caller' } }, { path: ['orchestration', 'run-list'], @@ -67,6 +70,7 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ 'report-path', 'phase' ], + identityFlagRoles: { from: 'caller' }, notes: [ 'Valid --type values: status, dispatch, worker_done, merge_ready, escalation, handoff, decision_gate, question, heartbeat.', 'To answer a worker question, use orchestration reply --id --body with the same Orca CLI executable.', @@ -109,6 +113,7 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ 'timeout-ms', 'retry-request' ], + identityFlagRoles: { terminal: 'caller' }, notes: [ 'On Windows PowerShell, quote comma-separated type filters, e.g. --types "worker_done,escalation".', '--types is the wake condition for --wait; a returned Delivery is always the whole FIFO batch, so it is never filtered by type. Without --wait it has no effect on consuming checks. Only --peek and --all filter their rows.', @@ -121,13 +126,15 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ summary: 'Reply to a message', usage: 'orca orchestration reply --id --body [--run ] [--from ] [--retry-request ] [--json]', - allowedFlags: [...GLOBAL_FLAGS, 'id', 'body', 'run', 'from', 'retry-request'] + allowedFlags: [...GLOBAL_FLAGS, 'id', 'body', 'run', 'from', 'retry-request'], + identityFlagRoles: { from: 'caller' } }, { path: ['orchestration', 'inbox'], summary: 'Show messages across (or for) recipients', usage: 'orca orchestration inbox [--limit ] [--terminal ] [--full] [--json]', - allowedFlags: [...GLOBAL_FLAGS, 'limit', 'terminal', 'full'] + allowedFlags: [...GLOBAL_FLAGS, 'limit', 'terminal', 'full'], + identityFlagRoles: { terminal: 'target' } }, { path: ['orchestration', 'task-create'], @@ -144,7 +151,8 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ 'run', 'from', 'retry-request' - ] + ], + identityFlagRoles: { from: 'caller' } }, { path: ['orchestration', 'task-list'], @@ -152,6 +160,7 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ usage: 'orca orchestration task-list [--status ] [--ready] [--brief] [--run ] [--from ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'status', 'ready', 'brief', 'run', 'from'], + identityFlagRoles: { from: 'caller' }, notes: ['--brief collapses whitespace and caps each spec at 160 characters.'] }, { @@ -160,6 +169,7 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ usage: 'orca orchestration task-update --id --status [--result ] [--run ] [--from ] [--retry-request ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'id', 'status', 'result', 'run', 'from', 'retry-request'], + identityFlagRoles: { from: 'caller' }, notes: ['Valid --status values: pending, ready, dispatched, completed, failed, blocked.'] }, ...ORCHESTRATION_WORKER_COMMAND_SPECS, @@ -178,7 +188,8 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ 'dry-run', 'return-preamble', 'retry-request' - ] + ], + identityFlagRoles: { from: 'caller' } }, { path: ['orchestration', 'request-show'], @@ -196,7 +207,8 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ summary: 'Show dispatch context for a task', usage: 'orca orchestration dispatch-show --task [--preamble] [--from ] [--json]', - allowedFlags: [...GLOBAL_FLAGS, 'task', 'preamble', 'from'] + allowedFlags: [...GLOBAL_FLAGS, 'task', 'preamble', 'from'], + identityFlagRoles: { from: 'target' } }, { path: ['orchestration', 'ask'], @@ -215,6 +227,7 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ 'from', 'retry-request' ], + identityFlagRoles: { from: 'caller' }, notes: [ 'From an active Dispatch, a new question defaults to its owning Run mailbox.', 'Timeout leaves the question pending; resume with the original message ID.' @@ -234,6 +247,7 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ 'max-concurrent', 'worktree' ], + identityFlagRoles: { from: 'caller' }, notes: [ 'This command performs no effects and returns the exact `skills get orchestration --full` recovery action.', 'Use the lightweight Run, Task, and worker-start primitives described by the current skill.' @@ -254,14 +268,16 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ summary: 'Create a decision gate blocking a task', usage: 'orca orchestration gate-create --task --question [--options ] [--from ] [--retry-request ] [--json]', - allowedFlags: [...GLOBAL_FLAGS, 'task', 'question', 'options', 'from', 'retry-request'] + allowedFlags: [...GLOBAL_FLAGS, 'task', 'question', 'options', 'from', 'retry-request'], + identityFlagRoles: { from: 'caller' } }, { path: ['orchestration', 'gate-resolve'], summary: 'Resolve a pending decision gate', usage: 'orca orchestration gate-resolve --id --resolution [--from ] [--retry-request ] [--json]', - allowedFlags: [...GLOBAL_FLAGS, 'id', 'resolution', 'from', 'retry-request'] + allowedFlags: [...GLOBAL_FLAGS, 'id', 'resolution', 'from', 'retry-request'], + identityFlagRoles: { from: 'caller' } }, { path: ['orchestration', 'gate-list'], @@ -269,6 +285,7 @@ export const ORCHESTRATION_COMMAND_SPECS: CommandSpec[] = [ usage: 'orca orchestration gate-list [--task ] [--status ] [--run ] [--from ] [--json]', allowedFlags: [...GLOBAL_FLAGS, 'task', 'status', 'run', 'from'], + identityFlagRoles: { from: 'caller' }, notes: ['--run inspects a named Run without binding; otherwise gates are scoped to the caller.'] }, { diff --git a/src/main/claude/claude-stream-json-connection.test.ts b/src/main/claude/claude-stream-json-connection.test.ts index 946cf08e1c41..6d3f0d89f305 100644 --- a/src/main/claude/claude-stream-json-connection.test.ts +++ b/src/main/claude/claude-stream-json-connection.test.ts @@ -164,9 +164,12 @@ describe('Claude stream-json connection', () => { // An inherited value wins over the SDK's default, so clear it to pin the default. vi.stubEnv('CLAUDE_CODE_ENTRYPOINT', undefined) vi.stubEnv('ORCA_CONNECTION_MARKER', 'inherited') + // An Orca launched inside another structured session inherits that session's id. + vi.stubEnv('ORCA_AGENT_SESSION_ID', 'a0b1c2d3-0000-4000-8000-00000000abcd') const scenario = scriptScenario([HOLD_OPEN]) const connection = await open( launchFor(scenario, { + ORCA_AGENT_SESSION_ID: 'f7a1c0de-1111-4222-8333-444455556666', CLAUDE_CONFIG_DIR: '/accounts/managed/home', ANTHROPIC_AUTH_TOKEN: 'configured-token', ORCA_AGENT_SESSION_SPAWN_TOKEN: 'spawn-9', @@ -185,6 +188,8 @@ describe('Claude stream-json connection', () => { expect(env.ANTHROPIC_AUTH_TOKEN).toBe('configured-token') expect(env.ORCA_AGENT_SESSION_SPAWN_TOKEN).toBe('spawn-9') expect(env.ORCA_CONNECTION_MARKER).toBe('inherited') + // The session's own id reaches the spawned child over the inherited one. + expect(env.ORCA_AGENT_SESSION_ID).toBe('f7a1c0de-1111-4222-8333-444455556666') expect(env.ANTHROPIC_API_KEY).toBeUndefined() expect(env.CLAUDE_CODE_CHILD_SESSION).toBeUndefined() expect(env.CLAUDE_CODE_SESSION_ID).toBeUndefined() diff --git a/src/main/claude/claude-structured-launch-resolution.test.ts b/src/main/claude/claude-structured-launch-resolution.test.ts index 3d7592c8406a..66fed64c3230 100644 --- a/src/main/claude/claude-structured-launch-resolution.test.ts +++ b/src/main/claude/claude-structured-launch-resolution.test.ts @@ -161,6 +161,19 @@ describe('claude structured launch resolution', () => { expect(launch.options.sessionId).toBeUndefined() }) + it('names the child by the Orca session id, over any id the configured overlay carries', async () => { + // The Orca-minted id, never the provider's: the provider id rotates on /clear. + const launch = await resolverFor(record(), () => ({ + ORCA_AGENT_SESSION_ID: 'a0b1c2d3-0000-4000-8000-00000000abcd' + }))({ identity: IDENTITY }) + + expect(launch.env).toMatchObject({ + ORCA_AGENT_SESSION_ID: SESSION_ID, + ORCA_CLI_COMMAND: expect.stringMatching(/^[^:;]*[\\/]cli[\\/]bin[\\/]orca-dev$/) + }) + expect(launch.env?.ORCA_AGENT_SESSION_ID).not.toBe(launch.providerSessionId) + }) + it('forces session-state events on when the inherited overlay disables them', async () => { const launch = await resolverFor(record(), () => ({ [CLAUDE_SESSION_STATE_EVENTS_ENV]: '0' diff --git a/src/main/claude/claude-structured-launch-resolution.ts b/src/main/claude/claude-structured-launch-resolution.ts index d5d0542cb9da..29703dfd8eb7 100644 --- a/src/main/claude/claude-structured-launch-resolution.ts +++ b/src/main/claude/claude-structured-launch-resolution.ts @@ -8,7 +8,7 @@ import type { AgentSessionJournalIdentity } from '../../shared/agent-session-jou import { agentSessionProviderHandleChainHead } from '../../shared/agent-session-provider-handle' import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' import { withCliRuntimeOnPath } from '../../shared/node-cli-command-resolution' -import { structuredWorkerChildIdentityEnv } from '../runtime/structured-worker-child-identity-env' +import { structuredSessionChildIdentityEnv } from '../runtime/structured-session-child-identity-env' import { CLAUDE_AUTH_ENV_CONFLICT_MESSAGE, CLAUDE_AUTH_SWITCH_IN_PROGRESS_MESSAGE, @@ -288,9 +288,8 @@ export function createClaudeStructuredLaunchResolver( (await deps.resolvePermissionMode?.()) ?? 'default' ) const { command, env } = await resolveClaudeStructuredInvocation(deps, (base) => - // Only a dispatched structured worker gets the orchestration identity and the Orca CLI on - // PATH; an ordinary chat session's env passes through untouched. - structuredWorkerChildIdentityEnv(record.sessionId, { + // Every structured session speaks orchestration as itself: its injected id and the Orca CLI. + structuredSessionChildIdentityEnv(record.sessionId, { ...base, // The turn translator relies on Claude's authoritative idle frame when no result arrives. [CLAUDE_SESSION_STATE_EVENTS_ENV]: '1' diff --git a/src/main/cli/orca-cli-child-path.ts b/src/main/cli/orca-cli-child-path.ts index f053e54c3d53..2a8136c367fc 100644 --- a/src/main/cli/orca-cli-child-path.ts +++ b/src/main/cli/orca-cli-child-path.ts @@ -17,6 +17,8 @@ import { delimiter, join } from 'node:path' import { readInheritedPath } from '../ipc/pty/host-env/path' import { resolvePathEnvKey } from '../pty/windows-environment-path' import { ensureLinuxTerminalOrcaCliShimDir } from './linux-terminal-orca-cli-shim' +import { getBundledLauncherPath } from './bundled-cli-launcher-path' +import { DEV_COMMAND_NAME } from './cli-install-constants' export type OrcaCliChildPathOptions = { isPackaged: boolean @@ -26,11 +28,16 @@ export type OrcaCliChildPathOptions = { platform?: NodeJS.Platform } -/** Mutates `env` in place, prepending the directory that makes bare `orca` this app's CLI. */ +/** + * Mutates `env` in place, prepending the directory that makes bare `orca` this app's CLI. Returns + * the absolute launcher in that directory, or null when none was prepended: a child whose shell + * rebuilds PATH (a login shell reordering it behind a global install) can still name this app's + * CLI by path. + */ export function prependOrcaCliDirToChildPath( env: Record, opts: OrcaCliChildPathOptions -): void { +): string | null { const platform = opts.platform ?? process.platform // Why: matches node:path's `delimiter` for the running platform, but stays correct when a test // drives a foreign platform through the seam. @@ -43,6 +50,7 @@ export function prependOrcaCliDirToChildPath( env[resolvePathEnvKey(env, platform)] = inheritedPath ? `${devCliBin}${pathDelimiter}${inheritedPath}` : devCliBin + return join(devCliBin, platform === 'win32' ? `${DEV_COMMAND_NAME}.cmd` : DEV_COMMAND_NAME) } else if (platform === 'linux') { // Why: bare-`orca` shim scoped to Orca PTYs — Linux CLI installs as `orca-ide` to avoid shadowing GNOME's /usr/bin/orca screen reader (stablyai/orca#7904). const shimDir = ensureLinuxTerminalOrcaCliShimDir({ userDataPath: opts.userDataPath }) @@ -51,6 +59,7 @@ export function prependOrcaCliDirToChildPath( .split(pathDelimiter) .filter((entry) => entry.length > 0 && entry !== shimDir) env.PATH = [shimDir, ...inheritedEntries].join(pathDelimiter) + return join(shimDir, 'orca') } } else if (opts.resourcesPath && (platform === 'darwin' || platform === 'win32')) { // Why: global CLI registration is optional, but agents in Orca-managed PTYs must always reach this app's bundled CLI. @@ -59,5 +68,8 @@ export function prependOrcaCliDirToChildPath( env[resolvePathEnvKey(env, platform)] = inheritedPath ? `${bundledCliBin}${pathDelimiter}${inheritedPath}` : bundledCliBin + // Why the native launcher on Windows: `orca.cmd` refuses message bodies cmd.exe would mangle. + return getBundledLauncherPath(platform, opts.resourcesPath) } + return null } diff --git a/src/main/codex/codex-structured-child-environment.test.ts b/src/main/codex/codex-structured-child-environment.test.ts index 201efc0b0c5b..4dcd49e96459 100644 --- a/src/main/codex/codex-structured-child-environment.test.ts +++ b/src/main/codex/codex-structured-child-environment.test.ts @@ -1,7 +1,7 @@ -import { describe, expect, it } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' +import { openCodexAppServerConnection } from './codex-app-server-connection' import { CODEX_SPAWN_TOKEN_ENV } from './codex-structured-owner-identity' import { buildCodexStructuredChildEnvironment } from './codex-structured-child-environment' -import { ORCA_STRUCTURED_SESSION_ENV } from '../../shared/structured-session-marker' import { mintStructuredWorkerHandle, mintStructuredWorkerPaneKey, @@ -9,6 +9,10 @@ import { structuredWorkerProcessIncarnation } from '../runtime/structured-worker-identity' +const DEV_CLI_BIN_FIRST = /^[^:;]*[\\/]cli[\\/]bin[:;]/ +// The dev launcher by absolute path: a login shell's profile cannot reorder it behind a global. +const DEV_CLI_LAUNCHER = /^[^:;]*[\\/]cli[\\/]bin[\\/]orca-dev$/ + describe('buildCodexStructuredChildEnvironment', () => { it('keeps shell exports while pinned launch values win', () => { expect( @@ -28,11 +32,16 @@ describe('buildCodexStructuredChildEnvironment', () => { EXAMPLE_GATEWAY_TOKEN: 'shell-exported', CODEX_HOME: '/pinned/home', [CODEX_SPAWN_TOKEN_ENV]: 'spawn-token', - [ORCA_STRUCTURED_SESSION_ENV]: '1' + ORCA_AGENT_SESSION_ID: 'session-not-a-worker', + ORCA_STRUCTURED_SESSION: '1', + ORCA_CLI_COMMAND: expect.stringMatching(DEV_CLI_LAUNCHER), + ORCA_USER_DATA_PATH: expect.any(String), + // The test host is unpackaged, so this app's CLI is the dev launcher dir, first on PATH. + PATH: expect.stringMatching(DEV_CLI_BIN_FIRST) }) }) - it('adds the orchestration handle only for a registered structured worker', () => { + it('names every session by its id, and adds the handle only for a registered worker', () => { const launch = { command: 'codex', args: ['app-server'], @@ -44,8 +53,12 @@ describe('buildCodexStructuredChildEnvironment', () => { const sessionId = 'a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d' expect(buildCodexStructuredChildEnvironment(launch, 'spawn-token', sessionId)).toEqual({ [CODEX_SPAWN_TOKEN_ENV]: 'spawn-token', - // No identity yet, so the child carries only the refuse-rather-than-guess marker. - [ORCA_STRUCTURED_SESSION_ENV]: '1' + // Not a worker, so no handle: the id alone names this chat as a caller. + ORCA_AGENT_SESSION_ID: sessionId, + ORCA_STRUCTURED_SESSION: '1', + ORCA_CLI_COMMAND: expect.stringMatching(DEV_CLI_LAUNCHER), + ORCA_USER_DATA_PATH: expect.any(String), + PATH: expect.stringMatching(DEV_CLI_BIN_FIRST) }) const handle = mintStructuredWorkerHandle() @@ -61,7 +74,8 @@ describe('buildCodexStructuredChildEnvironment', () => { try { const env = buildCodexStructuredChildEnvironment(launch, 'spawn-token', sessionId) expect(env.ORCA_TERMINAL_HANDLE).toBe(handle) - expect(env.ORCA_CLI_COMMAND).toBe('orca') + expect(env.ORCA_AGENT_SESSION_ID).toBe(sessionId) + expect(env.ORCA_CLI_COMMAND).toMatch(DEV_CLI_LAUNCHER) // A pane key here would leak into hook-emitted agent statuses, which assume a PTY leaf. expect(env.ORCA_PANE_KEY).toBeUndefined() } finally { @@ -69,3 +83,62 @@ describe('buildCodexStructuredChildEnvironment', () => { } }) }) + +/** A real child speaking Codex's JSONL framing, answering with the environment it was spawned with. */ +const ENV_REPORTING_APP_SERVER = String.raw` + const readline = require('node:readline') + const send = (payload) => process.stdout.write(JSON.stringify(payload) + '\n') + readline.createInterface({ input: process.stdin }).on('line', (line) => { + const message = JSON.parse(line) + if (message.method === 'initialize') return send({ id: message.id, result: {} }) + if (message.method === 'test/env') { + return send({ + id: message.id, + result: { + sessionId: process.env.ORCA_AGENT_SESSION_ID ?? null, + cliCommand: process.env.ORCA_CLI_COMMAND ?? null, + path: process.env.PATH ?? process.env.Path ?? null + } + }) + } + }) +` + +describe('the spawned Codex child', () => { + afterEach(() => { + vi.unstubAllEnvs() + }) + + it("runs with its own session id and this app's CLI, over an id inherited by Orca itself", async () => { + // The builder's output is an overlay on process.env, so only the spawned child proves the id + // survives the merge — an Orca launched inside another session inherits that session's id. + vi.stubEnv('ORCA_AGENT_SESSION_ID', 'a0b1c2d3-0000-4000-8000-00000000abcd') + const sessionId = 'a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d' + const env = buildCodexStructuredChildEnvironment( + { + command: process.execPath, + args: ['-e', ENV_REPORTING_APP_SERVER], + cwd: process.cwd(), + codexHome: null, + resumeThreadId: null, + env: {} + }, + 'spawn-token', + sessionId + ) + const connection = await openCodexAppServerConnection({ + command: process.execPath, + args: ['-e', ENV_REPORTING_APP_SERVER], + env + }) + try { + await expect(connection.request('test/env')).resolves.toEqual({ + sessionId, + cliCommand: expect.stringMatching(DEV_CLI_LAUNCHER), + path: expect.stringMatching(DEV_CLI_BIN_FIRST) + }) + } finally { + await connection.close() + } + }) +}) diff --git a/src/main/codex/codex-structured-child-environment.ts b/src/main/codex/codex-structured-child-environment.ts index 72bf17a1bcef..38ea91abe268 100644 --- a/src/main/codex/codex-structured-child-environment.ts +++ b/src/main/codex/codex-structured-child-environment.ts @@ -1,6 +1,6 @@ import type { CodexStructuredLaunch } from './codex-structured-session-state' import { CODEX_SPAWN_TOKEN_ENV } from './codex-structured-owner-identity' -import { structuredWorkerChildIdentityEnv } from '../runtime/structured-worker-child-identity-env' +import { structuredSessionChildIdentityEnv } from '../runtime/structured-session-child-identity-env' export function buildCodexStructuredChildEnvironment( launch: CodexStructuredLaunch, @@ -8,9 +8,8 @@ export function buildCodexStructuredChildEnvironment( sessionId: string ): Record { return { - // Only a dispatched structured worker gets the orchestration identity and the Orca CLI on - // PATH; an ordinary chat session's env passes through untouched. - ...structuredWorkerChildIdentityEnv(sessionId, { + // Every structured session speaks orchestration as itself: its injected id and the Orca CLI. + ...structuredSessionChildIdentityEnv(sessionId, { ...launch.env, ...(launch.codexHome ? { CODEX_HOME: launch.codexHome } : {}) }), diff --git a/src/main/codex/codex-structured-session-adapter.test.ts b/src/main/codex/codex-structured-session-adapter.test.ts index 43b76536c64e..2fa337b60011 100644 --- a/src/main/codex/codex-structured-session-adapter.test.ts +++ b/src/main/codex/codex-structured-session-adapter.test.ts @@ -6,7 +6,6 @@ import { } from './codex-app-server-connection' import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' import { CODEX_SPAWN_TOKEN_ENV } from './codex-structured-owner-identity' -import { ORCA_STRUCTURED_SESSION_ENV } from '../../shared/structured-session-marker' import { CodexStructuredSessionAdapter, type CodexStructuredLaunch, @@ -35,7 +34,12 @@ describe('CodexStructuredSessionAdapter.acquire', () => { expect(codex.connections[0].launch.env).toEqual({ [CODEX_SPAWN_TOKEN_ENV]: 'spawn-9', CODEX_HOME: '/codex/home', - [ORCA_STRUCTURED_SESSION_ENV]: '1' + ORCA_AGENT_SESSION_ID: 'session-1', + ORCA_STRUCTURED_SESSION: '1', + ORCA_CLI_COMMAND: expect.stringMatching(/^[^:;]*[\\/]cli[\\/]bin[\\/]orca-dev$/), + ORCA_USER_DATA_PATH: expect.any(String), + // The test host is unpackaged, so this app's CLI is the dev launcher dir, first on PATH. + PATH: expect.stringMatching(/^[^:;]*[\\/]cli[\\/]bin[:;]/) }) expect(codex.connections[0].launch.cwd).toBe('/work/repo') expect(codex.connections[0].calls[0]).toEqual({ diff --git a/src/main/ipc/pty-daemon-spawn-agent-home-env.test.ts b/src/main/ipc/pty-daemon-spawn-agent-home-env.test.ts index f73f11e7f932..092886b3fe75 100644 --- a/src/main/ipc/pty-daemon-spawn-agent-home-env.test.ts +++ b/src/main/ipc/pty-daemon-spawn-agent-home-env.test.ts @@ -413,6 +413,17 @@ describe('registerPtyHandlers', () => { ]) ) }) + it('strips an inherited agent session id', async () => { + // Why: a daemon forked by an Orca launched inside a structured session inherits its id, + // and every daemon pane would present that session as its orchestration caller. + const inherited = await daemonSpawnAndGetOptions(undefined, undefined, undefined, { + ORCA_AGENT_SESSION_ID: 'a0b1c2d3-0000-4000-8000-00000000abcd', + ORCA_STRUCTURED_SESSION: '1' + }) + expect(inherited.envToDelete).toEqual( + expect.arrayContaining(['ORCA_AGENT_SESSION_ID', 'ORCA_STRUCTURED_SESSION']) + ) + }) it('preserves an explicitly requested Claude child-session stamp', async () => { // Why: only inherited values are poison; a caller deliberately spawning a // nested Claude child passes the stamp in args.env and must keep it. diff --git a/src/main/ipc/pty-spawn-env-terminal-basics.test.ts b/src/main/ipc/pty-spawn-env-terminal-basics.test.ts index c36fa3e40f5e..bed6953e2b12 100644 --- a/src/main/ipc/pty-spawn-env-terminal-basics.test.ts +++ b/src/main/ipc/pty-spawn-env-terminal-basics.test.ts @@ -351,6 +351,16 @@ describe('registerPtyHandlers', () => { expect(env.CLAUDE_CODE_SESSION_ID).toBeUndefined() expect(env.CLAUDE_CODE_BRIDGE_SESSION_ID).toBeUndefined() }) + it('strips an inherited agent session id so a pane never claims that session', async () => { + // Why: an Orca launched inside a structured session inherits its id; every pane would then + // present that session as its orchestration caller instead of its own terminal. + const env = await spawnAndGetEnv(undefined, { + ORCA_AGENT_SESSION_ID: 'a0b1c2d3-0000-4000-8000-00000000abcd', + ORCA_STRUCTURED_SESSION: '1' + }) + expect(env.ORCA_AGENT_SESSION_ID).toBeUndefined() + expect(env.ORCA_STRUCTURED_SESSION).toBeUndefined() + }) it('keeps an explicitly requested Claude child-session stamp on a local spawn', async () => { const env = await spawnAndGetEnv( { CLAUDE_CODE_CHILD_SESSION: '1' }, diff --git a/src/main/ipc/pty/host-env/pi-agent.ts b/src/main/ipc/pty/host-env/pi-agent.ts index 05258f0bdc6c..caf18e3e1aa7 100644 --- a/src/main/ipc/pty/host-env/pi-agent.ts +++ b/src/main/ipc/pty/host-env/pi-agent.ts @@ -8,7 +8,11 @@ import { type PiAgentKind } from '../../../../shared/pi-agent-kind' import { readSessionShellStartupEnvVar } from '../../../pty/shell-startup-env' -import { AGENT_HOOK_RUNTIME_ENV_KEYS, CLAUDE_CHILD_SESSION_STAMP_ENV_KEYS } from './spawn-env-keys' +import { + AGENT_HOOK_RUNTIME_ENV_KEYS, + CLAUDE_CHILD_SESSION_STAMP_ENV_KEYS, + ORCA_AGENT_SESSION_CALLER_ENV_KEYS +} from './spawn-env-keys' export function readEnvWithProcessFallback( baseEnv: Record, @@ -138,13 +142,16 @@ export function getInheritedAgentHookEnvKeysToDelete( ].filter((key) => env[key] === undefined) } -export function getInheritedClaudeSessionStampEnvKeysToDelete( +export function getInheritedAgentSessionStampEnvKeysToDelete( spawnEnv: Record | undefined ): string[] { const env = spawnEnv ?? {} - // Why: strip only values inherited from the pty host; a caller that explicitly - // provides a stamp (deliberately spawning a nested Claude child) keeps it. - return CLAUDE_CHILD_SESSION_STAMP_ENV_KEYS.filter((key) => env[key] === undefined) + // Why: a caller that explicitly provides a Claude stamp (a nested Claude child) keeps it; no + // terminal is a structured session, so the session caller keys always go. + return [ + ...CLAUDE_CHILD_SESSION_STAMP_ENV_KEYS.filter((key) => env[key] === undefined), + ...ORCA_AGENT_SESSION_CALLER_ENV_KEYS + ] } export { restoreOrStripOverlayEnv } from '../../../../shared/agent-overlay-env' diff --git a/src/main/ipc/pty/host-env/spawn-env-keys.ts b/src/main/ipc/pty/host-env/spawn-env-keys.ts index cabbde7b0ecb..ed070c7d043d 100644 --- a/src/main/ipc/pty/host-env/spawn-env-keys.ts +++ b/src/main/ipc/pty/host-env/spawn-env-keys.ts @@ -1,3 +1,6 @@ +import { ORCA_AGENT_SESSION_ID_ENV } from '../../../../shared/agent-session-caller-env' +import { ORCA_STRUCTURED_SESSION_ENV } from '../../../../shared/structured-session-marker' + export const AGENT_HOOK_RUNTIME_ENV_KEYS = [ 'ORCA_AGENT_HOOK_PORT', 'ORCA_AGENT_HOOK_TOKEN', @@ -15,3 +18,9 @@ export const CLAUDE_CHILD_SESSION_STAMP_ENV_KEYS = [ 'CLAUDE_CODE_SESSION_ID', 'CLAUDE_CODE_BRIDGE_SESSION_ID' ] as const + +// Why: Orca writes these only into a structured session's own spawn, so an inherited value means a pty host launched from inside one — every pane would claim that session as its orchestration caller. +export const ORCA_AGENT_SESSION_CALLER_ENV_KEYS = [ + ORCA_AGENT_SESSION_ID_ENV, + ORCA_STRUCTURED_SESSION_ENV +] as const diff --git a/src/main/ipc/pty/ipc/spawn-options.ts b/src/main/ipc/pty/ipc/spawn-options.ts index 42d2aedf0084..d46f210fcd38 100644 --- a/src/main/ipc/pty/ipc/spawn-options.ts +++ b/src/main/ipc/pty/ipc/spawn-options.ts @@ -9,7 +9,7 @@ import { mergePtyEnvDeletions, removeCodexHomeDeletionRequests, getInheritedAgentHookEnvKeysToDelete, - getInheritedClaudeSessionStampEnvKeysToDelete + getInheritedAgentSessionStampEnvKeysToDelete } from '../host-env/pi-agent' import { promoteAgentTeamsShimPath, deleteRequestedEnvKeys } from '../host-env/path' import { beginPtySpawnForWorktree } from '../host-env/fresh-spawn-routing' @@ -49,7 +49,7 @@ export async function buildPtyIpcSpawnOptions( !args.connectionId && !ctx.isDaemonHostSpawn ? getLegacyOpenCodeEnvKeysToDelete(ctx.spawnEnv, getAppEnvironment().getPath('userData')) : [], - getInheritedClaudeSessionStampEnvKeysToDelete(ctx.spawnEnv), + getInheritedAgentSessionStampEnvKeysToDelete(ctx.spawnEnv), ctx.skipCodexHomeEnv ? CODEX_HOME_ENV_KEYS : [], // Why: the persistent daemon compares its own merged CODEX_HOME pair; // main cannot safely decide ownership for a process it may not parent. diff --git a/src/main/ipc/pty/runtime/spawn-options.ts b/src/main/ipc/pty/runtime/spawn-options.ts index c544b9ac7c90..933624e6dd56 100644 --- a/src/main/ipc/pty/runtime/spawn-options.ts +++ b/src/main/ipc/pty/runtime/spawn-options.ts @@ -11,7 +11,7 @@ import { mergePtyEnvDeletions, removeCodexHomeDeletionRequests, getInheritedAgentHookEnvKeysToDelete, - getInheritedClaudeSessionStampEnvKeysToDelete + getInheritedAgentSessionStampEnvKeysToDelete } from '../host-env/pi-agent' import { promoteAgentTeamsShimPath, deleteRequestedEnvKeys } from '../host-env/path' import { @@ -79,7 +79,7 @@ export async function buildRuntimePtySpawnOptions( ? getLegacyOpenCodeEnvKeysToDelete(ctx.env, getAppEnvironment().getPath('userData')) : [], // Why: ungated, unlike the agent-hook keys — the local provider and the relay host also spread their own process.env into every spawn. - getInheritedClaudeSessionStampEnvKeysToDelete(ctx.env) + getInheritedAgentSessionStampEnvKeysToDelete(ctx.env) ) if (ctx.skipCodexHomeEnv) { ctx.spawnOptions.envToDelete = mergePtyEnvDeletions( diff --git a/src/main/providers/provider-dispatch.test.ts b/src/main/providers/provider-dispatch.test.ts index c74358b89b0e..7ac956b70fde 100644 --- a/src/main/providers/provider-dispatch.test.ts +++ b/src/main/providers/provider-dispatch.test.ts @@ -165,8 +165,8 @@ describe('PTY provider dispatch', () => { })) as { id: string } expect(result.id).toBe('ssh-pty-1') - // Why: the relay host can be launched from a Claude session too, so the stamps are - // stripped on the SSH path as well. Compared as a set — envToDelete is consumed by + // Why: the relay host can be launched from a Claude or structured session too, so the + // stamps are stripped on the SSH path as well; a remote pane never names a local session. Compared as a set — envToDelete is consumed by // membership only, so a reordering of the merge sources must not fail this. const sshSpawnArgs = vi.mocked(mockSshProvider.spawn).mock.calls.at(-1)![0] expect([...(sshSpawnArgs.envToDelete ?? [])].sort()).toEqual( @@ -177,7 +177,9 @@ describe('PTY provider dispatch', () => { 'CLAUDE_CODE_BRIDGE_SESSION_ID', 'ORCA_PI_STATUS_OWNED', 'ORCA_PRIME_AGENT_STATUS_OWNED', - 'ORCA_PI_TITLE_MARKER_OWNED' + 'ORCA_PI_TITLE_MARKER_OWNED', + 'ORCA_AGENT_SESSION_ID', + 'ORCA_STRUCTURED_SESSION' ].sort() ) expect(mockSshProvider.spawn).toHaveBeenCalledWith( diff --git a/src/main/runtime/orchestration/orchestration-party-cli-address.test.ts b/src/main/runtime/orchestration/orchestration-party-cli-address.test.ts new file mode 100644 index 000000000000..f6f1c1e25745 --- /dev/null +++ b/src/main/runtime/orchestration/orchestration-party-cli-address.test.ts @@ -0,0 +1,50 @@ +import { afterEach, describe, expect, it } from 'vitest' +import { injectedSessionAddress } from '../../../shared/agent-session-caller-env' +import { testOrcaSessionId } from '../../../shared/orca-session-address-test-fixture' +import { + mintStructuredWorkerHandle, + mintStructuredWorkerPaneKey, + structuredWorkerIdentities, + structuredWorkerProcessIncarnation +} from '../structured-worker-identity' +import { resolveOrcaSessionParty } from './orchestration-party' + +// The CLI spells its own address without the host resolver (it runs before the codec's module +// graph), so it must land on the one mailbox address the resolver gives the same session. +const CHAT = testOrcaSessionId('f7a1c0de-1111-4222-8333-444455556666') +const WORKER = testOrcaSessionId('a0b1c2d3-0000-4000-8000-00000000abcd') + +afterEach(() => { + structuredWorkerIdentities.clear() +}) + +describe("the CLI's own address", () => { + it("is a chat's session address, even beside a pane handle it inherited", () => { + const hostAddress = resolveOrcaSessionParty(CHAT, null).address + expect(injectedSessionAddress({ ORCA_AGENT_SESSION_ID: CHAT })).toBe(hostAddress) + expect( + injectedSessionAddress({ + ORCA_AGENT_SESSION_ID: CHAT, + ORCA_TERMINAL_HANDLE: 'term_inherited' + }) + ).toBe(hostAddress) + }) + + it("is a structured worker's minted handle, as the host resolves it", () => { + const handle = mintStructuredWorkerHandle() + structuredWorkerIdentities.register({ + handle, + sessionId: WORKER, + agent: 'claude', + paneKey: mintStructuredWorkerPaneKey(WORKER), + processIncarnation: structuredWorkerProcessIncarnation(WORKER), + worktreeId: 'wt_1', + hostScope: { kind: 'local', hostId: 'local' } + }) + const hostAddress = resolveOrcaSessionParty(WORKER, null).address + expect(hostAddress).toBe(handle) + expect( + injectedSessionAddress({ ORCA_AGENT_SESSION_ID: WORKER, ORCA_TERMINAL_HANDLE: handle }) + ).toBe(hostAddress) + }) +}) diff --git a/src/main/runtime/rpc/methods/orchestration-structured-worker-session.test.ts b/src/main/runtime/rpc/methods/orchestration-structured-worker-session.test.ts index 0d1f04cb83bd..c3c69dc15fd2 100644 --- a/src/main/runtime/rpc/methods/orchestration-structured-worker-session.test.ts +++ b/src/main/runtime/rpc/methods/orchestration-structured-worker-session.test.ts @@ -1,5 +1,7 @@ +import { join } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' import type { AgentJournalSubmission } from '../../../../shared/agent-session-journal-types' +import { getAppEnvironment } from '../../../../shared/app-environment' import { DISPATCH_REJECTED_WRITE_FAILED } from '../../../../shared/structured-agent-session-dispatch-rejection' const hostRef: { current: unknown } = { current: null } @@ -19,8 +21,8 @@ const { } = await import('./orchestration-structured-worker-session') const { isUnknownWorkerStartOutcome } = await import('./orchestration/worker/worker-topology') const { structuredWorkerIdentities } = await import('../../structured-worker-identity') -const { structuredWorkerChildIdentityEnv } = - await import('../../structured-worker-child-identity-env') +const { structuredSessionChildIdentityEnv } = + await import('../../structured-session-child-identity-env') // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: a host stub carrying only the members the worker start reaches. function installHost(location = { executionHostId: 'local', wslDistro: null as string | null }) { @@ -82,7 +84,7 @@ describe('structured worker session', () => { createSpy.mockImplementation(async (args: { envelope: { sessionId: string } }) => { // `attach` is what spawns the provider child, and the child's env is read from the registry // at spawn time. Registering afterwards ships a worker with no ORCA_TERMINAL_HANDLE. - envAtSpawn = structuredWorkerChildIdentityEnv(args.envelope.sessionId, {}) + envAtSpawn = structuredSessionChildIdentityEnv(args.envelope.sessionId, {}) return { ok: true, value: { sessionId: args.envelope.sessionId } } }) const created = await createStructuredWorkerSession({ @@ -93,7 +95,15 @@ describe('structured worker session', () => { onJournalActivity: () => {} }) expect(envAtSpawn?.ORCA_TERMINAL_HANDLE).toBe(created.identity.handle) - expect(envAtSpawn?.ORCA_CLI_COMMAND).toBe('orca') + // This app's own launcher by absolute path, so a login shell's profile cannot swap in a global. + expect(envAtSpawn?.ORCA_CLI_COMMAND).toBe( + join( + getAppEnvironment().getPath('userData'), + 'cli', + 'bin', + process.platform === 'win32' ? 'orca-dev.cmd' : 'orca-dev' + ) + ) expect(envAtSpawn?.ORCA_PANE_KEY).toBeUndefined() releaseStructuredWorkerSession('d_spawn') }) diff --git a/src/main/runtime/structured-session-child-identity-env.test.ts b/src/main/runtime/structured-session-child-identity-env.test.ts new file mode 100644 index 000000000000..1289e979ad63 --- /dev/null +++ b/src/main/runtime/structured-session-child-identity-env.test.ts @@ -0,0 +1,193 @@ +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { installFakeAppEnvironment } from '../../../config/scripts/vitest-host-ports-setup' + +const shim = vi.hoisted(() => ({ ensureLinuxTerminalOrcaCliShimDir: vi.fn() })) +vi.mock('../cli/linux-terminal-orca-cli-shim', () => shim) + +import { structuredSessionChildIdentityEnv } from './structured-session-child-identity-env' +import { + mintStructuredWorkerHandle, + mintStructuredWorkerPaneKey, + structuredWorkerHostScope, + structuredWorkerIdentities, + structuredWorkerProcessIncarnation +} from './structured-worker-identity' + +const SESSION_ID = 'f7a1c0de-1111-4222-8333-444455556666' +const USER_DATA = '/data/orca' +const RESOURCES = '/app/Resources' +const SHIM_DIR = join(USER_DATA, 'linux-orca-cli-shim') + +const platformDescriptor = Object.getOwnPropertyDescriptor(process, 'platform')! +const resourcesDescriptor = Object.getOwnPropertyDescriptor(process, 'resourcesPath') + +function pinPlatform(platform: NodeJS.Platform): void { + Object.defineProperty(process, 'platform', { configurable: true, value: platform }) +} + +function registerWorker(): string { + const handle = mintStructuredWorkerHandle() + structuredWorkerIdentities.register({ + handle, + sessionId: SESSION_ID, + agent: 'claude', + paneKey: mintStructuredWorkerPaneKey(SESSION_ID), + processIncarnation: structuredWorkerProcessIncarnation(SESSION_ID), + worktreeId: 'wt_1', + hostScope: { kind: 'local', hostId: 'local' } + }) + return handle +} + +beforeEach(() => { + shim.ensureLinuxTerminalOrcaCliShimDir.mockReset() + shim.ensureLinuxTerminalOrcaCliShimDir.mockReturnValue(SHIM_DIR) + Object.defineProperty(process, 'resourcesPath', { configurable: true, value: RESOURCES }) +}) + +afterEach(() => { + structuredWorkerIdentities.clear() + Object.defineProperty(process, 'platform', platformDescriptor) + if (resourcesDescriptor) { + Object.defineProperty(process, 'resourcesPath', resourcesDescriptor) + } else { + Reflect.deleteProperty(process, 'resourcesPath') + } +}) + +describe('structuredSessionChildIdentityEnv', () => { + it("gives an ordinary chat session its own id and this app's CLI, and no terminal identity", () => { + // The id names the caller, so a bare `orca orchestration check` acts as this session instead of + // guessing a terminal — every guess landed on a sibling pane, and `check` consumed its mail. + pinPlatform('linux') + installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) + const childEnv = { PATH: '/usr/bin' } + const env = structuredSessionChildIdentityEnv(SESSION_ID, childEnv) + expect(env).toEqual({ + PATH: `${SHIM_DIR}:/usr/bin`, + ORCA_AGENT_SESSION_ID: SESSION_ID, + // For a CLI that predates the id, which refuses on it instead of guessing a sibling. + ORCA_STRUCTURED_SESSION: '1', + ORCA_CLI_COMMAND: join(SHIM_DIR, 'orca'), + // The instance that minted the id, so any current CLI dials it rather than the default. + ORCA_USER_DATA_PATH: USER_DATA + }) + // A chat names itself by its id alone: no handle, no pane key. + expect(env.ORCA_TERMINAL_HANDLE).toBeUndefined() + expect(env.ORCA_PANE_KEY).toBeUndefined() + expect(childEnv).toEqual({ PATH: '/usr/bin' }) + }) + + it('replaces an id inherited from an Orca launched inside another session', () => { + installFakeAppEnvironment({ isPackaged: () => false, getPath: () => USER_DATA }) + const env = structuredSessionChildIdentityEnv(SESSION_ID, { + ORCA_AGENT_SESSION_ID: 'a0b1c2d3-0000-4000-8000-00000000abcd', + PATH: '/usr/bin' + }) + expect(env.ORCA_AGENT_SESSION_ID).toBe(SESSION_ID) + }) + + it('gives a structured worker its id and keeps the handle it was minted', () => { + // For orchestration the id wins and the host maps it back to this handle, so the worker keeps + // one identity; the handle stays for the handle-based surfaces outside orchestration. + installFakeAppEnvironment({ isPackaged: () => false, getPath: () => USER_DATA }) + const handle = registerWorker() + const env = structuredSessionChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin' }) + expect(env.ORCA_AGENT_SESSION_ID).toBe(SESSION_ID) + expect(env.ORCA_TERMINAL_HANDLE).toBe(handle) + }) + + describe.each(['chat', 'worker'] as const)("reaches this app's CLI as a %s", (kind) => { + beforeEach(() => { + if (kind === 'worker') { + registerWorker() + } + }) + + it('on packaged Linux, through the bare-orca shim, named by absolute path', () => { + // Without this the child's first `orca orchestration check` execs GNOME Orca — the CLI + // installs as `orca-ide` on Linux (stablyai/orca#7904) — and the dispatch hangs to timeout. + pinPlatform('linux') + installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) + const env = structuredSessionChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin:/bin' }) + expect(env.ORCA_CLI_COMMAND).toBe(join(SHIM_DIR, 'orca')) + expect(env.PATH).toBe(`${SHIM_DIR}:/usr/bin:/bin`) + }) + + it('on packaged macOS, through the bundled CLI dir', () => { + pinPlatform('darwin') + installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) + const env = structuredSessionChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin' }) + expect(env.PATH).toBe(`${join(RESOURCES, 'bin')}:/usr/bin`) + expect(env.ORCA_CLI_COMMAND).toBe(join(RESOURCES, 'bin', 'orca')) + }) + + it('on packaged Windows, through the bundled CLI dir under the env block spelling', () => { + pinPlatform('win32') + installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) + const env = structuredSessionChildIdentityEnv(SESSION_ID, { Path: 'C:\\Windows' }) + expect(env.Path).toBe(`${join(RESOURCES, 'bin')};C:\\Windows`) + expect(env.PATH).toBeUndefined() + // The native launcher: `orca.cmd` refuses message bodies cmd.exe would mangle. + expect(env.ORCA_CLI_COMMAND).toBe(join(RESOURCES, 'bin', 'orca.exe')) + }) + + it('unpackaged, through the dev launcher dir', () => { + pinPlatform('darwin') + installFakeAppEnvironment({ isPackaged: () => false, getPath: () => USER_DATA }) + const env = structuredSessionChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin' }) + expect(env.PATH).toBe(`${join(USER_DATA, 'cli', 'bin')}:/usr/bin`) + expect(env.ORCA_CLI_COMMAND).toBe(join(USER_DATA, 'cli', 'bin', 'orca-dev')) + }) + }) + + it('omits the CLI command when no launcher resolves, never naming a bare `orca`', () => { + // On packaged Linux the shim can fail to resolve (no bundled launcher, an unverified AppImage); + // a bare `orca` there is GNOME's screen reader, and an inherited value names another app's CLI. + pinPlatform('linux') + installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) + shim.ensureLinuxTerminalOrcaCliShimDir.mockReturnValue(null) + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const env = structuredSessionChildIdentityEnv(SESSION_ID, { + PATH: '/usr/bin', + ORCA_CLI_COMMAND: '/Applications/Other Orca.app/Contents/Resources/bin/orca', + ORCA_USER_DATA_PATH: '/data/other-orca' + }) + expect(env).not.toHaveProperty('ORCA_CLI_COMMAND') + expect(env.PATH).toBe('/usr/bin') + expect(env.ORCA_USER_DATA_PATH).toBe(USER_DATA) + expect(console.warn).toHaveBeenCalledOnce() + }) + + it('never puts a pane key in the child environment', () => { + // A pane key here flows into hook-emitted agent statuses and the attestation, agent-row and + // mobile-projection pipelines, all of which assume it names a live PTY leaf. + pinPlatform('linux') + installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) + registerWorker() + const env = structuredSessionChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin' }) + expect(env.ORCA_PANE_KEY).toBeUndefined() + expect(Object.keys(env).filter((key) => key.includes('PANE'))).toEqual([]) + }) + + it('never names the WSL-scoped launcher, because a structured worker cannot run in WSL', () => { + // `orca-ide` is the literal the PTY lane exports for WSL only. A structured session that + // resolves to a WSL distro is refused a host scope, so it never becomes a worker at all — + // which is why the bare-`orca` shim, not the literal, is the right fix on Linux. + expect( + structuredWorkerHostScope({ + executionHostId: 'local', + workspaceId: 'wt_1', + workspaceKind: 'git-worktree', + wslDistro: 'Ubuntu' + }) + ).toBeNull() + pinPlatform('linux') + installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) + registerWorker() + expect( + structuredSessionChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin' }).ORCA_CLI_COMMAND + ).not.toBe('orca-ide') + }) +}) diff --git a/src/main/runtime/structured-session-child-identity-env.ts b/src/main/runtime/structured-session-child-identity-env.ts new file mode 100644 index 000000000000..4d3e85c34140 --- /dev/null +++ b/src/main/runtime/structured-session-child-identity-env.ts @@ -0,0 +1,93 @@ +/** + * The orchestration identity — and the CLI reachability — a structured session's own child needs to + * speak for itself. Both providers' native launches (Claude, Codex) build their child env here. + * + * Every structured session carries `ORCA_AGENT_SESSION_ID`, the id Orca minted for it — never the + * provider's, which rotates on `/clear`. The CLI sends it as the caller, so a bare + * `orca orchestration check` acts as this session instead of guessing a terminal: with no pane of + * its own, every guess landed on a sibling, and a destructive `check` consumed that sibling's mail. + * Identity by session id assumes one machine and one user; crossing a host boundary (SSH, a paired + * peer) re-opens that decision, and the host refuses a session claim from across one. + * + * A dispatched structured worker also keeps the `structworker_` handle it was minted, for the + * handle-based surfaces outside orchestration; for orchestration the id wins and the host maps it + * back to that handle, so the worker keeps one identity. + * + * The PATH prepend below makes bare `orca` this app's CLI, the SAME function `buildPtyHostEnv` + * applies, rather than a second, drifting copy of the rule. Orca's Linux CLI installs as `orca-ide` + * so it never claims GNOME Orca's /usr/bin/orca (stablyai/orca#7904), and on packaged macOS/Windows + * the bundled launcher is reachable only from the app's own resources dir. + * + * `ORCA_CLI_COMMAND` names that same launcher by absolute path, because a provider can run each + * command in a login shell (Codex runs `zsh -lc`) whose profile rebuilds PATH and puts a global + * install ahead of this app's. A bare `orca` that reaches another install still acts as this + * session: any current CLI sends the injected id and dials the instance `ORCA_USER_DATA_PATH` pins + * below, and a CLI that predates the id refuses on the marker. When no launcher resolves the key + * is omitted rather than naming a bare `orca`: on Linux that is GNOME's screen reader, and an + * inherited value names another app. + * + * `ORCA_USER_DATA_PATH` pins this instance beside the identity, so any current CLI — the session's + * own or a global one — dials the Orca that minted the id instead of the production default. + * + * Deliberately NOT `ORCA_PANE_KEY`. Claude structured sessions run hooks, and a pane key in their + * environment starts flowing into hook-emitted agent-status payloads and the hook-attestation, + * agent-row and mobile-projection pipelines, every one of which assumes a pane key names a live + * PTY leaf. It would also open `selectExactWorkerProviderSession`, which is fail-closed today + * precisely because a structured session emits no hook agent status. + * + * `ORCA_STRUCTURED_SESSION` stays beside the id for a CLI that predates it — one reached through a + * global install when a shell rc resets PATH — which would otherwise guess a sibling's terminal; + * such a CLI refuses on the marker. A current CLI checks the id first, so the marker never makes a + * session with an id identity-less. + * + * The handle is read from the registry at spawn time, so an in-host recovery respawn re-bakes the + * SAME handle rather than a stale or fresh one. + */ + +import { getAppEnvironment, hasAppEnvironment } from '../../shared/app-environment' +import { ORCA_AGENT_SESSION_ID_ENV } from '../../shared/agent-session-caller-env' +import { ORCA_STRUCTURED_SESSION_ENV } from '../../shared/structured-session-marker' +import { prependOrcaCliDirToChildPath } from '../cli/orca-cli-child-path' +import { structuredWorkerIdentities } from './structured-worker-identity' + +export function structuredSessionChildIdentityEnv( + sessionId: string, + childEnv: Record +): Record { + const identity = structuredWorkerIdentities.getBySessionId(sessionId) + const env: Record = { + ...childEnv, + ...(identity ? { ORCA_TERMINAL_HANDLE: identity.handle } : {}), + [ORCA_AGENT_SESSION_ID_ENV]: sessionId, + [ORCA_STRUCTURED_SESSION_ENV]: '1' + } + applyThisAppCli(env) + return env +} + +/** + * A host with no app environment installed — a plain-Node fork, or a unit test — has no userData + * root to resolve, and inventing one would write a shim into the wrong directory. + */ +function applyThisAppCli(env: Record): void { + delete env.ORCA_CLI_COMMAND + if (!hasAppEnvironment()) { + return + } + const app = getAppEnvironment() + const userDataPath = app.getPath('userData') + const isPackaged = app.isPackaged() + env.ORCA_USER_DATA_PATH = userDataPath + const launcher = prependOrcaCliDirToChildPath(env, { + isPackaged, + userDataPath, + resourcesPath: process.resourcesPath ?? null + }) + if (launcher) { + env.ORCA_CLI_COMMAND = launcher + } else { + console.warn( + "[structured-session] This app's CLI launcher did not resolve; the session's child has no ORCA_CLI_COMMAND." + ) + } +} diff --git a/src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts b/src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts new file mode 100644 index 000000000000..c5a9eb769f1e --- /dev/null +++ b/src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts @@ -0,0 +1,34 @@ +/** + * The zsh arm of `structured-session-cli-login-shell.test.ts`: Codex's own shell on macOS. Runs in + * the real-shell lane, which installs zsh; the ordinary unit lane has none. + */ + +import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import { + createLoginShellHarness, + type LoginShellHarness +} from './structured-session-login-shell-test-harness' + +describe.runIf(process.platform !== 'win32')('a structured session in a zsh login shell', () => { + let harness: LoginShellHarness + + beforeEach(() => { + harness = createLoginShellHarness() + }) + + afterEach(() => { + harness.dispose() + }) + + it("resolves this app's CLI through ORCA_CLI_COMMAND in `zsh -lc`", async () => { + // Positive control: the profile really does put the global install first for a bare name. + expect(await harness.run({ program: '/bin/zsh', args: ['-lc', 'orca'] })).toBe('global') + expect(await harness.run({ program: '/bin/zsh', args: ['-lc', '"$ORCA_CLI_COMMAND"'] })).toBe( + 'app' + ) + }) + + it("keeps bare `orca` this app's CLI in a zsh that reads no login profile", async () => { + expect(await harness.run({ program: '/bin/zsh', args: ['-c', 'orca'] })).toBe('app') + }) +}) diff --git a/src/main/runtime/structured-session-cli-login-shell.test.ts b/src/main/runtime/structured-session-cli-login-shell.test.ts new file mode 100644 index 000000000000..2079dc44eb66 --- /dev/null +++ b/src/main/runtime/structured-session-cli-login-shell.test.ts @@ -0,0 +1,38 @@ +/** + * A provider can run every command in a login shell: Codex runs ` -lc `. The login + * profile rebuilds PATH — macOS's path_helper, a user's profile — so the directory Orca prepended + * ends up behind a global install, and bare `orca` becomes that install, possibly an older Orca. + * `ORCA_CLI_COMMAND` names this app's launcher by absolute path, which no startup file can reorder. + * The zsh arm lives in `structured-session-cli-login-shell.live-shell.test.ts`, in the real-shell + * lane that installs zsh. + */ + +import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import { + createLoginShellHarness, + type LoginShellHarness +} from './structured-session-login-shell-test-harness' + +describe.runIf(process.platform !== 'win32')('a structured session in a bash login shell', () => { + let harness: LoginShellHarness + + beforeEach(() => { + harness = createLoginShellHarness() + }) + + afterEach(() => { + harness.dispose() + }) + + it("resolves this app's CLI through ORCA_CLI_COMMAND in `bash -lc`", async () => { + // Positive control: the profile really does put the global install first for a bare name. + expect(await harness.run({ program: '/bin/bash', args: ['-lc', 'orca'] })).toBe('global') + expect(await harness.run({ program: '/bin/bash', args: ['-lc', '"$ORCA_CLI_COMMAND"'] })).toBe( + 'app' + ) + }) + + it("keeps bare `orca` this app's CLI in a shell that reads no login profile", async () => { + expect(await harness.run({ program: '/bin/bash', args: ['-c', 'orca'] })).toBe('app') + }) +}) diff --git a/src/main/runtime/structured-session-login-shell-test-harness.ts b/src/main/runtime/structured-session-login-shell-test-harness.ts new file mode 100644 index 000000000000..943dfe0f4d3d --- /dev/null +++ b/src/main/runtime/structured-session-login-shell-test-harness.ts @@ -0,0 +1,48 @@ +/** + * A structured session's child env beside a HOME whose login profiles put a stand-in global `orca` + * first, as `/usr/local/bin` often is. Shared by the bash suite (every lane) and the zsh suite + * (the real-shell lane, which installs zsh). + */ + +import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { installFakeAppEnvironment } from '../../../config/scripts/vitest-host-ports-setup' +import { runProcess } from '../../shared/child-process/run-process' +import { structuredSessionChildIdentityEnv } from './structured-session-child-identity-env' + +const SESSION_ID = 'f7a1c0de-1111-4222-8333-444455556666' + +export type LoginShellHarness = { + /** Runs a shell with the structured session's env and returns its stdout. */ + run: (spec: { program: string; args: [flag: '-lc' | '-c', script: string] }) => Promise + dispose: () => void +} + +function writeStub(path: string, says: string): void { + writeFileSync(path, `#!/bin/sh\nprintf '%s' '${says}'\n`) + chmodSync(path, 0o755) +} + +export function createLoginShellHarness(): LoginShellHarness { + const root = mkdtempSync(join(tmpdir(), 'orca-login-shell-cli-')) + const home = join(root, 'home') + const globalBin = join(root, 'global-bin') + const userData = join(root, 'user-data') + const appCliBin = join(userData, 'cli', 'bin') + for (const dir of [home, globalBin, appCliBin]) { + mkdirSync(dir, { recursive: true }) + } + writeStub(join(globalBin, 'orca'), 'global') + writeStub(join(appCliBin, 'orca'), 'app') + writeStub(join(appCliBin, 'orca-dev'), 'app') + const prependGlobal = `export PATH="${globalBin}:$PATH"\n` + writeFileSync(join(home, '.zprofile'), prependGlobal) + writeFileSync(join(home, '.bash_profile'), prependGlobal) + installFakeAppEnvironment({ isPackaged: () => false, getPath: () => userData }) + const env = structuredSessionChildIdentityEnv(SESSION_ID, { HOME: home, PATH: '/usr/bin:/bin' }) + return { + run: async (spec) => (await runProcess({ ...spec, env })).stdout, + dispose: () => rmSync(root, { recursive: true, force: true }) + } +} diff --git a/src/main/runtime/structured-worker-child-identity-env.test.ts b/src/main/runtime/structured-worker-child-identity-env.test.ts deleted file mode 100644 index e966dd558240..000000000000 --- a/src/main/runtime/structured-worker-child-identity-env.test.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { installFakeAppEnvironment } from '../../../config/scripts/vitest-host-ports-setup' - -const shim = vi.hoisted(() => ({ ensureLinuxTerminalOrcaCliShimDir: vi.fn() })) -vi.mock('../cli/linux-terminal-orca-cli-shim', () => shim) - -import { structuredWorkerChildIdentityEnv } from './structured-worker-child-identity-env' -import { - mintStructuredWorkerHandle, - mintStructuredWorkerPaneKey, - structuredWorkerHostScope, - structuredWorkerIdentities, - structuredWorkerProcessIncarnation -} from './structured-worker-identity' - -const SESSION_ID = 'f7a1c0de-1111-4222-8333-444455556666' -const USER_DATA = '/data/orca' -const RESOURCES = '/app/Resources' -const SHIM_DIR = join(USER_DATA, 'linux-orca-cli-shim') - -const platformDescriptor = Object.getOwnPropertyDescriptor(process, 'platform')! -const resourcesDescriptor = Object.getOwnPropertyDescriptor(process, 'resourcesPath') - -function pinPlatform(platform: NodeJS.Platform): void { - Object.defineProperty(process, 'platform', { configurable: true, value: platform }) -} - -function registerWorker(): string { - const handle = mintStructuredWorkerHandle() - structuredWorkerIdentities.register({ - handle, - sessionId: SESSION_ID, - agent: 'claude', - paneKey: mintStructuredWorkerPaneKey(SESSION_ID), - processIncarnation: structuredWorkerProcessIncarnation(SESSION_ID), - worktreeId: 'wt_1', - hostScope: { kind: 'local', hostId: 'local' } - }) - return handle -} - -beforeEach(() => { - shim.ensureLinuxTerminalOrcaCliShimDir.mockReset() - shim.ensureLinuxTerminalOrcaCliShimDir.mockReturnValue(SHIM_DIR) - Object.defineProperty(process, 'resourcesPath', { configurable: true, value: RESOURCES }) -}) - -afterEach(() => { - structuredWorkerIdentities.clear() - Object.defineProperty(process, 'platform', platformDescriptor) - if (resourcesDescriptor) { - Object.defineProperty(process, 'resourcesPath', resourcesDescriptor) - } else { - Reflect.deleteProperty(process, 'resourcesPath') - } -}) - -describe('structuredWorkerChildIdentityEnv', () => { - it('marks an ordinary chat session as having NO identity, and grants it nothing', () => { - // The marker names nothing — no handle, no pane key, no session id, no token — so it cannot be - // replayed or impersonated, and it does not reach the hook, agent-row or mobile-projection - // pipelines a pane key would. Its only job is to let the CLI REFUSE instead of guessing: this - // session has no pane, so every implicit-terminal guess resolved to a sibling, and a - // destructive `check` then consumed that sibling's mail. - pinPlatform('linux') - installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) - const childEnv = { PATH: '/usr/bin' } - const env = structuredWorkerChildIdentityEnv(SESSION_ID, childEnv) - expect(env).toEqual({ PATH: '/usr/bin', ORCA_STRUCTURED_SESSION: '1' }) - expect(env.ORCA_TERMINAL_HANDLE).toBeUndefined() - expect(env.ORCA_PANE_KEY).toBeUndefined() - expect(env.ORCA_CLI_COMMAND).toBeUndefined() - // Still no CLI reachability granted, so packaged builds keep today's exposure. - expect(childEnv.PATH).toBe('/usr/bin') - expect(shim.ensureLinuxTerminalOrcaCliShimDir).not.toHaveBeenCalled() - }) - - it('gives a packaged-Linux worker the bare-orca shim its ORCA_CLI_COMMAND assumes', () => { - // Without this the child's first `orca orchestration check` execs GNOME Orca — the CLI - // installs as `orca-ide` on Linux (stablyai/orca#7904) — and the dispatch hangs to timeout. - pinPlatform('linux') - installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) - const handle = registerWorker() - const env = structuredWorkerChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin:/bin' }) - expect(env.ORCA_TERMINAL_HANDLE).toBe(handle) - expect(env.ORCA_CLI_COMMAND).toBe('orca') - expect(env.PATH).toBe(`${SHIM_DIR}:/usr/bin:/bin`) - }) - - it('gives a packaged-macOS worker the bundled CLI dir', () => { - pinPlatform('darwin') - installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) - registerWorker() - const env = structuredWorkerChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin' }) - expect(env.PATH).toBe(`${join(RESOURCES, 'bin')}:/usr/bin`) - }) - - it('gives a packaged-Windows worker the bundled CLI dir under the env block spelling', () => { - pinPlatform('win32') - installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) - registerWorker() - const env = structuredWorkerChildIdentityEnv(SESSION_ID, { Path: 'C:\\Windows' }) - expect(env.Path).toBe(`${join(RESOURCES, 'bin')};C:\\Windows`) - expect(env.PATH).toBeUndefined() - }) - - it('gives an unpackaged worker the dev launcher dir', () => { - pinPlatform('darwin') - installFakeAppEnvironment({ isPackaged: () => false, getPath: () => USER_DATA }) - registerWorker() - const env = structuredWorkerChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin' }) - expect(env.PATH).toBe(`${join(USER_DATA, 'cli', 'bin')}:/usr/bin`) - }) - - it('never puts a pane key in the child environment', () => { - // A pane key here flows into hook-emitted agent statuses and the attestation, agent-row and - // mobile-projection pipelines, all of which assume it names a live PTY leaf. - pinPlatform('linux') - installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) - registerWorker() - const env = structuredWorkerChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin' }) - expect(env.ORCA_PANE_KEY).toBeUndefined() - expect(Object.keys(env).filter((key) => key.includes('PANE'))).toEqual([]) - }) - - it('never names the WSL-scoped launcher, because a structured worker cannot run in WSL', () => { - // `orca-ide` is the literal the PTY lane exports for WSL only. A structured session that - // resolves to a WSL distro is refused a host scope, so it never becomes a worker at all — - // which is why the bare-`orca` shim, not the literal, is the right fix on Linux. - expect( - structuredWorkerHostScope({ - executionHostId: 'local', - workspaceId: 'wt_1', - workspaceKind: 'git-worktree', - wslDistro: 'Ubuntu' - }) - ).toBeNull() - pinPlatform('linux') - installFakeAppEnvironment({ isPackaged: () => true, getPath: () => USER_DATA }) - registerWorker() - expect( - structuredWorkerChildIdentityEnv(SESSION_ID, { PATH: '/usr/bin' }).ORCA_CLI_COMMAND - ).not.toBe('orca-ide') - }) -}) diff --git a/src/main/runtime/structured-worker-child-identity-env.ts b/src/main/runtime/structured-worker-child-identity-env.ts deleted file mode 100644 index 6cf9f46e910c..000000000000 --- a/src/main/runtime/structured-worker-child-identity-env.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * The orchestration identity — and the CLI reachability — a structured worker's own child needs - * to speak for itself. - * - * Without `ORCA_TERMINAL_HANDLE` the worker's Bash tool has nothing to pass as `--from`, and - * `resolveOrchestrationTerminalHandle` falls back to a cwd lookup that returns whichever leaf in - * the worktree comes first. Two attacks follow from that: a bare `check` reads and consumes a - * SIBLING's dispatch mailbox, and a bare `send --type worker_done` can settle a sibling's - * context-only dispatch, a tier that has no capability token to reject on. - * - * `ORCA_CLI_COMMAND: 'orca'` is honest ONLY because of the PATH prepend below. Orca's Linux CLI - * installs as `orca-ide` so it never claims GNOME Orca's /usr/bin/orca (stablyai/orca#7904), and - * on packaged macOS/Windows the bundled launcher is reachable only from the app's own resources - * dir. A PTY worker gets that treatment from `buildPtyHostEnv`; a structured worker has no PTY, - * so it applies the SAME function here rather than a second, drifting copy of the rule. - * - * Deliberately NOT `ORCA_PANE_KEY`. Claude structured sessions run hooks, and a pane key in their - * environment starts flowing into hook-emitted agent-status payloads and the hook-attestation, - * agent-row and mobile-projection pipelines, every one of which assumes a pane key names a live - * PTY leaf. It would also open `selectExactWorkerProviderSession`, which is fail-closed today - * precisely because a structured session emits no hook agent status. The CLI needs none of it once - * the handle is present. - * - * A session that is not a dispatched worker gets ONE variable, `ORCA_STRUCTURED_SESSION`, and it - * names nothing: no handle, no pane key, no session id, no token. Its only meaning is "this child - * is a structured session with no orchestration identity", which is what a verb needs in order to - * REFUSE rather than guess one. Because it names nothing it cannot be replayed, cannot impersonate, - * and cannot flow into the hook, agent-row or mobile-projection pipelines the way a pane key would - * — which is why it is a different decision from withholding `ORCA_PANE_KEY`, not a reversal of it. - * Without it, `check` fell through to the active-terminal guess and destructively consumed a - * SIBLING pane's oldest unread batch; `requireUnambiguous` only narrows that, because with exactly - * one terminal pane in the worktree the guess still resolves — to a sibling. - * - * The handle is read from the registry at spawn time, so an in-host recovery respawn re-bakes the - * SAME handle rather than a stale or fresh one. - */ - -import { getAppEnvironment, hasAppEnvironment } from '../../shared/app-environment' -import { prependOrcaCliDirToChildPath } from '../cli/orca-cli-child-path' -import { ORCA_STRUCTURED_SESSION_ENV } from '../../shared/structured-session-marker' -import { structuredWorkerIdentities } from './structured-worker-identity' - -export function structuredWorkerChildIdentityEnv( - sessionId: string, - childEnv: Record -): Record { - const identity = structuredWorkerIdentities.getBySessionId(sessionId) - if (!identity) { - return { ...childEnv, [ORCA_STRUCTURED_SESSION_ENV]: '1' } - } - const env: Record = { - ...childEnv, - ORCA_TERMINAL_HANDLE: identity.handle, - ORCA_CLI_COMMAND: 'orca' - } - applyOrcaCliPath(env) - return env -} - -/** - * A host with no app environment installed — a plain-Node fork, or a unit test — has no userData - * root to resolve, and inventing one would write a shim into the wrong directory. - */ -function applyOrcaCliPath(env: Record): void { - if (!hasAppEnvironment()) { - return - } - const app = getAppEnvironment() - prependOrcaCliDirToChildPath(env, { - isPackaged: app.isPackaged(), - userDataPath: app.getPath('userData'), - resourcesPath: process.resourcesPath ?? null - }) -} diff --git a/src/main/runtime/structured-worker-identity.test.ts b/src/main/runtime/structured-worker-identity.test.ts index d20cadf5c770..17ba897de479 100644 --- a/src/main/runtime/structured-worker-identity.test.ts +++ b/src/main/runtime/structured-worker-identity.test.ts @@ -5,7 +5,7 @@ import { structuredAgentSessionTabId } from '../../shared/structured-agent-session-projection' import { selectExactWorkerProviderSession } from './orchestration/worker-provider-session' -import { structuredWorkerChildIdentityEnv } from './structured-worker-child-identity-env' +import { structuredSessionChildIdentityEnv } from './structured-session-child-identity-env' import { StructuredWorkerIdentityRegistry, isStructuredWorkerHandle, @@ -300,9 +300,9 @@ describe('structured workers stay outside the PTY-only fail-closed paths', () => hostScope: { kind: 'local', hostId: 'local' } }) try { - const env = structuredWorkerChildIdentityEnv(SESSION_ID, {}) - // Registered, so this is a populated env — not the empty one an unregistered session gets, - // which would satisfy the pane-key assertion for the wrong reason. + const env = structuredSessionChildIdentityEnv(SESSION_ID, {}) + // Registered, so the worker's handle is present; without it the pane-key assertion would pass + // for the wrong reason. expect(env.ORCA_TERMINAL_HANDLE).toBe(handle) expect(Object.keys(env)).not.toContain('ORCA_PANE_KEY') } finally { diff --git a/src/main/runtime/structured-worker-identity.ts b/src/main/runtime/structured-worker-identity.ts index e09adee7c1e2..22a49e11abb2 100644 --- a/src/main/runtime/structured-worker-identity.ts +++ b/src/main/runtime/structured-worker-identity.ts @@ -26,14 +26,19 @@ import { } from '../../shared/structured-agent-session-projection' import { isTerminalLeafId, makePaneKey, parsePaneKey } from '../../shared/stable-pane-id' import { isOrcaSessionId, type OrcaSessionId } from '../../shared/orca-session-address' +import { + STRUCTURED_WORKER_HANDLE_PREFIX, + isStructuredWorkerHandle +} from '../../shared/structured-worker-handle' import { parseWorkerTerminalHostScope, type WorkerTerminalHostScope } from './orchestration/worker-terminal-process-liveness' -// Deliberately not `term_`: `issueHandle` revalidates the renderer graph epoch against the -// renderer-driven leaves map, so a main-minted `term_` leaf evaporates on the next window reload. -export const STRUCTURED_WORKER_HANDLE_PREFIX = 'structworker_' +export { + STRUCTURED_WORKER_HANDLE_PREFIX, + isStructuredWorkerHandle +} from '../../shared/structured-worker-handle' export const STRUCTURED_WORKER_INCARNATION_PREFIX = 'structured:' export type StructuredWorkerIdentity = { @@ -47,10 +52,6 @@ export type StructuredWorkerIdentity = { hostScope: WorkerTerminalHostScope } -export function isStructuredWorkerHandle(handle: string | null | undefined): boolean { - return typeof handle === 'string' && handle.startsWith(STRUCTURED_WORKER_HANDLE_PREFIX) -} - export function mintStructuredWorkerHandle(): string { return `${STRUCTURED_WORKER_HANDLE_PREFIX}${randomUUID()}` } diff --git a/src/main/ssh/ssh-remote-cli-host-passthrough.test.ts b/src/main/ssh/ssh-remote-cli-host-passthrough.test.ts index 53334e3cd125..811917cf7152 100644 --- a/src/main/ssh/ssh-remote-cli-host-passthrough.test.ts +++ b/src/main/ssh/ssh-remote-cli-host-passthrough.test.ts @@ -129,6 +129,28 @@ describe('buildHostCliEnv', () => { expect(env.ORCA_CLI_COMMAND).toBe('orca') }) + it('never lets a remote command claim a local agent session', () => { + // The host's env carries a session id when Orca was launched inside a structured session; the + // remote shell's own is from another machine. Session identity is same-host only. + const env = buildHostCliEnv({ + hostEnv: { + ORCA_AGENT_SESSION_ID: 'f7a1c0de-1111-4222-8333-444455556666', + ORCA_STRUCTURED_SESSION: '1' + }, + remoteEnv: { + ORCA_TERMINAL_HANDLE: 'term_remote', + ORCA_AGENT_SESSION_ID: 'a0b1c2d3-0000-4000-8000-00000000abcd' + }, + userDataPath: '/host/user-data', + remoteCwd: '/srv/repo' + }) + + expect(env.ORCA_AGENT_SESSION_ID).toBeUndefined() + expect(env.ORCA_STRUCTURED_SESSION).toBeUndefined() + // The remote command still speaks as its own terminal. + expect(env.ORCA_TERMINAL_HANDLE).toBe('term_remote') + }) + it('namespaces identical remote artifact paths by stable SSH target', () => { const artifactInput = { sourceKey: '/srv/repo/report.html', diff --git a/src/main/ssh/ssh-remote-cli-host-passthrough.ts b/src/main/ssh/ssh-remote-cli-host-passthrough.ts index d62a23d8e304..4490343504ff 100644 --- a/src/main/ssh/ssh-remote-cli-host-passthrough.ts +++ b/src/main/ssh/ssh-remote-cli-host-passthrough.ts @@ -13,6 +13,8 @@ import { ORCHESTRATION_COMPATIBILITY_HOST_INCARNATION_ENV, ORCHESTRATION_COMPATIBILITY_HOST_KIND_ENV } from '../../shared/orchestration-compatibility-evidence' +import { ORCA_AGENT_SESSION_ID_ENV } from '../../shared/agent-session-caller-env' +import { ORCA_STRUCTURED_SESSION_ENV } from '../../shared/structured-session-marker' import { REMOTE_ARTIFACT_INPUT_ENV, sshArtifactSourceKey, @@ -131,6 +133,10 @@ export function buildHostCliEnv(args: { delete env[ORCHESTRATION_COMPATIBILITY_HOST_INCARNATION_ENV] delete env[ORCHESTRATION_COMPATIBILITY_ATTACHMENT_ENV] delete env[REMOTE_ARTIFACT_INPUT_ENV] + // Why: a remote command must never claim a local agent session. The host's env carries one only + // when Orca was launched inside a session, and identity by session id is same-host only. + delete env[ORCA_AGENT_SESSION_ID_ENV] + delete env[ORCA_STRUCTURED_SESSION_ENV] if (args.runtimeAuthority) { env[ORCHESTRATION_COMPATIBILITY_HOST_KIND_ENV] = 'ssh' env[ORCHESTRATION_COMPATIBILITY_HOST_ID_ENV] = args.runtimeAuthority.targetId diff --git a/src/shared/agent-session-caller-env.ts b/src/shared/agent-session-caller-env.ts new file mode 100644 index 000000000000..5f66128dc5f9 --- /dev/null +++ b/src/shared/agent-session-caller-env.ts @@ -0,0 +1,38 @@ +/** + * The Orca-minted agent session id, injected into a structured session's own child processes. When + * it is present it IS the orchestration caller: the CLI sends it in the orchestration envelope and + * the host resolves the session it names, so no terminal is resolved or guessed on its behalf. + * + * Identity by session id assumes one machine and one user. A host boundary (SSH, a paired peer, + * WSL) re-opens that decision: the host refuses a claim that arrives across one, and the SSH + * passthrough never carries the id. + */ +import { ORCA_SESSION_ADDRESS_PREFIX } from './orca-session-address-prefix' +import { isStructuredWorkerHandle } from './structured-worker-handle' + +export const ORCA_AGENT_SESSION_ID_ENV = 'ORCA_AGENT_SESSION_ID' + +export function readInjectedAgentSessionId( + env: Readonly> = process.env +): string | undefined { + const value = env[ORCA_AGENT_SESSION_ID_ENV]?.trim() + return value ? value : undefined +} + +/** + * The address the host gives this session (`mailboxAddressOf` on its resolved party): a structured + * worker keeps the handle it was minted, any other session is `session:`. Only for text that + * must match what the host writes; the CLI spells it without the host resolver. + */ +export function injectedSessionAddress( + env: Readonly> = process.env +): string | undefined { + const sessionId = readInjectedAgentSessionId(env) + if (!sessionId) { + return undefined + } + const ownHandle = env.ORCA_TERMINAL_HANDLE + return isStructuredWorkerHandle(ownHandle) + ? ownHandle + : `${ORCA_SESSION_ADDRESS_PREFIX}${sessionId}` +} diff --git a/src/shared/orca-session-address-prefix.ts b/src/shared/orca-session-address-prefix.ts new file mode 100644 index 000000000000..984aec9d7890 --- /dev/null +++ b/src/shared/orca-session-address-prefix.ts @@ -0,0 +1,2 @@ +// A leaf with no imports, so the CLI entry can spell a session address without the codec's zod graph. +export const ORCA_SESSION_ADDRESS_PREFIX = 'session:' diff --git a/src/shared/orca-session-address.ts b/src/shared/orca-session-address.ts index 339ccb01f435..d0098ea2ef9d 100644 --- a/src/shared/orca-session-address.ts +++ b/src/shared/orca-session-address.ts @@ -1,17 +1,19 @@ import { isAgentSessionId } from './agent-session-record' +import { STRUCTURED_WORKER_HANDLE_PREFIX } from './structured-worker-handle' +import { ORCA_SESSION_ADDRESS_PREFIX } from './orca-session-address-prefix' /** - * The Orca session id is the id Orca minted for a structured session (its session record id), never - * the provider's own session id. Orchestration stores, bare, the one the agent is addressed by: for - * a `/clear`ed chat, its lineage root's, not the live session's. Mail addresses the session as - * `session:`, beside `run:` and `dispatch:`, and derives that spelling here rather than - * storing it. + * The Orca session id is the id Orca minted for a structured session (its session record id, the + * value of `ORCA_AGENT_SESSION_ID`), never the provider's own session id. Orchestration stores, + * bare, the one the agent is addressed by: for a `/clear`ed chat, its lineage root's, not the live + * session's. Mail addresses the session as `session:`, beside `run:` and `dispatch:`, + * and derives that spelling here rather than storing it. * * Where the session runs is not part of the id; it is read from the session record when needed. PTY * agents have none today, and never a pane-keyed one: a pane outlives the agent in it, so such an id * would be inherited by the pane's next occupant. */ -export const ORCA_SESSION_ADDRESS_PREFIX = 'session:' +export { ORCA_SESSION_ADDRESS_PREFIX } declare const orcaSessionIdBrand: unique symbol declare const orcaSessionAddressBrand: unique symbol @@ -24,7 +26,7 @@ export type OrcaSessionAddress = string & { readonly [orcaSessionAddressBrand]: // Terminal handles (`term_` from the PTY runtime, `structworker_` from structured-worker-identity) // share the session-id charset. A handle is never a session, so one handed over by mistake must not // become a durable Orca session id. -const TERMINAL_HANDLE_PREFIXES = ['term_', 'structworker_'] as const +const TERMINAL_HANDLE_PREFIXES = ['term_', STRUCTURED_WORKER_HANDLE_PREFIX] as const export function isOrcaSessionId(id: string): id is OrcaSessionId { return isAgentSessionId(id) && !TERMINAL_HANDLE_PREFIXES.some((prefix) => id.startsWith(prefix)) diff --git a/src/shared/structured-session-marker.ts b/src/shared/structured-session-marker.ts index 36c90f432ee8..c30dc5a6139d 100644 --- a/src/shared/structured-session-marker.ts +++ b/src/shared/structured-session-marker.ts @@ -1,13 +1,18 @@ /** - * The marker a structured chat session's child carries when it has NO orchestration identity. + * Marks a structured session's child. It names nothing — no handle, no pane key, no token. * - * It names nothing on purpose — no handle, no pane key, no session id, no token — so it grants no - * authority and cannot be replayed or impersonated. Its only job is to let a CLI verb that would - * otherwise GUESS an implicit terminal refuse instead: a structured session has no pane, so every - * guess resolves to a sibling, and `orchestration check` is destructive by default. + * Every structured child now also carries its injected session id, and a current CLI checks the id + * first, so for it the marker only matters when the id is absent: a child spawned by an Orca that + * predates injection. The marker is still written for the opposite case, a CLI that predates the + * id, which refuses on it. Either way the answer is refuse, never guess: a structured session has + * no pane, so every implicit-terminal guess resolves to a sibling, and `orchestration check` is + * destructive by default. + * + * The reader answers only "does this process carry the marker": a current CLI reaches it after the + * id check has already returned, which is what makes a marked child with an id act as its session. */ export const ORCA_STRUCTURED_SESSION_ENV = 'ORCA_STRUCTURED_SESSION' -export function isStructuredSessionWithoutIdentity(env: NodeJS.ProcessEnv = process.env): boolean { +export function hasStructuredSessionMarker(env: NodeJS.ProcessEnv = process.env): boolean { return (env[ORCA_STRUCTURED_SESSION_ENV] ?? '').length > 0 } diff --git a/src/shared/structured-worker-handle.ts b/src/shared/structured-worker-handle.ts new file mode 100644 index 000000000000..c9fd3927c02c --- /dev/null +++ b/src/shared/structured-worker-handle.ts @@ -0,0 +1,7 @@ +// Deliberately not `term_`: `issueHandle` revalidates the renderer graph epoch against the +// renderer-driven leaves map, so a main-minted `term_` leaf evaporates on the next window reload. +export const STRUCTURED_WORKER_HANDLE_PREFIX = 'structworker_' + +export function isStructuredWorkerHandle(handle: string | null | undefined): handle is string { + return typeof handle === 'string' && handle.startsWith(STRUCTURED_WORKER_HANDLE_PREFIX) +} From c5330d0d525d44d83213acca3a62b3c1121f063d Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:25:24 -0700 Subject: [PATCH 34/90] fix(native-chat): stop killing processes that only inherited a chat's spawn tag (#23460) * fix(native-chat): stop signalling processes that only inherited a spawn token A spawn token is an environment variable, so every descendant of a provider child carries it. The Linux-only startup scan treated any carrier no lease claimed as a lost provider child and sent it SIGTERM, which also hit editors, tmux servers and nested Orca processes the agent had started. Remove that scan's killing consumer; the token scan stays for the reservation probe, and recorded owners are still stopped by identity during recovery. * fix(codex): remove the token-scan kill path from app-server teardown Every descendant inherits the spawn token, so killing each pid that carries it can reach processes the agent started that are not the provider. Production never injected this path; teardown always uses the process-group and descendant-snapshot proof. Drop it, its deps, and the now-unused spawn-token argument. --- config/scripts/ci-shard-timings.json | 1 - src/main/codex/codex-app-server-connection.ts | 4 +- .../codex-app-server-process-teardown.test.ts | 54 +---- .../codex-app-server-process-teardown.ts | 74 +------ .../agent-session-orphan-child-reaper.test.ts | 68 ------- .../agent-session-orphan-child-reaper.ts | 48 ----- .../agent-session-record-store.test.ts | 8 +- .../runtime/agent-session-record-store.ts | 9 - .../agent-session-spawn-token-process-scan.ts | 2 +- .../structured-agent-session-runtime.test.ts | 61 +----- .../structured-agent-session-runtime.ts | 17 -- ...nt-session-spawn-token-descendants.test.ts | 191 ++++++++++++++++++ ...ctured-agent-session-support-probe.test.ts | 19 +- .../agent-session-lease-adjudication.test.ts | 17 +- .../agent-session-lease-adjudication.ts | 20 +- 15 files changed, 211 insertions(+), 382 deletions(-) delete mode 100644 src/main/runtime/agent-session-orphan-child-reaper.test.ts delete mode 100644 src/main/runtime/agent-session-orphan-child-reaper.ts create mode 100644 src/main/runtime/structured-agent-session-spawn-token-descendants.test.ts diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 2ca7094bdd24..1a187718dd23 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -3241,7 +3241,6 @@ "src/main/runtime/agent-session-launch-env-backfill.test.ts": 264, "src/main/runtime/agent-session-lease-renewal.test.ts": 242, "src/main/runtime/agent-session-operation-admission.test.ts": 165, - "src/main/runtime/agent-session-orphan-child-reaper.test.ts": 90, "src/main/runtime/agent-session-process-identity-probe-windows-batch.test.ts": 47, "src/main/runtime/agent-session-process-identity-probe.test.ts": 78, "src/main/runtime/agent-session-provider-handle-transition.test.ts": 104, diff --git a/src/main/codex/codex-app-server-connection.ts b/src/main/codex/codex-app-server-connection.ts index c0ac7f07400a..b0cf133e1e2a 100644 --- a/src/main/codex/codex-app-server-connection.ts +++ b/src/main/codex/codex-app-server-connection.ts @@ -5,7 +5,6 @@ import { buildCodexAppServerExitError } from './codex-app-server-exit-error' import { initializeCodexAppServerConnection } from './codex-app-server-handshake' import { CodexAppServerHandshakeExitUnprovenError } from './codex-app-server-handshake-exit-proof' import { terminateCodexAppServerProcessTree } from './codex-app-server-process-teardown' -import { CODEX_SPAWN_TOKEN_ENV } from './codex-structured-owner-identity' import { waitForProcessExitUntil } from './codex-process-exit-deadline' import { CodexAppServerTimeoutError, @@ -64,12 +63,11 @@ export async function openCodexAppServerConnection( } const spawnSpec = createProviderSpawnSpec(launch, childEnv, process.platform) const child = spawnImpl(spawnSpec) - const spawnToken = launch.env?.[CODEX_SPAWN_TOKEN_ENV] function terminateProcessTree(): Promise { // The supervisor and provider own separate POSIX groups so the supervisor can prove the // provider group empty before relaying its exit. Forced wrapper teardown uses descendant proof. - return terminateCodexAppServerProcessTree(child, spawnToken) + return terminateCodexAppServerProcessTree(child) } let stderrTail = '' diff --git a/src/main/codex/codex-app-server-process-teardown.test.ts b/src/main/codex/codex-app-server-process-teardown.test.ts index cec8f91d0815..295d780718d0 100644 --- a/src/main/codex/codex-app-server-process-teardown.test.ts +++ b/src/main/codex/codex-app-server-process-teardown.test.ts @@ -26,7 +26,7 @@ describe('terminateCodexAppServerProcessTree', () => { const release = Promise.withResolvers() const terminateWindowsTree = vi.fn(() => release.promise) - const teardown = terminateCodexAppServerProcessTree(target, undefined, { + const teardown = terminateCodexAppServerProcessTree(target, { platform: 'win32', terminateWindowsTree }) @@ -38,52 +38,12 @@ describe('terminateCodexAppServerProcessTree', () => { expect(target.kill).toHaveBeenCalledWith('SIGKILL') }) - it('kills exact Linux spawn-token PIDs before the recorded wrapper', async () => { - const target = child() - const findSpawnTokenProcesses = vi - .fn<() => Promise>() - .mockResolvedValueOnce([1234, 2345, 3456]) - .mockResolvedValueOnce([1234]) - .mockResolvedValueOnce([1234]) - const signalPid = vi.fn() - - await expect( - terminateCodexAppServerProcessTree(target, 'spawn-1', { - platform: 'linux', - findSpawnTokenProcesses, - signalPid, - isPidPresent: () => false, - wait: async () => undefined - }) - ).resolves.toBe(true) - - expect(signalPid.mock.calls).toEqual([ - [2345, 'SIGKILL'], - [3456, 'SIGKILL'] - ]) - expect(target.kill).toHaveBeenCalledTimes(1) - expect(target.kill).toHaveBeenCalledWith('SIGKILL') - }) - - it('keeps the wrapper reachable when Linux cannot prove descendant exit', async () => { - const target = child() - - await expect( - terminateCodexAppServerProcessTree(target, 'spawn-1', { - platform: 'linux', - findSpawnTokenProcesses: async () => null - }) - ).resolves.toBe(false) - - expect(target.kill).not.toHaveBeenCalled() - }) - it('waits for an owned POSIX snapshot before killing the wrapper', async () => { const target = child() const snapshot = { rootPgid: 1234, descendants: [], capturedAtMs: 1 } const release = Promise.withResolvers() - const teardown = terminateCodexAppServerProcessTree(target, undefined, { + const teardown = terminateCodexAppServerProcessTree(target, { platform: 'darwin', captureDescendants: async () => snapshot, terminateDescendants: () => release.promise @@ -102,7 +62,7 @@ describe('terminateCodexAppServerProcessTree', () => { const signalProcessGroup = vi.fn() await expect( - terminateCodexAppServerProcessTree(target, undefined, { + terminateCodexAppServerProcessTree(target, { platform: 'darwin', dedicatedProcessGroup: true, captureDescendants, @@ -119,7 +79,7 @@ describe('terminateCodexAppServerProcessTree', () => { const target = child() await expect( - terminateCodexAppServerProcessTree(target, undefined, { + terminateCodexAppServerProcessTree(target, { platform: 'linux', dedicatedProcessGroup: true, signalProcessGroup: () => { @@ -142,7 +102,7 @@ describe('terminateCodexAppServerProcessTree', () => { const target = { pid: UNREACHABLE_PGID, kill: vi.fn(() => true) as ChildProcess['kill'] } await expect( - terminateCodexAppServerProcessTree(target, undefined, { + terminateCodexAppServerProcessTree(target, { platform: 'darwin', captureDescendants: async () => ({ rootPgid: UNREACHABLE_PGID, @@ -162,7 +122,7 @@ describe('terminateCodexAppServerProcessTree', () => { const signalProcessGroup = vi.fn() await expect( - terminateCodexAppServerProcessTree(target, undefined, { + terminateCodexAppServerProcessTree(target, { platform: 'darwin', captureDescendants: async () => ({ rootPgid: 1234, descendants: [], capturedAtMs: 1 }), terminateDescendants: async () => true, @@ -191,7 +151,7 @@ describe('terminateCodexAppServerProcessTree', () => { const results = await Promise.all( targets.map((target) => - terminateCodexAppServerProcessTree(target, undefined, { + terminateCodexAppServerProcessTree(target, { platform: 'linux', dedicatedProcessGroup: true, captureDescendants, diff --git a/src/main/codex/codex-app-server-process-teardown.ts b/src/main/codex/codex-app-server-process-teardown.ts index 5a9c6e3574b4..10e625bef7e8 100644 --- a/src/main/codex/codex-app-server-process-teardown.ts +++ b/src/main/codex/codex-app-server-process-teardown.ts @@ -2,11 +2,8 @@ import type { ChildProcessHandle } from '../../shared/child-process/run-process' import { captureDescendantSnapshot, type DescendantSnapshot } from '../pty-descendant-termination' import { terminateDescendantSnapshotAndWait } from '../pty-descendant-exit-verification' import { terminateWindowsProcessTree } from '../windows-process-tree-kill' -import { findAgentSessionSpawnTokenProcesses } from '../runtime/agent-session-spawn-token-process-scan' import { recordSelfInitiatedTreeKill } from '../crash-reporting/self-initiated-tree-kill-log' -const TOKEN_PROCESS_EXIT_TIMEOUT_MS = 3_500 -const TOKEN_PROCESS_POLL_MS = 25 const activeTeardowns = new WeakMap>() type TeardownChild = Pick @@ -14,16 +11,10 @@ type TeardownChild = Pick export type CodexAppServerProcessTeardownDeps = { platform?: NodeJS.Platform dedicatedProcessGroup?: boolean - /** Diagnostic/recovery injection only; never used by the primary teardown. */ - findSpawnTokenProcesses?: (spawnToken: string) => Promise captureDescendants?: (rootPid: number) => Promise terminateDescendants?: (snapshot: DescendantSnapshot) => Promise terminateWindowsTree?: (rootPid: number, deps?: { site?: string }) => Promise - signalPid?: (pid: number, signal: NodeJS.Signals) => void signalProcessGroup?: (pgid: number, signal: NodeJS.Signals) => void - isPidPresent?: (pid: number) => boolean - wait?: (ms: number) => Promise - now?: () => number } function terminateDedicatedPosixGroup( @@ -47,70 +38,11 @@ function terminateDedicatedPosixGroup( return true } -function sendSignal(pid: number, signal: NodeJS.Signals): void { - try { - process.kill(pid, signal) - } catch { - // An already-gone exact PID is the desired outcome. - } -} - -function isPidPresent(pid: number): boolean { - try { - process.kill(pid, 0) - return true - } catch (error) { - return (error as NodeJS.ErrnoException).code !== 'ESRCH' - } -} - -async function diagnosticTokenFallback( - rootPid: number, - spawnToken: string, - deps: CodexAppServerProcessTeardownDeps -): Promise { - const find = deps.findSpawnTokenProcesses ?? findAgentSessionSpawnTokenProcesses - const signal = deps.signalPid ?? sendSignal - const pidPresent = deps.isPidPresent ?? isPidPresent - const delay = - deps.wait ?? ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))) - const now = deps.now ?? Date.now - const deadline = now() + TOKEN_PROCESS_EXIT_TIMEOUT_MS - const signalled = new Set() - while (now() < deadline) { - const pids = await find(spawnToken).catch(() => null) - if (pids === null) { - return false - } - for (const pid of pids.filter((candidate) => candidate !== rootPid)) { - signalled.add(pid) - signal(pid, 'SIGKILL') - } - if ([...signalled].every((pid) => !pidPresent(pid))) { - return true - } - await delay(TOKEN_PROCESS_POLL_MS) - } - return false -} - async function terminatePosixTree( child: TeardownChild, rootPid: number, - _spawnToken: string | undefined, deps: CodexAppServerProcessTeardownDeps ): Promise { - // Kept only for explicit recovery callers/tests. Production always follows - // the dedicated process-group path below; token enumeration is evidence, - // never the owner of orphan-reaping decisions. - if (_spawnToken && deps.findSpawnTokenProcesses) { - const reaped = await diagnosticTokenFallback(rootPid, _spawnToken, deps) - if (reaped) { - child.kill('SIGKILL') - return true - } - return false - } child.kill('SIGSTOP') const capture = deps.captureDescendants ?? captureDescendantSnapshot const snapshot = await capture(rootPid).catch(() => null) @@ -158,7 +90,6 @@ async function terminatePosixTree( /** Stops every process owned by one app-server launch before releasing its wrapper. */ async function terminateOnce( child: TeardownChild, - spawnToken: string | undefined, deps: CodexAppServerProcessTeardownDeps ): Promise { const rootPid = child.pid @@ -176,12 +107,11 @@ async function terminateOnce( if (deps.dedicatedProcessGroup) { return terminateDedicatedPosixGroup(rootPid, deps) } - return terminatePosixTree(child, rootPid, spawnToken, deps) + return terminatePosixTree(child, rootPid, deps) } export function terminateCodexAppServerProcessTree( child: TeardownChild, - spawnToken?: string, deps: CodexAppServerProcessTeardownDeps = {} ): Promise { const key = child as object @@ -189,7 +119,7 @@ export function terminateCodexAppServerProcessTree( if (active) { return active } - const attempt = terminateOnce(child, spawnToken, deps).catch(() => false) + const attempt = terminateOnce(child, deps).catch(() => false) activeTeardowns.set(key, attempt) void attempt.then(() => { if (activeTeardowns.get(key) === attempt) { diff --git a/src/main/runtime/agent-session-orphan-child-reaper.test.ts b/src/main/runtime/agent-session-orphan-child-reaper.test.ts deleted file mode 100644 index eb837ac4a223..000000000000 --- a/src/main/runtime/agent-session-orphan-child-reaper.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -// A child spawned under a reservation whose record was lost is invisible to the lease. Reaping -// is bounded cleanup only; it never replaces the lease proof required to grant another writer. - -import { describe, expect, it, vi } from 'vitest' -import type { AgentSessionRecordStore } from './agent-session-record-store' -import { stopOrphanAgentSessionChildren } from './agent-session-orphan-child-reaper' - -function storeWithLeasedTokens(tokens: readonly string[]) { - return { - listOrphanSpawnTokens: (observed: readonly string[]) => - observed.filter((token) => !tokens.includes(token)) - } as Pick -} - -describe('orphan agent-session child reaper', () => { - it('stops every process whose spawn token no lease claims', async () => { - const stop = vi.fn() - - const stopped = await stopOrphanAgentSessionChildren({ - store: storeWithLeasedTokens(['token-owned']), - scan: async () => - new Map([ - ['token-owned', [101]], - ['token-lost', [202, 203]] - ]), - stop - }) - - expect(stopped).toEqual([202, 203]) - expect(stop).toHaveBeenCalledWith(202, 'SIGTERM') - expect(stop).toHaveBeenCalledWith(203, 'SIGTERM') - expect(stop).not.toHaveBeenCalledWith(101, 'SIGTERM') - }) - - it('stops nothing on a host that cannot enumerate spawn tokens', async () => { - const stop = vi.fn() - - // Null is "cannot answer", never "no tokens" — treating it as an empty scan would be a - // license to signal nothing, but a future empty-map reading would be a license to signal - // whatever the caller guessed. - const stopped = await stopOrphanAgentSessionChildren({ - store: { - listOrphanSpawnTokens: () => { - throw new Error('the reaper must not ask when the host could not answer') - } - }, - scan: async () => null, - stop - }) - - expect(stopped).toEqual([]) - expect(stop).not.toHaveBeenCalled() - }) - - it('surfaces a failure to signal an observed orphan', async () => { - const failure = Object.assign(new Error('not permitted'), { code: 'EPERM' }) - - await expect( - stopOrphanAgentSessionChildren({ - store: storeWithLeasedTokens([]), - scan: async () => new Map([['token-lost', [202]]]), - stop: () => { - throw failure - } - }) - ).rejects.toBe(failure) - }) -}) diff --git a/src/main/runtime/agent-session-orphan-child-reaper.ts b/src/main/runtime/agent-session-orphan-child-reaper.ts deleted file mode 100644 index 68d9c8990240..000000000000 --- a/src/main/runtime/agent-session-orphan-child-reaper.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Best-effort stop for provider children that carry an Orca spawn token no lease claims. - * - * A child spawned under a reservation whose record was lost — the primary store file went with it, - * or the crash beat the durable write — is unreachable but still connected to the provider session. - * Only a token match justifies signalling a process; neither age nor CPU is evidence, and a host - * that cannot enumerate tokens stops nothing. This never proves process exit or licenses a new - * owner; lease adjudication remains the single-writer boundary. - */ - -import type { AgentSessionRecordStore } from './agent-session-record-store' -import { - scanAgentSessionSpawnTokenProcesses, - type AgentSessionSpawnTokenScan -} from './agent-session-spawn-token-process-scan' - -export type AgentSessionOrphanStopSignal = 'SIGTERM' | 'SIGKILL' - -function defaultStop(pid: number, signal: AgentSessionOrphanStopSignal): void { - try { - process.kill(pid, signal) - } catch (error) { - if ((error as NodeJS.ErrnoException).code !== 'ESRCH') { - throw error - } - } -} - -/** Returns the pids signalled, so the caller can report what it reaped. */ -export async function stopOrphanAgentSessionChildren(input: { - store: Pick - scan?: () => Promise - stop?: (pid: number, signal: AgentSessionOrphanStopSignal) => void -}): Promise { - const observed = await (input.scan ?? scanAgentSessionSpawnTokenProcesses)() - if (observed === null || observed.size === 0) { - return [] - } - const stop = input.stop ?? defaultStop - const stopped: number[] = [] - for (const token of input.store.listOrphanSpawnTokens([...observed.keys()])) { - for (const pid of observed.get(token) ?? []) { - stop(pid, 'SIGTERM') - stopped.push(pid) - } - } - return stopped -} diff --git a/src/main/runtime/agent-session-record-store.test.ts b/src/main/runtime/agent-session-record-store.test.ts index ce38e43d0ea3..5ee25d36813d 100644 --- a/src/main/runtime/agent-session-record-store.test.ts +++ b/src/main/runtime/agent-session-record-store.test.ts @@ -753,13 +753,7 @@ describe('host and workspace isolation', () => { }) }) -describe('orphans, claim keys, checkpoints, and unreadable rows', () => { - it('calls a spawn token with no lease an orphan', async () => { - const store = await open() - await establishOwner(store) - expect(store.listOrphanSpawnTokens(['spawn-a', 'spawn-z'])).toEqual(['spawn-z']) - }) - +describe('claim keys, checkpoints, and unreadable rows', () => { it('keeps a retired claim key verifiable for the retention window', async () => { const store = await open() await store.retireClaimKey('key-1', NOW) diff --git a/src/main/runtime/agent-session-record-store.ts b/src/main/runtime/agent-session-record-store.ts index 7df509dd8102..314323a32380 100644 --- a/src/main/runtime/agent-session-record-store.ts +++ b/src/main/runtime/agent-session-record-store.ts @@ -25,7 +25,6 @@ import { retireAgentSessionClaimKey } from './agent-session-claim-key-retention' import type { AgentSessionOwnerProbe } from '../../shared/agent-session-lease-adjudication' -import { classifyObservedAgentSessionSpawnToken } from '../../shared/agent-session-lease-adjudication' import type { AgentSessionProviderHandleLink } from '../../shared/agent-session-provider-handle' import { agentSessionScopeKey, @@ -180,14 +179,6 @@ export class AgentSessionRecordStore { isClaimKeyVerifiable = (keyId: string, now: number): boolean => isAgentSessionClaimKeyVerifiable(this.state, keyId, now) - /** Spawn tokens observed on the host with no matching lease. Stop them; never adopt them. */ - listOrphanSpawnTokens(observedTokens: readonly string[]): string[] { - const leases = this.listRecords().map((record) => record.lease) - return observedTokens.filter( - (spawnToken) => classifyObservedAgentSessionSpawnToken({ spawnToken, leases }) === 'orphan' - ) - } - async reserveOwner(request: AgentSessionReserveRequest): Promise { return this.transact(() => commitAgentSessionReservation(this.state, request, AGENT_SESSION_LEASE_TTL_MS) diff --git a/src/main/runtime/agent-session-spawn-token-process-scan.ts b/src/main/runtime/agent-session-spawn-token-process-scan.ts index 6db1c069110f..55e860f93205 100644 --- a/src/main/runtime/agent-session-spawn-token-process-scan.ts +++ b/src/main/runtime/agent-session-spawn-token-process-scan.ts @@ -56,7 +56,7 @@ export async function scanAgentSessionSpawnTokenProcesses( /** * Diagnostic evidence only. A null result is deliberately typed as * `unverifiable`, not as an empty process set; callers must never use this - * Linux read-back as ownership or orphan-reaping proof. + * Linux read-back as ownership proof. */ export async function scanAgentSessionSpawnTokenEvidence( platform: NodeJS.Platform = process.platform, diff --git a/src/main/runtime/structured-agent-session-runtime.test.ts b/src/main/runtime/structured-agent-session-runtime.test.ts index 7749fc3c25b0..9f4f4e2474de 100644 --- a/src/main/runtime/structured-agent-session-runtime.test.ts +++ b/src/main/runtime/structured-agent-session-runtime.test.ts @@ -205,36 +205,6 @@ describe('structured agent-session runtime install', () => { vi.restoreAllMocks() }) - it('starts orphan reaping and reports failures without failing installation', async () => { - stateDirectory = await mkdtemp(join(tmpdir(), 'orca-structured-runtime-')) - const failure = new Error('scan failed') - const reapOrphanChildren = vi.fn(async () => { - throw failure - }) - const onError = vi.fn() - - await expect( - ensureStructuredAgentSessionHost({ - stateDirectory, - hostId: HOST_ID, - claimKeyId: 'key-1', - resolveWorkspacePath: async () => stateDirectory!, - resolveClaudeAuthPolicy: () => ({ stripAuthEnv: true }), - resolveEnvironment: async () => ({}), - reapOrphanChildren, - onError - }) - ).resolves.toBeDefined() - - await vi.waitFor(() => - expect(onError).toHaveBeenCalledWith({ - scope: 'agent-session-orphan-child-reaper', - error: failure - }) - ) - expect(reapOrphanChildren).toHaveBeenCalledWith({ store: expect.anything() }) - }) - it('holds stop until the model catalog has written its coalesced save', async () => { stateDirectory = await mkdtemp(join(tmpdir(), 'orca-structured-runtime-')) await ensureStructuredAgentSessionHost({ @@ -243,8 +213,7 @@ describe('structured agent-session runtime install', () => { claimKeyId: 'key-1', resolveWorkspacePath: async () => stateDirectory!, resolveClaudeAuthPolicy: () => ({ stripAuthEnv: true }), - resolveEnvironment: async () => ({}), - reapOrphanChildren: async () => [] + resolveEnvironment: async () => ({}) }) let finishWrite = (): void => {} vi.spyOn(agentModelCatalogStore, 'flushPersistence').mockReturnValue( @@ -265,33 +234,6 @@ describe('structured agent-session runtime install', () => { expect(stopped).toBe(true) }) - it('logs an orphan-reaper failure when no reporter is configured', async () => { - stateDirectory = await mkdtemp(join(tmpdir(), 'orca-structured-runtime-')) - const failure = new Error('scan failed') - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}) - - await expect( - ensureStructuredAgentSessionHost({ - stateDirectory, - hostId: HOST_ID, - claimKeyId: 'key-1', - resolveWorkspacePath: async () => stateDirectory!, - resolveClaudeAuthPolicy: () => ({ stripAuthEnv: true }), - resolveEnvironment: async () => ({}), - reapOrphanChildren: async () => { - throw failure - } - }) - ).resolves.toBeDefined() - - await vi.waitFor(() => - expect(consoleError).toHaveBeenCalledWith( - '[structured-agent-session] orphan reaper failed', - failure - ) - ) - }) - it('does not infer Windows process identity support from an injected reader', async () => { stateDirectory = await mkdtemp(join(tmpdir(), 'orca-structured-runtime-')) const originalPlatform = process.platform @@ -355,7 +297,6 @@ describe('a teardown that fails is retried by the next stop', () => { claimKeyId: 'key-1', resolveWorkspacePath: async () => directory!, resolveEnvironment: async () => ({}), - reapOrphanChildren: async () => [], resolveClaudeAuthPolicy: () => ({ stripAuthEnv: true }) }) diff --git a/src/main/runtime/structured-agent-session-runtime.ts b/src/main/runtime/structured-agent-session-runtime.ts index f4a1d1b81850..1659fcd512ea 100644 --- a/src/main/runtime/structured-agent-session-runtime.ts +++ b/src/main/runtime/structured-agent-session-runtime.ts @@ -38,7 +38,6 @@ import { } from '../native-chat/claude-structured-managed-account-support' import { AgentSessionRecordStore } from './agent-session-record-store' import { agentSessionStorePath } from './agent-session-record-store-file' -import { stopOrphanAgentSessionChildren } from './agent-session-orphan-child-reaper' import { createStructuredAgentSessionOwnerProbe, createStructuredAgentSessionOwnerProbes @@ -106,7 +105,6 @@ export type StructuredAgentSessionRuntimeDeps = { statusSink?: StructuredAgentSessionHostDeps['statusSink'] /** See `StructuredAgentSessionHostDeps.hasOpenDispatch`. */ hasOpenDispatch?: StructuredAgentSessionHostDeps['hasOpenDispatch'] - reapOrphanChildren?: typeof stopOrphanAgentSessionChildren /** The account home a structured launch would pin right now, for catalog * reads with no session record. Absent disables the catalog surface. */ resolveAgentAccountHome?: RuntimeAgentAccountHomeResolver @@ -199,21 +197,6 @@ async function install(deps: StructuredAgentSessionRuntimeDeps): Promise { - try { - if (deps.onError) { - deps.onError({ scope: 'agent-session-orphan-child-reaper', error }) - } else { - console.error('[structured-agent-session] orphan reaper failed', error) - } - } catch (reportingError) { - console.error( - '[structured-agent-session] orphan reaper error reporting failed', - reportingError - ) - } - }) let host: StructuredAgentSessionHost | null = null const lifecycle = createStructuredAgentSessionLifecycleDelivery({ handle: (event) => host?.handleAdapterEvent(event), diff --git a/src/main/runtime/structured-agent-session-spawn-token-descendants.test.ts b/src/main/runtime/structured-agent-session-spawn-token-descendants.test.ts new file mode 100644 index 000000000000..d0650d94f495 --- /dev/null +++ b/src/main/runtime/structured-agent-session-spawn-token-descendants.test.ts @@ -0,0 +1,191 @@ +// The spawn token is an environment variable, so every descendant of a provider child inherits it: +// an editor the agent opened with `code .`, a tmux server, a detached dev server. Carrying the token +// proves descent, not being the provider child, so the host never signals a process on the token +// alone. The token scan still answers one question soundly: whether a reservation ever spawned. + +import type * as NodeFsPromises from 'node:fs/promises' +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { CODEX_SPAWN_TOKEN_ENV } from '../codex/codex-structured-owner-identity' +import { AgentSessionRecordStore } from './agent-session-record-store' +import type { AgentSessionReserveRequest } from './agent-session-reservation-admission' +import { createStructuredAgentSessionOwnerProbe } from './structured-agent-session-owner-probe' +import { + ensureStructuredAgentSessionHost, + stopStructuredAgentSessionRuntime +} from './structured-agent-session-runtime' + +/** pid -> the NUL-separated environment block `/proc//environ` serves. */ +const fakeProc = vi.hoisted(() => ({ environs: new Map() })) + +vi.mock('node:fs/promises', async (importOriginal) => { + const fsp = await importOriginal() + const enoent = (path: string) => Object.assign(new Error(`ENOENT: ${path}`), { code: 'ENOENT' }) + return { + ...fsp, + readdir: async (...args: Parameters) => + args[0] === '/proc' ? [...fakeProc.environs.keys()].map(String) : fsp.readdir(...args), + readFile: async (...args: Parameters) => { + const path = String(args[0]) + if (!path.startsWith('/proc/')) { + return fsp.readFile(...args) + } + const environ = fakeProc.environs.get(Number(path.split('/')[2])) + if (environ === undefined || !path.endsWith('/environ')) { + throw enoent(path) + } + return environ + } + } +}) + +const HOST_ID = 'local' +const NOW = 1_800_000_000_000 +const SESSION = 'session-alpha' +const MINTED_TOKEN = 'spawn-minted-by-this-store' + +function environ(token: string | null): string { + return ['PATH=/usr/bin', ...(token ? [`${CODEX_SPAWN_TOKEN_ENV}=${token}`] : [])].join('\0') +} + +function reserveRequest(): AgentSessionReserveRequest { + const operationId = `${NOW}-${'1'.padStart(32, '0')}` + return { + sessionId: SESSION, + location: { + executionHostId: HOST_ID, + wslDistro: null, + workspaceId: 'workspace-1', + workspaceKind: 'git-worktree' + }, + provider: 'codex', + accountHome: { variable: 'CODEX_HOME', path: '/home/dev/.codex' }, + expectedFence: null, + spawnToken: MINTED_TOKEN, + claimKeyId: 'key-1', + handoffOperationId: null, + probe: { outcome: 'indeterminate', reason: 'no previous owner' }, + operation: { callerKey: 'client-1', operationId, fingerprint: 'fp-1' }, + now: NOW + } +} + +const originalPlatform = process.platform +let stateDirectory: string + +beforeEach(async () => { + stateDirectory = await mkdtemp(join(tmpdir(), 'orca-spawn-token-descendants-')) + Object.defineProperty(process, 'platform', { configurable: true, value: 'linux' }) +}) + +afterEach(async () => { + await stopStructuredAgentSessionRuntime() + Object.defineProperty(process, 'platform', { configurable: true, value: originalPlatform }) + fakeProc.environs.clear() + vi.restoreAllMocks() + await rm(stateDirectory, { recursive: true, force: true }) +}) + +function openStore(): Promise { + return AgentSessionRecordStore.open({ + directory: join(stateDirectory, 'agent-sessions'), + hostId: HOST_ID + }) +} + +describe('a process that inherited a spawn token', () => { + it('is never signalled when the host installs and reconciles, even when this store minted the token', async () => { + // A chat ran and ended: its root exited and the lease was released, clearing the token. + const seed = await openStore() + const reserved = await seed.reserveOwner(reserveRequest()) + const fence = reserved.record.lease.runtimeFence + await seed.commitProcessIdentity({ + sessionId: SESSION, + fence, + process: { hostId: HOST_ID, pid: 4242, processStartTimeMs: NOW, spawnToken: MINTED_TOKEN }, + now: NOW + }) + await seed.proveOwner({ + sessionId: SESSION, + fence, + link: { + linkId: 'link-1', + handle: { provider: 'codex', threadId: 'thread-1' }, + origin: 'created', + mintedAtFence: fence, + observedAt: NOW + }, + now: NOW + }) + const released = await seed.evictProvenDeadOwner({ + sessionId: SESSION, + expectedFence: fence, + probe: { outcome: 'pid-absent' }, + now: NOW + }) + expect(released.lease).toMatchObject({ claimStatus: 'released', reservedSpawnToken: null }) + + // The editor the agent opened detached into its own group and outlived the chat, still + // carrying the token; another descendant carries a token no store here ever minted. + fakeProc.environs.set(1, environ(null)) + fakeProc.environs.set(5151, environ(MINTED_TOKEN)) + fakeProc.environs.set(6161, environ('spawn-foreign')) + const kill = vi.spyOn(process, 'kill').mockImplementation(() => true) + + const host = await ensureStructuredAgentSessionHost({ + stateDirectory, + hostId: HOST_ID, + claimKeyId: 'key-1', + resolveWorkspacePath: async () => stateDirectory, + resolveClaudeAuthPolicy: () => ({ stripAuthEnv: true }), + resolveEnvironment: async () => ({}) + }) + await host.reconcileRestartLeases() + // Install work that is not awaited would have run by now; nothing here waits on a timer. + await new Promise((resolve) => setTimeout(resolve, 50)) + + expect(kill.mock.calls.filter(([, signal]) => signal !== 0)).toEqual([]) + }) +}) + +describe('the reservation owner probe', () => { + async function reconcileReservation(): Promise { + const crashed = await openStore() + await crashed.reserveOwner(reserveRequest()) + // The restart after a crash between reservation and recorded identity. + const store = await openStore() + await store.reconcileOnRestart({ + probe: createStructuredAgentSessionOwnerProbe(HOST_ID), + now: NOW + }) + return store + } + + it('proves a reservation never spawned when the host scan finds no process carrying its token', async () => { + fakeProc.environs.set(1, environ(null)) + fakeProc.environs.set(6161, environ('spawn-foreign')) + + const store = await reconcileReservation() + + expect(store.getRecord(SESSION)?.lease).toMatchObject({ + claimStatus: 'released', + deathEvidence: { kind: 'pid-absent', detail: 'reservation never spawned' } + }) + }) + + it('claims no absence when the host scan finds a process carrying the token', async () => { + fakeProc.environs.set(5151, environ(MINTED_TOKEN)) + const kill = vi.spyOn(process, 'kill').mockImplementation(() => true) + + const store = await reconcileReservation() + + // Released without evidence, and the process carrying the token is left alone. + expect(store.getRecord(SESSION)?.lease).toMatchObject({ + claimStatus: 'released', + deathEvidence: null + }) + expect(kill.mock.calls.filter(([, signal]) => signal !== 0)).toEqual([]) + }) +}) diff --git a/src/main/runtime/structured-agent-session-support-probe.test.ts b/src/main/runtime/structured-agent-session-support-probe.test.ts index 07a2b671f0a7..ea0ab3298d9b 100644 --- a/src/main/runtime/structured-agent-session-support-probe.test.ts +++ b/src/main/runtime/structured-agent-session-support-probe.test.ts @@ -22,19 +22,15 @@ function setPlatform(platform: NodeJS.Platform): void { type InstallEffects = { storeOpened: boolean - reaperStarted: boolean } -/** Stands in for `install()` by performing the two effects it performs, so a probe that +/** Stands in for `install()` by performing the effect it performs, so a probe that * reinstalls the host is caught by what the install *does*, not by a call count alone. */ function stubStructuredHostInstall(runtime: OrcaRuntimeService): { effects: InstallEffects ensure: ReturnType } { - const effects: InstallEffects = { - storeOpened: false, - reaperStarted: false - } + const effects: InstallEffects = { storeOpened: false } // `supportsCreate` answers as the real Codex adapter would, so a probe that reinstalls the host // still returns the right answer and fails on the install effects alone. const host = { @@ -44,7 +40,6 @@ function stubStructuredHostInstall(runtime: OrcaRuntimeService): { } const ensure = vi.fn(async () => { effects.storeOpened = true - effects.reaperStarted = true setStructuredAgentSessionHost(host as never) }) vi.spyOn(runtime, 'ensureStructuredAgentSessionHost').mockImplementation(ensure) @@ -94,10 +89,7 @@ async function expectSupportWithoutInstall(input: { expect(answers).toEqual(Array(input.repetitions ?? 1).fill(input.expected)) expect(ensure).not.toHaveBeenCalled() - expect(effects).toEqual({ - storeOpened: false, - reaperStarted: false - }) + expect(effects).toEqual({ storeOpened: false }) expect(getStructuredAgentSessionHost()).toBeNull() } @@ -193,10 +185,7 @@ describe('structured agent-session create-support probe', () => { await runtime.prepareStructuredAgentSessionStartupRestoration() expect(ensure).toHaveBeenCalledTimes(1) - expect(effects).toEqual({ - storeOpened: true, - reaperStarted: true - }) + expect(effects).toEqual({ storeOpened: true }) expect( (getStructuredAgentSessionHost() as unknown as { reconcileRestartLeases: () => void }) .reconcileRestartLeases diff --git a/src/shared/agent-session-lease-adjudication.test.ts b/src/shared/agent-session-lease-adjudication.test.ts index 602a263e91b7..7256f940aa43 100644 --- a/src/shared/agent-session-lease-adjudication.test.ts +++ b/src/shared/agent-session-lease-adjudication.test.ts @@ -2,7 +2,6 @@ import { describe, expect, it } from 'vitest' import { adjudicateAgentSessionRestart, agentSessionLeaseAdmitsWriter, - classifyObservedAgentSessionSpawnToken, evaluateAgentSessionAcquisition, isProvenAliveProbe, isProvenDeadProbe, @@ -315,7 +314,7 @@ describe('restart reconciliation', () => { ) }) -describe('writer admission and orphan spawn tokens', () => { +describe('writer admission', () => { it('admits a writer only when reconciled, settled, live, and holding a process', () => { expect(agentSessionLeaseAdmitsWriter(lease())).toBe(true) expect(agentSessionLeaseAdmitsWriter(lease({ unreconciled: true }))).toBe(false) @@ -323,18 +322,4 @@ describe('writer admission and orphan spawn tokens', () => { expect(agentSessionLeaseAdmitsWriter(lease({ claimStatus: 'reserved' }))).toBe(false) expect(agentSessionLeaseAdmitsWriter(lease({ ownerProcess: null }))).toBe(false) }) - - it('calls a spawn token with no matching lease an orphan', () => { - const leases = [lease(), lease({ sessionId: 'session-beta-1', reservedSpawnToken: 'spawn-b' })] - expect(classifyObservedAgentSessionSpawnToken({ spawnToken: 'spawn-a', leases })).toBe('owned') - expect(classifyObservedAgentSessionSpawnToken({ spawnToken: 'spawn-b', leases })).toBe('owned') - expect(classifyObservedAgentSessionSpawnToken({ spawnToken: 'spawn-z', leases })).toBe('orphan') - }) - - it('still recognises an owner whose reservation token was cleared after proving', () => { - const proved = lease({ reservedSpawnToken: null }) - expect( - classifyObservedAgentSessionSpawnToken({ spawnToken: 'spawn-a', leases: [proved] }) - ).toBe('owned') - }) }) diff --git a/src/shared/agent-session-lease-adjudication.ts b/src/shared/agent-session-lease-adjudication.ts index bbe409a37fce..b0b806ddad72 100644 --- a/src/shared/agent-session-lease-adjudication.ts +++ b/src/shared/agent-session-lease-adjudication.ts @@ -233,8 +233,8 @@ export function adjudicateAgentSessionRestart(args: { // Why: a child spawned before its identity was recorded lost its stdio with the runtime that // crashed, so nothing can drive it. A token scan that proves no child is the only evidence there // can be; without it the lease is released anyway. A live child still carrying the token is - // not signalled here, and the orphan reaper, which runs once at store open, may have seen this - // lease still claiming it. + // never signalled: the token is inherited by every descendant, so it cannot prove which one is + // the provider child. return { disposition: 'evicted', nextFence: nextAgentSessionFence(lease), @@ -265,19 +265,3 @@ export function adjudicateAgentSessionRestart(args: { probe.outcome === 'indeterminate' ? probe.reason : 'process identity could not be verified' } } - -/** - * A process carrying an Orca spawn token with no matching lease is an orphan: stop it, never - * adopt it. Neither age nor CPU is evidence — only a token match justifies acting on a process. - */ -export function classifyObservedAgentSessionSpawnToken(args: { - spawnToken: string - leases: readonly AgentSessionLease[] -}): 'owned' | 'orphan' { - const owned = args.leases.some( - (lease) => - lease.reservedSpawnToken === args.spawnToken || - lease.ownerProcess?.spawnToken === args.spawnToken - ) - return owned ? 'owned' : 'orphan' -} From e8e144bf3ca6bdc1bdb1a2d92af4872d0ea31b9e Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:28:01 -0700 Subject: [PATCH 35/90] fix(native-chat): a subagent's words are presented as that subagent's, never the parent's (#23605) * fix(native-chat): a subagent's words are presented as that subagent's, never the parent's The journal already names the agent that produced every row, but the transcript projection dropped it, so a subagent's prose rendered as the parent's reply, its tool calls folded into the parent's runs, and a settled turn could fold down to a subagent's words as its only visible answer. The transcript message now keeps the row's producer. The fold keeps each agent's calls in that agent's own run, a turn's answer is the session's own agent's last prose, and a subagent's row names the subagent on desktop, mobile and a worker's transcript text. * test(native-chat): give the window fixture's slot the attribution field it now carries * fix(mobile): read the subagent label the row is given, and pin the caption * fix(native-chat): keep interleaved agents in order and each agent's own run live Review follow-ups: - the fold is main's adjacency fold plus one condition: a row never folds into another agent's run, so an agent's later call stays below its subagent's work instead of jumping back into its earlier row - each agent has its own live frontier, so a parent still inside its spawn call reads as running while its subagent works below it - mobile names no one on a row whose only content is hidden behind its settled turn - a pending question from a subagent keeps its producer - worker reads serve only the producing agent's id, bounded like the roster key that names it, and drop the provenance fields - the single-message worker formatter is private, so no caller can drop names --- .../session/MobileNativeChatMessage.test.ts | 71 +++++++++++++++++++ .../src/session/MobileNativeChatMessage.tsx | 36 +++++++++- mobile/src/session/MobileNativeChatView.tsx | 8 ++- .../mobile-native-chat-message-styles.ts | 11 +++ .../handlers/orchestration/worker-output.ts | 4 +- .../worker-transcript-payload.test.ts | 45 ++++++++++++ .../worker-transcript-payload.ts | 16 ++++- .../structured-worker-terminal-read.ts | 6 +- .../native-chat/NativeChatMessageList.tsx | 6 +- .../native-chat/NativeChatMessageRow.test.tsx | 38 ++++++++++ .../native-chat/NativeChatMessageRow.tsx | 38 +++++++++- .../native-chat/NativeChatTranscriptRow.tsx | 1 + .../native-chat-row-height-estimate.ts | 6 ++ .../native-chat/native-chat-tool-fold.test.ts | 54 ++++++++++++++ .../native-chat-transcript-slots.test.ts | 69 ++++++++++++++++++ .../native-chat-transcript-slots.ts | 39 ++++++++-- ...ructured-agent-question-projection.test.ts | 16 +++++ .../structured-agent-question-projection.ts | 2 + ...ve-chat-transcript-window.options.test.tsx | 1 + .../src/i18n/en-runtime-required.json | 4 ++ src/renderer/src/i18n/locales/en.json | 4 +- src/renderer/src/i18n/locales/es.json | 4 ++ src/renderer/src/i18n/locales/fr.json | 4 +- src/renderer/src/i18n/locales/ja.json | 4 +- src/renderer/src/i18n/locales/ko.json | 4 +- src/renderer/src/i18n/locales/zh.json | 4 +- src/shared/agent-session-journal-producer.ts | 10 ++- .../native-chat-subagent-attribution.ts | 42 +++++++++++ src/shared/native-chat-tool-fold.ts | 20 ++++-- src/shared/native-chat-turn-fold.test.ts | 30 ++++++++ src/shared/native-chat-turn-fold.ts | 16 ++++- src/shared/native-chat-types.ts | 7 +- ...tructured-agent-session-projection.test.ts | 12 ++++ .../structured-agent-session-projection.ts | 7 +- ...er-transcript-background-task-text.test.ts | 5 +- ...er-transcript-subagent-attribution.test.ts | 49 +++++++++++++ .../worker-transcript-text-scaling.test.ts | 5 +- src/shared/worker-transcript-text.ts | 32 ++++++++- 38 files changed, 688 insertions(+), 42 deletions(-) create mode 100644 src/shared/native-chat-subagent-attribution.ts create mode 100644 src/shared/worker-transcript-subagent-attribution.test.ts diff --git a/mobile/src/session/MobileNativeChatMessage.test.ts b/mobile/src/session/MobileNativeChatMessage.test.ts index 67e901328667..935fe2ef0f31 100644 --- a/mobile/src/session/MobileNativeChatMessage.test.ts +++ b/mobile/src/session/MobileNativeChatMessage.test.ts @@ -285,3 +285,74 @@ describe('MobileNativeChatMessage', () => { }) }) }) + +describe("MobileNativeChatMessage — a subagent's row speaks as that subagent", () => { + let renderer: ReactTestRenderer | null = null + + afterEach(() => { + act(() => renderer?.unmount()) + renderer = null + }) + + function renderAgentRow(agentId: string | undefined, subagentLabel?: string): ReactTestRenderer { + const message: NativeChatMessage = { + id: 'a1', + role: 'assistant', + blocks: [{ type: 'text', text: 'The PR is CLEAN.' }], + timestamp: null, + source: 'transcript', + ...(agentId === undefined ? {} : { agentId }) + } + act(() => { + renderer = create(createElement(MobileNativeChatMessage, { message, subagentLabel })) + }) + return renderer! + } + + const captions = (tree: ReactTestRenderer): ReactTestInstance[] => + tree.root + .findAllByType('Text' as never) + .filter((node) => typeof node.props.accessibilityLabel === 'string') + + it('names the subagent that wrote the row', () => { + const [caption] = captions(renderAgentRow('task-1', 'review the PR')) + expect(caption?.props.accessibilityLabel).toBe('Written by subagent review the PR') + expect(caption?.children.join('')).toBe('review the PR') + }) + + it('still marks the row as a subagent when no loaded roster names it', () => { + const [caption] = captions(renderAgentRow('task-9')) + expect(caption?.children.join('')).toBe('Subagent') + }) + + it("adds nothing to the session's own row", () => { + expect(captions(renderAgentRow(undefined, 'review the PR'))).toEqual([]) + }) + + it('names no one on a settled row whose only content is hidden, and names the live one', () => { + const toolOnly: NativeChatMessage = { + id: 'a2', + role: 'assistant', + blocks: [{ type: 'tool-call', name: 'Grep', input: {}, state: 'completed' }], + timestamp: null, + source: 'transcript', + agentId: 'task-1' + } + const renderToolOnly = (activeTurnIsWorking: boolean): ReactTestRenderer => { + act(() => { + renderer = create( + createElement(MobileNativeChatMessage, { + message: toolOnly, + subagentLabel: 'review the PR', + structuredActivityUi: true, + activeTurnIsWorking + }) + ) + }) + return renderer! + } + expect(captions(renderToolOnly(false))).toEqual([]) + act(() => renderer?.unmount()) + expect(captions(renderToolOnly(true))).toHaveLength(1) + }) +}) diff --git a/mobile/src/session/MobileNativeChatMessage.tsx b/mobile/src/session/MobileNativeChatMessage.tsx index a290a9991610..08feb9bc7ceb 100644 --- a/mobile/src/session/MobileNativeChatMessage.tsx +++ b/mobile/src/session/MobileNativeChatMessage.tsx @@ -4,6 +4,8 @@ import { Image, Text as NativeText, View } from 'react-native' import { splitNativeChatBlocks } from '../../../src/shared/native-chat-tool-fold' import { selectActiveToolCall } from '../../../src/shared/native-chat-tool-activity' import { isImageRefBlock, isTextBlock } from '../../../src/shared/native-chat-types' +import { agentJournalItemSubagentId } from '../../../src/shared/agent-session-journal-producer' +import { NATIVE_CHAT_SUBAGENT_ATTRIBUTION_COPY } from '../../../src/shared/native-chat-subagent-attribution' import type { NativeChatBlock, NativeChatMessage } from '../../../src/shared/native-chat-types' import { MobileMarkdown } from '../components/MobileMarkdown' import { MobileNativeChatTurnStatus } from './MobileNativeChatTurnStatus' @@ -75,7 +77,8 @@ function MobileNativeChatMessageImpl({ turnKey, onToggleTurn, activeTurnIsWorking, - structuredActivityUi = false + structuredActivityUi = false, + subagentLabel }: { message: NativeChatMessage toolsExpanded?: boolean @@ -94,6 +97,8 @@ function MobileNativeChatMessageImpl({ activeTurnIsWorking?: boolean /** Structured lane only: live tool progress plus the turn-status disclosure. */ structuredActivityUi?: boolean + /** The roster's name for the subagent that wrote this row, when one names it. */ + subagentLabel?: string }): React.JSX.Element { const isUser = message.role === 'user' const isReasoning = message.role === 'reasoning' @@ -115,13 +120,40 @@ function MobileNativeChatMessageImpl({ !turnExpanded && !toolsExpanded const showToolRun = tools.length > 0 && !settledToolsHidden + // A subagent's row sits where it happened but speaks as that subagent. A row + // whose only content is hidden behind its settled turn names no one. + const subagentName = + isUser || agentJournalItemSubagentId(message) === null || (prose.length === 0 && !showToolRun) + ? null + : (subagentLabel ?? NATIVE_CHAT_SUBAGENT_ATTRIBUTION_COPY.unnamed) return ( <> + {subagentName !== null ? ( + + {subagentName} + + ) : null} {prose.map((block, index) => ( nativeChatSubagentLabels(messages), [messages]) const { listRef, showJumpToTail, @@ -281,10 +286,11 @@ export function MobileNativeChatView({ onOpenFile={onOpenFile} structuredActivityUi={structuredActivityUi} onToggleTurn={turns.onToggleTurn} + subagentLabel={nativeChatSubagentLabel(subagentLabels, item)} {...turns.resolveRow(index, item)} /> ), - [toolsExpanded, fontScale, onOpenFile, structuredActivityUi, turns] + [toolsExpanded, fontScale, onOpenFile, structuredActivityUi, subagentLabels, turns] ) const emptyState = mobileNativeChatEmptyState(status, agent ?? null, error) diff --git a/mobile/src/session/mobile-native-chat-message-styles.ts b/mobile/src/session/mobile-native-chat-message-styles.ts index 51ff9ab1f36c..88e97018521e 100644 --- a/mobile/src/session/mobile-native-chat-message-styles.ts +++ b/mobile/src/session/mobile-native-chat-message-styles.ts @@ -32,6 +32,17 @@ export const styles = StyleSheet.create({ reasoning: { opacity: 0.7 }, + // A subagent's row is an aside to the conversation, set off the way desktop sets it off. + subagent: { + borderLeftWidth: 2, + borderLeftColor: colors.borderSubtle, + paddingLeft: spacing.md + }, + subagentCaption: { + color: colors.textMuted, + fontFamily: typography.monoFamily, + fontSize: MONO_SIZE + }, toolRun: { marginTop: spacing.xs }, diff --git a/src/cli/handlers/orchestration/worker-output.ts b/src/cli/handlers/orchestration/worker-output.ts index 9d6d1949911e..d9b5b9a46fac 100644 --- a/src/cli/handlers/orchestration/worker-output.ts +++ b/src/cli/handlers/orchestration/worker-output.ts @@ -1,6 +1,6 @@ import type { RuntimeTerminalRead } from '../../../shared/runtime-types' import type { OrchestrationWorkerReadResult } from '../../../shared/orchestration-worker-output' -import { formatWorkerTranscriptMessage } from '../../../shared/worker-transcript-text' +import { formatWorkerTranscriptMessages } from '../../../shared/worker-transcript-text' export type LegacyWorkerReadResult = { dispatchId: string @@ -57,7 +57,7 @@ export function formatWorkerRead( const output = value.source === 'terminal' ? value.terminal.tail.join('\n') - : value.transcript.messages.map(formatWorkerTranscriptMessage).join('\n\n') + : formatWorkerTranscriptMessages(value.transcript.messages).join('\n\n') if (output) { return `${details}\n\n${output}` } diff --git a/src/main/runtime/orchestration/worker-transcript-payload.test.ts b/src/main/runtime/orchestration/worker-transcript-payload.test.ts index 802b724a2aa6..d0b4ce231272 100644 --- a/src/main/runtime/orchestration/worker-transcript-payload.test.ts +++ b/src/main/runtime/orchestration/worker-transcript-payload.test.ts @@ -299,3 +299,48 @@ describe('worker transcript wire bounds', () => { ) }) }) + +describe("worker transcript wire bounds — a subagent's line names its agent and nothing more", () => { + it('serves the producing agent id, bounded like the roster key, and drops provenance', () => { + const longId = `task-${'x'.repeat(2_000)}` + const result = boundWorkerTranscriptMessages([ + { + id: 'child-line', + role: 'assistant', + timestamp: null, + source: 'transcript', + blocks: [{ type: 'text', text: 'The PR is CLEAN.' }], + agentId: longId, + parentAgentId: 'task-parent', + providerParentRef: 'toolu_provider_call', + producerKind: 'agent', + attempt: 2 + }, + { + id: 'roster', + role: 'system', + timestamp: null, + source: 'transcript', + blocks: [ + { + type: 'subagent-group', + groupId: 'group-1', + agents: [{ id: longId, label: 'review the PR', state: 'working' }] + } + ] + } + ]) + const [child, roster] = result.messages + expect(child).not.toHaveProperty('providerParentRef') + expect(child).not.toHaveProperty('parentAgentId') + expect(child).not.toHaveProperty('producerKind') + expect(child).not.toHaveProperty('attempt') + // The line's agent id and the roster entry that names it bound to the same key, + // so the reader can still put a name to the line. + const rosterBlock = roster?.blocks[0] + expect(rosterBlock?.type).toBe('subagent-group') + const entryId = rosterBlock?.type === 'subagent-group' ? rosterBlock.agents[0]?.id : undefined + expect(child?.agentId).toBeDefined() + expect(child?.agentId).toBe(entryId) + }) +}) diff --git a/src/main/runtime/orchestration/worker-transcript-payload.ts b/src/main/runtime/orchestration/worker-transcript-payload.ts index 684dfc771e2b..b62687bd8138 100644 --- a/src/main/runtime/orchestration/worker-transcript-payload.ts +++ b/src/main/runtime/orchestration/worker-transcript-payload.ts @@ -1,5 +1,6 @@ import { createHash } from 'node:crypto' import type { NativeChatBlock, NativeChatMessage } from '../../../shared/native-chat-types' +import { agentJournalItemSubagentId } from '../../../shared/agent-session-journal-producer' import { boundSubagentEntryId } from '../../native-chat/subagent-entry-id-bounds' import { boundWorkerTranscriptActivityBlock } from './worker-transcript-activity-block-bounds' @@ -109,11 +110,24 @@ function boundMessage( markClipped(state, 'Some transcript blocks were omitted from oversized messages.') } // The journal position only orders a live list; a worker read is already in order. - const { journalPosition: _journalPosition, ...served } = message + // Of the producer linkage only the agent's id is served, so a reader can say whose + // line it is; the rest is provenance. + const { + journalPosition: _journalPosition, + agentId: _agentId, + parentAgentId: _parentAgentId, + providerParentRef: _providerParentRef, + producerKind: _producerKind, + attempt: _attempt, + ...served + } = message + const subagentId = agentJournalItemSubagentId(message) return { ...served, id: boundIdentifier(message.id, transcriptPath, state), ...(message.turnId ? { turnId: boundIdentifier(message.turnId, transcriptPath, state) } : {}), + // Same key as the roster entry that names it, so it is bounded the same way. + ...(subagentId === null ? {} : { agentId: boundEntryId(subagentId, state) }), blocks: blocks.map((block) => boundBlock(block, state)) } } diff --git a/src/main/runtime/structured-worker-terminal-read.ts b/src/main/runtime/structured-worker-terminal-read.ts index 3d31c4c863c7..60dd11260670 100644 --- a/src/main/runtime/structured-worker-terminal-read.ts +++ b/src/main/runtime/structured-worker-terminal-read.ts @@ -29,7 +29,7 @@ */ import type { RuntimeTerminalRead } from '../../shared/runtime-types' -import { formatWorkerTranscriptMessage } from '../../shared/worker-transcript-text' +import { formatWorkerTranscriptMessages } from '../../shared/worker-transcript-text' import { AGENT_SESSION_NOT_ATTACHED } from '../native-chat/agent-session-wire/structured-agent-session-mutation-admission' import type { OrchestrationDb } from './orchestration/db' import { boundStructuredJournalTail } from './orchestration/structured-worker-journal-archive' @@ -84,9 +84,7 @@ export async function readStructuredWorkerTerminal(args: { } // Redacts dispatch capabilities and clips oversized blocks under the archive path's byte bound. const bounded = boundStructuredJournalTail(page.items) - const lines = bounded.messages.flatMap((message) => - formatWorkerTranscriptMessage(message).split('\n') - ) + const lines = formatWorkerTranscriptMessages(bounded.messages).flatMap((text) => text.split('\n')) const read = readTerminalTail({ handle: args.handle, status: structuredWorkerTerminalState(observeStructuredWorker(identity).status), diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx index 3562065c1514..d81bfffb52f1 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx @@ -42,6 +42,7 @@ import { nativeChatReaderScrollInputHandlers } from './native-chat-reader-scroll import type { AgentJournalRenderItem } from '../../../../shared/agent-session-journal-types' import { isStructuredAgentSessionThinking } from '../../../../shared/structured-agent-session-live-turn' +import { nativeChatSubagentLabels } from '../../../../shared/native-chat-subagent-attribution' import type { NativeChatSettledTurns } from '../../../../shared/native-chat-turn-status' import { nativeChatTurnDiffs, @@ -147,6 +148,7 @@ export function NativeChatMessageList({ // Structured sessions show goal state in the banner above the composer. return journalItems ? omitNativeChatThreadGoalRows(projected) : projected }, [journalItems, projectMessages, session.messages]) + const subagentLabels = useMemo(() => nativeChatSubagentLabels(messages), [messages]) const taskListPredecessors = useMemo(() => nativeChatTaskListPredecessors(messages), [messages]) const taskListState = useMemo(() => nativeChatTaskListState(messages), [messages]) const showTypingIndicator = showTurnStatus @@ -201,7 +203,8 @@ export function NativeChatMessageList({ showTurnStatus, expandedTurnKeys: expandedTurnIds, isWorking, - lifecycleWorking + lifecycleWorking, + subagentLabels }), [ currentTurnKey, @@ -212,6 +215,7 @@ export function NativeChatMessageList({ messages, receipts, showTurnStatus, + subagentLabels, turnDiffs, turnKeys, turnStatuses diff --git a/src/renderer/src/components/native-chat/NativeChatMessageRow.test.tsx b/src/renderer/src/components/native-chat/NativeChatMessageRow.test.tsx index f11e41a6e2d4..996716a838fa 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageRow.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageRow.test.tsx @@ -204,3 +204,41 @@ describe('a user message that did not go through', () => { expect(screen.queryByRole('button', { name: 'Retry' })).toBeNull() }) }) + +describe("MessageRow — a subagent's row speaks as that subagent", () => { + function renderAgentRow(agentId: string | undefined, subagentLabel?: string) { + return render( + + ) + } + + it('names the subagent that wrote the row', () => { + renderAgentRow('task-1', 'explore the lane') + expect( + screen.getByRole('note', { name: 'Written by subagent explore the lane' }) + ).toBeInTheDocument() + expect(screen.getByText('The PR is CLEAN.')).toBeInTheDocument() + }) + + it('still marks the row as a subagent when no loaded roster names it', () => { + renderAgentRow('task-9') + expect(screen.getByRole('note', { name: 'Subagent' })).toBeInTheDocument() + }) + + it("adds nothing to the session's own row", () => { + renderAgentRow(undefined, 'explore the lane') + expect(screen.queryByRole('note')).toBeNull() + }) +}) diff --git a/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx b/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx index c7ed087e9181..c6505f86bf6f 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx @@ -1,5 +1,5 @@ import { memo, useCallback, useRef } from 'react' -import { Goal, RotateCcw } from 'lucide-react' +import { Bot, Goal, RotateCcw } from 'lucide-react' import { Button } from '@/components/ui/button' import CommentMarkdown, { type CommentMarkdownLinkClickHandler @@ -11,6 +11,8 @@ import type { NativeChatToolCallBlock } from '../../../../shared/native-chat-types' import { deriveNativeChatRowContent } from '../../../../shared/native-chat-row-content' +import { agentJournalItemSubagentId } from '../../../../shared/agent-session-journal-producer' +import { NATIVE_CHAT_SUBAGENT_ATTRIBUTION_COPY } from '../../../../shared/native-chat-subagent-attribution' import { NativeChatToolRun } from './NativeChatToolRun' import { NativeChatCodeBlock } from './NativeChatCodeBlock' import { NativeChatNoticeRow } from './NativeChatNoticeRow' @@ -47,6 +49,7 @@ export const MessageRow = memo(function MessageRow({ deliveryNotice, structuredActivityUi = true, folded = false, + subagentLabel, runtimeContext }: { message: NativeChatMessage @@ -65,6 +68,8 @@ export const MessageRow = memo(function MessageRow({ structuredActivityUi?: boolean /** Behind a folded turn: the row keeps only what outlives the turn. */ folded?: boolean + /** The roster's name for the subagent that wrote this row, when one names it. */ + subagentLabel?: string runtimeContext?: RuntimeFileOperationArgs | null }): React.JSX.Element | null { const rowRef = useRef(null) @@ -193,6 +198,24 @@ export const MessageRow = memo(function MessageRow({ // Plain assistant prose is the copyable unit; reasoning/system asides stay // chrome-free. Controls reveal on hover/keyboard focus and stay visible on touch. const showControls = !isReasoning && !isSystem && markdown.length > 0 + // A subagent's row sits where it happened but speaks as that subagent, never as + // the agent the reader is talking to. + const subagentName = + agentJournalItemSubagentId(message) === null + ? null + : (subagentLabel ?? + translate( + 'components.native-chat.subagents.unnamed', + NATIVE_CHAT_SUBAGENT_ATTRIBUTION_COPY.unnamed + )) + const subagentCaption = + subagentLabel === undefined + ? subagentName + : translate( + 'components.native-chat.subagents.writtenBy', + NATIVE_CHAT_SUBAGENT_ATTRIBUTION_COPY.writtenBy, + { value0: subagentLabel } + ) return (
+ {subagentName !== null ? ( +
+ + + {subagentName} + +
+ ) : null} )} diff --git a/src/renderer/src/components/native-chat/native-chat-row-height-estimate.ts b/src/renderer/src/components/native-chat/native-chat-row-height-estimate.ts index 60075385292b..368eea2699b7 100644 --- a/src/renderer/src/components/native-chat/native-chat-row-height-estimate.ts +++ b/src/renderer/src/components/native-chat/native-chat-row-height-estimate.ts @@ -29,6 +29,8 @@ export type NativeChatRowChromeMetrics = { /** Behind a folded turn: prose and tool activity draw nothing, so estimating * them would reserve a screen of height for a row that paints a roster. */ folded?: boolean + /** A subagent wrote the row, so it draws a caption naming that subagent. */ + attributed?: boolean } const LINE_HEIGHT_PX = 22 @@ -38,6 +40,7 @@ const USER_BUBBLE_CHROME_PX = 32 const IMAGE_STRIP_PX = 88 const TOOL_RUN_PX = 40 const SUBAGENT_ROW_PX = 32 +const SUBAGENT_CAPTION_PX = 24 const STATUS_ROW_PX = 28 const TURN_DIFF_PX = 28 const RECEIPT_PX = 56 @@ -117,6 +120,9 @@ export function estimateNativeChatRowHeight( height += TOOL_RUN_PX } height += content.subagentGroupCount * SUBAGENT_ROW_PX + if (chrome.attributed === true && height > 0) { + height += SUBAGENT_CAPTION_PX + } partCount = height > 0 ? 1 : 0 } if (chrome.hasStatus) { diff --git a/src/renderer/src/components/native-chat/native-chat-tool-fold.test.ts b/src/renderer/src/components/native-chat/native-chat-tool-fold.test.ts index 2e15d24eb2a2..3c83b6a2796d 100644 --- a/src/renderer/src/components/native-chat/native-chat-tool-fold.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-tool-fold.test.ts @@ -252,3 +252,57 @@ describe('spawn-group roster rows', () => { expect(prose.map((block) => block.type)).toEqual(['text', 'subagent-group']) }) }) + +describe('foldToolMessages — each agent folds into its own run', () => { + const child = ( + overrides: Partial & Pick + ): NativeChatMessage => msg({ agentId: 'task-1', ...overrides }) + const text = (value: string) => ({ type: 'text' as const, text: value }) + const call = (name: string) => ({ type: 'tool-call' as const, name, input: {} }) + + it("does not fold a subagent's tool calls into its parent's message", () => { + const folded = foldToolMessages([ + msg({ id: 'parent', blocks: [text('delegating')] }), + child({ id: 'child-grep', blocks: [call('Grep')] }) + ]) + expect(folded.map((message) => message.id)).toEqual(['parent', 'child-grep']) + expect(folded[0]?.blocks).toEqual([text('delegating')]) + }) + + it("keeps interleaved agents in order, each call in its own agent's run", () => { + const folded = foldToolMessages([ + msg({ id: 'parent', blocks: [text('delegating')] }), + child({ id: 'child', blocks: [text('looking')] }), + child({ id: 'child-grep', blocks: [call('Grep')] }), + msg({ id: 'parent-read', blocks: [call('Read')] }) + ]) + // The parent's later call stays where it happened, below the child's work, + // rather than jumping back up into the parent's earlier row. + expect(folded.map((message) => message.id)).toEqual(['parent', 'child', 'parent-read']) + expect(folded[0]?.blocks).toEqual([text('delegating')]) + expect(folded[1]?.blocks).toEqual([text('looking'), call('Grep')]) + expect(folded[1]?.agentId).toBe('task-1') + expect(folded[2]?.agentId).toBeUndefined() + }) + + it("ends every agent's run at a turn boundary", () => { + const folded = foldToolMessages([ + child({ id: 'child', blocks: [text('looking')] }), + msg({ id: 'ask', role: 'user', blocks: [text('next')] }), + child({ id: 'child-grep', blocks: [call('Grep')] }) + ]) + // The child's later call stays in the turn it happened in. + expect(folded.map((message) => message.id)).toEqual(['child', 'ask', 'child-grep']) + }) + + it('folds a transcript that names no producer exactly as a single run', () => { + const folded = foldToolMessages([ + msg({ id: 'a', blocks: [text('one')] }), + msg({ id: 'a-call', blocks: [call('Bash')] }), + msg({ id: 'notice', role: 'system', blocks: [text('Something happened')] }), + msg({ id: 'b-call', blocks: [call('Read')] }) + ]) + expect(folded.map((message) => message.id)).toEqual(['a', 'notice', 'b-call']) + expect(folded[0]?.blocks).toEqual([text('one'), call('Bash')]) + }) +}) diff --git a/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts b/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts index f22d25bfa8f5..6bc5a2d9b1d9 100644 --- a/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts @@ -206,3 +206,72 @@ describe('a send the host rejected', () => { ]) }) }) + +describe("a subagent's rows speak as that subagent", () => { + const settled: NativeChatTurnStatus = { startedAt: 1, thinking: false, workedSeconds: 5 } + const roster: NativeChatMessage = { + id: 'roster', + role: 'system', + blocks: [ + { + type: 'subagent-group', + groupId: 'group-1', + agents: [{ id: 'task-1', label: 'explore the lane', state: 'working' }] + } + ], + timestamp: 1, + source: 'transcript' + } + const child = (id: string, body: string, agentId = 'task-1'): NativeChatMessage => ({ + ...text(id, body), + agentId + }) + const messages = [ + text('ask', 'summarise the repo', 'user'), + text('answer', 'Delegated; the summary follows.'), + roster, + child('child-said', 'The PR is CLEAN.') + ] + + it("keeps the parent's answer on a settled turn and folds the subagent's later words", () => { + const slots = build(messages, { + turnStatuses: { active: null, completedByTurn: { ask: settled } }, + subagentLabels: new Map([['task-1', 'explore the lane']]) + }) + const drawn = slots.filter((slot) => !slot.folded).map((slot) => slot.message.id) + expect(drawn).toContain('answer') + expect(drawn).not.toContain('child-said') + }) + + it("names the subagent on its row from the roster, and only on a subagent's row", () => { + const slots = build(messages, { + subagentLabels: new Map([['task-1', 'explore the lane']]) + }) + const labelOf = (id: string) => slots.find((slot) => slot.message.id === id)?.subagentLabel + expect(labelOf('child-said')).toBe('explore the lane') + expect(labelOf('answer')).toBeUndefined() + }) + + it("keeps the parent's run live while its subagent works below it", () => { + const trailing = (rows: NativeChatMessage[]) => + build(rows) + .filter((slot) => slot.trailingRun) + .map((slot) => slot.message.id) + const childRun: NativeChatMessage = { ...toolRun('child-run'), agentId: 'task-1' } + // The parent is still inside its spawn call; the child's work does not move it past. + expect(trailing([text('ask', 'go', 'user'), toolRun('spawn'), childRun])).toEqual([ + 'spawn', + 'child-run' + ]) + // The parent answering does move it past its own run, whatever the child does. + expect( + trailing([text('ask', 'go', 'user'), toolRun('spawn'), text('said', 'Done.'), childRun]) + ).toEqual(['said', 'child-run']) + }) + + it('reserves room for the caption on a subagent row', () => { + const [parentSlot] = build([text('mine', 'same words')]) + const [childSlot] = build([child('theirs', 'same words')]) + expect(childSlot!.estimatedHeight).toBeGreaterThan(parentSlot!.estimatedHeight) + }) +}) diff --git a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts index a0fe23b6df34..cf2acedfc686 100644 --- a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts +++ b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts @@ -13,6 +13,8 @@ import { isToolCallBlock, type NativeChatMessage } from '../../../../shared/native-chat-types' +import { agentJournalItemSubagentId } from '../../../../shared/agent-session-journal-producer' +import { nativeChatSubagentLabel } from '../../../../shared/native-chat-subagent-attribution' import type { NativeChatTurnStatus } from '../../../../shared/native-chat-turn-status' import { nativeChatTurnFold, @@ -48,6 +50,9 @@ export type NativeChatTranscriptSlot = { /** Whether this row's turn hides anything, so its status row offers a caret. */ turnFolds: boolean turnDiff: NativeChatTurnDiff | undefined + /** The roster's name for the subagent that wrote this row, when one names it. + * Whether a subagent wrote it at all is the message's own linkage. */ + subagentLabel: string | undefined /** Height to reserve before the row has ever been measured. */ estimatedHeight: number } @@ -69,6 +74,8 @@ export type NativeChatTranscriptSlotsInput = { isWorking: boolean /** Session-level lifecycle, which outlives a transcript that never said "done". */ lifecycleWorking: boolean + /** Each subagent's roster label, by the id its rows carry. */ + subagentLabels?: ReadonlyMap } export function buildNativeChatTranscriptSlots( @@ -85,12 +92,14 @@ export function buildNativeChatTranscriptSlots( showTurnStatus, expandedTurnKeys, isWorking, - lifecycleWorking + lifecycleWorking, + subagentLabels } = input // One pass to decide what each row draws, then the fold over those readings — // so "is this the answer" and "does this row render prose" cannot disagree. const foldRows: NativeChatTurnFoldRow[] = messages.map((message, index) => { const content = deriveNativeChatRowContent(message.blocks) + const agentId = agentJournalItemSubagentId(message) return { turnKey: turnKeys[index], role: message.role, @@ -99,20 +108,32 @@ export function buildNativeChatTranscriptSlots( // and its plain-text twin is then the only record the spawn happened. outlivesTurn: message.blocks.some( (block) => isSubagentGroupBlock(block) || isBackgroundTaskBlock(block) - ) + ), + ...(agentId === null ? {} : { agentId }) } }) // Liveness is the turn's, not any one call's: the run at the frontier stays // live between its calls, and a run the agent has moved past is settled even // while its last call is still reporting. An approval's receipt decides a call // of the run above it, which then runs, so it does not move past that run. - const trailingRunIndex = foldRows.findLastIndex( - (row, index) => + // Each agent has its own frontier: a subagent working below its parent's run + // has not moved the parent past it. + const trailingRunIndexes = new Set() + const agentsWithFrontier = new Set() + for (let index = foldRows.length - 1; index >= 0; index -= 1) { + const row = foldRows[index]! + const agent = agentJournalItemSubagentId(messages[index]) + if ( + !agentsWithFrontier.has(agent) && row.role !== 'user' && row.role !== 'reasoning' && receipts.get(messages[index].id)?.kind !== 'approval' && (row.rendersProse || messages[index].blocks.some(isToolCallBlock)) - ) + ) { + trailingRunIndexes.add(index) + agentsWithFrontier.add(agent) + } + } const settledTurnKeys = new Set( showTurnStatus ? Object.entries(turnStatuses.completedByTurn) @@ -147,23 +168,27 @@ export function buildNativeChatTranscriptSlots( if (!drawsRow && status === undefined && turnDiff === undefined) { continue } + const subagentId = agentJournalItemSubagentId(message) slots.push({ message, turnKey, activeTurnIsWorking: (currentTurnKey ? turnKey === currentTurnKey : turnKey === undefined) && (isWorking || lifecycleWorking), - trailingRun: index === trailingRunIndex, + trailingRun: trailingRunIndexes.has(index), receipt, status: status ?? undefined, folded, turnFolds: turnKey !== undefined && foldableTurnKeys.has(turnKey), turnDiff, + subagentLabel: nativeChatSubagentLabel(subagentLabels, message), estimatedHeight: estimateNativeChatRowHeight(nativeChatRowContentMetrics(message), { hasReceipt: receipt !== undefined, hasStatus: status !== undefined, hasTurnDiff: turnDiff !== undefined, - folded + folded, + // Only an agent's own row draws the caption; a receipt stands in for it. + attributed: subagentId !== null && receipt === undefined && message.role !== 'user' }) }) } diff --git a/src/renderer/src/components/native-chat/structured-agent-question-projection.test.ts b/src/renderer/src/components/native-chat/structured-agent-question-projection.test.ts index ab74c2efef24..09154a2512a9 100644 --- a/src/renderer/src/components/native-chat/structured-agent-question-projection.test.ts +++ b/src/renderer/src/components/native-chat/structured-agent-question-projection.test.ts @@ -215,3 +215,19 @@ describe('structured agent session ask-row projection', () => { ).toHaveLength(1) }) }) + +describe("a subagent's pending question keeps its producer", () => { + it('carries the linkage onto the row that stands in for the question', () => { + const projected = projectQuestion({ + ...item('child-q', { + kind: 'question', + question: 'Which branch?', + options: [{ id: 'q1:main', label: 'main' }], + resolution: { ...PENDING } + }), + agentId: 'task-1', + producerKind: 'agent' + }) + expect(projected).toMatchObject({ role: 'system', agentId: 'task-1' }) + }) +}) diff --git a/src/renderer/src/components/native-chat/structured-agent-question-projection.ts b/src/renderer/src/components/native-chat/structured-agent-question-projection.ts index 9469c443d0a8..da2478761191 100644 --- a/src/renderer/src/components/native-chat/structured-agent-question-projection.ts +++ b/src/renderer/src/components/native-chat/structured-agent-question-projection.ts @@ -5,6 +5,7 @@ import type { import { isAskUserQuestionTool } from '../../../../shared/agent-question-answered-intent' import { parseAskFromToolInput } from '../../../../shared/native-chat-ask' import { agentJournalItemRowOrigin } from '../../../../shared/agent-session-journal-position' +import { agentJournalLinkageFields } from '../../../../shared/agent-session-journal-producer' import type { NativeChatMessage } from '../../../../shared/native-chat-types' import { projectStructuredItemToNativeChat } from '../../../../shared/structured-agent-session-projection' import { readAgentJournalTurn } from '../../../../shared/agent-session-turn-record' @@ -71,6 +72,7 @@ function projectItem(item: AgentJournalRenderItem): Projection { // A system row preserves question identity through tool folding; the receipt renders its body. message = { ...agentJournalItemRowOrigin(item), + ...agentJournalLinkageFields(item), role: 'system', blocks: [{ type: 'text', text: body.question }] } diff --git a/src/renderer/src/components/native-chat/use-native-chat-transcript-window.options.test.tsx b/src/renderer/src/components/native-chat/use-native-chat-transcript-window.options.test.tsx index 823f78af6edc..7d245cc76fd2 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-transcript-window.options.test.tsx +++ b/src/renderer/src/components/native-chat/use-native-chat-transcript-window.options.test.tsx @@ -58,6 +58,7 @@ function slot(id: string): NativeChatTranscriptSlot { folded: false, turnFolds: false, turnDiff: undefined, + subagentLabel: undefined, estimatedHeight: 48 } } diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index 57703fb7d1f4..c72ffcdf8038 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -2697,6 +2697,10 @@ "workedFor": "Worked for {{value0}}", "workingFor": "Working for {{value0}}" }, + "subagents": { + "unnamed": "Subagent", + "writtenBy": "Written by subagent {{value0}}" + }, "tool": { "countN": "{{value0}} tool calls", "countOne": "1 tool call", diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index ffdcd6031c2f..caed5202f089 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -17837,7 +17837,9 @@ "startedN": "Kicked off {{value0}} subagents", "ranOne": "Ran 1 subagent", "ranN": "Ran {{value0}} subagents", - "tokens": "{{value0}} tokens" + "tokens": "{{value0}} tokens", + "unnamed": "Subagent", + "writtenBy": "Written by subagent {{value0}}" }, "conversationCommand": { "pendingWork": "Wait for pending work and messages to finish before using this command.", diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index adbe527574ae..05d262673428 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -15104,6 +15104,10 @@ "label": "Contexto: {{used}} de {{window}} tokens, {{percent}} % usados", "title": "Contexto", "estimated": "Estimado a partir de la última respuesta." + }, + "subagents": { + "unnamed": "Subagente", + "writtenBy": "Escrito por el subagente {{value0}}" } }, "tab": { diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json index 047564c4e617..4f591ca8bf2d 100644 --- a/src/renderer/src/i18n/locales/fr.json +++ b/src/renderer/src/i18n/locales/fr.json @@ -17769,7 +17769,9 @@ "startedN": "Lancement des sous-agents {{value0}}", "ranOne": "A exécuté 1 sous-agent", "ranN": "Ran les sous-agents {{value0}}", - "tokens": "Jetons {{value0}}" + "tokens": "Jetons {{value0}}", + "unnamed": "Sous-agent", + "writtenBy": "Écrit par le sous-agent {{value0}}" }, "conversationCommand": { "pendingWork": "Attendez la fin du travail et des messages en attente avant d'utiliser cette commande.", diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 97ff2a6ffdae..3e4a5cd42ee3 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -17705,7 +17705,9 @@ "startedN": "{{value0}} サブ Agent をキックオフしました", "ranOne": "1 人のサブ Agent を実行しました", "ranN": "{{value0}} サブ Agent を実行しました", - "tokens": "{{value0}} トークン" + "tokens": "{{value0}} トークン", + "unnamed": "サブ Agent", + "writtenBy": "サブ Agent {{value0}} による出力" }, "conversationCommand": { "pendingWork": "このコマンドを使用する前に、保留中の作業とメッセージが完了するまで待ってください。", diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index 511ee010e702..75f96c732ab1 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -17705,7 +17705,9 @@ "startedN": "{{value0}} 하위 에이전트가 시작되었습니다.", "ranOne": "하위 에이전트 1개 실행", "ranN": "{{value0}} 하위 에이전트를 실행했습니다.", - "tokens": "{{value0}} 토큰" + "tokens": "{{value0}} 토큰", + "unnamed": "하위 에이전트", + "writtenBy": "하위 에이전트 {{value0}}의 출력" }, "conversationCommand": { "pendingWork": "이 명령을 사용하기 전에 보류 중인 작업과 메시지가 완료될 때까지 기다리십시오.", diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index e4fa1521899a..5d3eadd54d06 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -17670,7 +17670,9 @@ "startedN": "启动 {{value0}} 子代理", "ranOne": "Ran 1 子代理", "ranN": "Ran {{value0}} 子代理", - "tokens": "{{value0}} 代币" + "tokens": "{{value0}} 代币", + "unnamed": "子代理", + "writtenBy": "由子代理 {{value0}} 输出" }, "conversationCommand": { "pendingWork": "在使用此命令之前,请等待挂起的工作和消息完成。", diff --git a/src/shared/agent-session-journal-producer.ts b/src/shared/agent-session-journal-producer.ts index ff51c6eaf576..2a5410eb2752 100644 --- a/src/shared/agent-session-journal-producer.ts +++ b/src/shared/agent-session-journal-producer.ts @@ -25,7 +25,15 @@ import type { export function isRootAgentJournalItem( item: Pick | undefined ): boolean { - return item?.agentId == null + return agentJournalItemSubagentId(item) === null +} + +/** The subagent that produced a row, or null when the session's own agent did. + * Same reading of absence as {@link isRootAgentJournalItem}. */ +export function agentJournalItemSubagentId( + item: Pick | undefined +): string | null { + return item?.agentId ?? null } /** Whether a write names its producer at all. One that does not revises a row diff --git a/src/shared/native-chat-subagent-attribution.ts b/src/shared/native-chat-subagent-attribution.ts new file mode 100644 index 000000000000..19619ec6c872 --- /dev/null +++ b/src/shared/native-chat-subagent-attribution.ts @@ -0,0 +1,42 @@ +// Whose words a transcript row carries, when they are not the session's own agent's. +// +// A session's subagents write into its journal, and the transcript keeps their rows +// where they happened. Each such row names the subagent that wrote it, using the +// label that subagent's spawn roster already gives it, so a child's words are never +// read as its parent's. Shared so desktop and mobile name the same agent. + +import { agentJournalItemSubagentId } from './agent-session-journal-producer' +import { isSubagentGroupBlock, type NativeChatMessage } from './native-chat-types' + +/** English copy: the desktop's i18n fallbacks, and mobile's text as-is. */ +export const NATIVE_CHAT_SUBAGENT_ATTRIBUTION_COPY = { + unnamed: 'Subagent', + writtenBy: 'Written by subagent {{value0}}' +} as const + +/** Each subagent's roster label, by the id its rows carry. */ +export function nativeChatSubagentLabels( + messages: readonly NativeChatMessage[] +): ReadonlyMap { + const labels = new Map() + for (const message of messages) { + for (const block of message.blocks) { + if (isSubagentGroupBlock(block)) { + for (const agent of block.agents) { + labels.set(agent.id, agent.label) + } + } + } + } + return labels +} + +/** The roster's name for the subagent that wrote a row. Undefined for the + * session's own rows, and for a subagent no loaded roster names. */ +export function nativeChatSubagentLabel( + labels: ReadonlyMap | undefined, + message: NativeChatMessage +): string | undefined { + const agentId = agentJournalItemSubagentId(message) + return agentId === null ? undefined : labels?.get(agentId) +} diff --git a/src/shared/native-chat-tool-fold.ts b/src/shared/native-chat-tool-fold.ts index e08a722c2428..f3c72a45a6b2 100644 --- a/src/shared/native-chat-tool-fold.ts +++ b/src/shared/native-chat-tool-fold.ts @@ -8,6 +8,7 @@ import { type NativeChatToolCallBlock, type NativeChatToolResultBlock } from './native-chat-types' +import { agentJournalItemSubagentId } from './agent-session-journal-producer' import { isKnownHarnessInjectedUserTurnText } from './harness-injected-user-turns' import { isNoiseMessage } from './native-chat-noise' @@ -78,14 +79,23 @@ function dropUnattributableToolResults(message: NativeChatMessage): NativeChatMe return blocks.length > 0 ? { ...message, blocks } : null } -/** Fold consecutive tool-only messages into their preceding assistant turn. */ +/** Fold consecutive tool-only messages into their preceding assistant turn. + * Only into a run the same agent wrote: a subagent's calls interleave with its + * parent's in one journal, and absorbing one into the other would present one + * agent's work as the other's. */ export function foldToolMessages(messages: readonly NativeChatMessage[]): NativeChatMessage[] { const output: NativeChatMessage[] = [] let mutableAssistantIndex = -1 let clonedAssistantIndex = -1 for (const message of messages) { - if (isHarnessSidecarToolMessage(message) && mutableAssistantIndex >= 0) { - const index = mutableAssistantIndex + const foldTarget = + mutableAssistantIndex >= 0 && + agentJournalItemSubagentId(output[mutableAssistantIndex]) === + agentJournalItemSubagentId(message) + ? mutableAssistantIndex + : -1 + if (isHarnessSidecarToolMessage(message) && foldTarget >= 0) { + const index = foldTarget const assistant = output[index] if (assistant?.role === 'assistant') { if (clonedAssistantIndex !== index) { @@ -100,8 +110,8 @@ export function foldToolMessages(messages: readonly NativeChatMessage[]): Native continue } } - if (isToolOnlyMessage(message) && mutableAssistantIndex >= 0) { - const index = mutableAssistantIndex + if (isToolOnlyMessage(message) && foldTarget >= 0) { + const index = foldTarget const assistant = output[index] if (assistant?.role !== 'assistant') { output.push(message) diff --git a/src/shared/native-chat-turn-fold.test.ts b/src/shared/native-chat-turn-fold.test.ts index cd7e4de024de..d6bba89e552c 100644 --- a/src/shared/native-chat-turn-fold.test.ts +++ b/src/shared/native-chat-turn-fold.test.ts @@ -147,3 +147,33 @@ describe('nativeChatTurnFold', () => { expect(foldedRows.size).toBe(0) }) }) + +describe("a subagent's words are never the turn's answer", () => { + // The reported shape: the parent replies, then a subagent it launched keeps + // narrating into the same journal after the parent's last word. + const rows: NativeChatTurnFoldRow[] = [ + row({ role: 'user' }), + row(), + row({ agentId: 'task-1' }), + row({ agentId: 'task-1', rendersProse: false }) + ] + + it("names the session's own last prose, not a subagent's later prose", () => { + expect(nativeChatTurnAnswerRows(rows).get('turn-1')).toBe(1) + }) + + it("folds the subagent's prose behind a settled turn and keeps the parent's answer", () => { + const { foldedRows } = nativeChatTurnFold({ + rows, + settledTurnKeys: SETTLED, + expandedTurnKeys: NONE + }) + expect(foldedRows.has(1)).toBe(false) + expect(foldedRows.has(2)).toBe(true) + }) + + it('reports no answer for a turn in which only subagents spoke', () => { + const onlyChildren = [row({ role: 'user' }), row({ agentId: 'task-1' })] + expect(nativeChatTurnAnswerRows(onlyChildren).has('turn-1')).toBe(false) + }) +}) diff --git a/src/shared/native-chat-turn-fold.ts b/src/shared/native-chat-turn-fold.ts index 5ceb0ef89898..52407a9d5244 100644 --- a/src/shared/native-chat-turn-fold.ts +++ b/src/shared/native-chat-turn-fold.ts @@ -9,6 +9,7 @@ // Shared because desktop and mobile both draw this disclosure, and a fold that // hides a different row on each surface is the same bug twice. +import { isRootAgentJournalItem } from './agent-session-journal-producer' import type { NativeChatRole } from './native-chat-types' /** What the fold needs to know about one transcript row. Deliberately not a @@ -24,6 +25,8 @@ export type NativeChatTurnFoldRow = { * spawn roster or a background task. That row is the durable report of how * the work ended — often the only one — so it never folds. */ outlivesTurn: boolean + /** The subagent that produced the row. Absent ⇒ the session's own agent. */ + agentId?: string } export type NativeChatTurnFold = { @@ -39,14 +42,21 @@ export const NATIVE_CHAT_EMPTY_TURN_FOLD: NativeChatTurnFold = { foldableTurnKeys: new Set() } -/** The index of each turn's answer: its last assistant row that renders prose. - * A turn with no such row has no answer, and folds whole. */ +/** The index of each turn's answer: the last prose the session's own agent + * wrote. A subagent that is still narrating after its parent's last word would + * otherwise stand as the turn's only visible reply. A turn with no such row has + * no answer, and folds whole. */ export function nativeChatTurnAnswerRows( rows: readonly NativeChatTurnFoldRow[] ): ReadonlyMap { const answers = new Map() for (const [index, row] of rows.entries()) { - if (row.turnKey !== undefined && row.role === 'assistant' && row.rendersProse) { + if ( + row.turnKey !== undefined && + row.role === 'assistant' && + row.rendersProse && + isRootAgentJournalItem(row) + ) { answers.set(row.turnKey, index) } } diff --git a/src/shared/native-chat-types.ts b/src/shared/native-chat-types.ts index f33158d9a0f8..392ebb5b8f6a 100644 --- a/src/shared/native-chat-types.ts +++ b/src/shared/native-chat-types.ts @@ -13,7 +13,8 @@ import type { import type { AgentSessionFailureFact } from './agent-session-failure' import type { AgentJournalMessageSendMode, - AgentJournalPosition + AgentJournalPosition, + AgentJournalProducerLinkage } from './agent-session-journal-types' import type { AgentType } from './agent-status-types' import type { NativeChatToolMetadata } from './native-chat-tool-identity' @@ -190,7 +191,9 @@ export type NativeChatBlock = | NativeChatSubagentGroupBlock | NativeChatBackgroundTaskBlock -export type NativeChatMessage = { +/** A transcript row. Structured rows carry the journal row's producer linkage, so + * "who said this" survives the projection; terminal-backed rows carry none. */ +export type NativeChatMessage = AgentJournalProducerLinkage & { /** Stable across re-reads/appends so the assembler and the renderer list can * dedup and key by it. */ id: string diff --git a/src/shared/structured-agent-session-projection.test.ts b/src/shared/structured-agent-session-projection.test.ts index f26f409afd40..691872c3587d 100644 --- a/src/shared/structured-agent-session-projection.test.ts +++ b/src/shared/structured-agent-session-projection.test.ts @@ -665,6 +665,18 @@ describe("producer linkage — a subagent's output never speaks for the parent", expect(prose).toContain('delegating') }) + it("keeps the child's output as the child's: the transcript message names its producer", () => { + // Rendering the child's rows is not enough; unless the message still says who + // wrote it, the transcript can only present it as the parent speaking. + const messages = projectStructuredItemsToNativeChat(items) + const byId = new Map(messages.map((message) => [message.id, message])) + expect(byId.get('child-prose')).toMatchObject({ agentId: 'task-1', producerKind: 'agent' }) + expect(byId.get('child-grep')).toMatchObject({ agentId: 'task-1' }) + // The session's own rows name no producer: absence is the claim that they are its own. + expect(byId.get('root-prose')).not.toHaveProperty('agentId') + expect(byId.get('root-task')).not.toHaveProperty('agentId') + }) + it("falls back to nothing rather than a child's line when the parent said nothing", () => { const summary = projectStructuredAgentSessionStatusSummary([ userAsk, diff --git a/src/shared/structured-agent-session-projection.ts b/src/shared/structured-agent-session-projection.ts index f444af0a060c..f35af81b9325 100644 --- a/src/shared/structured-agent-session-projection.ts +++ b/src/shared/structured-agent-session-projection.ts @@ -10,7 +10,7 @@ import { type AgentJournalSubmission, type AgentJournalTurnOutcome } from './agent-session-journal-types' -import { isRootAgentJournalItem } from './agent-session-journal-producer' +import { agentJournalLinkageFields, isRootAgentJournalItem } from './agent-session-journal-producer' import { structuredAgentSessionStatusBlock } from './structured-agent-session-status-block' import { agentJournalItemRowOrigin } from './agent-session-journal-position' import { @@ -133,8 +133,8 @@ function isAgentJournalMessageSendMode(value: string): value is AgentJournalMess const projectedItems = new WeakMap() /** Deliberately NOT scoped by producer: the transcript shows every agent's - * output. The line this module draws is that the transcript renders every item, - * while every "what is this agent doing right now" scan renders only the + * output, and each message keeps its row's linkage so the transcript can say + * whose it is. Every "what is this agent doing right now" scan renders only the * session's own agent's. */ export function projectStructuredItemsToNativeChat( items: readonly AgentJournalRenderItem[] @@ -162,6 +162,7 @@ export function projectStructuredItemToNativeChat( const message: NativeChatMessage | null = projected ? { ...agentJournalItemRowOrigin(item), + ...agentJournalLinkageFields(item), role: projected.role, blocks: projected.blocks, // A send mode this build cannot name renders as an ordinary message. diff --git a/src/shared/worker-transcript-background-task-text.test.ts b/src/shared/worker-transcript-background-task-text.test.ts index 1e9d727406be..a612dbe0d8c4 100644 --- a/src/shared/worker-transcript-background-task-text.test.ts +++ b/src/shared/worker-transcript-background-task-text.test.ts @@ -1,6 +1,9 @@ import { describe, expect, it } from 'vitest' import type { NativeChatMessage } from './native-chat-types' -import { formatWorkerTranscriptMessage } from './worker-transcript-text' +import { formatWorkerTranscriptMessages } from './worker-transcript-text' + +const formatWorkerTranscriptMessage = (message: NativeChatMessage): string => + formatWorkerTranscriptMessages([message]).join('') function message(blocks: NativeChatMessage['blocks']): NativeChatMessage { return { id: 'm-1', role: 'system', blocks, timestamp: null, source: 'hook' } diff --git a/src/shared/worker-transcript-subagent-attribution.test.ts b/src/shared/worker-transcript-subagent-attribution.test.ts new file mode 100644 index 000000000000..f67a12d6702d --- /dev/null +++ b/src/shared/worker-transcript-subagent-attribution.test.ts @@ -0,0 +1,49 @@ +import { describe, expect, it } from 'vitest' +import type { NativeChatMessage } from './native-chat-types' +import { formatWorkerTranscriptMessages } from './worker-transcript-text' + +function message( + id: string, + text: string, + overrides: Partial = {} +): NativeChatMessage { + return { + id, + role: 'assistant', + blocks: [{ type: 'text', text }], + timestamp: 0, + source: 'transcript', + ...overrides + } +} + +const roster = message('roster', 'Kicked off 1 subagent', { + role: 'system', + blocks: [ + { type: 'text', text: 'Kicked off 1 subagent' }, + { + type: 'subagent-group', + groupId: 'group-1', + agents: [{ id: 'task-1', label: 'review the PR', state: 'working' }] + } + ] +}) + +describe("a worker's transcript never gives a subagent's words to the worker", () => { + it("tags a subagent's line with the subagent the roster names", () => { + const [own, , child] = formatWorkerTranscriptMessages([ + message('own', 'Delegating the review.'), + roster, + message('child', 'The PR is CLEAN.', { agentId: 'task-1' }) + ]) + expect(own).toBe('[assistant] Delegating the review.') + expect(child).toBe('[assistant, subagent review the PR] The PR is CLEAN.') + }) + + it('still tags a subagent that no roster on the page names', () => { + const [child] = formatWorkerTranscriptMessages([ + message('child', 'Still looking.', { agentId: 'task-9' }) + ]) + expect(child).toBe('[assistant, subagent] Still looking.') + }) +}) diff --git a/src/shared/worker-transcript-text-scaling.test.ts b/src/shared/worker-transcript-text-scaling.test.ts index 92283cb24319..d00778e4d1ab 100644 --- a/src/shared/worker-transcript-text-scaling.test.ts +++ b/src/shared/worker-transcript-text-scaling.test.ts @@ -1,7 +1,10 @@ import { expect, it, vi } from 'vitest' -import { formatWorkerTranscriptMessage } from './worker-transcript-text' +import { formatWorkerTranscriptMessages } from './worker-transcript-text' import type { NativeChatMessage } from './native-chat-types' +const formatWorkerTranscriptMessage = (message: NativeChatMessage): string => + formatWorkerTranscriptMessages([message]).join('') + it('does not shift the remaining twin list for each matching roster', () => { const blocks: NativeChatMessage['blocks'] = Array.from({ length: 1000 }, (_, index) => ({ type: 'subagent-group', diff --git a/src/shared/worker-transcript-text.ts b/src/shared/worker-transcript-text.ts index 45a98a878352..fd42193edd8b 100644 --- a/src/shared/worker-transcript-text.ts +++ b/src/shared/worker-transcript-text.ts @@ -12,8 +12,36 @@ import { subagentGroupFallbackText } from './native-chat-subagent-summary' import type { NativeChatMessage } from './native-chat-types' +import { agentJournalItemSubagentId } from './agent-session-journal-producer' +import { + nativeChatSubagentLabel, + nativeChatSubagentLabels +} from './native-chat-subagent-attribution' + +/** Every message in one read, each tagged with who it speaks as. A subagent is + * named by the roster on the same page. */ +export function formatWorkerTranscriptMessages(messages: readonly NativeChatMessage[]): string[] { + const subagentLabels = nativeChatSubagentLabels(messages) + return messages.map((message) => formatWorkerTranscriptMessage(message, subagentLabels)) +} + +/** Who a line speaks as. A subagent's lines are tagged as its own, so a peer reading + * a worker's transcript never takes a subagent's words for the worker's. */ +function workerTranscriptSpeaker( + message: NativeChatMessage, + subagentLabels: ReadonlyMap | undefined +): string { + if (agentJournalItemSubagentId(message) === null) { + return message.role + } + const label = nativeChatSubagentLabel(subagentLabels, message) + return label === undefined ? `${message.role}, subagent` : `${message.role}, subagent ${label}` +} -export function formatWorkerTranscriptMessage(message: NativeChatMessage): string { +function formatWorkerTranscriptMessage( + message: NativeChatMessage, + subagentLabels: ReadonlyMap +): string { // Every roster block is written beside a plain-text twin carrying the same // sentence, for clients that cannot draw the block. Text surfaces are those // clients, so they print the twin and drop the block. The renderer reaches the @@ -49,7 +77,7 @@ export function formatWorkerTranscriptMessage(message: NativeChatMessage): strin // than reading fields off a shape that has none. return '[unsupported block]' }) - return `[${message.role}] ${blocks.filter((line) => line !== null).join('\n')}`.trimEnd() + return `[${workerTranscriptSpeaker(message, subagentLabels)}] ${blocks.filter((line) => line !== null).join('\n')}`.trimEnd() } /** For each roster block, the sentence it must print itself — absent when a twin From e7940121eb0a287a2f2abadf456bf6208d8e9026 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:43:09 -0700 Subject: [PATCH 36/90] fix(tab-group): measure fallback pane geometry once per tab group, only while visible (#23592) * fix(tab-group): measure fallback pane geometry once per tab group, only while visible * refactor(tab-group): derive the shared resize listener's lifetime from the source map The map already drops empty groups, so a separate counter was a second copy that could disagree. --- .../tab-group/RetainedPaneHost.test.tsx | 90 +++++++++ .../components/tab-group/RetainedPaneHost.tsx | 75 +------- .../components/tab-group/TabGroupPanel.tsx | 19 +- .../tab-group/tab-group-body-geometry.test.ts | 141 +++++++++++++++ .../tab-group/tab-group-body-geometry.ts | 171 ++++++++++++++++++ ...TerminalPaneOverlayLayer.react185.test.tsx | 4 + 6 files changed, 432 insertions(+), 68 deletions(-) create mode 100644 src/renderer/src/components/tab-group/tab-group-body-geometry.test.ts create mode 100644 src/renderer/src/components/tab-group/tab-group-body-geometry.ts diff --git a/src/renderer/src/components/tab-group/RetainedPaneHost.test.tsx b/src/renderer/src/components/tab-group/RetainedPaneHost.test.tsx index 964214e0d9f0..ea71e0e8fd51 100644 --- a/src/renderer/src/components/tab-group/RetainedPaneHost.test.tsx +++ b/src/renderer/src/components/tab-group/RetainedPaneHost.test.tsx @@ -2,10 +2,13 @@ import { act, cleanup, fireEvent, render } from '@testing-library/react' import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { RetainedPaneHost } from './RetainedPaneHost' +import { registerTabGroupBody } from './tab-group-body-geometry' const disconnect = vi.fn() +const observerCreated = vi.fn() let notifyResize: () => void let anchors: HTMLDivElement[] +let unregisterAnchors: (() => void)[] beforeEach(() => { vi.stubGlobal('__ORCA_WEB_CLIENT__', true) @@ -14,12 +17,15 @@ beforeEach(() => { class { constructor(callback: () => void) { notifyResize = callback + observerCreated() } observe(): void {} + unobserve(): void {} disconnect = disconnect } ) disconnect.mockClear() + observerCreated.mockClear() anchors = ['left', 'right'].map((id, index) => { const anchor = document.createElement('div') anchor.dataset.tabGroupBodyId = id @@ -27,11 +33,14 @@ beforeEach(() => { document.body.append(anchor) return anchor }) + unregisterAnchors = ['left', 'right'].map((id, index) => registerTabGroupBody(id, anchors[index])) }) afterEach(() => { cleanup() + unregisterAnchors.forEach((unregister) => unregister()) anchors.forEach((anchor) => anchor.remove()) + vi.restoreAllMocks() vi.unstubAllGlobals() }) @@ -105,3 +114,84 @@ it('allows hidden terminal startup measurement without exposing input or startin expect(timeout).not.toHaveBeenCalled() timeout.mockRestore() }) + +function countResizeListeners(spy: ReturnType): number { + return spy.mock.calls.filter(([type]) => type === 'resize').length +} + +it('measures a group once for all of its visible panes', () => { + const addListener = vi.spyOn(window, 'addEventListener') + const view = render( + <> + + + + + + + + + + + ) + expect(observerCreated).toHaveBeenCalledTimes(1) + expect(countResizeListeners(addListener)).toBe(1) + + const measureBody = vi.fn(() => new DOMRect(0, 40, 300, 500)) + anchors[0].getBoundingClientRect = measureBody + act(() => notifyResize()) + expect(measureBody).toHaveBeenCalledTimes(1) + const hosts = Array.from( + view.container.querySelectorAll('[data-retained-pane-host]') + ) + expect(hosts.map((host) => host.style.width)).toEqual(['300px', '300px', '300px']) + + const removeListener = vi.spyOn(window, 'removeEventListener') + view.unmount() + expect(disconnect).toHaveBeenCalledTimes(1) + expect(countResizeListeners(removeListener)).toBe(1) +}) + +it('does not measure a hidden pane until it becomes visible', () => { + const addListener = vi.spyOn(window, 'addEventListener') + const view = render( + + + + ) + const host = view.container.firstElementChild as HTMLDivElement + expect(observerCreated).not.toHaveBeenCalled() + expect(countResizeListeners(addListener)).toBe(0) + expect(host.style.display).toBe('none') + + anchors[0].getBoundingClientRect = () => new DOMRect(0, 48, 320, 400) + view.rerender( + + + + ) + expect(observerCreated).toHaveBeenCalledTimes(1) + expect(host.style.top).toBe('48px') + expect(host.style.width).toBe('320px') + + view.rerender( + + + + ) + expect(disconnect).toHaveBeenCalledTimes(1) +}) + +it('keeps measuring a hidden pane that asks to measure while hidden', () => { + const view = render( + + + + ) + const host = view.container.firstElementChild as HTMLDivElement + expect(observerCreated).toHaveBeenCalledTimes(1) + expect(host.style.width).toBe('400px') + anchors[0].getBoundingClientRect = () => new DOMRect(0, 32, 360, 568) + act(() => notifyResize()) + expect(host.style.width).toBe('360px') +}) diff --git a/src/renderer/src/components/tab-group/RetainedPaneHost.tsx b/src/renderer/src/components/tab-group/RetainedPaneHost.tsx index 6007f2b1c202..c9ec5d3a8260 100644 --- a/src/renderer/src/components/tab-group/RetainedPaneHost.tsx +++ b/src/renderer/src/components/tab-group/RetainedPaneHost.tsx @@ -1,6 +1,7 @@ import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react' import { SYNC_FIT_PANES_EVENT } from '@/constants/terminal' import { tabGroupBodyAnchorName } from './tab-group-body-anchor' +import { subscribeTabGroupBodyRect, type TabGroupBodyRect } from './tab-group-body-geometry' const HAS_CSS_ANCHOR_POSITIONING = typeof CSS !== 'undefined' && @@ -9,7 +10,6 @@ const HAS_CSS_ANCHOR_POSITIONING = CSS.supports('width', 'anchor-size(--orca-terminal-overlay-probe width)') const MIN_OVERLAY_FIT_WIDTH_PX = 48 const MIN_OVERLAY_FIT_HEIGHT_PX = 24 -const FALLBACK_RECT_MIN_CHANGE_PX = 1 function shouldUseCssAnchorPositioning(): boolean { return ( @@ -18,13 +18,6 @@ function shouldUseCssAnchorPositioning(): boolean { ) } -type MeasuredFallbackRect = { - top: number - left: number - width: number - height: number -} - type RetainedPaneHostProps = { groupId: string | undefined isVisible: boolean @@ -47,67 +40,17 @@ export function RetainedPaneHost({ }: RetainedPaneHostProps): React.JSX.Element { const anchorName = groupId !== undefined ? tabGroupBodyAnchorName(groupId) : undefined const overlayRef = useRef(null) - const [measuredFallbackRect, setMeasuredFallbackRect] = useState( - null - ) + const [measuredFallbackRect, setMeasuredFallbackRect] = useState(null) + // Why: a hidden host renders display:none, so it has no use for group geometry until shown. + const measuresFallbackRect = + groupId !== undefined && !shouldUseCssAnchorPositioning() && (isVisible || measureWhileHidden) useLayoutEffect(() => { - if (!anchorName || shouldUseCssAnchorPositioning() || !groupId) { + const container = overlayRef.current?.parentElement + if (!measuresFallbackRect || groupId === undefined || !container) { return } - - const findBody = (): HTMLElement | null => { - for (const candidate of document.querySelectorAll('[data-tab-group-body-id]')) { - if (candidate.dataset.tabGroupBodyId === groupId) { - return candidate - } - } - return null - } - - const updateRect = (): void => { - const overlay = overlayRef.current - const parent = overlay?.parentElement - const body = findBody() - if (!parent || !body) { - setMeasuredFallbackRect(null) - return - } - const parentRect = parent.getBoundingClientRect() - const bodyRect = body.getBoundingClientRect() - const next: MeasuredFallbackRect = { - top: bodyRect.top - parentRect.top, - left: bodyRect.left - parentRect.left, - width: bodyRect.width, - height: bodyRect.height - } - // Why: ResizeObserver and xterm fit can otherwise amplify sub-pixel jitter forever. - setMeasuredFallbackRect((prev) => - prev && - Math.abs(prev.top - next.top) < FALLBACK_RECT_MIN_CHANGE_PX && - Math.abs(prev.left - next.left) < FALLBACK_RECT_MIN_CHANGE_PX && - Math.abs(prev.width - next.width) < FALLBACK_RECT_MIN_CHANGE_PX && - Math.abs(prev.height - next.height) < FALLBACK_RECT_MIN_CHANGE_PX - ? prev - : next - ) - } - - updateRect() - const body = findBody() - const parent = overlayRef.current?.parentElement - const resizeObserver = new ResizeObserver(updateRect) - if (body) { - resizeObserver.observe(body) - } - if (parent) { - resizeObserver.observe(parent) - } - window.addEventListener('resize', updateRect) - return () => { - resizeObserver.disconnect() - window.removeEventListener('resize', updateRect) - } - }, [anchorName, groupId, isVisible]) + return subscribeTabGroupBodyRect(groupId, container, setMeasuredFallbackRect) + }, [groupId, measuresFallbackRect]) useLayoutEffect(() => { if (!fitTerminal || !isVisible || !anchorName) { diff --git a/src/renderer/src/components/tab-group/TabGroupPanel.tsx b/src/renderer/src/components/tab-group/TabGroupPanel.tsx index 6e48ddd0ec08..f6ad4b04d897 100644 --- a/src/renderer/src/components/tab-group/TabGroupPanel.tsx +++ b/src/renderer/src/components/tab-group/TabGroupPanel.tsx @@ -1,4 +1,4 @@ -import { Suspense, useMemo } from 'react' +import { Suspense, useCallback, useMemo } from 'react' import { lazyWithRetry as lazy } from '@/lib/lazy-with-retry' import { useDroppable } from '@dnd-kit/core' import { Ellipsis, X } from 'lucide-react' @@ -18,6 +18,7 @@ import { closeTerminalTab } from '../terminal/terminal-tab-actions' import { resolveGroupTabFromVisibleId } from './tab-group-visible-id' import { getTabPaneBodyDroppableId, type HoveredTabInsertion } from './useTabDragSplit' import { tabGroupBodyAnchorName } from './tab-group-body-anchor' +import { registerTabGroupBody } from './tab-group-body-geometry' import { translate } from '@/i18n/i18n' import type { TabGroup } from '../../../../shared/tab-types' import type { ClientHostedBrowserRow } from '../../../../shared/client-hosted-browser-rows' @@ -93,6 +94,20 @@ export default function TabGroupPanel({ }, disabled: !isTabDragActive }) + const setBodyRef = useCallback( + (node: HTMLDivElement | null) => { + setBodyDropRef(node) + if (!node) { + return undefined + } + const unregisterBody = registerTabGroupBody(groupId, node) + return () => { + unregisterBody() + setBodyDropRef(null) + } + }, + [groupId, setBodyDropRef] + ) // Why: per-group anchor-name lets the worktree-level overlay position panes via CSS anchor positioning, so moving a tab between groups re-targets the anchor instead of remounting xterm (loses alt-screen TUI state) or reloading ``. const bodyAnchorName = tabGroupBodyAnchorName(groupId) // Why: memoize so a fresh style object each render doesn't break downstream memoization keyed on referential equality. @@ -334,7 +349,7 @@ export default function TabGroupPanel({
void + observed: Set + disconnected: boolean +} + +let observers: FakeObserver[] +let cleanups: (() => void)[] + +function element(rect: DOMRect): HTMLDivElement { + const node = document.createElement('div') + node.getBoundingClientRect = () => rect + return node +} + +function track(cleanup: () => void): () => void { + cleanups.push(cleanup) + return cleanup +} + +function resizeListenerDelta( + add: ReturnType, + remove: ReturnType +) { + const count = (spy: ReturnType): number => + spy.mock.calls.filter(([type]) => type === 'resize').length + return count(add) - count(remove) +} + +beforeEach(() => { + observers = [] + cleanups = [] + vi.stubGlobal( + 'ResizeObserver', + class { + private readonly record: FakeObserver + constructor(callback: () => void) { + this.record = { callback, observed: new Set(), disconnected: false } + observers.push(this.record) + } + observe(target: Element): void { + this.record.observed.add(target) + } + unobserve(target: Element): void { + this.record.observed.delete(target) + } + disconnect(): void { + this.record.disconnected = true + this.record.observed.clear() + } + } + ) +}) + +afterEach(() => { + cleanups.forEach((cleanup) => cleanup()) + vi.restoreAllMocks() + vi.unstubAllGlobals() +}) + +describe('subscribeTabGroupBodyRect', () => { + it('shares one observer per group and one window listener across groups', () => { + const add = vi.spyOn(window, 'addEventListener') + const remove = vi.spyOn(window, 'removeEventListener') + const container = element(new DOMRect(0, 10, 800, 600)) + track(registerTabGroupBody('a', element(new DOMRect(0, 42, 400, 568)))) + track(registerTabGroupBody('b', element(new DOMRect(400, 42, 400, 568)))) + + const first = vi.fn() + const second = vi.fn() + const other = vi.fn() + const unsubscribeFirst = subscribeTabGroupBodyRect('a', container, first) + const unsubscribeSecond = subscribeTabGroupBodyRect('a', container, second) + const unsubscribeOther = subscribeTabGroupBodyRect('b', container, other) + + expect(observers).toHaveLength(2) + expect(resizeListenerDelta(add, remove)).toBe(1) + expect(first).toHaveBeenLastCalledWith({ top: 32, left: 0, width: 400, height: 568 }) + expect(second.mock.lastCall?.[0]).toBe(first.mock.lastCall?.[0]) + expect(other).toHaveBeenLastCalledWith({ top: 32, left: 400, width: 400, height: 568 }) + + unsubscribeFirst() + expect(observers[0].disconnected).toBe(false) + unsubscribeSecond() + expect(observers[0].disconnected).toBe(true) + expect(resizeListenerDelta(add, remove)).toBe(1) + unsubscribeOther() + expect(observers[1].disconnected).toBe(true) + expect(resizeListenerDelta(add, remove)).toBe(0) + }) + + it('notifies only on changes larger than a pixel', () => { + const container = element(new DOMRect(0, 0, 800, 600)) + let bodyRect = new DOMRect(0, 32, 400, 568) + const body = element(bodyRect) + body.getBoundingClientRect = () => bodyRect + track(registerTabGroupBody('a', body)) + const listener = vi.fn() + track(subscribeTabGroupBodyRect('a', container, listener)) + listener.mockClear() + + bodyRect = new DOMRect(0, 32.5, 400.5, 568) + window.dispatchEvent(new Event('resize')) + expect(listener).not.toHaveBeenCalled() + + bodyRect = new DOMRect(0, 32, 380, 568) + observers[0].callback() + expect(listener).toHaveBeenCalledTimes(1) + expect(listener).toHaveBeenLastCalledWith({ top: 32, left: 0, width: 380, height: 568 }) + }) + + it('follows the group body as it mounts, is replaced, and unmounts', () => { + const container = element(new DOMRect(0, 0, 800, 600)) + const listener = vi.fn() + track(subscribeTabGroupBodyRect('a', container, listener)) + expect(listener).toHaveBeenLastCalledWith(null) + + const firstBody = element(new DOMRect(0, 32, 400, 568)) + const unregisterFirst = registerTabGroupBody('a', firstBody) + expect(observers[0].observed.has(firstBody)).toBe(true) + expect(listener).toHaveBeenLastCalledWith({ top: 32, left: 0, width: 400, height: 568 }) + + const secondBody = element(new DOMRect(0, 32, 600, 568)) + const unregisterSecond = track(registerTabGroupBody('a', secondBody)) + expect(observers[0].observed.has(firstBody)).toBe(false) + expect(observers[0].observed.has(secondBody)).toBe(true) + expect(listener).toHaveBeenLastCalledWith({ top: 32, left: 0, width: 600, height: 568 }) + + // A late unregister from the replaced panel must not drop the live body. + unregisterFirst() + expect(observers[0].observed.has(secondBody)).toBe(true) + + unregisterSecond() + expect(observers[0].observed.has(secondBody)).toBe(false) + expect(listener).toHaveBeenLastCalledWith(null) + }) +}) diff --git a/src/renderer/src/components/tab-group/tab-group-body-geometry.ts b/src/renderer/src/components/tab-group/tab-group-body-geometry.ts new file mode 100644 index 000000000000..28712fb07166 --- /dev/null +++ b/src/renderer/src/components/tab-group/tab-group-body-geometry.ts @@ -0,0 +1,171 @@ +// Why: every retained pane in a group sits over the same tab-group body, so the +// non-anchor fallback (web client) measures that body once per group instead of +// once per pane, and only while some pane in the group can display. + +export type TabGroupBodyRect = { + top: number + left: number + width: number + height: number +} + +type TabGroupBodyRectListener = (rect: TabGroupBodyRect | null) => void + +type GroupBodyGeometrySource = { + groupId: string + // The positioned element the pane hosts are laid out in; rects are relative to it. + container: HTMLElement + listeners: Set + observer: ResizeObserver + observedBody: HTMLElement | null + rect: TabGroupBodyRect | null +} + +const RECT_MIN_CHANGE_PX = 1 + +const bodiesByGroupId = new Map() +const sourcesByGroupId = new Map>() + +function isSameRect(prev: TabGroupBodyRect | null, next: TabGroupBodyRect | null): boolean { + if (!prev || !next) { + return prev === next + } + // Why: ResizeObserver and xterm fit can otherwise amplify sub-pixel jitter forever. + return ( + Math.abs(prev.top - next.top) < RECT_MIN_CHANGE_PX && + Math.abs(prev.left - next.left) < RECT_MIN_CHANGE_PX && + Math.abs(prev.width - next.width) < RECT_MIN_CHANGE_PX && + Math.abs(prev.height - next.height) < RECT_MIN_CHANGE_PX + ) +} + +function measureSource(source: GroupBodyGeometrySource): void { + const body = source.observedBody + let next: TabGroupBodyRect | null = null + if (body) { + const containerRect = source.container.getBoundingClientRect() + const bodyRect = body.getBoundingClientRect() + next = { + top: bodyRect.top - containerRect.top, + left: bodyRect.left - containerRect.left, + width: bodyRect.width, + height: bodyRect.height + } + } + if (isSameRect(source.rect, next)) { + return + } + source.rect = next + for (const listener of source.listeners) { + listener(next) + } +} + +function measureAllSources(): void { + for (const sources of sourcesByGroupId.values()) { + for (const source of sources) { + measureSource(source) + } + } +} + +function syncObservedBody(source: GroupBodyGeometrySource): void { + const body = bodiesByGroupId.get(source.groupId) ?? null + if (body === source.observedBody) { + return + } + if (source.observedBody) { + source.observer.unobserve(source.observedBody) + } + if (body) { + source.observer.observe(body) + } + source.observedBody = body +} + +function onGroupBodyChanged(groupId: string): void { + for (const source of sourcesByGroupId.get(groupId) ?? []) { + syncObservedBody(source) + measureSource(source) + } +} + +/** Registers the element that is the body of `groupId`; returns the unregister function. */ +export function registerTabGroupBody(groupId: string, body: HTMLElement): () => void { + bodiesByGroupId.set(groupId, body) + onGroupBodyChanged(groupId) + return () => { + // A remounted panel may already have registered its replacement body. + if (bodiesByGroupId.get(groupId) !== body) { + return + } + bodiesByGroupId.delete(groupId) + onGroupBodyChanged(groupId) + } +} + +function acquireSource(groupId: string, container: HTMLElement): GroupBodyGeometrySource { + let sources = sourcesByGroupId.get(groupId) + for (const existing of sources ?? []) { + if (existing.container === container) { + return existing + } + } + const source: GroupBodyGeometrySource = { + groupId, + container, + listeners: new Set(), + observer: new ResizeObserver(() => measureSource(source)), + observedBody: null, + rect: null + } + source.observer.observe(container) + syncObservedBody(source) + if (sourcesByGroupId.size === 0) { + window.addEventListener('resize', measureAllSources) + } + if (!sources) { + sources = new Set() + sourcesByGroupId.set(groupId, sources) + } + sources.add(source) + return source +} + +function releaseSource(source: GroupBodyGeometrySource): void { + source.observer.disconnect() + const sources = sourcesByGroupId.get(source.groupId) + sources?.delete(source) + if (sources?.size === 0) { + sourcesByGroupId.delete(source.groupId) + } + if (sourcesByGroupId.size === 0) { + window.removeEventListener('resize', measureAllSources) + } +} + +/** + * Subscribes to the rect of `groupId`'s body relative to `container`. The + * listener is called synchronously with the current rect, then on each change. + */ +export function subscribeTabGroupBodyRect( + groupId: string, + container: HTMLElement, + listener: TabGroupBodyRectListener +): () => void { + const source = acquireSource(groupId, container) + // Why: observers miss moves without a resize, so a pane that becomes visible re-reads once. + measureSource(source) + listener(source.rect) + // A per-subscription entry keeps unsubscribe idempotent even if one listener subscribes twice. + const entry: TabGroupBodyRectListener = (rect) => listener(rect) + source.listeners.add(entry) + return () => { + if (!source.listeners.delete(entry)) { + return + } + if (source.listeners.size === 0) { + releaseSource(source) + } + } +} diff --git a/src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.react185.test.tsx b/src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.react185.test.tsx index dbdca3557797..cf9cabd9c576 100644 --- a/src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.react185.test.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.react185.test.tsx @@ -23,6 +23,7 @@ vi.mock('../../store', () => ({ })) import { TerminalOverlaySlot } from './TerminalOverlaySlot' +import { registerTabGroupBody } from '../tab-group/tab-group-body-geometry' const GROUP_ID = 'group-react185' const TAB_ID = 'tab-react185' @@ -52,6 +53,7 @@ let capturedResizeCallback: (() => void) | null = null let container: HTMLDivElement let bodyEl: HTMLDivElement let bodyRect: DOMRect +let unregisterBody: () => void let root: Root class CapturingResizeObserver { @@ -103,12 +105,14 @@ beforeEach(() => { bodyRect = createRect({ top: 32, height: 568 }) bodyEl.getBoundingClientRect = () => bodyRect document.body.appendChild(bodyEl) + unregisterBody = registerTabGroupBody(GROUP_ID, bodyEl) }) afterEach(() => { act(() => { root?.unmount() }) + unregisterBody() container?.remove() bodyEl?.remove() vi.unstubAllGlobals() From 9b11b1d594ae3775d0d37dbde8c423d8c5a58ac9 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:44:59 -0700 Subject: [PATCH 37/90] fix(agent-hooks): compare status rows structurally instead of serializing both (#23585) Status-row change detection stringified two full IPC payloads on every status write, including an up-to-8 KB lastAssistantMessage re-posted on every OpenCode streamed part. Compare the same published field set with the existing structural-equality helper, with a same-reference fast path. Linear: STA-7432 --- .../server/server-row-ownership.test.ts | 142 ++++++++++++++++++ .../server/server-row-ownership.ts | 25 ++- 2 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 src/main/agent-hooks/server/server-row-ownership.test.ts diff --git a/src/main/agent-hooks/server/server-row-ownership.test.ts b/src/main/agent-hooks/server/server-row-ownership.test.ts new file mode 100644 index 000000000000..e466ef879d23 --- /dev/null +++ b/src/main/agent-hooks/server/server-row-ownership.test.ts @@ -0,0 +1,142 @@ +import { describe, expect, it } from 'vitest' +import { AgentHookServer } from '../server' +import type { AgentHookStatusRowMutation, EnrichedAgentHookEventPayload } from './server-types' + +const PANE_KEY = 'tab-row:55555555-5555-4555-8555-555555555555' + +class RowMutationProbe extends AgentHookServer { + readonly mutations: AgentHookStatusRowMutation[] = [] + + constructor() { + super() + this.subscribeStatusRowMutations((mutation) => this.mutations.push(mutation)) + } + + commit( + before: EnrichedAgentHookEventPayload | null | undefined, + after: EnrichedAgentHookEventPayload | null | undefined + ): boolean { + return this.commitStatusRowMutation(before, after) + } +} + +function row( + overrides: Partial = {} +): EnrichedAgentHookEventPayload { + return { + paneKey: PANE_KEY, + tabId: 'tab-row', + worktreeId: 'worktree', + connectionId: null, + receivedAt: 1_000, + stateStartedAt: 900, + terminalHandle: 'term_row', + ...overrides, + payload: { + state: 'working', + prompt: 'ship it', + agentType: 'opencode', + lastAssistantMessage: 'x'.repeat(8_000), + subagents: [{ id: 'child-1', state: 'working', agentType: 'claude', startedAt: 800 }], + ...overrides.payload + } + } +} + +describe('status-row change detection', () => { + it('treats the same row object on both sides as unchanged', () => { + const probe = new RowMutationProbe() + const same = row() + expect(probe.commit(same, same)).toBe(false) + expect(probe.commit(null, undefined)).toBe(false) + expect(probe.mutations).toEqual([]) + }) + + it('ignores a rebuilt row whose published content is identical', () => { + const probe = new RowMutationProbe() + const before = row() + const rebuilt = row({ + receivedAt: 2_000, + evidenceObservedAt: 1_500, + launchToken: 'launch-2', + promptInteractionKey: 'turn-2', + observation: { + origin: 'hook', + authorityId: 'authority', + incarnation: 1, + revision: 7, + observedAt: 2_000 + }, + payload: { ...before.payload, subagents: before.payload.subagents?.map((s) => ({ ...s })) } + }) + expect(probe.commit(before, rebuilt)).toBe(false) + expect(probe.mutations).toEqual([]) + }) + + it('ignores key order, which a producer is free to change', () => { + const probe = new RowMutationProbe() + const before = row() + const reordered: EnrichedAgentHookEventPayload = { + payload: { + subagents: before.payload.subagents?.map((s) => ({ ...s })), + lastAssistantMessage: before.payload.lastAssistantMessage, + agentType: before.payload.agentType, + prompt: before.payload.prompt, + state: before.payload.state + }, + terminalHandle: before.terminalHandle, + stateStartedAt: before.stateStartedAt, + receivedAt: before.receivedAt, + connectionId: before.connectionId, + worktreeId: before.worktreeId, + tabId: before.tabId, + paneKey: before.paneKey + } + expect(probe.commit(before, reordered)).toBe(false) + }) + + // Why: paired clients read the whole payload off session.tabs, so no field may be skipped. + it.each<[string, Partial]>([ + ['state', { payload: { state: 'done', prompt: 'ship it' } }], + [ + 'lastAssistantMessage', + { payload: { state: 'working', prompt: 'ship it', lastAssistantMessage: 'y' } } + ], + [ + 'subagents', + { + payload: { + state: 'working', + prompt: 'ship it', + subagents: [{ id: 'child-1', state: 'idle', agentType: 'claude', startedAt: 800 }] + } + } + ], + [ + 'a newly present payload field', + { payload: { state: 'working', prompt: 'ship it', model: 'm' } } + ], + ['stateStartedAt', { stateStartedAt: 950 }], + ['connectionId', { connectionId: 'ssh-a' }], + ['terminalHandle', { terminalHandle: 'term_other' }], + ['providerSession', { providerSession: { key: 'session_id', id: 's-1' } }], + ['structuredHost', { structuredHost: 'owned' }] + ])('publishes a change to %s', (_field, overrides) => { + const probe = new RowMutationProbe() + const before = row() + expect(probe.commit(before, row(overrides))).toBe(true) + expect(probe.mutations).toEqual([ + { + before: { paneKey: PANE_KEY, worktreeId: 'worktree', terminalHandle: 'term_row' }, + after: expect.objectContaining({ paneKey: PANE_KEY }) + } + ]) + }) + + it('publishes a row appearing or disappearing', () => { + const probe = new RowMutationProbe() + expect(probe.commit(null, row())).toBe(true) + expect(probe.commit(row(), undefined)).toBe(true) + expect(probe.mutations).toHaveLength(2) + }) +}) diff --git a/src/main/agent-hooks/server/server-row-ownership.ts b/src/main/agent-hooks/server/server-row-ownership.ts index 2895eb463e45..cde178e335dd 100644 --- a/src/main/agent-hooks/server/server-row-ownership.ts +++ b/src/main/agent-hooks/server/server-row-ownership.ts @@ -4,6 +4,7 @@ import { } from '../../../shared/wsl-hook-relay-contract' import { splitWorktreeIdForFilesystem, worktreeIdsEqual } from '../../../shared/worktree/id' import { parseWslUncPath } from '../../../shared/wsl-paths' +import { structuralValuesEqualIgnoringUndefined } from '../../../shared/structural-value-equality' import type { AgentHookEventPayload } from '../../../shared/agent-hook-listener/listener-event' import type { AgentHookStatusRowIdentity, @@ -27,10 +28,7 @@ function toMutationIdentity( } } -function semanticRowJson(row: EnrichedAgentHookEventPayload | null | undefined): string | null { - if (!row) { - return null - } +function semanticRow(row: EnrichedAgentHookEventPayload): Record { const { receivedAt: _receivedAt, evidenceObservedAt: _evidenceObservedAt, @@ -39,7 +37,22 @@ function semanticRowJson(row: EnrichedAgentHookEventPayload | null | undefined): promptInteractionKey: _promptInteractionKey, ...semantic } = toAgentStatusIpcPayload(row) - return JSON.stringify(semantic) + return semantic +} + +// Why: runs on every status write; a structural walk exits on the first difference and skips +// shared leaves (e.g. an unchanged 8 KB lastAssistantMessage) instead of serializing both rows. +function semanticRowsEqual( + before: EnrichedAgentHookEventPayload | null | undefined, + after: EnrichedAgentHookEventPayload | null | undefined +): boolean { + if (before === after || (!before && !after)) { + return true + } + if (!before || !after) { + return false + } + return structuralValuesEqualIgnoringUndefined(semanticRow(before), semanticRow(after)) } function wslDistroForWorktree(worktreeId: string | undefined): string | null { @@ -113,7 +126,7 @@ export abstract class AgentHookServerRowOwnership extends AgentHookServerListene if (after?.terminalHandle) { this.paneKeyByTerminalHandle.set(after.terminalHandle, after.paneKey) } - if (!emit || semanticRowJson(before) === semanticRowJson(after)) { + if (!emit || semanticRowsEqual(before, after)) { return false } const mutation: AgentHookStatusRowMutation = { From 64569a8183c844544e5aba50262916acf3759bb0 Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Mon, 28 Sep 2026 22:53:11 +0000 Subject: [PATCH 38/90] fix(ssh): don't overwrite remote agent config after a failed read (#22644) * fix(ssh): don't overwrite remote agent config after a failed read A flaky read was treated as an empty file, wiping the user's config. Fixes #22638 * test(runtime): model remote missing-config reads as relay ENOENT errors The runtime harness stubbed isENOENT as code-only, and the remote Codex startup specs rejected with a generic error that only passed while any read failure seeded an empty config. Use the real isENOENT and the message-only shape the relay actually delivers. --------- Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> --- src/main/remote-agent-trust-presets.test.ts | 55 +++++++++++++++++++ src/main/remote-agent-trust-presets.ts | 19 +++++-- .../orca-runtime-test-mocks/setup.spec.ts | 12 ++-- ...worktree-setup-and-startup-part-05.spec.ts | 12 +++- 4 files changed, 87 insertions(+), 11 deletions(-) diff --git a/src/main/remote-agent-trust-presets.test.ts b/src/main/remote-agent-trust-presets.test.ts index 8b552e55277f..4b0692bb1427 100644 --- a/src/main/remote-agent-trust-presets.test.ts +++ b/src/main/remote-agent-trust-presets.test.ts @@ -159,6 +159,61 @@ describe('markRemoteAgentWorkspaceTrusted', () => { expect(fsProvider.writeFile).not.toHaveBeenCalled() }) + + it.each(['codex', 'copilot'] as const)( + 'leaves the remote %s config untouched when the read fails', + async (preset) => { + const fsProvider = makeFsProvider({ + readFile: vi.fn(async () => { + throw new Error('file stream stalled') + }) + }) + mocks.getSshFilesystemProvider.mockReturnValue(fsProvider) + + await expect( + markRemoteAgentWorkspaceTrusted({ preset, connectionId: 'ssh-1', workspacePath: '/repo' }) + ).rejects.toThrow() + + expect(fsProvider.writeFile).not.toHaveBeenCalled() + } + ) + + it.each(['codex', 'copilot'] as const)( + 'leaves the remote %s config untouched when the read comes back binary', + async (preset) => { + const fsProvider = makeFsProvider({ + readFile: vi.fn(async () => ({ content: 'AAEC', isBinary: true })) + }) + mocks.getSshFilesystemProvider.mockReturnValue(fsProvider) + + await expect( + markRemoteAgentWorkspaceTrusted({ preset, connectionId: 'ssh-1', workspacePath: '/repo' }) + ).rejects.toThrow() + + expect(fsProvider.writeFile).not.toHaveBeenCalled() + } + ) + + it('creates the remote Codex config when the relay reports it missing', async () => { + // The relay rebuilds remote errors without Node's .code; only the message survives. + const fsProvider = makeFsProvider({ + readFile: vi.fn(async () => { + throw new Error("ENOENT: no such file or directory, stat '/home/u/.codex/config.toml'") + }) + }) + mocks.getSshFilesystemProvider.mockReturnValue(fsProvider) + + await markRemoteAgentWorkspaceTrusted({ + preset: 'codex', + connectionId: 'ssh-1', + workspacePath: '/repo' + }) + + expect(fsProvider.writeFile).toHaveBeenCalledWith( + '/home/u/.codex/config.toml', + '[projects."/real/repo"]\ntrust_level = "trusted"\n' + ) + }) }) describe('remote Qoder trust', () => { diff --git a/src/main/remote-agent-trust-presets.ts b/src/main/remote-agent-trust-presets.ts index 9ca8d665e066..021f18683cae 100644 --- a/src/main/remote-agent-trust-presets.ts +++ b/src/main/remote-agent-trust-presets.ts @@ -3,7 +3,8 @@ import type { AgentTrustPreset } from './agent-trust-presets' import { upsertProjectTrustLevelInContent } from './codex/config-toml-trust' import { getActiveMultiplexer } from './ssh/ssh-target-registry' import { getSshFilesystemProvider } from './providers/ssh-filesystem-dispatch' -import type { IFilesystemProvider } from './providers/types' +import type { FileReadResult, IFilesystemProvider } from './providers/types' +import { isENOENT } from './ipc/filesystem-path-containment' import { isWindowsAbsolutePathLike, normalizeRuntimePathSeparators @@ -76,12 +77,20 @@ async function readRemoteTextFile( fsProvider: IFilesystemProvider, filePath: string ): Promise { + let result: FileReadResult try { - const result = await fsProvider.readFile(filePath) - return result.isBinary ? '' : result.content - } catch { - return '' + result = await fsProvider.readFile(filePath) + } catch (error) { + // Why: only definitive absence may seed empty; a failed read would otherwise overwrite the user's config. + if (isENOENT(error)) { + return '' + } + throw error + } + if (result.isBinary) { + throw new Error(`Refusing to rewrite non-text remote config: ${filePath}`) } + return result.content } async function markRemoteCodexProjectTrusted( diff --git a/src/main/runtime/orca-runtime-test-mocks/setup.spec.ts b/src/main/runtime/orca-runtime-test-mocks/setup.spec.ts index f85c353575ec..c25dc33df879 100644 --- a/src/main/runtime/orca-runtime-test-mocks/setup.spec.ts +++ b/src/main/runtime/orca-runtime-test-mocks/setup.spec.ts @@ -1,6 +1,7 @@ import { expect, vi } from 'vitest' import type { Mock } from 'vitest' import type * as GitUsernameModule from '../../git/git-username' +import type * as FilesystemPathContainmentModule from '../../ipc/filesystem-path-containment' import { reviewHeadRemoteRefComponent } from '../../../shared/review-head-tracking-ref' // Why: durable review-head refs are scoped by remote identity (name + URL hash). @@ -420,10 +421,13 @@ vi.mock('../../ipc/registered-worktree-roots-cache', () => ({ invalidateAuthorizedRootsCache: invalidateAuthorizedRootsCacheMock })) -vi.mock('../../ipc/filesystem-path-containment', () => ({ - isENOENT: (error: unknown) => - Boolean(error && typeof error === 'object' && 'code' in error && error.code === 'ENOENT') -})) +// Why: the real check also matches relay-rebuilt errors, which carry only the ENOENT message. +vi.mock('../../ipc/filesystem-path-containment', async () => { + const actual = await vi.importActual( + '../../ipc/filesystem-path-containment' + ) + return { isENOENT: actual.isENOENT } +}) vi.mock('../../worktree-root-preparation', () => ({ prepareLocalWorktreeRootForRepo: prepareLocalWorktreeRootForRepoMock diff --git a/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-05.spec.ts b/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-05.spec.ts index c4ac5ea9a84b..d341496786e0 100644 --- a/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-05.spec.ts +++ b/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-05.spec.ts @@ -189,7 +189,11 @@ describe('OrcaRuntimeService', () => { } const fsProvider = { realpath: vi.fn().mockResolvedValue('/remote/mobile-codex-draft'), - readFile: vi.fn().mockRejectedValue(new Error('missing config')), + readFile: vi + .fn() + .mockRejectedValue( + new Error("ENOENT: no such file or directory, stat '/home/dev/.codex/config.toml'") + ), createDir: vi.fn().mockResolvedValue(undefined), writeFile: vi.fn().mockResolvedValue(undefined) } @@ -302,7 +306,11 @@ describe('OrcaRuntimeService', () => { } const fsProvider = { realpath: vi.fn().mockResolvedValue('/remote/mobile-codex-command'), - readFile: vi.fn().mockRejectedValue(new Error('missing config')), + readFile: vi + .fn() + .mockRejectedValue( + new Error("ENOENT: no such file or directory, stat '/home/dev/.codex/config.toml'") + ), createDir: vi.fn().mockResolvedValue(undefined), writeFile: vi.fn().mockResolvedValue(undefined) } From 2af897d7ea9ef1f6f80066876e072a030bef8692 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:04:04 -0700 Subject: [PATCH 39/90] fix(codex): the provider supervisor outlives its provider group when stopped (#23466) * fix(codex): the provider supervisor outlives its provider group when stopped A signalled supervisor forwards the signal to the provider group, escalates to SIGKILL after the grace, and exits only once the group is gone, so recovery's proof that the recorded pid is dead also proves the provider is. It refuses to spawn when its parent is already not the owner named in its spec, and watches that owner rather than whichever parent it first saw. The grace is a spec field. Recovery's SIGTERM stage now outlasts the supervisor's own stop, since a SIGKILL that lands first cannot be handled and leaves the group running. * fix(codex): a closed owner pipe no longer ends the supervisor before its provider group When Orca dies, the supervisor's stdout pipe has no reader. Provider output in the window before the parent-death watch fired raised an unhandled EPIPE that exited the supervisor with the provider group still running. * fix(codex): bound the supervisor grace so recovery's SIGTERM stage always covers it Recovery sized its SIGTERM stage from the default grace, so a launch with a longer grace would be SIGKILLed mid-stop and orphan its group with no test noticing. The spec now refuses any grace above one exported maximum, and recovery derives its SIGTERM stage from that maximum. * fix(codex): every supervisor stop asks the provider with SIGTERM first Owner death, stdin end after the grace, and a signal to the supervisor now all take one path: SIGTERM the provider group, SIGKILL it after the grace, and exit only once it is gone. The signal handlers are registered before the provider is spawned, so a stop that lands in the spawn window still reaps it. The longest stop grows to two graces plus the reap wait, and both recovery's SIGTERM stage and the connection's graceful close now wait that long before forcing, since forcing the supervisor sooner can orphan its group. * fix(codex): give the provider 1 s after stdin end and 3 s after SIGTERM to flush before SIGKILL The supervisor's stop was stdin end, 1.25 s, SIGTERM, 1.25 s, SIGKILL. Codex now gets 3 s after SIGTERM to flush its state. The two graces are separate constants, the longest stop they derive becomes 5.5 s, and a test keeps it inside quit's 8 s child-eviction bound. * test(codex): count eviction's pre-stop drain in the quit budget test Eviction drains the sink for up to 1 s before it stops the child, inside the same 8 s bound. --- .../codex/codex-app-server-connection.test.ts | 12 +- src/main/codex/codex-app-server-connection.ts | 11 +- ...erver-posix-supervisor.integration.test.ts | 333 ++++++++++++++++++ .../codex-app-server-posix-supervisor.test.ts | 21 +- .../codex-app-server-posix-supervisor.ts | 104 ++++-- .../structured-agent-session-eviction.ts | 2 +- ...ctured-agent-session-host-teardown.test.ts | 20 +- .../structured-agent-session-host-teardown.ts | 2 +- ...-agent-session-recovery-resolution.test.ts | 75 +++- ...tured-agent-session-recovery-resolution.ts | 10 +- 10 files changed, 553 insertions(+), 37 deletions(-) create mode 100644 src/main/codex/codex-app-server-posix-supervisor.integration.test.ts diff --git a/src/main/codex/codex-app-server-connection.test.ts b/src/main/codex/codex-app-server-connection.test.ts index 4e7cd016bd6c..7fe63c6e4180 100644 --- a/src/main/codex/codex-app-server-connection.test.ts +++ b/src/main/codex/codex-app-server-connection.test.ts @@ -11,8 +11,12 @@ import { type CodexAppServerConnection, type CodexAppServerConnectionHandlers } from './codex-app-server-connection' +import { PROVIDER_SUPERVISOR_MAX_STOP_MS } from './codex-app-server-posix-supervisor' import { isCodexAppServerUnsupportedError } from './codex-app-server-session' +// close() waits out the supervisor's own stop before forcing the tree. +const GRACEFUL_EXIT_MS = process.platform === 'win32' ? 1_500 : PROVIDER_SUPERVISOR_MAX_STOP_MS + const originalCodexHome = process.env.CODEX_HOME afterEach(() => { @@ -392,7 +396,7 @@ describe('openCodexAppServerConnection', () => { openCodexAppServerConnection({ command: 'codex', args: ['app-server'] }, {}, spawnImpl) ) - await vi.advanceTimersByTimeAsync(5_000) + await vi.advanceTimersByTimeAsync(GRACEFUL_EXIT_MS + 3_500) const error = (await opening) as Error & { connection?: CodexAppServerConnection } expect(error.name).toBe('CodexAppServerHandshakeExitUnprovenError') @@ -434,7 +438,7 @@ describe('openCodexAppServerConnection', () => { }) const closing = connection.close() - await vi.advanceTimersByTimeAsync(2_000) + await vi.advanceTimersByTimeAsync(GRACEFUL_EXIT_MS + 500) await closing await vi.waitFor(() => expect(child.kill).toHaveBeenCalledWith('SIGKILL')) @@ -468,7 +472,7 @@ describe('openCodexAppServerConnection', () => { const first = connection.close() const second = connection.close() - await vi.advanceTimersByTimeAsync(4_100) + await vi.advanceTimersByTimeAsync(GRACEFUL_EXIT_MS + 2_600) await expect(Promise.all([first, second])).resolves.toEqual([true, true]) expect(child.kill.mock.calls.map(([signal]) => signal)).toEqual(['SIGSTOP', 'SIGKILL']) @@ -485,7 +489,7 @@ describe('openCodexAppServerConnection', () => { ) const first = connection.close() - await vi.advanceTimersByTimeAsync(5_000) + await vi.advanceTimersByTimeAsync(GRACEFUL_EXIT_MS + 3_500) await expect(first).resolves.toBe(false) child.emit('exit', 0, null) diff --git a/src/main/codex/codex-app-server-connection.ts b/src/main/codex/codex-app-server-connection.ts index b0cf133e1e2a..ef566bca3360 100644 --- a/src/main/codex/codex-app-server-connection.ts +++ b/src/main/codex/codex-app-server-connection.ts @@ -1,6 +1,9 @@ import { spawnProcess } from '../../shared/child-process/run-process' import { RetryableProcessExitProof } from '../../shared/child-process/retryable-process-exit-proof' -import { createProviderSpawnSpec } from './codex-app-server-posix-supervisor' +import { + createProviderSpawnSpec, + PROVIDER_SUPERVISOR_MAX_STOP_MS +} from './codex-app-server-posix-supervisor' import { buildCodexAppServerExitError } from './codex-app-server-exit-error' import { initializeCodexAppServerConnection } from './codex-app-server-handshake' import { CodexAppServerHandshakeExitUnprovenError } from './codex-app-server-handshake-exit-proof' @@ -247,7 +250,11 @@ export async function openCodexAppServerConnection( // Already destroyed; the reap below still runs. } if (!exited) { - await waitForProcessExitUntil(exitPromise, GRACEFUL_EXIT_MS) + // The POSIX supervisor stops its own provider group; forcing it any sooner can orphan it. + await waitForProcessExitUntil( + exitPromise, + process.platform === 'win32' ? GRACEFUL_EXIT_MS : PROVIDER_SUPERVISOR_MAX_STOP_MS + ) if (!exited) { const treeExited = await terminateProcessTree() if (!treeExited) { diff --git a/src/main/codex/codex-app-server-posix-supervisor.integration.test.ts b/src/main/codex/codex-app-server-posix-supervisor.integration.test.ts new file mode 100644 index 000000000000..e23cdbc88c34 --- /dev/null +++ b/src/main/codex/codex-app-server-posix-supervisor.integration.test.ts @@ -0,0 +1,333 @@ +import { spawn, type ChildProcess } from 'node:child_process' +import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' +import { + POSIX_PROVIDER_SUPERVISOR_SCRIPT, + PROVIDER_SIGTERM_GRACE_MS, + PROVIDER_STDIN_END_GRACE_MS, + PROVIDER_SUPERVISOR_MAX_STOP_MS, + supervisedPosixLaunch, + type ProviderSupervisorOptions +} from './codex-app-server-posix-supervisor' + +// The provider leads its own group; its grandchild shares that group and ignores SIGTERM. +const PROVIDER = String.raw` + const { spawn } = require('node:child_process') + if (process.env.ORCA_TEST_PROVIDER_IGNORES_SIGTERM) process.on('SIGTERM', () => {}) + if (process.env.ORCA_TEST_PROVIDER_SIGNAL_FILE) { + process.on('SIGTERM', () => { + require('node:fs').writeFileSync(process.env.ORCA_TEST_PROVIDER_SIGNAL_FILE, 'SIGTERM') + process.exit(0) + }) + } + process.stdout.on('error', () => {}) + const grandchild = spawn( + process.execPath, + ['-e', "process.on('SIGTERM', () => {}); process.stdout.write('armed'); setInterval(() => {}, 60000)"], + { stdio: ['ignore', 'pipe', 'ignore'] } + ) + grandchild.stdout.once('data', () => { + process.stdout.write(JSON.stringify({ provider: process.pid, grandchild: grandchild.pid }) + '\n') + if (process.env.ORCA_TEST_PROVIDER_STREAMS_OUTPUT) setInterval(() => process.stdout.write('.'), 2) + }) + setInterval(() => {}, 60000) +` + +// Exits the moment its stdin ends, as Codex does on a normal close. +const EXITS_ON_STDIN_END_PROVIDER = String.raw` + process.stdin.on('end', () => process.exit(0)).resume() + process.stdout.write(JSON.stringify({ provider: process.pid }) + '\n') +` + +// Ignores stdin end and SIGTERM, recording when SIGTERM arrived, so only SIGKILL ends it. +const RECORDS_SIGTERM_PROVIDER = String.raw` + process.on('SIGTERM', () => { + require('node:fs').writeFileSync(process.env.ORCA_TEST_PROVIDER_SIGNAL_FILE, String(Date.now())) + }) + process.stdout.write(JSON.stringify({ provider: process.pid }) + '\n') + setInterval(() => {}, 60000) +` + +// Stands in for Orca: launches the supervisor as its own child, then can be killed outright. A +// second child holds the supervisor's stdin open, so only the parent-death watch can notice. +const OWNER = String.raw` + const { spawn } = require('node:child_process') + const spec = JSON.parse(Buffer.from(process.env.ORCA_PROVIDER_SUPERVISOR_SPEC, 'base64').toString()) + spec.ownerPid = process.pid + const supervisor = spawn(process.execPath, ['-e', process.env.ORCA_TEST_SUPERVISOR_SCRIPT], { + env: { ...process.env, ORCA_PROVIDER_SUPERVISOR_SPEC: Buffer.from(JSON.stringify(spec)).toString('base64') }, + stdio: ['pipe', 'pipe', 'ignore'], + detached: true + }) + const holder = spawn(process.execPath, ['-e', 'setInterval(() => {}, 60000)'], { + stdio: ['ignore', supervisor.stdin, 'ignore'] + }) + process.stdout.write(JSON.stringify({ supervisor: supervisor.pid, holder: holder.pid }) + '\n') + supervisor.stdout.pipe(process.stdout) + setInterval(() => {}, 60000) +` + +// Preloaded into the supervisor: signals it the instant its provider exists, the spawn window. +const SIGNAL_AFTER_SPAWN_PRELOAD = String.raw` + const childProcess = require('node:child_process') + const spawn = childProcess.spawn + childProcess.spawn = (...args) => { + const child = spawn(...args) + require('node:fs').writeFileSync(process.env.ORCA_TEST_PROVIDER_PID_FILE, String(child.pid)) + process.kill(process.pid, 'SIGTERM') + return child + } +` + +const recordedPids = new Set() +const tempDirs: string[] = [] + +function tempDir(): string { + const dir = mkdtempSync(join(tmpdir(), 'orca-supervisor-')) + tempDirs.push(dir) + return dir +} + +function alive(pid: number): boolean { + try { + process.kill(pid, 0) + return true + } catch (error) { + return !(error instanceof Error && 'code' in error && error.code === 'ESRCH') + } +} + +async function waitFor(predicate: () => boolean, timeoutMs: number): Promise { + const deadline = Date.now() + timeoutMs + while (!predicate()) { + if (Date.now() >= deadline) { + return false + } + await new Promise((resolve) => setTimeout(resolve, 25)) + } + return true +} + +function readPids(child: ChildProcess, keys: readonly string[]): Promise> { + return new Promise((resolve, reject) => { + const pids: Record = {} + let buffered = '' + const timeout = setTimeout(() => reject(new Error(`no ${keys.join('/')} pids`)), 10_000) + const onData = (chunk: Buffer): void => { + buffered += chunk.toString() + const lines = buffered.split('\n') + buffered = lines.pop() ?? '' + for (const line of lines) { + const parsed: unknown = JSON.parse(line) + for (const [key, pid] of Object.entries(parsed ?? {})) { + if (typeof pid === 'number') { + pids[key] = pid + recordedPids.add(pid) + } + } + } + if (keys.every((key) => key in pids)) { + clearTimeout(timeout) + // Later output is not pids; the stream keeps flowing without a listener. + child.stdout!.off('data', onData) + resolve(pids) + } + } + child.stdout!.on('data', onData) + }) +} + +function launchSupervisor( + options: ProviderSupervisorOptions, + env: Record = {}, + provider: { command: string; args: string[] } = { + command: process.execPath, + args: ['-e', PROVIDER] + }, + nodeArgs: string[] = [] +): { supervisor: ChildProcess; exit: Promise<{ code: number | null; signal: string | null }> } { + const launch = supervisedPosixLaunch(provider, { ...process.env, ...env }, options) + const supervisor = spawn(launch.command, [...nodeArgs, ...launch.args], { + env: launch.env, + stdio: ['pipe', 'pipe', 'ignore'], + detached: true + }) + recordedPids.add(supervisor.pid!) + const exit = new Promise<{ code: number | null; signal: string | null }>((resolve) => + supervisor.once('exit', (code, signal) => resolve({ code, signal })) + ) + return { supervisor, exit } +} + +async function launchUnderOwner( + options: ProviderSupervisorOptions, + env: Record = {} +): Promise<{ owner: ChildProcess; pids: Record }> { + const launch = supervisedPosixLaunch( + { command: process.execPath, args: ['-e', PROVIDER] }, + { ...process.env, ...env }, + options + ) + const owner = spawn(process.execPath, ['-e', OWNER], { + env: { ...launch.env, ORCA_TEST_SUPERVISOR_SCRIPT: POSIX_PROVIDER_SUPERVISOR_SCRIPT }, + stdio: ['ignore', 'pipe', 'ignore'] + }) + recordedPids.add(owner.pid!) + const pids = await readPids(owner, ['supervisor', 'holder', 'provider', 'grandchild']) + return { owner, pids } +} + +afterEach(() => { + for (const pid of recordedPids) { + if (alive(pid)) { + process.kill(pid, 'SIGKILL') + } + } + recordedPids.clear() + for (const dir of tempDirs.splice(0)) { + rmSync(dir, { recursive: true, force: true }) + } +}) + +describe.runIf(process.platform !== 'win32')('POSIX provider supervisor processes', () => { + it('reaps the provider group on SIGTERM and exits only after the group is gone', async () => { + const { supervisor, exit } = launchSupervisor({ sigtermGraceMs: 300 }) + const { provider, grandchild } = await readPids(supervisor, ['provider', 'grandchild']) + + let groupAliveAtExit: boolean | null = null + void exit.then(() => { + groupAliveAtExit = alive(-provider) + }) + supervisor.kill('SIGTERM') + + await expect(exit).resolves.toEqual({ code: null, signal: 'SIGTERM' }) + expect(groupAliveAtExit).toBe(false) + expect(alive(provider)).toBe(false) + expect(alive(grandchild)).toBe(false) + }) + + it('escalates a SIGTERM-ignoring provider to SIGKILL after the grace from the spec', async () => { + const graceMs = 200 + const { supervisor, exit } = launchSupervisor( + { sigtermGraceMs: graceMs }, + { ORCA_TEST_PROVIDER_IGNORES_SIGTERM: '1' } + ) + const { provider, grandchild } = await readPids(supervisor, ['provider', 'grandchild']) + + const signalledAt = Date.now() + supervisor.kill('SIGTERM') + const exited = await Promise.race([exit, new Promise((resolve) => setTimeout(resolve, 5_000))]) + + expect(exited).toEqual({ code: null, signal: 'SIGTERM' }) + expect(Date.now() - signalledAt).toBeGreaterThanOrEqual(graceMs) + expect(Date.now() - signalledAt).toBeLessThan(PROVIDER_SIGTERM_GRACE_MS) + expect(alive(provider)).toBe(false) + expect(alive(grandchild)).toBe(false) + }) + + it('reaps a provider spawned in the instant before a stop arrives', async () => { + const dir = tempDir() + const preload = join(dir, 'signal-after-spawn.js') + const pidFile = join(dir, 'provider-pid') + writeFileSync(preload, SIGNAL_AFTER_SPAWN_PRELOAD) + const { exit } = launchSupervisor( + { sigtermGraceMs: 300 }, + { ORCA_TEST_PROVIDER_PID_FILE: pidFile }, + { command: process.execPath, args: ['-e', 'setInterval(() => {}, 60000)'] }, + ['--require', preload] + ) + + await expect(exit).resolves.toEqual({ code: null, signal: 'SIGTERM' }) + const provider = Number(readFileSync(pidFile, 'utf8')) + recordedPids.add(provider) + expect(await waitFor(() => !alive(provider), 3_000)).toBe(true) + }) + + it('never spawns the provider when its owner is not its parent at start', async () => { + const marker = join(tempDir(), 'provider-started') + const { exit } = launchSupervisor( + { ownerPid: process.pid === 1 ? 2 : 1 }, + {}, + { command: 'touch', args: [marker] } + ) + + await expect(exit).resolves.toEqual({ code: 1, signal: null }) + await new Promise((resolve) => setTimeout(resolve, 200)) + expect(existsSync(marker)).toBe(false) + }) + + it.each([ + ['', {}], + // Output after the owner's death meets a closed pipe, which must not end the supervisor first. + [' while the provider is writing output', { ORCA_TEST_PROVIDER_STREAMS_OUTPUT: '1' }] + ])('reaps the provider group when its owner dies%s', async (_, env) => { + const graceMs = 300 + const { owner, pids } = await launchUnderOwner({ sigtermGraceMs: graceMs }, env) + + const killedAt = Date.now() + owner.kill('SIGKILL') + + expect(await waitFor(() => !alive(-pids.provider), 3_000)).toBe(true) + // The grandchild ignores SIGTERM, so the group lasts until the grace ends in SIGKILL. + expect(Date.now() - killedAt).toBeGreaterThanOrEqual(graceMs) + expect(await waitFor(() => !alive(pids.supervisor), 3_000)).toBe(true) + expect(alive(pids.grandchild)).toBe(false) + }) + + it('closes a provider that exits on stdin end without waiting out any grace', async () => { + const { supervisor, exit } = launchSupervisor( + {}, + {}, + { + command: process.execPath, + args: ['-e', EXITS_ON_STDIN_END_PROVIDER] + } + ) + const { provider } = await readPids(supervisor, ['provider']) + + const endedAt = Date.now() + supervisor.stdin!.end() + + await expect(exit).resolves.toEqual({ code: 0, signal: null }) + expect(Date.now() - endedAt).toBeLessThan(PROVIDER_STDIN_END_GRACE_MS) + expect(alive(provider)).toBe(false) + }) + + it('gives a provider 1 s after stdin end, then 3 s after SIGTERM before SIGKILL', async () => { + const signalFile = join(tempDir(), 'provider-sigterm-at') + const { supervisor, exit } = launchSupervisor( + {}, + { ORCA_TEST_PROVIDER_SIGNAL_FILE: signalFile }, + { command: process.execPath, args: ['-e', RECORDS_SIGTERM_PROVIDER] } + ) + const { provider } = await readPids(supervisor, ['provider']) + + const endedAt = Date.now() + supervisor.stdin!.end() + const exited = await exit + const exitedAt = Date.now() + const signalledAt = Number(readFileSync(signalFile, 'utf8')) + + expect(exited).toEqual({ code: 137, signal: null }) + // Timers may fire a tick early against another process's clock. + expect(signalledAt - endedAt).toBeGreaterThanOrEqual(1_000 - 20) + expect(exitedAt - signalledAt).toBeGreaterThanOrEqual(3_000 - 20) + expect(exitedAt - endedAt).toBeLessThan(PROVIDER_SUPERVISOR_MAX_STOP_MS + 1_000) + expect(alive(provider)).toBe(false) + }) + + it('asks the provider to stop with SIGTERM when its owner dies', async () => { + const signalFile = join(tempDir(), 'provider-signal') + const { owner, pids } = await launchUnderOwner( + { sigtermGraceMs: 300 }, + { ORCA_TEST_PROVIDER_SIGNAL_FILE: signalFile } + ) + + owner.kill('SIGKILL') + + expect(await waitFor(() => !alive(-pids.provider), 3_000)).toBe(true) + expect(existsSync(signalFile) && readFileSync(signalFile, 'utf8')).toBe('SIGTERM') + }) +}) diff --git a/src/main/codex/codex-app-server-posix-supervisor.test.ts b/src/main/codex/codex-app-server-posix-supervisor.test.ts index f51157a443c7..28a088716f6c 100644 --- a/src/main/codex/codex-app-server-posix-supervisor.test.ts +++ b/src/main/codex/codex-app-server-posix-supervisor.test.ts @@ -3,6 +3,8 @@ import type { CodexAppServerLaunch } from './codex-app-server-connection' import { createProviderSpawnSpec, POSIX_PROVIDER_SUPERVISOR_SCRIPT, + PROVIDER_SIGTERM_GRACE_MS, + PROVIDER_STDIN_END_GRACE_MS, supervisedPosixLaunch } from './codex-app-server-posix-supervisor' @@ -27,7 +29,10 @@ describe('structured provider supervision', () => { expect.objectContaining({ command: '/opt/codex', args: ['app-server', '--flag'], - cwd: '/work/repo' + cwd: '/work/repo', + ownerPid: process.pid, + stdinEndGraceMs: PROVIDER_STDIN_END_GRACE_MS, + sigtermGraceMs: PROVIDER_SIGTERM_GRACE_MS }) ) expect( @@ -38,7 +43,7 @@ describe('structured provider supervision', () => { ) expect(POSIX_PROVIDER_SUPERVISOR_SCRIPT).toContain('delete childEnv.ELECTRON_RUN_AS_NODE') expect(spec.env.ELECTRON_RUN_AS_NODE).toBe('1') - expect(POSIX_PROVIDER_SUPERVISOR_SCRIPT).toContain('process.ppid !== originalParent') + expect(POSIX_PROVIDER_SUPERVISOR_SCRIPT).toContain('process.ppid !== spec.ownerPid') expect(POSIX_PROVIDER_SUPERVISOR_SCRIPT).toContain( "process.stdin.once('close', scheduleOwnerShutdown)" ) @@ -49,6 +54,18 @@ describe('structured provider supervision', () => { expect(POSIX_PROVIDER_SUPERVISOR_SCRIPT).not.toContain('process.ppid === 1') }) + it('refuses a grace longer than recovery waits before SIGKILL', () => { + const stdinEnd = (stdinEndGraceMs: number) => () => + supervisedPosixLaunch(launch, {}, { stdinEndGraceMs }) + const sigterm = (sigtermGraceMs: number) => () => + supervisedPosixLaunch(launch, {}, { sigtermGraceMs }) + + expect(stdinEnd(PROVIDER_STDIN_END_GRACE_MS)).not.toThrow() + expect(stdinEnd(PROVIDER_STDIN_END_GRACE_MS + 1)).toThrow(RangeError) + expect(sigterm(PROVIDER_SIGTERM_GRACE_MS)).not.toThrow() + expect(sigterm(PROVIDER_SIGTERM_GRACE_MS + 1)).toThrow(RangeError) + }) + it('uses direct provider spawning on Windows because the job owns the tree', () => { expect(createProviderSpawnSpec(launch, { PATH: '/bin' }, 'win32')).toEqual({ program: '/opt/codex', diff --git a/src/main/codex/codex-app-server-posix-supervisor.ts b/src/main/codex/codex-app-server-posix-supervisor.ts index f83ba6f374bc..30714ee79112 100644 --- a/src/main/codex/codex-app-server-posix-supervisor.ts +++ b/src/main/codex/codex-app-server-posix-supervisor.ts @@ -1,9 +1,33 @@ import type { CodexAppServerLaunch } from './codex-app-server-connection' +/** Time the provider gets to exit on its own after its stdin ends, before SIGTERM. */ +export const PROVIDER_STDIN_END_GRACE_MS = 1_000 +/** Time the provider group gets to flush and exit after SIGTERM, before SIGKILL. */ +export const PROVIDER_SIGTERM_GRACE_MS = 3_000 +/** + * How long the supervisor waits for a SIGKILLed group to disappear. A killed process never runs + * again, so this only covers the kernel finishing the kill; waiting forever could hang close or + * recovery on a process stuck in the kernel, such as one blocked on a hung network drive. + */ +export const PROVIDER_GROUP_REAP_TIMEOUT_MS = 1_500 +/** + * Longest a supervisor can take to stop once asked (stdin end, grace, SIGTERM, grace, SIGKILL, + * reap); a SIGKILL sooner can orphan its group. The graces are also the largest a spec may carry. + */ +export const PROVIDER_SUPERVISOR_MAX_STOP_MS = + PROVIDER_STDIN_END_GRACE_MS + PROVIDER_SIGTERM_GRACE_MS + PROVIDER_GROUP_REAP_TIMEOUT_MS + /** Inline supervisor source kept dependency-free for the spawned Node child. */ export const POSIX_PROVIDER_SUPERVISOR_SCRIPT = ` const { spawn } = require('node:child_process') const spec = JSON.parse(Buffer.from(process.env.ORCA_PROVIDER_SUPERVISOR_SPEC, 'base64').toString()) +// A detached supervisor is reparented when its owner exits. The new parent may +// be PID 1 or a platform subreaper, so any other parent means no live owner. +const ownerGone = () => process.ppid !== spec.ownerPid +// Registered before the spawn, so a stop that lands while the provider starts still reaps it. +for (const signal of ['SIGTERM', 'SIGINT', 'SIGHUP']) process.on(signal, () => stopProviderGroup(signal)) +// Orca can die before this runs; spawning then would start a provider nothing watches. +if (ownerGone()) process.exit(1) const childEnv = { ...process.env } delete childEnv.ORCA_PROVIDER_SUPERVISOR_SPEC delete childEnv.ELECTRON_RUN_AS_NODE @@ -13,7 +37,6 @@ const child = spawn(spec.command, spec.args, { stdio: ['pipe', 'pipe', 'pipe'], detached: true }) -const originalParent = process.ppid let timer let ownerShutdownTimer let settling = false @@ -26,29 +49,47 @@ const providerGroupExists = () => { return Boolean(error && error.code !== 'ESRCH') } } -const reapOwnedProviderGroup = async () => { - if (!child.pid) return false - try { process.kill(-child.pid, 'SIGKILL') } catch (error) { - if (error && error.code !== 'ESRCH') return false - } - const deadline = Date.now() + 1500 +const waitForProviderGroupExit = async (timeoutMs) => { + const deadline = Date.now() + timeoutMs while (providerGroupExists()) { if (Date.now() >= deadline) return false await new Promise((resolve) => setTimeout(resolve, 25)) } return true } -const terminateOwnedGroup = () => { +const reapOwnedProviderGroup = async () => { + if (!child.pid) return false + try { process.kill(-child.pid, 'SIGKILL') } catch (error) { + if (error && error.code !== 'ESRCH') return false + } + return waitForProviderGroupExit(${PROVIDER_GROUP_REAP_TIMEOUT_MS}) +} +const finishWithProviderOutcome = (code, signal) => { + if (!signal) return process.exit(code ?? 1) + // Re-raise with the default action; this supervisor's own handler would swallow it. + process.removeAllListeners(signal) + process.kill(process.pid, signal) +} +// Every stop is the same: SIGTERM the group, SIGKILL it after its grace, and exit only once it is +// gone. Whoever stops this pid judges the provider by it, so a dead supervisor means a dead group. +const stopProviderGroup = (receivedSignal) => { if (settling) return settling = true clearInterval(timer) - void reapOwnedProviderGroup().then((reaped) => process.exit(reaped ? 137 : 1)) + if (ownerShutdownTimer) clearTimeout(ownerShutdownTimer) + try { process.kill(-child.pid, 'SIGTERM') } catch {} + void waitForProviderGroupExit(spec.sigtermGraceMs) + .then((exited) => exited || reapOwnedProviderGroup()) + .then((reaped) => { + if (!reaped) return process.exit(1) + finishWithProviderOutcome(137, receivedSignal) + }) } const scheduleOwnerShutdown = () => { if (settling || ownerShutdownTimer) return // A normal close ends the provider's stdin first; allow it to flush and // exit before forcing the group, while still bounding an orphaned child. - ownerShutdownTimer = setTimeout(terminateOwnedGroup, 1250) + ownerShutdownTimer = setTimeout(() => stopProviderGroup(null), spec.stdinEndGraceMs) ownerShutdownTimer.unref() } process.stdin.once('end', scheduleOwnerShutdown) @@ -56,10 +97,9 @@ process.stdin.once('close', scheduleOwnerShutdown) process.stdin.pipe(child.stdin) child.stdout.pipe(process.stdout) child.stderr.pipe(process.stderr) -for (const stream of [process.stdin, child.stdin, child.stdout, child.stderr]) stream.on('error', () => {}) -const finishWithProviderOutcome = (code, signal) => { - if (!signal) return process.exit(code ?? 1) - process.kill(process.pid, signal) +// A dead owner's stdout pipe raises EPIPE; unhandled, it would end this pid before the group. +for (const stream of [process.stdin, process.stdout, process.stderr, child.stdin, child.stdout, child.stderr]) { + stream.on('error', () => {}) } const reapProviderExit = async (code, signal) => { if (settling) return @@ -70,12 +110,7 @@ const reapProviderExit = async (code, signal) => { finishWithProviderOutcome(code, signal) } timer = setInterval(() => { - // A detached supervisor is reparented when its owner exits. The new parent - // may be PID 1 or a platform subreaper, so any parent change is proof that - // this process group no longer has a live Orca owner. - if (process.ppid !== originalParent) { - terminateOwnedGroup() - } + if (ownerGone()) stopProviderGroup(null) }, 100) timer.unref() child.once('error', () => { @@ -87,16 +122,41 @@ child.once('exit', (code, signal) => { }) ` +export type ProviderSupervisorOptions = { + cwd?: string + /** The process the supervisor serves; it must be the supervisor's parent. */ + ownerPid?: number + stdinEndGraceMs?: number + sigtermGraceMs?: number +} + +// A longer grace than the max stop allows would let recovery or close SIGKILL mid-stop. +function assertGraceWithin(name: string, graceMs: number, maxMs: number): void { + if (!(graceMs >= 0 && graceMs <= maxMs)) { + throw new RangeError(`Provider supervisor ${name} grace ${graceMs} ms is outside 0-${maxMs} ms`) + } +} + export function supervisedPosixLaunch( launch: CodexAppServerLaunch, childEnv: NodeJS.ProcessEnv, - cwd = launch.cwd ?? process.cwd() + { + cwd = launch.cwd ?? process.cwd(), + ownerPid = process.pid, + stdinEndGraceMs = PROVIDER_STDIN_END_GRACE_MS, + sigtermGraceMs = PROVIDER_SIGTERM_GRACE_MS + }: ProviderSupervisorOptions = {} ): { command: string; args: string[]; env: NodeJS.ProcessEnv } { + assertGraceWithin('stdin-end', stdinEndGraceMs, PROVIDER_STDIN_END_GRACE_MS) + assertGraceWithin('SIGTERM', sigtermGraceMs, PROVIDER_SIGTERM_GRACE_MS) const supervisorSpec = Buffer.from( JSON.stringify({ command: launch.command, args: launch.args, - cwd + cwd, + ownerPid, + stdinEndGraceMs, + sigtermGraceMs }) ).toString('base64') return { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-eviction.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-eviction.ts index 2c03143ff417..226781117bdf 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-eviction.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-eviction.ts @@ -52,7 +52,7 @@ export type StructuredAgentSessionEvictionContext = { } /** The resume offer is advisory; a stalled sink must not hold the child's stop behind it. */ -const SNAPSHOT_DRAIN_TIMEOUT_MS = 1_000 +export const SNAPSHOT_DRAIN_TIMEOUT_MS = 1_000 export type StructuredAgentSessionEvictionStep = { name: string diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.test.ts index 5fd0440a1fe1..760b2603d99c 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.test.ts @@ -1,5 +1,13 @@ import { describe, expect, it, vi } from 'vitest' -import { structuredAgentSessionHostTeardownPhases } from './structured-agent-session-host-teardown' +import { PROVIDER_SUPERVISOR_MAX_STOP_MS } from '../../codex/codex-app-server-posix-supervisor' +import { SNAPSHOT_DRAIN_TIMEOUT_MS } from './structured-agent-session-eviction' +import { + CHILD_EVICTION_TIMEOUT_MS, + structuredAgentSessionHostTeardownPhases +} from './structured-agent-session-host-teardown' + +// Codex close observes the supervisor's exit after its timers fire, which run late on a loaded host. +const SUPERVISOR_EXIT_OBSERVATION_HEADROOM_MS = 1_000 describe('structured agent-session host teardown', () => { it('names every phase, so the quit-path order is pinned rather than incidental', () => { @@ -23,6 +31,16 @@ describe('structured agent-session host teardown', () => { ]) }) + it("fits the Codex supervisor's longest stop inside quit's child-eviction bound", () => { + // A quit that times out first leaves the provider running and its lease unreleased. Eviction + // drains the sink for the resume offer before it stops the child, inside the same bound. + expect( + SNAPSHOT_DRAIN_TIMEOUT_MS + + PROVIDER_SUPERVISOR_MAX_STOP_MS + + SUPERVISOR_EXIT_OBSERVATION_HEADROOM_MS + ).toBeLessThan(CHILD_EVICTION_TIMEOUT_MS) + }) + it('bounds stalled recovery publication without preventing later cleanup', async () => { vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) const warning = vi.spyOn(console, 'warn').mockImplementation(() => {}) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.ts index 97a27d5c246c..eade95a7dd2c 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.ts @@ -28,7 +28,7 @@ const RESUME_MARKER_RECORD_TIMEOUT_MS = 2_000 /** Eight steps at ten seconds each would outlast the global quit deadline, and a quit that dies * mid-eviction leaves the lease unreleased — the exact state restart has to clean up. Bounded * well below that deadline so the phases after this one still get to run. */ -const CHILD_EVICTION_TIMEOUT_MS = 8_000 +export const CHILD_EVICTION_TIMEOUT_MS = 8_000 /** Bounds a phase without swallowing its failure, which `withTimeout` alone would. */ async function withPhaseTimeout(run: () => Promise, timeoutMs: number): Promise { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.test.ts index 7fbd785894d8..063e8c64af71 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.test.ts @@ -1,3 +1,4 @@ +import { spawn } from 'node:child_process' import { mkdtemp, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' @@ -8,6 +9,7 @@ import { writeOlderBuildLease } from '../../runtime/agent-session-older-build-lease.test-fixture' import { AgentSessionRecordStore } from '../../runtime/agent-session-record-store' +import { supervisedPosixLaunch } from '../../codex/codex-app-server-posix-supervisor' import { resolveStructuredSessionRecovery, type StructuredSessionRecoveryResolutionDeps @@ -62,7 +64,7 @@ async function reserve(store: AgentSessionRecordStore) { }) } -async function liveOwner(store: AgentSessionRecordStore) { +async function liveOwner(store: AgentSessionRecordStore, pid = 4242) { const reserved = await reserve(store) const fence = reserved.record.lease.runtimeFence await store.commitProcessIdentity({ @@ -70,7 +72,7 @@ async function liveOwner(store: AgentSessionRecordStore) { fence, process: { hostId: 'local', - pid: 4242, + pid, processStartTimeMs: NOW - 1_000, spawnToken: 'spawn-recovery' }, @@ -302,3 +304,72 @@ describe('structured session recovery resolution', () => { ).toBe('not-applicable') }) }) + +describe.runIf(process.platform !== 'win32')( + 'structured session recovery of a supervised owner', + () => { + const recordedPids: number[] = [] + const alive = (pid: number): boolean => { + try { + process.kill(pid, 0) + return true + } catch (error) { + return !(error instanceof Error && 'code' in error && error.code === 'ESRCH') + } + } + + afterEach(() => { + for (const pid of recordedPids.splice(0)) { + if (alive(pid)) { + process.kill(pid, 'SIGKILL') + } + } + }) + + it('evicts only after the supervisor has reaped a provider that ignores SIGTERM', async () => { + const launch = supervisedPosixLaunch( + { + command: process.execPath, + args: [ + '-e', + "process.on('SIGTERM', () => {}); process.stdout.write(process.pid + '\\n'); setInterval(() => {}, 60000)" + ] + }, + process.env + ) + const supervisor = spawn(launch.command, launch.args, { + env: launch.env, + stdio: ['pipe', 'pipe', 'ignore'], + detached: true + }) + recordedPids.push(supervisor.pid!) + const provider = await new Promise((resolve, reject) => { + const timeout = setTimeout(() => reject(new Error('provider never started')), 10_000) + supervisor.stdout.once('data', (chunk: Buffer) => { + clearTimeout(timeout) + resolve(Number(chunk.toString().trim())) + }) + }) + recordedPids.push(provider) + const store = await openStore() + await liveOwner(store, supervisor.pid!) + await latch(store) + + const result = await resolveStructuredSessionRecovery( + { + store, + // The recorded pid is the supervisor's; its absence is the proof recovery evicts on. + probeRecord: async () => + alive(supervisor.pid!) ? MATCHED : { outcome: 'pid-absent' as const }, + now: () => NOW + 10_000 + }, + SESSION + ) + + expect(result).toBe('resolved') + // Evicted on proof of death, which must hold for the provider too, not only the supervisor. + expect(store.getRecord(SESSION)?.lease.deathEvidence).not.toBeNull() + expect(alive(provider)).toBe(false) + }) + } +) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.ts index 5e04cbdf90ef..36d950a09a48 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.ts @@ -15,6 +15,7 @@ import { type AgentSessionOwnerProbe } from '../../../shared/agent-session-lease-adjudication' import type { AgentSessionRecord } from '../../../shared/agent-session-record' +import { PROVIDER_SUPERVISOR_MAX_STOP_MS } from '../../codex/codex-app-server-posix-supervisor' import { releaseUnprovenAgentSessionOwner } from '../../runtime/agent-session-lease-transitions' import type { AgentSessionRecordStore } from '../../runtime/agent-session-record-store' @@ -28,8 +29,13 @@ export type StructuredSessionRecoveryResolutionDeps = { delay?: (ms: number) => Promise } -const STOP_PROBES_PER_SIGNAL = 4 const STOP_PROBE_INTERVAL_MS = 250 +// A POSIX Codex owner is its provider supervisor, which exits only after its provider group. A +// SIGKILL that lands first leaves the group running, so SIGTERM outlasts the supervisor's stop. +const STOP_PROBES: Record = { + SIGTERM: Math.ceil(PROVIDER_SUPERVISOR_MAX_STOP_MS / STOP_PROBE_INTERVAL_MS) + 1, + SIGKILL: 4 +} const UNRESOLVED_REFUSALS: ReadonlySet = new Set([ 'agent_session_ownership_unknown', @@ -94,7 +100,7 @@ async function stopOwnerAndReprobe( let probe: AgentSessionOwnerProbe = { outcome: 'indeterminate', reason: 'owner stop requested' } for (const signal of ['SIGTERM', 'SIGKILL'] as const) { stop(pid, signal) - for (let attempt = 0; attempt < STOP_PROBES_PER_SIGNAL; attempt += 1) { + for (let attempt = 0; attempt < STOP_PROBES[signal]; attempt += 1) { probe = await deps.probeRecord(record) if (isProvenDeadProbe(probe)) { return probe From d68eee37576ec2327f16adfcd3526b6ad61fa58c Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:12:26 -0700 Subject: [PATCH 40/90] fix(runtime): retire an exited terminal before its stream end (#23492) * fix(runtime): retire an exited terminal before its stream end An exit's durable retirement became asynchronous, so onPtyExit released the terminal stream before the retirement landed. A paired client answers a stream end by re-activating its pane; that activation still found the exited leaf, materialized it under the same session id, and registerPty dropped the pending retirement. The exited split pane came back as a fresh shell. The exit now stages the retirement into the in-memory session and publishes it synchronously, then notifies exit listeners, and only then makes it durable. A failed durable write is logged and left in memory for the next profile write instead of being rolled back, since the process is gone either way. This removes the pending-retirement latch and its post-await incarnation fence: there is no longer a window for them to guard. * test(runtime): a failed exit retirement still reaches disk Pins the no-rollback contract through a real Store and SQLite authority: when the retirement's own durable write fails, the in-memory retirement is carried by the next unrelated profile write, and by the app-quit flush when no other write happens. The delayed authority fixture can now fail its next write, and the acknowledged-retirement fixture reads the database a relaunch would load and models the quit flush. * test(runtime): a stream end observes the exit retirement already published The re-activation check alone passes with the listener ordering reverted, because activation awaits before its lookup. Record the session binding and publication count at the moment the exit listener fires so the ordering itself is pinned. * fix(runtime): an exit cleanup fault still ends the terminal stream * perf(runtime): exits retired together share one durable write * test(runtime): a refused staging write still retires the pane and ends the stream * refactor(runtime): describe exit retirement as staged, not durably accepted The retirement result is staged in memory before any write, and the removable-surface comment and the replacement-admission test name still described the old publish-after-durable rule. --- config/reliability-gates.jsonc | 2 +- ...-host-admitted-terminal-membership.test.ts | 2 +- ...profile-state-delayed-authority-fixture.ts | 23 +- ...retirement-publication-during-read.test.ts | 9 +- ...wledged-terminal-tab-retirement-fixture.ts | 24 +- .../orca-runtime-fit-override-listeners.ts | 1 - ...-runtime-invalidate-all-handles-for-pty.ts | 1 - src/main/runtime/orca-runtime-on-pty-exit.ts | 319 +++++++++--------- ...me-persist-terminal-surface-retirements.ts | 129 +++---- src/main/runtime/orca-runtime-register-pty.ts | 1 - .../orca-runtime-terminal-retirement.test.ts | 20 +- .../exit-retirement-activation.spec.ts | 148 ++++++++ src/main/runtime/orca-runtime.test.ts | 1 + ...rminal-retirement-async-durability.test.ts | 63 +++- 14 files changed, 472 insertions(+), 271 deletions(-) create mode 100644 src/main/runtime/orca-runtime-tests/exit-retirement-activation.spec.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index e100d54e17a7..4e4443354fa7 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -8856,7 +8856,7 @@ "Windows ConPTY, SSH-hosted PTYs, app-quit killAll, and daemon dispose retain foreground-tree-only teardown.", "A process born in the capture second is SIGTERMed but not SIGKILLed because ps cannot prove its recycled-PID identity.", "A descendant orphaned before or during root ownership loss requires the separate crash-orphan sweep and is not recovered from a stale kill-time snapshot.", - "recordTerminalSurfaceRetirement advances the INCOMING session's terminal topology revision, so a tombstoned close whose write carries a revision at or below the store's own is rebased away instead of persisting. Pre-existing for every repo already past revision 0 and unchanged by the host-admitted membership fix, which only makes more repos reach that state sooner; the authoritative close path (persistTerminalSurfaceRetirements) computes from the store's session and is unaffected. Known, unaddressed, and deliberately out of scope here: the safe correction is per-tab rather than per-worktree rebase arbitration, because raising the incoming revision wholesale would re-open the host-tab loss whenever a close coincides with a host create.", + "recordTerminalSurfaceRetirement advances the INCOMING session's terminal topology revision, so a tombstoned close whose write carries a revision at or below the store's own is rebased away instead of persisting. Pre-existing for every repo already past revision 0 and unchanged by the host-admitted membership fix, which only makes more repos reach that state sooner; the authoritative close path (stageTerminalSurfaceRetirements) computes from the store's session and is unaffected. Known, unaddressed, and deliberately out of scope here: the safe correction is per-tab rather than per-worktree rebase arbitration, because raising the incoming revision wholesale would re-open the host-tab loss whenever a close coincides with a host create.", "The SSH relay reattach binding (src/main/ssh/ssh-relay-session.ts persistPtyBinding) is NOT flagged host-admitted, so a lease rebind that has to mint a missing tab raises no fence. It rebinds an existing lease rather than admitting a new surface, so it is believed not to need one, but that was not established either way. Known, unaddressed, and deliberately out of scope here.", "The host-created retention journey is macOS-local; the reported incident was on a physical Windows host, which we did not run against." ], diff --git a/src/main/persistence-host-admitted-terminal-membership.test.ts b/src/main/persistence-host-admitted-terminal-membership.test.ts index 3470215a5152..83a6898c6671 100644 --- a/src/main/persistence-host-admitted-terminal-membership.test.ts +++ b/src/main/persistence-host-admitted-terminal-membership.test.ts @@ -136,7 +136,7 @@ describe('host-admitted terminal membership survives a stale renderer replay', ( }) // Closing must still work afterwards. Closes are host-driven: the retirement is - // computed from the store's own session (see persistTerminalSurfaceRetirements), + // computed from the store's own session (see stageTerminalSurfaceRetirements), // which is what outranks the fence this create just raised. it('still lets the authoritative retirement path close the host-admitted tab', async () => { const store = await createStore() diff --git a/src/main/persistence/loading-store/profile-state-delayed-authority-fixture.ts b/src/main/persistence/loading-store/profile-state-delayed-authority-fixture.ts index cebd91b05389..26709b33e3fa 100644 --- a/src/main/persistence/loading-store/profile-state-delayed-authority-fixture.ts +++ b/src/main/persistence/loading-store/profile-state-delayed-authority-fixture.ts @@ -29,12 +29,18 @@ export class DelayedAuthority implements AsyncProfileStateAuthority { | { started: ReturnType>; finish: ReturnType> } | undefined readonly captures: ProfileStateDomainReplacement[][] = [] + private failNext = false readonly close = vi.fn(async () => { this.inner.close() }) constructor(readonly inner: ProfileStateSqliteAuthority) {} + /** Fail the next profile write the way a full disk would, after any paused gate opens. */ + failNextWrite() { + this.failNext = true + } + pause() { const gate = { started: deferred(), finish: deferred() } this.next = gate @@ -51,17 +57,17 @@ export class DelayedAuthority implements AsyncProfileStateAuthority { } async writeSerializedState(payload: Buffer) { const captured = Buffer.from(payload) - await this.dispatch(() => this.inner.writeSerializedState(captured)) + await this.dispatch(() => this.inner.writeSerializedState(captured), true) } async writeSerializedDomains(replacements: readonly ProfileStateDomainReplacement[]) { const captured = structuredClone(replacements) this.captures.push([...captured]) - await this.dispatch(() => this.inner.writeSerializedDomains(captured)) + await this.dispatch(() => this.inner.writeSerializedDomains(captured), true) } async writeCompleteSerializedDomains(replacements: readonly ProfileStateDomainReplacement[]) { const captured = structuredClone(replacements) this.captures.push([...captured]) - await this.dispatch(() => this.inner.writeCompleteSerializedDomains(captured)) + await this.dispatch(() => this.inner.writeCompleteSerializedDomains(captured), true) } async writeSerializedAutomationRuns( replacements: readonly ProfileStateDomainReplacement[], @@ -69,7 +75,10 @@ export class DelayedAuthority implements AsyncProfileStateAuthority { ) { const captured = structuredClone(replacements) const capturedRuns = structuredClone(runs) - await this.dispatch(() => this.inner.writeSerializedAutomationRuns(captured, capturedRuns)) + await this.dispatch( + () => this.inner.writeSerializedAutomationRuns(captured, capturedRuns), + true + ) } async writeJsonExport(path: string) { return this.inner.writeJsonExport(path) @@ -83,11 +92,15 @@ export class DelayedAuthority implements AsyncProfileStateAuthority { async quarantineDatabase(root?: string, reason?: string) { return this.inner.quarantineDatabase(root, reason) } - private async dispatch(operation: () => void) { + private async dispatch(operation: () => void, write = false) { const gate = this.next this.next = undefined gate?.started.resolve() await gate?.finish.promise + if (write && this.failNext) { + this.failNext = false + throw new Error('profile_state_write_failed') + } operation() } } diff --git a/src/main/persistence/loading-store/pty-retirement-publication-during-read.test.ts b/src/main/persistence/loading-store/pty-retirement-publication-during-read.test.ts index dd6754c1d73d..34b6e742804e 100644 --- a/src/main/persistence/loading-store/pty-retirement-publication-during-read.test.ts +++ b/src/main/persistence/loading-store/pty-retirement-publication-during-read.test.ts @@ -29,9 +29,6 @@ class RetirementRuntime extends OrcaRuntimeService { generations(): number { return this.ptyLifecycleGenerationById.size } - retirements(): number { - return this.pendingPtySurfaceRetirementsByPtyId.size - } async closeTab(): Promise { const snapshot = this.snapshot() const tab = snapshot?.tabs[0] @@ -96,10 +93,8 @@ it.each(['read', 'replacement', 'legacy-replacement'] as const)( gate.finish.resolve() await exiting expect(readState().workspaceSession.terminalLayoutsByTabId[binding.tabId]).toBeUndefined() - expect(runtime.snapshot()?.tabs).toHaveLength(action === 'read' ? 0 : 1) - if (action === 'read') { - expect(runtime.retirements()).toBe(0) - } + // Why every action: the exit retired the leaf in memory before any of them could run. + expect(runtime.snapshot()?.tabs).toHaveLength(0) } ) diff --git a/src/main/runtime/acknowledged-terminal-tab-retirement-fixture.ts b/src/main/runtime/acknowledged-terminal-tab-retirement-fixture.ts index 51cd8b4cd8bf..12b3340d2ac4 100644 --- a/src/main/runtime/acknowledged-terminal-tab-retirement-fixture.ts +++ b/src/main/runtime/acknowledged-terminal-tab-retirement-fixture.ts @@ -3,6 +3,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { vi } from 'vitest' import { getDefaultWorkspaceSession } from '../../shared/constants' +import type { PersistedState } from '../../shared/persisted-state-types' import type { RuntimeSyncWindowGraph } from '../../shared/runtime-types' import { closeTerminalTabInWorkspaceSession } from '../../shared/workspace-session-terminal-tab-close' import { ProfileStateSqliteAuthority } from '../persistence/profile-state/profile-state-sqlite-authority' @@ -30,8 +31,9 @@ function deferred(): { promise: Promise; resolve: () => void } { export function createAcknowledgedTabRetirementFixture(bound = false) { const directory = mkdtempSync(join(tmpdir(), 'orca-close-ack-')) + const databasePath = join(directory, 'profile-state.db') const authority = new DelayedAuthority( - new ProfileStateSqliteAuthority(join(directory, 'profile-state.db'), 'ack-retirement') + new ProfileStateSqliteAuthority(databasePath, 'ack-retirement') ) const store = new Store({ dataFile: join(directory, 'orca-data.json'), @@ -149,6 +151,7 @@ export function createAcknowledgedTabRetirementFixture(bound = false) { store.setWorkspaceSession( advanceTerminalTopologyRevision(store.getWorkspaceSession(), ACK_WORKTREE) ) + let finalFlush: Promise | undefined const entered = deferred() const acknowledgement = deferred() const closeTerminalTab = vi.fn(async () => { @@ -184,15 +187,30 @@ export function createAcknowledgedTabRetirementFixture(bound = false) { acknowledgement, closeTerminalTab, publish, + /** Reads what a relaunch would load, independent of the store's in-memory state. */ + readDisk: (): PersistedState => { + const reader = new ProfileStateSqliteAuthority(databasePath, 'ack-retirement') + try { + return JSON.parse(reader.readSerializedState() ?? '{}') + } finally { + reader.close() + } + }, hasTab: () => store.getWorkspaceSession().tabsByWorktree[ACK_WORKTREE].some((tab) => tab.id === ACK_TAB), close: (options: { force?: boolean } = {}) => runtime.closeMobileSessionTab(`id:${ACK_WORKTREE}`, ACK_TAB, { reason: 'user', ...options }), + /** The app-quit flush; it finalizes persistence, so dispose must not flush again. */ + quit: () => (finalFlush ??= store.flushFinalOrThrowAsync()), dispose: async () => { runtime.setNotifier(null) runtime.syncWindowGraph(1, { tabs: [], leaves: [], mobileSessionTabs: [] }) - await store.flushPendingOrThrowAsync() - await store.freezeWritesAsync() + if (finalFlush) { + await finalFlush + } else { + await store.flushPendingOrThrowAsync() + await store.freezeWritesAsync() + } setRuntimeDesktopSurface(null) rmSync(directory, { recursive: true, force: true }) } diff --git a/src/main/runtime/orca-runtime-fit-override-listeners.ts b/src/main/runtime/orca-runtime-fit-override-listeners.ts index 6d4242d77587..5ef17ce4c2ea 100644 --- a/src/main/runtime/orca-runtime-fit-override-listeners.ts +++ b/src/main/runtime/orca-runtime-fit-override-listeners.ts @@ -74,7 +74,6 @@ export class OrcaRuntimeWithFitOverrideListeners extends OrcaRuntimeWithStopRequ protected providerSnapshotsWithLiveModeTransition = new WeakSet() protected ptyLifecycleGenerationById = new Map() - protected pendingPtySurfaceRetirementsByPtyId = new Map() protected nextPtyLifecycleGeneration = 1 diff --git a/src/main/runtime/orca-runtime-invalidate-all-handles-for-pty.ts b/src/main/runtime/orca-runtime-invalidate-all-handles-for-pty.ts index a348309a5689..9d6e5d56ca4b 100644 --- a/src/main/runtime/orca-runtime-invalidate-all-handles-for-pty.ts +++ b/src/main/runtime/orca-runtime-invalidate-all-handles-for-pty.ts @@ -140,7 +140,6 @@ export class OrcaRuntimeWithInvalidateAllHandlesForPty extends OrcaRuntimeWithRe options: { awaitsRegistration?: boolean } = {} ): void { this.invalidatePtyControllerInventoryForLifecycle(ptyId) - this.pendingPtySurfaceRetirementsByPtyId.delete(ptyId) const existingPty = this.ptysById.get(ptyId) if ( existingPty && diff --git a/src/main/runtime/orca-runtime-on-pty-exit.ts b/src/main/runtime/orca-runtime-on-pty-exit.ts index 52b7024b8181..abcf2fcf57f4 100644 --- a/src/main/runtime/orca-runtime-on-pty-exit.ts +++ b/src/main/runtime/orca-runtime-on-pty-exit.ts @@ -68,171 +68,172 @@ export class OrcaRuntimeWithOnPtyExit extends OrcaRuntimeWithOnClientDisconnecte pty?.incarnationId ?? `runtime:${this.runtimeId}:${this.getPtyLifecycleGeneration(ptyId)}` this.advancePtyLifecycleGeneration(ptyId) - this.notifyPtyExitListeners(ptyId) - const exactSurfaceByKey = new Map< - string, - Pick - >() - for (const [worktreeId, snapshot] of this.mobileSessionTabsByWorktree) { - for (const tab of snapshot.tabs) { - if ( - tab.type === 'terminal' && - (tab.ptyId === ptyId || tab.parentLayout?.ptyIdsByLeafId?.[tab.leafId] === ptyId) - ) { - exactSurfaceByKey.set(`${worktreeId}\0${tab.parentTabId}\0${tab.leafId}`, { - worktreeId, - parentTabId: tab.parentTabId, - leafId: tab.leafId - }) + let retirement: Promise | undefined + try { + const exactSurfaceByKey = new Map< + string, + Pick + >() + for (const [worktreeId, snapshot] of this.mobileSessionTabsByWorktree) { + for (const tab of snapshot.tabs) { + if ( + tab.type === 'terminal' && + (tab.ptyId === ptyId || tab.parentLayout?.ptyIdsByLeafId?.[tab.leafId] === ptyId) + ) { + exactSurfaceByKey.set(`${worktreeId}\0${tab.parentTabId}\0${tab.leafId}`, { + worktreeId, + parentTabId: tab.parentTabId, + leafId: tab.leafId + }) + } } } - } - for (const leaf of this.getLeavesForPty(ptyId)) { - exactSurfaceByKey.set(`${leaf.worktreeId}\0${leaf.tabId}\0${leaf.leafId}`, { - worktreeId: leaf.worktreeId, - parentTabId: leaf.tabId, - leafId: leaf.leafId - }) - } - const parsedPaneKey = parsePaneKey(pty?.paneKey ?? '') - if (pty?.tabId && parsedPaneKey) { - exactSurfaceByKey.set(`${pty.worktreeId}\0${pty.tabId}\0${parsedPaneKey.leafId}`, { - worktreeId: pty.worktreeId, - parentTabId: pty.tabId, - leafId: parsedPaneKey.leafId - }) - } - const exactSurfaces = [...exactSurfaceByKey.values()] - const pendingIncarnation = this.pendingPtyRegistrationIncarnations.get(ptyId) - const exitMatchesPendingRegistration = - this.pendingPtyRegistrationIncarnations.has(ptyId) && - (pendingIncarnation === null || - exitIncarnationId === null || - exitIncarnationId === undefined || - pendingIncarnation === exitIncarnationId) - if (exitMatchesPendingRegistration) { - // Why: reused surfaces can look registered while their replacement incarnation still awaits admission. - this.earlyExitedPtyIncarnations.set( - ptyId, - exitIncarnationId ?? pendingIncarnation ?? pty?.incarnationId ?? null - ) - } - // Why both kinds: a sleep keeps its wake hint, and a restart's replacement takes the pane. - const preservesIntentionallyStoppedSurface = - this.intentionalPtyStops.claimExit(ptyId, exitIncarnationId ?? pty?.incarnationId).length > 0 - advertisedUrlWatcher.unbindPty(ptyId) - // Clean up new mobile state for this PTY - this.mobileSubscribers.delete(ptyId) - this.terminalViewSubscribers.clearSubscribers(ptyId) - this.mobileDisplayModes.delete(ptyId) - this.resizeListeners.delete(ptyId) - this.lastRendererSizes.delete(ptyId) - this.recentPtyOutputById.delete(ptyId) - this.setupCompletionTokenByPtyId.delete(ptyId) - this.clearWaitBlockedCheckState(ptyId) - this.recentPtyPathCandidatesById.delete(ptyId) - this.ptyOutputSequenceById.delete(ptyId) - this.providerSequenceInitializedPtys.delete(ptyId) - this.providerSequenceOffsetByPtyId.delete(ptyId) - this.providerSnapshotPreferredPtys.delete(ptyId) - this.providerModeTrackersByPtyId.delete(ptyId) - this.providerModeSnapshotScansByPtyId.delete(ptyId) - this.providerBufferAcquisitionsByPtyId.delete(ptyId) - this.providerVisibleStateByPtyId.delete(ptyId) - this.providerVisibleRetryAtByPtyId.delete(ptyId) - this.agentPromptExplicitStatusFloorByPtyId.delete(ptyId) - this.ptyLifecycleGenerationById.delete(ptyId) - this.pendingPtySurfaceRetirementsByPtyId.delete(ptyId) - this.agentStatusOscProcessorsByPtyId.delete(ptyId) - this.terminalSpawnCommandsByPtyId.delete(ptyId) - this.disposePtyTitleTracker(ptyId) - this.oscTitleScanTailByPtyId.delete(ptyId) - this.osc7ScanTailByPtyId.delete(ptyId) - this.terminalCwdByPtyId.delete(ptyId) - this.terminalFileUriHostnameByPtyId.delete(ptyId) - this.wslDistroByPtyId.delete(ptyId) - // Why: a Claude agent-team leader whose PTY exits naturally (agent finished, - // process died, renderer reload) must release its team + nested panes map. - // Previously only explicit closeTerminal evicted it, so natural exits leaked - // one team per never-reused teamId for the runtime's lifetime. - const exitedTeamLeaderHandle = this.handleByPtyId.get(ptyId) - if (exitedTeamLeaderHandle) { - this.claudeAgentTeams.removeTeamForLeaderHandle(exitedTeamLeaderHandle) - } - // Layout state machine: clear `layouts` and `layoutQueues`. Any - // already-queued applyLayout work for this ptyId will run, but every - // applyLayout re-checks `layouts.has(ptyId)` (or fresh-subscribe) and - // short-circuits with `pty-exited`. - this.layouts.delete(ptyId) - this.layoutQueues.delete(ptyId) - this.freshSubscribeGuard.delete(ptyId) - this.cancelPendingDriverMutations(ptyId) - // Why: a cold restore can respawn under the same session id within the - // delayed-Enter window; the armed Enter would inject \r into the - // replacement and stamp rows it never received. - this.orchestrationMailboxNotifications.retirePty(ptyId) - // Why: the dead pty's terminal handle and any run bound to its panes still carry mailbox - // pointers; schedule a debounced repoint so they do not stay aimed at a retired session. - for (const leaf of this.getLeavesForPty(ptyId)) { - const mailboxHandle = this.handleByLeafKey.get(this.getLeafKey(leaf.tabId, leaf.leafId)) - if (mailboxHandle) { - this.mailPointerRepointScheduler.schedule(mailboxHandle) + for (const leaf of this.getLeavesForPty(ptyId)) { + exactSurfaceByKey.set(`${leaf.worktreeId}\0${leaf.tabId}\0${leaf.leafId}`, { + worktreeId: leaf.worktreeId, + parentTabId: leaf.tabId, + leafId: leaf.leafId + }) } - const boundRun = this._orchestrationDb?.getCurrentRunForPane?.(`${leaf.tabId}:${leaf.leafId}`) - if (boundRun) { - this.mailPointerRepointScheduler.schedule(`run:${boundRun.id}`) + const parsedPaneKey = parsePaneKey(pty?.paneKey ?? '') + if (pty?.tabId && parsedPaneKey) { + exactSurfaceByKey.set(`${pty.worktreeId}\0${pty.tabId}\0${parsedPaneKey.leafId}`, { + worktreeId: pty.worktreeId, + parentTabId: pty.tabId, + leafId: parsedPaneKey.leafId + }) + } + const exactSurfaces = [...exactSurfaceByKey.values()] + const pendingIncarnation = this.pendingPtyRegistrationIncarnations.get(ptyId) + const exitMatchesPendingRegistration = + this.pendingPtyRegistrationIncarnations.has(ptyId) && + (pendingIncarnation === null || + exitIncarnationId === null || + exitIncarnationId === undefined || + pendingIncarnation === exitIncarnationId) + if (exitMatchesPendingRegistration) { + // Why: reused surfaces can look registered while their replacement incarnation still awaits admission. + this.earlyExitedPtyIncarnations.set( + ptyId, + exitIncarnationId ?? pendingIncarnation ?? pty?.incarnationId ?? null + ) + } + // Why both kinds: a sleep keeps its wake hint, and a restart's replacement takes the pane. + const preservesIntentionallyStoppedSurface = + this.intentionalPtyStops.claimExit(ptyId, exitIncarnationId ?? pty?.incarnationId).length > + 0 + advertisedUrlWatcher.unbindPty(ptyId) + // Clean up new mobile state for this PTY + this.mobileSubscribers.delete(ptyId) + this.terminalViewSubscribers.clearSubscribers(ptyId) + this.mobileDisplayModes.delete(ptyId) + this.resizeListeners.delete(ptyId) + this.lastRendererSizes.delete(ptyId) + this.recentPtyOutputById.delete(ptyId) + this.setupCompletionTokenByPtyId.delete(ptyId) + this.clearWaitBlockedCheckState(ptyId) + this.recentPtyPathCandidatesById.delete(ptyId) + this.ptyOutputSequenceById.delete(ptyId) + this.providerSequenceInitializedPtys.delete(ptyId) + this.providerSequenceOffsetByPtyId.delete(ptyId) + this.providerSnapshotPreferredPtys.delete(ptyId) + this.providerModeTrackersByPtyId.delete(ptyId) + this.providerModeSnapshotScansByPtyId.delete(ptyId) + this.providerBufferAcquisitionsByPtyId.delete(ptyId) + this.providerVisibleStateByPtyId.delete(ptyId) + this.providerVisibleRetryAtByPtyId.delete(ptyId) + this.agentPromptExplicitStatusFloorByPtyId.delete(ptyId) + this.ptyLifecycleGenerationById.delete(ptyId) + this.agentStatusOscProcessorsByPtyId.delete(ptyId) + this.terminalSpawnCommandsByPtyId.delete(ptyId) + this.disposePtyTitleTracker(ptyId) + this.oscTitleScanTailByPtyId.delete(ptyId) + this.osc7ScanTailByPtyId.delete(ptyId) + this.terminalCwdByPtyId.delete(ptyId) + this.terminalFileUriHostnameByPtyId.delete(ptyId) + this.wslDistroByPtyId.delete(ptyId) + // Why: a Claude agent-team leader whose PTY exits naturally (agent finished, + // process died, renderer reload) must release its team + nested panes map. + // Previously only explicit closeTerminal evicted it, so natural exits leaked + // one team per never-reused teamId for the runtime's lifetime. + const exitedTeamLeaderHandle = this.handleByPtyId.get(ptyId) + if (exitedTeamLeaderHandle) { + this.claudeAgentTeams.removeTeamForLeaderHandle(exitedTeamLeaderHandle) + } + // Layout state machine: clear `layouts` and `layoutQueues`. Any + // already-queued applyLayout work for this ptyId will run, but every + // applyLayout re-checks `layouts.has(ptyId)` (or fresh-subscribe) and + // short-circuits with `pty-exited`. + this.layouts.delete(ptyId) + this.layoutQueues.delete(ptyId) + this.freshSubscribeGuard.delete(ptyId) + this.cancelPendingDriverMutations(ptyId) + // Why: a cold restore can respawn under the same session id within the + // delayed-Enter window; the armed Enter would inject \r into the + // replacement and stamp rows it never received. + this.orchestrationMailboxNotifications.retirePty(ptyId) + // Why: the dead pty's terminal handle and any run bound to its panes still carry mailbox + // pointers; schedule a debounced repoint so they do not stay aimed at a retired session. + for (const leaf of this.getLeavesForPty(ptyId)) { + const mailboxHandle = this.handleByLeafKey.get(this.getLeafKey(leaf.tabId, leaf.leafId)) + if (mailboxHandle) { + this.mailPointerRepointScheduler.schedule(mailboxHandle) + } + const boundRun = this._orchestrationDb?.getCurrentRunForPane?.( + `${leaf.tabId}:${leaf.leafId}` + ) + if (boundRun) { + this.mailPointerRepointScheduler.schedule(`run:${boundRun.id}`) + } } - } - if (this.terminalFitOverrides.has(ptyId)) { - this.terminalFitOverrides.delete(ptyId) - this.notifier?.terminalFitOverrideChanged(ptyId, 'desktop-fit', 0, 0) - this.notifyFitOverrideListeners(ptyId, 'desktop-fit', 0, 0) - } - // Why: clear driver state and notify the renderer so any lock banner on - // this dead pane unmounts. Without this, the pane shows a stuck banner - // until tab teardown, and `getDriver(deadPtyId)` would keep returning a - // stale `mobile{X}` to any caller that hasn't yet seen the exit IPC. - this.terminalDrivers.clear(ptyId) - this.remoteDesktopFloor.clearPty(ptyId) - this.disposeHeadlessTerminal(ptyId) - if (processDeathCertified) { - // The bounded verdict register also fences late graphs after the PTY record was pruned. - this.rememberPtyLivenessVerdict(ptyId, { status: 'exited' }) - } - if (pty) { - pty.connected = false - pty.runtimeSessionOwned = false - this.setPairedRendererSessionOwnership(pty.ptyId, false) - pty.disconnectedAt = Date.now() - pty.lastExitCode = exitCode - pty.lastExitCause = exitCause - // Why: the exited process's live frames say nothing about a replacement. - // A same-id respawn makes the leaf writable again before any new title, - // so leaving this true would let push delivery type into the new process - // on the dead one's idle. lastAgentStatus itself stays for `ps` display. - pty.lastAgentStatusObservedLive = false - this.resolvePtyExitWaiters(pty, ptyId) - this.pruneDisconnectedPtyTranscript(pty) - } - let retirement: Promise | undefined - if (preservesIntentionallyStoppedSurface || preservesAbnormalSshSurface) { - // Why: relay loss is recoverable; keep the HUB-owned pane addressable through the bounded reconnect grace. - this.touchMobileSessionSnapshotsForPty(ptyId, { immediate: true }) - } else { - // Why: permanent process exit is absence, not a starting/sleeping tab. - // Retire before publishing so paired clients never persist a ghost. - const pendingRetirement = {} - this.pendingPtySurfaceRetirementsByPtyId.set(ptyId, pendingRetirement) - retirement = this.retireMobileSessionSurfacesForPty(ptyId, incarnationId, exactSurfaces) - .catch((error) => { + if (this.terminalFitOverrides.has(ptyId)) { + this.terminalFitOverrides.delete(ptyId) + this.notifier?.terminalFitOverrideChanged(ptyId, 'desktop-fit', 0, 0) + this.notifyFitOverrideListeners(ptyId, 'desktop-fit', 0, 0) + } + // Why: clear driver state and notify the renderer so any lock banner on + // this dead pane unmounts. Without this, the pane shows a stuck banner + // until tab teardown, and `getDriver(deadPtyId)` would keep returning a + // stale `mobile{X}` to any caller that hasn't yet seen the exit IPC. + this.terminalDrivers.clear(ptyId) + this.remoteDesktopFloor.clearPty(ptyId) + this.disposeHeadlessTerminal(ptyId) + if (processDeathCertified) { + // The bounded verdict register also fences late graphs after the PTY record was pruned. + this.rememberPtyLivenessVerdict(ptyId, { status: 'exited' }) + } + if (pty) { + pty.connected = false + pty.runtimeSessionOwned = false + this.setPairedRendererSessionOwnership(pty.ptyId, false) + pty.disconnectedAt = Date.now() + pty.lastExitCode = exitCode + pty.lastExitCause = exitCause + // Why: the exited process's live frames say nothing about a replacement. + // A same-id respawn makes the leaf writable again before any new title, + // so leaving this true would let push delivery type into the new process + // on the dead one's idle. lastAgentStatus itself stays for `ps` display. + pty.lastAgentStatusObservedLive = false + this.resolvePtyExitWaiters(pty, ptyId) + this.pruneDisconnectedPtyTranscript(pty) + } + if (preservesIntentionallyStoppedSurface || preservesAbnormalSshSurface) { + // Why: relay loss is recoverable; keep the HUB-owned pane addressable through the bounded reconnect grace. + this.touchMobileSessionSnapshotsForPty(ptyId, { immediate: true }) + } else { + // Why: permanent process exit is absence, not a starting/sleeping tab. + // Retire before publishing so paired clients never persist a ghost. + try { + retirement = this.retireMobileSessionSurfacesForPty(ptyId, incarnationId, exactSurfaces) + } catch (error) { console.error('[runtime] failed to publish terminal retirement:', error) - }) - .finally(() => { - if (this.pendingPtySurfaceRetirementsByPtyId.get(ptyId) === pendingRetirement) { - this.pendingPtySurfaceRetirementsByPtyId.delete(ptyId) - } - }) + } + } + } finally { + // Why last: a stream end cues clients to re-activate the pane it ended, so the retirement + // must precede it; a cleanup fault must still end the stream. + this.notifyPtyExitListeners(ptyId) } const exitedSurfaces: { handle: string; paneKey: string | null }[] = [] diff --git a/src/main/runtime/orca-runtime-persist-terminal-surface-retirements.ts b/src/main/runtime/orca-runtime-persist-terminal-surface-retirements.ts index bafc280d9574..5458543815ad 100644 --- a/src/main/runtime/orca-runtime-persist-terminal-surface-retirements.ts +++ b/src/main/runtime/orca-runtime-persist-terminal-surface-retirements.ts @@ -1,95 +1,69 @@ // @ts-nocheck -- mechanically split from OrcaRuntimeService; behavior is covered by AST equivalence and characterization tests. import { OrcaRuntimeWithTouchMobileSessionTabsForWorktree } from './orca-runtime-touch-mobile-session-tabs-for-worktree' import type { RetiredTerminalSurface } from './mobile-session-terminal-retirement' -import type { ExecutionHostId } from '../../shared/execution-host' import type { RuntimeMobileSessionRetiredTerminalSurface } from '../../shared/runtime-types' import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host' -import type { WorkspaceSessionState } from '../../shared/workspace-session-state-types' import { retireTerminalSurfaceFromPersistence } from './mobile-session-terminal-persistence-retirement' import { retireTerminalSurfacesFromSnapshot } from './mobile-session-terminal-retirement' import { attachRetirementProofsToSnapshot } from './mobile-session-terminal-retirement-proof' -import { cloneWorkspaceSessionState } from '../persistence/restoring-sessions/session-owner-fields' -import { rollbackWorkspaceSessionAfterFailedAsyncWrite } from '../persistence/restoring-sessions/workspace-session-write-rollback' import { getRepoIdFromWorktreeId } from '../../shared/worktree/id' export class OrcaRuntimeWithPersistTerminalSurfaceRetirements extends OrcaRuntimeWithTouchMobileSessionTabsForWorktree { /** - * Retires each surface in the session partition of the host that owns its worktree. + * Retires each surface in the in-memory session partition of the host that owns its worktree. * Why: an SSH pane's durable surface lives in that connection's partition; retiring it * against the local partition strands the real ghost and bumps a foreign host's epoch. - * Returns null when nothing may be published because persistence is unavailable or failed. + * `accepted` held the surface; `unpersisted` had no partition to hold it (or refused the write). */ - protected async persistTerminalSurfaceRetirements( - retiredSurfaces: readonly RetiredTerminalSurface[] - ): Promise<{ accepted: RetiredTerminalSurface[]; unpersisted: RetiredTerminalSurface[] } | null> { + protected stageTerminalSurfaceRetirements(retiredSurfaces: readonly RetiredTerminalSurface[]): { + accepted: RetiredTerminalSurface[] + unpersisted: RetiredTerminalSurface[] + } { + const accepted: RetiredTerminalSurface[] = [] + const unpersisted: RetiredTerminalSurface[] = [] + for (const surface of retiredSurfaces) { + const hostId = + this.tryGetWorkspaceSessionHostIdForWorktree(surface.worktreeId) ?? LOCAL_EXECUTION_HOST_ID + const current = this.store?.getWorkspaceSession?.(hostId) + if (!current) { + unpersisted.push(surface) + continue + } + const next = retireTerminalSurfaceFromPersistence(current, surface) + if (next === current) { + continue + } + try { + this.store.setWorkspaceSession(next, hostId) + accepted.push(surface) + } catch (error) { + // Why: the process is gone whether or not the profile admits the write (quit, maintenance). + console.error('[runtime] could not stage terminal retirement:', error) + unpersisted.push(surface) + } + } + return { accepted, unpersisted } + } + + // Why no rollback: the process is gone, so a failed write leaves the retirement for the next one. + protected async persistStagedTerminalSurfaceRetirements(): Promise { if (!this.store?.runDurableMutation) { - const hasPersistedSession = retiredSurfaces.some((surface) => - this.store?.getWorkspaceSession?.( - this.tryGetWorkspaceSessionHostIdForWorktree(surface.worktreeId) ?? - LOCAL_EXECUTION_HOST_ID - ) - ) - return hasPersistedSession ? null : { accepted: [], unpersisted: [...retiredSurfaces] } + return } try { - return await this.store.runDurableMutation(() => { - const accepted: RetiredTerminalSurface[] = [] - const unpersisted: RetiredTerminalSurface[] = [] - const originals = new Map() - const staged = new Map() - for (const surface of retiredSurfaces) { - const hostId = - this.tryGetWorkspaceSessionHostIdForWorktree(surface.worktreeId) ?? - LOCAL_EXECUTION_HOST_ID - const current = this.store.getWorkspaceSession?.(hostId) - if (!current) { - unpersisted.push(surface) - continue - } - if (!this.store.setWorkspaceSession) { - throw new Error('workspace_session_unavailable') - } - if (!originals.has(hostId)) { - originals.set(hostId, cloneWorkspaceSessionState(current)) - } - const next = retireTerminalSurfaceFromPersistence(current, surface) - if (next !== current) { - this.store.setWorkspaceSession(next, hostId) - staged.set(hostId, cloneWorkspaceSessionState(this.store.getWorkspaceSession(hostId))) - accepted.push(surface) - } - } - return { - value: { accepted, unpersisted }, - persist: staged.size > 0, - rollback: () => { - for (const [hostId, stagedSession] of staged) { - const current = this.store.getWorkspaceSession(hostId) - const rolledBack = rollbackWorkspaceSessionAfterFailedAsyncWrite( - originals.get(hostId), - stagedSession, - current - ) - if (rolledBack !== current) { - this.store.setWorkspaceSession(rolledBack, hostId) - } - } - } - } - }) + // Why if-dirty: an earlier write, or another exit's, may already carry this retirement. + await this.store.runDurableMutation(() => ({ value: undefined, persist: 'if-dirty' })) } catch (error) { - console.error('[runtime] failed to persist terminal retirement:', error) - return null + console.error('[runtime] terminal retirement is not yet durable:', error) } } - protected async retireMobileSessionSurfacesForPty( + // Why synchronous: the exit's stream end cues clients to re-activate, which must find the leaf gone. + protected retireMobileSessionSurfacesForPty( ptyId: string, incarnationId: string, exactSurfaces: readonly Pick[] - ): Promise { - // Reads can mint a new frame generation while this independent retirement waits for disk. - const pendingRetirement = this.pendingPtySurfaceRetirementsByPtyId.get(ptyId) + ): Promise | undefined { const terminalHandle = this.handleByPtyId.get(ptyId) ?? this.findHandleForPtyRecord(ptyId) ?? undefined const retiredSurfaceByKey = new Map() @@ -119,26 +93,18 @@ export class OrcaRuntimeWithPersistTerminalSurfaceRetirements extends OrcaRuntim } const retiredSurfaces = [...retiredSurfaceByKey.values()] if (retiredSurfaces.length === 0) { - return - } - const persisted = await this.persistTerminalSurfaceRetirements(retiredSurfaces) - const currentIncarnation = this.ptysById.get(ptyId)?.incarnationId - if ( - !persisted || - this.pendingPtySurfaceRetirementsByPtyId.get(ptyId) !== pendingRetirement || - (currentIncarnation && currentIncarnation !== incarnationId) - ) { - return + return undefined } - for (const surface of persisted.unpersisted) { + const staged = this.stageTerminalSurfaceRetirements(retiredSurfaces) + for (const surface of staged.unpersisted) { const repoId = getRepoIdFromWorktreeId(surface.worktreeId) this.terminalTopologyRevisionByRepoId.set( repoId, (this.terminalTopologyRevisionByRepoId.get(repoId) ?? 0) + 1 ) } - // Why: one repo epoch can cover multiple exits, but only surfaces individually accepted by persistence may disappear. - const removableRetiredSurfaces = [...persisted.accepted, ...persisted.unpersisted] + // Why: one repo epoch can cover multiple exits; a surface the session binds to another PTY or incarnation stays. + const removableRetiredSurfaces = [...staged.accepted, ...staged.unpersisted] for (const [worktreeId, snapshot] of this.mobileSessionTabsByWorktree) { // Why proofs aren't gated on `removable`: the exit is the attestation, and a surface the // renderer already de-persisted leaves persistence nothing to accept. Withholding the proof @@ -163,7 +129,7 @@ export class OrcaRuntimeWithPersistTerminalSurfaceRetirements extends OrcaRuntim snapshot, ptyId, exactSurfaces: removableSurfaces, - // Why: discovery is broad by PTY id, but publication may remove only surfaces whose durable retirement was accepted. + // Why: discovery is broad by PTY id, but publication may remove only surfaces the session retired. exactOnly: true, ...(retirementProofs.length > 0 ? { retirementProofs } : {}) }) @@ -175,6 +141,7 @@ export class OrcaRuntimeWithPersistTerminalSurfaceRetirements extends OrcaRuntim } this.publishRetiredTerminalSurfaceProofs(worktreeId, retirementProofs) } + return staged.accepted.length > 0 ? this.persistStagedTerminalSurfaceRetirements() : undefined } /** Ships durable retirement proofs on their own frame when no surface removal carries them. */ diff --git a/src/main/runtime/orca-runtime-register-pty.ts b/src/main/runtime/orca-runtime-register-pty.ts index ba7b47be72d2..bd9c96a5c0fa 100644 --- a/src/main/runtime/orca-runtime-register-pty.ts +++ b/src/main/runtime/orca-runtime-register-pty.ts @@ -27,7 +27,6 @@ export class OrcaRuntimeWithRegisterPty extends OrcaRuntimeWithInvalidateAllHand isWsl?: boolean ): void { this.assertPtyDidNotExitBeforeRegistration(ptyId, binding?.incarnationId) - this.pendingPtySurfaceRetirementsByPtyId.delete(ptyId) this.invalidatePtyControllerInventoryForLifecycle(ptyId, connectionId) const existingPty = this.ptysById.get(ptyId) const replacementHandle = binding?.terminalHandle?.trim() diff --git a/src/main/runtime/orca-runtime-terminal-retirement.test.ts b/src/main/runtime/orca-runtime-terminal-retirement.test.ts index 4422dc2a1e64..d6f70fd4c6e0 100644 --- a/src/main/runtime/orca-runtime-terminal-retirement.test.ts +++ b/src/main/runtime/orca-runtime-terminal-retirement.test.ts @@ -691,7 +691,7 @@ describe('OrcaRuntimeService terminal surface retirement', () => { expect(flushOrThrow).toHaveBeenCalledOnce() }) - it('does not publish absence when the durable retirement flush fails', async () => { + it('publishes absence and reports when the durable retirement flush fails', async () => { const session = makePersistedSplitSession() const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined) const runtime = new OrcaRuntimeService( @@ -717,20 +717,20 @@ describe('OrcaRuntimeService terminal surface retirement', () => { await runtime.onPtyExit('pty-left', 0, 'incarnation-a') + // Why: the process is gone either way; a failed write is reported, not reinstated. expect((await runtime.listMobileSessionTabs(`id:${WORKTREE_ID}`)).tabs).toEqual([ - expect.objectContaining({ id: 'tab::left' }), expect.objectContaining({ id: 'tab::right' }) ]) - expect(events).toEqual([]) + expect(events).not.toEqual([]) expect(errorSpy).toHaveBeenCalledWith( - '[runtime] failed to persist terminal retirement:', + '[runtime] terminal retirement is not yet durable:', expect.any(Error) ) unsubscribe() errorSpy.mockRestore() }) - it('rolls back an in-memory retirement when the durable flush fails', async () => { + it('keeps the in-memory retirement when the durable flush fails', async () => { let session = makePersistedSplitSession() const original = structuredClone(session) const setWorkspaceSession = vi.fn((next: WorkspaceSessionState) => { @@ -755,10 +755,14 @@ describe('OrcaRuntimeService terminal surface retirement', () => { incarnationId: 'incarnation-a' }) + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined) + await runtime.onPtyExit('pty-left', 0, 'incarnation-a') - expect(session).toEqual(original) - expect(setWorkspaceSession).toHaveBeenLastCalledWith(original, LOCAL_EXECUTION_HOST_ID) - expect(setWorkspaceSession).toHaveBeenCalledTimes(2) + // Why: the next profile write carries the staged retirement; nothing may reinstate the leaf. + expect(session).not.toEqual(original) + expect(session.terminalLayoutsByTabId.tab?.ptyIdsByLeafId).toEqual({ right: 'pty-right' }) + expect(setWorkspaceSession).toHaveBeenCalledOnce() + errorSpy.mockRestore() }) }) diff --git a/src/main/runtime/orca-runtime-tests/exit-retirement-activation.spec.ts b/src/main/runtime/orca-runtime-tests/exit-retirement-activation.spec.ts new file mode 100644 index 000000000000..7da878ca2f7c --- /dev/null +++ b/src/main/runtime/orca-runtime-tests/exit-retirement-activation.spec.ts @@ -0,0 +1,148 @@ +import { describe, expect, it, vi } from 'vitest' +import { OrcaRuntimeService } from '../orca-runtime-test-mocks.spec' +import { + HEADLESS_LEAF_ID, + HEADLESS_SECOND_LEAF_ID, + TEST_WORKTREE_ID, + makeDeferred, + makeHeadlessTerminalLayout, + makeRuntimeStoreWithWorkspaceSession, + makeWorkspaceSessionWithHeadlessTerminal +} from '../orca-runtime-test-fixtures.spec' + +async function startSplitHost() { + const { runtimeStore, getSession } = makeRuntimeStoreWithWorkspaceSession( + makeWorkspaceSessionWithHeadlessTerminal({ + tabsByWorktree: { + [TEST_WORKTREE_ID]: [ + { + id: 'host-tab', + ptyId: 'pty-a', + worktreeId: TEST_WORKTREE_ID, + title: 'Split Terminal', + customTitle: null, + color: null, + sortOrder: 0, + createdAt: 1 + } + ] + }, + terminalLayoutsByTabId: { + 'host-tab': makeHeadlessTerminalLayout({ + [HEADLESS_LEAF_ID]: 'pty-a', + [HEADLESS_SECOND_LEAF_ID]: 'pty-b' + }) + } + }) + ) + const spawn = vi.fn(async (options: { sessionId?: string }) => ({ + id: options.sessionId ?? 'fresh-pty' + })) + const adoptStablePane = vi.fn(async () => null) + const runtime = new OrcaRuntimeService(runtimeStore) + runtime.setPtyController({ + spawn, + adoptStablePane, + write: () => true, + kill: () => true, + getForegroundProcess: async () => null, + listProcesses: async () => [] + }) + runtime.syncWindowGraph(0, { tabs: [], leaves: [] }) + const activate = (leafId: string, intent: 'user' | 'automatic') => + runtime.activateMobileSessionTab(`id:${TEST_WORKTREE_ID}`, 'host-tab', leafId, { + notifyClients: false, + navigation: 'caller', + intent + }) + const terminalLeafIds = async (): Promise => + (await runtime.listMobileSessionTabs(`id:${TEST_WORKTREE_ID}`)).tabs.flatMap((tab) => + tab.type === 'terminal' ? [tab.leafId] : [] + ) + await activate(HEADLESS_LEAF_ID, 'user') + await activate(HEADLESS_SECOND_LEAF_ID, 'user') + expect(spawn).toHaveBeenCalledTimes(2) + expect(adoptStablePane).toHaveBeenCalledTimes(2) + return { runtime, runtimeStore, getSession, spawn, adoptStablePane, activate, terminalLeafIds } +} + +describe('OrcaRuntimeService', () => { + // Why: a paired mirror answers an exit's stream end by re-activating its pane. An activation + // that still finds the leaf respawns the exited session, and the retirement never publishes. + it('retires an exited split leaf before its stream end, while the durable write is pending', async () => { + const { runtime, runtimeStore, getSession, spawn, adoptStablePane, activate, terminalLeafIds } = + await startSplitHost() + + const disk = makeDeferred() + Object.assign(runtimeStore, { flushPendingOrThrowAsync: () => disk.promise }) + const published = vi.fn() + runtime.onMobileSessionTabsChanged(published) + // The stream end: the mirror's re-activation starts the moment the host releases it. + let reactivation: Promise | undefined + let observedAtStreamEnd: { binding?: string; publications: number } | undefined + runtime.subscribeToPtyExit('pty-b', () => { + observedAtStreamEnd = { + binding: + getSession().terminalLayoutsByTabId['host-tab']?.ptyIdsByLeafId?.[ + HEADLESS_SECOND_LEAF_ID + ], + publications: published.mock.calls.length + } + reactivation = activate(HEADLESS_SECOND_LEAF_ID, 'automatic').catch((error) => error) + }) + const exiting = runtime.onPtyExit('pty-b', 0, undefined, { providerExitObserved: true }) + + // Why: whatever answers the stream end, over any transport, must already see the leaf retired. + expect(observedAtStreamEnd).toEqual({ binding: undefined, publications: 1 }) + expect(reactivation).toBeDefined() + // Why: the refusal must come from the lookup, before any stable-pane adoption can revive it. + expect(await reactivation).toEqual(new Error('tab_not_found')) + expect(adoptStablePane).toHaveBeenCalledTimes(2) + expect(spawn).toHaveBeenCalledTimes(2) + expect(await terminalLeafIds()).toEqual([HEADLESS_LEAF_ID]) + expect( + getSession().terminalLayoutsByTabId['host-tab']?.ptyIdsByLeafId?.[HEADLESS_SECOND_LEAF_ID] + ).toBeUndefined() + + disk.resolve() + await exiting + expect(await terminalLeafIds()).toEqual([HEADLESS_LEAF_ID]) + }) + + // Why: the process is gone whether or not the profile admits the write (quit, maintenance). + it('retires the pane and ends the stream when the profile refuses the staging write', async () => { + const { runtime, runtimeStore, activate, terminalLeafIds } = await startSplitHost() + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined) + runtimeStore.setWorkspaceSession.mockImplementation(() => { + throw new Error('Profile maintenance or finalization is blocking new terminal snapshot work') + }) + const streamEnd = vi.fn() + runtime.subscribeToPtyExit('pty-b', streamEnd) + + await runtime.onPtyExit('pty-b', 0, undefined, { providerExitObserved: true }) + + expect(streamEnd).toHaveBeenCalledOnce() + expect(await terminalLeafIds()).toEqual([HEADLESS_LEAF_ID]) + await expect(activate(HEADLESS_SECOND_LEAF_ID, 'automatic')).rejects.toThrow('tab_not_found') + expect(errorSpy).toHaveBeenCalledWith( + '[runtime] could not stage terminal retirement:', + expect.any(Error) + ) + errorSpy.mockRestore() + }) + + // Why: the stream end now waits behind the exit cleanup; a cleanup fault must not strand it. + it('still ends the stream when exit cleanup throws before the retirement', () => { + const runtime = new OrcaRuntimeService() + Object.assign(runtime, { + disposeHeadlessTerminal: () => { + throw new Error('dispose_failed') + } + }) + const streamEnd = vi.fn() + runtime.subscribeToPtyExit('pty-a', streamEnd) + + expect(() => runtime.onPtyExit('pty-a', 0)).toThrow('dispose_failed') + expect(streamEnd).toHaveBeenCalledOnce() + }) +}) diff --git a/src/main/runtime/orca-runtime.test.ts b/src/main/runtime/orca-runtime.test.ts index 6d4cba4741d5..070363fdb3fb 100644 --- a/src/main/runtime/orca-runtime.test.ts +++ b/src/main/runtime/orca-runtime.test.ts @@ -79,6 +79,7 @@ await import('./orca-runtime-tests/mobile-session-tabs-part-10.spec') await import('./orca-runtime-tests/mobile-session-tabs-part-11.spec') await import('./orca-runtime-tests/mobile-session-tabs-part-12.spec') await import('./orca-runtime-tests/mobile-session-tabs-part-13.spec') +await import('./orca-runtime-tests/exit-retirement-activation.spec') await import('./orca-runtime-tests/mobile-creation-and-orchestration.spec') await import('./orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec') await import('./orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec') diff --git a/src/main/runtime/terminal-retirement-async-durability.test.ts b/src/main/runtime/terminal-retirement-async-durability.test.ts index 038832782d7b..28d2f1603a91 100644 --- a/src/main/runtime/terminal-retirement-async-durability.test.ts +++ b/src/main/runtime/terminal-retirement-async-durability.test.ts @@ -2,6 +2,7 @@ import { afterEach, expect, it, vi } from 'vitest' import { ACK_INCARNATION, ACK_LEAF, + ACK_SECOND_LEAF, ACK_TAB, createAcknowledgedTabRetirementFixture } from './acknowledged-terminal-tab-retirement-fixture' @@ -35,7 +36,7 @@ it('withholds the acknowledged close until its host retirement is durable', asyn expect(f.hasTab()).toBe(false) }) -it('publishes physical-exit retirement only after durability', async () => { +it('publishes physical-exit retirement before its durable write completes', async () => { const f = fixture() await f.store.flushPendingOrThrowAsync() const published = vi.fn() @@ -43,7 +44,8 @@ it('publishes physical-exit retirement only after durability', async () => { const gate = f.authority.pause() const exiting = f.runtime.onPtyExit('pty-a', 0, ACK_INCARNATION, { providerExitObserved: true }) await gate.started.promise - expect(published).not.toHaveBeenCalled() + // Why: a client re-activating the exited pane in this window must already find it retired. + expect(published).toHaveBeenCalled() gate.finish.resolve() await exiting expect(published).toHaveBeenCalled() @@ -53,7 +55,7 @@ it('publishes physical-exit retirement only after durability', async () => { unsubscribe() }) -it('does not publish a delayed exit over a newly admitted incarnation', async () => { +it('publishes nothing when the exit write lands after a replacement is admitted', async () => { const f = fixture() await f.store.flushPendingOrThrowAsync() const published = vi.fn() @@ -68,3 +70,58 @@ it('does not publish a delayed exit over a newly admitted incarnation', async () expect(published).not.toHaveBeenCalled() unsubscribe() }) + +async function exitWithFailedDurableWrite(f: ReturnType): Promise { + await f.store.flushPendingOrThrowAsync() + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined) + f.authority.failNextWrite() + await f.runtime.onPtyExit('pty-a', 0, ACK_INCARNATION, { providerExitObserved: true }) + expect(errorSpy).toHaveBeenCalledWith( + '[runtime] terminal retirement is not yet durable:', + expect.any(Error) + ) + errorSpy.mockRestore() + // The failed write left disk untouched, so a relaunch would still load the exited leaf. + expect(f.readDisk().workspaceSession.terminalLayoutsByTabId[ACK_TAB]?.ptyIdsByLeafId).toEqual({ + [ACK_LEAF]: 'pty-a', + [ACK_SECOND_LEAF]: 'pty-b' + }) +} + +it('persists a failed exit retirement with the next unrelated profile write', async () => { + const f = fixture() + await exitWithFailedDurableWrite(f) + f.store.addRepo({ + id: 'repo2', + path: '/tmp/other', + displayName: 'Other', + badgeColor: 'gray', + addedAt: 2 + }) + await f.store.flushPendingOrThrowAsync() + expect(f.readDisk().workspaceSession.terminalLayoutsByTabId[ACK_TAB]?.ptyIdsByLeafId).toEqual({ + [ACK_SECOND_LEAF]: 'pty-b' + }) +}) + +it('persists a failed exit retirement with the final quit flush', async () => { + const f = fixture() + await exitWithFailedDurableWrite(f) + await f.quit() + expect(f.readDisk().workspaceSession.terminalLayoutsByTabId[ACK_TAB]?.ptyIdsByLeafId).toEqual({ + [ACK_SECOND_LEAF]: 'pty-b' + }) +}) + +it('writes exits retired in the same tick once', async () => { + const f = fixture() + await f.store.flushPendingOrThrowAsync() + const writes = f.authority.captures.length + await Promise.all([ + f.runtime.onPtyExit('pty-a', 0, ACK_INCARNATION, { providerExitObserved: true }), + f.runtime.onPtyExit('pty-b', 0, undefined, { providerExitObserved: true }) + ]) + // Why: the first write already carries both retirements; the second has nothing left to fence. + expect(f.authority.captures.length - writes).toBe(1) + expect(f.readDisk().workspaceSession.terminalLayoutsByTabId[ACK_TAB]).toBeUndefined() +}) From d0db35c18cb8701a3049405594d353cd45984655 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:12:39 -0700 Subject: [PATCH 41/90] fix(terminal): preserve typing while a remote pane reattaches (#23701) * fix(terminal): retain typing while a parked remote pane reattaches * test: persist restored remote terminal screenshots * fix(remote): buffer recovery reconnect input * fix(remote): retain input across restored pane attach * fix(remote): flush attach input after subscription * fix(remote): flush reattach input after attach readiness * fix(remote): stop buffering after reattach readiness * test(remote): trace parked reattach input lifecycle * test(remote): forward paired client lifecycle diagnostics * fix(remote): preserve restored typing before connect starts * chore(i18n): refresh runtime required catalog * fix(i18n): ship compact agent runtime label * fix(i18n): merge required label into existing sidebar catalog --- .../terminal-pane/pty-transport-types.ts | 2 + .../remote-reattach-input-buffer.test.ts | 150 ++++++++++++++++++ .../remote-reattach-input-buffer.ts | 90 +++++++++++ ...-pty-transport-reattach-type-ahead.test.ts | 68 ++++++++ .../remote-runtime-pty-transport.ts | 11 +- .../src/i18n/en-runtime-required.json | 39 +++-- ...rminal-parked-reveal-interactivity.spec.ts | 6 + 7 files changed, 347 insertions(+), 19 deletions(-) create mode 100644 src/renderer/src/components/terminal-pane/remote-reattach-input-buffer.test.ts create mode 100644 src/renderer/src/components/terminal-pane/remote-reattach-input-buffer.ts create mode 100644 src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-reattach-type-ahead.test.ts diff --git a/src/renderer/src/components/terminal-pane/pty-transport-types.ts b/src/renderer/src/components/terminal-pane/pty-transport-types.ts index 7fd0de6952e7..dce25fd547cc 100644 --- a/src/renderer/src/components/terminal-pane/pty-transport-types.ts +++ b/src/renderer/src/components/terminal-pane/pty-transport-types.ts @@ -212,6 +212,8 @@ export type PtyTransport = { getRecoveryState?: () => PtyTransportRecoveryState /** Starts a fresh connection epoch while preserving the authoritative remote PTY identity. */ retryRecovery?: () => boolean + /** Lets a wrapper retain input when recovery re-enters connect internally. */ + setConnectForRecovery?: (connect: PtyTransport['connect']) => void /** The user dismissed the error surface; the next occurrence of the same message must surface again. */ notifyErrorSurfaceDismissed?: () => void getPtyId: () => string | null diff --git a/src/renderer/src/components/terminal-pane/remote-reattach-input-buffer.test.ts b/src/renderer/src/components/terminal-pane/remote-reattach-input-buffer.test.ts new file mode 100644 index 000000000000..9b6a731b1585 --- /dev/null +++ b/src/renderer/src/components/terminal-pane/remote-reattach-input-buffer.test.ts @@ -0,0 +1,150 @@ +import { describe, expect, it, vi } from 'vitest' +import { createDeferred, flushAsyncTicks } from './pty-connection-test-async' +import type { PtyConnectResult, PtyTransport } from './pty-transport-types' +import { withRemoteReattachInputBuffer } from './remote-reattach-input-buffer' + +const ORIGINAL_ID = 'remote:environment@@term_original' + +function createHarness() { + const connected = createDeferred() + let ptyId: string | null = null + const writes: string[] = [] + const delegate: PtyTransport = { + connect: vi.fn(() => connected.promise), + attach: vi.fn(), + disconnect: vi.fn(), + detach: vi.fn(), + destroy: vi.fn(), + isConnected: () => ptyId !== null, + getPtyId: () => ptyId, + resize: () => true, + sendInput: vi.fn((data) => { + if (!ptyId) { + return false + } + writes.push(data) + return true + }), + sendInputImmediate: vi.fn(() => false), + sendInputAccepted: vi.fn(async (data) => { + if (!ptyId) { + return false + } + writes.push(data) + return true + }) + } + return { + delegate, + connected, + writes, + transport: withRemoteReattachInputBuffer(delegate), + finish(id: string | null = ORIGINAL_ID) { + ptyId = id + connected.resolve(id ? { id, isReattach: true } : undefined) + } + } +} + +describe('remote reattach type-ahead', () => { + it('preserves typing from the restored screen before connect starts', async () => { + const harness = createHarness() + expect(harness.transport.sendInput('before', 'driving')).toBe(true) + const accepted = harness.transport.sendInputAccepted?.('\x03', 'driving') + const connecting = harness.transport.connect({ url: '', sessionId: ORIGINAL_ID, callbacks: {} }) + expect(harness.transport.sendInput('after\r', 'driving')).toBe(true) + harness.finish() + await connecting + await expect(accepted).resolves.toBe(true) + expect(harness.writes).toEqual(['before', '\x03', 'after\r']) + }) + + it('discards pre-entry typing when the first connection creates a fresh terminal', async () => { + const harness = createHarness() + const accepted = harness.transport.sendInputAccepted?.('old tail\r', 'driving') + const connecting = harness.transport.connect({ url: '', callbacks: {} }) + await expect(accepted).resolves.toBe(false) + harness.finish('remote:environment@@fresh') + await connecting + expect(harness.writes).toEqual([]) + }) + + it('delivers typing and an acknowledged interrupt once the original endpoint reattaches', async () => { + const harness = createHarness() + const connecting = harness.transport.connect({ url: '', sessionId: ORIGINAL_ID, callbacks: {} }) + expect(harness.transport.sendInput('partial', 'driving')).toBe(true) + const accepted = harness.transport.sendInputAccepted?.('\x03', 'driving') + expect(harness.transport.sendInput('next\r', 'driving')).toBe(true) + expect(harness.writes).toEqual([]) + harness.finish() + await connecting + await expect(accepted).resolves.toBe(true) + expect(harness.writes).toEqual(['partial', '\x03', 'next\r']) + expect(harness.transport.sendInput('later', 'driving')).toBe(true) + expect(harness.writes.at(-1)).toBe('later') + }) + + it.each(['remote:environment@@term_replacement', null])( + 'never forwards retained input when the original endpoint is unavailable: %s', + async (replacementId) => { + const harness = createHarness() + const connecting = harness.transport.connect({ + url: '', + sessionId: ORIGINAL_ID, + callbacks: {} + }) + const accepted = harness.transport.sendInputAccepted?.('dangerous tail\r', 'driving') + harness.finish(replacementId) + await connecting + await expect(accepted).resolves.toBe(false) + expect(harness.writes).toEqual([]) + } + ) + + it.each(['disconnect', 'detach', 'destroy'] as const)( + 'drops input and settles accepted writes on %s before a late reattach', + async (action) => { + const harness = createHarness() + const connecting = harness.transport.connect({ + url: '', + sessionId: ORIGINAL_ID, + callbacks: {} + }) + const accepted = harness.transport.sendInputAccepted?.('stale\r', 'driving') + harness.transport[action]?.() + await expect(accepted).resolves.toBe(false) + harness.finish() + await connecting + expect(harness.writes).toEqual([]) + } + ) + + it('keeps newly typed bytes behind a pending acknowledged write', async () => { + const harness = createHarness() + const acknowledgement = createDeferred() + harness.delegate.sendInputAccepted = () => acknowledgement.promise + const transport = withRemoteReattachInputBuffer(harness.delegate) + const connecting = transport.connect({ url: '', sessionId: ORIGINAL_ID, callbacks: {} }) + const accepted = transport.sendInputAccepted?.('\x03', 'driving') + harness.finish() + await flushAsyncTicks() + expect(transport.sendInput('after interrupt\r', 'driving')).toBe(true) + expect(harness.writes).toEqual([]) + acknowledgement.resolve(true) + await connecting + await expect(accepted).resolves.toBe(true) + expect(harness.writes).toEqual(['after interrupt\r']) + }) + + it('rejects pending writes when connection fails and leaves query replies unbuffered', async () => { + const harness = createHarness() + const connecting = harness.transport.connect({ url: '', sessionId: ORIGINAL_ID, callbacks: {} }) + const accepted = harness.transport.sendInputAccepted?.('typed', 'driving') + expect(harness.transport.sendInput('\x1b[I', 'query-reply')).toBe(false) + expect(harness.transport.sendInputImmediate('\x1b[1;1R')).toBe(false) + harness.connected.reject(new Error('offline')) + await expect(connecting).rejects.toThrow('offline') + await expect(accepted).resolves.toBe(false) + expect(harness.writes).toEqual([]) + }) +}) diff --git a/src/renderer/src/components/terminal-pane/remote-reattach-input-buffer.ts b/src/renderer/src/components/terminal-pane/remote-reattach-input-buffer.ts new file mode 100644 index 000000000000..6e5969a74c86 --- /dev/null +++ b/src/renderer/src/components/terminal-pane/remote-reattach-input-buffer.ts @@ -0,0 +1,90 @@ +import { parseRemoteRuntimePtyId } from '../../../../shared/remote-runtime-pty-id' +import { createPtyPreconnectInputBuffer } from './pty-preconnect-input-buffer' +import type { PtyTransport } from './pty-transport-types' + +/** Keeps type-ahead on a restored screen bound to its original remote terminal. */ +export function withRemoteReattachInputBuffer(transport: PtyTransport): PtyTransport { + const sendAccepted = transport.sendInputAccepted?.bind(transport) + let pending: ReturnType | null = + createPtyPreconnectInputBuffer() + let entered = false + const clear = (): void => { + pending?.clear() + pending = null + } + const wrapped: PtyTransport = { + ...transport, + async connect(options) { + const expectedId = options.sessionId + const initialBuffer = entered ? null : pending + entered = true + const buffer = + expectedId && parseRemoteRuntimePtyId(expectedId) + ? (initialBuffer ?? createPtyPreconnectInputBuffer()) + : null + // Restored pixels can accept typing before the first connect call begins. + if (pending !== buffer) { + clear() + } + pending = buffer + try { + const result = await transport.connect(options) + if (buffer) { + await buffer.flush({ + // A replacement endpoint must never receive the old terminal's unfinished command. + isCurrent: () => pending === buffer && transport.getPtyId() === expectedId, + sendInput: (data, kind) => transport.sendInput(data, kind), + sendInputImmediate: (data) => transport.sendInputImmediate(data), + ...(sendAccepted ? { sendInputAccepted: sendAccepted } : {}) + }) + } + return result + } finally { + buffer?.clear() + if (pending === buffer) { + pending = null + } + } + }, + sendInput(data, kind) { + return kind !== 'query-reply' && pending?.isBuffering() + ? pending.enqueue(data, 'ordinary', kind) + : transport.sendInput(data, kind) + }, + // Emulator replies stay on the immediate path; replay must not retain them as user input. + ...(sendAccepted + ? { + sendInputAccepted: (data, kind) => + kind !== 'query-reply' && pending?.isBuffering() + ? pending.enqueueAccepted(data, kind) + : sendAccepted(data, kind) + } + : {}), + attach(options) { + entered = true + clear() + transport.attach(options) + }, + disconnect() { + entered = true + clear() + transport.disconnect() + }, + ...(transport.detach + ? { + detach: (options) => { + entered = true + clear() + transport.detach?.(options) + } + } + : {}), + destroy(options) { + entered = true + clear() + return transport.destroy?.(options) + } + } + transport.setConnectForRecovery?.((options) => wrapped.connect(options)) + return wrapped +} diff --git a/src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-reattach-type-ahead.test.ts b/src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-reattach-type-ahead.test.ts new file mode 100644 index 000000000000..94fd6f828539 --- /dev/null +++ b/src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-reattach-type-ahead.test.ts @@ -0,0 +1,68 @@ +import { beforeEach, expect, it, vi } from 'vitest' +import { + TerminalStreamOpcode, + decodeTerminalStreamText +} from '../../../../shared/terminal-stream-protocol' +import { createDeferred } from './pty-connection-test-async' +import { + createRemoteRuntimeTransportMocks, + type MultiplexSubscriptionCallbacks +} from './remote-runtime-pty-transport-test-harness' + +let callbacks: MultiplexSubscriptionCallbacks = null +let resolvedHandle = 'terminal-1' +const { runtimeCall, latestFrameForOpcode, resetRemoteRuntimeTransport } = + createRemoteRuntimeTransportMocks({ + getCallbacks: () => callbacks, + setCallbacks: (value) => { + callbacks = value + }, + getResolvedPaneHandle: () => resolvedHandle, + setResolvedPaneHandle: (value) => { + resolvedHandle = value + } + }) + +beforeEach(resetRemoteRuntimeTransport) + +it('sends typing from a restored screen after the host finishes resolving its original pane', async () => { + const resolution = createDeferred() + const call = runtimeCall.getMockImplementation() + runtimeCall.mockImplementation(async (request: { method: string }) => { + if (request.method === 'terminal.resolvePane') { + await resolution.promise + } + return call?.(request) + }) + const { createRemoteRuntimePtyTransport } = await import('./remote-runtime-pty-transport') + const transport = createRemoteRuntimePtyTransport('env-1', { + worktreeId: 'wt-1', + tabId: 'web-terminal-host-tab-1', + leafId: 'pane:1' + }) + try { + expect(transport.sendInput('probe-', 'driving')).toBe(true) + const connecting = transport.connect({ + url: '', + sessionId: 'remote:env-1@@terminal-1', + callbacks: {} + }) + await vi.waitFor(() => { + expect(runtimeCall).toHaveBeenCalledWith( + expect.objectContaining({ method: 'terminal.resolvePane' }) + ) + }) + expect(transport.getPtyId()).toBeNull() + expect(transport.sendInput('cold-parked\r', 'driving')).toBe(true) + expect(latestFrameForOpcode(TerminalStreamOpcode.Input)).toBeUndefined() + resolution.resolve() + await connecting + await vi.waitFor(() => { + const frame = latestFrameForOpcode(TerminalStreamOpcode.Input) + expect(frame && decodeTerminalStreamText(frame.payload)).toBe('probe-cold-parked\r') + }) + } finally { + resolution.resolve() + transport.destroy?.() + } +}) diff --git a/src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts b/src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts index a8e8a727ad88..cb78db75e9e3 100644 --- a/src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts +++ b/src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts @@ -1,4 +1,5 @@ import { createAgentSessionKeyboardOptions } from '@/runtime/agent-session-keyboard-capability' +import { withRemoteReattachInputBuffer } from './remote-reattach-input-buffer' /* eslint-disable max-lines -- Why: remote PTY transport keeps lifecycle, JSON fallback, and binary stream wiring together so reconnect/destroy ordering stays testable as one behavior surface. */ import type { RuntimeRpcResponse } from '../../../../shared/runtime-rpc-envelope' import { @@ -885,7 +886,7 @@ export function createRemoteRuntimePtyTransport( return true } if (lastConnectOptions) { - void transport.connect(lastConnectOptions) + void connectForRecovery(lastConnectOptions) return true } return false @@ -2173,6 +2174,7 @@ export function createRemoteRuntimePtyTransport( flushPendingClaimInput(nextStream) } + let connectForRecovery: PtyTransport['connect'] = (options) => transport.connect(options) const transport: PtyTransport = { async connect(options) { cancelTerminalCreateRetryWait() @@ -2715,7 +2717,7 @@ export function createRemoteRuntimePtyTransport( recovery.currentPhase === 'disconnected' ) { recovery.begin() - void transport.connect(lastConnectOptions) + void connectForRecovery(lastConnectOptions) return true } // Why: online/resume fires a parked retry; the button must not be weaker than an event (#12684). @@ -2785,6 +2787,9 @@ export function createRemoteRuntimePtyTransport( return stream.serializeBufferOutcome(opts) }, + setConnectForRecovery(connect) { + connectForRecovery = connect + }, destroy() { destroyed = true setAttachmentUnavailable() @@ -2800,5 +2805,5 @@ export function createRemoteRuntimePtyTransport( viewportBatcher.clear() } } - return transport + return withRemoteReattachInputBuffer(transport) } diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index c72ffcdf8038..8b971208580f 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -99,11 +99,11 @@ "setupKindGit": "Git repo" }, "PullRequestPage": { - "3450247584": "Comment", "19f19560d5": "destructive", "1ff5d979df": "No one assigned", "2b4fdb880c": "Unmark viewed", "2e528e1c2d": "Viewed", + "3450247584": "Comment", "42c36d9166": "{{value0}} {{value1}} reaction{{value2}}", "4b960e5978": "Loading code context…", "50b8fb290f": "Mark viewed", @@ -245,9 +245,9 @@ "f0202f3a89": "Daily" }, "AutomationsPage": { - "2695883141": "delete", "0329f9bef1": "Close · Esc", "0ae52dd760": "hermes", + "2695883141": "delete", "3e42a5cc1b": "SSH connection failed.", "53f06f0ad5": "Retry source", "587a4b205c": "Next", @@ -297,13 +297,6 @@ "unknownManager": "This external automation is no longer listed for any host in view." } }, - "browser-pane": { - "markup": { - "errorAttach": "Could not attach the markup screenshot.", - "errorCapture": "Could not capture the page to draw on.", - "errorUnavailable": "Screenshot markup is not available on this page." - } - }, "browser": { "pane": { "BrowserPane": { @@ -340,6 +333,13 @@ } } }, + "browser-pane": { + "markup": { + "errorAttach": "Could not attach the markup screenshot.", + "errorCapture": "Could not capture the page to draw on.", + "errorUnavailable": "Screenshot markup is not available on this page." + } + }, "contextual": { "tours": { "ContextualTourControl": { @@ -595,9 +595,6 @@ } } }, - "linear-issue-attribute-filter-dropdowns": { - "optionsFromTeam": "Options from {{team}}" - }, "linear": { "api": { "key": { @@ -616,6 +613,9 @@ } } }, + "linear-issue-attribute-filter-dropdowns": { + "optionsFromTeam": "Options from {{team}}" + }, "mobile": { "MobileHero": { "79d2f480da": "Network interface to advertise", @@ -878,9 +878,9 @@ }, "empty": { "state": { - "3322603418": "Pull request status unavailable", "13e1c7d5ed": "No {{value0}} found", "2bdd7aaf2d": "GitHub status could not be refreshed. Existing cached data was preserved.", + "3322603418": "Pull request status unavailable", "3d4af82ff4": "Refreshing GitHub status for this branch", "41252bc53f": "Branch not published", "5b0cfae9a5": "Create a {{value0}} to start checks and review.", @@ -2005,6 +2005,15 @@ } } } + }, + "worktree": { + "card": { + "compact": { + "agents": { + "a128d7006b": "{{value0}} {{value1}} child {{value2}}" + } + } + } } }, "skills": { @@ -2687,12 +2696,10 @@ "notAgent": { "subtitle": "This terminal is not running a recognized coding agent.", "title": "No conversation here" - }, - "reconnecting": "Reconnecting to this chat…" + } }, "status": { "responding": "Agent is responding", - "thinking": "Thinking", "toggleDetails": "Toggle turn details", "workedFor": "Worked for {{value0}}", "workingFor": "Working for {{value0}}" diff --git a/tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts b/tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts index fe045e3814a9..a21c3ccab0da 100644 --- a/tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts +++ b/tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts @@ -288,6 +288,12 @@ async function probeInteractivity( ) const paneGrid = await readActivePaneGrid(page, target.webTabId) const diagnostics = await readPaneDiagnostics(page, worktreeId, target.webTabId) + const screenshotPath = test.info().outputPath(`paired-terminal-${name}.png`) + await page.screenshot({ path: screenshotPath }) + await test.info().attach(`paired-terminal-${name}`, { + path: screenshotPath, + contentType: 'image/png' + }) let paintedAfterFlip = paintedLive if (!paintedLive) { await openClientTab(page, worktreeId, flipTo.webTabId) From 2aed2cf64a5ea961235e6cf2e5be146428b2d8fd Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:34:36 -0700 Subject: [PATCH 42/90] fix(terminal): reveal splits while the source pane binds (#23692) * test(e2e): observe passive terminal restoration before activation * fix(terminal): reveal persisted splits during source binding publication * test(terminal): handle nullable persisted layout roots --- ...me-resolve-terminal-split-source-authority.ts | 3 ++- ...orca-runtime-terminal-split-authority.test.ts | 16 +++++++++++++++- ...erminal-tab-close-restart-persistence.spec.ts | 15 +++++++++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/main/runtime/orca-runtime-resolve-terminal-split-source-authority.ts b/src/main/runtime/orca-runtime-resolve-terminal-split-source-authority.ts index 6acf8ba325f0..167aee3e21b8 100644 --- a/src/main/runtime/orca-runtime-resolve-terminal-split-source-authority.ts +++ b/src/main/runtime/orca-runtime-resolve-terminal-split-source-authority.ts @@ -54,12 +54,13 @@ export class OrcaRuntimeWithResolveTerminalSplitSourceAuthority extends OrcaRunt ) const rendererTab = this.tabs.get(tabId) const rendererLeaf = this.leaves.get(this.getLeafKey(tabId, leafId)) + // A mounted pane can publish before its PTY binds; persisted identity fences that gap. const rendererMounted = Boolean( rendererTab && rendererLeaf && runtimeWorktreeIdsEqual(rendererTab.worktreeId, worktreeId) && runtimeWorktreeIdsEqual(rendererLeaf.worktreeId, worktreeId) && - rendererLeaf.ptyId === ptyId + (rendererLeaf.ptyId === ptyId || (persisted && rendererLeaf.ptyId === null)) ) if (persisted && persistedLayout) { return { diff --git a/src/main/runtime/orca-runtime-terminal-split-authority.test.ts b/src/main/runtime/orca-runtime-terminal-split-authority.test.ts index 9da61e59072f..8369a219331e 100644 --- a/src/main/runtime/orca-runtime-terminal-split-authority.test.ts +++ b/src/main/runtime/orca-runtime-terminal-split-authority.test.ts @@ -78,6 +78,7 @@ function createHarness( deferSpawn?: boolean includePairedSnapshot?: boolean rendererMounted?: boolean + rendererPtyId?: string | null graphOnlySource?: boolean sourceIncarnationId?: string stopAndWaitResult?: boolean @@ -169,7 +170,7 @@ function createHarness( worktreeId: WORKTREE_ID, leafId: SOURCE_LEAF_ID, paneRuntimeId: 1, - ptyId: SOURCE_PTY_ID + ptyId: options.rendererPtyId === undefined ? SOURCE_PTY_ID : options.rendererPtyId } ] : [], @@ -283,6 +284,19 @@ describe('remote runtime terminal split authority', () => { }) }) + it('reveals a persisted split while its mounted source is still publishing its PTY binding', async () => { + const harness = createHarness(true, { rendererMounted: true, rendererPtyId: null }) + await harness.runtime.splitTerminal(harness.handle, { direction: 'vertical' }) + expect(harness.revealTerminalSession).toHaveBeenCalledOnce() + expect(harness.getSession().terminalLayoutsByTabId[TAB_ID]?.root?.type).toBe('split') + }) + + it('does not reveal a persisted split into a renderer bound to a different PTY', async () => { + const harness = createHarness(true, { rendererMounted: true, rendererPtyId: 'replacement' }) + await harness.runtime.splitTerminal(harness.handle, { direction: 'vertical' }) + expect(harness.revealTerminalSession).not.toHaveBeenCalled() + }) + it('splits a persisted tab without consulting an unmounted host renderer', async () => { const harness = createHarness() diff --git a/tests/e2e/terminal-tab-close-restart-persistence.spec.ts b/tests/e2e/terminal-tab-close-restart-persistence.spec.ts index 9df296d287bf..20421dd17303 100644 --- a/tests/e2e/terminal-tab-close-restart-persistence.spec.ts +++ b/tests/e2e/terminal-tab-close-restart-persistence.spec.ts @@ -137,8 +137,19 @@ test('durable whole-tab close removes a split tab across restart', async (// oxl const secondLaunch = await session.launch() secondApp = secondLaunch.app await waitForSessionReady(secondLaunch.page) - const restoredWorktreeId = await attachRepoAndOpenTerminal(secondLaunch.page, repoPath) - expect(restoredWorktreeId).toBe(worktreeId) + // Activation deliberately creates a fresh terminal; observe passive hydration first. + await expect + .poll(() => + secondLaunch.page.evaluate( + (id) => + window.__store + ?.getState() + .allWorktrees() + .some((worktree) => worktree.id === id), + worktreeId + ) + ) + .toBe(true) // Why: wait past initial worktree effects so this checks resurrection, not // only the first hydrated frame before default-tab logic has run. From 4b622e1b1354a83b9b4cf963fdcc96b3266ff0eb Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:48:07 -0700 Subject: [PATCH 43/90] fix(runtime): reopen the quiet-foreground tui-idle lane for agents with no other rest signal (#23598) * fix(runtime): reopen the quiet-foreground tui-idle lane for agents with no other rest signal A tui-idle wait could never settle on a pane running amp, goose, crush, kimi, qwen-code, rovo, auggie and other agents whose titles Orca cannot classify: the quiet-foreground lane was closed for every launched agent, and it was the only lane those agents could reach, so worker start failed at agent_readiness after 60s. Model each agent's rest signal, derived from the tables that already encode it (synthetic ready titles, the title classifier, the DSH hook and Muse ready screen lanes). The lane stays closed where a stronger signal will arrive and reopens for agents with none. On a reopened lane, silence counts only after the TUI has painted: an agent that has painted nothing is still booting. Linear: STA-7440 * fix(runtime): count only the command's own output as an agent's paint on the tui-idle foreground lane The after-paint lane accepted any output, and the shell's prompt and echoed launch command always land before the agent starts, so a silently booting agent could still settle and lose its first prompt. The runtime now reads the shell integration's command-start marker and requires visible output after it; panes whose shell emits no marker keep the any-output rule. Also skip the foreground-process read while the pane cannot settle, and register the new title-classifier call site in the pane agent identity inventory. * fix(runtime): classify Freebuff's rest signal and skip the backward marker scan on chunks without one Main added the Freebuff agent after this branch point, so the full per-agent rest-signal table no longer matched on the merge ref. Freebuff derives `none`: its screen reports a first-party `done`, which tui-idle trusts only for DSH, so the quiet-foreground lane is its only one. The command-start scan ran a backward search over every PTY chunk; a forward check first cuts that to the cost of a plain substring test on chunks with no marker. * fix(runtime): classify Qoder's rest signal after merging main Main added Qoder with its own readiness branch returning a boolean quiet-foreground flag; map it to the lane type and classify Qoder by its ready screen so the full rest-signal table and lane-agreement check stay exhaustive. Say what `none` actually means: no stronger lane tui-idle trusts, not no hooks at all. * refactor(runtime): track command paint with the shared OSC 133 scanner The command-paint tracker had its own split-unsafe 133;C parser. Reuse the chunk-boundary-safe scanner, which now reports where in the chunk the marker ended, so a marker split across reads is still found. Correct the unmarked-launch list: bash and zsh mark typed launches after the echo. * fix(runtime): drop command-paint state on an output gap or a new process A dropped chunk can cut a command-start marker in half, and the scanner's carry then completes it on unrelated output after the gap, leaving the pane waiting for a paint that already happened. Reset it with the other cross-chunk carries. * fix(terminal): keep the command-start offset out of renderer lifecycle callbacks --- .../orca-runtime-apply-tracked-pty-title.ts | 1 + ...-runtime-emit-daemon-pty-transient-fact.ts | 1 + src/main/runtime/orca-runtime-on-pty-data.ts | 2 + src/main/runtime/orca-runtime-runtime-id.ts | 5 ++ .../runtime-terminal-idle-polls.test.ts | 80 +++++++++++++++++++ .../runtime/runtime-terminal-idle-polls.ts | 51 +++++++++--- .../runtime/runtime-terminal-state-records.ts | 3 + .../runtime/terminal-command-paint.test.ts | 52 ++++++++++++ src/main/runtime/terminal-command-paint.ts | 66 +++++++++++++++ .../terminal-wait-name-only-idle.test.ts | 1 + .../runtime/tui-idle-command-paint.test.ts | 57 +++++++++++++ src/main/runtime/tui-idle-evidence.test.ts | 74 +++++++++++++++-- src/main/runtime/tui-idle-evidence.ts | 31 ++++--- .../terminal-command-lifecycle.ts | 6 +- .../pane-agent-identity-inventory.test.ts | 3 +- .../terminal-osc133-command-finished.ts | 23 ++++-- src/shared/tui-agent-rest-signal.test.ts | 62 ++++++++++++++ src/shared/tui-agent-rest-signal.ts | 41 ++++++++++ 18 files changed, 520 insertions(+), 39 deletions(-) create mode 100644 src/main/runtime/terminal-command-paint.test.ts create mode 100644 src/main/runtime/terminal-command-paint.ts create mode 100644 src/main/runtime/tui-idle-command-paint.test.ts create mode 100644 src/shared/tui-agent-rest-signal.test.ts create mode 100644 src/shared/tui-agent-rest-signal.ts diff --git a/src/main/runtime/orca-runtime-apply-tracked-pty-title.ts b/src/main/runtime/orca-runtime-apply-tracked-pty-title.ts index f1ea159f4a8b..f4f8826e6e78 100644 --- a/src/main/runtime/orca-runtime-apply-tracked-pty-title.ts +++ b/src/main/runtime/orca-runtime-apply-tracked-pty-title.ts @@ -191,6 +191,7 @@ export class OrcaRuntimeWithApplyTrackedPtyTitle extends OrcaRuntimeWithGetUnper pty.managementTitleAt = null pty.waitBlockedAt = null pty.tailWaitState = undefined + pty.commandPaint = undefined } for (const leaf of this.getLeavesForPty(ptyId)) { leaf.lastOscTitle = null diff --git a/src/main/runtime/orca-runtime-emit-daemon-pty-transient-fact.ts b/src/main/runtime/orca-runtime-emit-daemon-pty-transient-fact.ts index 635d14e60d3c..cc112a78ade7 100644 --- a/src/main/runtime/orca-runtime-emit-daemon-pty-transient-fact.ts +++ b/src/main/runtime/orca-runtime-emit-daemon-pty-transient-fact.ts @@ -51,6 +51,7 @@ export class OrcaRuntimeWithEmitDaemonPtyTransientFact extends OrcaRuntimeWithSc const pty = this.getOrCreatePtyWorktreeRecord(ptyId) if (pty) { pty.tailPendingAnsi = '' + pty.commandPaint = undefined } for (const leaf of this.getLeavesForPty(ptyId)) { leaf.tailPendingAnsi = '' diff --git a/src/main/runtime/orca-runtime-on-pty-data.ts b/src/main/runtime/orca-runtime-on-pty-data.ts index 57b094165dae..52c1fb32551e 100644 --- a/src/main/runtime/orca-runtime-on-pty-data.ts +++ b/src/main/runtime/orca-runtime-on-pty-data.ts @@ -4,6 +4,7 @@ import type { TerminalOutputSourceRange } from '../../shared/terminal-output-sou import { advertisedUrlWatcher } from '../ports/advertised-url-watcher' import { appendNormalizedToTailBuffer } from './terminal-tail-buffer' import { normalizeTerminalChunk } from './terminal-ansi-normalization' +import { observeTerminalCommandPaint } from './terminal-command-paint' import { appendCompletedTerminalTranscript, buildPreview, @@ -91,6 +92,7 @@ export class OrcaRuntimeWithOnPtyData extends OrcaRuntimeWithPreparePtyExecution pty.lastOutputAt = at const normalized = normalizeTerminalChunk(data, pty.tailPendingAnsi) pty.tailPendingAnsi = normalized.pendingAnsi + observeTerminalCommandPaint(pty, data, normalized.text) const nextTail = appendNormalizedToTailBuffer( pty.tailBuffer, pty.tailPartialLine, diff --git a/src/main/runtime/orca-runtime-runtime-id.ts b/src/main/runtime/orca-runtime-runtime-id.ts index 4b252d57fefd..d724207f9210 100644 --- a/src/main/runtime/orca-runtime-runtime-id.ts +++ b/src/main/runtime/orca-runtime-runtime-id.ts @@ -48,6 +48,7 @@ import { RuntimeTerminalIdlePolls } from './runtime-terminal-idle-polls' import { TerminalIntentionalStops } from './terminal-intentional-stops' import { TerminalRunFactsRegister, type TerminalSpawnCommit } from './terminal-run-facts' import type { TuiIdleEvidenceSource } from './tui-idle-evidence' +import { hasTerminalCommandPainted } from './terminal-command-paint' import { TUI_IDLE_DEFAULT_TIMEOUT_MS, TUI_IDLE_POLL_INTERVAL_MS, @@ -351,6 +352,10 @@ export class OrcaRuntimeWithRuntimeId { ...this.tuiIdleEvidenceSource, intervalMs: TUI_IDLE_POLL_INTERVAL_MS, getForegroundProcess: (ptyId) => this.ptyController?.getForegroundProcess(ptyId) ?? null, + hasCommandPainted: (ptyId) => { + const pty = this.ptysById.get(ptyId) + return pty === undefined || hasTerminalCommandPainted(pty) + }, // Why the runtime's own emulator: a provider snapshot would be a host round trip per tick. readVisibleScreen: (ptyId) => this.headlessTerminals.has(ptyId) diff --git a/src/main/runtime/runtime-terminal-idle-polls.test.ts b/src/main/runtime/runtime-terminal-idle-polls.test.ts index cab8e75ae468..5149c63da223 100644 --- a/src/main/runtime/runtime-terminal-idle-polls.test.ts +++ b/src/main/runtime/runtime-terminal-idle-polls.test.ts @@ -4,6 +4,7 @@ import type { TerminalWaiter } from './runtime-terminal-contracts' import type { RuntimeLeafRecord, RuntimePtyWorktreeRecord } from './runtime-terminal-state-records' import type { RuntimeTerminalWait } from '../../shared/runtime-types' import type { TuiAgent } from '../../shared/tui-agent' +import { TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' const INTERVAL_MS = 2000 @@ -71,6 +72,7 @@ describe('RuntimeTerminalIdlePolls timer budget', () => { quiescenceMs: 1500, getTabTitle: () => null, getForegroundProcess: () => null, + hasCommandPainted: () => true, getAdoptedPtyIdleStatus: () => null, getPaneAgent: () => null, getFirstPartyAgentStatus: () => null, @@ -108,6 +110,7 @@ describe('RuntimeTerminalIdlePolls timer budget', () => { quiescenceMs: 1500, getTabTitle: () => null, getForegroundProcess: () => null, + hasCommandPainted: () => true, getAdoptedPtyIdleStatus: () => null, getPaneAgent: () => null, getFirstPartyAgentStatus: () => null, @@ -135,6 +138,7 @@ describe('RuntimeTerminalIdlePolls timer budget', () => { quiescenceMs: 1500, getTabTitle: () => null, getForegroundProcess: () => null, + hasCommandPainted: () => true, getAdoptedPtyIdleStatus: () => null, getPaneAgent: () => null, getFirstPartyAgentStatus: () => null, @@ -167,6 +171,7 @@ describe('RuntimeTerminalIdlePolls timer budget', () => { new Promise((resolve) => { gates.push(resolve) }), + hasCommandPainted: () => true, getAdoptedPtyIdleStatus: () => null, getPaneAgent: () => null, getFirstPartyAgentStatus: () => null, @@ -225,6 +230,7 @@ describe('RuntimeTerminalIdlePolls rendered-screen blocked prompts', () => { getTabTitle: () => null, // Unknown agent + quiet pane: without the screen check this would settle idle. getForegroundProcess: () => (foreground ? Promise.resolve(foreground) : null), + hasCommandPainted: () => true, getAdoptedPtyIdleStatus: () => null, getPaneAgent: () => agent, getFirstPartyAgentStatus: () => null, @@ -354,3 +360,77 @@ describe('RuntimeTerminalIdlePolls rendered-screen blocked prompts', () => { expect(resolved).toEqual([expect.objectContaining({ satisfied: true })]) }) }) + +describe('RuntimeTerminalIdlePolls quiet foreground for a launched agent', () => { + const QUIESCENCE_MS = 1500 + + beforeEach(() => { + vi.useFakeTimers() + }) + + afterEach(() => { + vi.useRealTimers() + }) + + function createPolls( + agent: TuiAgent, + resolved: string[], + foregroundReads: string[] = [] + ): RuntimeTerminalIdlePolls { + return new RuntimeTerminalIdlePolls({ + intervalMs: INTERVAL_MS, + quiescenceMs: QUIESCENCE_MS, + getTabTitle: () => null, + getForegroundProcess: (ptyId) => { + foregroundReads.push(ptyId) + return Promise.resolve(TUI_AGENT_CONFIG[agent].expectedProcess) + }, + hasCommandPainted: () => true, + getAdoptedPtyIdleStatus: () => null, + getPaneAgent: () => agent, + getFirstPartyAgentStatus: () => null, + readScreenLines: () => null, + readVisibleScreen: () => null, + getLiveLeaf: (leaf) => leaf, + resolve: (waiter) => resolved.push(waiter.handle) + }) + } + + // Why: amp's title never classifies, so this lane is its only rest signal; closing it for + // every launched agent failed `worker start` at agent_readiness after 60s (STA-7440). + it('settles an agent with no other rest signal once it has painted and gone quiet', async () => { + const resolved: string[] = [] + const foregroundReads: string[] = [] + const polls = createPolls('amp', resolved, foregroundReads) + const pty = makePty('pty-amp') + const leaf = makeLeaf('tab-amp') + polls.startPty(makeWaiter('pty'), pty) + polls.startLeaf(makeWaiter('leaf'), leaf) + + // Booting: the agent owns the foreground but has painted nothing (#9976). + await vi.advanceTimersByTimeAsync(INTERVAL_MS * 5) + expect(resolved).toEqual([]) + + await vi.advanceTimersByTimeAsync(INTERVAL_MS / 2) + pty.lastOutputAt = Date.now() + leaf.lastOutputAt = Date.now() + // The next sweep lands inside the quiet window measured from that paint. + await vi.advanceTimersByTimeAsync(INTERVAL_MS / 2) + expect(resolved).toEqual([]) + // A pane that cannot settle yet costs no process inspection. + expect(foregroundReads).toEqual([]) + + await vi.advanceTimersByTimeAsync(INTERVAL_MS) + expect(resolved).toEqual(['pty', 'leaf']) + expect(polls.activeTimerCount).toBe(0) + }) + + it('does not settle an agent that will announce rest itself on a quiet foreground', async () => { + const resolved: string[] = [] + const polls = createPolls('claude', resolved) + polls.startPty(makeWaiter('pty'), makePty('pty-claude', { lastOutputAt: Date.now() })) + + await vi.advanceTimersByTimeAsync(INTERVAL_MS * 5) + expect(resolved).toEqual([]) + }) +}) diff --git a/src/main/runtime/runtime-terminal-idle-polls.ts b/src/main/runtime/runtime-terminal-idle-polls.ts index 7306914af1fb..d63b59974ee5 100644 --- a/src/main/runtime/runtime-terminal-idle-polls.ts +++ b/src/main/runtime/runtime-terminal-idle-polls.ts @@ -15,21 +15,36 @@ import { evaluateTuiIdle, leafTuiIdleEvidence, ptyTuiIdleEvidence, + type QuietForegroundLane, type TuiIdleEvidenceSource, type TuiIdleVerdict } from './tui-idle-evidence' /** - * Why null counts as quiet: a record with no output timestamp has produced nothing the - * RUNTIME OBSERVED since it was created. That is not the same as silence — the reachable - * case is a daemon-hosted pane whose bytes never reach the runtime, which may still be - * streaming. The trade is deliberate: "never settles" becomes "settles uncorroborated", + * Why null counts as quiet on an `open` lane: a record with no output timestamp has produced + * nothing the RUNTIME OBSERVED since it was created. That is not the same as silence — the + * reachable case is a daemon-hosted pane whose bytes never reach the runtime, which may still + * be streaming. The trade is deliberate: "never settles" becomes "settles uncorroborated", * the caller keeps its timeout, and delivery cannot reach this lane. Reading it as `0ms since output` * inverted that — `0 >= quiescenceMs` is false forever, so an adopted pane that never * emitted could not settle no matter how long the caller waited. + * Why not on `after-paint`: that pane runs a known agent, whose TUI must paint before it can + * take input, so until the command has painted it is still booting. The shell's prompt and + * echoed command line are not the agent's paint (see terminal-command-paint.ts). */ -function isQuietForQuiescence(lastOutputAt: number | null, quiescenceMs: number): boolean { - return lastOutputAt === null ? true : Date.now() - lastOutputAt >= quiescenceMs +function isQuietForQuiescence( + lastOutputAt: number | null, + quiescenceMs: number, + lane: QuietForegroundLane, + commandPainted: () => boolean +): boolean { + if (lane === 'after-paint' && !commandPainted()) { + return false + } + if (lastOutputAt === null) { + return lane === 'open' + } + return Date.now() - lastOutputAt >= quiescenceMs } import type { TerminalWaiter } from './runtime-terminal-contracts' import type { RuntimeLeafRecord, RuntimePtyWorktreeRecord } from './runtime-terminal-state-records' @@ -37,6 +52,8 @@ import type { RuntimeLeafRecord, RuntimePtyWorktreeRecord } from './runtime-term type RuntimeTerminalIdlePollDependencies = TuiIdleEvidenceSource & { intervalMs: number getForegroundProcess(ptyId: string): Promise | null + /** Whether the pane's running command has painted anything of its own. */ + hasCommandPainted(ptyId: string): boolean /** The pane's rendered viewport, or null when the runtime holds no screen model for it. */ readVisibleScreen(ptyId: string): Promise | null /** Re-read the record the waiter registered against; see `sample` below. */ @@ -56,7 +73,7 @@ type IdlePollSample = { ptyId: string | null ready(): RuntimeTerminalWait blocked(reason: RuntimeTerminalWaitBlockedReason): RuntimeTerminalWait - isQuiet(): boolean + isQuiet(lane: QuietForegroundLane): boolean } const IDLE_ENTRY_FLAGS = { foregroundPollInFlight: false, screenReadInFlight: false } @@ -120,7 +137,10 @@ export class RuntimeTerminalIdlePolls { ptyId: pty.ptyId, ready: () => buildPtyTerminalWaitResult(handle, 'tui-idle', pty), blocked: (reason) => buildPtyTerminalWaitBlockedResult(handle, 'tui-idle', pty, reason), - isQuiet: () => isQuietForQuiescence(pty.lastOutputAt, this.deps.quiescenceMs) + isQuiet: (lane) => + isQuietForQuiescence(pty.lastOutputAt, this.deps.quiescenceMs, lane, () => + this.deps.hasCommandPainted(pty.ptyId) + ) } } // Why re-read: `syncWindowGraph` rebuilds `this.leaves` with fresh objects on every @@ -136,7 +156,13 @@ export class RuntimeTerminalIdlePolls { ptyId: leaf.ptyId, ready: () => buildTerminalWaitResult(handle, 'tui-idle', live()), blocked: (reason) => buildTerminalWaitBlockedResult(handle, 'tui-idle', live(), reason), - isQuiet: () => isQuietForQuiescence(live().lastOutputAt, this.deps.quiescenceMs) + isQuiet: (lane) => + isQuietForQuiescence( + live().lastOutputAt, + this.deps.quiescenceMs, + lane, + () => !leaf.ptyId || this.deps.hasCommandPainted(leaf.ptyId) + ) } } @@ -177,7 +203,10 @@ export class RuntimeTerminalIdlePolls { this.settle(entry, sample.ready()) return } - if (verdict.quietForeground && ptyId && !entry.foregroundPollInFlight) { + const lane = verdict.quietForeground + // Why quiet before the read too: a streaming or not-yet-painted pane cannot settle, so it + // must not pay a process inspection every tick for a whole turn. + if (lane !== 'closed' && ptyId && !entry.foregroundPollInFlight && sample.isQuiet(lane)) { const foregroundRead = this.deps.getForegroundProcess(ptyId) if (!foregroundRead) { return @@ -185,7 +214,7 @@ export class RuntimeTerminalIdlePolls { entry.foregroundPollInFlight = true startedForegroundPoll = true const foreground = await foregroundRead - if (foreground && !isShellProcess(foreground) && sample.isQuiet()) { + if (foreground && !isShellProcess(foreground) && sample.isQuiet(lane)) { this.settle(entry, sample.ready()) } } diff --git a/src/main/runtime/runtime-terminal-state-records.ts b/src/main/runtime/runtime-terminal-state-records.ts index 82e5124bf402..d030b896da99 100644 --- a/src/main/runtime/runtime-terminal-state-records.ts +++ b/src/main/runtime/runtime-terminal-state-records.ts @@ -11,6 +11,7 @@ import type { HeadlessEmulator } from '../daemon/headless-emulator' import type { PtyProviderBufferSnapshot } from '../providers/types' import type { RetainedTailRedrawCursor } from './terminal-tail-redraw-buffer' import type { TerminalTailWaitState } from './terminal-wait-tail-state' +import type { TerminalCommandPaint } from './terminal-command-paint' import type { PtyShellOwnershipMirror } from './pty-shell-ownership-mirror' import type { TerminalExitCause } from '../../shared/terminal-exit-cause' import type { AgentSessionOwnerBinding } from '../../shared/agent-session-host-authority' @@ -87,6 +88,8 @@ export type RuntimePtyWorktreeRecord = RuntimeTerminalTailState & { title: string | null titleUpdatedAt: number | null lastOutputAt: number | null + /** See terminal-command-paint.ts; absent until the pane's first output, and again after a gap or a new process. */ + commandPaint?: TerminalCommandPaint } export type RuntimePtyTabCloseAuthority = { diff --git a/src/main/runtime/terminal-command-paint.test.ts b/src/main/runtime/terminal-command-paint.test.ts new file mode 100644 index 000000000000..54493da686fb --- /dev/null +++ b/src/main/runtime/terminal-command-paint.test.ts @@ -0,0 +1,52 @@ +import { describe, expect, it } from 'vitest' +import { + hasTerminalCommandPainted, + observeTerminalCommandPaint, + type TerminalCommandPaintRecord +} from './terminal-command-paint' +import { normalizeTerminalChunk } from './terminal-ansi-normalization' + +function observe(record: TerminalCommandPaintRecord, data: string): void { + observeTerminalCommandPaint(record, data, normalizeTerminalChunk(data).text) +} + +describe('terminal command paint', () => { + it('reads a pane with no command-start marker as painted', () => { + const record: TerminalCommandPaintRecord = {} + observe(record, '~/repo % ') + expect(hasTerminalCommandPainted(record)).toBe(true) + }) + + it('does not count the prompt, the echoed command, or a title set after the marker', () => { + const record: TerminalCommandPaintRecord = {} + observe(record, '\x1b]133;A\x07~/repo % amp\r\n\x1b]133;C\x07\x1b]0;amp\x07') + expect(hasTerminalCommandPainted(record)).toBe(false) + observe(record, '\x1b[?1049h\x1b[?25l\r\n') + expect(hasTerminalCommandPainted(record)).toBe(false) + observe(record, '\x1b[2;3H╭─ Amp') + expect(hasTerminalCommandPainted(record)).toBe(true) + }) + + it('counts a paint that arrives in the same chunk as the marker', () => { + const record: TerminalCommandPaintRecord = {} + observe(record, '\x1b]133;C\x1b\\\x1b[?1049hLIVE-TUI') + expect(hasTerminalCommandPainted(record)).toBe(true) + }) + + it('finds a marker split across chunks, and counts only output after it', () => { + const record: TerminalCommandPaintRecord = {} + observe(record, '~/repo % amp\r\n\x1b]13') + observe(record, '3;C\x07') + expect(hasTerminalCommandPainted(record)).toBe(false) + observe(record, '\x1b]133;C;cmdline_url=') + observe(record, 'amp\x07╭─ Amp') + expect(hasTerminalCommandPainted(record)).toBe(true) + }) + + it('starts over at the next command', () => { + const record: TerminalCommandPaintRecord = {} + observe(record, '\x1b]133;C\x07goose> ') + observe(record, '\x1b]133;D;0\x07\x1b]133;A\x07% goose\r\n\x1b]133;C\x07') + expect(hasTerminalCommandPainted(record)).toBe(false) + }) +}) diff --git a/src/main/runtime/terminal-command-paint.ts b/src/main/runtime/terminal-command-paint.ts new file mode 100644 index 000000000000..d415d52dae7d --- /dev/null +++ b/src/main/runtime/terminal-command-paint.ts @@ -0,0 +1,66 @@ +import { stripAnsiEscapeSequences } from '../../shared/ansi-escape-sequences' +import { createOsc133CommandFinishedScanner } from '../../shared/terminal-osc133-command-finished' +import { normalizeTerminalChunk } from './terminal-ansi-normalization' + +// eslint-disable-next-line no-control-regex -- control bytes are exactly what is not visible. +const VISIBLE_CHARACTER_RE = /[^\s\u0000-\u001f\u007f-\u009f]/ + +function hasVisibleText(normalizedText: string): boolean { + return VISIBLE_CHARACTER_RE.test(stripAnsiEscapeSequences(normalizedText)) +} + +/** + * Where the running command's own output begins. Orca's shell integration prints OSC 133;C + * after the prompt and the echoed command line, right before the command runs, so only + * visible output after it can be the command's. + */ +export class TerminalCommandPaint { + private awaitingPaint = false + private markerEndInChunk = -1 + private readonly scanner = createOsc133CommandFinishedScanner( + () => {}, + (endInChunk) => { + this.markerEndInChunk = endInChunk + } + ) + + observe(data: string, normalizedText: string): void { + this.markerEndInChunk = -1 + this.scanner.scan(data) + if (this.markerEndInChunk !== -1) { + // Why the rest of this chunk counts: a fast binary can paint in the same read as the marker. + this.awaitingPaint = !hasVisibleText( + normalizeTerminalChunk(data.slice(this.markerEndInChunk)).text + ) + return + } + if (this.awaitingPaint && hasVisibleText(normalizedText)) { + this.awaitingPaint = false + } + } + + hasPainted(): boolean { + return !this.awaitingPaint + } +} + +export type TerminalCommandPaintRecord = { commandPaint?: TerminalCommandPaint } + +/** `normalizedText` is the chunk as the tail buffer received it (pending escapes resolved). */ +export function observeTerminalCommandPaint( + record: TerminalCommandPaintRecord, + data: string, + normalizedText: string +): void { + record.commandPaint ??= new TerminalCommandPaint() + record.commandPaint.observe(data, normalizedText) +} + +/** + * Why no marker reads as painted: some launches get no command boundary (older fish, SSH relay + * zsh, shells Orca could not wrap, and Windows launches that pass the command in shell args), so + * any output is all the evidence there is. + */ +export function hasTerminalCommandPainted(record: TerminalCommandPaintRecord): boolean { + return record.commandPaint?.hasPainted() ?? true +} diff --git a/src/main/runtime/terminal-wait-name-only-idle.test.ts b/src/main/runtime/terminal-wait-name-only-idle.test.ts index 3ad2e74d2e60..cf4648bf3539 100644 --- a/src/main/runtime/terminal-wait-name-only-idle.test.ts +++ b/src/main/runtime/terminal-wait-name-only-idle.test.ts @@ -59,6 +59,7 @@ function createWait(options: { ...shared, intervalMs: POLL_INTERVAL_MS, getForegroundProcess: () => Promise.resolve(options.foreground ?? null), + hasCommandPainted: () => true, getLiveLeaf: (leaf) => options.liveLeaf?.() ?? leaf, resolve: (waiter, result) => waiters.resolve(waiter, result) }) diff --git a/src/main/runtime/tui-idle-command-paint.test.ts b/src/main/runtime/tui-idle-command-paint.test.ts new file mode 100644 index 000000000000..fda31e06ebbe --- /dev/null +++ b/src/main/runtime/tui-idle-command-paint.test.ts @@ -0,0 +1,57 @@ +/** + * An agent with no rest signal of its own (amp) settles only on a quiet foreground, and only + * once it has painted. The shell's prompt and the echoed launch command land first, so the + * runtime must tell them apart from the agent's paint by the shell's command-start marker. + */ + +import { afterEach, describe, expect, it, vi } from 'vitest' +import { createTranscriptPane, TRANSCRIPT_PANE_PTY_ID } from './agent-transcript-pane-test-harness' + +const POLL_INTERVAL_MS = 2_000 + +describe('tui-idle on an agent with no rest signal', () => { + afterEach(() => { + vi.useRealTimers() + }) + + it('waits through a silent boot after the shell echoed the command, then settles on the paint', async () => { + const { runtime, handle } = await createTranscriptPane({ + paneTitle: 'Terminal', + foregroundProcess: 'amp', + launchAgent: 'amp', + data: '' + }) + vi.useFakeTimers() + const write = (chunk: string) => runtime.onPtyData(TRANSCRIPT_PANE_PTY_ID, chunk, Date.now()) + write('\x1b]133;A\x07~/repo % amp\r\n\x1b]133;C\x07\x1b]0;amp\x07') + const settled = vi.fn() + const wait = runtime.waitForTerminal(handle, { condition: 'tui-idle', timeoutMs: 60_000 }) + wait.then(settled, () => {}) + + await vi.advanceTimersByTimeAsync(POLL_INTERVAL_MS * 5) + expect(settled).not.toHaveBeenCalled() + + write('\x1b[?1049h\x1b[H╭─ Amp ─╮\r\n│ > │') + await vi.advanceTimersByTimeAsync(POLL_INTERVAL_MS * 3) + await expect(wait).resolves.toMatchObject({ satisfied: true }) + }) + + it('does not finish a command-start marker cut off by dropped output', async () => { + const { runtime, handle } = await createTranscriptPane({ + paneTitle: 'Terminal', + foregroundProcess: 'amp', + launchAgent: 'amp', + data: '' + }) + vi.useFakeTimers() + const write = (chunk: string) => runtime.onPtyData(TRANSCRIPT_PANE_PTY_ID, chunk, Date.now()) + // Fish's marker carries the command line, so a cut-off one can terminate on unrelated output. + write('~/repo % amp\r\n\x1b]133;C;cmdline_url=am') + runtime.notePtyDataGap(TRANSCRIPT_PANE_PTY_ID, 4096) + write('╭─ Amp ─╮\r\n│ > │\x1b]0;amp\x07') + const wait = runtime.waitForTerminal(handle, { condition: 'tui-idle', timeoutMs: 60_000 }) + + await vi.advanceTimersByTimeAsync(POLL_INTERVAL_MS * 3) + await expect(wait).resolves.toMatchObject({ satisfied: true }) + }) +}) diff --git a/src/main/runtime/tui-idle-evidence.test.ts b/src/main/runtime/tui-idle-evidence.test.ts index ec88c3368a3d..de9e955099cd 100644 --- a/src/main/runtime/tui-idle-evidence.test.ts +++ b/src/main/runtime/tui-idle-evidence.test.ts @@ -1,6 +1,12 @@ import { describe, expect, it } from 'vitest' +import { detectAgentStatusFromTitle } from '../../shared/agent-title-status' +import { getSyntheticAgentTerminalTitle } from '../../shared/synthetic-agent-title' +import { isTuiAgent, TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' +import { getTuiAgentRestSignal } from '../../shared/tui-agent-rest-signal' +import { isKnownReadyPromptBody } from './terminal-wait-detection' import { evaluateTuiIdle, + hasFreshDoneFirstPartyStatus, isTuiIdleReadyVerdict, hasQuietMuseReadyPrompt, nameOnlyIdleNeedsCorroboration, @@ -121,7 +127,7 @@ describe('evaluateTuiIdle ranking', () => { }) expect(evaluateTuiIdle(input({ ...noMuse, agent: 'claude', record: streaming }))).toEqual({ kind: 'pending', - quietForeground: false + quietForeground: 'closed' }) const quiet = record({ lastAgentStatus: 'idle', lastOscTitle: 'claude' }) expect(evaluateTuiIdle(input({ ...noMuse, agent: 'claude', record: quiet }))).toEqual({ @@ -145,18 +151,72 @@ describe('evaluateTuiIdle ranking', () => { firstPartyStatus: { state: 'blocked', updatedAt: Date.now() } }) ) - expect(verdict).toEqual({ kind: 'pending', quietForeground: false }) + expect(verdict).toEqual({ kind: 'pending', quietForeground: 'closed' }) }) - it('leaves the quiet-foreground lane open only for an unidentified pane with no title status', () => { + it('leaves the quiet-foreground lane open for an unidentified pane with no title status', () => { expect(evaluateTuiIdle(input({ ...noMuse, agent: null }))).toEqual({ kind: 'pending', - quietForeground: true + quietForeground: 'open' }) - expect(evaluateTuiIdle(input({ ...noMuse, agent: 'claude' }))).toEqual({ - kind: 'pending', - quietForeground: false + }) + + it('closes the quiet-foreground lane for an agent with a stronger rest signal still to come', () => { + for (const agent of ['claude', 'codex', 'grok', 'dsh'] as const) { + expect(evaluateTuiIdle(input({ ...noMuse, agent }))).toEqual({ + kind: 'pending', + quietForeground: 'closed' + }) + } + }) + + // Why: a launched agent whose title Orca cannot classify has no other lane; closing this + // one for every known agent left `worker start` failing at agent_readiness (STA-7440). + it('keeps the quiet-foreground lane for an agent with no other rest signal, after it paints', () => { + for (const agent of ['amp', 'goose', 'crush', 'kimi', 'qwen-code', 'rovo', 'aug'] as const) { + expect(evaluateTuiIdle(input({ ...noMuse, agent }))).toEqual({ + kind: 'pending', + quietForeground: 'after-paint' + }) + } + }) + + it('closes the lane once any title has classified, so a title that does arrive outranks it', () => { + const verdict = evaluateTuiIdle( + input({ ...noMuse, agent: 'amp', record: record({ lastAgentStatus: 'permission' }) }) + ) + expect(verdict).toEqual({ kind: 'pending', quietForeground: 'closed' }) + }) +}) + +// Why: `none` reopens the quiet-foreground lane, which is only safe where no stronger lane +// could have settled the wait; the identity-keyed lanes must agree with the declared signal. +describe('rest signal agrees with the lanes that can settle a wait', () => { + it.each(Object.keys(TUI_AGENT_CONFIG).filter(isTuiAgent))('%s', (agent) => { + const signal = getTuiAgentRestSignal(agent) + const hookDone = hasFreshDoneFirstPartyStatus(agent, { state: 'done', updatedAt: Date.now() }) + expect(hookDone).toBe(signal === 'hook-done') + let screenRead = false + isKnownReadyPromptBody('', agent, () => { + screenRead = true + return null }) + const museBody = hasQuietMuseReadyPrompt(record(), agent, () => true, QUIESCENCE_MS) + if (museBody) { + expect(signal).toBe('ready-body') + } + // Why a screen read also counts: Qoder's ready body is its composer, read by identity. + if (signal === 'ready-body') { + expect(museBody || screenRead).toBe(true) + } + if (signal !== 'none') { + return + } + expect({ + screenRead, + syntheticTitle: getSyntheticAgentTerminalTitle(agent, 'done'), + processTitle: detectAgentStatusFromTitle(TUI_AGENT_CONFIG[agent].expectedProcess) + }).toEqual({ screenRead: false, syntheticTitle: null, processTitle: null }) }) }) diff --git a/src/main/runtime/tui-idle-evidence.ts b/src/main/runtime/tui-idle-evidence.ts index 87027ab4bc37..c9cd6675d384 100644 --- a/src/main/runtime/tui-idle-evidence.ts +++ b/src/main/runtime/tui-idle-evidence.ts @@ -8,6 +8,7 @@ import type { RuntimeTerminalWaitBlockedReason } from '../../shared/runtime-type import { getSyntheticAgentTerminalTitle } from '../../shared/synthetic-agent-title' import { resolveExplicitTerminalTitleAgentType } from '../../shared/terminal-title-agent-type' import type { TuiAgent } from '../../shared/tui-agent' +import { getTuiAgentRestSignal } from '../../shared/tui-agent-rest-signal' import type { RuntimeLeafRecord, RuntimePtyWorktreeRecord } from './runtime-terminal-state-records' import { detectExplicitIdleStatusFromTitle, @@ -157,13 +158,22 @@ export function hasSustainedTitleIdle( } /** - * Tier 3, cold start: Orca launched a known agent on this PTY, so a quiet non-shell - * foreground process is an agent still booting, not one sitting at its prompt. Resolving - * on it is what let `dispatch --inject` write into a TUI that had not yet attached its - * reader and silently lose the prompt (#9976). + * When a quiet non-shell foreground process may settle a pending wait. + * - `closed`: the agent has a stronger rest signal, so its silence is boot, not rest. + * Resolving on it let `dispatch --inject` write into a TUI that had not yet attached + * its reader and silently lose the prompt (#9976). + * - `after-paint`: Orca knows an agent runs here but it has no other rest signal, so this + * lane is its only one. A TUI that has painted nothing yet is still booting. + * - `open`: nothing is known about the pane, so a missing output clock also counts as quiet + * (see isQuietForQuiescence). */ -export function quietForegroundProcessProvesTuiIdle(agent: TuiAgent | null | undefined): boolean { - return !agent +export type QuietForegroundLane = 'closed' | 'after-paint' | 'open' + +function quietForegroundLane(agent: TuiAgent | null | undefined): QuietForegroundLane { + if (!agent) { + return 'open' + } + return getTuiAgentRestSignal(agent) === 'none' ? 'after-paint' : 'closed' } export type TuiIdleEvaluationInput = { @@ -191,8 +201,7 @@ export type TuiIdleVerdict = | { kind: 'ready-weak' } /** The agent says it is mid-turn: nothing may settle, and its screen is not read. */ | { kind: 'working' } - /** `quietForeground`: whether a quiet non-shell foreground process may still settle it. */ - | { kind: 'pending'; quietForeground: boolean } + | { kind: 'pending'; quietForeground: QuietForegroundLane } const READY_STRONG: TuiIdleVerdict = { kind: 'ready-strong' } const READY_WEAK: TuiIdleVerdict = { kind: 'ready-weak' } @@ -244,7 +253,7 @@ export function evaluateTuiIdle(input: TuiIdleEvaluationInput): TuiIdleVerdict { } return input.readPositiveBodyEvidence() ? READY_STRONG - : { kind: 'pending', quietForeground: false } + : { kind: 'pending', quietForeground: 'closed' } } // Why the title before the body: both are tier 1, so either settles, but the title is a // memoized lookup and the body is a fresh multi-KB scan. Same verdict, cheaper order. @@ -261,7 +270,7 @@ export function evaluateTuiIdle(input: TuiIdleEvaluationInput): TuiIdleVerdict { // when a dialog is on screen, so the screen read must still run. return input.firstPartyStatus?.state === 'working' ? WORKING - : { kind: 'pending', quietForeground: false } + : { kind: 'pending', quietForeground: 'closed' } } // Why after the veto: a first-party working account outranks inferred body evidence. if ( @@ -283,7 +292,7 @@ export function evaluateTuiIdle(input: TuiIdleEvaluationInput): TuiIdleVerdict { return { kind: 'pending', quietForeground: - input.record.lastAgentStatus === null && quietForegroundProcessProvesTuiIdle(input.agent) + input.record.lastAgentStatus === null ? quietForegroundLane(input.agent) : 'closed' } } diff --git a/src/renderer/src/components/terminal-pane/terminal-command-lifecycle.ts b/src/renderer/src/components/terminal-pane/terminal-command-lifecycle.ts index 61ad0891fa61..5d60514842e9 100644 --- a/src/renderer/src/components/terminal-pane/terminal-command-lifecycle.ts +++ b/src/renderer/src/components/terminal-pane/terminal-command-lifecycle.ts @@ -15,9 +15,9 @@ export function createTerminalCommandLifecycle(options: TerminalCommandLifecycle // Why: the byte parsing lives in shared so main's side-effect tracker emits // identical command-finished facts for local/SSH PTYs; this renderer wrapper // remains the byte path for remote-runtime PTYs and the kill-switch-off mode. - const scanner = createOsc133CommandFinishedScanner( - options.onCommandFinished, - options.onCommandStarted + // Why the wrapper: the scanner passes a chunk offset, which a callback with its own optional parameter must not receive. + const scanner = createOsc133CommandFinishedScanner(options.onCommandFinished, () => + options.onCommandStarted?.() ) const disposables: IDisposable[] = [] diff --git a/src/shared/pane-agent-identity-inventory.test.ts b/src/shared/pane-agent-identity-inventory.test.ts index 41ca5090dafc..028207cdfb9a 100644 --- a/src/shared/pane-agent-identity-inventory.test.ts +++ b/src/shared/pane-agent-identity-inventory.test.ts @@ -308,7 +308,8 @@ const INVENTORY: readonly InventoryGroup[] = [ ['src/renderer/src/components/terminal-pane/agent-completion-title-observer.ts', 2], ['src/renderer/src/components/terminal-pane/pty-connection/shell-command-inference.ts', 4], ['src/renderer/src/components/terminal-pane/pty-output-title-observer.ts', 2], - ['src/shared/terminal-output-side-effects.ts', 3] + ['src/shared/terminal-output-side-effects.ts', 3], + ['src/shared/tui-agent-rest-signal.ts', 2] ] }, { diff --git a/src/shared/terminal-osc133-command-finished.ts b/src/shared/terminal-osc133-command-finished.ts index 9468e1aaa5f6..f0a9831d029a 100644 --- a/src/shared/terminal-osc133-command-finished.ts +++ b/src/shared/terminal-osc133-command-finished.ts @@ -59,15 +59,19 @@ export type Osc133CommandFinishedScanner = { export function createOsc133CommandFinishedScanner( onCommandFinished: (bestEffortExitCode: number | null) => void, - /** OSC 133;C — the shell exec'd a command; the pane's foreground changed. */ - onCommandStarted?: () => void + /** + * OSC 133;C — the shell exec'd a command; the pane's foreground changed. + * `endInChunk` is the index in the scanned chunk just past the sequence, where the command's own + * output begins. + */ + onCommandStarted?: (endInChunk: number) => void ): Osc133CommandFinishedScanner { let carry = '' - const handleOsc133 = (payload: string): void => { + const handleOsc133 = (payload: string, endInChunk: number): void => { const [sequence, exitCode] = payload.split(';') if (sequence === 'C') { - onCommandStarted?.() + onCommandStarted?.(endInChunk) return } if (sequence === 'D') { @@ -77,6 +81,8 @@ export function createOsc133CommandFinishedScanner( const scan = (data: string): void => { let combined = carry + data + // `combined` starts at this index in `data`; negative while it still holds the carry. + let combinedStartInChunk = -carry.length carry = '' while (combined.length > 0) { @@ -97,8 +103,13 @@ export function createOsc133CommandFinishedScanner( return } - handleOsc133(combined.slice(payloadStart, terminator.index)) - combined = combined.slice(terminator.index + terminator.length) + const sequenceEnd = terminator.index + terminator.length + handleOsc133( + combined.slice(payloadStart, terminator.index), + combinedStartInChunk + sequenceEnd + ) + combined = combined.slice(sequenceEnd) + combinedStartInChunk += sequenceEnd } } diff --git a/src/shared/tui-agent-rest-signal.test.ts b/src/shared/tui-agent-rest-signal.test.ts new file mode 100644 index 000000000000..f7d110328755 --- /dev/null +++ b/src/shared/tui-agent-rest-signal.test.ts @@ -0,0 +1,62 @@ +import { describe, expect, it } from 'vitest' +import type { TuiAgent } from './tui-agent' +import { isTuiAgent, TUI_AGENT_CONFIG } from './tui-agent-config' +import { getTuiAgentRestSignal, type TuiAgentRestSignal } from './tui-agent-rest-signal' + +// Why a full Record: adding a TuiAgent fails to compile here until someone decides what its +// rest signal is, and a title-table change that moves an agent shows up in review. +const EXPECTED_REST_SIGNALS: Record = { + dsh: 'hook-done', + codex: 'synthetic-title', + cursor: 'synthetic-title', + pi: 'synthetic-title', + omp: 'synthetic-title', + droid: 'synthetic-title', + hermes: 'synthetic-title', + devin: 'synthetic-title', + zcode: 'synthetic-title', + claude: 'title', + 'claude-agent-teams': 'title', + openclaude: 'title', + opencode: 'title', + opencode2: 'title', + 'mimo-code': 'title', + gemini: 'title', + antigravity: 'title', + aider: 'title', + openclaw: 'title', + copilot: 'title', + grok: 'title', + muse: 'ready-body', + qoder: 'ready-body', + autohand: 'none', + ante: 'none', + trae: 'none', + 'prime-agent': 'none', + goose: 'none', + amp: 'none', + kilo: 'none', + kiro: 'none', + crush: 'none', + aug: 'none', + cline: 'none', + codebuff: 'none', + freebuff: 'none', + 'command-code': 'none', + continue: 'none', + kimi: 'none', + 'mistral-vibe': 'none', + 'qwen-code': 'none', + rovo: 'none' +} + +describe('getTuiAgentRestSignal', () => { + it('declares a rest signal for every launchable agent', () => { + const derived = Object.fromEntries( + Object.keys(TUI_AGENT_CONFIG) + .filter(isTuiAgent) + .map((agent) => [agent, getTuiAgentRestSignal(agent)]) + ) + expect(derived).toEqual(EXPECTED_REST_SIGNALS) + }) +}) diff --git a/src/shared/tui-agent-rest-signal.ts b/src/shared/tui-agent-rest-signal.ts new file mode 100644 index 000000000000..93f694a5d799 --- /dev/null +++ b/src/shared/tui-agent-rest-signal.ts @@ -0,0 +1,41 @@ +import { detectAgentStatusFromTitle } from './agent-title-status' +import { getSyntheticAgentTerminalTitle } from './synthetic-agent-title' +import type { TuiAgent } from './tui-agent' +import { TUI_AGENT_CONFIG } from './tui-agent-config' + +/** + * The strongest lane tui-idle-evidence.ts trusts to say an agent's TUI is at rest: + * - `hook-done`: its own hook reports the lead turn ended (DSH). + * - `synthetic-title`: its hooks drive an Orca-written ` ready` title. + * - `title`: its running process names itself in a title the status classifier reads. + * - `ready-body`: a ready screen Orca recognises (Muse; Qoder, whose idle title can show while + * its trust menu still owns input). + * - `none`: no stronger lane, so a quiet foreground process is its only one. Hooks or a first-party + * `done` (amp, kimi, command-code, freebuff) do not count: tui-idle takes their `working` as a + * veto, and trusts a first-party `done` only from DSH. + */ +export type TuiAgentRestSignal = 'hook-done' | 'synthetic-title' | 'title' | 'ready-body' | 'none' + +/** Lanes keyed on agent identity in tui-idle-evidence.ts, which no title table records. */ +const IDENTITY_REST_SIGNALS: Partial> = { + dsh: 'hook-done', + muse: 'ready-body', + qoder: 'ready-body' +} + +// Why derived, not declared per agent: the title tables are the evidence, so a second +// hand-kept copy could only drift from them. An agent with no evidence falls to `none`. +export function getTuiAgentRestSignal(agent: TuiAgent): TuiAgentRestSignal { + const identitySignal = IDENTITY_REST_SIGNALS[agent] + if (identitySignal) { + return identitySignal + } + if (getSyntheticAgentTerminalTitle(agent, 'done') !== null) { + return 'synthetic-title' + } + // Why the process name: the title tables match an agent by the name it runs as. + if (detectAgentStatusFromTitle(TUI_AGENT_CONFIG[agent].expectedProcess) !== null) { + return 'title' + } + return 'none' +} From 64dbe87de6c9ab7d45fa0b087dd5f1ac02bdf6a8 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:54:02 -0700 Subject: [PATCH 44/90] test(terminal): wait for decoy panes before host parking (#23729) --- .../host-parked-pane-remote-viewer.spec.ts | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/tests/e2e/host-parked-pane-remote-viewer.spec.ts b/tests/e2e/host-parked-pane-remote-viewer.spec.ts index 6846369f9de5..f2f8dd7fb397 100644 --- a/tests/e2e/host-parked-pane-remote-viewer.spec.ts +++ b/tests/e2e/host-parked-pane-remote-viewer.spec.ts @@ -45,7 +45,7 @@ import { launchPairedElectronClient } from './helpers/paired-electron-client' import { focusActiveTerminalInput } from './helpers/terminal' -import { waitForTabParked } from './helpers/terminal-hidden-parking' +import { parkHiddenTabBehindDecoy } from './helpers/terminal-hidden-parking' const PARK_DELAY_MS = 30_000 const PAINT_BUDGET_MS = 20_000 @@ -269,19 +269,6 @@ test('a cold-parked host pane keeps serving its paired remote viewer', async ({ // 3. The host cold-parks the pane the client is watching. Nobody touches // it on the host again. - // Two decoy tabs on the host: one to age the target, one to take the - // most-recently-hidden exemption. Sampled before and after the park lands - // so decoy churn cannot be mistaken for the park itself. - for (let i = 0; i < 2; i += 1) { - await orcaPage.evaluate((id) => { - const state = window.__store?.getState() - const tab = state?.createTab(id, undefined, undefined, { activate: true }) - if (tab) { - state?.setActiveTab(tab.id) - state?.setActiveTabType('terminal', window.__store?.getState().activeWorktreeId ?? null) - } - }, worktreeId) - } const readClientState = async (): Promise => client.page.evaluate((id) => { const manager = window.__paneManagers?.get(id) @@ -292,8 +279,10 @@ test('a cold-parked host pane keeps serving its paired remote viewer', async ({ recoveryState: pane?.container?.dataset?.ptyRecoveryState ?? null } }, webTabId) - console.log(`[sta2854] decoys-created client=${JSON.stringify(await readClientState())}`) - await waitForTabParked(orcaPage, hostTabId, { parkDelayMs: PARK_DELAY_MS }) + console.log(`[sta2854] before-park client=${JSON.stringify(await readClientState())}`) + await parkHiddenTabBehindDecoy(orcaPage, worktreeId, hostTabId, { + parkDelayMs: PARK_DELAY_MS + }) console.log(`[sta2854] post-park client=${JSON.stringify(await readClientState())}`) // Direct probe: is the host-minted terminal handle still resolvable once From 8bb78f0dddc8d343bacdf968b2370f8773227095 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 17:07:07 -0700 Subject: [PATCH 45/90] test(browser): create probe body before starting frame requests (#23730) --- src/main/browser/browser-session-ua-wire-probe-server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/browser/browser-session-ua-wire-probe-server.ts b/src/main/browser/browser-session-ua-wire-probe-server.ts index d00117ad86b8..6062ed3df917 100644 --- a/src/main/browser/browser-session-ua-wire-probe-server.ts +++ b/src/main/browser/browser-session-ua-wire-probe-server.ts @@ -156,7 +156,7 @@ function probePage( const dedicatedWorkerScriptText = crossContext ? `const dedicatedDone = message('dedicated-worker'); const dedicated = new Worker(${JSON.stringify(httpOrigin)} + '/dedicated-worker.js'); dedicated.onmessage = event => postMessage(event.data, '*')` : '' - return `UA wire probe` + ` } function childPage( context: string, From bd5dca4406ff6b755474474625af8177b5821c36 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 17:14:03 -0700 Subject: [PATCH 46/90] fix(editor): preserve combined diff scroll on line focus (#23735) --- .../src/components/editor/DiffSectionBody.tsx | 2 + .../e2e/combined-diff-scroll-restore.spec.ts | 37 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/renderer/src/components/editor/DiffSectionBody.tsx b/src/renderer/src/components/editor/DiffSectionBody.tsx index 869d0de5a730..5ac46e175388 100644 --- a/src/renderer/src/components/editor/DiffSectionBody.tsx +++ b/src/renderer/src/components/editor/DiffSectionBody.tsx @@ -166,6 +166,8 @@ export function DiffSectionBody({ keepCurrentOriginalModel keepCurrentModifiedModel options={{ + // Native EditContext focus scrolls its hidden input into the combined viewport. + editContext: false, readOnly: !isEditable, originalEditable: false, renderSideBySide: sideBySide, diff --git a/tests/e2e/combined-diff-scroll-restore.spec.ts b/tests/e2e/combined-diff-scroll-restore.spec.ts index 496bead3db61..da02f8d0bdd0 100644 --- a/tests/e2e/combined-diff-scroll-restore.spec.ts +++ b/tests/e2e/combined-diff-scroll-restore.spec.ts @@ -370,26 +370,27 @@ async function clickVisibleDiffLine(page: Page): Promise { return null } const containerRect = container.getBoundingClientRect() - const visibleLine = Array.from( - container.querySelectorAll('.monaco-diff-editor .view-line') - ).find((line) => { + for (const line of container.querySelectorAll( + '.monaco-diff-editor .view-line' + )) { const rect = line.getBoundingClientRect() - return ( - rect.height > 0 && - rect.bottom > containerRect.top && - rect.top < containerRect.bottom && - rect.right > containerRect.left && - rect.left < containerRect.right - ) - }) - if (!visibleLine) { - return null - } - const rect = visibleLine.getBoundingClientRect() - return { - x: rect.left + Math.min(12, Math.max(1, rect.width / 2)), - y: rect.top + rect.height / 2 + const left = Math.max(rect.left, containerRect.left) + const right = Math.min(rect.right, containerRect.right) + const top = Math.max(rect.top, containerRect.top) + const bottom = Math.min(rect.bottom, containerRect.bottom) + if (left >= right || top >= bottom) { + continue + } + const point = { + x: left + Math.min(12, (right - left) / 2), + y: (top + bottom) / 2 + } + // Sticky headers can cover a line whose rectangle intersects the viewport. + if (line.contains(document.elementFromPoint(point.x, point.y))) { + return point + } } + return null }) return linePoint !== null }, From d606be3adef44c80214de3c29e28717b4c80d2be Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 17:45:09 -0700 Subject: [PATCH 47/90] test: wait for remote terminal grid convergence after reveal (#23738) * test: wait for revealed remote PTY grid convergence * test: retain reveal diagnostics on geometry failure --- ...rminal-parked-reveal-interactivity.spec.ts | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts b/tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts index a21c3ccab0da..7c413c061263 100644 --- a/tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts +++ b/tests/e2e/paired-remote-terminal-parked-reveal-interactivity.spec.ts @@ -286,7 +286,9 @@ async function probeInteractivity( `LINE:${token}`, LIVE_PAINT_BUDGET_MS ) - const paneGrid = await readActivePaneGrid(page, target.webTabId) + let paneGrid = await readActivePaneGrid(page, target.webTabId) + let ptyGrid = readPtyGridFromContent(readSink(target.sinkPath)) + console.log(`[paired-grid-initial] ${JSON.stringify({ name, paneGrid, ptyGrid })}`) const diagnostics = await readPaneDiagnostics(page, worktreeId, target.webTabId) const screenshotPath = test.info().outputPath(`paired-terminal-${name}.png`) await page.screenshot({ path: screenshotPath }) @@ -305,6 +307,31 @@ async function probeInteractivity( LIVE_PAINT_BUDGET_MS ) } + // Preserve the scenario report even when geometry fails to converge. + await expect + .configure({ soft: true }) + .poll( + async () => { + paneGrid = await readActivePaneGrid(page, target.webTabId) + ptyGrid = readPtyGridFromContent(readSink(target.sinkPath)) + return { + paneGrid, + ptyGrid, + converged: + paneGrid !== null && + ptyGrid !== null && + paneGrid.cols > 0 && + paneGrid.rows > 0 && + paneGrid.cols === ptyGrid.cols && + paneGrid.rows === ptyGrid.rows + } + }, + { + timeout: REVEAL_BUDGET_MS, + message: `${name}: revealed pane and host PTY grids did not converge` + } + ) + .toMatchObject({ converged: true }) const sink = readSink(target.sinkPath) return { name, @@ -313,7 +340,7 @@ async function probeInteractivity( paintedLive, paintedAfterFlip, paneGrid, - ptyGrid: readPtyGridFromContent(sink), + ptyGrid, diagnostics } } From da48d98040a106665d544e13f4b3e53dd73fc725 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 17:57:08 -0700 Subject: [PATCH 48/90] fix: bound combined diff editors and scope chat style invalidation (#23725) * fix(editor): bound offscreen combined diff rendering by height * perf: scope native chat relational styles to their ancestor --- .../combined-diff-render-range.test.ts | 55 +++++++++++++++++++ .../combined-diff-render-range.ts | 28 ++++++++++ .../use-combined-diff-virtualizer.ts | 21 ++++--- .../NativeChatBackgroundTasksStatus.tsx | 4 +- .../native-chat/NativeChatCodeBlock.tsx | 2 +- .../native-chat/NativeChatMessageRow.test.tsx | 8 +-- .../native-chat/NativeChatMessageRow.tsx | 4 +- ...veChatStructuredSession.goal-dock.test.tsx | 2 +- ...ned-diff-invalidation-freeze-repro.spec.ts | 1 + 9 files changed, 107 insertions(+), 18 deletions(-) create mode 100644 src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-render-range.test.ts create mode 100644 src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-render-range.ts diff --git a/src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-render-range.test.ts b/src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-render-range.test.ts new file mode 100644 index 000000000000..7f58e7c2a37f --- /dev/null +++ b/src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-render-range.test.ts @@ -0,0 +1,55 @@ +import { describe, expect, it } from 'vitest' +import { getCombinedDiffRenderRange } from './combined-diff-render-range' + +describe('combined diff render range', () => { + it('keeps visible large sections without mounting their large neighbors', () => { + expect( + getCombinedDiffRenderRange( + { startIndex: 2, endIndex: 3, count: 8, overscan: 5 }, + () => 230_000, + 800 + ) + ).toEqual([2, 3]) + }) + + it('pre-renders at most one viewport of small sections on each side', () => { + expect( + getCombinedDiffRenderRange( + { startIndex: 4, endIndex: 5, count: 10, overscan: 5 }, + () => 200, + 400 + ) + ).toEqual([2, 3, 4, 5, 6, 7]) + }) + + it('stops at a large neighboring section instead of skipping across it', () => { + const heights = [100, 230_000, 100, 100, 230_000, 100] + expect( + getCombinedDiffRenderRange( + { startIndex: 2, endIndex: 2, count: heights.length, overscan: 5 }, + (index) => heights[index], + 800 + ) + ).toEqual([2, 3]) + }) + + it('retains the row-count cap and list boundaries for short sections', () => { + expect( + getCombinedDiffRenderRange( + { startIndex: 1, endIndex: 2, count: 100, overscan: 5 }, + () => 28, + 800 + ) + ).toEqual([0, 1, 2, 3, 4, 5, 6, 7]) + }) + + it('renders only visible sections before the viewport is measured', () => { + expect( + getCombinedDiffRenderRange( + { startIndex: 1, endIndex: 2, count: 10, overscan: 5 }, + () => 88, + 0 + ) + ).toEqual([1, 2]) + }) +}) diff --git a/src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-render-range.ts b/src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-render-range.ts new file mode 100644 index 000000000000..0e57d785e864 --- /dev/null +++ b/src/renderer/src/components/editor/combined-diff/scroll-viewport/combined-diff-render-range.ts @@ -0,0 +1,28 @@ +import type { Range } from '@tanstack/react-virtual' + +export function getCombinedDiffRenderRange( + range: Range, + estimateHeight: (index: number) => number, + viewportHeight: number +): number[] { + let start = range.startIndex + let end = range.endIndex + const budget = Math.max(0, viewportHeight) + let height = 0 + while (start > 0 && range.startIndex - start < range.overscan) { + height += estimateHeight(start - 1) + if (height > budget) { + break + } + start -= 1 + } + height = 0 + while (end + 1 < range.count && end - range.endIndex < range.overscan) { + height += estimateHeight(end + 1) + if (height > budget) { + break + } + end += 1 + } + return Array.from({ length: end - start + 1 }, (_, offset) => start + offset) +} diff --git a/src/renderer/src/components/editor/combined-diff/scroll-viewport/use-combined-diff-virtualizer.ts b/src/renderer/src/components/editor/combined-diff/scroll-viewport/use-combined-diff-virtualizer.ts index d9874ea9265c..4cca1137afff 100644 --- a/src/renderer/src/components/editor/combined-diff/scroll-viewport/use-combined-diff-virtualizer.ts +++ b/src/renderer/src/components/editor/combined-diff/scroll-viewport/use-combined-diff-virtualizer.ts @@ -4,6 +4,7 @@ import { elementScroll, useVirtualizer, type Virtualizer } from '@tanstack/react import type { ProgrammaticScrollMarks } from '@/hooks/programmatic-scroll-marks' import type { DiffSection } from '../../diff-section-types' import { getDiffSectionRowEstimatedHeight } from '../../diff-section-layout' +import { getCombinedDiffRenderRange } from './combined-diff-render-range' const COMBINED_DIFF_OVERSCAN = 5 @@ -28,17 +29,21 @@ export function useCombinedDiffVirtualizer({ sections: DiffSection[] sideBySide: boolean }): Virtualizer { + const estimateSize = (index: number): number => { + const section = sections[index] + return section ? getDiffSectionRowEstimatedHeight(section, sectionHeights[index]) : 88 + } const virtualizer = useVirtualizer({ count: sections.length, getScrollElement: () => scrollContainerRef.current, - estimateSize: (index) => { - const section = sections[index] - if (!section) { - return 88 - } - - return getDiffSectionRowEstimatedHeight(section, sectionHeights[index]) - }, + estimateSize, + // Offscreen Monaco sections render their full height; bound that work by pixels, too. + rangeExtractor: (range) => + getCombinedDiffRenderRange( + range, + estimateSize, + scrollContainerRef.current?.clientHeight ?? 0 + ), overscan: COMBINED_DIFF_OVERSCAN, initialOffset: () => scrollOffsetRef.current, // Why: mark every virtualizer-issued scroll so events are attributed to the user only when this code didn't cause them. diff --git a/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx b/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx index 2e8cf51f18ff..de9ba8c655c0 100644 --- a/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx +++ b/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx @@ -178,10 +178,10 @@ export function NativeChatBackgroundTasksStatus(props: { className="group/tasks shrink-0 bg-background px-3 pt-2 sm:px-4" > {/* When the goal tab is the next sibling, take its width and share its top edge. */} -
+
diff --git a/src/renderer/src/components/native-chat/NativeChatMessageRow.test.tsx b/src/renderer/src/components/native-chat/NativeChatMessageRow.test.tsx index 996716a838fa..7097cb87aa4b 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageRow.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageRow.test.tsx @@ -60,9 +60,9 @@ describe('MessageRow control visibility', () => { 'can-hover:opacity-0', 'can-hover:pointer-events-none', 'group-hover:opacity-100', - 'group-has-[:focus-visible]:opacity-100', + '[.group:has(:focus-visible)_&]:opacity-100', 'group-hover:pointer-events-auto', - 'group-has-[:focus-visible]:pointer-events-auto' + '[.group:has(:focus-visible)_&]:pointer-events-auto' ) expect(copy.parentElement).not.toHaveClass('opacity-0', 'pointer-events-none') expect(time).not.toHaveAttribute('tabindex') @@ -79,9 +79,9 @@ describe('MessageRow control visibility', () => { 'can-hover:opacity-0', 'can-hover:pointer-events-none', 'group-hover:opacity-100', - 'group-has-[:focus-visible]:opacity-100', + '[.group:has(:focus-visible)_&]:opacity-100', 'group-hover:pointer-events-auto', - 'group-has-[:focus-visible]:pointer-events-auto' + '[.group:has(:focus-visible)_&]:pointer-events-auto' ) expect(copy.parentElement).not.toHaveClass('opacity-0', 'pointer-events-none') expect(copy.parentElement!.parentElement).toHaveClass('group') diff --git a/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx b/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx index c6505f86bf6f..59e70cfc7e1a 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx @@ -172,7 +172,7 @@ export const MessageRow = memo(function MessageRow({ {/* Copy + timestamp reveal together, mirroring the agent controls row. Image-only prompts have no text to copy, so the button is omitted. */} {markdown || message.timestamp !== null ? ( -
+
{markdown ? : null}
@@ -278,7 +278,7 @@ export const MessageRow = memo(function MessageRow({ markdown={markdown} timestamp={message.timestamp} onScrollToTop={scrollToTop} - className="mt-1 -mb-5 w-fit select-none transition-opacity can-hover:pointer-events-none can-hover:opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-has-[:focus-visible]:pointer-events-auto group-has-[:focus-visible]:opacity-100" + className="mt-1 -mb-5 w-fit select-none transition-opacity can-hover:pointer-events-none can-hover:opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 [.group:has(:focus-visible)_&]:pointer-events-auto [.group:has(:focus-visible)_&]:opacity-100" /> ) : null}
diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.goal-dock.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.goal-dock.test.tsx index 471f1b636d28..c3c08f6647e0 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.goal-dock.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.goal-dock.test.tsx @@ -35,7 +35,7 @@ const STRIP = '[data-native-chat-background-tasks]' const GOAL = '[data-native-chat-thread-goal]' // The seam is CSS on DOM adjacency: the strip styles itself when a goal tab follows // it, and the goal tab styles itself when the strip precedes it. -const STRIP_DOCK_RULE = /^group-has-\[\+\[([a-z-]+)\]\]\/tasks:(.+)$/ +const STRIP_DOCK_RULE = /^\[\[data-native-chat-background-tasks\]:has\(\+\[([a-z-]+)\]\)_&\]:(.+)$/ const GOAL_DOCK_RULE = /^group-\[\[([a-z-]+)\]\+&\]\/goal:(.+)$/ function dockRules(root: Element, rule: RegExp): { attribute: string; utility: string }[] { diff --git a/tests/e2e/combined-diff-invalidation-freeze-repro.spec.ts b/tests/e2e/combined-diff-invalidation-freeze-repro.spec.ts index cb11acf25f38..99b6b939f6d7 100644 --- a/tests/e2e/combined-diff-invalidation-freeze-repro.spec.ts +++ b/tests/e2e/combined-diff-invalidation-freeze-repro.spec.ts @@ -299,6 +299,7 @@ test.describe('Combined diff invalidation freeze repro (STA-3420)', () => { ) console.log(`external-change burst measurement ${JSON.stringify(measurement)}`) + expect(measurement.sectionRowCount).toBe(1) expect(measurement.stuckLoadingRowCount).toBe(0) expect(measurement.editorCount).toBeGreaterThan(0) // Why: before the fix this window blocked continuously — p95 3963ms, 16 samples in 23s. From ccdb324b63e4942891942edde1216586a51774bd Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 18:11:25 -0700 Subject: [PATCH 49/90] Add CodeBuddy as a built-in coding agent (#23740) * feat(agents): integrate CodeBuddy launch, status and session history * docs: record CodeBuddy lifecycle verification * fix(codebuddy): backfill scoped history and negotiate remote resume * test(cli): include CodeBuddy in known search agents --- README.md | 1 + config/tsconfig.cli.json | 1 + docs/reference/codebuddy-harness.md | 44 ++++ docs/site/content/docs/agents/supported.mdx | 1 + .../components/mobile-agent-icon-assets.ts | 1 + mobile/src/tasks/mobile-tui-agents.ts | 1 + src/cli/search-command-arguments.test.ts | 2 +- .../managed-agent-hook-registry.ts | 5 + .../managed-hook-command-contract.test.ts | 17 +- ...ote-hook-service-registry-coverage.test.ts | 2 + .../remote-managed-hook-installers.ts | 2 + .../server-retired-pane-new-turn.test.ts | 1 + .../remote-session-scanner-sources.ts | 12 + .../session-cwd-bucket-layouts.test.ts | 18 +- .../ai-vault/session-cwd-bucket-layouts.ts | 27 +- .../ai-vault/session-scanner-agent-parser.ts | 3 + .../ai-vault/session-scanner-agent-sources.ts | 10 + .../session-scanner-codebuddy-parser.ts | 230 ++++++++++++++++++ .../session-scanner-codebuddy-scope.test.ts | 135 ++++++++++ .../session-scanner-codebuddy-source.test.ts | 80 ++++++ .../session-scanner-log-agent-fixtures.ts | 17 ++ .../ai-vault/session-scanner-parse-cache.ts | 3 + .../session-scanner-scope-discovery.ts | 6 +- .../ai-vault/session-scanner-test-fixtures.ts | 1 + src/main/ai-vault/session-scanner-types.ts | 1 + src/main/ai-vault/session-scanner.ts | 12 +- src/main/claude/hook-settings.ts | 4 +- src/main/codebuddy/hook-service.test.ts | 47 ++++ src/main/codebuddy/hook-service.ts | 34 +++ src/renderer/src/i18n/locales/en.json | 3 +- src/renderer/src/i18n/locales/es.json | 3 +- src/renderer/src/i18n/locales/fr.json | 1 + src/renderer/src/i18n/locales/ja.json | 1 + src/renderer/src/i18n/locales/ko.json | 1 + src/renderer/src/i18n/locales/zh.json | 1 + .../src/lib/agent-catalog-platform.ts | 13 + src/renderer/src/lib/agent-catalog.tsx | 22 +- src/renderer/src/lib/agent-status.ts | 1 + ...t-resume-host-authority-capability.test.ts | 2 + .../agent-resume-host-authority-capability.ts | 2 + .../remote-agent-session-launch.test.ts | 40 +-- .../codebuddy-question-hooks.jsonl | 6 + .../codebuddy-question-hooks.meta.json | 6 + src/shared/agent-headless-command.ts | 2 + .../agent-hook-listener/provider-dispatch.ts | 11 + .../provider-event-routing.ts | 2 + .../providers/compatible-lifecycle-events.ts | 104 ++++++++ .../providers/qoder-events.ts | 82 +------ .../agent-hook-listener/source-routing.ts | 1 + src/shared/agent-hook-relay.ts | 1 + src/shared/agent-hook-types.ts | 1 + src/shared/agent-icons/codebuddy.png | Bin 0 -> 3794 bytes src/shared/agent-kind.ts | 1 + src/shared/agent-node-package-entrypoints.ts | 1 + .../agent-session-option-catalog-codebuddy.ts | 44 ++++ src/shared/agent-session-option-catalog.ts | 2 + src/shared/agent-session-resume.test.ts | 5 + src/shared/agent-session-resume.ts | 4 + src/shared/agent-type-label.ts | 1 + src/shared/ai-vault-resume-command.test.ts | 11 + src/shared/ai-vault-resume-command.ts | 1 + src/shared/ai-vault-session-deletion.ts | 1 + src/shared/ai-vault-types.ts | 2 + src/shared/codebuddy-agent.test.ts | 67 +++++ src/shared/codebuddy-headless-command.ts | 13 + src/shared/protocol-version.ts | 3 + src/shared/skills-cli-agent-keys.ts | 1 + src/shared/telemetry-property-schemas.ts | 1 + src/shared/tui-agent-config.ts | 6 +- src/shared/tui-agent-display-names.ts | 1 + src/shared/tui-agent-permissions.ts | 1 + src/shared/tui-agent-rest-signal.test.ts | 1 + src/shared/tui-agent-selection.ts | 3 +- src/shared/tui-agent.ts | 1 + 74 files changed, 1074 insertions(+), 121 deletions(-) create mode 100644 docs/reference/codebuddy-harness.md create mode 100644 src/main/ai-vault/session-scanner-codebuddy-parser.ts create mode 100644 src/main/ai-vault/session-scanner-codebuddy-scope.test.ts create mode 100644 src/main/ai-vault/session-scanner-codebuddy-source.test.ts create mode 100644 src/main/codebuddy/hook-service.test.ts create mode 100644 src/main/codebuddy/hook-service.ts create mode 100644 src/renderer/src/lib/agent-catalog-platform.ts create mode 100644 src/shared/__fixtures__/codebuddy-question-hooks.jsonl create mode 100644 src/shared/__fixtures__/codebuddy-question-hooks.meta.json create mode 100644 src/shared/agent-hook-listener/providers/compatible-lifecycle-events.ts create mode 100644 src/shared/agent-icons/codebuddy.png create mode 100644 src/shared/agent-session-option-catalog-codebuddy.ts create mode 100644 src/shared/codebuddy-agent.test.ts create mode 100644 src/shared/codebuddy-headless-command.ts diff --git a/README.md b/README.md index 0f337f9e677e..93e096146090 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,7 @@ Works with **any CLI agent** — if it runs in a terminal, it runs in Orca. Autohand Code logo Autohand Code   Charm logo Charm   Cline logo Cline   + CodeBuddy logo CodeBuddy   Codebuff logo Codebuff   Freebuff logo Freebuff   Command Code logo Command Code   diff --git a/config/tsconfig.cli.json b/config/tsconfig.cli.json index 030a90632b0f..85f3529b2dcb 100644 --- a/config/tsconfig.cli.json +++ b/config/tsconfig.cli.json @@ -9,6 +9,7 @@ "../src/main/claude/claude-hook-event-versions.ts", "../src/main/claude/claude-managed-hook-events.ts", "../src/main/qoder/hook-service.ts", + "../src/main/codebuddy/hook-service.ts", "../src/main/agent-hooks/hook-stdin-contract.ts", "../src/main/agent-hooks/hook-post-command.ts", "../src/main/agent-hooks/hook-config-write-path.ts", diff --git a/docs/reference/codebuddy-harness.md b/docs/reference/codebuddy-harness.md new file mode 100644 index 000000000000..e59eaec855ed --- /dev/null +++ b/docs/reference/codebuddy-harness.md @@ -0,0 +1,44 @@ +# CodeBuddy terminal harness + +CodeBuddy uses its own identity in the desktop and mobile agent catalogs, process +detection, telemetry, hooks, resume records and AI Vault. `codebuddy` and `cbc` +identify the interactive CLI; print, server, ACP and detached background modes do +not identify an interactive pane. Model and effort selections use `--model` and +`--effort`; the CLI resolves its stable model aliases for the current account. + +Managed hooks use the existing Claude-compatible installer and transport, with +CodeBuddy's own `.codebuddy/settings.json` and hook source. Installation preserves +user hooks and statusline configuration. Local and SSH installers share the same +plan; Windows explicitly selects CodeBuddy's supported PowerShell hook shell. +Status flows through the execution host's canonical hook store. + +## Observed lifecycle + +Verified with the authenticated CodeBuddy 2.159.0 CLI on macOS: + +- `UserPromptSubmit` starts work. `SessionStart` can arrive afterward and must not + settle that work. +- An unanswered `AskUserQuestion` emits a `Notification` with + `notification_type: permission_prompt` and the message + `needs your permission to use AskUserQuestion`. +- In this version, `PreToolUse(AskUserQuestion)` arrives **after** the user answers; + it resumes working, followed by `PostToolUse` and `Stop`. +- `Stop` supplies the final assistant message and the provider session identity + supplies the resume command. + +The sanitized real event sequence is +`src/shared/__fixtures__/codebuddy-question-hooks.jsonl`. The regression test +replays it through the shared hook listener. Qoder keeps its existing lifecycle +semantics while sharing the common event projection. + +AI Vault reads CodeBuddy's `type: message` JSONL records with top-level roles and +`input_text` / `output_text` content blocks. Local, WSL and SSH discovery use the +provider's `.codebuddy/projects` tree and the same incremental parser. + +## Validation scope + +Live macOS checks exercised launch through Orca's agent menu, model switching, +question waiting, answer submission, working and completion indicators, history +discovery and a resumed session recalling its earlier answer. Hidden-renderer CDP +screenshots record the working, question and completed states. Windows, Linux, +WSL and SSH runtime execution have not been exercised live on this machine. diff --git a/docs/site/content/docs/agents/supported.mdx b/docs/site/content/docs/agents/supported.mdx index 0658ce6fd8c3..ecc8cfd13057 100644 --- a/docs/site/content/docs/agents/supported.mdx +++ b/docs/site/content/docs/agents/supported.mdx @@ -45,6 +45,7 @@ To restore prompts for one agent only, edit that agent's default arguments or en | Auggie | Auto-setup | [Augment](https://docs.augmentcode.com/cli/overview) | | Autohand | Auto-setup | [Autohand](https://github.com/autohandai/code-cli) | | Cline | Auto-setup | [Cline](https://docs.cline.bot/cline-cli/overview) | +| CodeBuddy | `npm install -g @tencent-ai/codebuddy-code` | [CodeBuddy](https://www.codebuddy.ai/cli) | | Codebuff | Auto-setup | [Codebuff](https://www.codebuff.com/docs/help/quick-start) | | Freebuff | Auto-setup | [Freebuff](https://freebuff.com/cli) | | Command Code | Auto-setup, status | [Command Code](https://commandcode.ai/docs/quickstart) | diff --git a/mobile/src/components/mobile-agent-icon-assets.ts b/mobile/src/components/mobile-agent-icon-assets.ts index 8d0a6d474f7c..53745ead77e6 100644 --- a/mobile/src/components/mobile-agent-icon-assets.ts +++ b/mobile/src/components/mobile-agent-icon-assets.ts @@ -18,6 +18,7 @@ export const MOBILE_AGENT_ICON_ASSETS: Partial = TUI_AGENT_DISPL export const MOBILE_TUI_AGENT_FAVICON_DOMAINS: Partial> = { openclaude: 'openclaude.gitlawb.com', + codebuddy: 'codebuddy.ai', grok: 'x.ai', copilot: 'github.com', opencode: 'opencode.ai', diff --git a/src/cli/search-command-arguments.test.ts b/src/cli/search-command-arguments.test.ts index be9195a1fab7..27b06286f529 100644 --- a/src/cli/search-command-arguments.test.ts +++ b/src/cli/search-command-arguments.test.ts @@ -126,7 +126,7 @@ describe('orca search argument parsing', () => { it('rejects an unknown --agent and names the known ones', () => { expect(() => parseSearch(['search', 'q', '--agent', 'claude', '--agent', 'bogus'])).toThrow( - /Unknown --agent "bogus"\. Known agents: claude, codex, / + /Unknown --agent "bogus"\. Known agents: claude, codebuddy, codex, / ) }) diff --git a/src/main/agent-hooks/managed-agent-hook-registry.ts b/src/main/agent-hooks/managed-agent-hook-registry.ts index 31513658035b..11b642ee0900 100644 --- a/src/main/agent-hooks/managed-agent-hook-registry.ts +++ b/src/main/agent-hooks/managed-agent-hook-registry.ts @@ -1,3 +1,4 @@ +import { codebuddyHookService } from '../codebuddy/hook-service' import { qoderHookService } from '../qoder/hook-service' import type { AgentHookInstallStatus } from '../../shared/agent-hook-types' import type { HookInstallAgent } from '../../shared/telemetry-events' @@ -46,6 +47,7 @@ export const MANAGED_AGENT_HOOK_INSTALLERS: readonly ManagedAgentHookInstaller[] ['codex', () => codexHookService.install()], ['gemini', () => geminiHookService.install()], ['qoder', () => qoderHookService.install()], + ['codebuddy', () => codebuddyHookService.install()], ['antigravity', () => antigravityHookService.install()], ['amp', () => ampHookService.install()], ['cursor', () => cursorHookService.install()], @@ -73,6 +75,7 @@ export const MANAGED_AGENT_HOOK_SCRIPT_REFRESHERS: readonly ManagedAgentHookScri ['codex', () => codexHookService.refreshManagedScripts()], ['gemini', () => geminiHookService.refreshManagedScripts()], ['qoder', () => qoderHookService.refreshManagedScripts()], + ['codebuddy', () => codebuddyHookService.refreshManagedScripts()], ['antigravity', () => antigravityHookService.refreshManagedScripts()], ['cursor', () => cursorHookService.refreshManagedScripts()], ['droid', () => droidHookService.refreshManagedScripts()], @@ -92,6 +95,7 @@ export const MANAGED_AGENT_HOOK_REMOVERS: readonly ManagedAgentHookRemover[] = [ ['codex', () => codexHookService.remove()], ['gemini', () => geminiHookService.remove()], ['qoder', () => qoderHookService.remove()], + ['codebuddy', () => codebuddyHookService.remove()], ['antigravity', () => antigravityHookService.remove()], ['amp', () => ampHookService.remove()], ['cursor', () => cursorHookService.remove()], @@ -117,6 +121,7 @@ export const MANAGED_AGENT_HOOK_STATUS_READERS: readonly ManagedAgentHookStatusR ['codex', () => codexHookService.getStatus()], ['gemini', () => geminiHookService.getStatus()], ['qoder', () => qoderHookService.getStatus()], + ['codebuddy', () => codebuddyHookService.getStatus()], ['antigravity', () => antigravityHookService.getStatus()], ['amp', () => ampHookService.getStatus()], ['cursor', () => cursorHookService.getStatus()], diff --git a/src/main/agent-hooks/managed-hook-command-contract.test.ts b/src/main/agent-hooks/managed-hook-command-contract.test.ts index b3166a6c90e7..ebb1412ec580 100644 --- a/src/main/agent-hooks/managed-hook-command-contract.test.ts +++ b/src/main/agent-hooks/managed-hook-command-contract.test.ts @@ -96,6 +96,20 @@ const buildersByAgent = new Map([ remote: (path) => [getClaudeRemoteCommand(path)] } ], + [ + 'codebuddy', + { + local: (path) => [ + getManagedLifecycleHook(path, { + configDirName: '.codebuddy', + scriptBaseName: 'codebuddy-hook', + usesWindowsCompatLauncher: true, + windowsHookShell: 'powershell' + }).command + ], + remote: (path) => [getClaudeRemoteCommand(path)] + } + ], [ 'codex', { @@ -224,7 +238,8 @@ describe('managed hook command contract', () => { const scannedCommand = platform === 'win32' && ((agent === 'codex' && command.startsWith('if (Test-Path')) || - (agent === 'qoder' && command.startsWith('$scriptPath = Join-Path'))) + ((agent === 'qoder' || agent === 'codebuddy') && + command.startsWith('$scriptPath = Join-Path'))) ? command .replaceAll('$LASTEXITCODE', '') .replaceAll('$env:', '') diff --git a/src/main/agent-hooks/remote-hook-service-registry-coverage.test.ts b/src/main/agent-hooks/remote-hook-service-registry-coverage.test.ts index f9ff9c232e02..dea6c4a46634 100644 --- a/src/main/agent-hooks/remote-hook-service-registry-coverage.test.ts +++ b/src/main/agent-hooks/remote-hook-service-registry-coverage.test.ts @@ -1,3 +1,4 @@ +import { codebuddyHookService } from '../codebuddy/hook-service' import { describe, expect, it, vi } from 'vitest' vi.mock('electron', () => ({ @@ -53,6 +54,7 @@ describe('remote hook service registry coverage', () => { ['kimi', kimiHookService], ['muse', museHookService], ['qoder', qoderHookService], + ['codebuddy', codebuddyHookService], ['zcode', zcodeHookService], ['dsh', dshHookService] ]) diff --git a/src/main/agent-hooks/remote-managed-hook-installers.ts b/src/main/agent-hooks/remote-managed-hook-installers.ts index 272e330be113..b012af91ff35 100644 --- a/src/main/agent-hooks/remote-managed-hook-installers.ts +++ b/src/main/agent-hooks/remote-managed-hook-installers.ts @@ -1,3 +1,4 @@ +import { codebuddyHookService } from '../codebuddy/hook-service' import { qoderHookService } from '../qoder/hook-service' import type { SFTPWrapper } from 'ssh2' import type { AgentHookInstallStatus, AgentHookTarget } from '../../shared/agent-hook-types' @@ -64,6 +65,7 @@ const REMOTE_MANAGED_HOOK_INSTALLERS: readonly RemoteManagedHookInstaller[] = [ ], ['gemini', (sftp, remoteHome) => geminiHookService.installRemote(sftp, remoteHome)], ['qoder', (sftp, remoteHome) => qoderHookService.installRemote(sftp, remoteHome)], + ['codebuddy', (sftp, remoteHome) => codebuddyHookService.installRemote(sftp, remoteHome)], ['antigravity', (sftp, remoteHome) => antigravityHookService.installRemote(sftp, remoteHome)], ['amp', (sftp, remoteHome) => ampHookService.installRemote(sftp, remoteHome)], ['cursor', (sftp, remoteHome) => cursorHookService.installRemote(sftp, remoteHome)], diff --git a/src/main/agent-hooks/server-retired-pane-new-turn.test.ts b/src/main/agent-hooks/server-retired-pane-new-turn.test.ts index a405199a6e76..23dbb56c6956 100644 --- a/src/main/agent-hooks/server-retired-pane-new-turn.test.ts +++ b/src/main/agent-hooks/server-retired-pane-new-turn.test.ts @@ -25,6 +25,7 @@ const NEW_TURN_EVENT: Record = { qoder: 'SessionStart', claude: 'SessionStart', kimi: 'UserPromptSubmit', + codebuddy: 'UserPromptSubmit', codex: 'SessionStart', gemini: 'BeforeAgent', antigravity: 'PreInvocation', diff --git a/src/main/ai-vault/remote-session-scanner-sources.ts b/src/main/ai-vault/remote-session-scanner-sources.ts index ed34e8b52a58..dfd012415d54 100644 --- a/src/main/ai-vault/remote-session-scanner-sources.ts +++ b/src/main/ai-vault/remote-session-scanner-sources.ts @@ -8,6 +8,7 @@ import { isAntigravityTranscriptPath } from './session-scanner-antigravity-paths import { parseCodexSessionContent } from './session-scanner-codex-parser' import { parseDroidSessionContent } from './session-scanner-droid-parser' import { parseClaudeSessionContent } from './session-scanner-primary-parsers' +import { parseCodebuddySessionContent } from './session-scanner-codebuddy-parser' import { parseGeminiSessionContent } from './session-scanner-gemini-parsers' import { parseCopilotSessionContent } from './session-scanner-copilot-parser' import { parseCursorSessionContent } from './session-scanner-cursor-parser' @@ -65,6 +66,17 @@ export function remoteSessionSources( // top-level sessions carrying the parent's sessionId. partitionSubagentTranscripts: partitionSubagentTranscriptPaths }, + { + // The execution host owns CodeBuddy's transcripts, including subagent pruning. + ...jsonlSource( + 'codebuddy', + remoteHome, + hostPlatform, + ['.codebuddy', 'projects'], + parseCodebuddySessionContent + ), + partitionSubagentTranscripts: partitionSubagentTranscriptPaths + }, remoteAntigravitySource(remoteHome, hostPlatform), source( 'gemini', diff --git a/src/main/ai-vault/session-cwd-bucket-layouts.test.ts b/src/main/ai-vault/session-cwd-bucket-layouts.test.ts index 38c2f0b68e20..7cbbbfbcc6d5 100644 --- a/src/main/ai-vault/session-cwd-bucket-layouts.test.ts +++ b/src/main/ai-vault/session-cwd-bucket-layouts.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import { PI_CWD_BUCKET_LAYOUT } from './session-cwd-bucket-layouts' +import { PI_CWD_BUCKET_LAYOUT, CODEBUDDY_CWD_BUCKET_LAYOUT } from './session-cwd-bucket-layouts' function piDirInScope(dirName: string, scopePath: string): boolean { return PI_CWD_BUCKET_LAYOUT.isDirInScope( @@ -31,3 +31,19 @@ describe('PI_CWD_BUCKET_LAYOUT', () => { expect(piDirInScope('--C--Users-ada-repo--', 'C:\\Users\\ada\\repo')).toBe(true) }) }) + +describe('CODEBUDDY_CWD_BUCKET_LAYOUT', () => { + it.each([ + ['C:\\Users\\ada\\repo', 'C-Users-ada-repo-src'], + ['/home/ada/repo', 'home-ada-repo-src'], + ['/', 'home-ada-repo'], + [`/${'界'.repeat(100)}`, `${'界'.repeat(60)}-hash`] + ])('keeps candidate buckets for %s', (scope, bucket) => { + expect( + CODEBUDDY_CWD_BUCKET_LAYOUT.isDirInScope( + bucket, + new Set(CODEBUDDY_CWD_BUCKET_LAYOUT.encodeScopePrefixes(scope)) + ) + ).toBe(true) + }) +}) diff --git a/src/main/ai-vault/session-cwd-bucket-layouts.ts b/src/main/ai-vault/session-cwd-bucket-layouts.ts index d8b4a565949c..3f0195cdcd4f 100644 --- a/src/main/ai-vault/session-cwd-bucket-layouts.ts +++ b/src/main/ai-vault/session-cwd-bucket-layouts.ts @@ -3,7 +3,7 @@ import { encodeClaudeProjectPaths, isClaudeProjectDirInScope } from './claude-pr /** An agent that keeps one directory per cwd, named by a lossy encoding of that cwd. */ export type CwdBucketLayout = { - agent: Extract + agent: Extract encodeScopePrefixes: (scopePath: string) => string[] isDirInScope: (dirName: string, prefixes: ReadonlySet) => boolean } @@ -41,3 +41,28 @@ export const PI_CWD_BUCKET_LAYOUT: CwdBucketLayout = { return false } } + +// CodeBuddy 2.159.0 collapses separators and retains 180 UTF-8 bytes before long-path hashes. +function codebuddyScopePrefix(path: string): string { + const encoded = path + .replace(/[/\\:]+/g, '-') + .replace(/-+/g, '-') + .replace(/^-|-$/g, '') + let prefix = '' + for (const character of encoded) { + if (Buffer.byteLength(prefix + character, 'utf8') > 180) { + break + } + prefix += character + } + return prefix +} + +export const CODEBUDDY_CWD_BUCKET_LAYOUT: CwdBucketLayout = { + agent: 'codebuddy', + encodeScopePrefixes: (path) => [ + ...new Set([path, path.normalize('NFC')].map(codebuddyScopePrefix)) + ], + // This is only a prefilter: each transcript's cwd decides membership, including lossy collisions. + isDirInScope: (name, prefixes) => [...prefixes].some((prefix) => name.startsWith(prefix)) +} diff --git a/src/main/ai-vault/session-scanner-agent-parser.ts b/src/main/ai-vault/session-scanner-agent-parser.ts index 80a56bf2519d..95910d208b73 100644 --- a/src/main/ai-vault/session-scanner-agent-parser.ts +++ b/src/main/ai-vault/session-scanner-agent-parser.ts @@ -1,3 +1,4 @@ +import { parseCodebuddySessionFile } from './session-scanner-codebuddy-parser' import type { AiVaultSession } from '../../shared/ai-vault-types' import { throwIfSignalAborted } from '../../shared/abort-signal-reason' import { parseDevinSessionFile } from './session-scanner-devin-parser' @@ -87,6 +88,8 @@ export async function parseAgentSessionFile( signal?: AbortSignal ): Promise { switch (candidate.agent) { + case 'codebuddy': + return parseCodebuddySessionFile(candidate.file, platform, messages) case 'claude': return parseClaudeSessionFile(candidate.file, platform, messages) case 'codex': diff --git a/src/main/ai-vault/session-scanner-agent-sources.ts b/src/main/ai-vault/session-scanner-agent-sources.ts index ee10422031b0..66d069b68cc2 100644 --- a/src/main/ai-vault/session-scanner-agent-sources.ts +++ b/src/main/ai-vault/session-scanner-agent-sources.ts @@ -34,6 +34,7 @@ const COPILOT_SESSIONS_DIR = join( 'session-state' ) const CURSOR_PROJECTS_DIR = join(homedir(), '.cursor', 'projects') +const CODEBUDDY_PROJECTS_DIR = join(homedir(), '.codebuddy', 'projects') const HERMES_SESSIONS_DIR = join(homedir(), '.hermes', 'sessions') const ROVO_SESSIONS_DIR = join(homedir(), '.rovodev', 'sessions') const OPENCLAW_STATE_DIR = resolveAbsoluteDirOverride( @@ -114,6 +115,15 @@ export const AI_VAULT_AGENT_SOURCES: AiVaultAgentSourceTable = { // their parent instead. directoryPredicate: (name) => name !== SUBAGENT_DIR_NAME }, + codebuddy: { + rootDirs: (options, wslHomeDirs) => [ + options.codebuddyProjectsDir ?? CODEBUDDY_PROJECTS_DIR, + ...wslHomeDirs.map((homeDir) => join(homeDir, '.codebuddy', 'projects')) + ], + extensions: ['.jsonl'], + // Nested subagent transcripts are not independent top-level conversations. + directoryPredicate: (name) => name !== SUBAGENT_DIR_NAME + }, codex: { rootDirs: (options, wslHomeDirs) => uniqueCodexSessionsDirs([ diff --git a/src/main/ai-vault/session-scanner-codebuddy-parser.ts b/src/main/ai-vault/session-scanner-codebuddy-parser.ts new file mode 100644 index 000000000000..94fc52d1eabb --- /dev/null +++ b/src/main/ai-vault/session-scanner-codebuddy-parser.ts @@ -0,0 +1,230 @@ +import { createInterface } from 'node:readline' +import { + remoteSessionContentLines, + type RemoteSessionContent +} from './remote-session-content-lines' +import { openTranscriptReadStream } from '../native-chat/wsl-transcript-fs-access' +import type { AiVaultSession } from '../../shared/ai-vault-types' +import type { ExecutionHostId } from '../../shared/execution-host' +import { isKnownHarnessInjectedUserTurnText } from '../../shared/harness-injected-user-turns' +import type { FileWithMtime, ResumableSessionParseState } from './session-scanner-types' +import type { TranscriptMessageSink } from './session-transcript-consumers' +import { + addPreviewMessage, + accumulatorSessionIdentity, + createAccumulator, + finalizeSession, + sessionIdFromFileName, + updateLatestLocation, + updateTimeline +} from './session-scanner-accumulator' +import { + asRecord, + extractString, + normalizeTitleText, + parseJsonObject +} from './session-scanner-values' + +type ParserSessionOptions = { + executionHostId?: ExecutionHostId + executionHostPlatform?: NodeJS.Platform | null +} + +// CodeBuddy stores top-level message roles and input_text/output_text blocks, not Claude records. +export type CodebuddySessionParseState = { + accumulator: ReturnType + aiTitle: string | null + firstUserTitle: string | null +} + +export function createCodebuddySessionParseState( + file: FileWithMtime, + messages?: TranscriptMessageSink +): CodebuddySessionParseState { + return { + accumulator: createAccumulator({ + agent: 'codebuddy', + file, + sessionId: sessionIdFromFileName(file.path), + messages + }), + aiTitle: null, + firstUserTitle: null + } +} + +export function cloneCodebuddySessionParseState( + state: CodebuddySessionParseState +): CodebuddySessionParseState { + return { + accumulator: { + ...state.accumulator, + previewMessages: [...state.accumulator.previewMessages] + }, + aiTitle: state.aiTitle, + firstUserTitle: state.firstUserTitle + } +} + +// CodeBuddy conversation content is an array of typed text blocks; join the +// text ones. Non-text blocks (tool calls, diffs) carry no preview copy. +function codebuddyContentText(content: unknown): string | null { + if (typeof content === 'string') { + return content + } + if (!Array.isArray(content)) { + return null + } + const parts = content + .map((block) => { + const record = asRecord(block) + const type = extractString(record?.type) + return type === 'input_text' || type === 'output_text' || type === 'text' + ? extractString(record?.text) + : null + }) + .filter((text): text is string => typeof text === 'string' && text.length > 0) + return parts.length > 0 ? parts.join('\n\n') : null +} + +export function consumeCodebuddySessionLine(state: CodebuddySessionParseState, line: string): void { + const { accumulator } = state + const record = parseJsonObject(line) + if (!record) { + return + } + + if (typeof record.sessionId === 'string' && record.sessionId.trim()) { + accumulator.sessionId = record.sessionId.trim() + } + updateTimeline(accumulator, record.timestamp) + updateLatestLocation(accumulator, record) + + // The CLI's own session title; later summaries revise it, like Claude's + // custom-title. + if (record.type === 'summary') { + const summary = normalizeTitleText(extractString(record.summary) ?? '') + if (summary) { + accumulator.title = summary + } + return + } + + if (record.type === 'ai-title') { + const title = normalizeTitleText(extractString(record.aiTitle) ?? '') + if (title) { + // CodeBuddy can revise generated names; AI Vault mirrors the current one. + state.aiTitle = title + } + return + } + + if (record.type !== 'message') { + return + } + + const role = extractString(record.role) + const text = codebuddyContentText(record.content) + accumulator.messageCount++ + if (role === 'user') { + // Meta prompts (injected context) only seed the last-resort title. + // `providerData.skipRun` marks machinery-injected turns that never reached + // the model as a user prompt. + const isMetaUserTurn = + asRecord(record.providerData)?.skipRun === true || + (text != null && isKnownHarnessInjectedUserTurnText(text)) + addPreviewMessage(accumulator, { + role: 'user', + text, + timestamp: record.timestamp, + seedFirstUserPrompt: !isMetaUserTurn + }) + if (text && !isMetaUserTurn) { + state.firstUserTitle ??= text + } + return + } + if (role === 'assistant') { + addPreviewMessage(accumulator, { role: 'assistant', text, timestamp: record.timestamp }) + const model = extractString(asRecord(record.providerData)?.model) + if (model) { + accumulator.model = model + } + } +} + +export function finalizeCodebuddySessionParseState( + state: CodebuddySessionParseState, + platform: NodeJS.Platform, + options: ParserSessionOptions = {} +): AiVaultSession | null { + // Finalize a snapshot: the live state (and its preview array) may keep + // accumulating appended lines after this session object is handed out. + const snapshot = cloneCodebuddySessionParseState(state) + // Why: the CLI's summary title wins via accumulator.title; the generated + // ai-title should outrank the raw first prompt when present. + snapshot.accumulator.fallbackTitle = snapshot.aiTitle ?? snapshot.firstUserTitle + return finalizeSession(snapshot.accumulator, platform, options) +} + +function codebuddyResumeStateFromParseState( + state: CodebuddySessionParseState +): ResumableSessionParseState { + return { + consumeLine: (line) => consumeCodebuddySessionLine(state, line), + identity: () => accumulatorSessionIdentity(state.accumulator), + clone: () => codebuddyResumeStateFromParseState(cloneCodebuddySessionParseState(state)), + touchFile: (file) => { + state.accumulator.modifiedAt = file.modifiedAt + }, + finalize: (platform, options) => finalizeCodebuddySessionParseState(state, platform, options) + } +} + +export function createCodebuddySessionResumeState( + file: FileWithMtime, + messages?: TranscriptMessageSink +): ResumableSessionParseState { + return codebuddyResumeStateFromParseState(createCodebuddySessionParseState(file, messages)) +} + +export async function parseCodebuddySessionFile( + file: FileWithMtime, + platform: NodeJS.Platform = process.platform, + messages?: TranscriptMessageSink +): Promise { + const lines = createInterface({ + input: openTranscriptReadStream(file.path, { encoding: 'utf-8' }, 'scan'), + crlfDelay: Infinity + }) + return parseCodebuddySessionLines({ file, lines, platform, messages }) +} + +export async function parseCodebuddySessionContent( + file: FileWithMtime, + content: RemoteSessionContent, + platform: NodeJS.Platform = process.platform, + options: ParserSessionOptions = {}, + signal?: AbortSignal +): Promise { + return parseCodebuddySessionLines({ + file, + lines: remoteSessionContentLines(content, signal), + platform, + options + }) +} + +async function parseCodebuddySessionLines(args: { + file: FileWithMtime + lines: AsyncIterable | Iterable + platform: NodeJS.Platform + options?: ParserSessionOptions + messages?: TranscriptMessageSink +}): Promise { + const state = createCodebuddySessionParseState(args.file, args.messages) + for await (const line of args.lines) { + consumeCodebuddySessionLine(state, line) + } + return finalizeCodebuddySessionParseState(state, args.platform, args.options) +} diff --git a/src/main/ai-vault/session-scanner-codebuddy-scope.test.ts b/src/main/ai-vault/session-scanner-codebuddy-scope.test.ts new file mode 100644 index 000000000000..9086ab1e8118 --- /dev/null +++ b/src/main/ai-vault/session-scanner-codebuddy-scope.test.ts @@ -0,0 +1,135 @@ +import { mkdtemp, mkdir, rm, utimes, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' +import { scanAiVaultSessions } from './session-scanner' +import { resetProjectDirCwdCacheForTests } from './session-scanner-scope-discovery' +import { isolatedScanRoots, jsonLines } from './session-scanner-test-fixtures' + +let tempRoots: string[] = [] + +afterEach(async () => { + await Promise.all(tempRoots.map((root) => rm(root, { recursive: true, force: true }))) + tempRoots = [] + resetProjectDirCwdCacheForTests() +}) + +function codebuddySessionDirName(cwd: string): string { + return cwd + .replace(/[/\\:]+/g, '-') + .replace(/-+/g, '-') + .replace(/^-|-$/g, '') +} + +async function writeCodeBuddySession(args: { + sessionsDir: string + cwd: string + id: string + timestamp: string +}): Promise { + const dir = join(args.sessionsDir, codebuddySessionDirName(args.cwd)) + await mkdir(dir, { recursive: true }) + const file = join(dir, `${args.id}.jsonl`) + await writeFile( + file, + jsonLines([ + { + type: 'message', + timestamp: args.timestamp, + sessionId: args.id, + cwd: args.cwd, + role: 'user', + content: [{ type: 'input_text', text: `prompt ${args.id}` }] + } + ]) + ) + const time = new Date(args.timestamp) + await utimes(file, time, time) +} + +describe('scanAiVaultSessions — CodeBuddy scope discovery', () => { + it('lists an older in-scope CodeBuddy session the recency cap would drop', async () => { + const root = await mkdtemp(join(tmpdir(), 'orca-ai-vault-codebuddy-scope-')) + tempRoots.push(root) + const roots = isolatedScanRoots(root) + const workspace = '/home/ada/orca/workspaces/orca/feature' + + await writeCodeBuddySession({ + sessionsDir: roots.codebuddyProjectsDir, + cwd: `${workspace}/packages/app`, + id: 'old-in-scope', + timestamp: '2026-05-01T10:00:00.000Z' + }) + // Newer, out of scope, and a sibling whose encoding shares the workspace prefix. + await writeCodeBuddySession({ + sessionsDir: roots.codebuddyProjectsDir, + cwd: '/home/ada/other', + id: 'recent-elsewhere', + timestamp: '2026-06-01T10:00:00.000Z' + }) + await writeCodeBuddySession({ + sessionsDir: roots.codebuddyProjectsDir, + cwd: `${workspace}-sibling`, + id: 'sibling', + timestamp: '2026-04-01T10:00:00.000Z' + }) + + const result = await scanAiVaultSessions({ + ...roots, + platform: 'linux', + limit: 1, + scopePaths: [workspace] + }) + const ids = result.sessions.map((session) => session.sessionId) + + expect(ids).toContain('old-in-scope') + expect(ids).toContain('recent-elsewhere') + expect(ids).not.toContain('sibling') + expect(result.sessions.find((session) => session.sessionId === 'old-in-scope')?.agent).toBe( + 'codebuddy' + ) + }) + + it('finds an older session when another cwd shares its encoded bucket', async () => { + const root = await mkdtemp(join(tmpdir(), 'orca-codebuddy-collision-')) + tempRoots.push(root) + const roots = isolatedScanRoots(root) + for (const [cwd, id, timestamp] of [ + ['/home/ada/repo/app', 'in-scope', '2026-04-01T10:00:00.000Z'], + ['/home/ada/repo-app', 'collision', '2026-05-01T10:00:00.000Z'], + ['/home/ada/elsewhere', 'recent', '2026-06-01T10:00:00.000Z'] + ]) { + await writeCodeBuddySession({ sessionsDir: roots.codebuddyProjectsDir, cwd, id, timestamp }) + } + const result = await scanAiVaultSessions({ + ...roots, + platform: 'linux', + limit: 1, + scopePaths: ['/home/ada/repo/app'] + }) + expect(result.sessions.map((session) => session.sessionId)).toContain('in-scope') + expect(result.sessions.map((session) => session.sessionId)).not.toContain('collision') + }) + + it('adds nothing when no scope is requested', async () => { + const root = await mkdtemp(join(tmpdir(), 'orca-ai-vault-codebuddy-noscope-')) + tempRoots.push(root) + const roots = isolatedScanRoots(root) + await writeCodeBuddySession({ + sessionsDir: roots.codebuddyProjectsDir, + cwd: '/home/ada/old', + id: 'old', + timestamp: '2026-05-01T10:00:00.000Z' + }) + await writeCodeBuddySession({ + sessionsDir: roots.codebuddyProjectsDir, + cwd: '/home/ada/new', + id: 'new', + timestamp: '2026-06-01T10:00:00.000Z' + }) + + const result = await scanAiVaultSessions({ ...roots, platform: 'linux', limit: 1 }) + + expect(result.sessions.map((session) => session.sessionId)).toEqual(['new']) + }) +}) diff --git a/src/main/ai-vault/session-scanner-codebuddy-source.test.ts b/src/main/ai-vault/session-scanner-codebuddy-source.test.ts new file mode 100644 index 000000000000..a171ac6d6716 --- /dev/null +++ b/src/main/ai-vault/session-scanner-codebuddy-source.test.ts @@ -0,0 +1,80 @@ +import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' +import { scanAiVaultSessions } from './session-scanner' +import { isolatedScanRoots, jsonLines } from './session-scanner-test-fixtures' + +let tempRoots: string[] = [] + +afterEach(async () => { + await Promise.all(tempRoots.map((root) => rm(root, { recursive: true, force: true }))) + tempRoots = [] +}) + +describe('scanAiVaultSessions — CodeBuddy transcripts', () => { + it('discovers ~/.codebuddy/projects transcripts and attributes them to codebuddy', async () => { + const root = await mkdtemp(join(tmpdir(), 'orca-ai-vault-codebuddy-')) + tempRoots.push(root) + const roots = isolatedScanRoots(root) + await mkdir(join(roots.codebuddyProjectsDir, 'project'), { recursive: true }) + + await writeFile( + join(roots.codebuddyProjectsDir, 'project', 'codebuddy-session.jsonl'), + jsonLines([ + { + id: 'cb-msg-1', + timestamp: 1_777_634_400_000, + type: 'message', + role: 'user', + content: [{ type: 'input_text', text: 'fix the flaky test' }], + sessionId: 'codebuddy-session', + cwd: '/repo/app' + }, + { + id: 'cb-msg-2', + timestamp: 1_777_634_405_000, + type: 'message', + role: 'assistant', + status: 'completed', + content: [{ type: 'output_text', text: 'On it' }], + providerData: { model: 'glm-5.3-flash' }, + sessionId: 'codebuddy-session', + cwd: '/repo/app' + }, + { + id: 'cb-title-1', + timestamp: 1_777_634_406_000, + type: 'ai-title', + aiTitle: 'Fixing the flaky test', + sessionId: 'codebuddy-session', + cwd: '/repo/app' + }, + { + id: 'cb-summary-1', + timestamp: 1_777_634_407_000, + type: 'summary', + summary: 'Fix the flaky test', + providerData: { source: 'initial-user-message' } + } + ]) + ) + + const result = await scanAiVaultSessions({ ...roots, platform: 'darwin' }) + + const codebuddy = result.sessions.find((session) => session.agent === 'codebuddy') + expect(codebuddy).toMatchObject({ + sessionId: 'codebuddy-session', + cwd: '/repo/app', + title: 'Fix the flaky test', + model: 'glm-5.3-flash', + resumeCommand: "cd '/repo/app' && codebuddy --resume 'codebuddy-session'", + filePath: join(roots.codebuddyProjectsDir, 'project', 'codebuddy-session.jsonl') + }) + expect(codebuddy?.messageCount).toBe(2) + expect(codebuddy?.previewMessages.map((message) => message.text)).toEqual([ + 'fix the flaky test', + 'On it' + ]) + }) +}) diff --git a/src/main/ai-vault/session-scanner-log-agent-fixtures.ts b/src/main/ai-vault/session-scanner-log-agent-fixtures.ts index ed2cf8d2eee7..be080271269c 100644 --- a/src/main/ai-vault/session-scanner-log-agent-fixtures.ts +++ b/src/main/ai-vault/session-scanner-log-agent-fixtures.ts @@ -32,6 +32,23 @@ export async function writeLogAgentFixtures( ]) ) + // CodeBuddy writes its own message-record shape under its own root. + await mkdir(join(roots.codebuddyProjectsDir, 'project'), { recursive: true }) + await writeFile( + join(roots.codebuddyProjectsDir, 'project', 'codebuddy-session.jsonl'), + jsonlBody([ + { + id: 'codebuddy-msg-1', + timestamp: 1_777_634_430_000, + type: 'message', + role: 'user', + content: [{ type: 'input_text', text: 'CodeBuddy title' }], + sessionId: 'codebuddy-session', + cwd: '/tmp/codebuddy' + } + ]) + ) + await mkdir(join(roots.codexSessionsDir, '2026', '05', '01'), { recursive: true }) await writeFile( join(roots.codexSessionsDir, '2026', '05', '01', 'rollout-2026-codex-session.jsonl'), diff --git a/src/main/ai-vault/session-scanner-parse-cache.ts b/src/main/ai-vault/session-scanner-parse-cache.ts index 4610c198cb37..a00f4edd2cfe 100644 --- a/src/main/ai-vault/session-scanner-parse-cache.ts +++ b/src/main/ai-vault/session-scanner-parse-cache.ts @@ -5,6 +5,7 @@ import { createCodexSessionResumeState } from './session-scanner-codex-parser' import { createDroidSessionResumeState } from './session-scanner-droid-parser' import { createMessageGraphSessionResumeState } from './session-scanner-graph-parsers' import { createClaudeSessionResumeState } from './session-scanner-primary-parsers' +import { createCodebuddySessionResumeState } from './session-scanner-codebuddy-parser' import { createGeminiJsonlSessionResumeState } from './session-scanner-gemini-parsers' import { createCopilotSessionResumeState } from './session-scanner-copilot-parser' import { createCursorSessionResumeState } from './session-scanner-cursor-parser' @@ -51,6 +52,8 @@ function resumableStateFactoryFor( switch (candidate.agent) { case 'claude': return (messages) => createClaudeSessionResumeState(candidate.file, messages) + case 'codebuddy': + return (messages) => createCodebuddySessionResumeState(candidate.file, messages) case 'codex': return (messages) => createCodexSessionResumeState(candidate.file, candidate.codexHome, messages) diff --git a/src/main/ai-vault/session-scanner-scope-discovery.ts b/src/main/ai-vault/session-scanner-scope-discovery.ts index d9ef112f7727..52795830e667 100644 --- a/src/main/ai-vault/session-scanner-scope-discovery.ts +++ b/src/main/ai-vault/session-scanner-scope-discovery.ts @@ -20,7 +20,7 @@ const REPRESENTATIVE_CWD_LINE_LIMIT = 200 const REPRESENTATIVE_FILE_LIMIT = 3 const TRANSCRIPT_EXTENSIONS = new Set(['.jsonl']) -// Both encodings are lossy; retain Claude’s existing cache and verify each Pi transcript. +// Bucket encodings are lossy; retain Claude’s cache and verify other transcripts individually. const PROJECT_DIR_CWD_CACHE_MAX = 2048 const projectDirCwdCache = new Map() @@ -75,7 +75,7 @@ type InScopeDiscoveryArgs = { } /** - * Fully include the transcripts of cwd-bucket directories (Claude, Pi) whose cwd + * Fully include the transcripts of cwd-bucket directories (Claude, Pi, CodeBuddy) whose cwd * falls inside the active workspace/project paths. * * Why: these agents keep one directory per cwd, e.g. `~/.claude/projects//`. @@ -108,7 +108,7 @@ export async function discoverInScopeCwdBucketFiles( } await collectBucketFiles({ agent: layout.agent, - scopePaths: layout.agent === 'pi' ? args.scopePaths : undefined, + scopePaths: layout.agent !== 'claude' ? args.scopePaths : undefined, projectDir, issues: args.issues, collected, diff --git a/src/main/ai-vault/session-scanner-test-fixtures.ts b/src/main/ai-vault/session-scanner-test-fixtures.ts index 43d03d340dde..0d9b8cef5aba 100644 --- a/src/main/ai-vault/session-scanner-test-fixtures.ts +++ b/src/main/ai-vault/session-scanner-test-fixtures.ts @@ -54,6 +54,7 @@ export async function writeOpenCode2SqliteFixture(root: string): Promise export function isolatedScanRoots(root: string) { return { claudeProjectsDir: join(root, 'claude-projects'), + codebuddyProjectsDir: join(root, 'codebuddy-projects'), codexSessionsDir: join(root, 'codex-sessions'), geminiSessionsDir: join(root, 'gemini-sessions'), antigravityBrainDir: join(root, 'antigravity-brain'), diff --git a/src/main/ai-vault/session-scanner-types.ts b/src/main/ai-vault/session-scanner-types.ts index 099b3593431b..be97a4b3187b 100644 --- a/src/main/ai-vault/session-scanner-types.ts +++ b/src/main/ai-vault/session-scanner-types.ts @@ -14,6 +14,7 @@ import type { OpenCodeWslRuntime } from './session-scanner-opencode-wsl-runtime' export type AiVaultScanOptions = { claudeProjectsDir?: string + codebuddyProjectsDir?: string codexSessionsDir?: string additionalCodexSessionsDirs?: readonly string[] // Why: tests inject a sandbox "real ~/.codex" so real-home attribution diff --git a/src/main/ai-vault/session-scanner.ts b/src/main/ai-vault/session-scanner.ts index 2f5629f94c3e..f56f17af7961 100644 --- a/src/main/ai-vault/session-scanner.ts +++ b/src/main/ai-vault/session-scanner.ts @@ -27,7 +27,11 @@ import { getSessionParseCacheEntry } from './session-parse-cache-store' import { describeSkippedTranscriptRecords } from './session-transcript-record-budget' import { canStopParsingSessions } from './session-scan-cutoff' import { discoverInScopeCwdBucketFiles } from './session-scanner-scope-discovery' -import { CLAUDE_CWD_BUCKET_LAYOUT, PI_CWD_BUCKET_LAYOUT } from './session-cwd-bucket-layouts' +import { + CLAUDE_CWD_BUCKET_LAYOUT, + PI_CWD_BUCKET_LAYOUT, + CODEBUDDY_CWD_BUCKET_LAYOUT +} from './session-cwd-bucket-layouts' import { discoverAiVaultSessionSources } from './session-scanner-source-discovery' import { cursorChatMetaRefusals, withCursorChatMetaScan } from './session-scanner-cursor-chat-meta' import type { @@ -166,7 +170,11 @@ function mergeSessions( // Agents whose on-disk layout names a directory per cwd, so a scope's older // sessions can be found without reading every transcript's header. -const CWD_BUCKET_LAYOUTS = [CLAUDE_CWD_BUCKET_LAYOUT, PI_CWD_BUCKET_LAYOUT] +const CWD_BUCKET_LAYOUTS = [ + CLAUDE_CWD_BUCKET_LAYOUT, + PI_CWD_BUCKET_LAYOUT, + CODEBUDDY_CWD_BUCKET_LAYOUT +] async function scanInScopeSessions(args: { discoveries: SessionFileDiscovery[] diff --git a/src/main/claude/hook-settings.ts b/src/main/claude/hook-settings.ts index 6ce4ea4869ca..381e4d26b6f0 100644 --- a/src/main/claude/hook-settings.ts +++ b/src/main/claude/hook-settings.ts @@ -19,8 +19,8 @@ import { isGitBashAvailable } from '../git-bash' import type { ClaudeManagedHookPlan } from './claude-managed-hook-events' export type ClaudeCompatibleHookSettings = { - configDirName: '.claude' | '.openclaude' | '.qoder' - scriptBaseName: 'claude-hook' | 'openclaude-hook' | 'qoder-hook' + configDirName: '.claude' | '.openclaude' | '.qoder' | '.codebuddy' + scriptBaseName: 'claude-hook' | 'openclaude-hook' | 'qoder-hook' | 'codebuddy-hook' usesWindowsCompatLauncher: boolean windowsHookShell?: 'powershell' } diff --git a/src/main/codebuddy/hook-service.test.ts b/src/main/codebuddy/hook-service.test.ts new file mode 100644 index 000000000000..e20ae46e39c2 --- /dev/null +++ b/src/main/codebuddy/hook-service.test.ts @@ -0,0 +1,47 @@ +import { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import type * as OsModule from 'node:os' +import { join } from 'node:path' +import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest' +const sandbox = vi.hoisted(() => ({ home: '' })) +vi.mock('node:os', async (importOriginal) => ({ + ...(await importOriginal()), + homedir: () => sandbox.home +})) +vi.mock('electron', () => ({ app: { getPath: () => sandbox.home } })) +import { codebuddyHookService, CODEBUDDY_HOOK_EVENTS } from './hook-service' + +beforeAll(() => { + sandbox.home = mkdtempSync(join(tmpdir(), 'orca-codebuddy-test-')) + mkdirSync(join(sandbox.home, '.codebuddy')) +}) +afterAll(() => rmSync(sandbox.home, { recursive: true, force: true })) + +describe('CodeBuddy managed hooks', () => { + it('preserves user configuration through repeated install and removal', () => { + const path = join(sandbox.home, '.codebuddy', 'settings.json') + const userHook = { hooks: [{ type: 'command', command: 'echo user-hook' }] } + const settings = { + model: 'custom', + hooks: { Stop: [userHook] }, + statusLine: { command: 'user-status' } + } + writeFileSync(path, JSON.stringify(settings)) + expect(codebuddyHookService.install().state).toBe('installed') + expect(codebuddyHookService.install().state).toBe('installed') + const installed = JSON.parse(readFileSync(path, 'utf8')) + for (const event of CODEBUDDY_HOOK_EVENTS) { + expect(installed.hooks[event]).toHaveLength(event === 'Stop' ? 2 : 1) + } + expect(installed.statusLine).toEqual(settings.statusLine) + expect(codebuddyHookService.remove().state).toBe('not_installed') + expect(JSON.parse(readFileSync(path, 'utf8'))).toMatchObject(settings) + }) + + it('leaves malformed user settings untouched', () => { + const path = join(sandbox.home, '.codebuddy', 'settings.json') + writeFileSync(path, '{broken') + expect(codebuddyHookService.install().state).toBe('error') + expect(readFileSync(path, 'utf8')).toBe('{broken') + }) +}) diff --git a/src/main/codebuddy/hook-service.ts b/src/main/codebuddy/hook-service.ts new file mode 100644 index 000000000000..1a7c9619a344 --- /dev/null +++ b/src/main/codebuddy/hook-service.ts @@ -0,0 +1,34 @@ +import type { ClaudeManagedHookPlan } from '../claude/claude-managed-hook-events' +import { ClaudeHookService } from '../claude/hook-service' + +export const CODEBUDDY_HOOK_EVENTS = [ + 'SessionStart', + 'SessionEnd', + 'UserPromptSubmit', + 'PreToolUse', + 'PostToolUse', + 'PostToolUseFailure', + 'PermissionRequest', + 'Stop', + 'StopFailure', + 'Notification' +] as const + +export const CODEBUDDY_MANAGED_HOOK_PLAN: ClaudeManagedHookPlan = { + install: CODEBUDDY_HOOK_EVENTS.map((eventName) => ({ eventName, definition: {} })), + retire: [], + statusLine: 'leave' +} + +export const codebuddyHookService = new ClaudeHookService({ + agent: 'codebuddy', + source: 'codebuddy', + displayName: 'CodeBuddy', + settings: { + configDirName: '.codebuddy', + scriptBaseName: 'codebuddy-hook', + usesWindowsCompatLauncher: true, + windowsHookShell: 'powershell' + }, + hookPlan: CODEBUDDY_MANAGED_HOOK_PLAN +}) diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index caed5202f089..cbbba795d593 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -616,7 +616,8 @@ "zcode_label": "ZCode", "d443a47995": "Prime Agent", "mimo_code_label": "MiMo Code", - "opencode2_label": "OpenCode 2" + "opencode2_label": "OpenCode 2", + "codebuddy_label": "CodeBuddy" }, "skill": { "cli": { diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 05d262673428..3e2132d6011a 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -385,7 +385,8 @@ "d443a47995": "Prime Agent", "mimo_code_label": "MiMo Code", "muse_label": "Muse", - "zcode_label": "ZCode" + "zcode_label": "ZCode", + "codebuddy_label": "CodeBuddy" }, "skill": { "cli": { diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json index 4f591ca8bf2d..53ceaf15c39e 100644 --- a/src/renderer/src/i18n/locales/fr.json +++ b/src/renderer/src/i18n/locales/fr.json @@ -595,6 +595,7 @@ "mimo_code_label": "MiMo Code", "muse_label": "Muse", "opencode2_label": "OpenCode 2", + "codebuddy_label": "CodeBuddy", "zcode_label": "ZCode" }, "skill": { diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 3e4a5cd42ee3..1b55d87552ac 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -496,6 +496,7 @@ "mimo_code_label": "MiMo Code", "muse_label": "Muse", "opencode2_label": "OpenCode 2", + "codebuddy_label": "CodeBuddy", "zcode_label": "ZCode" }, "skill": { diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index 75f96c732ab1..a5aca8c17b6b 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -496,6 +496,7 @@ "mimo_code_label": "MiMo Code", "muse_label": "Muse", "opencode2_label": "OpenCode 2", + "codebuddy_label": "CodeBuddy", "zcode_label": "ZCode" }, "skill": { diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 5d3eadd54d06..47fefd2f0e36 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -496,6 +496,7 @@ "mimo_code_label": "MiMo Code", "muse_label": "Muse", "opencode2_label": "OpenCode 2", + "codebuddy_label": "CodeBuddy", "zcode_label": "ZCode" }, "skill": { diff --git a/src/renderer/src/lib/agent-catalog-platform.ts b/src/renderer/src/lib/agent-catalog-platform.ts new file mode 100644 index 000000000000..9a9eac351f07 --- /dev/null +++ b/src/renderer/src/lib/agent-catalog-platform.ts @@ -0,0 +1,13 @@ +export function getCatalogPlatform(): NodeJS.Platform { + const userAgent = typeof navigator === 'undefined' ? '' : navigator.userAgent + if (userAgent.includes('Windows')) { + return 'win32' + } + if (userAgent.includes('Mac')) { + return 'darwin' + } + if (userAgent) { + return 'linux' + } + return typeof process === 'undefined' ? 'linux' : process.platform +} diff --git a/src/renderer/src/lib/agent-catalog.tsx b/src/renderer/src/lib/agent-catalog.tsx index 56cd2180c728..325d838552d2 100644 --- a/src/renderer/src/lib/agent-catalog.tsx +++ b/src/renderer/src/lib/agent-catalog.tsx @@ -1,3 +1,4 @@ +import { getCatalogPlatform } from './agent-catalog-platform' import type React from 'react' import { ClaudeIcon, DroidIcon, OpenAIIcon } from '@/components/status-bar/icons' import openClaudeLogoUrl from '../../../../resources/openclaude-logo.png?url' @@ -30,20 +31,6 @@ export type AgentCatalogEntry = { homepageUrl: string } -function getCatalogPlatform(): NodeJS.Platform { - const userAgent = typeof navigator === 'undefined' ? '' : navigator.userAgent - if (userAgent.includes('Windows')) { - return 'win32' - } - if (userAgent.includes('Mac')) { - return 'darwin' - } - if (userAgent) { - return 'linux' - } - return typeof process === 'undefined' ? 'linux' : process.platform -} - export const getAgentCatalog = createLocalizedCatalog((): AgentCatalogEntry[] => [ { id: 'claude', @@ -349,6 +336,13 @@ export const getAgentCatalog = createLocalizedCatalog((): AgentCatalogEntry[] => cmd: 'openclaw', faviconDomain: 'openclaw.ai', homepageUrl: 'https://github.com/openclaw/openclaw' + }, + { + id: 'codebuddy', + label: translate('auto.lib.agent.catalog.codebuddy_label', 'CodeBuddy'), + cmd: 'codebuddy', + faviconDomain: 'codebuddy.ai', + homepageUrl: 'https://www.codebuddy.ai/cli' } ]) diff --git a/src/renderer/src/lib/agent-status.ts b/src/renderer/src/lib/agent-status.ts index 41ccc2cc7d76..04ecd728541a 100644 --- a/src/renderer/src/lib/agent-status.ts +++ b/src/renderer/src/lib/agent-status.ts @@ -100,6 +100,7 @@ export { formatAgentTypeLabel } from '../../../shared/agent-type-label' const ICONABLE_AGENT_TYPES: Record = { claude: true, 'claude-agent-teams': true, + codebuddy: true, openclaude: true, codex: true, autohand: true, diff --git a/src/renderer/src/runtime/agent-resume-host-authority-capability.test.ts b/src/renderer/src/runtime/agent-resume-host-authority-capability.test.ts index 24393546a813..e5b6d8327ae6 100644 --- a/src/renderer/src/runtime/agent-resume-host-authority-capability.test.ts +++ b/src/renderer/src/runtime/agent-resume-host-authority-capability.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest' import { RESUMABLE_TUI_AGENTS } from '../../../shared/agent-session-resume' import { AGENT_SESSION_QODER_RESUME_RUNTIME_CAPABILITY, + AGENT_SESSION_CODEBUDDY_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_DSH_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_KIMI_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_MUSE_RESUME_RUNTIME_CAPABILITY, @@ -56,6 +57,7 @@ describe('agentResumeHostAuthorityCapability', () => { ) ).toEqual({ claude: undefined, + codebuddy: AGENT_SESSION_CODEBUDDY_RESUME_RUNTIME_CAPABILITY, codex: undefined, qoder: AGENT_SESSION_QODER_RESUME_RUNTIME_CAPABILITY, gemini: undefined, diff --git a/src/renderer/src/runtime/agent-resume-host-authority-capability.ts b/src/renderer/src/runtime/agent-resume-host-authority-capability.ts index efec3fe38b15..a5cefe6a74c5 100644 --- a/src/renderer/src/runtime/agent-resume-host-authority-capability.ts +++ b/src/renderer/src/runtime/agent-resume-host-authority-capability.ts @@ -3,6 +3,7 @@ import type { TuiAgent } from '../../../shared/tui-agent' import { AGENT_SESSION_KIMI_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_QODER_RESUME_RUNTIME_CAPABILITY, + AGENT_SESSION_CODEBUDDY_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_DSH_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_MUSE_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_ZCODE_RESUME_RUNTIME_CAPABILITY, @@ -20,6 +21,7 @@ import { const RESUME_HOST_AUTHORITY_CAPABILITY_BY_AGENT = { // These shipped inside agent-session.host-authority.v1's enum, so the generic probe covers them. claude: undefined, + codebuddy: AGENT_SESSION_CODEBUDDY_RESUME_RUNTIME_CAPABILITY, codex: undefined, qoder: AGENT_SESSION_QODER_RESUME_RUNTIME_CAPABILITY, gemini: undefined, diff --git a/src/renderer/src/runtime/remote-agent-session-launch.test.ts b/src/renderer/src/runtime/remote-agent-session-launch.test.ts index d8cf0c542cb8..dda22ff12fd4 100644 --- a/src/renderer/src/runtime/remote-agent-session-launch.test.ts +++ b/src/renderer/src/runtime/remote-agent-session-launch.test.ts @@ -45,7 +45,7 @@ describe('remote agent-session launch routing', () => { expect(legacy).not.toHaveBeenCalled() }) - it.each(['kimi', 'muse'] as const)( + it.each(['kimi', 'muse', 'codebuddy'] as const)( 'falls back to legacy when an older host lacks the %s resume capability', async (agent) => { const hostAuthority = vi.fn().mockResolvedValue('structured') @@ -70,23 +70,29 @@ describe('remote agent-session launch routing', () => { } ) - it('uses host authority when the host supports Muse resume', async () => { - const hostAuthority = vi.fn().mockResolvedValue('host') - const legacy = vi.fn() - mocks.supportsCapability.mockResolvedValue(true) + it.each(['muse', 'codebuddy'] as const)( + 'uses host authority when the host supports %s resume', + async (agent) => { + const hostAuthority = vi.fn().mockResolvedValue('host') + const legacy = vi.fn() + mocks.supportsCapability.mockResolvedValue(true) - await expect( - runRemoteAgentSessionLaunch({ - environmentId: 'env-1', - hostAuthority, - hostAuthorityCapability: agentResumeHostAuthorityCapability('muse'), - legacy - }) - ).resolves.toBe('host') - expect(mocks.supportsCapability).toHaveBeenCalledWith('env-1', 'agent-session.muse-resume.v1') - expect(hostAuthority).toHaveBeenCalledOnce() - expect(legacy).not.toHaveBeenCalled() - }) + await expect( + runRemoteAgentSessionLaunch({ + environmentId: 'env-1', + hostAuthority, + hostAuthorityCapability: agentResumeHostAuthorityCapability(agent), + legacy + }) + ).resolves.toBe('host') + expect(mocks.supportsCapability).toHaveBeenCalledWith( + 'env-1', + `agent-session.${agent}-resume.v1` + ) + expect(hostAuthority).toHaveBeenCalledOnce() + expect(legacy).not.toHaveBeenCalled() + } + ) it('preserves the exact legacy path when the capability is absent', async () => { const hostAuthority = vi.fn().mockResolvedValue('structured') diff --git a/src/shared/__fixtures__/codebuddy-question-hooks.jsonl b/src/shared/__fixtures__/codebuddy-question-hooks.jsonl new file mode 100644 index 000000000000..81a69a899b62 --- /dev/null +++ b/src/shared/__fixtures__/codebuddy-question-hooks.jsonl @@ -0,0 +1,6 @@ +{"hook_event_name": "UserPromptSubmit", "prompt": "Use AskUserQuestion to ask me to choose red or blue. After I answer, reply with my color and stop.", "permission_mode": "default", "version": "2.159.0", "model": "fast-model", "session_id": "codebuddy-verification", "transcript_path": "/sessions/codebuddy-verification.jsonl"} +{"hook_event_name": "SessionStart", "source": "startup", "permission_mode": "default", "version": "2.159.0", "model": "fast-model", "session_id": "codebuddy-verification", "transcript_path": "/sessions/codebuddy-verification.jsonl"} +{"hook_event_name": "Notification", "notification_type": "permission_prompt", "message": "needs your permission to use AskUserQuestion", "permission_mode": "default", "version": "2.159.0", "model": "fast-model", "session_id": "codebuddy-verification", "transcript_path": "/sessions/codebuddy-verification.jsonl"} +{"hook_event_name": "PreToolUse", "tool_name": "AskUserQuestion", "tool_input": {"questions": [{"header": "Color", "multiSelect": false, "options": [{"description": "Choose red", "label": "Red"}, {"description": "Choose blue", "label": "Blue"}], "question": "Which color do you choose?"}]}, "permission_mode": "default", "version": "2.159.0", "model": "fast-model", "session_id": "codebuddy-verification", "transcript_path": "/sessions/codebuddy-verification.jsonl"} +{"hook_event_name": "PostToolUse", "tool_name": "AskUserQuestion", "tool_input": {"questions": [{"header": "Color", "multiSelect": false, "options": [{"description": "Choose red", "label": "Red"}, {"description": "Choose blue", "label": "Blue"}], "question": "Which color do you choose?"}]}, "tool_response": " \u00b7 Which color do you choose? \u2192 Red", "permission_mode": "default", "version": "2.159.0", "model": "fast-model", "session_id": "codebuddy-verification", "transcript_path": "/sessions/codebuddy-verification.jsonl"} +{"hook_event_name": "Stop", "last_assistant_message": "Red", "permission_mode": "default", "version": "2.159.0", "model": "fast-model", "session_id": "codebuddy-verification", "transcript_path": "/sessions/codebuddy-verification.jsonl"} diff --git a/src/shared/__fixtures__/codebuddy-question-hooks.meta.json b/src/shared/__fixtures__/codebuddy-question-hooks.meta.json new file mode 100644 index 000000000000..28ac3a2d76b3 --- /dev/null +++ b/src/shared/__fixtures__/codebuddy-question-hooks.meta.json @@ -0,0 +1,6 @@ +{ + "version": "2.159.0", + "platform": "darwin", + "model": "fast-model", + "description": "Live CLI: question notification precedes PreToolUse; PreToolUse follows the answer; SessionStart follows UserPromptSubmit. Host paths and session identifiers replaced." +} diff --git a/src/shared/agent-headless-command.ts b/src/shared/agent-headless-command.ts index f3f67535963f..9f742a5355d1 100644 --- a/src/shared/agent-headless-command.ts +++ b/src/shared/agent-headless-command.ts @@ -1,3 +1,4 @@ +import { isCodebuddyNonInteractiveCommand } from './codebuddy-headless-command' import { isQoderHeadlessCommand } from './qoder-headless-command' import { isAnteHeadlessOneShotCommand } from './ante-headless-command' import { isDshNonInteractiveCommand } from './dsh-launch-command' @@ -18,6 +19,7 @@ const HEADLESS_ONE_SHOT_MATCHERS: Partial< > = { qoder: isQoderHeadlessCommand, claude: isPrintModeHeadlessOneShotCommand, + codebuddy: isCodebuddyNonInteractiveCommand, trae: isPrintModeHeadlessOneShotCommand, 'prime-agent': isPrimeAgentHeadlessOneShotCommand, ante: isAnteHeadlessOneShotCommand, diff --git a/src/shared/agent-hook-listener/provider-dispatch.ts b/src/shared/agent-hook-listener/provider-dispatch.ts index 067e4552212c..ab7e847c4cad 100644 --- a/src/shared/agent-hook-listener/provider-dispatch.ts +++ b/src/shared/agent-hook-listener/provider-dispatch.ts @@ -1,3 +1,4 @@ +import { normalizeCompatibleLifecycleEvent } from './providers/compatible-lifecycle-events' import { normalizeQoderEvent } from './providers/qoder-events' import type { ParsedAgentStatusPayload } from '../agent-status-types' import type { AgentHookSource } from '../agent-hook-relay' @@ -53,6 +54,16 @@ export function normalizeProviderEvent(input: { let payload: ParsedAgentStatusPayload | null switch (source) { + case 'codebuddy': + payload = normalizeCompatibleLifecycleEvent( + source, + state, + eventName, + promptText, + paneKey, + hookPayload + ) + break case 'claude': payload = normalizeClaudeEvent(state, eventName, promptText, paneKey, hookPayload) break diff --git a/src/shared/agent-hook-listener/provider-event-routing.ts b/src/shared/agent-hook-listener/provider-event-routing.ts index 40e59a1d8201..80cd0fdc91c9 100644 --- a/src/shared/agent-hook-listener/provider-event-routing.ts +++ b/src/shared/agent-hook-listener/provider-event-routing.ts @@ -30,6 +30,7 @@ export function isNewTurnEvent(source: AgentHookSource, eventName: unknown): boo // Why: SessionStart lands an idle row (STA-3386) and must also drop stale // tool/prompt caches left by the pane's previous session. return eventName === 'SessionStart' || eventName === 'UserPromptSubmit' + case 'codebuddy': case 'kimi': // Why: Kimi Code emits Claude-compatible hook events, so UserPromptSubmit is its new-turn boundary too. return eventName === 'UserPromptSubmit' @@ -143,6 +144,7 @@ export function extractToolFields( case 'claude': // Why: Kimi Code uses Claude's tool_name/tool_input payload fields verbatim. // falls through + case 'codebuddy': case 'kimi': // Muse uses Claude-compatible tool fields. // falls through diff --git a/src/shared/agent-hook-listener/providers/compatible-lifecycle-events.ts b/src/shared/agent-hook-listener/providers/compatible-lifecycle-events.ts new file mode 100644 index 000000000000..2678dfc5e1ea --- /dev/null +++ b/src/shared/agent-hook-listener/providers/compatible-lifecycle-events.ts @@ -0,0 +1,104 @@ +import { isAskUserQuestionTool } from '../../agent-question-answered-intent' +import { + normalizeAgentStatusPayload, + type ParsedAgentStatusPayload +} from '../../agent-status-types' +import type { HookListenerState } from '../listener-state' +import { + resolvePrompt, + resolveToolState, + shouldIgnoreCompactContinuationUserPromptSubmit +} from '../prompt-fields' +import { extractToolFields, isNewTurnEvent } from '../provider-event-routing' +import { readString } from '../tool-input-preview' + +function readCompatibleState( + eventName: unknown, + payload: Record +): 'working' | 'waiting' | 'done' | null { + switch (eventName) { + case 'SessionStart': + // Compaction restarts the session during an active turn. + return ['startup', 'resume', 'clear', 'new'].includes(String(payload.source)) ? 'done' : null + case 'UserPromptSubmit': + case 'PostToolUse': + case 'PostToolUseFailure': + return 'working' + case 'PreToolUse': + return isAskUserQuestionTool(readString(payload, 'tool_name')) ? 'waiting' : 'working' + case 'PermissionRequest': + return 'waiting' + case 'Stop': + case 'StopFailure': + case 'SessionEnd': + return 'done' + case 'PostCompact': + return payload.trigger === 'manual' ? 'done' : null + case 'Notification': + if ( + payload.notification_type === 'permission_prompt' || + payload.notification_type === 'elicitation_dialog' + ) { + return 'waiting' + } + return payload.notification_type === 'idle_prompt' ? 'done' : null + default: + return null + } +} + +export function normalizeCompatibleLifecycleEvent( + source: 'qoder' | 'codebuddy', + state: HookListenerState, + eventName: unknown, + promptText: string, + paneKey: string, + hookPayload: Record +): ParsedAgentStatusPayload | null { + if (shouldIgnoreCompactContinuationUserPromptSubmit(eventName, promptText)) { + return null + } + // CodeBuddy emits SessionStart after UserPromptSubmit, so it cannot settle a turn. + if (source === 'codebuddy' && eventName === 'SessionStart') { + return null + } + const stateName = + source === 'codebuddy' && eventName === 'PreToolUse' + ? 'working' + : readCompatibleState(eventName, hookPayload) + if (!stateName) { + return null + } + const resetOnNewTurn = isNewTurnEvent(source, eventName) + const toolFields = extractToolFields(source, eventName, hookPayload) + if ( + source === 'codebuddy' && + eventName === 'Notification' && + hookPayload.notification_type === 'permission_prompt' && + hookPayload.message === 'needs your permission to use AskUserQuestion' + ) { + toolFields.toolName = 'AskUserQuestion' + } + const snapshot = resolveToolState(state, paneKey, toolFields, { resetOnNewTurn }) + return normalizeAgentStatusPayload({ + state: stateName, + agentType: source, + prompt: resolvePrompt( + state, + paneKey, + source === 'codebuddy' && eventName === 'Notification' ? '' : promptText, + { resetOnNewTurn } + ), + toolName: snapshot.toolName, + toolInput: snapshot.toolInput, + interactivePrompt: snapshot.interactivePrompt, + lastAssistantMessage: snapshot.lastAssistantMessage, + lastAssistantMessageIsToolOutput: snapshot.lastAssistantMessageIsToolOutput, + sessionBoundary: eventName === 'SessionStart' || eventName === 'PostCompact' ? true : undefined, + interrupted: eventName === 'Stop' && hookPayload.is_interrupt === true ? true : undefined, + mainAgent: + eventName === 'StopFailure' + ? { state: 'done', outcome: 'failure', stateStartedAt: Date.now() } + : undefined + }) +} diff --git a/src/shared/agent-hook-listener/providers/qoder-events.ts b/src/shared/agent-hook-listener/providers/qoder-events.ts index bdf2a622dbec..c83923d58f74 100644 --- a/src/shared/agent-hook-listener/providers/qoder-events.ts +++ b/src/shared/agent-hook-listener/providers/qoder-events.ts @@ -1,51 +1,5 @@ -import { isAskUserQuestionTool } from '../../agent-question-answered-intent' -import { - normalizeAgentStatusPayload, - type ParsedAgentStatusPayload -} from '../../agent-status-types' +import { normalizeCompatibleLifecycleEvent } from './compatible-lifecycle-events' import type { HookListenerState } from '../listener-state' -import { - resolvePrompt, - resolveToolState, - shouldIgnoreCompactContinuationUserPromptSubmit -} from '../prompt-fields' -import { extractToolFields, isNewTurnEvent } from '../provider-event-routing' -import { readString } from '../tool-input-preview' - -function readQoderState( - eventName: unknown, - payload: Record -): 'working' | 'waiting' | 'done' | null { - switch (eventName) { - case 'SessionStart': - // Compaction restarts the session during an active turn. - return ['startup', 'resume', 'clear', 'new'].includes(String(payload.source)) ? 'done' : null - case 'UserPromptSubmit': - case 'PostToolUse': - case 'PostToolUseFailure': - return 'working' - case 'PreToolUse': - return isAskUserQuestionTool(readString(payload, 'tool_name')) ? 'waiting' : 'working' - case 'PermissionRequest': - return 'waiting' - case 'Stop': - case 'StopFailure': - case 'SessionEnd': - return 'done' - case 'PostCompact': - return payload.trigger === 'manual' ? 'done' : null - case 'Notification': - if ( - payload.notification_type === 'permission_prompt' || - payload.notification_type === 'elicitation_dialog' - ) { - return 'waiting' - } - return payload.notification_type === 'idle_prompt' ? 'done' : null - default: - return null - } -} export function normalizeQoderEvent( state: HookListenerState, @@ -53,35 +7,13 @@ export function normalizeQoderEvent( promptText: string, paneKey: string, hookPayload: Record -): ParsedAgentStatusPayload | null { - if (shouldIgnoreCompactContinuationUserPromptSubmit(eventName, promptText)) { - return null - } - const stateName = readQoderState(eventName, hookPayload) - if (!stateName) { - return null - } - const resetOnNewTurn = isNewTurnEvent('qoder', eventName) - const snapshot = resolveToolState( +) { + return normalizeCompatibleLifecycleEvent( + 'qoder', state, + eventName, + promptText, paneKey, - extractToolFields('qoder', eventName, hookPayload), - { resetOnNewTurn } + hookPayload ) - return normalizeAgentStatusPayload({ - state: stateName, - agentType: 'qoder', - prompt: resolvePrompt(state, paneKey, promptText, { resetOnNewTurn }), - toolName: snapshot.toolName, - toolInput: snapshot.toolInput, - interactivePrompt: snapshot.interactivePrompt, - lastAssistantMessage: snapshot.lastAssistantMessage, - lastAssistantMessageIsToolOutput: snapshot.lastAssistantMessageIsToolOutput, - sessionBoundary: eventName === 'SessionStart' || eventName === 'PostCompact' ? true : undefined, - interrupted: eventName === 'Stop' && hookPayload.is_interrupt === true ? true : undefined, - mainAgent: - eventName === 'StopFailure' - ? { state: 'done', outcome: 'failure', stateStartedAt: Date.now() } - : undefined - }) } diff --git a/src/shared/agent-hook-listener/source-routing.ts b/src/shared/agent-hook-listener/source-routing.ts index 2b7f0147e60a..2940685665c4 100644 --- a/src/shared/agent-hook-listener/source-routing.ts +++ b/src/shared/agent-hook-listener/source-routing.ts @@ -6,6 +6,7 @@ export const HOOK_SOURCE_BY_PATHNAME: Readonly> '/hook/claude': 'claude', '/hook/codex': 'codex', '/hook/qoder': 'qoder', + '/hook/codebuddy': 'codebuddy', '/hook/gemini': 'gemini', '/hook/antigravity': 'antigravity', '/hook/amp': 'amp', diff --git a/src/shared/agent-hook-relay.ts b/src/shared/agent-hook-relay.ts index 7e0d452a66bf..bb2dca99f729 100644 --- a/src/shared/agent-hook-relay.ts +++ b/src/shared/agent-hook-relay.ts @@ -38,6 +38,7 @@ const AGENT_HOOK_SOURCES = [ 'claude', 'codex', 'qoder', + 'codebuddy', 'gemini', 'antigravity', 'amp', diff --git a/src/shared/agent-hook-types.ts b/src/shared/agent-hook-types.ts index cc83527fc096..0bc5b67bc284 100644 --- a/src/shared/agent-hook-types.ts +++ b/src/shared/agent-hook-types.ts @@ -8,6 +8,7 @@ export const AGENT_HOOK_TARGETS = [ 'openclaude', 'codex', 'qoder', + 'codebuddy', 'gemini', 'antigravity', 'amp', diff --git a/src/shared/agent-icons/codebuddy.png b/src/shared/agent-icons/codebuddy.png new file mode 100644 index 0000000000000000000000000000000000000000..ecaab1216f4b1edbee6aa61de58fb83dbfdc888e GIT binary patch literal 3794 zcmV;@4lVJCP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91D4+uX1ONa40RR91C;$Ke0D9(TtN;KGJV``BR9FcuSZR!1=UINg?QD0Q zJDX>`dmPtJ?0AdgI+aP^M3F0EZ;C^9O1A;-2YGb z$TSJ&-)l+u(oo)^Fz|2YXX(K_-MdHEX6V7f3bAZ#eE6|#YGQ)M#%aw2k)YC&iijjx zMqFs3X`-s5HOxkMn#1EIF0QiA1N%6G!#Ha#=fZ!mlyxbJ=-Nd({*x=exw$mlnp|2O za%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&VJ+*n=&Z$k?0^ds%wuYq-SR%qB9_{8Z<%124M?A6r2XSUv_ const TUI_AGENT_KIND_BY_AGENT = { claude: 'claude-code', 'claude-agent-teams': 'claude-agent-teams', + codebuddy: 'codebuddy', openclaude: 'openclaude', codex: 'codex', autohand: 'autohand', diff --git a/src/shared/agent-node-package-entrypoints.ts b/src/shared/agent-node-package-entrypoints.ts index 905d41f95f09..7f8f9abd7cb2 100644 --- a/src/shared/agent-node-package-entrypoints.ts +++ b/src/shared/agent-node-package-entrypoints.ts @@ -6,6 +6,7 @@ // new agent's install path is a data edit, as in agent-node-entrypoint-identities.ts. export const NODE_PACKAGE_SCRIPT_ENTRYPOINTS: Record = { codex: ['node_modules/@openai/codex/'], + codebuddy: ['node_modules/@tencent-ai/codebuddy-code/'], gemini: ['node_modules/@google/gemini-cli/'], // Why: ZCode's npm bin is `dist/zcode.cjs`, so a package install runs as `node …zcode.cjs` // and never shows `zcode` as the foreground name (a SEA build still matches by name). diff --git a/src/shared/agent-session-option-catalog-codebuddy.ts b/src/shared/agent-session-option-catalog-codebuddy.ts new file mode 100644 index 000000000000..d0a8afa04c51 --- /dev/null +++ b/src/shared/agent-session-option-catalog-codebuddy.ts @@ -0,0 +1,44 @@ +import { hasFlag } from './agent-cli-flag-detection' +import { removeAgentArgOption } from './agent-session-option-agent-args' +import type { AgentSessionOptionCatalog, CatalogOption } from './agent-session-option-catalog-types' + +const CODEBUDDY_EFFORT: CatalogOption = { + id: 'effort', + label: 'Reasoning effort', + category: 'thought_level', + kind: { + type: 'select', + choices: [ + { value: 'minimal', label: 'Minimal' }, + { value: 'low', label: 'Low' }, + { value: 'medium', label: 'Medium' }, + { value: 'high', label: 'High' }, + { value: 'xhigh', label: 'Extra high' }, + { value: 'max', label: 'Max' } + ], + defaultValue: 'medium' + }, + apply: { + launchArgs: (value) => ['--effort', String(value)], + agentArgsOverride: (tokens) => hasFlag(tokens, ['--effort']), + removeAgentArgs: (tokens) => removeAgentArgOption(tokens, ['--effort']) + } +} + +export const CODEBUDDY_SESSION_OPTION_CATALOG: AgentSessionOptionCatalog = { + supportsWorkerLaunchPreferences: true, + // Stable CLI aliases let CodeBuddy resolve the account's current model choices. + models: [ + { id: 'default-model', label: 'Default' }, + { id: 'fast-model', label: 'Fast' }, + { id: 'balanced-model', label: 'Balanced' }, + { id: 'primary-model', label: 'Primary' }, + { id: 'deep-model', label: 'Deep' } + ].map((model) => ({ ...model, options: [CODEBUDDY_EFFORT] })), + modelApply: { + launchArgs: (value) => ['--model', String(value)], + agentArgsOverride: (tokens) => hasFlag(tokens, ['--model']), + removeAgentArgs: (tokens) => removeAgentArgOption(tokens, ['--model']) + }, + unknownModelOptions: [CODEBUDDY_EFFORT] +} diff --git a/src/shared/agent-session-option-catalog.ts b/src/shared/agent-session-option-catalog.ts index a8e26f5a0edb..74a7f3848017 100644 --- a/src/shared/agent-session-option-catalog.ts +++ b/src/shared/agent-session-option-catalog.ts @@ -1,3 +1,4 @@ +import { CODEBUDDY_SESSION_OPTION_CATALOG } from './agent-session-option-catalog-codebuddy' import type { AgentType } from './agent-status-types' import { ANTIGRAVITY_SESSION_OPTION_CATALOG } from './agent-session-option-catalog-antigravity' import { @@ -34,6 +35,7 @@ export { createClaudeCatalogOptions } const CATALOGS: AgentSessionOptionCatalogMap = { antigravity: ANTIGRAVITY_SESSION_OPTION_CATALOG, claude: CLAUDE_SESSION_OPTION_CATALOG, + codebuddy: CODEBUDDY_SESSION_OPTION_CATALOG, codex: CODEX_SESSION_OPTION_CATALOG, gemini: GEMINI_SESSION_OPTION_CATALOG, cursor: CURSOR_SESSION_OPTION_CATALOG, diff --git a/src/shared/agent-session-resume.test.ts b/src/shared/agent-session-resume.test.ts index 577492ddefc4..397a1a9451f8 100644 --- a/src/shared/agent-session-resume.test.ts +++ b/src/shared/agent-session-resume.test.ts @@ -28,6 +28,10 @@ describe('agent session resume metadata', () => { expect(isResumableTuiAgent('kimi')).toBe(true) }) + it('treats CodeBuddy as a resumable TUI agent', () => { + expect(isResumableTuiAgent('codebuddy')).toBe(true) + }) + it.each([ ['claude', { session_id: 'claude-session' }, { key: 'session_id', id: 'claude-session' }], ['codex', { session_id: 'codex-session' }, { key: 'session_id', id: 'codex-session' }], @@ -70,6 +74,7 @@ describe('agent session resume metadata', () => { it.each([ ['claude', { key: 'session_id', id: 's1' }, ['claude', '--resume', 's1']], + ['codebuddy', { key: 'session_id', id: 's1' }, ['codebuddy', '--resume', 's1']], ['codex', { key: 'session_id', id: 's1' }, ['codex', 'resume', 's1']], ['gemini', { key: 'session_id', id: 's1' }, ['gemini', '--resume', 's1']], ['antigravity', { key: 'conversation_id', id: 's1' }, ['agy', '--conversation', 's1']], diff --git a/src/shared/agent-session-resume.ts b/src/shared/agent-session-resume.ts index 4cbc240c7641..40a3699af3c3 100644 --- a/src/shared/agent-session-resume.ts +++ b/src/shared/agent-session-resume.ts @@ -5,6 +5,7 @@ import type { TuiAgent } from './tui-agent' export const RESUMABLE_TUI_AGENTS = [ 'claude', + 'codebuddy', 'codex', 'qoder', 'gemini', @@ -196,6 +197,7 @@ export function extractAgentProviderSession( // since recent Claude Code names the transcript file with a UUID that differs // from the hook session_id (so the id-based glob no longer finds it). case 'qoder': + case 'codebuddy': case 'claude': case 'codex': { const id = readSessionId(payload, ['session_id']) @@ -277,6 +279,8 @@ export function getAgentResumeArgv( ): string[] | null { const id = providerSession.id switch (agent) { + case 'codebuddy': + return providerSession.key === 'session_id' ? ['codebuddy', '--resume', id] : null case 'claude': return providerSession.key === 'session_id' ? ['claude', '--resume', id] : null case 'codex': diff --git a/src/shared/agent-type-label.ts b/src/shared/agent-type-label.ts index a4d70a760370..72d1b1b6d634 100644 --- a/src/shared/agent-type-label.ts +++ b/src/shared/agent-type-label.ts @@ -4,6 +4,7 @@ import type { AgentType } from './agent-status-types' // (e.g. native chat's empty state on both surfaces) from one source of truth. const WELL_KNOWN_LABELS: Record = { claude: 'Claude', + codebuddy: 'CodeBuddy', openclaude: 'OpenClaude', codex: 'Codex', qoder: 'Qoder CLI', diff --git a/src/shared/ai-vault-resume-command.test.ts b/src/shared/ai-vault-resume-command.test.ts index da8ced39e0e3..db89cb412638 100644 --- a/src/shared/ai-vault-resume-command.test.ts +++ b/src/shared/ai-vault-resume-command.test.ts @@ -28,6 +28,17 @@ describe('buildAiVaultResumeCommand', () => { ).toBe('cmd /d /s /c "cd /d ""C:\\Users\\Ada Lovelace\\repo"" && codex resume ""session-1"""') }) + it('resumes CodeBuddy sessions with the Claude-compatible --resume flag', () => { + expect( + buildAiVaultResumeCommand({ + agent: 'codebuddy', + sessionId: 'aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee', + cwd: '/repo/app', + platform: 'darwin' + }) + ).toBe("cd '/repo/app' && codebuddy --resume 'aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee'") + }) + it('builds a direct queued command for a live cmd shell', () => { expect( buildAiVaultResumeCommand({ diff --git a/src/shared/ai-vault-resume-command.ts b/src/shared/ai-vault-resume-command.ts index cfff419c95c9..efb2ddbe5d3c 100644 --- a/src/shared/ai-vault-resume-command.ts +++ b/src/shared/ai-vault-resume-command.ts @@ -218,6 +218,7 @@ function buildAgentResumeInvocation( return `${baseCommand} resume ${sessionArg}` case 'cline': return `${baseCommand} --id ${sessionArg}` + case 'codebuddy': case 'claude': case 'zcode': case 'cursor': diff --git a/src/shared/ai-vault-session-deletion.ts b/src/shared/ai-vault-session-deletion.ts index d3c2211ab847..4875ab6e889a 100644 --- a/src/shared/ai-vault-session-deletion.ts +++ b/src/shared/ai-vault-session-deletion.ts @@ -40,6 +40,7 @@ export const AI_VAULT_DELETABLE_AGENTS = [ 'pi', 'omp', 'claude', + 'codebuddy', 'rovo', 'grok', 'cline' diff --git a/src/shared/ai-vault-types.ts b/src/shared/ai-vault-types.ts index 28f93dcfbe19..e337f98d7a08 100644 --- a/src/shared/ai-vault-types.ts +++ b/src/shared/ai-vault-types.ts @@ -3,6 +3,7 @@ import type { ExecutionHostId, ExecutionHostScope } from './execution-host' export const AI_VAULT_AGENTS = [ 'claude', + 'codebuddy', 'codex', 'hermes', 'pi', @@ -51,6 +52,7 @@ export type AiVaultGroup = 'project' | 'folder' | 'agent' export const AI_VAULT_AGENT_LABELS = { claude: 'Claude', + codebuddy: 'CodeBuddy', codex: 'Codex', hermes: 'Hermes', pi: 'Pi', diff --git a/src/shared/codebuddy-agent.test.ts b/src/shared/codebuddy-agent.test.ts new file mode 100644 index 000000000000..6915cf8d5730 --- /dev/null +++ b/src/shared/codebuddy-agent.test.ts @@ -0,0 +1,67 @@ +import { readFileSync } from 'node:fs' +import { join } from 'node:path' +import { describe, expect, it } from 'vitest' +import { createHookListenerState } from './agent-hook-listener/listener-state' +import { normalizeAndAccept } from './agent-hook-listener-test-harness' +import { recognizeAgentProcessFromCommandLine } from './agent-process-recognition' +import { getAgentSessionOptionCatalog } from './agent-session-option-catalog' +import { getAgentResumeArgv } from './agent-session-resume' + +describe('CodeBuddy harness', () => { + it('replays the live question lifecycle without settling at late SessionStart', () => { + const state = createHookListenerState() + const events = readFileSync( + join(__dirname, '__fixtures__/codebuddy-question-hooks.jsonl'), + 'utf8' + ) + .trim() + .split('\n') + .map((line) => JSON.parse(line)) + const rows = events.map((event) => normalizeAndAccept(state, 'codebuddy', event)) + expect(rows.map((row) => row?.payload.state ?? null)).toEqual([ + 'working', + null, + 'waiting', + 'working', + 'working', + 'done' + ]) + expect(rows[2]?.payload).toMatchObject({ agentType: 'codebuddy', toolName: 'AskUserQuestion' }) + expect(rows[5]?.payload).toMatchObject({ agentType: 'codebuddy', lastAssistantMessage: 'Red' }) + expect(rows[5]?.providerSession?.id).toBe('codebuddy-verification') + }) + + it.each([ + 'codebuddy', + 'cbc', + 'C:\\Tools\\codebuddy.cmd', + 'node /usr/lib/node_modules/@tencent-ai/codebuddy-code/dist/codebuddy.js' + ])('recognizes interactive %s', (command) => { + expect(recognizeAgentProcessFromCommandLine(command)?.agent).toBe('codebuddy') + }) + + it('excludes print runs and resumes the original provider session', () => { + for (const flag of ['--print', '--serve', '--acp', '--bg', '--background']) { + expect(recognizeAgentProcessFromCommandLine(`codebuddy ${flag}`)).toBeNull() + } + expect(recognizeAgentProcessFromCommandLine('codebuddy -- --serve')?.agent).toBe('codebuddy') + expect(getAgentResumeArgv('codebuddy', { key: 'session_id', id: 'session-1' })).toEqual([ + 'codebuddy', + '--resume', + 'session-1' + ]) + }) + + it('passes explicit model and effort preferences through the CLI flags', () => { + const catalog = getAgentSessionOptionCatalog('codebuddy') + expect(catalog?.modelApply.launchArgs?.('fast-model')).toEqual(['--model', 'fast-model']) + expect(catalog?.unknownModelOptions?.[0].apply.launchArgs?.('high')).toEqual([ + '--effort', + 'high' + ]) + expect(catalog?.modelApply.removeAgentArgs?.(['--model', 'old', '--', 'prompt'])).toEqual([ + '--', + 'prompt' + ]) + }) +}) diff --git a/src/shared/codebuddy-headless-command.ts b/src/shared/codebuddy-headless-command.ts new file mode 100644 index 000000000000..5c632b27b3b0 --- /dev/null +++ b/src/shared/codebuddy-headless-command.ts @@ -0,0 +1,13 @@ +import { agentArgOptionTokens } from './agent-session-option-agent-args' +import { isPrintModeHeadlessOneShotCommand, optionName } from './print-mode-headless-command' + +const NON_INTERACTIVE_FLAGS = new Set(['--serve', '--acp', '--bg', '--background']) + +export function isCodebuddyNonInteractiveCommand(tokens: readonly string[]): boolean { + return ( + isPrintModeHeadlessOneShotCommand(tokens) || + agentArgOptionTokens(tokens) + .slice(1) + .some((token) => NON_INTERACTIVE_FLAGS.has(optionName(token))) + ) +} diff --git a/src/shared/protocol-version.ts b/src/shared/protocol-version.ts index bd8b3f62a31f..3a877a809004 100644 --- a/src/shared/protocol-version.ts +++ b/src/shared/protocol-version.ts @@ -236,6 +236,8 @@ export const AGENT_SESSION_OPENCODE2_RESUME_RUNTIME_CAPABILITY = 'agent-session.opencode2-resume.v1' as const export const AGENT_SESSION_MUSE_RESUME_RUNTIME_CAPABILITY = 'agent-session.muse-resume.v1' as const export const AGENT_SESSION_DSH_RESUME_RUNTIME_CAPABILITY = 'agent-session.dsh-resume.v1' as const +export const AGENT_SESSION_CODEBUDDY_RESUME_RUNTIME_CAPABILITY = + 'agent-session.codebuddy-resume.v1' as const export const AGENT_SESSION_QODER_RESUME_RUNTIME_CAPABILITY = 'agent-session.qoder-resume.v1' as const export const AGENT_SESSION_ZCODE_RESUME_RUNTIME_CAPABILITY = @@ -402,6 +404,7 @@ export const RUNTIME_CAPABILITIES = [ AGENT_SESSION_MUSE_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_DSH_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_QODER_RESUME_RUNTIME_CAPABILITY, + AGENT_SESSION_CODEBUDDY_RESUME_RUNTIME_CAPABILITY, AGENT_SESSION_ZCODE_RESUME_RUNTIME_CAPABILITY, FILE_MUTATION_OWNERSHIP_RUNTIME_CAPABILITY, GITHUB_MARK_PR_READY_RUNTIME_CAPABILITY, diff --git a/src/shared/skills-cli-agent-keys.ts b/src/shared/skills-cli-agent-keys.ts index f8d1a913172f..1955bfa6d581 100644 --- a/src/shared/skills-cli-agent-keys.ts +++ b/src/shared/skills-cli-agent-keys.ts @@ -14,6 +14,7 @@ import type { TuiAgent } from './tui-agent' export const SKILLS_CLI_AGENT_KEY_BY_TUI_AGENT = { claude: 'claude-code', 'claude-agent-teams': 'claude-code', + codebuddy: 'codebuddy', // Why: Orca states OpenClaude reads Claude-owned roots (native-chat-agent-profiles). openclaude: 'claude-code', codex: 'codex', diff --git a/src/shared/telemetry-property-schemas.ts b/src/shared/telemetry-property-schemas.ts index cee76b677d64..89f62138407b 100644 --- a/src/shared/telemetry-property-schemas.ts +++ b/src/shared/telemetry-property-schemas.ts @@ -10,6 +10,7 @@ import type { GlobalSettings } from './global-settings-types' export const AGENT_KIND_VALUES = [ 'claude-code', 'claude-agent-teams', + 'codebuddy', 'openclaude', 'codex', 'autohand', diff --git a/src/shared/tui-agent-config.ts b/src/shared/tui-agent-config.ts index 153189139681..27cda1d19796 100644 --- a/src/shared/tui-agent-config.ts +++ b/src/shared/tui-agent-config.ts @@ -97,6 +97,11 @@ const TUI_AGENT_CONFIG_SOURCE: Record = { promptInjectionMode: 'stdin-after-start', pasteNeedsTypedRequest: true }, + codebuddy: { + detectCmd: 'codebuddy', + detectCmdAliases: ['cbc'], + promptInjectionMode: 'argv' + }, openclaude: { detectCmd: 'openclaude', promptInjectionMode: 'argv', @@ -148,7 +153,6 @@ const TUI_AGENT_CONFIG_SOURCE: Record = { detectCmd: 'opencode2', // The private server inherits this pane's hook endpoint and identity. launchCmd: 'opencode2 --standalone', - expectedProcess: 'opencode2', promptInjectionMode: 'flag-prompt', draftPasteReadySignal: 'render-cursor-after-bracketed-paste', draftPasteReadyTimeoutMs: 20_000 diff --git a/src/shared/tui-agent-display-names.ts b/src/shared/tui-agent-display-names.ts index a90daa3242f3..31b6035a9530 100644 --- a/src/shared/tui-agent-display-names.ts +++ b/src/shared/tui-agent-display-names.ts @@ -8,6 +8,7 @@ import type { TuiAgent } from './tui-agent' export const TUI_AGENT_DISPLAY_NAMES: Record = { claude: 'Claude', 'claude-agent-teams': 'Claude Agent Teams', + codebuddy: 'CodeBuddy', openclaude: 'OpenClaude', codex: 'Codex', devin: 'Devin', diff --git a/src/shared/tui-agent-permissions.ts b/src/shared/tui-agent-permissions.ts index 3a9912bf0663..9fc8eb0a6910 100644 --- a/src/shared/tui-agent-permissions.ts +++ b/src/shared/tui-agent-permissions.ts @@ -5,6 +5,7 @@ export type AgentPermissionMode = 'yolo' | 'manual' | 'mixed' export const YOLO_TUI_AGENT_ARGS: Partial> = { claude: '--dangerously-skip-permissions', + codebuddy: '--dangerously-skip-permissions', 'claude-agent-teams': '--dangerously-skip-permissions', openclaude: '--dangerously-skip-permissions', codex: '--dangerously-bypass-approvals-and-sandbox', diff --git a/src/shared/tui-agent-rest-signal.test.ts b/src/shared/tui-agent-rest-signal.test.ts index f7d110328755..6e573acc0b06 100644 --- a/src/shared/tui-agent-rest-signal.test.ts +++ b/src/shared/tui-agent-rest-signal.test.ts @@ -29,6 +29,7 @@ const EXPECTED_REST_SIGNALS: Record = { grok: 'title', muse: 'ready-body', qoder: 'ready-body', + codebuddy: 'none', autohand: 'none', ante: 'none', trae: 'none', diff --git a/src/shared/tui-agent-selection.ts b/src/shared/tui-agent-selection.ts index 85567dcb334c..acf305dad599 100644 --- a/src/shared/tui-agent-selection.ts +++ b/src/shared/tui-agent-selection.ts @@ -45,7 +45,8 @@ export const TUI_AGENT_AUTO_PICK_ORDER = [ 'rovo', 'hermes', 'devin', - 'openclaw' + 'openclaw', + 'codebuddy' ] as const satisfies readonly TuiAgent[] // Why: fresh installs should expose Claude Agent Teams in agent pickers; the diff --git a/src/shared/tui-agent.ts b/src/shared/tui-agent.ts index 197222208887..a98c45101fd6 100644 --- a/src/shared/tui-agent.ts +++ b/src/shared/tui-agent.ts @@ -3,6 +3,7 @@ export type TuiAgent = | 'claude' // Claude Code | 'claude-agent-teams' // Claude Code Agent Teams via Orca native panes + | 'codebuddy' // CodeBuddy Code | 'openclaude' // OpenClaude | 'codex' // OpenAI Codex | 'autohand' // Autohand Code CLI From 28942eed5af3410e924f171d230db9452a2c9dc6 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:16:37 -0400 Subject: [PATCH 50/90] test(mobile): repin the RPC recording corpus to main after #22762 (#23757) #22762 squash-merged as 29c7d5d9835 with the corpus pinned to its branch commit 03995ae29d2, which the squash left unreachable from main. Repin baseline to main's tip and re-record the full corpus in place; only the baseline header moves on every golden. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- .../rpc-foundation/goldens/aivault-history-scan-fulfilled.json | 2 +- .../goldens/aivault-history-scan-unsupported.json | 2 +- .../goldens/aivault-history-scan-worktrees-late.json | 2 +- .../rpc-foundation/goldens/aivault-history-screen-listed.json | 2 +- .../goldens/aivault-history-screen-worktrees.json | 2 +- .../goldens/aivault-resume-launch-create-refused.json | 2 +- .../goldens/aivault-resume-launch-invalid-tab.json | 2 +- mobile/rpc-foundation/goldens/aivault-resume-launch-locked.json | 2 +- mobile/rpc-foundation/goldens/aivault-resume-launch-sent.json | 2 +- .../rpc-foundation/goldens/aivault-resume-prepare-refused.json | 2 +- mobile/rpc-foundation/goldens/aivault-resume-prepare-repin.json | 2 +- .../rpc-foundation/goldens/aivault-resume-prepare-skipped.json | 2 +- .../goldens/aivault-resume-prepare-unavailable.json | 2 +- mobile/rpc-foundation/goldens/b1.json | 2 +- mobile/rpc-foundation/goldens/b2.json | 2 +- mobile/rpc-foundation/goldens/b3.json | 2 +- mobile/rpc-foundation/goldens/browser-dialog-accepted.json | 2 +- mobile/rpc-foundation/goldens/browser-dialog-dismissed.json | 2 +- mobile/rpc-foundation/goldens/browser-keyboard-input.json | 2 +- .../rpc-foundation/goldens/browser-pointer-click-accepted.json | 2 +- .../rpc-foundation/goldens/browser-pointer-click-fallback.json | 2 +- mobile/rpc-foundation/goldens/browser-wheel-scrolled.json | 2 +- .../goldens/clipboard-image-attachment-anonymous.json | 2 +- .../goldens/clipboard-image-attachment-blocked-before-send.json | 2 +- .../goldens/clipboard-image-attachment-cancelled.json | 2 +- .../goldens/clipboard-image-attachment-pasted.json | 2 +- .../goldens/clipboard-image-attachment-upload-refused.json | 2 +- .../goldens/clipboard-image-upload-aborts-on-chunk-failure.json | 2 +- .../rpc-foundation/goldens/clipboard-image-upload-chunked.json | 2 +- .../goldens/clipboard-image-upload-single-frame-fallback.json | 2 +- .../goldens/clipboard-image-upload-start-refused.json | 2 +- mobile/rpc-foundation/goldens/codex-reset-credit-consumed.json | 2 +- mobile/rpc-foundation/goldens/codex-reset-credit-resumed.json | 2 +- mobile/rpc-foundation/goldens/components-codex-capability.json | 2 +- mobile/rpc-foundation/goldens/components-setup-ask.json | 2 +- mobile/rpc-foundation/goldens/components-target-local.json | 2 +- mobile/rpc-foundation/goldens/components-target-ssh.json | 2 +- mobile/rpc-foundation/goldens/diff-review-branch-compare.json | 2 +- mobile/rpc-foundation/goldens/diff-review-branch-file-diff.json | 2 +- .../goldens/diff-review-notes-refused-before-compare.json | 2 +- .../rpc-foundation/goldens/diff-review-refused-file-diff.json | 2 +- mobile/rpc-foundation/goldens/diff-review-snapshot.json | 2 +- .../rpc-foundation/goldens/diff-review-status-unavailable.json | 2 +- .../rpc-foundation/goldens/diff-review-worktree-file-diff.json | 2 +- mobile/rpc-foundation/goldens/file-tap-open-refused.json | 2 +- mobile/rpc-foundation/goldens/file-tap-opens-worktree-file.json | 2 +- .../goldens/file-tap-previews-absolute-artifact.json | 2 +- mobile/rpc-foundation/goldens/file-tap-resolve-miss.json | 2 +- mobile/rpc-foundation/goldens/file-tap-resolve-refused.json | 2 +- .../rpc-foundation/goldens/files-explorer-legacy-fallback.json | 2 +- mobile/rpc-foundation/goldens/files-explorer-readdir.json | 2 +- mobile/rpc-foundation/goldens/files-ownership-local.json | 2 +- mobile/rpc-foundation/goldens/files-ownership-ssh.json | 2 +- .../rpc-foundation/goldens/files-preview-artifact-direct.json | 2 +- .../goldens/files-preview-artifact-image-read.json | 2 +- mobile/rpc-foundation/goldens/files-preview-artifact-image.json | 2 +- mobile/rpc-foundation/goldens/files-preview-grant-refresh.json | 2 +- .../goldens/files-preview-worktree-image-read.json | 2 +- mobile/rpc-foundation/goldens/files-preview-worktree-image.json | 2 +- .../goldens/files-preview-worktree-text-read.json | 2 +- mobile/rpc-foundation/goldens/files-preview-worktree.json | 2 +- mobile/rpc-foundation/goldens/files-save-blind.json | 2 +- mobile/rpc-foundation/goldens/files-save-verified.json | 2 +- mobile/rpc-foundation/goldens/files-tab-doc-shapes.json | 2 +- mobile/rpc-foundation/goldens/home-host-accounts.json | 2 +- mobile/rpc-foundation/goldens/home-host-stats.json | 2 +- mobile/rpc-foundation/goldens/host-view-settings-sync.json | 2 +- .../goldens/host-worktree-actions-pin-open-delete.json | 2 +- mobile/rpc-foundation/goldens/host-worktree-delete-refused.json | 2 +- mobile/rpc-foundation/goldens/host-worktree-refresh-stream.json | 2 +- .../goldens/interruptions-inventory-lifecycle.json | 2 +- .../goldens/interruptions-settings-bot-overrides-fulfilled.json | 2 +- mobile/rpc-foundation/goldens/inventory-lifecycle.json | 2 +- mobile/rpc-foundation/goldens/inventory-repeat-query.json | 2 +- mobile/rpc-foundation/goldens/lifecycle-b3.json | 2 +- .../rpc-foundation/goldens/lifecycle-inventory-lifecycle.json | 2 +- .../goldens/lifecycle-settings-bot-overrides-fulfilled.json | 2 +- .../goldens/lifecycle-settings-task-hydration-fulfilled.json | 2 +- .../goldens/lifecycle-settings-workspace-context-fulfilled.json | 2 +- mobile/rpc-foundation/goldens/linear-select-workspace.json | 2 +- mobile/rpc-foundation/goldens/live-worktree-name-stream.json | 2 +- ...ix-agentsession.structured-create-agentsession.create-1.json | 2 +- ...tsession.structured-create-agentsession.createsupport-1.json | 2 +- ...tsession.structured-launch-agentsession.createsupport-1.json | 2 +- .../goldens/matrix-aivault.history-aivault.listsessions-1.json | 2 +- .../goldens/matrix-aivault.history-screen-platform-status.json | 2 +- .../goldens/matrix-aivault.history-screen-status.get-2.json | 2 +- .../goldens/matrix-aivault.history-screen-worktree.ps-1.json | 2 +- .../goldens/matrix-aivault.history-status.get-1.json | 2 +- ...rix-aivault.resume-launch-session.tabs.createterminal-1.json | 2 +- .../goldens/matrix-aivault.resume-launch-terminal.send-1.json | 2 +- ...vault.resume-preparation-aivault.preparesessionresume-1.json | 2 +- .../goldens/matrix-browser.dialog-browser.dialogaccept-1.json | 2 +- .../matrix-browser.keyboard-browser.keyboardinserttext-1.json | 2 +- .../goldens/matrix-browser.keyboard-browser.keypress-1.json | 2 +- .../matrix-browser.pointer-click-browser.mouseclick-1.json | 2 +- .../matrix-browser.pointer-click-browser.mousedown-1.json | 2 +- .../matrix-browser.pointer-click-browser.mousemove-1.json | 2 +- .../goldens/matrix-browser.pointer-click-browser.mouseup-1.json | 2 +- .../goldens/matrix-browser.wheel-browser.mousemove-1.json | 2 +- .../goldens/matrix-browser.wheel-browser.mousewheel-1.json | 2 +- ...clipboard.image-attachment-clipboard.startimageupload-1.json | 2 +- ...-clipboard.image-upload-clipboard.saveimageastempfile-1.json | 2 +- ...rix-clipboard.image-upload-clipboard.startimageupload-1.json | 2 +- .../matrix-components.codex-reset-capability-status.get-1.json | 2 +- ...s.codex-reset-credit-accounts.consumecodexresetcredit-1.json | 2 +- ...ponents.execution-target-local-preflight.detectagents-1.json | 2 +- ...ponents.execution-target-preflight.detectremoteagents-1.json | 2 +- .../matrix-components.execution-target-ssh.connect-1.json | 2 +- .../matrix-components.execution-target-ssh.getstate-1.json | 2 +- ...atrix-components.new-workspace-repositories-repo.list-1.json | 2 +- .../goldens/matrix-components.setup-script-repo.hooks-1.json | 2 +- .../goldens/matrix-files.explorer-screen-files.list-1.json | 2 +- .../goldens/matrix-files.explorer-screen-files.readdir-1.json | 2 +- .../goldens/matrix-files.mutation-ownership-ssh.getstate-1.json | 2 +- .../goldens/matrix-files.mutation-ownership-status.get-1.json | 2 +- .../matrix-files.mutation-ownership-worktree.show-1.json | 2 +- ...view-artifact-image-files.readterminalartifactpreview-1.json | 2 +- .../matrix-files.preview-load-files.readterminalartifact-1.json | 2 +- .../matrix-files.preview-load-files.readterminalartifact-2.json | 2 +- .../matrix-files.preview-load-files.resolveterminalpath-1.json | 2 +- .../matrix-files.preview-save-files.readterminalartifact-1.json | 2 +- ...matrix-files.preview-save-files.writeterminalartifact-1.json | 2 +- ...matrix-files.preview-worktree-image-files.readpreview-1.json | 2 +- .../matrix-files.preview-worktree-text-files.read-1.json | 2 +- .../goldens/matrix-files.tab-doc-files.read-1.json | 2 +- .../goldens/matrix-files.tab-doc-files.readpreview-1.json | 2 +- .../rpc-foundation/goldens/matrix-files.tab-doc-git.diff-1.json | 2 +- .../goldens/matrix-files.terminal-path-tap-files.open-1.json | 2 +- ...rix-files.terminal-path-tap-files.resolveterminalpath-1.json | 2 +- .../matrix-git.base-ref-chain-repo.baserefdefault-1.json | 2 +- .../goldens/matrix-git.base-ref-chain-repo.list-1.json | 2 +- .../goldens/matrix-git.base-ref-chain-worktree.show-1.json | 2 +- .../matrix-git.branch-diff-preview-git.branchdiff-1.json | 2 +- .../goldens/matrix-git.changes-load-git.branchcompare-1.json | 2 +- .../goldens/matrix-git.changes-load-git.status-1.json | 2 +- .../goldens/matrix-git.changes-load-repo.list-1.json | 2 +- .../goldens/matrix-git.changes-load-worktree.show-1.json | 2 +- ...atrix-git.commit-message-ai-git.generatecommitmessage-1.json | 2 +- .../matrix-git.history-commit-files-git.commitcompare-1.json | 2 +- .../goldens/matrix-git.history-commit-files-git.history-1.json | 2 +- .../goldens/matrix-git.history-read-git.history-1.json | 2 +- .../goldens/matrix-git.remote-prerequisite-git.push-1.json | 2 +- .../goldens/matrix-git.review-preparation-git.status-1.json | 2 +- ...rix-github.pr-comment-mutation-github.addissuecomment-1.json | 2 +- ...ub.pr-comment-mutation-github.addprreviewcommentreply-1.json | 2 +- ...ment-mutation-github.project.deleteissuecommentbyslug-1.json | 2 +- ...ment-mutation-github.project.updateissuecommentbyslug-1.json | 2 +- ...github.pr-comment-mutation-github.resolvereviewthread-1.json | 2 +- .../goldens/matrix-github.pr-mutation-github.mergepr-1.json | 2 +- .../matrix-github.pr-mutation-github.removeprreviewers-1.json | 2 +- .../matrix-github.pr-mutation-github.requestprreviewers-1.json | 2 +- .../matrix-github.pr-mutation-github.rerunprchecks-1.json | 2 +- .../matrix-github.pr-mutation-github.setprautomerge-1.json | 2 +- .../matrix-github.pr-mutation-github.updateprstate-1.json | 2 +- .../matrix-github.pr-read-github.listassignableusers-1.json | 2 +- .../goldens/matrix-github.pr-read-github.prcheckdetails-1.json | 2 +- .../goldens/matrix-github.pr-read-github.prchecks-1.json | 2 +- .../goldens/matrix-github.pr-read-github.prforbranch-1.json | 2 +- .../goldens/matrix-github.pr-read-github.reposlug-1.json | 2 +- .../goldens/matrix-github.pr-read-github.workitemdetails-1.json | 2 +- .../goldens/matrix-github.pr-read-hostedreview.forbranch-1.json | 2 +- .../matrix-github.pr-title-mutation-github.updateprtitle-1.json | 2 +- .../goldens/matrix-home.host-accounts-accounts.list-1.json | 2 +- .../goldens/matrix-home.host-stats-stats.summary-1.json | 2 +- ...ost-worktree-refresh-runtime.clientevents.subscribe-1-1.json | 2 +- ...ost-worktree-refresh-runtime.clientevents.subscribe-1-2.json | 2 +- ...ost-worktree-refresh-runtime.clientevents.subscribe-1-3.json | 2 +- ...ost-worktree-refresh-runtime.clientevents.subscribe-2-1.json | 2 +- .../goldens/matrix-host.view-settings-ui.get-1.json | 2 +- .../goldens/matrix-host.view-settings-ui.set-1.json | 2 +- .../matrix-host.worktree-actions-worktree.activate-1.json | 2 +- .../goldens/matrix-host.worktree-actions-worktree.rm-1.json | 2 +- .../goldens/matrix-host.worktree-actions-worktree.set-1.json | 2 +- .../goldens/matrix-hostedreview.create-chain-git.push-1.json | 2 +- .../matrix-hostedreview.create-chain-hostedreview.create-1.json | 2 +- .../matrix-hostedreview.create-chain-worktree.set-1.json | 2 +- .../matrix-hostedreview.create-intent-git.bulkstage-1.json | 2 +- .../goldens/matrix-hostedreview.create-intent-git.commit-1.json | 2 +- ...-hostedreview.create-intent-git.generatecommitmessage-1.json | 2 +- .../goldens/matrix-hostedreview.create-intent-git.push-1.json | 2 +- .../goldens/matrix-hostedreview.create-intent-git.status-1.json | 2 +- .../goldens/matrix-hostedreview.create-intent-git.status-2.json | 2 +- .../goldens/matrix-hostedreview.create-intent-git.status-3.json | 2 +- .../goldens/matrix-hostedreview.create-intent-git.status-4.json | 2 +- ...matrix-hostedreview.create-intent-hostedreview.create-1.json | 2 +- ...iew.create-intent-hostedreview.getcreationeligibility-1.json | 2 +- ...iew.create-intent-hostedreview.getcreationeligibility-2.json | 2 +- .../matrix-hostedreview.create-intent-worktree.set-1.json | 2 +- ...eview.eligibility-hostedreview.getcreationeligibility-1.json | 2 +- .../goldens/matrix-legacy-inventory-files.searchpaths-1.json | 2 +- .../goldens/matrix-legacy-inventory-files.searchpaths-2.json | 2 +- .../goldens/matrix-legacy-inventory-fresh-inventory.json | 2 +- .../goldens/matrix-legacy-inventory-old-inventory.json | 2 +- .../goldens/matrix-linear-detail-barrier-linear.getissue-1.json | 2 +- .../matrix-linear-detail-barrier-linear.issuecomments-1.json | 2 +- ...linear.select-workspace-picker-linear.selectworkspace-1.json | 2 +- ...x-live-worktree-name-runtime.clientevents.subscribe-1-1.json | 2 +- ...x-live-worktree-name-runtime.clientevents.subscribe-1-2.json | 2 +- ...x-live-worktree-name-runtime.clientevents.subscribe-2-1.json | 2 +- .../goldens/matrix-live-worktree-name-worktree.show-1.json | 2 +- .../goldens/matrix-live-worktree-name-worktree.show-2.json | 2 +- .../goldens/matrix-live-worktree-name-worktree.show-3.json | 2 +- .../goldens/matrix-mobileweb.bundle-fetch-app-js.json | 2 +- .../goldens/matrix-mobileweb.bundle-fetch-index-head.json | 2 +- .../goldens/matrix-mobileweb.bundle-fetch-index-tail.json | 2 +- ...trix-mobileweb.bundle-fetch-mobileweb.bundle.manifest-1.json | 2 +- ...x-mobileweb.bundle-manifest-mobileweb.bundle.manifest-1.json | 2 +- .../goldens/matrix-nativechat.image-paste-terminal.send-1.json | 2 +- .../goldens/matrix-nativechat.image-paste-terminal.send-2.json | 2 +- ...ix-nativechat.image-upload-clipboard.startimageupload-1.json | 2 +- ...n-option-pick-settings.mutatenativechatsessionoptions-1.json | 2 +- ....terminal-write-orchestration.workerterminaluserinput-1.json | 2 +- .../matrix-nativechat.terminal-write-terminal.send-1.json | 2 +- ...fications.desktop-stream-notifications.getmissedsince-1.json | 2 +- ...otifications.desktop-stream-notifications.subscribe-1-1.json | 2 +- ...otifications.desktop-stream-notifications.subscribe-1-2.json | 2 +- ...otifications.desktop-stream-notifications.unsubscribe-1.json | 2 +- ...ifications.display-test-screen-notifications.testpush-1.json | 2 +- ...fications.push-dismissal-notifications.getmissedsince-1.json | 2 +- ...ications.push-registration-notifications.registerpush-1.json | 2 +- ...ations.push-registration-notifications.unregisterpush-1.json | 2 +- .../goldens/matrix-pairing.pre-profile-direct-status.json | 2 +- .../matrix-pairing.pre-profile-pairing.getendpoints-1.json | 2 +- .../matrix-pairing.pre-profile-pairing.provisionrelay-1.json | 2 +- .../goldens/matrix-pairing.pre-profile-relay-status.json | 2 +- ...oject-explicit-false-github.project.updateissuebyslug-1.json | 2 +- ...matrix-relay.credential-rotation-pairing.getendpoints-1.json | 2 +- ...matrix-relay.credential-rotation-pairing.getendpoints-2.json | 2 +- ...trix-relay.credential-rotation-pairing.provisionrelay-1.json | 2 +- .../matrix-relay.direct-upgrade-pairing.getendpoints-1.json | 2 +- .../matrix-relay.direct-upgrade-pairing.getendpoints-2.json | 2 +- .../matrix-relay.direct-upgrade-pairing.provisionrelay-1.json | 2 +- .../matrix-relay.pairing-recovery-pairing.getendpoints-1.json | 2 +- .../matrix-session.browser-tab-create-browser.tabcreate-1.json | 2 +- .../matrix-session.content-create-files.createfile-1.json | 2 +- .../goldens/matrix-session.content-create-files.open-1.json | 2 +- .../goldens/matrix-session.content-create-status.get-1.json | 2 +- .../goldens/matrix-session.content-create-worktree.show-1.json | 2 +- ...x-session.create-terminal-session.tabs.createterminal-1.json | 2 +- .../goldens/matrix-session.create-terminal-terminal.send-1.json | 2 +- .../goldens/matrix-session.diff-notes-worktree.show-1.json | 2 +- .../matrix-session.diff-review-actions-worktree.set-1.json | 2 +- .../goldens/matrix-session.diff-review-base-ref-show.json | 2 +- .../goldens/matrix-session.diff-review-git.branchcompare-1.json | 2 +- .../goldens/matrix-session.diff-review-git.status-1.json | 2 +- .../goldens/matrix-session.diff-review-repo.list-1.json | 2 +- .../goldens/matrix-session.diff-review-review-show.json | 2 +- .../matrix-session.markdown-disk-fallback-files.read-1.json | 2 +- ...atrix-session.markdown-disk-fallback-markdown.readtab-1.json | 2 +- .../matrix-session.markdown-save-markdown.savetab-1.json | 2 +- ...atrix-session.native-chat-page-nativechat.readsession-1.json | 2 +- ...atrix-session.native-chat-page-nativechat.subscribe-1-1.json | 2 +- ...atrix-session.native-chat-page-nativechat.subscribe-2-1.json | 2 +- .../matrix-session.native-chat-readability-repo.list-1.json | 2 +- ...ative-chat-stop-orchestration.workerterminaluserinput-1.json | 2 +- .../matrix-session.native-chat-stop-terminal.send-1.json | 2 +- .../matrix-session.native-chat-stop-terminal.send-2.json | 2 +- .../matrix-session.pr-branch-context-git.branchcompare-1.json | 2 +- .../goldens/matrix-session.pr-branch-context-git.status-1.json | 2 +- .../goldens/matrix-session.pr-branch-context-repo.list-1.json | 2 +- .../matrix-session.pr-branch-context-worktree.show-1.json | 2 +- .../goldens/matrix-session.pr-sidebar-github.prchecks-1.json | 2 +- .../goldens/matrix-session.pr-sidebar-github.prforbranch-1.json | 2 +- .../matrix-session.pr-sidebar-hostedreview.forbranch-1.json | 2 +- .../goldens/matrix-session.pr-sidebar-worktree.show-1.json | 2 +- .../goldens/matrix-session.pr-triage-agent.launchreplay-1.json | 2 +- .../matrix-session.pr-triage-preflight.detectagents-1.json | 2 +- .../goldens/matrix-session.pr-triage-repo.list-1.json | 2 +- .../goldens/matrix-session.pr-triage-settings.get-1.json | 2 +- .../matrix-session.review-branch-diff-git.branchdiff-1.json | 2 +- .../goldens/matrix-session.review-file-diff-git.diff-1.json | 2 +- .../goldens/matrix-session.review-file-diff-git.diff-2.json | 2 +- .../goldens/matrix-session.review-file-diff-git.diff-3.json | 2 +- .../matrix-session.review-git-mutations-git.discard-1.json | 2 +- .../matrix-session.review-git-mutations-git.stage-1.json | 2 +- .../matrix-session.review-git-mutations-git.stage-2.json | 2 +- .../matrix-session.review-send-sheet-session.tabs.list-1.json | 2 +- .../goldens/matrix-session.startup-worktree.activate-1.json | 2 +- .../goldens/matrix-session.startup-worktree.activate-2.json | 2 +- .../matrix-session.tab-activation-session.tabs.activate-1.json | 2 +- .../goldens/matrix-session.tab-activation-terminal.focus-1.json | 2 +- .../matrix-session.tab-close-session-session.tabs.close-1.json | 2 +- .../goldens/matrix-session.tab-close-terminal.close-1.json | 2 +- .../matrix-session.tab-documents-markdown.readtab-1.json | 2 +- .../goldens/matrix-session.tab-rename-terminal.rename-1.json | 2 +- .../matrix-session.tab-reveal-session.tabs.activate-1.json | 2 +- .../goldens/matrix-session.tab-reveal-session.tabs.list-1.json | 2 +- .../matrix-session.tabs-stream-health-session.tabs.list-1.json | 2 +- ...session.terminal-display-mode-terminal.setdisplaymode-1.json | 2 +- ...l-gesture-input-orchestration.workerterminaluserinput-1.json | 2 +- ...x-session.terminal-gesture-input-terminal.clearbuffer-1.json | 2 +- .../matrix-session.terminal-gesture-input-terminal.send-1.json | 2 +- ...inal-input-send-orchestration.workerterminaluserinput-1.json | 2 +- .../matrix-session.terminal-input-send-terminal.send-1.json | 2 +- .../matrix-session.terminal-inventory-terminal.list-1.json | 2 +- ....terminal-paste-orchestration.workerterminaluserinput-1.json | 2 +- .../goldens/matrix-session.terminal-paste-settings.get-1.json | 2 +- .../goldens/matrix-session.terminal-paste-terminal.send-1.json | 2 +- .../goldens/matrix-session.worktree-connection-repo.list-1.json | 2 +- .../matrix-session.worktree-connection-settings.get-1.json | 2 +- ...trix-settings-agent-read-preflight.detectremoteagents-1.json | 2 +- .../goldens/matrix-settings-agent-read-repo.list-1.json | 2 +- .../goldens/matrix-settings-agent-read-settings.get-1.json | 2 +- .../goldens/matrix-settings-best-effort-settings.update-1.json | 2 +- .../goldens/matrix-settings.bot-overrides-settings.get-1.json | 2 +- .../goldens/matrix-settings.home-providers-linear.status-1.json | 2 +- .../matrix-settings.home-providers-preflight.check-1.json | 2 +- .../goldens/matrix-settings.home-providers-settings.get-1.json | 2 +- ...-settings.new-tab-local-agents-preflight.detectagents-1.json | 2 +- .../matrix-settings.new-tab-local-agents-repo.list-1.json | 2 +- .../matrix-settings.new-tab-local-agents-settings.get-1.json | 2 +- ...ings.quick-commands-settings.getterminalquickcommands-1.json | 2 +- ...s.quick-commands-settings.updateterminalquickcommands-1.json | 2 +- .../goldens/matrix-settings.repo-metadata-host.platform-1.json | 2 +- .../goldens/matrix-settings.repo-metadata-repo.list-1.json | 2 +- .../goldens/matrix-settings.repo-metadata-settings.get-1.json | 2 +- ...matrix-settings.repo-metadata-ssh.listtargetsummaries-1.json | 2 +- .../matrix-settings.resume-metadata-folderworkspace.list-1.json | 2 +- .../matrix-settings.resume-metadata-projectgroup.list-1.json | 2 +- .../goldens/matrix-settings.resume-metadata-repo.list-1.json | 2 +- .../goldens/matrix-settings.resume-metadata-settings.get-1.json | 2 +- .../goldens/matrix-settings.resume-metadata-worktree.ps-1.json | 2 +- .../goldens/matrix-settings.task-hydration-linear.status-1.json | 2 +- .../matrix-settings.task-hydration-preflight.check-1.json | 2 +- .../goldens/matrix-settings.task-hydration-settings.get-1.json | 2 +- .../goldens/matrix-settings.task-hydration-status.get-1.json | 2 +- .../goldens/matrix-settings.task-hydration-ui.get-1.json | 2 +- .../matrix-settings.task-workspace-create-settings.get-1.json | 2 +- ...matrix-settings.task-workspace-create-worktree.create-1.json | 2 +- .../goldens/matrix-settings.task-workspace-settings.get-1.json | 2 +- .../matrix-settings.workspace-context-linear.status-1.json | 2 +- .../matrix-settings.workspace-context-preflight.check-1.json | 2 +- .../matrix-settings.workspace-context-settings.get-1.json | 2 +- .../goldens/matrix-settings.workspace-context-ui.get-1.json | 2 +- .../matrix-settings.workspace-submit-settings.get-1.json | 2 +- .../matrix-speech.dictation-chunk-speech.dictation.chunk-1.json | 2 +- ...trix-speech.dictation-session-speech.dictation.finish-1.json | 2 +- ...atrix-speech.dictation-session-speech.dictation.start-1.json | 2 +- ...matrix-speech.dictation-start-speech.dictation.cancel-1.json | 2 +- .../matrix-speech.dictation-start-speech.dictation.start-1.json | 2 +- .../matrix-speech.setup-sheet-speech.dictation.setup-1.json | 2 +- .../matrix-speech.setup-sheet-speech.models.delete-1.json | 2 +- .../matrix-speech.setup-sheet-speech.models.download-1.json | 2 +- .../goldens/matrix-speech.setup-sheet-speech.models.list-1.json | 2 +- ...rix-tasks.item-checks-files-github.addprreviewcomment-1.json | 2 +- .../matrix-tasks.item-checks-files-github.prfilecontents-1.json | 2 +- .../matrix-tasks.item-checks-files-github.rerunprchecks-1.json | 2 +- ...ix-tasks.item-checks-files-github.resolvereviewthread-1.json | 2 +- ...matrix-tasks.item-checks-files-github.setprfileviewed-1.json | 2 +- ...trix-tasks.item-comment-github-github.addissuecomment-1.json | 2 +- ...trix-tasks.item-comment-gitlab-gitlab.addissuecomment-1.json | 2 +- ...trix-tasks.item-comment-gitlab-mr-gitlab.addmrcomment-1.json | 2 +- ...atrix-tasks.item-detail-github-github.workitemdetails-1.json | 2 +- ...atrix-tasks.item-detail-gitlab-gitlab.workitemdetails-1.json | 2 +- .../matrix-tasks.item-detail-linear-linear.getissue-1.json | 2 +- .../matrix-tasks.item-detail-linear-linear.issuecomments-1.json | 2 +- ...tasks.item-detail-metadata-github.listassignableusers-1.json | 2 +- .../matrix-tasks.item-detail-metadata-github.listlabels-1.json | 2 +- .../matrix-tasks.item-merge-gitlab-gitlab.mergemr-1.json | 2 +- .../matrix-tasks.item-metadata-github-github.updatepr-1.json | 2 +- .../matrix-tasks.item-metadata-gitlab-gitlab.updateissue-1.json | 2 +- .../matrix-tasks.item-metadata-gitlab-mr-gitlab.updatemr-1.json | 2 +- .../matrix-tasks.item-reply-merge-github.addissuecomment-1.json | 2 +- ...tasks.item-reply-merge-github.addprreviewcommentreply-1.json | 2 +- .../goldens/matrix-tasks.item-reply-merge-github.mergepr-1.json | 2 +- .../matrix-tasks.item-reply-merge-linear.updateissue-1.json | 2 +- .../matrix-tasks.item-review-github-github.prchecks-1.json | 2 +- ...ix-tasks.item-review-github-github.requestprreviewers-1.json | 2 +- .../matrix-tasks.item-status-gitlab-github.updateissue-1.json | 2 +- .../matrix-tasks.item-status-gitlab-gitlab.updateissue-1.json | 2 +- ...trix-tasks.item-status-gitlab-mr-gitlab.updatemrstate-1.json | 2 +- .../goldens/matrix-tasks.linear-connect-linear.connect-1.json | 2 +- .../matrix-tasks.linear-item-linear.addissuecomment-1.json | 2 +- .../goldens/matrix-tasks.linear-item-linear.createissue-1.json | 2 +- .../goldens/matrix-tasks.linear-item-linear.getissue-1.json | 2 +- .../matrix-tasks.linear-team-context-linear.listteams-1.json | 2 +- .../matrix-tasks.linear-team-context-linear.teamstates-1.json | 2 +- .../goldens/matrix-tasks.paste-lookup-github.reposlug-1.json | 2 +- .../goldens/matrix-tasks.paste-lookup-github.workitem-1.json | 2 +- .../matrix-tasks.paste-lookup-github.workitembyownerrepo-1.json | 2 +- .../matrix-tasks.paste-lookup-gitlab.workitembypath-1.json | 2 +- ...asks.project-board-load-github.project.listaccessible-1.json | 2 +- ...rix-tasks.project-board-load-github.project.listviews-1.json | 2 +- ...rix-tasks.project-board-load-github.project.listviews-2.json | 2 +- ...ix-tasks.project-board-load-github.project.resolveref-1.json | 2 +- ...rix-tasks.project-board-load-github.project.viewtable-1.json | 2 +- .../matrix-tasks.project-repo-slugs-github.reposlug-1.json | 2 +- ...w-comments-issue-github.project.addissuecommentbyslug-1.json | 2 +- ...t-row-comments-issue-github.project.updateissuebyslug-1.json | 2 +- ...omments-issue-github.project.updateissuecommentbyslug-1.json | 2 +- ...ow-comments-pr-github.project.updatepullrequestbyslug-1.json | 2 +- ...oject-row-detail-github.project.workitemdetailsbyslug-1.json | 2 +- ...asks.project-row-fields-github.project.clearitemfield-1.json | 2 +- ...oject-row-fields-github.project.updateissuetypebyslug-1.json | 2 +- ...sks.project-row-fields-github.project.updateitemfield-1.json | 2 +- ...sks.project-row-files-merge-github.addprreviewcomment-1.json | 2 +- .../matrix-tasks.project-row-files-merge-github.mergepr-1.json | 2 +- ...x-tasks.project-row-files-merge-github.prfilecontents-1.json | 2 +- ...trix-tasks.project-row-files-merge-github.updateissue-1.json | 2 +- ...ix-tasks.project-row-files-merge-github.updateprstate-1.json | 2 +- ...etadata-load-github.project.listassignableusersbyslug-1.json | 2 +- ...row-metadata-load-github.project.listissuetypesbyslug-1.json | 2 +- ...ect-row-metadata-load-github.project.listlabelsbyslug-1.json | 2 +- ...atrix-tasks.project-row-review-checks-github.prchecks-1.json | 2 +- ...s.project-row-review-checks-github.requestprreviewers-1.json | 2 +- ...-tasks.project-row-review-checks-github.rerunprchecks-1.json | 2 +- ...asks.project-row-review-checks-github.setprfileviewed-1.json | 2 +- ...trix-tasks.project-row-threads-github.addissuecomment-1.json | 2 +- ...ks.project-row-threads-github.addprreviewcommentreply-1.json | 2 +- ...t-row-threads-github.project.deleteissuecommentbyslug-1.json | 2 +- ...-tasks.project-row-threads-github.resolvereviewthread-1.json | 2 +- .../matrix-tasks.provider-load-github.countworkitems-1.json | 2 +- .../matrix-tasks.provider-load-github.listworkitems-1.json | 2 +- .../goldens/matrix-tasks.provider-load-linear.listteams-1.json | 2 +- .../goldens/matrix-tasks.provider-load-linear.status-1.json | 2 +- .../goldens/matrix-tasks.provider-load-settings.update-1.json | 2 +- .../goldens/matrix-tasks.route-repo-list-repo.list-1.json | 2 +- ...matrix-tasks.smart-source-search-github.listworkitems-1.json | 2 +- ...matrix-tasks.smart-source-search-gitlab.listworkitems-1.json | 2 +- .../matrix-tasks.smart-source-search-linear.listissues-1.json | 2 +- .../matrix-tasks.smart-source-search-linear.searchissues-1.json | 2 +- .../matrix-tasks.smart-source-search-repo.searchrefs-1.json | 2 +- .../matrix-tasks.task-create-github-github.createissue-1.json | 2 +- .../goldens/matrix-tasks.task-create-github-repo.update-1.json | 2 +- .../matrix-tasks.task-create-gitlab-gitlab.createissue-1.json | 2 +- .../matrix-tasks.task-create-linear-linear.createissue-1.json | 2 +- ...rix-tasks.task-list-gitlab-items-gitlab.listworkitems-1.json | 2 +- .../matrix-tasks.task-list-gitlab-todos-gitlab.todos-1.json | 2 +- .../matrix-tasks.task-list-linear-linear.listissues-1.json | 2 +- .../matrix-tasks.task-list-linear-linear.searchissues-1.json | 2 +- .../matrix-tasks.workspace-source-repo.searchrefs-1.json | 2 +- .../matrix-tasks.workspace-source-repo.sparsepresets-1.json | 2 +- .../matrix-tasks.workspace-sparse-repo.savesparsepreset-1.json | 2 +- .../goldens/matrix-tasks.workspace-sparse-ssh.getstate-1.json | 2 +- ...trix-tasks.workspace-ssh-local-preflight.detectagents-1.json | 2 +- ...trix-tasks.workspace-ssh-preflight.detectremoteagents-1.json | 2 +- .../goldens/matrix-tasks.workspace-ssh-repo.hooks-1.json | 2 +- .../goldens/matrix-tasks.workspace-ssh-ssh.connect-1.json | 2 +- .../goldens/matrix-terminal.query-reply-terminal.send-1.json | 2 +- ...minal.raw-input-orchestration.workerterminaluserinput-1.json | 2 +- .../goldens/matrix-terminal.raw-input-terminal.send-1.json | 2 +- ...takeover-report-orchestration.workerterminaluserinput-1.json | 2 +- ...takeover-report-orchestration.workerterminaluserinput-2.json | 2 +- ...atrix-terminal.viewport-refit-terminal.updateviewport-1.json | 2 +- .../goldens/matrix-transport.capability-probe-status.get-1.json | 2 +- .../matrix-transport.host-status-gates-status.get-1.json | 2 +- .../goldens/matrix-transport.pairing-race-direct-status.json | 2 +- .../goldens/matrix-transport.pairing-race-relay-status.json | 2 +- .../matrix-worktree.agent-launch-create-agent.launch-1.json | 2 +- .../goldens/matrix-worktree.catalog-snapshot-worktree.ps-1.json | 2 +- .../goldens/matrix-worktree.create-retry-worktree.create-1.json | 2 +- .../goldens/matrix-worktree.home-catalog-worktree.ps-1.json | 2 +- .../matrix-worktree.hosted-base-worktree.resolvemrbase-1.json | 2 +- .../matrix-worktree.hosted-base-worktree.resolveprbase-1.json | 2 +- ...trix-worktree.retired-names-worktree.listretirednames-1.json | 2 +- .../goldens/matrix-worktree.review-link-worktree.set-1.json | 2 +- .../matrix-worktree.runtime-capabilities-status.get-1.json | 2 +- .../goldens/matrix-worktree.setup-hook-trust-ui.set-1.json | 2 +- .../rpc-foundation/goldens/mobile-web-bundle-build-changed.json | 2 +- .../rpc-foundation/goldens/mobile-web-bundle-fetch-paged.json | 2 +- .../rpc-foundation/goldens/mobile-web-bundle-manifest-read.json | 2 +- .../rpc-foundation/goldens/mobile-web-bundle-unavailable.json | 2 +- .../rpc-foundation/goldens/native-chat-image-paste-single.json | 2 +- .../goldens/native-chat-image-paste-stops-on-rejection.json | 2 +- .../goldens/native-chat-image-paste-trailing-image.json | 2 +- .../goldens/native-chat-image-paste-two-images.json | 2 +- .../goldens/native-chat-image-upload-cancelled.json | 2 +- .../goldens/native-chat-image-upload-second-fails.json | 2 +- .../rpc-foundation/goldens/native-chat-image-upload-single.json | 2 +- .../goldens/native-chat-image-upload-start-refused.json | 2 +- mobile/rpc-foundation/goldens/native-chat-image-upload-two.json | 2 +- mobile/rpc-foundation/goldens/native-chat-page-earlier.json | 2 +- .../goldens/native-chat-readability-local-repo.json | 2 +- .../rpc-foundation/goldens/native-chat-readability-refused.json | 2 +- .../goldens/native-chat-readability-remote-repo.json | 2 +- .../goldens/native-chat-session-option-pick-empty.json | 2 +- .../goldens/native-chat-session-option-pick-refused.json | 2 +- .../goldens/native-chat-session-option-pick-written.json | 2 +- mobile/rpc-foundation/goldens/native-chat-stop-accepted.json | 2 +- .../rpc-foundation/goldens/native-chat-stop-both-rejected.json | 2 +- .../goldens/native-chat-stop-delivery-unknown.json | 2 +- mobile/rpc-foundation/goldens/native-chat-write-accepted.json | 2 +- mobile/rpc-foundation/goldens/native-chat-write-clear-line.json | 2 +- .../goldens/native-chat-write-delivery-unknown.json | 2 +- mobile/rpc-foundation/goldens/native-chat-write-rejected.json | 2 +- .../rpc-foundation/goldens/native-chat-write-typed-command.json | 2 +- mobile/rpc-foundation/goldens/new-tab-local-agents.json | 2 +- .../goldens/new-workspace-repositories-fulfilled.json | 2 +- .../goldens/notifications-desktop-stream-closed.json | 2 +- .../goldens/notifications-desktop-stream-replayed.json | 2 +- mobile/rpc-foundation/goldens/notifications-desktop-stream.json | 2 +- .../goldens/notifications-display-test-accepted.json | 2 +- .../goldens/notifications-display-test-not-registered.json | 2 +- .../goldens/notifications-display-test-rate-limited.json | 2 +- .../goldens/notifications-display-test-unknown-reason.json | 2 +- .../goldens/notifications-push-gateway-rejected.json | 2 +- .../rpc-foundation/goldens/notifications-push-registered.json | 2 +- .../goldens/pairing-pre-profile-direct-wins-and-provisions.json | 2 +- ...ing-pre-profile-provision-unsupported-saves-direct-host.json | 2 +- .../rpc-foundation/goldens/pairing-pre-profile-times-out.json | 2 +- mobile/rpc-foundation/goldens/pr-branch-identity.json | 2 +- mobile/rpc-foundation/goldens/pr-branch-repo-context.json | 2 +- mobile/rpc-foundation/goldens/pr-comment-mutation.json | 2 +- .../rpc-foundation/goldens/pr-comment-resolve-unconfirmed.json | 2 +- mobile/rpc-foundation/goldens/pr-mutation-in-band-failure.json | 2 +- mobile/rpc-foundation/goldens/pr-mutation-status.json | 2 +- mobile/rpc-foundation/goldens/pr-read-fork-routing.json | 2 +- mobile/rpc-foundation/goldens/pr-read-surface.json | 2 +- mobile/rpc-foundation/goldens/pr-read-upstream-error.json | 2 +- mobile/rpc-foundation/goldens/pr-sidebar-checks-refused.json | 2 +- mobile/rpc-foundation/goldens/pr-sidebar-load.json | 2 +- mobile/rpc-foundation/goldens/pr-title-mutation.json | 2 +- mobile/rpc-foundation/goldens/pr-title-unconfirmed.json | 2 +- mobile/rpc-foundation/goldens/pr-triage-launch-unconfirmed.json | 2 +- mobile/rpc-foundation/goldens/pr-triage-launch.json | 2 +- .../rpc-foundation/goldens/pr-triage-prompt-not-delivered.json | 2 +- mobile/rpc-foundation/goldens/pr-triage-update-required.json | 2 +- mobile/rpc-foundation/goldens/probe-new-tab-both-refused.json | 2 +- .../goldens/probe-new-tab-null-sibling-refused.json | 2 +- .../goldens/probe-new-tab-refused-sibling-rejects.json | 2 +- .../goldens/probe-new-tab-rejects-sibling-refused.json | 2 +- .../rpc-foundation/goldens/push-dismissal-tray-reconciled.json | 2 +- mobile/rpc-foundation/goldens/quick-commands-load-refused.json | 2 +- .../rpc-foundation/goldens/quick-commands-loaded-and-saved.json | 2 +- .../goldens/quick-commands-save-refused-rolls-back.json | 2 +- mobile/rpc-foundation/goldens/relay-direct-upgrade-commits.json | 2 +- .../goldens/relay-direct-upgrade-unsupported-host-declines.json | 2 +- .../goldens/relay-pairing-recovery-invite-authorizes.json | 2 +- .../goldens/relay-pairing-recovery-resume-committed.json | 2 +- .../goldens/relay-rotation-installs-and-commits.json | 2 +- .../goldens/relay-rotation-resumes-committed-pending.json | 2 +- mobile/rpc-foundation/goldens/review-branch-diff-shapes.json | 2 +- mobile/rpc-foundation/goldens/review-create-agent-refused.json | 2 +- mobile/rpc-foundation/goldens/review-file-diff-shapes.json | 2 +- mobile/rpc-foundation/goldens/review-git-mutations-run.json | 2 +- .../rpc-foundation/goldens/review-mark-reviewed-persists.json | 2 +- .../rpc-foundation/goldens/review-mark-reviewed-rolls-back.json | 2 +- mobile/rpc-foundation/goldens/review-open-in-session.json | 2 +- .../goldens/review-send-notes-heals-stale-input.json | 2 +- .../goldens/review-send-sheet-lists-terminals.json | 2 +- mobile/rpc-foundation/goldens/review-stage-file.json | 2 +- mobile/rpc-foundation/goldens/review-stage-refused.json | 2 +- mobile/rpc-foundation/goldens/sc-base-ref-default.json | 2 +- mobile/rpc-foundation/goldens/sc-base-ref-repo-fallback.json | 2 +- mobile/rpc-foundation/goldens/sc-base-ref-unavailable.json | 2 +- mobile/rpc-foundation/goldens/sc-base-ref-worktree-hit.json | 2 +- mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json | 2 +- mobile/rpc-foundation/goldens/sc-changes-loaded.json | 2 +- .../goldens/sc-commit-message-cancel-rejected.json | 2 +- mobile/rpc-foundation/goldens/sc-commit-message-canceled.json | 2 +- mobile/rpc-foundation/goldens/sc-commit-message-generated.json | 2 +- mobile/rpc-foundation/goldens/sc-create-existing-review.json | 2 +- .../goldens/sc-create-intent-stage-commit-push-create.json | 2 +- .../goldens/sc-create-intent-unlisted-provider.json | 2 +- .../goldens/sc-create-link-failure-is-non-fatal.json | 2 +- .../rpc-foundation/goldens/sc-create-pushes-then-creates.json | 2 +- .../rpc-foundation/goldens/sc-create-refused-empty-message.json | 2 +- .../goldens/sc-create-rejected-empty-message.json | 2 +- mobile/rpc-foundation/goldens/sc-eligibility-fetched.json | 2 +- mobile/rpc-foundation/goldens/sc-history-commit-files.json | 2 +- mobile/rpc-foundation/goldens/sc-history-loaded.json | 2 +- mobile/rpc-foundation/goldens/sc-pr-link-hosted-review.json | 2 +- mobile/rpc-foundation/goldens/sc-pr-link-read.json | 2 +- mobile/rpc-foundation/goldens/sc-pr-link-set.json | 2 +- .../goldens/sc-prefill-unavailable-on-refusal.json | 2 +- .../goldens/sc-prefill-unavailable-on-rejection.json | 2 +- .../goldens/sc-prerequisite-force-with-lease.json | 2 +- mobile/rpc-foundation/goldens/sc-prerequisite-publish.json | 2 +- mobile/rpc-foundation/goldens/sc-prerequisite-push.json | 2 +- mobile/rpc-foundation/goldens/sc-prerequisite-skipped.json | 2 +- mobile/rpc-foundation/goldens/sc-reveal-first-poll.json | 2 +- mobile/rpc-foundation/goldens/sc-reveal-timeout.json | 2 +- .../rpc-foundation/goldens/sc-review-commit-inner-failure.json | 2 +- .../goldens/sc-review-commit-refused-empty-message.json | 2 +- mobile/rpc-foundation/goldens/sc-review-commit-rejected.json | 2 +- mobile/rpc-foundation/goldens/sc-review-commit.json | 2 +- .../goldens/sc-review-status-entries-not-array.json | 2 +- mobile/rpc-foundation/goldens/sc-review-status-normalized.json | 2 +- mobile/rpc-foundation/goldens/schedules-b3.json | 2 +- .../goldens/schedules-settings-home-providers-fulfilled.json | 2 +- .../rpc-foundation/goldens/schedules-settings-new-tab-ssh.json | 2 +- .../goldens/schedules-settings-repo-metadata-fulfilled.json | 2 +- .../goldens/schedules-settings-resume-metadata-fulfilled.json | 2 +- .../goldens/schedules-settings-task-hydration-fulfilled.json | 2 +- .../goldens/schedules-settings-workspace-context-fulfilled.json | 2 +- mobile/rpc-foundation/goldens/session-browser-tab-created.json | 2 +- .../rpc-foundation/goldens/session-create-browser-refused.json | 2 +- mobile/rpc-foundation/goldens/session-create-browser-tab.json | 2 +- .../goldens/session-create-markdown-name-collision.json | 2 +- mobile/rpc-foundation/goldens/session-create-markdown-note.json | 2 +- ...ssion-create-terminal-ignores-a-second-create-in-flight.json | 2 +- ...session-create-terminal-launches-an-agent-quick-command.json | 2 +- .../rpc-foundation/goldens/session-create-terminal-refused.json | 2 +- .../goldens/session-create-terminal-replaces-active.json | 2 +- .../goldens/session-create-terminal-runs-a-quick-command.json | 2 +- .../goldens/session-create-terminal-with-prompt.json | 2 +- .../goldens/session-create-terminal-without-active-tab.json | 2 +- .../goldens/session-create-terminal-without-handle.json | 2 +- .../rpc-foundation/goldens/session-diff-notes-load-refused.json | 2 +- mobile/rpc-foundation/goldens/session-diff-notes-loaded.json | 2 +- mobile/rpc-foundation/goldens/session-file-tab-read.json | 2 +- mobile/rpc-foundation/goldens/session-markdown-disk-read.json | 2 +- mobile/rpc-foundation/goldens/session-markdown-disk-served.json | 2 +- .../rpc-foundation/goldens/session-markdown-save-conflict.json | 2 +- mobile/rpc-foundation/goldens/session-markdown-saved.json | 2 +- .../goldens/session-markdown-tab-disk-fallback.json | 2 +- mobile/rpc-foundation/goldens/session-markdown-tab-read.json | 2 +- mobile/rpc-foundation/goldens/session-markdown-tab-refused.json | 2 +- .../goldens/session-startup-both-activation-sites.json | 2 +- .../session-startup-floating-route-skips-activation.json | 2 +- .../session-startup-keeps-terminals-visible-on-reconnect.json | 2 +- .../session-startup-refused-tab-load-still-loads-terminals.json | 2 +- .../goldens/session-tab-activation-focus-and-activate.json | 2 +- .../rpc-foundation/goldens/session-tab-activation-refused.json | 2 +- .../goldens/session-tab-activation-transport-error.json | 2 +- .../goldens/session-tab-close-refused-keeps-tab.json | 2 +- .../rpc-foundation/goldens/session-tab-close-session-tab.json | 2 +- mobile/rpc-foundation/goldens/session-tab-close-terminal.json | 2 +- mobile/rpc-foundation/goldens/session-tab-closed.json | 2 +- mobile/rpc-foundation/goldens/session-tab-rename.json | 2 +- mobile/rpc-foundation/goldens/session-tab-renamed.json | 2 +- mobile/rpc-foundation/goldens/session-tabs-health-errored.json | 2 +- .../rpc-foundation/goldens/session-tabs-health-reconciled.json | 2 +- mobile/rpc-foundation/goldens/session-tabs-health-refused.json | 2 +- .../goldens/session-tabs-health-stale-application-revision.json | 2 +- .../goldens/session-terminal-display-mode-auto-take-floor.json | 2 +- ...session-terminal-display-mode-auto-without-device-token.json | 2 +- .../session-terminal-display-mode-auto-without-viewport.json | 2 +- .../session-terminal-display-mode-drops-second-toggle.json | 2 +- .../goldens/session-terminal-display-mode-to-desktop.json | 2 +- .../goldens/session-terminal-list-dedupes-handles.json | 2 +- .../goldens/session-terminal-list-empty-guarded.json | 2 +- mobile/rpc-foundation/goldens/session-terminal-list-merged.json | 2 +- .../rpc-foundation/goldens/session-terminal-list-refused.json | 2 +- .../goldens/settings-bot-overrides-fulfilled.json | 2 +- .../goldens/settings-bot-overrides-refresh-refused.json | 2 +- .../rpc-foundation/goldens/settings-bot-overrides-refused.json | 2 +- .../goldens/settings-bot-overrides-transport-error.json | 2 +- mobile/rpc-foundation/goldens/settings-home-coalesced.json | 2 +- .../goldens/settings-home-providers-fulfilled.json | 2 +- .../goldens/settings-home-providers-refuse-after-data.json | 2 +- .../rpc-foundation/goldens/settings-home-providers-refused.json | 2 +- .../goldens/settings-home-providers-transport-error.json | 2 +- mobile/rpc-foundation/goldens/settings-new-tab-refused.json | 2 +- mobile/rpc-foundation/goldens/settings-new-tab-ssh.json | 2 +- .../goldens/settings-new-tab-transport-error.json | 2 +- mobile/rpc-foundation/goldens/settings-repo-cache-expiry.json | 2 +- .../goldens/settings-repo-metadata-fulfilled.json | 2 +- mobile/rpc-foundation/goldens/settings-repo-metadata-icons.json | 2 +- .../goldens/settings-repo-metadata-refuse-after-data.json | 2 +- .../rpc-foundation/goldens/settings-repo-metadata-refused.json | 2 +- .../goldens/settings-repo-metadata-single-host.json | 2 +- .../goldens/settings-repo-metadata-transport-error.json | 2 +- .../goldens/settings-resume-metadata-fulfilled.json | 2 +- .../goldens/settings-resume-metadata-refuse-after-data.json | 2 +- .../goldens/settings-resume-metadata-refused.json | 2 +- .../goldens/settings-resume-metadata-transport-error.json | 2 +- .../goldens/settings-task-hydration-fulfilled.json | 2 +- .../goldens/settings-task-hydration-refuse-after-data.json | 2 +- .../rpc-foundation/goldens/settings-task-hydration-refused.json | 2 +- .../goldens/settings-task-hydration-transport-error.json | 2 +- .../goldens/settings-task-workspace-create-linear.json | 2 +- .../goldens/settings-task-workspace-create-pr-start-point.json | 2 +- .../goldens/settings-task-workspace-fulfilled.json | 2 +- .../rpc-foundation/goldens/settings-task-workspace-refused.json | 2 +- .../goldens/settings-task-workspace-transport-error.json | 2 +- mobile/rpc-foundation/goldens/settings-task-write.json | 2 +- .../goldens/settings-workspace-context-fulfilled.json | 2 +- .../goldens/settings-workspace-context-refuse-after-data.json | 2 +- .../goldens/settings-workspace-context-refused.json | 2 +- .../goldens/settings-workspace-context-transport-error.json | 2 +- .../goldens/settings-workspace-submit-fulfilled.json | 2 +- .../goldens/settings-workspace-submit-refused.json | 2 +- .../goldens/settings-workspace-submit-transport-error.json | 2 +- .../rpc-foundation/goldens/speech-audio-chunk-acknowledged.json | 2 +- .../rpc-foundation/goldens/speech-desktop-start-fulfilled.json | 2 +- .../goldens/speech-desktop-start-recording-failed.json | 2 +- .../rpc-foundation/goldens/speech-desktop-start-superseded.json | 2 +- .../goldens/speech-dictation-session-cancelled.json | 2 +- .../goldens/speech-dictation-session-transcript.json | 2 +- .../goldens/speech-setup-sheet-denied-to-mobile.json | 2 +- mobile/rpc-foundation/goldens/speech-setup-sheet-fulfilled.json | 2 +- .../goldens/speech-setup-sheet-legacy-desktop.json | 2 +- .../goldens/speech-setup-sheet-model-vocabulary.json | 2 +- .../goldens/structured-agent-session-created.json | 2 +- mobile/rpc-foundation/goldens/structured-launch-created.json | 2 +- .../goldens/structured-launch-definitive-refusal.json | 2 +- .../goldens/structured-launch-replays-dropped-create.json | 2 +- .../goldens/structured-launch-support-refused.json | 2 +- .../rpc-foundation/goldens/structured-launch-unsupported.json | 2 +- mobile/rpc-foundation/goldens/tasks-route-repo-list.json | 2 +- .../goldens/terminal-gesture-flush-and-clear.json | 2 +- mobile/rpc-foundation/goldens/terminal-input-send-accepted.json | 2 +- mobile/rpc-foundation/goldens/terminal-input-send-refused.json | 2 +- mobile/rpc-foundation/goldens/terminal-live-input-accepted.json | 2 +- mobile/rpc-foundation/goldens/terminal-paste-accepted.json | 2 +- mobile/rpc-foundation/goldens/terminal-paste-refused.json | 2 +- .../rpc-foundation/goldens/terminal-query-reply-accepted.json | 2 +- .../goldens/terminal-query-reply-unsubscribed.json | 2 +- mobile/rpc-foundation/goldens/terminal-raw-input-refused.json | 2 +- mobile/rpc-foundation/goldens/terminal-raw-input-reported.json | 2 +- .../goldens/terminal-takeover-report-accepted.json | 2 +- .../goldens/terminal-takeover-report-retried.json | 2 +- .../rpc-foundation/goldens/terminal-viewport-refit-applied.json | 2 +- .../goldens/terminal-viewport-refit-legacy-desktop.json | 2 +- .../goldens/terminal-worktree-connection-resolved.json | 2 +- mobile/rpc-foundation/goldens/tk-create-github.json | 2 +- mobile/rpc-foundation/goldens/tk-create-gitlab.json | 2 +- mobile/rpc-foundation/goldens/tk-create-linear.json | 2 +- mobile/rpc-foundation/goldens/tk-item-checks-files.json | 2 +- mobile/rpc-foundation/goldens/tk-item-comment-github.json | 2 +- mobile/rpc-foundation/goldens/tk-item-comment-gitlab-mr.json | 2 +- mobile/rpc-foundation/goldens/tk-item-comment-gitlab.json | 2 +- .../rpc-foundation/goldens/tk-item-detail-github-reactions.json | 2 +- mobile/rpc-foundation/goldens/tk-item-detail-github.json | 2 +- .../rpc-foundation/goldens/tk-item-detail-gitlab-reactions.json | 2 +- mobile/rpc-foundation/goldens/tk-item-detail-gitlab.json | 2 +- mobile/rpc-foundation/goldens/tk-item-detail-linear.json | 2 +- mobile/rpc-foundation/goldens/tk-item-detail-metadata.json | 2 +- mobile/rpc-foundation/goldens/tk-item-merge-gitlab.json | 2 +- mobile/rpc-foundation/goldens/tk-item-metadata-github.json | 2 +- mobile/rpc-foundation/goldens/tk-item-metadata-gitlab-mr.json | 2 +- mobile/rpc-foundation/goldens/tk-item-metadata-gitlab.json | 2 +- mobile/rpc-foundation/goldens/tk-item-reply-merge.json | 2 +- mobile/rpc-foundation/goldens/tk-item-review-github.json | 2 +- mobile/rpc-foundation/goldens/tk-item-status-gitlab-mr.json | 2 +- mobile/rpc-foundation/goldens/tk-item-status-gitlab.json | 2 +- mobile/rpc-foundation/goldens/tk-linear-connect.json | 2 +- mobile/rpc-foundation/goldens/tk-linear-item.json | 2 +- mobile/rpc-foundation/goldens/tk-linear-team-context.json | 2 +- mobile/rpc-foundation/goldens/tk-list-gitlab-items.json | 2 +- mobile/rpc-foundation/goldens/tk-list-gitlab-todos.json | 2 +- mobile/rpc-foundation/goldens/tk-list-linear.json | 2 +- mobile/rpc-foundation/goldens/tk-project-board-load.json | 2 +- mobile/rpc-foundation/goldens/tk-project-repo-slugs.json | 2 +- .../rpc-foundation/goldens/tk-project-row-comments-issue.json | 2 +- mobile/rpc-foundation/goldens/tk-project-row-comments-pr.json | 2 +- mobile/rpc-foundation/goldens/tk-project-row-detail.json | 2 +- mobile/rpc-foundation/goldens/tk-project-row-fields.json | 2 +- mobile/rpc-foundation/goldens/tk-project-row-files-merge.json | 2 +- mobile/rpc-foundation/goldens/tk-project-row-metadata-load.json | 2 +- mobile/rpc-foundation/goldens/tk-project-row-review-checks.json | 2 +- mobile/rpc-foundation/goldens/tk-project-row-threads.json | 2 +- mobile/rpc-foundation/goldens/tk-provider-load.json | 2 +- .../goldens/transport-capability-probe-cutover-reasks-fast.json | 2 +- ...transport-capability-probe-non-string-capabilities-drop.json | 2 +- .../goldens/transport-capability-probe-publishes.json | 2 +- .../goldens/transport-capability-probe-refused-backs-off.json | 2 +- .../transport-host-status-gates-drop-keeps-capabilities.json | 2 +- .../goldens/transport-host-status-gates-ready.json | 2 +- .../goldens/transport-host-status-gates-refused-degrades.json | 2 +- .../goldens/transport-pairing-race-both-refused.json | 2 +- .../goldens/transport-pairing-race-direct-completes-first.json | 2 +- .../goldens/transport-pairing-race-relay-completes-first.json | 2 +- .../transport-pairing-race-relay-wins-when-direct-refused.json | 2 +- mobile/rpc-foundation/goldens/tw-capabilities-advertised.json | 2 +- .../rpc-foundation/goldens/tw-capabilities-cutover-retried.json | 2 +- .../goldens/tw-capabilities-legacy-idempotency.json | 2 +- .../rpc-foundation/goldens/tw-create-retry-agent-launched.json | 2 +- .../goldens/tw-create-retry-ambiguous-after-drop.json | 2 +- .../goldens/tw-create-retry-ambiguous-while-connected.json | 2 +- .../goldens/tw-create-retry-ambiguous-without-idempotency.json | 2 +- mobile/rpc-foundation/goldens/tw-create-retry-created.json | 2 +- .../rpc-foundation/goldens/tw-create-retry-name-collision.json | 2 +- .../goldens/tw-create-retry-unretryable-refusal.json | 2 +- mobile/rpc-foundation/goldens/tw-create-retry-warning-kept.json | 2 +- mobile/rpc-foundation/goldens/tw-hosted-base-resolved.json | 2 +- mobile/rpc-foundation/goldens/tw-hosted-base-soft-error.json | 2 +- mobile/rpc-foundation/goldens/tw-paste-lookup-resolved.json | 2 +- mobile/rpc-foundation/goldens/tw-paste-lookup-slug-refused.json | 2 +- .../goldens/tw-paste-lookup-slug-unsupported.json | 2 +- mobile/rpc-foundation/goldens/tw-setup-hook-trust-always.json | 2 +- mobile/rpc-foundation/goldens/tw-setup-hook-trust-approved.json | 2 +- .../rpc-foundation/goldens/tw-smart-search-all-providers.json | 2 +- .../goldens/tw-smart-search-gitlab-provider-error.json | 2 +- .../rpc-foundation/goldens/tw-smart-search-linear-listed.json | 2 +- .../goldens/tw-task-preferences-resume-write.json | 2 +- .../goldens/tw-workspace-source-presets-refused.json | 2 +- mobile/rpc-foundation/goldens/tw-workspace-source-presets.json | 2 +- .../goldens/tw-workspace-sparse-missing-preset.json | 2 +- mobile/rpc-foundation/goldens/tw-workspace-sparse-saved.json | 2 +- .../goldens/tw-workspace-ssh-connect-refused.json | 2 +- mobile/rpc-foundation/goldens/tw-workspace-ssh-connected.json | 2 +- .../rpc-foundation/goldens/tw-workspace-ssh-local-agents.json | 2 +- mobile/rpc-foundation/goldens/tw-workspace-ssh-not-ready.json | 2 +- .../goldens/worktree-catalog-snapshot-unreadable.json | 2 +- mobile/rpc-foundation/goldens/worktree-catalog-snapshot.json | 2 +- mobile/rpc-foundation/goldens/worktree-home-catalog.json | 2 +- mobile/rpc-foundation/goldens/worktree-retired-names.json | 2 +- mobile/rpc-foundation/pilot-scenarios.json | 2 +- 791 files changed, 791 insertions(+), 791 deletions(-) diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json b/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json index 419193c26342..05d48255545f 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-unsupported.json b/mobile/rpc-foundation/goldens/aivault-history-scan-unsupported.json index 88e8e31ab908..c49eaddae919 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-unsupported.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-unsupported.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json b/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json index ebcfd83d05ec..b83d7aa6db86 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json b/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json index 9b06260c75c6..05c1f3a3d2b5 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json +++ b/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json b/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json index 123c47efce25..5ede6eb120bc 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json +++ b/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-launch-create-refused.json b/mobile/rpc-foundation/goldens/aivault-resume-launch-create-refused.json index 7273d7096427..02164967d24c 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-launch-create-refused.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-launch-create-refused.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-launch-invalid-tab.json b/mobile/rpc-foundation/goldens/aivault-resume-launch-invalid-tab.json index 588b00e9d273..54b025004f95 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-launch-invalid-tab.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-launch-invalid-tab.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-launch-locked.json b/mobile/rpc-foundation/goldens/aivault-resume-launch-locked.json index 66ebfa061802..55d31ba3d5da 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-launch-locked.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-launch-locked.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-launch-sent.json b/mobile/rpc-foundation/goldens/aivault-resume-launch-sent.json index 8906ed097a1e..48db573bca73 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-launch-sent.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-launch-sent.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-prepare-refused.json b/mobile/rpc-foundation/goldens/aivault-resume-prepare-refused.json index fa0884b18359..091cbba96674 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-prepare-refused.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-prepare-refused.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-prepare-repin.json b/mobile/rpc-foundation/goldens/aivault-resume-prepare-repin.json index 6b10cde0937a..722569f79e48 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-prepare-repin.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-prepare-repin.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-prepare-skipped.json b/mobile/rpc-foundation/goldens/aivault-resume-prepare-skipped.json index 241b9e64da01..ca728868ddd9 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-prepare-skipped.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-prepare-skipped.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/aivault-resume-prepare-unavailable.json b/mobile/rpc-foundation/goldens/aivault-resume-prepare-unavailable.json index 8697a194d782..cbad473015a0 100644 --- a/mobile/rpc-foundation/goldens/aivault-resume-prepare-unavailable.json +++ b/mobile/rpc-foundation/goldens/aivault-resume-prepare-unavailable.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/b1.json b/mobile/rpc-foundation/goldens/b1.json index e9857f7b6c8e..fb50a2faf88d 100644 --- a/mobile/rpc-foundation/goldens/b1.json +++ b/mobile/rpc-foundation/goldens/b1.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/b2.json b/mobile/rpc-foundation/goldens/b2.json index 8412643f6a6c..df8f39f589b8 100644 --- a/mobile/rpc-foundation/goldens/b2.json +++ b/mobile/rpc-foundation/goldens/b2.json @@ -3,7 +3,7 @@ "family": "project-explicit-false", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/b3.json b/mobile/rpc-foundation/goldens/b3.json index 922c2db368ec..19d44634a488 100644 --- a/mobile/rpc-foundation/goldens/b3.json +++ b/mobile/rpc-foundation/goldens/b3.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/browser-dialog-accepted.json b/mobile/rpc-foundation/goldens/browser-dialog-accepted.json index 5013ef328dee..cabb31e6a66c 100644 --- a/mobile/rpc-foundation/goldens/browser-dialog-accepted.json +++ b/mobile/rpc-foundation/goldens/browser-dialog-accepted.json @@ -3,7 +3,7 @@ "family": "browser.dialog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-dialog-dismissed.json b/mobile/rpc-foundation/goldens/browser-dialog-dismissed.json index 4e23c9bbfb8c..da8036a9aea6 100644 --- a/mobile/rpc-foundation/goldens/browser-dialog-dismissed.json +++ b/mobile/rpc-foundation/goldens/browser-dialog-dismissed.json @@ -3,7 +3,7 @@ "family": "browser.dialog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-keyboard-input.json b/mobile/rpc-foundation/goldens/browser-keyboard-input.json index 0e5aab769a18..11721f745063 100644 --- a/mobile/rpc-foundation/goldens/browser-keyboard-input.json +++ b/mobile/rpc-foundation/goldens/browser-keyboard-input.json @@ -3,7 +3,7 @@ "family": "browser.keyboard", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-pointer-click-accepted.json b/mobile/rpc-foundation/goldens/browser-pointer-click-accepted.json index e0918d566395..bd6c2112a323 100644 --- a/mobile/rpc-foundation/goldens/browser-pointer-click-accepted.json +++ b/mobile/rpc-foundation/goldens/browser-pointer-click-accepted.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-pointer-click-fallback.json b/mobile/rpc-foundation/goldens/browser-pointer-click-fallback.json index 2a079f64ab80..83476c286725 100644 --- a/mobile/rpc-foundation/goldens/browser-pointer-click-fallback.json +++ b/mobile/rpc-foundation/goldens/browser-pointer-click-fallback.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/browser-wheel-scrolled.json b/mobile/rpc-foundation/goldens/browser-wheel-scrolled.json index bcbc82088a6e..94ad174a33ee 100644 --- a/mobile/rpc-foundation/goldens/browser-wheel-scrolled.json +++ b/mobile/rpc-foundation/goldens/browser-wheel-scrolled.json @@ -3,7 +3,7 @@ "family": "browser.wheel", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-anonymous.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-anonymous.json index e3c40477b441..1f5f6ec7abe0 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-anonymous.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-anonymous.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-blocked-before-send.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-blocked-before-send.json index e4a42c97e524..577c84ef759e 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-blocked-before-send.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-blocked-before-send.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-cancelled.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-cancelled.json index 6ddb969723e2..bb828ba1673e 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-cancelled.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-cancelled.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-pasted.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-pasted.json index acaf59fdb3c5..b98b684f5eb2 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-pasted.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-pasted.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-attachment-upload-refused.json b/mobile/rpc-foundation/goldens/clipboard-image-attachment-upload-refused.json index 5e6495076e05..2f800d92b7a3 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-attachment-upload-refused.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-attachment-upload-refused.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-upload-aborts-on-chunk-failure.json b/mobile/rpc-foundation/goldens/clipboard-image-upload-aborts-on-chunk-failure.json index 7102d030df0a..1a1d3056c2d1 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-upload-aborts-on-chunk-failure.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-upload-aborts-on-chunk-failure.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-upload-chunked.json b/mobile/rpc-foundation/goldens/clipboard-image-upload-chunked.json index 5ec35b41464f..6f0b9baf187e 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-upload-chunked.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-upload-chunked.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-upload-single-frame-fallback.json b/mobile/rpc-foundation/goldens/clipboard-image-upload-single-frame-fallback.json index 11b545e8c874..dc1bad47e5c1 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-upload-single-frame-fallback.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-upload-single-frame-fallback.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/clipboard-image-upload-start-refused.json b/mobile/rpc-foundation/goldens/clipboard-image-upload-start-refused.json index c5c41bb2d990..5f05ac6746a7 100644 --- a/mobile/rpc-foundation/goldens/clipboard-image-upload-start-refused.json +++ b/mobile/rpc-foundation/goldens/clipboard-image-upload-start-refused.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/codex-reset-credit-consumed.json b/mobile/rpc-foundation/goldens/codex-reset-credit-consumed.json index ae20906e3b90..f117d764a10d 100644 --- a/mobile/rpc-foundation/goldens/codex-reset-credit-consumed.json +++ b/mobile/rpc-foundation/goldens/codex-reset-credit-consumed.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-credit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "76b53dea504a688493843e23e8e7d052fc196f559bb1e2579d0fd38bf3156d0e", diff --git a/mobile/rpc-foundation/goldens/codex-reset-credit-resumed.json b/mobile/rpc-foundation/goldens/codex-reset-credit-resumed.json index c397c9741ac8..ba7be42c2308 100644 --- a/mobile/rpc-foundation/goldens/codex-reset-credit-resumed.json +++ b/mobile/rpc-foundation/goldens/codex-reset-credit-resumed.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-credit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "76b53dea504a688493843e23e8e7d052fc196f559bb1e2579d0fd38bf3156d0e", diff --git a/mobile/rpc-foundation/goldens/components-codex-capability.json b/mobile/rpc-foundation/goldens/components-codex-capability.json index bc682d8f7c65..298a0a94eb5e 100644 --- a/mobile/rpc-foundation/goldens/components-codex-capability.json +++ b/mobile/rpc-foundation/goldens/components-codex-capability.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-capability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/components-setup-ask.json b/mobile/rpc-foundation/goldens/components-setup-ask.json index 626c1640ff19..583273d6181a 100644 --- a/mobile/rpc-foundation/goldens/components-setup-ask.json +++ b/mobile/rpc-foundation/goldens/components-setup-ask.json @@ -3,7 +3,7 @@ "family": "components.setup-script", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/components-target-local.json b/mobile/rpc-foundation/goldens/components-target-local.json index de63b743df26..cb200b89d4da 100644 --- a/mobile/rpc-foundation/goldens/components-target-local.json +++ b/mobile/rpc-foundation/goldens/components-target-local.json @@ -3,7 +3,7 @@ "family": "components.execution-target-local", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/components-target-ssh.json b/mobile/rpc-foundation/goldens/components-target-ssh.json index 6862b608e8c8..b76ff7756771 100644 --- a/mobile/rpc-foundation/goldens/components-target-ssh.json +++ b/mobile/rpc-foundation/goldens/components-target-ssh.json @@ -3,7 +3,7 @@ "family": "components.execution-target", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/diff-review-branch-compare.json b/mobile/rpc-foundation/goldens/diff-review-branch-compare.json index 2431b6b6bb57..82b54bda98ec 100644 --- a/mobile/rpc-foundation/goldens/diff-review-branch-compare.json +++ b/mobile/rpc-foundation/goldens/diff-review-branch-compare.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-branch-file-diff.json b/mobile/rpc-foundation/goldens/diff-review-branch-file-diff.json index 3881b54995e3..fe7dd7a58b50 100644 --- a/mobile/rpc-foundation/goldens/diff-review-branch-file-diff.json +++ b/mobile/rpc-foundation/goldens/diff-review-branch-file-diff.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-notes-refused-before-compare.json b/mobile/rpc-foundation/goldens/diff-review-notes-refused-before-compare.json index 0d66e1a803c5..5bf8483bd592 100644 --- a/mobile/rpc-foundation/goldens/diff-review-notes-refused-before-compare.json +++ b/mobile/rpc-foundation/goldens/diff-review-notes-refused-before-compare.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-refused-file-diff.json b/mobile/rpc-foundation/goldens/diff-review-refused-file-diff.json index 170207631f89..da678dc98e2b 100644 --- a/mobile/rpc-foundation/goldens/diff-review-refused-file-diff.json +++ b/mobile/rpc-foundation/goldens/diff-review-refused-file-diff.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-snapshot.json b/mobile/rpc-foundation/goldens/diff-review-snapshot.json index 56c1562d77a6..ad6442801d5f 100644 --- a/mobile/rpc-foundation/goldens/diff-review-snapshot.json +++ b/mobile/rpc-foundation/goldens/diff-review-snapshot.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-status-unavailable.json b/mobile/rpc-foundation/goldens/diff-review-status-unavailable.json index 9029cc36b31d..7eca0de25a85 100644 --- a/mobile/rpc-foundation/goldens/diff-review-status-unavailable.json +++ b/mobile/rpc-foundation/goldens/diff-review-status-unavailable.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/diff-review-worktree-file-diff.json b/mobile/rpc-foundation/goldens/diff-review-worktree-file-diff.json index c4db11ee7820..5202ad864476 100644 --- a/mobile/rpc-foundation/goldens/diff-review-worktree-file-diff.json +++ b/mobile/rpc-foundation/goldens/diff-review-worktree-file-diff.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/file-tap-open-refused.json b/mobile/rpc-foundation/goldens/file-tap-open-refused.json index ddbb1a4028a4..78516f75ee76 100644 --- a/mobile/rpc-foundation/goldens/file-tap-open-refused.json +++ b/mobile/rpc-foundation/goldens/file-tap-open-refused.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/file-tap-opens-worktree-file.json b/mobile/rpc-foundation/goldens/file-tap-opens-worktree-file.json index 9f0c24dc1cab..a50d9ea8e1a5 100644 --- a/mobile/rpc-foundation/goldens/file-tap-opens-worktree-file.json +++ b/mobile/rpc-foundation/goldens/file-tap-opens-worktree-file.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/file-tap-previews-absolute-artifact.json b/mobile/rpc-foundation/goldens/file-tap-previews-absolute-artifact.json index 25480522f096..564f53ff194a 100644 --- a/mobile/rpc-foundation/goldens/file-tap-previews-absolute-artifact.json +++ b/mobile/rpc-foundation/goldens/file-tap-previews-absolute-artifact.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/file-tap-resolve-miss.json b/mobile/rpc-foundation/goldens/file-tap-resolve-miss.json index 8a5ca5a01607..012d31f7fc74 100644 --- a/mobile/rpc-foundation/goldens/file-tap-resolve-miss.json +++ b/mobile/rpc-foundation/goldens/file-tap-resolve-miss.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/file-tap-resolve-refused.json b/mobile/rpc-foundation/goldens/file-tap-resolve-refused.json index ab76b124fb4b..8213f3e49611 100644 --- a/mobile/rpc-foundation/goldens/file-tap-resolve-refused.json +++ b/mobile/rpc-foundation/goldens/file-tap-resolve-refused.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/files-explorer-legacy-fallback.json b/mobile/rpc-foundation/goldens/files-explorer-legacy-fallback.json index 5c10140877d4..b8c88b89a288 100644 --- a/mobile/rpc-foundation/goldens/files-explorer-legacy-fallback.json +++ b/mobile/rpc-foundation/goldens/files-explorer-legacy-fallback.json @@ -3,7 +3,7 @@ "family": "files.explorer-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "7a42a348f4407b94cf75ac77a4b6b783b7d28103b1ae1d111d2708dab0dd4a0c", diff --git a/mobile/rpc-foundation/goldens/files-explorer-readdir.json b/mobile/rpc-foundation/goldens/files-explorer-readdir.json index 658cd1cba1cf..fb6bd93a03dd 100644 --- a/mobile/rpc-foundation/goldens/files-explorer-readdir.json +++ b/mobile/rpc-foundation/goldens/files-explorer-readdir.json @@ -3,7 +3,7 @@ "family": "files.explorer-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "7a42a348f4407b94cf75ac77a4b6b783b7d28103b1ae1d111d2708dab0dd4a0c", diff --git a/mobile/rpc-foundation/goldens/files-ownership-local.json b/mobile/rpc-foundation/goldens/files-ownership-local.json index f3815b3c7f5e..6da2e1bc8328 100644 --- a/mobile/rpc-foundation/goldens/files-ownership-local.json +++ b/mobile/rpc-foundation/goldens/files-ownership-local.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-ownership-ssh.json b/mobile/rpc-foundation/goldens/files-ownership-ssh.json index 95aac7fc2462..94bd352a7642 100644 --- a/mobile/rpc-foundation/goldens/files-ownership-ssh.json +++ b/mobile/rpc-foundation/goldens/files-ownership-ssh.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-artifact-direct.json b/mobile/rpc-foundation/goldens/files-preview-artifact-direct.json index 4694bdef9d59..ab8ac02d2a6d 100644 --- a/mobile/rpc-foundation/goldens/files-preview-artifact-direct.json +++ b/mobile/rpc-foundation/goldens/files-preview-artifact-direct.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-artifact-image-read.json b/mobile/rpc-foundation/goldens/files-preview-artifact-image-read.json index dcf696662f15..4a232dcf21ec 100644 --- a/mobile/rpc-foundation/goldens/files-preview-artifact-image-read.json +++ b/mobile/rpc-foundation/goldens/files-preview-artifact-image-read.json @@ -3,7 +3,7 @@ "family": "files.preview-artifact-image", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-artifact-image.json b/mobile/rpc-foundation/goldens/files-preview-artifact-image.json index f9934fbb8415..50f04a169e73 100644 --- a/mobile/rpc-foundation/goldens/files-preview-artifact-image.json +++ b/mobile/rpc-foundation/goldens/files-preview-artifact-image.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-grant-refresh.json b/mobile/rpc-foundation/goldens/files-preview-grant-refresh.json index c1ea1ae07af1..501314f88088 100644 --- a/mobile/rpc-foundation/goldens/files-preview-grant-refresh.json +++ b/mobile/rpc-foundation/goldens/files-preview-grant-refresh.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-worktree-image-read.json b/mobile/rpc-foundation/goldens/files-preview-worktree-image-read.json index ab57d829624e..797e0f5c7bd5 100644 --- a/mobile/rpc-foundation/goldens/files-preview-worktree-image-read.json +++ b/mobile/rpc-foundation/goldens/files-preview-worktree-image-read.json @@ -3,7 +3,7 @@ "family": "files.preview-worktree-image", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-worktree-image.json b/mobile/rpc-foundation/goldens/files-preview-worktree-image.json index fc900664173a..3202b46f6d50 100644 --- a/mobile/rpc-foundation/goldens/files-preview-worktree-image.json +++ b/mobile/rpc-foundation/goldens/files-preview-worktree-image.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-worktree-text-read.json b/mobile/rpc-foundation/goldens/files-preview-worktree-text-read.json index 9f189b98b7cd..b67eb6d59cca 100644 --- a/mobile/rpc-foundation/goldens/files-preview-worktree-text-read.json +++ b/mobile/rpc-foundation/goldens/files-preview-worktree-text-read.json @@ -3,7 +3,7 @@ "family": "files.preview-worktree-text", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-preview-worktree.json b/mobile/rpc-foundation/goldens/files-preview-worktree.json index 5fd91b2b517f..933942cfdb3f 100644 --- a/mobile/rpc-foundation/goldens/files-preview-worktree.json +++ b/mobile/rpc-foundation/goldens/files-preview-worktree.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-save-blind.json b/mobile/rpc-foundation/goldens/files-save-blind.json index dc1209252f73..7dc10c03d1bf 100644 --- a/mobile/rpc-foundation/goldens/files-save-blind.json +++ b/mobile/rpc-foundation/goldens/files-save-blind.json @@ -3,7 +3,7 @@ "family": "files.preview-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-save-verified.json b/mobile/rpc-foundation/goldens/files-save-verified.json index 3d370939df4c..12bb53d22b7d 100644 --- a/mobile/rpc-foundation/goldens/files-save-verified.json +++ b/mobile/rpc-foundation/goldens/files-save-verified.json @@ -3,7 +3,7 @@ "family": "files.preview-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/files-tab-doc-shapes.json b/mobile/rpc-foundation/goldens/files-tab-doc-shapes.json index 4ba829fd5139..0658bd727128 100644 --- a/mobile/rpc-foundation/goldens/files-tab-doc-shapes.json +++ b/mobile/rpc-foundation/goldens/files-tab-doc-shapes.json @@ -3,7 +3,7 @@ "family": "files.tab-doc", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/home-host-accounts.json b/mobile/rpc-foundation/goldens/home-host-accounts.json index b9c58502f53b..e702147addff 100644 --- a/mobile/rpc-foundation/goldens/home-host-accounts.json +++ b/mobile/rpc-foundation/goldens/home-host-accounts.json @@ -3,7 +3,7 @@ "family": "home.host-accounts", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c632fdbc4b730777ecb09f08bec14cca0586042b01ed99d40d0228806c7def4a", diff --git a/mobile/rpc-foundation/goldens/home-host-stats.json b/mobile/rpc-foundation/goldens/home-host-stats.json index 53128ac55c86..8cf4e0187da5 100644 --- a/mobile/rpc-foundation/goldens/home-host-stats.json +++ b/mobile/rpc-foundation/goldens/home-host-stats.json @@ -3,7 +3,7 @@ "family": "home.host-stats", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/host-view-settings-sync.json b/mobile/rpc-foundation/goldens/host-view-settings-sync.json index ff27183bf088..adadbb818038 100644 --- a/mobile/rpc-foundation/goldens/host-view-settings-sync.json +++ b/mobile/rpc-foundation/goldens/host-view-settings-sync.json @@ -3,7 +3,7 @@ "family": "host.view-settings", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/host-worktree-actions-pin-open-delete.json b/mobile/rpc-foundation/goldens/host-worktree-actions-pin-open-delete.json index 49517faa0969..f1de161f46ae 100644 --- a/mobile/rpc-foundation/goldens/host-worktree-actions-pin-open-delete.json +++ b/mobile/rpc-foundation/goldens/host-worktree-actions-pin-open-delete.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/host-worktree-delete-refused.json b/mobile/rpc-foundation/goldens/host-worktree-delete-refused.json index 4d4f1c5da7b1..ca8bb14a5df9 100644 --- a/mobile/rpc-foundation/goldens/host-worktree-delete-refused.json +++ b/mobile/rpc-foundation/goldens/host-worktree-delete-refused.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/host-worktree-refresh-stream.json b/mobile/rpc-foundation/goldens/host-worktree-refresh-stream.json index 0e711a5623ed..b8ac4ff58b0a 100644 --- a/mobile/rpc-foundation/goldens/host-worktree-refresh-stream.json +++ b/mobile/rpc-foundation/goldens/host-worktree-refresh-stream.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/interruptions-inventory-lifecycle.json b/mobile/rpc-foundation/goldens/interruptions-inventory-lifecycle.json index 38f5f2d52db9..dabe2fc5872d 100644 --- a/mobile/rpc-foundation/goldens/interruptions-inventory-lifecycle.json +++ b/mobile/rpc-foundation/goldens/interruptions-inventory-lifecycle.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/interruptions-settings-bot-overrides-fulfilled.json b/mobile/rpc-foundation/goldens/interruptions-settings-bot-overrides-fulfilled.json index c113f4934a80..100f21460dd7 100644 --- a/mobile/rpc-foundation/goldens/interruptions-settings-bot-overrides-fulfilled.json +++ b/mobile/rpc-foundation/goldens/interruptions-settings-bot-overrides-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/inventory-lifecycle.json b/mobile/rpc-foundation/goldens/inventory-lifecycle.json index c8e58c17a54f..63331d4bc2cd 100644 --- a/mobile/rpc-foundation/goldens/inventory-lifecycle.json +++ b/mobile/rpc-foundation/goldens/inventory-lifecycle.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/inventory-repeat-query.json b/mobile/rpc-foundation/goldens/inventory-repeat-query.json index cca240fab8a1..133dd37378ef 100644 --- a/mobile/rpc-foundation/goldens/inventory-repeat-query.json +++ b/mobile/rpc-foundation/goldens/inventory-repeat-query.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/lifecycle-b3.json b/mobile/rpc-foundation/goldens/lifecycle-b3.json index cf04a8e52cd4..7e2a3ff2dde2 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-b3.json +++ b/mobile/rpc-foundation/goldens/lifecycle-b3.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/lifecycle-inventory-lifecycle.json b/mobile/rpc-foundation/goldens/lifecycle-inventory-lifecycle.json index 7706e5c23b41..28cd115186d5 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-inventory-lifecycle.json +++ b/mobile/rpc-foundation/goldens/lifecycle-inventory-lifecycle.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/lifecycle-settings-bot-overrides-fulfilled.json b/mobile/rpc-foundation/goldens/lifecycle-settings-bot-overrides-fulfilled.json index c02ba959c78a..7ee44f37fc47 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-settings-bot-overrides-fulfilled.json +++ b/mobile/rpc-foundation/goldens/lifecycle-settings-bot-overrides-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/lifecycle-settings-task-hydration-fulfilled.json b/mobile/rpc-foundation/goldens/lifecycle-settings-task-hydration-fulfilled.json index 233de8a64183..9c5f08c680e0 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-settings-task-hydration-fulfilled.json +++ b/mobile/rpc-foundation/goldens/lifecycle-settings-task-hydration-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/lifecycle-settings-workspace-context-fulfilled.json b/mobile/rpc-foundation/goldens/lifecycle-settings-workspace-context-fulfilled.json index 6c7c5a921cda..c72a6b5d8243 100644 --- a/mobile/rpc-foundation/goldens/lifecycle-settings-workspace-context-fulfilled.json +++ b/mobile/rpc-foundation/goldens/lifecycle-settings-workspace-context-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/linear-select-workspace.json b/mobile/rpc-foundation/goldens/linear-select-workspace.json index c62341321b80..cfe5c67870f2 100644 --- a/mobile/rpc-foundation/goldens/linear-select-workspace.json +++ b/mobile/rpc-foundation/goldens/linear-select-workspace.json @@ -3,7 +3,7 @@ "family": "linear.select-workspace-picker", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b65996c152b632d553a31e07e31ea5c76f998eada42cf0966923d730da21908f", diff --git a/mobile/rpc-foundation/goldens/live-worktree-name-stream.json b/mobile/rpc-foundation/goldens/live-worktree-name-stream.json index 8aeb392fe07f..db71c42b7105 100644 --- a/mobile/rpc-foundation/goldens/live-worktree-name-stream.json +++ b/mobile/rpc-foundation/goldens/live-worktree-name-stream.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.create-1.json b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.create-1.json index 4d2fe5a4e75e..8d205778875d 100644 --- a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.create-1.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.createsupport-1.json b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.createsupport-1.json index c42f108854cf..791ede81d7d9 100644 --- a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.createsupport-1.json +++ b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-create-agentsession.createsupport-1.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-launch-agentsession.createsupport-1.json b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-launch-agentsession.createsupport-1.json index 522a70669077..fe99a2b28143 100644 --- a/mobile/rpc-foundation/goldens/matrix-agentsession.structured-launch-agentsession.createsupport-1.json +++ b/mobile/rpc-foundation/goldens/matrix-agentsession.structured-launch-agentsession.createsupport-1.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json index 53404a56db05..68b76baf7984 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json index a2daea98baa2..3d60a85ab045 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-status.get-2.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-status.get-2.json index ace3ee82e9e8..2fc02ff18614 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-status.get-2.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-status.get-2.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json index 6255151ee8ec..4f9bbfc16b7d 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json @@ -3,7 +3,7 @@ "family": "aiVault.history-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c78ab47eea594b7e1988403321ff9ba135ca60c513bb9d5848bdde26c0ffe3c3", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json index 2dc1ed6dd783..5530b93969e4 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json @@ -3,7 +3,7 @@ "family": "aiVault.history", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "ec16931c5431d3dbb05729d4670c381a434bff71648d334b7b5224db188fdccb", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-session.tabs.createterminal-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-session.tabs.createterminal-1.json index 512d5c031a19..175556b1b0c3 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-session.tabs.createterminal-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-session.tabs.createterminal-1.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-terminal.send-1.json index de17109c6226..241e0f99409e 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.resume-launch-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.resume-preparation-aivault.preparesessionresume-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.resume-preparation-aivault.preparesessionresume-1.json index fa432bebe881..74f84d2526f8 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.resume-preparation-aivault.preparesessionresume-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.resume-preparation-aivault.preparesessionresume-1.json @@ -3,7 +3,7 @@ "family": "aiVault.resume-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2f43211e4084c0493bd02ec98868acf53a4c748f89a70cd9657c9c3ee87b12fb", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.dialog-browser.dialogaccept-1.json b/mobile/rpc-foundation/goldens/matrix-browser.dialog-browser.dialogaccept-1.json index 0bbdd00cb21f..6da9cceba8bb 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.dialog-browser.dialogaccept-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.dialog-browser.dialogaccept-1.json @@ -3,7 +3,7 @@ "family": "browser.dialog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keyboardinserttext-1.json b/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keyboardinserttext-1.json index cd482560c1a3..d943a202d3f8 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keyboardinserttext-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keyboardinserttext-1.json @@ -3,7 +3,7 @@ "family": "browser.keyboard", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keypress-1.json b/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keypress-1.json index fb7f153f204b..1311ac786595 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keypress-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.keyboard-browser.keypress-1.json @@ -3,7 +3,7 @@ "family": "browser.keyboard", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseclick-1.json b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseclick-1.json index 29a9173986d2..2b425803af09 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseclick-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseclick-1.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousedown-1.json b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousedown-1.json index 1e6456b1f023..f4219c2aeb63 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousedown-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousedown-1.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousemove-1.json b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousemove-1.json index d6009d614a74..1e2c03760f25 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousemove-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mousemove-1.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseup-1.json b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseup-1.json index facb0d19e0e9..43bed4caabf6 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseup-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.pointer-click-browser.mouseup-1.json @@ -3,7 +3,7 @@ "family": "browser.pointer-click", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousemove-1.json b/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousemove-1.json index 87ac6b7faaf7..ca312d82abb9 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousemove-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousemove-1.json @@ -3,7 +3,7 @@ "family": "browser.wheel", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousewheel-1.json b/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousewheel-1.json index 2c52ef6ec72a..8ee48dd1fd30 100644 --- a/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousewheel-1.json +++ b/mobile/rpc-foundation/goldens/matrix-browser.wheel-browser.mousewheel-1.json @@ -3,7 +3,7 @@ "family": "browser.wheel", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55971752f963202d30160851197a301089b0f3ebd0c46725af1a461d8310d658", diff --git a/mobile/rpc-foundation/goldens/matrix-clipboard.image-attachment-clipboard.startimageupload-1.json b/mobile/rpc-foundation/goldens/matrix-clipboard.image-attachment-clipboard.startimageupload-1.json index 2e7e89decf2f..99d3eb126993 100644 --- a/mobile/rpc-foundation/goldens/matrix-clipboard.image-attachment-clipboard.startimageupload-1.json +++ b/mobile/rpc-foundation/goldens/matrix-clipboard.image-attachment-clipboard.startimageupload-1.json @@ -3,7 +3,7 @@ "family": "clipboard.image-attachment", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.saveimageastempfile-1.json b/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.saveimageastempfile-1.json index 300c0a1bb4f5..ddda539bc4c6 100644 --- a/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.saveimageastempfile-1.json +++ b/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.saveimageastempfile-1.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.startimageupload-1.json b/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.startimageupload-1.json index 8599f5b2df99..f464ff8ef8e6 100644 --- a/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.startimageupload-1.json +++ b/mobile/rpc-foundation/goldens/matrix-clipboard.image-upload-clipboard.startimageupload-1.json @@ -3,7 +3,7 @@ "family": "clipboard.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-components.codex-reset-capability-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-components.codex-reset-capability-status.get-1.json index 70fa3aaa0841..9879f9282a39 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.codex-reset-capability-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.codex-reset-capability-status.get-1.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-capability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.codex-reset-credit-accounts.consumecodexresetcredit-1.json b/mobile/rpc-foundation/goldens/matrix-components.codex-reset-credit-accounts.consumecodexresetcredit-1.json index 1829baa8edaa..ea1cb61598f1 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.codex-reset-credit-accounts.consumecodexresetcredit-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.codex-reset-credit-accounts.consumecodexresetcredit-1.json @@ -3,7 +3,7 @@ "family": "components.codex-reset-credit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "76b53dea504a688493843e23e8e7d052fc196f559bb1e2579d0fd38bf3156d0e", diff --git a/mobile/rpc-foundation/goldens/matrix-components.execution-target-local-preflight.detectagents-1.json b/mobile/rpc-foundation/goldens/matrix-components.execution-target-local-preflight.detectagents-1.json index a56cfbad645c..cb7bae2e7aa5 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.execution-target-local-preflight.detectagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.execution-target-local-preflight.detectagents-1.json @@ -3,7 +3,7 @@ "family": "components.execution-target-local", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.execution-target-preflight.detectremoteagents-1.json b/mobile/rpc-foundation/goldens/matrix-components.execution-target-preflight.detectremoteagents-1.json index 4bc97abed12d..5b35c3911fb5 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.execution-target-preflight.detectremoteagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.execution-target-preflight.detectremoteagents-1.json @@ -3,7 +3,7 @@ "family": "components.execution-target", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.connect-1.json b/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.connect-1.json index 53d45631f5f2..288f5e269b57 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.connect-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.connect-1.json @@ -3,7 +3,7 @@ "family": "components.execution-target", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.getstate-1.json b/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.getstate-1.json index 68684251c5ea..86add409131e 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.getstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.execution-target-ssh.getstate-1.json @@ -3,7 +3,7 @@ "family": "components.execution-target", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-components.new-workspace-repositories-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-components.new-workspace-repositories-repo.list-1.json index 19650d12990d..d1d9e1bd99e3 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.new-workspace-repositories-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.new-workspace-repositories-repo.list-1.json @@ -3,7 +3,7 @@ "family": "components.new-workspace-repositories", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "64c1772f0f95a3c43fbb14398a8804b2b4784f7f18874e4fd79767ae634c7faa", diff --git a/mobile/rpc-foundation/goldens/matrix-components.setup-script-repo.hooks-1.json b/mobile/rpc-foundation/goldens/matrix-components.setup-script-repo.hooks-1.json index 18a8f25f5949..965623d61563 100644 --- a/mobile/rpc-foundation/goldens/matrix-components.setup-script-repo.hooks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-components.setup-script-repo.hooks-1.json @@ -3,7 +3,7 @@ "family": "components.setup-script", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5cfbce3c7d97d908fbd447646d611e41a8aa1f61f684b9b710c4b67d6ff023a7", diff --git a/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.list-1.json b/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.list-1.json index e3ae350bcd88..cc88c5ad7b9c 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.list-1.json @@ -3,7 +3,7 @@ "family": "files.explorer-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "7a42a348f4407b94cf75ac77a4b6b783b7d28103b1ae1d111d2708dab0dd4a0c", diff --git a/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.readdir-1.json b/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.readdir-1.json index 131d7707a4e1..8e1d86de1b90 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.readdir-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.explorer-screen-files.readdir-1.json @@ -3,7 +3,7 @@ "family": "files.explorer-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "7a42a348f4407b94cf75ac77a4b6b783b7d28103b1ae1d111d2708dab0dd4a0c", diff --git a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-ssh.getstate-1.json b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-ssh.getstate-1.json index 9c6bccc96098..2b192f3aa846 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-ssh.getstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-ssh.getstate-1.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-status.get-1.json index 3b5bec1f7d56..7c1c3ac751c6 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-status.get-1.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-worktree.show-1.json index bbf0b3851731..5cb190a31eff 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.mutation-ownership-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "files.mutation-ownership", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-artifact-image-files.readterminalartifactpreview-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-artifact-image-files.readterminalartifactpreview-1.json index 732fbc1f4b94..a3a8fe889513 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-artifact-image-files.readterminalartifactpreview-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-artifact-image-files.readterminalartifactpreview-1.json @@ -3,7 +3,7 @@ "family": "files.preview-artifact-image", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-1.json index 0d0a849b2f8a..159404e1b4c6 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-1.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-2.json b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-2.json index 8760719727d4..e7b369f7a8fa 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-2.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.readterminalartifact-2.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.resolveterminalpath-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.resolveterminalpath-1.json index a25e815bce38..377bcb8ef868 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.resolveterminalpath-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-load-files.resolveterminalpath-1.json @@ -3,7 +3,7 @@ "family": "files.preview-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.readterminalartifact-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.readterminalartifact-1.json index 51b9cf786282..32817b0fb41d 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.readterminalartifact-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.readterminalartifact-1.json @@ -3,7 +3,7 @@ "family": "files.preview-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.writeterminalartifact-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.writeterminalartifact-1.json index 363e3c7dde8e..78d0ee50808f 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.writeterminalartifact-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-save-files.writeterminalartifact-1.json @@ -3,7 +3,7 @@ "family": "files.preview-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-image-files.readpreview-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-image-files.readpreview-1.json index 0408a9c3a586..8173a17b650e 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-image-files.readpreview-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-image-files.readpreview-1.json @@ -3,7 +3,7 @@ "family": "files.preview-worktree-image", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-text-files.read-1.json b/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-text-files.read-1.json index 27825102bcec..34e778508857 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-text-files.read-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.preview-worktree-text-files.read-1.json @@ -3,7 +3,7 @@ "family": "files.preview-worktree-text", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.read-1.json b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.read-1.json index 35d97c64c469..8312731b553d 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.read-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.read-1.json @@ -3,7 +3,7 @@ "family": "files.tab-doc", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.readpreview-1.json b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.readpreview-1.json index 8a458180dd27..738bb631480f 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.readpreview-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-files.readpreview-1.json @@ -3,7 +3,7 @@ "family": "files.tab-doc", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-git.diff-1.json b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-git.diff-1.json index c25f92c59f79..a4c5d13082c1 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.tab-doc-git.diff-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.tab-doc-git.diff-1.json @@ -3,7 +3,7 @@ "family": "files.tab-doc", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b93fc8b6f1ece041acaa8cc5699852085e67d7e2f39db13145e483f854ea3309", diff --git a/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.open-1.json b/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.open-1.json index 80494c6f26f7..e340b90e7350 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.open-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.open-1.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.resolveterminalpath-1.json b/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.resolveterminalpath-1.json index 1eea79733e92..e28a23102bb0 100644 --- a/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.resolveterminalpath-1.json +++ b/mobile/rpc-foundation/goldens/matrix-files.terminal-path-tap-files.resolveterminalpath-1.json @@ -3,7 +3,7 @@ "family": "files.terminal-path-tap", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e20a76ecd5e820dc4797fb25307810af68b5ced996dba2b9599464a21b5cbe1b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.baserefdefault-1.json b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.baserefdefault-1.json index aabcd9eac472..ec13c65fb4af 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.baserefdefault-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.baserefdefault-1.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.list-1.json index 02f2730a3ce0..25f00c15ba2f 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-repo.list-1.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-worktree.show-1.json index 81be16d5e784..cbdea59fbc95 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.base-ref-chain-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json b/mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json index 4e9c254248b0..8aec0ab46c97 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.branch-diff-preview-git.branchdiff-1.json @@ -3,7 +3,7 @@ "family": "git.branch-diff-preview", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json index acf44fb06060..bcf54ece9dd8 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.branchcompare-1.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json index be1ce32089c8..5afd179d85d2 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-git.status-1.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json index 2d358a3e83b7..b84b036551c9 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-repo.list-1.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json index 9236f81f5d51..a3578fa67809 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.changes-load-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.commit-message-ai-git.generatecommitmessage-1.json b/mobile/rpc-foundation/goldens/matrix-git.commit-message-ai-git.generatecommitmessage-1.json index 0ad229114d0a..ce4246cb49bd 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.commit-message-ai-git.generatecommitmessage-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.commit-message-ai-git.generatecommitmessage-1.json @@ -3,7 +3,7 @@ "family": "git.commit-message-ai", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.commitcompare-1.json b/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.commitcompare-1.json index be9e8c3ccbb4..32b2fd268db3 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.commitcompare-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.commitcompare-1.json @@ -3,7 +3,7 @@ "family": "git.history-commit-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.history-1.json b/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.history-1.json index 43b1e6f69701..675c778ab312 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.history-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.history-commit-files-git.history-1.json @@ -3,7 +3,7 @@ "family": "git.history-commit-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/matrix-git.history-read-git.history-1.json b/mobile/rpc-foundation/goldens/matrix-git.history-read-git.history-1.json index 4f3bd614da3a..092dd3ae5355 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.history-read-git.history-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.history-read-git.history-1.json @@ -3,7 +3,7 @@ "family": "git.history-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-git.remote-prerequisite-git.push-1.json b/mobile/rpc-foundation/goldens/matrix-git.remote-prerequisite-git.push-1.json index b1c08de7bfc4..c5b8fa1ccecf 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.remote-prerequisite-git.push-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.remote-prerequisite-git.push-1.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-git.review-preparation-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-git.review-preparation-git.status-1.json index 4bc338b638ca..d69605a772cd 100644 --- a/mobile/rpc-foundation/goldens/matrix-git.review-preparation-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-git.review-preparation-git.status-1.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addissuecomment-1.json index 806b0ebafb43..aa34ebfeea07 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addprreviewcommentreply-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addprreviewcommentreply-1.json index 77d912eb07c9..e9d6280e3629 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addprreviewcommentreply-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.addprreviewcommentreply-1.json @@ -3,7 +3,7 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.deleteissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.deleteissuecommentbyslug-1.json index 76bc1ef55d15..cecc525a4cae 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.deleteissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.deleteissuecommentbyslug-1.json @@ -3,7 +3,7 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.updateissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.updateissuecommentbyslug-1.json index 8af2ce1ce222..294c5a2695b7 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.updateissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.project.updateissuecommentbyslug-1.json @@ -3,7 +3,7 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.resolvereviewthread-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.resolvereviewthread-1.json index 30555b5ae0c0..ce8130e211c4 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.resolvereviewthread-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-comment-mutation-github.resolvereviewthread-1.json @@ -3,7 +3,7 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.mergepr-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.mergepr-1.json index 396b4c7439ef..bc31d8f48546 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.mergepr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.mergepr-1.json @@ -3,7 +3,7 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.removeprreviewers-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.removeprreviewers-1.json index ab3f280a28ad..2030a3897ea0 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.removeprreviewers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.removeprreviewers-1.json @@ -3,7 +3,7 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.requestprreviewers-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.requestprreviewers-1.json index 28b45178e0d6..3fa4c425789a 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.requestprreviewers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.requestprreviewers-1.json @@ -3,7 +3,7 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.rerunprchecks-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.rerunprchecks-1.json index 973e5712cfc6..9bdbddba0a7a 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.rerunprchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.rerunprchecks-1.json @@ -3,7 +3,7 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.setprautomerge-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.setprautomerge-1.json index 336ae110059f..f11f6dd43a5f 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.setprautomerge-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.setprautomerge-1.json @@ -3,7 +3,7 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.updateprstate-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.updateprstate-1.json index a65428b8e2ca..52377ce2bb47 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.updateprstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-mutation-github.updateprstate-1.json @@ -3,7 +3,7 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.listassignableusers-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.listassignableusers-1.json index 3ba174a751d8..e6031d2899bd 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.listassignableusers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.listassignableusers-1.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prcheckdetails-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prcheckdetails-1.json index bf05e8646223..8a746b7d5083 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prcheckdetails-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prcheckdetails-1.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prchecks-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prchecks-1.json index a4102369042c..aedb53ac1412 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prchecks-1.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prforbranch-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prforbranch-1.json index d51a8e4a893e..60936c24937f 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prforbranch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.prforbranch-1.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.reposlug-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.reposlug-1.json index 294612973795..890ffd081004 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.reposlug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.reposlug-1.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.workitemdetails-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.workitemdetails-1.json index 03b1f3af3d68..7c620ace6afb 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.workitemdetails-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-github.workitemdetails-1.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-read-hostedreview.forbranch-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-read-hostedreview.forbranch-1.json index 9dfcea1975da..84e3d8d7ec44 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-read-hostedreview.forbranch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-read-hostedreview.forbranch-1.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-github.pr-title-mutation-github.updateprtitle-1.json b/mobile/rpc-foundation/goldens/matrix-github.pr-title-mutation-github.updateprtitle-1.json index db37ecace105..7b869bba8695 100644 --- a/mobile/rpc-foundation/goldens/matrix-github.pr-title-mutation-github.updateprtitle-1.json +++ b/mobile/rpc-foundation/goldens/matrix-github.pr-title-mutation-github.updateprtitle-1.json @@ -3,7 +3,7 @@ "family": "github.pr-title-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-home.host-accounts-accounts.list-1.json b/mobile/rpc-foundation/goldens/matrix-home.host-accounts-accounts.list-1.json index 8c3f240d5faa..5e3e117809b7 100644 --- a/mobile/rpc-foundation/goldens/matrix-home.host-accounts-accounts.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-home.host-accounts-accounts.list-1.json @@ -3,7 +3,7 @@ "family": "home.host-accounts", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c632fdbc4b730777ecb09f08bec14cca0586042b01ed99d40d0228806c7def4a", diff --git a/mobile/rpc-foundation/goldens/matrix-home.host-stats-stats.summary-1.json b/mobile/rpc-foundation/goldens/matrix-home.host-stats-stats.summary-1.json index e808bddbe6fd..84817f85a318 100644 --- a/mobile/rpc-foundation/goldens/matrix-home.host-stats-stats.summary-1.json +++ b/mobile/rpc-foundation/goldens/matrix-home.host-stats-stats.summary-1.json @@ -3,7 +3,7 @@ "family": "home.host-stats", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-1.json b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-1.json index 8188118fef3f..8e35b0ac7e35 100644 --- a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-1.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-2.json b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-2.json index 0ffb16350276..7cbe3edb79dd 100644 --- a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-2.json +++ b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-2.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-3.json b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-3.json index a7d857302e1f..94c83f0f737d 100644 --- a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-3.json +++ b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-1-3.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-2-1.json b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-2-1.json index 122408a75f79..45f37cca989a 100644 --- a/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-2-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host-worktree-refresh-runtime.clientevents.subscribe-2-1.json @@ -3,7 +3,7 @@ "family": "host-worktree-refresh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.get-1.json b/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.get-1.json index 57adfc6c1949..6d3c7f6f94ff 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.get-1.json @@ -3,7 +3,7 @@ "family": "host.view-settings", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.set-1.json b/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.set-1.json index 2cf5ee33fba8..0e7def826285 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.view-settings-ui.set-1.json @@ -3,7 +3,7 @@ "family": "host.view-settings", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a9e0780298a1443664e7ae02056168aa34d67556c9c056d51a82c7b4a73ad35b", diff --git a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.activate-1.json b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.activate-1.json index 0cf874ee84e3..404a2f89f268 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.activate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.activate-1.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.rm-1.json b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.rm-1.json index bf8d61caa050..04f692cca20b 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.rm-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.rm-1.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.set-1.json index ec3546ea2740..5098386c4f57 100644 --- a/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-host.worktree-actions-worktree.set-1.json @@ -3,7 +3,7 @@ "family": "host.worktree-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "92c29bd78ca0c0d5917e9386fc447bb9a1698b1d1ffaba0db7546eaac60da639", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-git.push-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-git.push-1.json index fb33a1c1e7dc..e1b7fa432b82 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-git.push-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-git.push-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-hostedreview.create-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-hostedreview.create-1.json index b7b4f4e326e3..2722a3dc1799 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-hostedreview.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-hostedreview.create-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-worktree.set-1.json index 39ea426a9f66..e57ec82457ad 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-chain-worktree.set-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.bulkstage-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.bulkstage-1.json index 445b6cee00a3..4a2305bcd49a 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.bulkstage-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.bulkstage-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.commit-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.commit-1.json index 425cb014bb3c..f946583aa4fd 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.commit-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.commit-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.generatecommitmessage-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.generatecommitmessage-1.json index a7ec45c47ea8..7463a1bc89b5 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.generatecommitmessage-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.generatecommitmessage-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.push-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.push-1.json index ca99bab6a01d..627f7488bde5 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.push-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.push-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-1.json index 11263c70c663..831261fe71ba 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-2.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-2.json index 13f402cfa973..c9180917cc6d 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-2.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-2.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-3.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-3.json index 36e2ddbc10fc..b7a96e01c98e 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-3.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-3.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-4.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-4.json index 4f6eb1557dc2..3e26f5eb9e91 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-4.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-git.status-4.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.create-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.create-1.json index f3e587029bd1..e701009162c2 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.create-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-1.json index 2bc0f6d3f4fb..85f852133770 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-2.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-2.json index 2380040f6684..edbb82cccad3 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-2.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-hostedreview.getcreationeligibility-2.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-worktree.set-1.json index 2beeb0ed5ab9..15bc63967aea 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.create-intent-worktree.set-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-hostedreview.eligibility-hostedreview.getcreationeligibility-1.json b/mobile/rpc-foundation/goldens/matrix-hostedreview.eligibility-hostedreview.getcreationeligibility-1.json index c0176e343196..190bdc01828e 100644 --- a/mobile/rpc-foundation/goldens/matrix-hostedreview.eligibility-hostedreview.getcreationeligibility-1.json +++ b/mobile/rpc-foundation/goldens/matrix-hostedreview.eligibility-hostedreview.getcreationeligibility-1.json @@ -3,7 +3,7 @@ "family": "hostedReview.eligibility", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-1.json b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-1.json index 3c160667be93..b0453b1c0fc9 100644 --- a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-1.json +++ b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-1.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-2.json b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-2.json index 033302a64a24..bc4f8e5dac82 100644 --- a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-2.json +++ b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-files.searchpaths-2.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-fresh-inventory.json b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-fresh-inventory.json index 61665af7c473..d71ede674799 100644 --- a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-fresh-inventory.json +++ b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-fresh-inventory.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-old-inventory.json b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-old-inventory.json index a75e8c682c51..4c50612fc187 100644 --- a/mobile/rpc-foundation/goldens/matrix-legacy-inventory-old-inventory.json +++ b/mobile/rpc-foundation/goldens/matrix-legacy-inventory-old-inventory.json @@ -3,7 +3,7 @@ "family": "legacy-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "262eaad263a45aa13ec5b27c12b59946b12c202474229fff7a5727dba6d702ca", diff --git a/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.getissue-1.json b/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.getissue-1.json index 60cc966dac40..e6ff652f0141 100644 --- a/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.getissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.getissue-1.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.issuecomments-1.json b/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.issuecomments-1.json index d113789d15e8..1dcbcdbfe1be 100644 --- a/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.issuecomments-1.json +++ b/mobile/rpc-foundation/goldens/matrix-linear-detail-barrier-linear.issuecomments-1.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/matrix-linear.select-workspace-picker-linear.selectworkspace-1.json b/mobile/rpc-foundation/goldens/matrix-linear.select-workspace-picker-linear.selectworkspace-1.json index 4f9be474280a..7088f794abfe 100644 --- a/mobile/rpc-foundation/goldens/matrix-linear.select-workspace-picker-linear.selectworkspace-1.json +++ b/mobile/rpc-foundation/goldens/matrix-linear.select-workspace-picker-linear.selectworkspace-1.json @@ -3,7 +3,7 @@ "family": "linear.select-workspace-picker", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b65996c152b632d553a31e07e31ea5c76f998eada42cf0966923d730da21908f", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-1.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-1.json index 29589903a21a..9da3e6beaf78 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-1.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-1.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-2.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-2.json index 8f6874667e42..04d990d591ce 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-2.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-1-2.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-2-1.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-2-1.json index 79ffed55a500..39f2a2e63863 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-2-1.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-runtime.clientevents.subscribe-2-1.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-1.json index 454bbe310918..1bc86e918969 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-2.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-2.json index 6ec8daed6edb..151808d673b8 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-2.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-2.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-3.json b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-3.json index bba304fd5101..5126ef54e29c 100644 --- a/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-3.json +++ b/mobile/rpc-foundation/goldens/matrix-live-worktree-name-worktree.show-3.json @@ -3,7 +3,7 @@ "family": "live-worktree-name", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8e41c8624b9b6185e447cee3590a851ab88b6b1ee1d632af90e3a771a90310be", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-app-js.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-app-js.json index b917722c7984..7573ef7cec0b 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-app-js.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-app-js.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-head.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-head.json index 79b074049b61..43a231817bdc 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-head.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-head.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-tail.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-tail.json index 338446476fe1..29fba15b4dae 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-tail.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-index-tail.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-mobileweb.bundle.manifest-1.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-mobileweb.bundle.manifest-1.json index 19d7ac1f8814..fe3ed6f7f9d8 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-mobileweb.bundle.manifest-1.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-fetch-mobileweb.bundle.manifest-1.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-manifest-mobileweb.bundle.manifest-1.json b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-manifest-mobileweb.bundle.manifest-1.json index 8f7a243fa737..4abd8f4e3752 100644 --- a/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-manifest-mobileweb.bundle.manifest-1.json +++ b/mobile/rpc-foundation/goldens/matrix-mobileweb.bundle-manifest-mobileweb.bundle.manifest-1.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-manifest", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-1.json index 8952e42cef8c..70d9caacc866 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-2.json b/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-2.json index 81df706c7cad..bda0f2377a62 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-2.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.image-paste-terminal.send-2.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.image-upload-clipboard.startimageupload-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.image-upload-clipboard.startimageupload-1.json index fbf47253e12b..6ca1f29ca742 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.image-upload-clipboard.startimageupload-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.image-upload-clipboard.startimageupload-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.session-option-pick-settings.mutatenativechatsessionoptions-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.session-option-pick-settings.mutatenativechatsessionoptions-1.json index 1f713a67286c..de35c7e8e9db 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.session-option-pick-settings.mutatenativechatsessionoptions-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.session-option-pick-settings.mutatenativechatsessionoptions-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.session-option-pick", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-orchestration.workerterminaluserinput-1.json index 09928edbacaa..4828a3c136a4 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-terminal.send-1.json index 2ad6a4c31683..e27b8dedce8b 100644 --- a/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-nativechat.terminal-write-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.getmissedsince-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.getmissedsince-1.json index 08806b12b125..5c96345be12e 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.getmissedsince-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.getmissedsince-1.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-1.json index 2a1c1f9bf052..6906e28b4be9 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-1.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-2.json b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-2.json index d70c83c9f1be..2d604afd9c4a 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-2.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.subscribe-1-2.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.unsubscribe-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.unsubscribe-1.json index 8ac93debb4bb..2a43ab0c76ed 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.unsubscribe-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.desktop-stream-notifications.unsubscribe-1.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.display-test-screen-notifications.testpush-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.display-test-screen-notifications.testpush-1.json index 0b3f26918a6a..afae0c3d35a8 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.display-test-screen-notifications.testpush-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.display-test-screen-notifications.testpush-1.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.push-dismissal-notifications.getmissedsince-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.push-dismissal-notifications.getmissedsince-1.json index 881d94162ed0..e06cd59edc4c 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.push-dismissal-notifications.getmissedsince-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.push-dismissal-notifications.getmissedsince-1.json @@ -3,7 +3,7 @@ "family": "notifications.push-dismissal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "595a3eb2994d0596b9fcd0707b175b4e978625053dfbc5c541b0350c0cbfb524", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.registerpush-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.registerpush-1.json index 58b63cc91697..0792eb913917 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.registerpush-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.registerpush-1.json @@ -3,7 +3,7 @@ "family": "notifications.push-registration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2e3d939dc162dbc5a38d8a7207111688204a825fd70348721917b3016e1c9470", diff --git a/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.unregisterpush-1.json b/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.unregisterpush-1.json index 07b3c9a2796a..dcf41dad6a07 100644 --- a/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.unregisterpush-1.json +++ b/mobile/rpc-foundation/goldens/matrix-notifications.push-registration-notifications.unregisterpush-1.json @@ -3,7 +3,7 @@ "family": "notifications.push-registration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2e3d939dc162dbc5a38d8a7207111688204a825fd70348721917b3016e1c9470", diff --git a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json index ebe7a717cc02..51f9cab8a2d8 100644 --- a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json +++ b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-direct-status.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.getendpoints-1.json b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.getendpoints-1.json index 7810e8b15694..eb571950293b 100644 --- a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.getendpoints-1.json +++ b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.getendpoints-1.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.provisionrelay-1.json b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.provisionrelay-1.json index 44781877b880..99d22ea0bd3e 100644 --- a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.provisionrelay-1.json +++ b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-pairing.provisionrelay-1.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json index e18957b26253..ea72c6502d22 100644 --- a/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json +++ b/mobile/rpc-foundation/goldens/matrix-pairing.pre-profile-relay-status.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-project-explicit-false-github.project.updateissuebyslug-1.json b/mobile/rpc-foundation/goldens/matrix-project-explicit-false-github.project.updateissuebyslug-1.json index 69986253a7d3..668b9c84bf94 100644 --- a/mobile/rpc-foundation/goldens/matrix-project-explicit-false-github.project.updateissuebyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-project-explicit-false-github.project.updateissuebyslug-1.json @@ -3,7 +3,7 @@ "family": "project-explicit-false", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-1.json b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-1.json index bae589eabc76..7c4b581d9c39 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-1.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-2.json b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-2.json index 90602fa2c0ef..9eb068188c7b 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-2.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.getendpoints-2.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.provisionrelay-1.json b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.provisionrelay-1.json index bc46128a9c9c..fb690cf26934 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.provisionrelay-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.credential-rotation-pairing.provisionrelay-1.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-1.json b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-1.json index 19896f3e5d69..ac4780fa50f1 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-1.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-2.json b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-2.json index e249286364c6..6d0198b9b6ab 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-2.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.getendpoints-2.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.provisionrelay-1.json b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.provisionrelay-1.json index 8450924573e5..2ea5793519b8 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.provisionrelay-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.direct-upgrade-pairing.provisionrelay-1.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/matrix-relay.pairing-recovery-pairing.getendpoints-1.json b/mobile/rpc-foundation/goldens/matrix-relay.pairing-recovery-pairing.getendpoints-1.json index 3aa32fc8d3f6..88d32e67d1d5 100644 --- a/mobile/rpc-foundation/goldens/matrix-relay.pairing-recovery-pairing.getendpoints-1.json +++ b/mobile/rpc-foundation/goldens/matrix-relay.pairing-recovery-pairing.getendpoints-1.json @@ -3,7 +3,7 @@ "family": "relay.pairing-recovery", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/matrix-session.browser-tab-create-browser.tabcreate-1.json b/mobile/rpc-foundation/goldens/matrix-session.browser-tab-create-browser.tabcreate-1.json index 2dbf9fec5b3f..b5dec27ab14a 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.browser-tab-create-browser.tabcreate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.browser-tab-create-browser.tabcreate-1.json @@ -3,7 +3,7 @@ "family": "session.browser-tab-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.content-create-files.createfile-1.json b/mobile/rpc-foundation/goldens/matrix-session.content-create-files.createfile-1.json index a5ca54c6d426..f5f1a42c141b 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.content-create-files.createfile-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.content-create-files.createfile-1.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.content-create-files.open-1.json b/mobile/rpc-foundation/goldens/matrix-session.content-create-files.open-1.json index 44de88f38237..4fc2a9a6a70b 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.content-create-files.open-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.content-create-files.open-1.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.content-create-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-session.content-create-status.get-1.json index 5cfb4c0388aa..a2b045ea2741 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.content-create-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.content-create-status.get-1.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.content-create-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-session.content-create-worktree.show-1.json index 8ccbb539e5c3..3c93c5850f6d 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.content-create-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.content-create-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.create-terminal-session.tabs.createterminal-1.json b/mobile/rpc-foundation/goldens/matrix-session.create-terminal-session.tabs.createterminal-1.json index fec627b879a7..301aba46f387 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.create-terminal-session.tabs.createterminal-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.create-terminal-session.tabs.createterminal-1.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/matrix-session.create-terminal-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.create-terminal-terminal.send-1.json index 298adc1fd190..a5b78204514e 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.create-terminal-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.create-terminal-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-notes-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-notes-worktree.show-1.json index f79bfbbc9dbd..250a9e128c3c 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-notes-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-notes-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "session.diff-notes", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-actions-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-actions-worktree.set-1.json index 5b2fe3a57786..e7b9015c59d8 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-actions-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-actions-worktree.set-1.json @@ -3,7 +3,7 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-base-ref-show.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-base-ref-show.json index 8fecc94c5bc1..501976ecc146 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-base-ref-show.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-base-ref-show.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.branchcompare-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.branchcompare-1.json index a2f96d210d49..8fc3fe1fd419 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.branchcompare-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.branchcompare-1.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.status-1.json index 692967ede256..fda5a92cfb41 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-git.status-1.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-repo.list-1.json index 22dd9acc3692..015d2cc0a139 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-repo.list-1.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.diff-review-review-show.json b/mobile/rpc-foundation/goldens/matrix-session.diff-review-review-show.json index 742924867bf2..8b53cc35b211 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.diff-review-review-show.json +++ b/mobile/rpc-foundation/goldens/matrix-session.diff-review-review-show.json @@ -3,7 +3,7 @@ "family": "session.diff-review", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-files.read-1.json b/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-files.read-1.json index d284eca5984a..e04c8b3ee7e8 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-files.read-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-files.read-1.json @@ -3,7 +3,7 @@ "family": "session.markdown-disk-fallback", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-markdown.readtab-1.json b/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-markdown.readtab-1.json index d070a4045a1d..e34993cefcf3 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-markdown.readtab-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.markdown-disk-fallback-markdown.readtab-1.json @@ -3,7 +3,7 @@ "family": "session.markdown-disk-fallback", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.markdown-save-markdown.savetab-1.json b/mobile/rpc-foundation/goldens/matrix-session.markdown-save-markdown.savetab-1.json index edd06be04501..f9d5c2d67787 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.markdown-save-markdown.savetab-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.markdown-save-markdown.savetab-1.json @@ -3,7 +3,7 @@ "family": "session.markdown-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.readsession-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.readsession-1.json index 0c86e7a752c3..63577bc9c284 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.readsession-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.readsession-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-page", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "60ce67f66134d6385aa7fb47f2135436a7b3ce0221e3b2514bea65e06dba5518", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-1-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-1-1.json index 9145e1b22ca5..b4aa358c816e 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-1-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-1-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-page", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "60ce67f66134d6385aa7fb47f2135436a7b3ce0221e3b2514bea65e06dba5518", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-2-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-2-1.json index d55f04de28af..9b429d1aec6d 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-2-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-page-nativechat.subscribe-2-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-page", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "60ce67f66134d6385aa7fb47f2135436a7b3ce0221e3b2514bea65e06dba5518", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-readability-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-readability-repo.list-1.json index 70d62a56811e..88889306408e 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-readability-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-readability-repo.list-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-readability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-orchestration.workerterminaluserinput-1.json index c1baafc684e8..ec3e90d6492d 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-1.json index f4be308503af..7c71d3750a39 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-2.json b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-2.json index ca1f9ce13dbe..efed2de7e0b9 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-2.json +++ b/mobile/rpc-foundation/goldens/matrix-session.native-chat-stop-terminal.send-2.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.branchcompare-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.branchcompare-1.json index a51a2d5dd12b..4578ecc3ad36 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.branchcompare-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.branchcompare-1.json @@ -3,7 +3,7 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.status-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.status-1.json index 3cae83bcc9e7..801140db7270 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-git.status-1.json @@ -3,7 +3,7 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-repo.list-1.json index 16d9172aae1c..24a2b9b0d4c9 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-repo.list-1.json @@ -3,7 +3,7 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-worktree.show-1.json index 8e9c61ff5a79..7c9de5929c30 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-branch-context-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prchecks-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prchecks-1.json index db4488562903..5537e82363f1 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prchecks-1.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prforbranch-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prforbranch-1.json index 37076b4d27b1..7102357f0fec 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prforbranch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-github.prforbranch-1.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-hostedreview.forbranch-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-hostedreview.forbranch-1.json index a8e8b1fda9a9..c05867fa10f6 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-hostedreview.forbranch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-hostedreview.forbranch-1.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-worktree.show-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-worktree.show-1.json index 096afff3ad43..edb26846e0d4 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-worktree.show-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-sidebar-worktree.show-1.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-agent.launchreplay-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-agent.launchreplay-1.json index d8c4acda08a8..7cb300eb4112 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-agent.launchreplay-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-agent.launchreplay-1.json @@ -3,7 +3,7 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-preflight.detectagents-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-preflight.detectagents-1.json index 49674829a77b..fcb3330b818f 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-preflight.detectagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-preflight.detectagents-1.json @@ -3,7 +3,7 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-repo.list-1.json index e509c2f8eacb..d3f6bbcbd6ab 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-repo.list-1.json @@ -3,7 +3,7 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-settings.get-1.json index 5aa2ac949f8d..793cb1435cb1 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.pr-triage-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.pr-triage-settings.get-1.json @@ -3,7 +3,7 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-branch-diff-git.branchdiff-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-branch-diff-git.branchdiff-1.json index 202974916ecc..32770529f332 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-branch-diff-git.branchdiff-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-branch-diff-git.branchdiff-1.json @@ -3,7 +3,7 @@ "family": "session.review-branch-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-1.json index ddce30f62073..79dcf7b791ff 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-1.json @@ -3,7 +3,7 @@ "family": "session.review-file-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-2.json b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-2.json index 98445d79d7cf..a15faee5c952 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-2.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-2.json @@ -3,7 +3,7 @@ "family": "session.review-file-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-3.json b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-3.json index aaecef28a47e..90b7d3421647 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-3.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-file-diff-git.diff-3.json @@ -3,7 +3,7 @@ "family": "session.review-file-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.discard-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.discard-1.json index f1ed4ede3492..add506aecc9c 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.discard-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.discard-1.json @@ -3,7 +3,7 @@ "family": "session.review-git-mutations", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-1.json index adab151675ca..d79b2df09c76 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-1.json @@ -3,7 +3,7 @@ "family": "session.review-git-mutations", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json index 2088f1a68736..affdd0974f51 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-git-mutations-git.stage-2.json @@ -3,7 +3,7 @@ "family": "session.review-git-mutations", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/matrix-session.review-send-sheet-session.tabs.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.review-send-sheet-session.tabs.list-1.json index c8a098ebd1de..8e429ea6b72f 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.review-send-sheet-session.tabs.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.review-send-sheet-session.tabs.list-1.json @@ -3,7 +3,7 @@ "family": "session.review-send-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-1.json b/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-1.json index 9e73c7944750..e6122841e480 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-1.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-2.json b/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-2.json index 9cceccbbca98..4e2a55ecc117 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-2.json +++ b/mobile/rpc-foundation/goldens/matrix-session.startup-worktree.activate-2.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-activation-session.tabs.activate-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-activation-session.tabs.activate-1.json index 9c18b6bdac57..7c1275889513 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-activation-session.tabs.activate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-activation-session.tabs.activate-1.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-activation-terminal.focus-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-activation-terminal.focus-1.json index ba95e6b4929f..8c00e200a5bc 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-activation-terminal.focus-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-activation-terminal.focus-1.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-close-session-session.tabs.close-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-close-session-session.tabs.close-1.json index 47641477c4cd..6cfee9aa3e2e 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-close-session-session.tabs.close-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-close-session-session.tabs.close-1.json @@ -3,7 +3,7 @@ "family": "session.tab-close-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-close-terminal.close-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-close-terminal.close-1.json index 977ff3841f0a..77844549a7c6 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-close-terminal.close-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-close-terminal.close-1.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-documents-markdown.readtab-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-documents-markdown.readtab-1.json index f47e18d311aa..80c376c3ea6e 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-documents-markdown.readtab-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-documents-markdown.readtab-1.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-rename-terminal.rename-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-rename-terminal.rename-1.json index a58857328443..64a564d7fa5e 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-rename-terminal.rename-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-rename-terminal.rename-1.json @@ -3,7 +3,7 @@ "family": "session.tab-rename", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json index cd84ae0abe6f..c6bb3eca2ee7 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.activate-1.json @@ -3,7 +3,7 @@ "family": "session.tab-reveal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json index 8b0befd6e0de..be97568a3b3c 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tab-reveal-session.tabs.list-1.json @@ -3,7 +3,7 @@ "family": "session.tab-reveal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-session.tabs-stream-health-session.tabs.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.tabs-stream-health-session.tabs.list-1.json index 404188bcf84a..3d0e30b909e9 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.tabs-stream-health-session.tabs.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.tabs-stream-health-session.tabs.list-1.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-display-mode-terminal.setdisplaymode-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-display-mode-terminal.setdisplaymode-1.json index f61034b9179b..cf8cb3ea08bf 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-display-mode-terminal.setdisplaymode-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-display-mode-terminal.setdisplaymode-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-orchestration.workerterminaluserinput-1.json index 44dab067c503..a91abecbfec7 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-gesture-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9d119d5ec320e2538105d6ff673b9f4b8e3decbe46527947489dffbcf2ac0472", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.clearbuffer-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.clearbuffer-1.json index 2017c3d2293c..9a73b8cb753a 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.clearbuffer-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.clearbuffer-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-gesture-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9d119d5ec320e2538105d6ff673b9f4b8e3decbe46527947489dffbcf2ac0472", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.send-1.json index ea57143fce58..5e7fe880f0c6 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-gesture-input-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-gesture-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9d119d5ec320e2538105d6ff673b9f4b8e3decbe46527947489dffbcf2ac0472", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-orchestration.workerterminaluserinput-1.json index 32d753e4d37e..f50d92b65004 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-terminal.send-1.json index 1fc9c0d763d0..b1214f83f76f 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-input-send-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-inventory-terminal.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-inventory-terminal.list-1.json index c31a784f8fa7..9d938aafb56f 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-inventory-terminal.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-inventory-terminal.list-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-orchestration.workerterminaluserinput-1.json index d22fb0fdc640..7c10f98cf150 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-settings.get-1.json index 506014b1006b..fd21bdcd9e39 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-settings.get-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-terminal.send-1.json index 286180c735bc..1f4bcaf11fa2 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.terminal-paste-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-repo.list-1.json index 95f4b417020a..2b9f88e97673 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-repo.list-1.json @@ -3,7 +3,7 @@ "family": "session.worktree-connection", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-settings.get-1.json index 60cfe697dbbd..5fc76824eb16 100644 --- a/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-session.worktree-connection-settings.get-1.json @@ -3,7 +3,7 @@ "family": "session.worktree-connection", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-preflight.detectremoteagents-1.json b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-preflight.detectremoteagents-1.json index 397713fe1265..b1a05557a62c 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-preflight.detectremoteagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-preflight.detectremoteagents-1.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-repo.list-1.json index 4e767dd1a337..aed8cd2f466c 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-repo.list-1.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-settings.get-1.json index cea0626169fc..58eaf3c62c8b 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings-agent-read-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings-agent-read-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings-best-effort-settings.update-1.json b/mobile/rpc-foundation/goldens/matrix-settings-best-effort-settings.update-1.json index fd1810fc815f..019b7bf7860e 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings-best-effort-settings.update-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings-best-effort-settings.update-1.json @@ -3,7 +3,7 @@ "family": "settings-best-effort", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.bot-overrides-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.bot-overrides-settings.get-1.json index 9da2716daf33..b29402a60a39 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.bot-overrides-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.bot-overrides-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-linear.status-1.json b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-linear.status-1.json index 038768002943..b513a25ec2e0 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-linear.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-linear.status-1.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-preflight.check-1.json b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-preflight.check-1.json index 00fbe373437c..3357d1ad059d 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-preflight.check-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-preflight.check-1.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-settings.get-1.json index 4ec63277e7b3..697bd7a56dc9 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.home-providers-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.home-providers-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-preflight.detectagents-1.json b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-preflight.detectagents-1.json index 60b06fdff096..5271ca6e7114 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-preflight.detectagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-preflight.detectagents-1.json @@ -3,7 +3,7 @@ "family": "settings.new-tab-local-agents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-repo.list-1.json index 62132561c941..1fa58694ab90 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-repo.list-1.json @@ -3,7 +3,7 @@ "family": "settings.new-tab-local-agents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-settings.get-1.json index 5451b05d18fa..0413b5312f07 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.new-tab-local-agents-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.new-tab-local-agents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.getterminalquickcommands-1.json b/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.getterminalquickcommands-1.json index 89782795dafb..781c4453fb3d 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.getterminalquickcommands-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.getterminalquickcommands-1.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.updateterminalquickcommands-1.json b/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.updateterminalquickcommands-1.json index b73c3a1f849c..ed8b968d466c 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.updateterminalquickcommands-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.quick-commands-settings.updateterminalquickcommands-1.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-host.platform-1.json b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-host.platform-1.json index 75d9f21869d0..22f64f961aae 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-host.platform-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-host.platform-1.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-repo.list-1.json index 07523015bbcc..850aad0c45bf 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-repo.list-1.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-settings.get-1.json index e09d27b0474d..4cc0de8e3c1a 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-ssh.listtargetsummaries-1.json b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-ssh.listtargetsummaries-1.json index b7ebb1568e87..210ae740e67f 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-ssh.listtargetsummaries-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.repo-metadata-ssh.listtargetsummaries-1.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-folderworkspace.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-folderworkspace.list-1.json index 3e2592a3ac35..18f97a13d2b5 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-folderworkspace.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-folderworkspace.list-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-projectgroup.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-projectgroup.list-1.json index 8dd1dca24e12..58aa1c29348f 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-projectgroup.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-projectgroup.list-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-repo.list-1.json index ed55d3d1d924..f105cd29f963 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-repo.list-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-settings.get-1.json index 52ac338f82f5..4680068df631 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-worktree.ps-1.json b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-worktree.ps-1.json index 85b57c953e80..4e83e3a031b0 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-worktree.ps-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.resume-metadata-worktree.ps-1.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-linear.status-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-linear.status-1.json index 0dc0ce5cc96a..4f1e509abb08 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-linear.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-linear.status-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-preflight.check-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-preflight.check-1.json index 4cb11452989b..c268b5e77fd0 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-preflight.check-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-preflight.check-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-settings.get-1.json index 66a4bef76dd2..981d619a412c 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-status.get-1.json index fefa73e4d26d..627a85f4dd2c 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-status.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-ui.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-ui.get-1.json index 473d944a4264..39f6361a0ea5 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-ui.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-hydration-ui.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-settings.get-1.json index a2043d110523..2cf32bbcfd43 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-worktree.create-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-worktree.create-1.json index 0ef8104890fe..9178ad4f5e64 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-worktree.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-create-worktree.create-1.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-settings.get-1.json index 2d1d3bf86dc4..f8027c550d19 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.task-workspace-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-linear.status-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-linear.status-1.json index 7aeed9bed047..aadc58bbff9c 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-linear.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-linear.status-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-preflight.check-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-preflight.check-1.json index 8efd8dec7ecf..96657659b8eb 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-preflight.check-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-preflight.check-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-settings.get-1.json index 02f6a42e0c04..0fd556516d54 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-ui.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-ui.get-1.json index 77d12ae27d1d..8f41fad96370 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-ui.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-context-ui.get-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/matrix-settings.workspace-submit-settings.get-1.json b/mobile/rpc-foundation/goldens/matrix-settings.workspace-submit-settings.get-1.json index 16ffdd39382f..d537ef9a2735 100644 --- a/mobile/rpc-foundation/goldens/matrix-settings.workspace-submit-settings.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-settings.workspace-submit-settings.get-1.json @@ -3,7 +3,7 @@ "family": "settings.workspace-submit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-chunk-speech.dictation.chunk-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-chunk-speech.dictation.chunk-1.json index cae4f6c8a6c2..abb97747284b 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-chunk-speech.dictation.chunk-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-chunk-speech.dictation.chunk-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-chunk", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.finish-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.finish-1.json index b9510ec635a2..8e9554098bb0 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.finish-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.finish-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.start-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.start-1.json index 522399376898..1b59a18276f4 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.start-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-session-speech.dictation.start-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.cancel-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.cancel-1.json index ff3ed7f91ec2..8db821475d58 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.cancel-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.cancel-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.start-1.json b/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.start-1.json index dcab290e4d8d..8f8cdc5dd82b 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.start-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.dictation-start-speech.dictation.start-1.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.dictation.setup-1.json b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.dictation.setup-1.json index f89d9e16871b..5fbae8a9192d 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.dictation.setup-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.dictation.setup-1.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.delete-1.json b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.delete-1.json index b2735a96daff..fb85e5e7d790 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.delete-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.delete-1.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.download-1.json b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.download-1.json index 8423a565108f..c1fd7934eade 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.download-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.download-1.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.list-1.json b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.list-1.json index 09a5deb80f1c..ef4e546b36fb 100644 --- a/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-speech.setup-sheet-speech.models.list-1.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.addprreviewcomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.addprreviewcomment-1.json index 4407db97ff31..5ac35183373a 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.addprreviewcomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.addprreviewcomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.prfilecontents-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.prfilecontents-1.json index aec93d1a133b..f6ddc37e0f74 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.prfilecontents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.prfilecontents-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.rerunprchecks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.rerunprchecks-1.json index 5d4e010a551b..9a921f60ec5f 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.rerunprchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.rerunprchecks-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.resolvereviewthread-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.resolvereviewthread-1.json index 75e7284e2ac9..66661fdfe92a 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.resolvereviewthread-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.resolvereviewthread-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.setprfileviewed-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.setprfileviewed-1.json index b9b3901bf1b6..fb73ddfdf912 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.setprfileviewed-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-checks-files-github.setprfileviewed-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-github-github.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-github-github.addissuecomment-1.json index b91a7a117db0..9d268655d891 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-github-github.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-github-github.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-gitlab.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-gitlab.addissuecomment-1.json index bcdc8c570174..e898469e7654 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-gitlab.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-gitlab.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-mr-gitlab.addmrcomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-mr-gitlab.addmrcomment-1.json index 3ea4b1565b86..a1967b96b5be 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-mr-gitlab.addmrcomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-comment-gitlab-mr-gitlab.addmrcomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-github-github.workitemdetails-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-github-github.workitemdetails-1.json index 1f5033517652..d0aa49fbb853 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-github-github.workitemdetails-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-github-github.workitemdetails-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-gitlab-gitlab.workitemdetails-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-gitlab-gitlab.workitemdetails-1.json index cebe79fac8c6..b13a5344e8ce 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-gitlab-gitlab.workitemdetails-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-gitlab-gitlab.workitemdetails-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.getissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.getissue-1.json index 479b6bb3cb73..82147afb79a3 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.getissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.getissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.issuecomments-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.issuecomments-1.json index 692c92b4a957..837399280345 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.issuecomments-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-linear-linear.issuecomments-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listassignableusers-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listassignableusers-1.json index 217259e6eea2..0bf04e347361 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listassignableusers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listassignableusers-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listlabels-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listlabels-1.json index 7ecd3c1f64a9..8a725b43c2b0 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listlabels-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-detail-metadata-github.listlabels-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-merge-gitlab-gitlab.mergemr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-merge-gitlab-gitlab.mergemr-1.json index 8598bb2eb902..f078de637465 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-merge-gitlab-gitlab.mergemr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-merge-gitlab-gitlab.mergemr-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-merge-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-github-github.updatepr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-github-github.updatepr-1.json index 091a41ca2bea..07caea1146cb 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-github-github.updatepr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-github-github.updatepr-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-gitlab.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-gitlab.updateissue-1.json index 993dcc5bc056..ad5b2516e9ae 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-gitlab.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-gitlab.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-mr-gitlab.updatemr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-mr-gitlab.updatemr-1.json index 0365dac61b3c..93e2a9c01385 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-mr-gitlab.updatemr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-metadata-gitlab-mr-gitlab.updatemr-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addissuecomment-1.json index 54bb28c24d92..a3190dbd8f3f 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addprreviewcommentreply-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addprreviewcommentreply-1.json index d942b505dd7f..59f6fc744dcf 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addprreviewcommentreply-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.addprreviewcommentreply-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.mergepr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.mergepr-1.json index 262ac06aa9f6..7e924dee5603 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.mergepr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-github.mergepr-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-linear.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-linear.updateissue-1.json index 3706568bc118..aa1f2f09e61e 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-linear.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-reply-merge-linear.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.prchecks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.prchecks-1.json index 9e9f3fdc9699..8af1b976c2e3 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.prchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.prchecks-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-review-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.requestprreviewers-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.requestprreviewers-1.json index fab6368f1cc3..22163e9d2ebf 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.requestprreviewers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-review-github-github.requestprreviewers-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-review-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-github.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-github.updateissue-1.json index 201345362fab..3ddb6d68b538 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-github.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-github.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-gitlab.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-gitlab.updateissue-1.json index de8d7b29d9c1..931029323417 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-gitlab.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-gitlab.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-mr-gitlab.updatemrstate-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-mr-gitlab.updatemrstate-1.json index 2313bcada882..ff43beb630c7 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-mr-gitlab.updatemrstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.item-status-gitlab-mr-gitlab.updatemrstate-1.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-connect-linear.connect-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-connect-linear.connect-1.json index e63fb9d9ec31..58deb7a6c841 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-connect-linear.connect-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-connect-linear.connect-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-connect", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.addissuecomment-1.json index 3dc191ea2365..79dc781dee0d 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-item", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.createissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.createissue-1.json index 42a8a9da83e2..e4e48b2582c2 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.createissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.createissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-item", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.getissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.getissue-1.json index 8c86d3699a33..21bd3a72283a 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.getissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-item-linear.getissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-item", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.listteams-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.listteams-1.json index c890e39d3b51..5728d801bfdc 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.listteams-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.listteams-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-team-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.teamstates-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.teamstates-1.json index 9e03b251fad8..b466b490213f 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.teamstates-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.linear-team-context-linear.teamstates-1.json @@ -3,7 +3,7 @@ "family": "tasks.linear-team-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.reposlug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.reposlug-1.json index 931ea2fade2c..810768d84b26 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.reposlug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.reposlug-1.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitem-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitem-1.json index 637173184022..400112c00cb4 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitem-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitem-1.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitembyownerrepo-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitembyownerrepo-1.json index dc0d62a270bb..11d0eab7074e 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitembyownerrepo-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-github.workitembyownerrepo-1.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-gitlab.workitembypath-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-gitlab.workitembypath-1.json index 73bc0b32d4e4..427f4b93c046 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-gitlab.workitembypath-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.paste-lookup-gitlab.workitembypath-1.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json index 74ea4e9fe248..26c3fe0e2cfb 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listaccessible-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json index ebf2dd2af6f8..9747f14435c9 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json index d48ef4e13a85..049aa7f2a329 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.listviews-2.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json index 52bdefcb2e6d..6e56719868f7 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.resolveref-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json index fe298fad20b2..75a2aab11dc9 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-board-load-github.project.viewtable-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-repo-slugs-github.reposlug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-repo-slugs-github.reposlug-1.json index a103ef69b393..869b299858cd 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-repo-slugs-github.reposlug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-repo-slugs-github.reposlug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-repo-slugs", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.addissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.addissuecommentbyslug-1.json index d44e17060342..2a8b844acb04 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.addissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.addissuecommentbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-issue", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuebyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuebyslug-1.json index bfe8fbaa0965..64bff9f06bb0 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuebyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuebyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-issue", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuecommentbyslug-1.json index 839d2b79d001..eed0fd8f95e8 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-issue-github.project.updateissuecommentbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-issue", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-pr-github.project.updatepullrequestbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-pr-github.project.updatepullrequestbyslug-1.json index 3af7b7c0fcbc..2683eefce2c6 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-pr-github.project.updatepullrequestbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-comments-pr-github.project.updatepullrequestbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-pr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-detail-github.project.workitemdetailsbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-detail-github.project.workitemdetailsbyslug-1.json index 6952ea391c11..82a9c9657192 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-detail-github.project.workitemdetailsbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-detail-github.project.workitemdetailsbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-detail", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.clearitemfield-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.clearitemfield-1.json index 9443a4e4e590..4720e2300ef4 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.clearitemfield-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.clearitemfield-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-fields", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateissuetypebyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateissuetypebyslug-1.json index c9b7ebe5dd98..d20f5e2f7ef2 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateissuetypebyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateissuetypebyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-fields", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateitemfield-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateitemfield-1.json index 9ca91ae714f8..f44b7d8524d8 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateitemfield-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-fields-github.project.updateitemfield-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-fields", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.addprreviewcomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.addprreviewcomment-1.json index 7f2ccefaff31..1dca0b1ce704 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.addprreviewcomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.addprreviewcomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.mergepr-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.mergepr-1.json index 95a5d3f8d708..a45018204e3d 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.mergepr-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.mergepr-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.prfilecontents-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.prfilecontents-1.json index e2ca43b1f7ed..fcc8971a6a8f 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.prfilecontents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.prfilecontents-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateissue-1.json index 054bbe2bbe69..1d277c901f81 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateprstate-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateprstate-1.json index 343ed063a81d..100f1dc72fff 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateprstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-files-merge-github.updateprstate-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listassignableusersbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listassignableusersbyslug-1.json index e7063174ca8b..dcec771e5a3b 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listassignableusersbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listassignableusersbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-metadata-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listissuetypesbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listissuetypesbyslug-1.json index e6e41eb79ea4..2924a6e6c719 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listissuetypesbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listissuetypesbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-metadata-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listlabelsbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listlabelsbyslug-1.json index 49d83e4c5e14..6a14216104fa 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listlabelsbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-metadata-load-github.project.listlabelsbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-metadata-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.prchecks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.prchecks-1.json index c9d08c7b4904..1da8e7e377ba 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.prchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.prchecks-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.requestprreviewers-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.requestprreviewers-1.json index 923aaa358eb7..0b8309956a09 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.requestprreviewers-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.requestprreviewers-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.rerunprchecks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.rerunprchecks-1.json index edcc72154244..3f3b07d7f992 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.rerunprchecks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.rerunprchecks-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.setprfileviewed-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.setprfileviewed-1.json index 522877d7d81c..c81dbc72713a 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.setprfileviewed-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-review-checks-github.setprfileviewed-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addissuecomment-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addissuecomment-1.json index b52daff4a4f6..743274c20be9 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addissuecomment-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addissuecomment-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addprreviewcommentreply-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addprreviewcommentreply-1.json index bc67329ebf26..244c36f18bef 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addprreviewcommentreply-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.addprreviewcommentreply-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.project.deleteissuecommentbyslug-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.project.deleteissuecommentbyslug-1.json index c05895e52dd8..8ce3d502001e 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.project.deleteissuecommentbyslug-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.project.deleteissuecommentbyslug-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.resolvereviewthread-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.resolvereviewthread-1.json index 05f4e492aa9f..dc1517e6e32b 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.resolvereviewthread-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.project-row-threads-github.resolvereviewthread-1.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.json index 1458e3fccf16..02beb58f0f67 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.countworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.json index 432ad890d8fd..8831bfb8fe82 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-github.listworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.json index cd4756238103..307bc0427cb9 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.listteams-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.json index c953fc2c0c9e..1e59f4bf4701 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-linear.status-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.json index 75c390b30175..bc6016bb0f97 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.provider-load-settings.update-1.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.route-repo-list-repo.list-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.route-repo-list-repo.list-1.json index 4b9a718cf8c1..1af1d818b40c 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.route-repo-list-repo.list-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.route-repo-list-repo.list-1.json @@ -3,7 +3,7 @@ "family": "tasks.route-repo-list", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "23f974df8b57c723069605de1db80c339ead286b18aae38e67fce03ea50c5180", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-github.listworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-github.listworkitems-1.json index d0c8375d5fff..8eed4e138244 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-github.listworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-github.listworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-gitlab.listworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-gitlab.listworkitems-1.json index be5a8106e913..dbaf0bfb521b 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-gitlab.listworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-gitlab.listworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.listissues-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.listissues-1.json index ab65ad2d6dc7..3b2700086f9d 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.listissues-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.listissues-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.searchissues-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.searchissues-1.json index 521c5b196104..16af661d49cd 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.searchissues-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-linear.searchissues-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-repo.searchrefs-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-repo.searchrefs-1.json index f810797ad0ea..b73d10a73ced 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-repo.searchrefs-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.smart-source-search-repo.searchrefs-1.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-github.createissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-github.createissue-1.json index 21c3b6102d05..a6d36c306f8e 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-github.createissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-github.createissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-repo.update-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-repo.update-1.json index 14d72690a4a3..ff972eb7449f 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-repo.update-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-github-repo.update-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-gitlab-gitlab.createissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-gitlab-gitlab.createissue-1.json index 4bcf523af7f0..35df73656d43 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-gitlab-gitlab.createissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-gitlab-gitlab.createissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-linear-linear.createissue-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-linear-linear.createissue-1.json index 5c832f181095..d50335aecc3f 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-create-linear-linear.createissue-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-create-linear-linear.createissue-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-items-gitlab.listworkitems-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-items-gitlab.listworkitems-1.json index 96d94fe89b07..cb10520c34b9 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-items-gitlab.listworkitems-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-items-gitlab.listworkitems-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-gitlab-items", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-todos-gitlab.todos-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-todos-gitlab.todos-1.json index 69ec73d45763..ca43c4fd653b 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-todos-gitlab.todos-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-gitlab-todos-gitlab.todos-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-gitlab-todos", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.listissues-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.listissues-1.json index fd06d7c167ca..af56926182d8 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.listissues-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.listissues-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.searchissues-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.searchissues-1.json index bfa64ad35e69..75aeb3a962cd 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.searchissues-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.task-list-linear-linear.searchissues-1.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.searchrefs-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.searchrefs-1.json index f94ad51fb203..b4254656d45f 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.searchrefs-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.searchrefs-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-source", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.sparsepresets-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.sparsepresets-1.json index 33370383b418..361b70033cdc 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.sparsepresets-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-source-repo.sparsepresets-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-source", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-repo.savesparsepreset-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-repo.savesparsepreset-1.json index e946c8f2198e..53479f698f1e 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-repo.savesparsepreset-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-repo.savesparsepreset-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-sparse", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-ssh.getstate-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-ssh.getstate-1.json index 3c600719aed2..2b77965536d4 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-ssh.getstate-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-sparse-ssh.getstate-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-sparse", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-local-preflight.detectagents-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-local-preflight.detectagents-1.json index 15bbff4736b9..9af3002abb79 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-local-preflight.detectagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-local-preflight.detectagents-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh-local", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-preflight.detectremoteagents-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-preflight.detectremoteagents-1.json index e90ddc051349..cab57378ab5a 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-preflight.detectremoteagents-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-preflight.detectremoteagents-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-repo.hooks-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-repo.hooks-1.json index 5f61f25da60b..b05d49d4a861 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-repo.hooks-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-repo.hooks-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-ssh.connect-1.json b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-ssh.connect-1.json index ac44344dfd5d..337f7141d896 100644 --- a/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-ssh.connect-1.json +++ b/mobile/rpc-foundation/goldens/matrix-tasks.workspace-ssh-ssh.connect-1.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.query-reply-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.query-reply-terminal.send-1.json index e3305afb2d6d..59e1a75e76e3 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.query-reply-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.query-reply-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "terminal.query-reply", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-orchestration.workerterminaluserinput-1.json index 9bd2e8592bec..9a2cc35f7b32 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "terminal.raw-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-terminal.send-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-terminal.send-1.json index e88711a965a0..160e170c6050 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-terminal.send-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.raw-input-terminal.send-1.json @@ -3,7 +3,7 @@ "family": "terminal.raw-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-1.json index e7c7180a762d..6754149bda73 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-1.json @@ -3,7 +3,7 @@ "family": "terminal.takeover-report", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-2.json b/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-2.json index 231c885875e9..456a924c62d0 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-2.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.takeover-report-orchestration.workerterminaluserinput-2.json @@ -3,7 +3,7 @@ "family": "terminal.takeover-report", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-terminal.viewport-refit-terminal.updateviewport-1.json b/mobile/rpc-foundation/goldens/matrix-terminal.viewport-refit-terminal.updateviewport-1.json index fd19dde7c145..3cf51bfd2c97 100644 --- a/mobile/rpc-foundation/goldens/matrix-terminal.viewport-refit-terminal.updateviewport-1.json +++ b/mobile/rpc-foundation/goldens/matrix-terminal.viewport-refit-terminal.updateviewport-1.json @@ -3,7 +3,7 @@ "family": "terminal.viewport-refit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/matrix-transport.capability-probe-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-transport.capability-probe-status.get-1.json index 8b0f00d34da0..d8477f733f80 100644 --- a/mobile/rpc-foundation/goldens/matrix-transport.capability-probe-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-transport.capability-probe-status.get-1.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/matrix-transport.host-status-gates-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-transport.host-status-gates-status.get-1.json index 130b385ed119..f8477b7cd30a 100644 --- a/mobile/rpc-foundation/goldens/matrix-transport.host-status-gates-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-transport.host-status-gates-status.get-1.json @@ -3,7 +3,7 @@ "family": "transport.host-status-gates", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json b/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json index 987029285eac..cfcc4ff6da39 100644 --- a/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json +++ b/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-direct-status.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json b/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json index 7d12b01799f6..e7cc088517f2 100644 --- a/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json +++ b/mobile/rpc-foundation/goldens/matrix-transport.pairing-race-relay-status.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.agent-launch-create-agent.launch-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.agent-launch-create-agent.launch-1.json index 1c78ae16d267..9a804d66f48f 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.agent-launch-create-agent.launch-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.agent-launch-create-agent.launch-1.json @@ -3,7 +3,7 @@ "family": "worktree.agent-launch-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.catalog-snapshot-worktree.ps-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.catalog-snapshot-worktree.ps-1.json index 9ea63e634081..4526333c8237 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.catalog-snapshot-worktree.ps-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.catalog-snapshot-worktree.ps-1.json @@ -3,7 +3,7 @@ "family": "worktree.catalog-snapshot", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.create-retry-worktree.create-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.create-retry-worktree.create-1.json index 5ca6a3915270..286c7314ef15 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.create-retry-worktree.create-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.create-retry-worktree.create-1.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.home-catalog-worktree.ps-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.home-catalog-worktree.ps-1.json index 9b9e360cde14..aae6c3f6d6f7 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.home-catalog-worktree.ps-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.home-catalog-worktree.ps-1.json @@ -3,7 +3,7 @@ "family": "worktree.home-catalog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolvemrbase-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolvemrbase-1.json index 849ec115f436..e2021615a4a3 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolvemrbase-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolvemrbase-1.json @@ -3,7 +3,7 @@ "family": "worktree.hosted-base", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolveprbase-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolveprbase-1.json index 96a309cf8cfb..2c454d91e5e5 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolveprbase-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.hosted-base-worktree.resolveprbase-1.json @@ -3,7 +3,7 @@ "family": "worktree.hosted-base", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.retired-names-worktree.listretirednames-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.retired-names-worktree.listretirednames-1.json index 99471df513d1..069ab19c7e44 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.retired-names-worktree.listretirednames-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.retired-names-worktree.listretirednames-1.json @@ -3,7 +3,7 @@ "family": "worktree.retired-names", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.review-link-worktree.set-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.review-link-worktree.set-1.json index 700460486381..a2038eb05848 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.review-link-worktree.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.review-link-worktree.set-1.json @@ -3,7 +3,7 @@ "family": "worktree.review-link", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.runtime-capabilities-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.runtime-capabilities-status.get-1.json index f00cb36ffe96..ab22f058cd5f 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.runtime-capabilities-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.runtime-capabilities-status.get-1.json @@ -3,7 +3,7 @@ "family": "worktree.runtime-capabilities", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/matrix-worktree.setup-hook-trust-ui.set-1.json b/mobile/rpc-foundation/goldens/matrix-worktree.setup-hook-trust-ui.set-1.json index db230f77b3cb..fb04070a8f96 100644 --- a/mobile/rpc-foundation/goldens/matrix-worktree.setup-hook-trust-ui.set-1.json +++ b/mobile/rpc-foundation/goldens/matrix-worktree.setup-hook-trust-ui.set-1.json @@ -3,7 +3,7 @@ "family": "worktree.setup-hook-trust", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/mobile-web-bundle-build-changed.json b/mobile/rpc-foundation/goldens/mobile-web-bundle-build-changed.json index c11ee140d4ff..019d9b15aad5 100644 --- a/mobile/rpc-foundation/goldens/mobile-web-bundle-build-changed.json +++ b/mobile/rpc-foundation/goldens/mobile-web-bundle-build-changed.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/mobile-web-bundle-fetch-paged.json b/mobile/rpc-foundation/goldens/mobile-web-bundle-fetch-paged.json index 70190efa3642..c84cabb898bc 100644 --- a/mobile/rpc-foundation/goldens/mobile-web-bundle-fetch-paged.json +++ b/mobile/rpc-foundation/goldens/mobile-web-bundle-fetch-paged.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/mobile-web-bundle-manifest-read.json b/mobile/rpc-foundation/goldens/mobile-web-bundle-manifest-read.json index dcc0762fae91..53e2810822bb 100644 --- a/mobile/rpc-foundation/goldens/mobile-web-bundle-manifest-read.json +++ b/mobile/rpc-foundation/goldens/mobile-web-bundle-manifest-read.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-manifest", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/mobile-web-bundle-unavailable.json b/mobile/rpc-foundation/goldens/mobile-web-bundle-unavailable.json index f73605c72b08..ec443d062543 100644 --- a/mobile/rpc-foundation/goldens/mobile-web-bundle-unavailable.json +++ b/mobile/rpc-foundation/goldens/mobile-web-bundle-unavailable.json @@ -3,7 +3,7 @@ "family": "mobileWeb.bundle-fetch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "af339fef2c684d5709c6d3f279e5f0d9c33d17b6d4e5c89e501963400901b564", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-paste-single.json b/mobile/rpc-foundation/goldens/native-chat-image-paste-single.json index f934aa288473..5750aa66cf60 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-paste-single.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-paste-single.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-paste-stops-on-rejection.json b/mobile/rpc-foundation/goldens/native-chat-image-paste-stops-on-rejection.json index 0f39c92ab9d2..dc80fd6650e7 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-paste-stops-on-rejection.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-paste-stops-on-rejection.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-paste-trailing-image.json b/mobile/rpc-foundation/goldens/native-chat-image-paste-trailing-image.json index 0b8bb809580a..fc45d428da41 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-paste-trailing-image.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-paste-trailing-image.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-paste-two-images.json b/mobile/rpc-foundation/goldens/native-chat-image-paste-two-images.json index bce6493283e3..044c0be53321 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-paste-two-images.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-paste-two-images.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-cancelled.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-cancelled.json index 1074bd2f3907..94da28329dad 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-cancelled.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-cancelled.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.json index 7115e1b0ea1d..9aa0b7cea3e2 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-single.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-single.json index cf18ef24a043..1f339ad76fad 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-single.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-single.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-start-refused.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-start-refused.json index 42628ce2bd70..95586c30d054 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-start-refused.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-start-refused.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-image-upload-two.json b/mobile/rpc-foundation/goldens/native-chat-image-upload-two.json index eed5822bd38e..bf8084aa951c 100644 --- a/mobile/rpc-foundation/goldens/native-chat-image-upload-two.json +++ b/mobile/rpc-foundation/goldens/native-chat-image-upload-two.json @@ -3,7 +3,7 @@ "family": "nativeChat.image-upload", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "16779b663f4faec8cbccdb42efd7b568a2912845b161f8a4827754687eb4235c", diff --git a/mobile/rpc-foundation/goldens/native-chat-page-earlier.json b/mobile/rpc-foundation/goldens/native-chat-page-earlier.json index fdbf4e6cb296..8eaf7296068a 100644 --- a/mobile/rpc-foundation/goldens/native-chat-page-earlier.json +++ b/mobile/rpc-foundation/goldens/native-chat-page-earlier.json @@ -3,7 +3,7 @@ "family": "session.native-chat-page", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "60ce67f66134d6385aa7fb47f2135436a7b3ce0221e3b2514bea65e06dba5518", diff --git a/mobile/rpc-foundation/goldens/native-chat-readability-local-repo.json b/mobile/rpc-foundation/goldens/native-chat-readability-local-repo.json index dfea737f9e29..cd84dadae001 100644 --- a/mobile/rpc-foundation/goldens/native-chat-readability-local-repo.json +++ b/mobile/rpc-foundation/goldens/native-chat-readability-local-repo.json @@ -3,7 +3,7 @@ "family": "session.native-chat-readability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-readability-refused.json b/mobile/rpc-foundation/goldens/native-chat-readability-refused.json index 82e7ce1df095..2b14e1cf7172 100644 --- a/mobile/rpc-foundation/goldens/native-chat-readability-refused.json +++ b/mobile/rpc-foundation/goldens/native-chat-readability-refused.json @@ -3,7 +3,7 @@ "family": "session.native-chat-readability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-readability-remote-repo.json b/mobile/rpc-foundation/goldens/native-chat-readability-remote-repo.json index 63174dde0ff7..697560982a89 100644 --- a/mobile/rpc-foundation/goldens/native-chat-readability-remote-repo.json +++ b/mobile/rpc-foundation/goldens/native-chat-readability-remote-repo.json @@ -3,7 +3,7 @@ "family": "session.native-chat-readability", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-empty.json b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-empty.json index bdfaaf078f11..9df01ea45688 100644 --- a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-empty.json +++ b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-empty.json @@ -3,7 +3,7 @@ "family": "nativeChat.session-option-pick", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-refused.json b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-refused.json index 069b6d69e2d7..f295cb8c9a0b 100644 --- a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-refused.json +++ b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-refused.json @@ -3,7 +3,7 @@ "family": "nativeChat.session-option-pick", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-written.json b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-written.json index 5c62652b35fa..4012a927f306 100644 --- a/mobile/rpc-foundation/goldens/native-chat-session-option-pick-written.json +++ b/mobile/rpc-foundation/goldens/native-chat-session-option-pick-written.json @@ -3,7 +3,7 @@ "family": "nativeChat.session-option-pick", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-stop-accepted.json b/mobile/rpc-foundation/goldens/native-chat-stop-accepted.json index c6404815bb3d..6c2ef2da6238 100644 --- a/mobile/rpc-foundation/goldens/native-chat-stop-accepted.json +++ b/mobile/rpc-foundation/goldens/native-chat-stop-accepted.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-stop-both-rejected.json b/mobile/rpc-foundation/goldens/native-chat-stop-both-rejected.json index 780a884a188b..296d4d7b349c 100644 --- a/mobile/rpc-foundation/goldens/native-chat-stop-both-rejected.json +++ b/mobile/rpc-foundation/goldens/native-chat-stop-both-rejected.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-stop-delivery-unknown.json b/mobile/rpc-foundation/goldens/native-chat-stop-delivery-unknown.json index 0838364830d6..1366bae9a1be 100644 --- a/mobile/rpc-foundation/goldens/native-chat-stop-delivery-unknown.json +++ b/mobile/rpc-foundation/goldens/native-chat-stop-delivery-unknown.json @@ -3,7 +3,7 @@ "family": "session.native-chat-stop", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-accepted.json b/mobile/rpc-foundation/goldens/native-chat-write-accepted.json index 5228ed6c3a74..e2e98cfebd42 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-accepted.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-accepted.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-clear-line.json b/mobile/rpc-foundation/goldens/native-chat-write-clear-line.json index b3b7b21e1d8e..bb10f158648a 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-clear-line.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-clear-line.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-delivery-unknown.json b/mobile/rpc-foundation/goldens/native-chat-write-delivery-unknown.json index 5ef0e31f3c43..8653789f0e54 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-delivery-unknown.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-delivery-unknown.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-rejected.json b/mobile/rpc-foundation/goldens/native-chat-write-rejected.json index d8d9ad5cd338..8b9726edd6e8 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-rejected.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-rejected.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/native-chat-write-typed-command.json b/mobile/rpc-foundation/goldens/native-chat-write-typed-command.json index 927f2e222e2d..d5232fa46cf0 100644 --- a/mobile/rpc-foundation/goldens/native-chat-write-typed-command.json +++ b/mobile/rpc-foundation/goldens/native-chat-write-typed-command.json @@ -3,7 +3,7 @@ "family": "nativeChat.terminal-write", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b98a3ca3818678b88cf629bc4635300a103637126a136f025a1600dc16f08008", diff --git a/mobile/rpc-foundation/goldens/new-tab-local-agents.json b/mobile/rpc-foundation/goldens/new-tab-local-agents.json index b07cb0d02ccd..a456b5350039 100644 --- a/mobile/rpc-foundation/goldens/new-tab-local-agents.json +++ b/mobile/rpc-foundation/goldens/new-tab-local-agents.json @@ -3,7 +3,7 @@ "family": "settings.new-tab-local-agents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/new-workspace-repositories-fulfilled.json b/mobile/rpc-foundation/goldens/new-workspace-repositories-fulfilled.json index 71b41beb8e41..6c076c3555f5 100644 --- a/mobile/rpc-foundation/goldens/new-workspace-repositories-fulfilled.json +++ b/mobile/rpc-foundation/goldens/new-workspace-repositories-fulfilled.json @@ -3,7 +3,7 @@ "family": "components.new-workspace-repositories", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "64c1772f0f95a3c43fbb14398a8804b2b4784f7f18874e4fd79767ae634c7faa", diff --git a/mobile/rpc-foundation/goldens/notifications-desktop-stream-closed.json b/mobile/rpc-foundation/goldens/notifications-desktop-stream-closed.json index b48df7e7da29..4cc144feba8a 100644 --- a/mobile/rpc-foundation/goldens/notifications-desktop-stream-closed.json +++ b/mobile/rpc-foundation/goldens/notifications-desktop-stream-closed.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/notifications-desktop-stream-replayed.json b/mobile/rpc-foundation/goldens/notifications-desktop-stream-replayed.json index d1f2d80cd581..ec67928b9837 100644 --- a/mobile/rpc-foundation/goldens/notifications-desktop-stream-replayed.json +++ b/mobile/rpc-foundation/goldens/notifications-desktop-stream-replayed.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/notifications-desktop-stream.json b/mobile/rpc-foundation/goldens/notifications-desktop-stream.json index eb1dc29e84d6..5ae2f8256bde 100644 --- a/mobile/rpc-foundation/goldens/notifications-desktop-stream.json +++ b/mobile/rpc-foundation/goldens/notifications-desktop-stream.json @@ -3,7 +3,7 @@ "family": "notifications.desktop-stream", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "eacf859143588ae6bee2804975d642b6c1088d57ae77ffe298620250d9a9f0e4", diff --git a/mobile/rpc-foundation/goldens/notifications-display-test-accepted.json b/mobile/rpc-foundation/goldens/notifications-display-test-accepted.json index b2b379a3fdd0..64e2c8c1cd94 100644 --- a/mobile/rpc-foundation/goldens/notifications-display-test-accepted.json +++ b/mobile/rpc-foundation/goldens/notifications-display-test-accepted.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/notifications-display-test-not-registered.json b/mobile/rpc-foundation/goldens/notifications-display-test-not-registered.json index 6f6eca1bd325..e255279ddc79 100644 --- a/mobile/rpc-foundation/goldens/notifications-display-test-not-registered.json +++ b/mobile/rpc-foundation/goldens/notifications-display-test-not-registered.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/notifications-display-test-rate-limited.json b/mobile/rpc-foundation/goldens/notifications-display-test-rate-limited.json index edc61beb60ca..6495277b7c71 100644 --- a/mobile/rpc-foundation/goldens/notifications-display-test-rate-limited.json +++ b/mobile/rpc-foundation/goldens/notifications-display-test-rate-limited.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/notifications-display-test-unknown-reason.json b/mobile/rpc-foundation/goldens/notifications-display-test-unknown-reason.json index d705ad25f9b1..16673d735330 100644 --- a/mobile/rpc-foundation/goldens/notifications-display-test-unknown-reason.json +++ b/mobile/rpc-foundation/goldens/notifications-display-test-unknown-reason.json @@ -3,7 +3,7 @@ "family": "notifications.display-test-screen", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f55275c268e49679b37d72ce6cbe71186ce02c77fe3fd53f0f21e796502d62e8", diff --git a/mobile/rpc-foundation/goldens/notifications-push-gateway-rejected.json b/mobile/rpc-foundation/goldens/notifications-push-gateway-rejected.json index fa92cf8b9025..4a85cc3448ff 100644 --- a/mobile/rpc-foundation/goldens/notifications-push-gateway-rejected.json +++ b/mobile/rpc-foundation/goldens/notifications-push-gateway-rejected.json @@ -3,7 +3,7 @@ "family": "notifications.push-registration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2e3d939dc162dbc5a38d8a7207111688204a825fd70348721917b3016e1c9470", diff --git a/mobile/rpc-foundation/goldens/notifications-push-registered.json b/mobile/rpc-foundation/goldens/notifications-push-registered.json index f49f196bb93c..85817d1e1752 100644 --- a/mobile/rpc-foundation/goldens/notifications-push-registered.json +++ b/mobile/rpc-foundation/goldens/notifications-push-registered.json @@ -3,7 +3,7 @@ "family": "notifications.push-registration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "2e3d939dc162dbc5a38d8a7207111688204a825fd70348721917b3016e1c9470", diff --git a/mobile/rpc-foundation/goldens/pairing-pre-profile-direct-wins-and-provisions.json b/mobile/rpc-foundation/goldens/pairing-pre-profile-direct-wins-and-provisions.json index 6d9e71fefc68..92c3d0be569f 100644 --- a/mobile/rpc-foundation/goldens/pairing-pre-profile-direct-wins-and-provisions.json +++ b/mobile/rpc-foundation/goldens/pairing-pre-profile-direct-wins-and-provisions.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/pairing-pre-profile-provision-unsupported-saves-direct-host.json b/mobile/rpc-foundation/goldens/pairing-pre-profile-provision-unsupported-saves-direct-host.json index 24e83a8eb977..dbaade09b510 100644 --- a/mobile/rpc-foundation/goldens/pairing-pre-profile-provision-unsupported-saves-direct-host.json +++ b/mobile/rpc-foundation/goldens/pairing-pre-profile-provision-unsupported-saves-direct-host.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/pairing-pre-profile-times-out.json b/mobile/rpc-foundation/goldens/pairing-pre-profile-times-out.json index d662e9711822..703f2d44b8a2 100644 --- a/mobile/rpc-foundation/goldens/pairing-pre-profile-times-out.json +++ b/mobile/rpc-foundation/goldens/pairing-pre-profile-times-out.json @@ -3,7 +3,7 @@ "family": "pairing.pre-profile", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/pr-branch-identity.json b/mobile/rpc-foundation/goldens/pr-branch-identity.json index 68711e3bc42f..8b55717c760d 100644 --- a/mobile/rpc-foundation/goldens/pr-branch-identity.json +++ b/mobile/rpc-foundation/goldens/pr-branch-identity.json @@ -3,7 +3,7 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-branch-repo-context.json b/mobile/rpc-foundation/goldens/pr-branch-repo-context.json index 4c1f18b58266..fdffc14bf9ea 100644 --- a/mobile/rpc-foundation/goldens/pr-branch-repo-context.json +++ b/mobile/rpc-foundation/goldens/pr-branch-repo-context.json @@ -3,7 +3,7 @@ "family": "session.pr-branch-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-comment-mutation.json b/mobile/rpc-foundation/goldens/pr-comment-mutation.json index 98fb81fb43e1..5135bf250680 100644 --- a/mobile/rpc-foundation/goldens/pr-comment-mutation.json +++ b/mobile/rpc-foundation/goldens/pr-comment-mutation.json @@ -3,7 +3,7 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-comment-resolve-unconfirmed.json b/mobile/rpc-foundation/goldens/pr-comment-resolve-unconfirmed.json index e4d974974f72..b51583c5b23d 100644 --- a/mobile/rpc-foundation/goldens/pr-comment-resolve-unconfirmed.json +++ b/mobile/rpc-foundation/goldens/pr-comment-resolve-unconfirmed.json @@ -3,7 +3,7 @@ "family": "github.pr-comment-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-mutation-in-band-failure.json b/mobile/rpc-foundation/goldens/pr-mutation-in-band-failure.json index 80210632f25d..bdd5c5f00b5b 100644 --- a/mobile/rpc-foundation/goldens/pr-mutation-in-band-failure.json +++ b/mobile/rpc-foundation/goldens/pr-mutation-in-band-failure.json @@ -3,7 +3,7 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-mutation-status.json b/mobile/rpc-foundation/goldens/pr-mutation-status.json index 9df9ebbc08f7..5b9696a333ca 100644 --- a/mobile/rpc-foundation/goldens/pr-mutation-status.json +++ b/mobile/rpc-foundation/goldens/pr-mutation-status.json @@ -3,7 +3,7 @@ "family": "github.pr-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-read-fork-routing.json b/mobile/rpc-foundation/goldens/pr-read-fork-routing.json index 82ae04bdf19c..9c63ea6f1ace 100644 --- a/mobile/rpc-foundation/goldens/pr-read-fork-routing.json +++ b/mobile/rpc-foundation/goldens/pr-read-fork-routing.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-read-surface.json b/mobile/rpc-foundation/goldens/pr-read-surface.json index beb3caed1aa3..000138b09f74 100644 --- a/mobile/rpc-foundation/goldens/pr-read-surface.json +++ b/mobile/rpc-foundation/goldens/pr-read-surface.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-read-upstream-error.json b/mobile/rpc-foundation/goldens/pr-read-upstream-error.json index 921b277e4051..ac5d882d2d5b 100644 --- a/mobile/rpc-foundation/goldens/pr-read-upstream-error.json +++ b/mobile/rpc-foundation/goldens/pr-read-upstream-error.json @@ -3,7 +3,7 @@ "family": "github.pr-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-sidebar-checks-refused.json b/mobile/rpc-foundation/goldens/pr-sidebar-checks-refused.json index d02fb4fe5988..0f676a3ec3c0 100644 --- a/mobile/rpc-foundation/goldens/pr-sidebar-checks-refused.json +++ b/mobile/rpc-foundation/goldens/pr-sidebar-checks-refused.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/pr-sidebar-load.json b/mobile/rpc-foundation/goldens/pr-sidebar-load.json index 0a6b876e2030..b620dbb5ff3a 100644 --- a/mobile/rpc-foundation/goldens/pr-sidebar-load.json +++ b/mobile/rpc-foundation/goldens/pr-sidebar-load.json @@ -3,7 +3,7 @@ "family": "session.pr-sidebar", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "87ffa2daea415d2682f1112025b5bd9d52404c6fc7c239180a3ad2120678ff1f", diff --git a/mobile/rpc-foundation/goldens/pr-title-mutation.json b/mobile/rpc-foundation/goldens/pr-title-mutation.json index 3025207a91b3..8b70312a91a3 100644 --- a/mobile/rpc-foundation/goldens/pr-title-mutation.json +++ b/mobile/rpc-foundation/goldens/pr-title-mutation.json @@ -3,7 +3,7 @@ "family": "github.pr-title-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-title-unconfirmed.json b/mobile/rpc-foundation/goldens/pr-title-unconfirmed.json index 76543bd73473..f3925091c1e1 100644 --- a/mobile/rpc-foundation/goldens/pr-title-unconfirmed.json +++ b/mobile/rpc-foundation/goldens/pr-title-unconfirmed.json @@ -3,7 +3,7 @@ "family": "github.pr-title-mutation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-triage-launch-unconfirmed.json b/mobile/rpc-foundation/goldens/pr-triage-launch-unconfirmed.json index 541634775ca9..dd9dc7f99321 100644 --- a/mobile/rpc-foundation/goldens/pr-triage-launch-unconfirmed.json +++ b/mobile/rpc-foundation/goldens/pr-triage-launch-unconfirmed.json @@ -3,7 +3,7 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-triage-launch.json b/mobile/rpc-foundation/goldens/pr-triage-launch.json index e98c39ee06a7..6409255dde36 100644 --- a/mobile/rpc-foundation/goldens/pr-triage-launch.json +++ b/mobile/rpc-foundation/goldens/pr-triage-launch.json @@ -3,7 +3,7 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-triage-prompt-not-delivered.json b/mobile/rpc-foundation/goldens/pr-triage-prompt-not-delivered.json index 093aa0d0036d..a3a899069984 100644 --- a/mobile/rpc-foundation/goldens/pr-triage-prompt-not-delivered.json +++ b/mobile/rpc-foundation/goldens/pr-triage-prompt-not-delivered.json @@ -3,7 +3,7 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/pr-triage-update-required.json b/mobile/rpc-foundation/goldens/pr-triage-update-required.json index 2abc1f20f771..9c177b4f7d8a 100644 --- a/mobile/rpc-foundation/goldens/pr-triage-update-required.json +++ b/mobile/rpc-foundation/goldens/pr-triage-update-required.json @@ -3,7 +3,7 @@ "family": "session.pr-triage", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5f65c5b318f4764b0f58a5e7b593333759a9cfa799db45b11190ac26f4083335", diff --git a/mobile/rpc-foundation/goldens/probe-new-tab-both-refused.json b/mobile/rpc-foundation/goldens/probe-new-tab-both-refused.json index 3a0831c480e7..5fc9131610e4 100644 --- a/mobile/rpc-foundation/goldens/probe-new-tab-both-refused.json +++ b/mobile/rpc-foundation/goldens/probe-new-tab-both-refused.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/probe-new-tab-null-sibling-refused.json b/mobile/rpc-foundation/goldens/probe-new-tab-null-sibling-refused.json index 8976f58317bd..7f025ba6705e 100644 --- a/mobile/rpc-foundation/goldens/probe-new-tab-null-sibling-refused.json +++ b/mobile/rpc-foundation/goldens/probe-new-tab-null-sibling-refused.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/probe-new-tab-refused-sibling-rejects.json b/mobile/rpc-foundation/goldens/probe-new-tab-refused-sibling-rejects.json index b4fe98c09e74..c35f9f15bb4a 100644 --- a/mobile/rpc-foundation/goldens/probe-new-tab-refused-sibling-rejects.json +++ b/mobile/rpc-foundation/goldens/probe-new-tab-refused-sibling-rejects.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/probe-new-tab-rejects-sibling-refused.json b/mobile/rpc-foundation/goldens/probe-new-tab-rejects-sibling-refused.json index 8dd63775a206..ead340e9da18 100644 --- a/mobile/rpc-foundation/goldens/probe-new-tab-rejects-sibling-refused.json +++ b/mobile/rpc-foundation/goldens/probe-new-tab-rejects-sibling-refused.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/push-dismissal-tray-reconciled.json b/mobile/rpc-foundation/goldens/push-dismissal-tray-reconciled.json index f4055dac19ae..efb5cb44258e 100644 --- a/mobile/rpc-foundation/goldens/push-dismissal-tray-reconciled.json +++ b/mobile/rpc-foundation/goldens/push-dismissal-tray-reconciled.json @@ -3,7 +3,7 @@ "family": "notifications.push-dismissal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "595a3eb2994d0596b9fcd0707b175b4e978625053dfbc5c541b0350c0cbfb524", diff --git a/mobile/rpc-foundation/goldens/quick-commands-load-refused.json b/mobile/rpc-foundation/goldens/quick-commands-load-refused.json index 4b66792f8801..9b474b2fe945 100644 --- a/mobile/rpc-foundation/goldens/quick-commands-load-refused.json +++ b/mobile/rpc-foundation/goldens/quick-commands-load-refused.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/quick-commands-loaded-and-saved.json b/mobile/rpc-foundation/goldens/quick-commands-loaded-and-saved.json index db28cbb0b9d3..f0a3927eb9d5 100644 --- a/mobile/rpc-foundation/goldens/quick-commands-loaded-and-saved.json +++ b/mobile/rpc-foundation/goldens/quick-commands-loaded-and-saved.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/quick-commands-save-refused-rolls-back.json b/mobile/rpc-foundation/goldens/quick-commands-save-refused-rolls-back.json index d2fd843f5b19..f35f31ef0118 100644 --- a/mobile/rpc-foundation/goldens/quick-commands-save-refused-rolls-back.json +++ b/mobile/rpc-foundation/goldens/quick-commands-save-refused-rolls-back.json @@ -3,7 +3,7 @@ "family": "settings.quick-commands", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/relay-direct-upgrade-commits.json b/mobile/rpc-foundation/goldens/relay-direct-upgrade-commits.json index 86fff0ea1fcf..128b5683855a 100644 --- a/mobile/rpc-foundation/goldens/relay-direct-upgrade-commits.json +++ b/mobile/rpc-foundation/goldens/relay-direct-upgrade-commits.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/relay-direct-upgrade-unsupported-host-declines.json b/mobile/rpc-foundation/goldens/relay-direct-upgrade-unsupported-host-declines.json index cbdc1ed67585..49bb0d6916b3 100644 --- a/mobile/rpc-foundation/goldens/relay-direct-upgrade-unsupported-host-declines.json +++ b/mobile/rpc-foundation/goldens/relay-direct-upgrade-unsupported-host-declines.json @@ -3,7 +3,7 @@ "family": "relay.direct-upgrade", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/relay-pairing-recovery-invite-authorizes.json b/mobile/rpc-foundation/goldens/relay-pairing-recovery-invite-authorizes.json index e9f548846ff6..93d35123826d 100644 --- a/mobile/rpc-foundation/goldens/relay-pairing-recovery-invite-authorizes.json +++ b/mobile/rpc-foundation/goldens/relay-pairing-recovery-invite-authorizes.json @@ -3,7 +3,7 @@ "family": "relay.pairing-recovery", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/relay-pairing-recovery-resume-committed.json b/mobile/rpc-foundation/goldens/relay-pairing-recovery-resume-committed.json index 462f491de850..01ea2c1dd1ca 100644 --- a/mobile/rpc-foundation/goldens/relay-pairing-recovery-resume-committed.json +++ b/mobile/rpc-foundation/goldens/relay-pairing-recovery-resume-committed.json @@ -3,7 +3,7 @@ "family": "relay.pairing-recovery", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "57c8ad93d162ea69e4a0ecd5de7d8fae6806f8f7a51945c2c13661d81bae6497", diff --git a/mobile/rpc-foundation/goldens/relay-rotation-installs-and-commits.json b/mobile/rpc-foundation/goldens/relay-rotation-installs-and-commits.json index 516a4c0e51c2..df749f8a8adf 100644 --- a/mobile/rpc-foundation/goldens/relay-rotation-installs-and-commits.json +++ b/mobile/rpc-foundation/goldens/relay-rotation-installs-and-commits.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/relay-rotation-resumes-committed-pending.json b/mobile/rpc-foundation/goldens/relay-rotation-resumes-committed-pending.json index c1ba267c15e6..9b00ed66ae03 100644 --- a/mobile/rpc-foundation/goldens/relay-rotation-resumes-committed-pending.json +++ b/mobile/rpc-foundation/goldens/relay-rotation-resumes-committed-pending.json @@ -3,7 +3,7 @@ "family": "relay.credential-rotation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "374a16da4187ee44fcc6e07daf822ae96ecfc13ab47ee6c29d048b1c0bd0f291", diff --git a/mobile/rpc-foundation/goldens/review-branch-diff-shapes.json b/mobile/rpc-foundation/goldens/review-branch-diff-shapes.json index 59f4d1f8fa6d..111141a241d7 100644 --- a/mobile/rpc-foundation/goldens/review-branch-diff-shapes.json +++ b/mobile/rpc-foundation/goldens/review-branch-diff-shapes.json @@ -3,7 +3,7 @@ "family": "session.review-branch-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/review-create-agent-refused.json b/mobile/rpc-foundation/goldens/review-create-agent-refused.json index 46eacedfb031..4b3e87f2df7b 100644 --- a/mobile/rpc-foundation/goldens/review-create-agent-refused.json +++ b/mobile/rpc-foundation/goldens/review-create-agent-refused.json @@ -3,7 +3,7 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/review-file-diff-shapes.json b/mobile/rpc-foundation/goldens/review-file-diff-shapes.json index 52d497f4ff62..468c34e78f7e 100644 --- a/mobile/rpc-foundation/goldens/review-file-diff-shapes.json +++ b/mobile/rpc-foundation/goldens/review-file-diff-shapes.json @@ -3,7 +3,7 @@ "family": "session.review-file-diff", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a8016eb61915cf80a3bdeb622ee67d35be8b4b9862a75e4ef2e8f4ff8e93e7f2", diff --git a/mobile/rpc-foundation/goldens/review-git-mutations-run.json b/mobile/rpc-foundation/goldens/review-git-mutations-run.json index 6c7223e82840..acd150c9b2ae 100644 --- a/mobile/rpc-foundation/goldens/review-git-mutations-run.json +++ b/mobile/rpc-foundation/goldens/review-git-mutations-run.json @@ -3,7 +3,7 @@ "family": "session.review-git-mutations", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/review-mark-reviewed-persists.json b/mobile/rpc-foundation/goldens/review-mark-reviewed-persists.json index 23eb48c754e9..b85c016c15ab 100644 --- a/mobile/rpc-foundation/goldens/review-mark-reviewed-persists.json +++ b/mobile/rpc-foundation/goldens/review-mark-reviewed-persists.json @@ -3,7 +3,7 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/review-mark-reviewed-rolls-back.json b/mobile/rpc-foundation/goldens/review-mark-reviewed-rolls-back.json index 38014ac78eed..e99516ff777c 100644 --- a/mobile/rpc-foundation/goldens/review-mark-reviewed-rolls-back.json +++ b/mobile/rpc-foundation/goldens/review-mark-reviewed-rolls-back.json @@ -3,7 +3,7 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/review-open-in-session.json b/mobile/rpc-foundation/goldens/review-open-in-session.json index b76d69a3b931..569e83371df2 100644 --- a/mobile/rpc-foundation/goldens/review-open-in-session.json +++ b/mobile/rpc-foundation/goldens/review-open-in-session.json @@ -3,7 +3,7 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/review-send-notes-heals-stale-input.json b/mobile/rpc-foundation/goldens/review-send-notes-heals-stale-input.json index 102af74f4ab6..a05b6062e167 100644 --- a/mobile/rpc-foundation/goldens/review-send-notes-heals-stale-input.json +++ b/mobile/rpc-foundation/goldens/review-send-notes-heals-stale-input.json @@ -3,7 +3,7 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/review-send-sheet-lists-terminals.json b/mobile/rpc-foundation/goldens/review-send-sheet-lists-terminals.json index 6ef0285d6062..97ad2e2b3c6f 100644 --- a/mobile/rpc-foundation/goldens/review-send-sheet-lists-terminals.json +++ b/mobile/rpc-foundation/goldens/review-send-sheet-lists-terminals.json @@ -3,7 +3,7 @@ "family": "session.review-send-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/review-stage-file.json b/mobile/rpc-foundation/goldens/review-stage-file.json index 1e943bc5d44e..c26300ecae40 100644 --- a/mobile/rpc-foundation/goldens/review-stage-file.json +++ b/mobile/rpc-foundation/goldens/review-stage-file.json @@ -3,7 +3,7 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/review-stage-refused.json b/mobile/rpc-foundation/goldens/review-stage-refused.json index 0a1e6a8a534c..ba13c5d523f9 100644 --- a/mobile/rpc-foundation/goldens/review-stage-refused.json +++ b/mobile/rpc-foundation/goldens/review-stage-refused.json @@ -3,7 +3,7 @@ "family": "session.diff-review-actions", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "dc3a746274b4197b02b0b3060bbf8ab0f67eb54355c8b9888e1f061e37f777af", diff --git a/mobile/rpc-foundation/goldens/sc-base-ref-default.json b/mobile/rpc-foundation/goldens/sc-base-ref-default.json index a01f9f2b924e..5942b67df036 100644 --- a/mobile/rpc-foundation/goldens/sc-base-ref-default.json +++ b/mobile/rpc-foundation/goldens/sc-base-ref-default.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-base-ref-repo-fallback.json b/mobile/rpc-foundation/goldens/sc-base-ref-repo-fallback.json index 3bf23f0d0bac..b8452d824103 100644 --- a/mobile/rpc-foundation/goldens/sc-base-ref-repo-fallback.json +++ b/mobile/rpc-foundation/goldens/sc-base-ref-repo-fallback.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-base-ref-unavailable.json b/mobile/rpc-foundation/goldens/sc-base-ref-unavailable.json index 8c8eeb7fd8cf..50df2e2ddabc 100644 --- a/mobile/rpc-foundation/goldens/sc-base-ref-unavailable.json +++ b/mobile/rpc-foundation/goldens/sc-base-ref-unavailable.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-base-ref-worktree-hit.json b/mobile/rpc-foundation/goldens/sc-base-ref-worktree-hit.json index 02b22c13ae77..ffee9e6aadd5 100644 --- a/mobile/rpc-foundation/goldens/sc-base-ref-worktree-hit.json +++ b/mobile/rpc-foundation/goldens/sc-base-ref-worktree-hit.json @@ -3,7 +3,7 @@ "family": "git.base-ref-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json b/mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json index fd257bbff10c..7b1b824e2bcd 100644 --- a/mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json +++ b/mobile/rpc-foundation/goldens/sc-branch-diff-previewed.json @@ -3,7 +3,7 @@ "family": "git.branch-diff-preview", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/sc-changes-loaded.json b/mobile/rpc-foundation/goldens/sc-changes-loaded.json index 898491e315a7..e958945db166 100644 --- a/mobile/rpc-foundation/goldens/sc-changes-loaded.json +++ b/mobile/rpc-foundation/goldens/sc-changes-loaded.json @@ -3,7 +3,7 @@ "family": "git.changes-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/sc-commit-message-cancel-rejected.json b/mobile/rpc-foundation/goldens/sc-commit-message-cancel-rejected.json index 5243f30ae1b7..2f9d956fb0cd 100644 --- a/mobile/rpc-foundation/goldens/sc-commit-message-cancel-rejected.json +++ b/mobile/rpc-foundation/goldens/sc-commit-message-cancel-rejected.json @@ -3,7 +3,7 @@ "family": "git.commit-message-ai", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-commit-message-canceled.json b/mobile/rpc-foundation/goldens/sc-commit-message-canceled.json index 82c4dc0b73bb..154bc9c8cc10 100644 --- a/mobile/rpc-foundation/goldens/sc-commit-message-canceled.json +++ b/mobile/rpc-foundation/goldens/sc-commit-message-canceled.json @@ -3,7 +3,7 @@ "family": "git.commit-message-ai", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-commit-message-generated.json b/mobile/rpc-foundation/goldens/sc-commit-message-generated.json index 50e21b494515..8afa223e0f88 100644 --- a/mobile/rpc-foundation/goldens/sc-commit-message-generated.json +++ b/mobile/rpc-foundation/goldens/sc-commit-message-generated.json @@ -3,7 +3,7 @@ "family": "git.commit-message-ai", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-create-existing-review.json b/mobile/rpc-foundation/goldens/sc-create-existing-review.json index d924c7310d5d..d2ba79261786 100644 --- a/mobile/rpc-foundation/goldens/sc-create-existing-review.json +++ b/mobile/rpc-foundation/goldens/sc-create-existing-review.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-intent-stage-commit-push-create.json b/mobile/rpc-foundation/goldens/sc-create-intent-stage-commit-push-create.json index 9361f82b5289..c6b49807d940 100644 --- a/mobile/rpc-foundation/goldens/sc-create-intent-stage-commit-push-create.json +++ b/mobile/rpc-foundation/goldens/sc-create-intent-stage-commit-push-create.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-intent-unlisted-provider.json b/mobile/rpc-foundation/goldens/sc-create-intent-unlisted-provider.json index f7e1ffd4130c..eea93b6b0634 100644 --- a/mobile/rpc-foundation/goldens/sc-create-intent-unlisted-provider.json +++ b/mobile/rpc-foundation/goldens/sc-create-intent-unlisted-provider.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-intent", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-link-failure-is-non-fatal.json b/mobile/rpc-foundation/goldens/sc-create-link-failure-is-non-fatal.json index 12d758d9b8b9..f5976e7eec6b 100644 --- a/mobile/rpc-foundation/goldens/sc-create-link-failure-is-non-fatal.json +++ b/mobile/rpc-foundation/goldens/sc-create-link-failure-is-non-fatal.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-pushes-then-creates.json b/mobile/rpc-foundation/goldens/sc-create-pushes-then-creates.json index 53a865285b6a..d2a7744e237c 100644 --- a/mobile/rpc-foundation/goldens/sc-create-pushes-then-creates.json +++ b/mobile/rpc-foundation/goldens/sc-create-pushes-then-creates.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-refused-empty-message.json b/mobile/rpc-foundation/goldens/sc-create-refused-empty-message.json index 95754691012b..3500b4a605a1 100644 --- a/mobile/rpc-foundation/goldens/sc-create-refused-empty-message.json +++ b/mobile/rpc-foundation/goldens/sc-create-refused-empty-message.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-create-rejected-empty-message.json b/mobile/rpc-foundation/goldens/sc-create-rejected-empty-message.json index be82322d1d8f..4246171faf02 100644 --- a/mobile/rpc-foundation/goldens/sc-create-rejected-empty-message.json +++ b/mobile/rpc-foundation/goldens/sc-create-rejected-empty-message.json @@ -3,7 +3,7 @@ "family": "hostedReview.create-chain", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-eligibility-fetched.json b/mobile/rpc-foundation/goldens/sc-eligibility-fetched.json index 5b8de2f15efe..f9cea076c935 100644 --- a/mobile/rpc-foundation/goldens/sc-eligibility-fetched.json +++ b/mobile/rpc-foundation/goldens/sc-eligibility-fetched.json @@ -3,7 +3,7 @@ "family": "hostedReview.eligibility", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-history-commit-files.json b/mobile/rpc-foundation/goldens/sc-history-commit-files.json index cc1728d3d824..650632d4a9d7 100644 --- a/mobile/rpc-foundation/goldens/sc-history-commit-files.json +++ b/mobile/rpc-foundation/goldens/sc-history-commit-files.json @@ -3,7 +3,7 @@ "family": "git.history-commit-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "48ccada93f208a24160483e98ee94a771ab6d63222f29ac4bbd6979157f98333", diff --git a/mobile/rpc-foundation/goldens/sc-history-loaded.json b/mobile/rpc-foundation/goldens/sc-history-loaded.json index cefe8dec69e8..6ab05a8ff9ad 100644 --- a/mobile/rpc-foundation/goldens/sc-history-loaded.json +++ b/mobile/rpc-foundation/goldens/sc-history-loaded.json @@ -3,7 +3,7 @@ "family": "git.history-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-pr-link-hosted-review.json b/mobile/rpc-foundation/goldens/sc-pr-link-hosted-review.json index 52f6a72ef9a0..dc8de943cb45 100644 --- a/mobile/rpc-foundation/goldens/sc-pr-link-hosted-review.json +++ b/mobile/rpc-foundation/goldens/sc-pr-link-hosted-review.json @@ -3,7 +3,7 @@ "family": "worktree.review-link", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-pr-link-read.json b/mobile/rpc-foundation/goldens/sc-pr-link-read.json index baa447adcc8d..ebb5e7ec15b2 100644 --- a/mobile/rpc-foundation/goldens/sc-pr-link-read.json +++ b/mobile/rpc-foundation/goldens/sc-pr-link-read.json @@ -3,7 +3,7 @@ "family": "worktree.review-link", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-pr-link-set.json b/mobile/rpc-foundation/goldens/sc-pr-link-set.json index b03e46c09340..34f35559c0f1 100644 --- a/mobile/rpc-foundation/goldens/sc-pr-link-set.json +++ b/mobile/rpc-foundation/goldens/sc-pr-link-set.json @@ -3,7 +3,7 @@ "family": "worktree.review-link", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-refusal.json b/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-refusal.json index e450baf4fe50..31773808f1cb 100644 --- a/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-refusal.json +++ b/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-refusal.json @@ -3,7 +3,7 @@ "family": "hostedReview.eligibility", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-rejection.json b/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-rejection.json index 22e03e7ae845..d526b09470e6 100644 --- a/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-rejection.json +++ b/mobile/rpc-foundation/goldens/sc-prefill-unavailable-on-rejection.json @@ -3,7 +3,7 @@ "family": "hostedReview.eligibility", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prerequisite-force-with-lease.json b/mobile/rpc-foundation/goldens/sc-prerequisite-force-with-lease.json index c2be37143978..1dbb4649be94 100644 --- a/mobile/rpc-foundation/goldens/sc-prerequisite-force-with-lease.json +++ b/mobile/rpc-foundation/goldens/sc-prerequisite-force-with-lease.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prerequisite-publish.json b/mobile/rpc-foundation/goldens/sc-prerequisite-publish.json index 1782c716e34d..18a8b027d3be 100644 --- a/mobile/rpc-foundation/goldens/sc-prerequisite-publish.json +++ b/mobile/rpc-foundation/goldens/sc-prerequisite-publish.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prerequisite-push.json b/mobile/rpc-foundation/goldens/sc-prerequisite-push.json index e57f5e8fbd77..319b4979fcfd 100644 --- a/mobile/rpc-foundation/goldens/sc-prerequisite-push.json +++ b/mobile/rpc-foundation/goldens/sc-prerequisite-push.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-prerequisite-skipped.json b/mobile/rpc-foundation/goldens/sc-prerequisite-skipped.json index a6a3ccd115a9..6d82311a78f5 100644 --- a/mobile/rpc-foundation/goldens/sc-prerequisite-skipped.json +++ b/mobile/rpc-foundation/goldens/sc-prerequisite-skipped.json @@ -3,7 +3,7 @@ "family": "git.remote-prerequisite", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-reveal-first-poll.json b/mobile/rpc-foundation/goldens/sc-reveal-first-poll.json index 4fbc890e10a0..a8adca2c4b9c 100644 --- a/mobile/rpc-foundation/goldens/sc-reveal-first-poll.json +++ b/mobile/rpc-foundation/goldens/sc-reveal-first-poll.json @@ -3,7 +3,7 @@ "family": "session.tab-reveal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-reveal-timeout.json b/mobile/rpc-foundation/goldens/sc-reveal-timeout.json index e529b87d415f..ab99918545d8 100644 --- a/mobile/rpc-foundation/goldens/sc-reveal-timeout.json +++ b/mobile/rpc-foundation/goldens/sc-reveal-timeout.json @@ -3,7 +3,7 @@ "family": "session.tab-reveal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5e47c7960b9352753f0751d4ccf5e3ff7fb7b74a63cc4e4df3c3ffdcc6c1e66b", diff --git a/mobile/rpc-foundation/goldens/sc-review-commit-inner-failure.json b/mobile/rpc-foundation/goldens/sc-review-commit-inner-failure.json index 02bbd1d4f4aa..e6aa5a4faa6a 100644 --- a/mobile/rpc-foundation/goldens/sc-review-commit-inner-failure.json +++ b/mobile/rpc-foundation/goldens/sc-review-commit-inner-failure.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-commit-refused-empty-message.json b/mobile/rpc-foundation/goldens/sc-review-commit-refused-empty-message.json index c4077e2331f4..27caff586148 100644 --- a/mobile/rpc-foundation/goldens/sc-review-commit-refused-empty-message.json +++ b/mobile/rpc-foundation/goldens/sc-review-commit-refused-empty-message.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-commit-rejected.json b/mobile/rpc-foundation/goldens/sc-review-commit-rejected.json index 00dfc9065892..434e9f70cf7d 100644 --- a/mobile/rpc-foundation/goldens/sc-review-commit-rejected.json +++ b/mobile/rpc-foundation/goldens/sc-review-commit-rejected.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-commit.json b/mobile/rpc-foundation/goldens/sc-review-commit.json index 523af3afd4f8..da0aa2e6a9f5 100644 --- a/mobile/rpc-foundation/goldens/sc-review-commit.json +++ b/mobile/rpc-foundation/goldens/sc-review-commit.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-status-entries-not-array.json b/mobile/rpc-foundation/goldens/sc-review-status-entries-not-array.json index a39edfc8cf8b..f63660a3cd9f 100644 --- a/mobile/rpc-foundation/goldens/sc-review-status-entries-not-array.json +++ b/mobile/rpc-foundation/goldens/sc-review-status-entries-not-array.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/sc-review-status-normalized.json b/mobile/rpc-foundation/goldens/sc-review-status-normalized.json index 1f1730fbf817..7b5a556643ba 100644 --- a/mobile/rpc-foundation/goldens/sc-review-status-normalized.json +++ b/mobile/rpc-foundation/goldens/sc-review-status-normalized.json @@ -3,7 +3,7 @@ "family": "git.review-preparation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c582ce355b0704b38d7e84cbce352630096c91231bf09aecd1f6dbb409fed17f", diff --git a/mobile/rpc-foundation/goldens/schedules-b3.json b/mobile/rpc-foundation/goldens/schedules-b3.json index 38674f2cd5b7..4f853b2b96f3 100644 --- a/mobile/rpc-foundation/goldens/schedules-b3.json +++ b/mobile/rpc-foundation/goldens/schedules-b3.json @@ -3,7 +3,7 @@ "family": "linear-detail-barrier", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-home-providers-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-home-providers-fulfilled.json index 90ad47f260d1..bea3dafeabdc 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-home-providers-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-home-providers-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-new-tab-ssh.json b/mobile/rpc-foundation/goldens/schedules-settings-new-tab-ssh.json index ecdc4157c67b..68d4feddea3b 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-new-tab-ssh.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-new-tab-ssh.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-repo-metadata-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-repo-metadata-fulfilled.json index 8bf76be19f43..ddbc2f475c24 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-repo-metadata-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-repo-metadata-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-resume-metadata-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-resume-metadata-fulfilled.json index 659e9c9623db..4eb88063ebf8 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-resume-metadata-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-resume-metadata-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-task-hydration-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-task-hydration-fulfilled.json index a20253e0834d..b2d3830f925c 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-task-hydration-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-task-hydration-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/schedules-settings-workspace-context-fulfilled.json b/mobile/rpc-foundation/goldens/schedules-settings-workspace-context-fulfilled.json index 962706318c83..66a95b727a5a 100644 --- a/mobile/rpc-foundation/goldens/schedules-settings-workspace-context-fulfilled.json +++ b/mobile/rpc-foundation/goldens/schedules-settings-workspace-context-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/session-browser-tab-created.json b/mobile/rpc-foundation/goldens/session-browser-tab-created.json index b9b271def77c..b04cda067496 100644 --- a/mobile/rpc-foundation/goldens/session-browser-tab-created.json +++ b/mobile/rpc-foundation/goldens/session-browser-tab-created.json @@ -3,7 +3,7 @@ "family": "session.browser-tab-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-browser-refused.json b/mobile/rpc-foundation/goldens/session-create-browser-refused.json index 5bef4c17f0a7..1d77a1a3c6a1 100644 --- a/mobile/rpc-foundation/goldens/session-create-browser-refused.json +++ b/mobile/rpc-foundation/goldens/session-create-browser-refused.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-browser-tab.json b/mobile/rpc-foundation/goldens/session-create-browser-tab.json index 744c50b126cf..9e18d6c81d84 100644 --- a/mobile/rpc-foundation/goldens/session-create-browser-tab.json +++ b/mobile/rpc-foundation/goldens/session-create-browser-tab.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-markdown-name-collision.json b/mobile/rpc-foundation/goldens/session-create-markdown-name-collision.json index 958d728be478..5a53b692c8e2 100644 --- a/mobile/rpc-foundation/goldens/session-create-markdown-name-collision.json +++ b/mobile/rpc-foundation/goldens/session-create-markdown-name-collision.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-markdown-note.json b/mobile/rpc-foundation/goldens/session-create-markdown-note.json index 13afb8392894..af1f1da0e637 100644 --- a/mobile/rpc-foundation/goldens/session-create-markdown-note.json +++ b/mobile/rpc-foundation/goldens/session-create-markdown-note.json @@ -3,7 +3,7 @@ "family": "session.content-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-ignores-a-second-create-in-flight.json b/mobile/rpc-foundation/goldens/session-create-terminal-ignores-a-second-create-in-flight.json index bc49333a7504..db66770d615f 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-ignores-a-second-create-in-flight.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-ignores-a-second-create-in-flight.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-launches-an-agent-quick-command.json b/mobile/rpc-foundation/goldens/session-create-terminal-launches-an-agent-quick-command.json index a5aa4d693f80..f78621dd39be 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-launches-an-agent-quick-command.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-launches-an-agent-quick-command.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-refused.json b/mobile/rpc-foundation/goldens/session-create-terminal-refused.json index ac3b01460832..8bc650492e4c 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-refused.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-refused.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-replaces-active.json b/mobile/rpc-foundation/goldens/session-create-terminal-replaces-active.json index b5354c9a8854..d019905f0125 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-replaces-active.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-replaces-active.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-runs-a-quick-command.json b/mobile/rpc-foundation/goldens/session-create-terminal-runs-a-quick-command.json index 33c777340181..5dec9e36ceff 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-runs-a-quick-command.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-runs-a-quick-command.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-with-prompt.json b/mobile/rpc-foundation/goldens/session-create-terminal-with-prompt.json index 4d2446390582..a279744b04d7 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-with-prompt.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-with-prompt.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-without-active-tab.json b/mobile/rpc-foundation/goldens/session-create-terminal-without-active-tab.json index 79dfa0e70c6e..382ae3b66587 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-without-active-tab.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-without-active-tab.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-create-terminal-without-handle.json b/mobile/rpc-foundation/goldens/session-create-terminal-without-handle.json index 7c3df89b6a4f..44072a16f7bb 100644 --- a/mobile/rpc-foundation/goldens/session-create-terminal-without-handle.json +++ b/mobile/rpc-foundation/goldens/session-create-terminal-without-handle.json @@ -3,7 +3,7 @@ "family": "session.create-terminal", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fa7d9fd6428e89282f08e04fefba4289000eb3aed1462489a2f11efed374382c", diff --git a/mobile/rpc-foundation/goldens/session-diff-notes-load-refused.json b/mobile/rpc-foundation/goldens/session-diff-notes-load-refused.json index 7e41166ae672..486e22ee91fa 100644 --- a/mobile/rpc-foundation/goldens/session-diff-notes-load-refused.json +++ b/mobile/rpc-foundation/goldens/session-diff-notes-load-refused.json @@ -3,7 +3,7 @@ "family": "session.diff-notes", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/session-diff-notes-loaded.json b/mobile/rpc-foundation/goldens/session-diff-notes-loaded.json index a7bb8ff898a3..43ee9a7704ce 100644 --- a/mobile/rpc-foundation/goldens/session-diff-notes-loaded.json +++ b/mobile/rpc-foundation/goldens/session-diff-notes-loaded.json @@ -3,7 +3,7 @@ "family": "session.diff-notes", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/session-file-tab-read.json b/mobile/rpc-foundation/goldens/session-file-tab-read.json index eb7eb1cbc5a7..1464aee2675e 100644 --- a/mobile/rpc-foundation/goldens/session-file-tab-read.json +++ b/mobile/rpc-foundation/goldens/session-file-tab-read.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-disk-read.json b/mobile/rpc-foundation/goldens/session-markdown-disk-read.json index 4d42d84c8a0a..33906f960315 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-disk-read.json +++ b/mobile/rpc-foundation/goldens/session-markdown-disk-read.json @@ -3,7 +3,7 @@ "family": "session.markdown-disk-fallback", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-disk-served.json b/mobile/rpc-foundation/goldens/session-markdown-disk-served.json index 5405ef59f382..aff129759520 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-disk-served.json +++ b/mobile/rpc-foundation/goldens/session-markdown-disk-served.json @@ -3,7 +3,7 @@ "family": "session.markdown-disk-fallback", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-save-conflict.json b/mobile/rpc-foundation/goldens/session-markdown-save-conflict.json index dadd4338f0df..49b8f03cfcf3 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-save-conflict.json +++ b/mobile/rpc-foundation/goldens/session-markdown-save-conflict.json @@ -3,7 +3,7 @@ "family": "session.markdown-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/session-markdown-saved.json b/mobile/rpc-foundation/goldens/session-markdown-saved.json index 7572025304ea..a55ed7cac7b6 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-saved.json +++ b/mobile/rpc-foundation/goldens/session-markdown-saved.json @@ -3,7 +3,7 @@ "family": "session.markdown-save", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42334358b5e5966001639653b553f15033f6e201d785107871fe056536f0a5e2", diff --git a/mobile/rpc-foundation/goldens/session-markdown-tab-disk-fallback.json b/mobile/rpc-foundation/goldens/session-markdown-tab-disk-fallback.json index 35e69380af4a..d4f03e527ca2 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-tab-disk-fallback.json +++ b/mobile/rpc-foundation/goldens/session-markdown-tab-disk-fallback.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-tab-read.json b/mobile/rpc-foundation/goldens/session-markdown-tab-read.json index 3aa03329f501..b9426e53cb44 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-tab-read.json +++ b/mobile/rpc-foundation/goldens/session-markdown-tab-read.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-markdown-tab-refused.json b/mobile/rpc-foundation/goldens/session-markdown-tab-refused.json index 0eaf1fe08c89..db44a855f001 100644 --- a/mobile/rpc-foundation/goldens/session-markdown-tab-refused.json +++ b/mobile/rpc-foundation/goldens/session-markdown-tab-refused.json @@ -3,7 +3,7 @@ "family": "session.tab-documents", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-startup-both-activation-sites.json b/mobile/rpc-foundation/goldens/session-startup-both-activation-sites.json index f42c64c4432a..05e12d59cd54 100644 --- a/mobile/rpc-foundation/goldens/session-startup-both-activation-sites.json +++ b/mobile/rpc-foundation/goldens/session-startup-both-activation-sites.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/session-startup-floating-route-skips-activation.json b/mobile/rpc-foundation/goldens/session-startup-floating-route-skips-activation.json index f2dc1d61fcac..9b75f0a29eeb 100644 --- a/mobile/rpc-foundation/goldens/session-startup-floating-route-skips-activation.json +++ b/mobile/rpc-foundation/goldens/session-startup-floating-route-skips-activation.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/session-startup-keeps-terminals-visible-on-reconnect.json b/mobile/rpc-foundation/goldens/session-startup-keeps-terminals-visible-on-reconnect.json index f877cbf30bdd..dc0af2b1c43c 100644 --- a/mobile/rpc-foundation/goldens/session-startup-keeps-terminals-visible-on-reconnect.json +++ b/mobile/rpc-foundation/goldens/session-startup-keeps-terminals-visible-on-reconnect.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/session-startup-refused-tab-load-still-loads-terminals.json b/mobile/rpc-foundation/goldens/session-startup-refused-tab-load-still-loads-terminals.json index 0d7223f52f5b..9ba927b4a88e 100644 --- a/mobile/rpc-foundation/goldens/session-startup-refused-tab-load-still-loads-terminals.json +++ b/mobile/rpc-foundation/goldens/session-startup-refused-tab-load-still-loads-terminals.json @@ -3,7 +3,7 @@ "family": "session.startup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "6b08c394e37fd572cf63a4c11934247d379008f11117aa5af33b2926fbd32d1e", diff --git a/mobile/rpc-foundation/goldens/session-tab-activation-focus-and-activate.json b/mobile/rpc-foundation/goldens/session-tab-activation-focus-and-activate.json index e318448da70c..90fc3c39d9ac 100644 --- a/mobile/rpc-foundation/goldens/session-tab-activation-focus-and-activate.json +++ b/mobile/rpc-foundation/goldens/session-tab-activation-focus-and-activate.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tab-activation-refused.json b/mobile/rpc-foundation/goldens/session-tab-activation-refused.json index b568ef3c28c4..632862d82816 100644 --- a/mobile/rpc-foundation/goldens/session-tab-activation-refused.json +++ b/mobile/rpc-foundation/goldens/session-tab-activation-refused.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tab-activation-transport-error.json b/mobile/rpc-foundation/goldens/session-tab-activation-transport-error.json index 840aeb36c5f5..54bac0ec3e2c 100644 --- a/mobile/rpc-foundation/goldens/session-tab-activation-transport-error.json +++ b/mobile/rpc-foundation/goldens/session-tab-activation-transport-error.json @@ -3,7 +3,7 @@ "family": "session.tab-activation", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tab-close-refused-keeps-tab.json b/mobile/rpc-foundation/goldens/session-tab-close-refused-keeps-tab.json index d7965799fb68..c567b3dff9a4 100644 --- a/mobile/rpc-foundation/goldens/session-tab-close-refused-keeps-tab.json +++ b/mobile/rpc-foundation/goldens/session-tab-close-refused-keeps-tab.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-close-session-tab.json b/mobile/rpc-foundation/goldens/session-tab-close-session-tab.json index a0c45cf4c9aa..f1ad9234d979 100644 --- a/mobile/rpc-foundation/goldens/session-tab-close-session-tab.json +++ b/mobile/rpc-foundation/goldens/session-tab-close-session-tab.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-close-terminal.json b/mobile/rpc-foundation/goldens/session-tab-close-terminal.json index 51951642c40f..f513fa07b597 100644 --- a/mobile/rpc-foundation/goldens/session-tab-close-terminal.json +++ b/mobile/rpc-foundation/goldens/session-tab-close-terminal.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-closed.json b/mobile/rpc-foundation/goldens/session-tab-closed.json index d69e9d539d55..d68d1c2fe1e0 100644 --- a/mobile/rpc-foundation/goldens/session-tab-closed.json +++ b/mobile/rpc-foundation/goldens/session-tab-closed.json @@ -3,7 +3,7 @@ "family": "session.tab-close-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-rename.json b/mobile/rpc-foundation/goldens/session-tab-rename.json index 666d9de75f62..9c38aa6d43e6 100644 --- a/mobile/rpc-foundation/goldens/session-tab-rename.json +++ b/mobile/rpc-foundation/goldens/session-tab-rename.json @@ -3,7 +3,7 @@ "family": "session.tab-close", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tab-renamed.json b/mobile/rpc-foundation/goldens/session-tab-renamed.json index b67716fba428..ff8aab7dd9ec 100644 --- a/mobile/rpc-foundation/goldens/session-tab-renamed.json +++ b/mobile/rpc-foundation/goldens/session-tab-renamed.json @@ -3,7 +3,7 @@ "family": "session.tab-rename", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "562c2f4ab669e774dd7045ecd9518e483845433fef6034688090f3b056df2815", diff --git a/mobile/rpc-foundation/goldens/session-tabs-health-errored.json b/mobile/rpc-foundation/goldens/session-tabs-health-errored.json index 099094e7c06c..592720b6ebff 100644 --- a/mobile/rpc-foundation/goldens/session-tabs-health-errored.json +++ b/mobile/rpc-foundation/goldens/session-tabs-health-errored.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tabs-health-reconciled.json b/mobile/rpc-foundation/goldens/session-tabs-health-reconciled.json index 6f608d136457..43513fd5d5ff 100644 --- a/mobile/rpc-foundation/goldens/session-tabs-health-reconciled.json +++ b/mobile/rpc-foundation/goldens/session-tabs-health-reconciled.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tabs-health-refused.json b/mobile/rpc-foundation/goldens/session-tabs-health-refused.json index 952c1fca8cff..646aeedd242c 100644 --- a/mobile/rpc-foundation/goldens/session-tabs-health-refused.json +++ b/mobile/rpc-foundation/goldens/session-tabs-health-refused.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-tabs-health-stale-application-revision.json b/mobile/rpc-foundation/goldens/session-tabs-health-stale-application-revision.json index 0d3f2650bdb1..1b38eea06ba2 100644 --- a/mobile/rpc-foundation/goldens/session-tabs-health-stale-application-revision.json +++ b/mobile/rpc-foundation/goldens/session-tabs-health-stale-application-revision.json @@ -3,7 +3,7 @@ "family": "session.tabs-stream-health", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4a1e81ab3229c8fd10b3ad435568efec11a944e0f02a183f94e4b1f44a7e5de0", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-take-floor.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-take-floor.json index 8bb2d688a1a5..eb9415320606 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-take-floor.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-take-floor.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-device-token.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-device-token.json index 4122e8803acb..22c345648ecc 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-device-token.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-device-token.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-viewport.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-viewport.json index 8240ec9c4a9b..b2ed727567b2 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-viewport.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-auto-without-viewport.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-drops-second-toggle.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-drops-second-toggle.json index 08b6c1b0cc6f..9d8e0ca1fda8 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-drops-second-toggle.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-drops-second-toggle.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-display-mode-to-desktop.json b/mobile/rpc-foundation/goldens/session-terminal-display-mode-to-desktop.json index 732087cdc448..3bec41d3d144 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-display-mode-to-desktop.json +++ b/mobile/rpc-foundation/goldens/session-terminal-display-mode-to-desktop.json @@ -3,7 +3,7 @@ "family": "session.terminal-display-mode", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9e90ad39a8d4257adf30166757a6364c4710dc3ae9f06365f80a3dd8f1c94d89", diff --git a/mobile/rpc-foundation/goldens/session-terminal-list-dedupes-handles.json b/mobile/rpc-foundation/goldens/session-terminal-list-dedupes-handles.json index a076ae6cc9f8..819c744595e6 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-list-dedupes-handles.json +++ b/mobile/rpc-foundation/goldens/session-terminal-list-dedupes-handles.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-terminal-list-empty-guarded.json b/mobile/rpc-foundation/goldens/session-terminal-list-empty-guarded.json index b7d2c3e2eed3..68a8101eb704 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-list-empty-guarded.json +++ b/mobile/rpc-foundation/goldens/session-terminal-list-empty-guarded.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-terminal-list-merged.json b/mobile/rpc-foundation/goldens/session-terminal-list-merged.json index 3a893faff395..dd47dfd4a3f7 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-list-merged.json +++ b/mobile/rpc-foundation/goldens/session-terminal-list-merged.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/session-terminal-list-refused.json b/mobile/rpc-foundation/goldens/session-terminal-list-refused.json index 7d034cea715f..702e90b09d94 100644 --- a/mobile/rpc-foundation/goldens/session-terminal-list-refused.json +++ b/mobile/rpc-foundation/goldens/session-terminal-list-refused.json @@ -3,7 +3,7 @@ "family": "session.terminal-inventory", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "a3daf9a05d05424959baf77feb45cb0c076d77d8c49e877941ed612cc1e5ce95", diff --git a/mobile/rpc-foundation/goldens/settings-bot-overrides-fulfilled.json b/mobile/rpc-foundation/goldens/settings-bot-overrides-fulfilled.json index b1b174597abb..10aa9bf6fade 100644 --- a/mobile/rpc-foundation/goldens/settings-bot-overrides-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-bot-overrides-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-bot-overrides-refresh-refused.json b/mobile/rpc-foundation/goldens/settings-bot-overrides-refresh-refused.json index e1f4e3224adc..cbc26766aba6 100644 --- a/mobile/rpc-foundation/goldens/settings-bot-overrides-refresh-refused.json +++ b/mobile/rpc-foundation/goldens/settings-bot-overrides-refresh-refused.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-bot-overrides-refused.json b/mobile/rpc-foundation/goldens/settings-bot-overrides-refused.json index 6d281b4f23bd..59f48eb7903f 100644 --- a/mobile/rpc-foundation/goldens/settings-bot-overrides-refused.json +++ b/mobile/rpc-foundation/goldens/settings-bot-overrides-refused.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-bot-overrides-transport-error.json b/mobile/rpc-foundation/goldens/settings-bot-overrides-transport-error.json index 342ac6c4620c..af9092a191a2 100644 --- a/mobile/rpc-foundation/goldens/settings-bot-overrides-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-bot-overrides-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.bot-overrides", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-coalesced.json b/mobile/rpc-foundation/goldens/settings-home-coalesced.json index 4dd791f1a90e..bfd248c1111c 100644 --- a/mobile/rpc-foundation/goldens/settings-home-coalesced.json +++ b/mobile/rpc-foundation/goldens/settings-home-coalesced.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-providers-fulfilled.json b/mobile/rpc-foundation/goldens/settings-home-providers-fulfilled.json index 90cb00d86a48..8559c33d6f8b 100644 --- a/mobile/rpc-foundation/goldens/settings-home-providers-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-home-providers-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-providers-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-home-providers-refuse-after-data.json index f1c9d5f27cdd..2383aa119812 100644 --- a/mobile/rpc-foundation/goldens/settings-home-providers-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-home-providers-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-providers-refused.json b/mobile/rpc-foundation/goldens/settings-home-providers-refused.json index 142f90c69bea..09641d9d31f3 100644 --- a/mobile/rpc-foundation/goldens/settings-home-providers-refused.json +++ b/mobile/rpc-foundation/goldens/settings-home-providers-refused.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-home-providers-transport-error.json b/mobile/rpc-foundation/goldens/settings-home-providers-transport-error.json index 2b5c55a18bc0..7e0cfa9e465c 100644 --- a/mobile/rpc-foundation/goldens/settings-home-providers-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-home-providers-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.home-providers", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-new-tab-refused.json b/mobile/rpc-foundation/goldens/settings-new-tab-refused.json index 0a6362bc82da..7678703497f3 100644 --- a/mobile/rpc-foundation/goldens/settings-new-tab-refused.json +++ b/mobile/rpc-foundation/goldens/settings-new-tab-refused.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/settings-new-tab-ssh.json b/mobile/rpc-foundation/goldens/settings-new-tab-ssh.json index dbdb53084d81..5a83681082c5 100644 --- a/mobile/rpc-foundation/goldens/settings-new-tab-ssh.json +++ b/mobile/rpc-foundation/goldens/settings-new-tab-ssh.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/settings-new-tab-transport-error.json b/mobile/rpc-foundation/goldens/settings-new-tab-transport-error.json index 4306706463b0..a14c158b06b7 100644 --- a/mobile/rpc-foundation/goldens/settings-new-tab-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-new-tab-transport-error.json @@ -3,7 +3,7 @@ "family": "settings-agent-read", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "448cdbd12f4f6a14bb33947bfbbb1837aebeb28979db70c62f2ba2fbb4d89c8f", diff --git a/mobile/rpc-foundation/goldens/settings-repo-cache-expiry.json b/mobile/rpc-foundation/goldens/settings-repo-cache-expiry.json index 30457d0762ec..eb4fc941aca1 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-cache-expiry.json +++ b/mobile/rpc-foundation/goldens/settings-repo-cache-expiry.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-fulfilled.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-fulfilled.json index 523da4245773..48d11dcd47b0 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-icons.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-icons.json index b41a07f9ffa1..f2d0e0648ede 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-icons.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-icons.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-refuse-after-data.json index 9116d51c643b..534db6719a7d 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-refused.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-refused.json index 4681e027614f..826fa175c36c 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-refused.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-refused.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-single-host.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-single-host.json index 656207c38f88..3ff00bc00660 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-single-host.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-single-host.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-repo-metadata-transport-error.json b/mobile/rpc-foundation/goldens/settings-repo-metadata-transport-error.json index c02040b8b0f5..b096dc378efd 100644 --- a/mobile/rpc-foundation/goldens/settings-repo-metadata-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-repo-metadata-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.repo-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-resume-metadata-fulfilled.json b/mobile/rpc-foundation/goldens/settings-resume-metadata-fulfilled.json index f339231a8812..a3fde54d0e01 100644 --- a/mobile/rpc-foundation/goldens/settings-resume-metadata-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-resume-metadata-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-resume-metadata-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-resume-metadata-refuse-after-data.json index d6beaa00054d..70edb4661de8 100644 --- a/mobile/rpc-foundation/goldens/settings-resume-metadata-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-resume-metadata-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-resume-metadata-refused.json b/mobile/rpc-foundation/goldens/settings-resume-metadata-refused.json index 77d6d3713ca0..3daae99cf55b 100644 --- a/mobile/rpc-foundation/goldens/settings-resume-metadata-refused.json +++ b/mobile/rpc-foundation/goldens/settings-resume-metadata-refused.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-resume-metadata-transport-error.json b/mobile/rpc-foundation/goldens/settings-resume-metadata-transport-error.json index 3deb52b2b44b..995ad34d24b9 100644 --- a/mobile/rpc-foundation/goldens/settings-resume-metadata-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-resume-metadata-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.resume-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-hydration-fulfilled.json b/mobile/rpc-foundation/goldens/settings-task-hydration-fulfilled.json index e634538fa165..9940a7b242ce 100644 --- a/mobile/rpc-foundation/goldens/settings-task-hydration-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-task-hydration-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-hydration-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-task-hydration-refuse-after-data.json index 83efbfab3712..a2353d9cd01d 100644 --- a/mobile/rpc-foundation/goldens/settings-task-hydration-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-task-hydration-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-hydration-refused.json b/mobile/rpc-foundation/goldens/settings-task-hydration-refused.json index c0984fe9e71e..ef29c952cfca 100644 --- a/mobile/rpc-foundation/goldens/settings-task-hydration-refused.json +++ b/mobile/rpc-foundation/goldens/settings-task-hydration-refused.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-hydration-transport-error.json b/mobile/rpc-foundation/goldens/settings-task-hydration-transport-error.json index 898195b8983f..b03484b95bcb 100644 --- a/mobile/rpc-foundation/goldens/settings-task-hydration-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-task-hydration-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.task-hydration", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-create-linear.json b/mobile/rpc-foundation/goldens/settings-task-workspace-create-linear.json index b7df634d4901..9331d8c3eb47 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-create-linear.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-create-linear.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-create-pr-start-point.json b/mobile/rpc-foundation/goldens/settings-task-workspace-create-pr-start-point.json index ae87f0db1516..9088f5d3b1e5 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-create-pr-start-point.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-create-pr-start-point.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-fulfilled.json b/mobile/rpc-foundation/goldens/settings-task-workspace-fulfilled.json index b24de99905e4..703829be6845 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-refused.json b/mobile/rpc-foundation/goldens/settings-task-workspace-refused.json index b70fcbd41492..5e433195d9ac 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-refused.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-refused.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-workspace-transport-error.json b/mobile/rpc-foundation/goldens/settings-task-workspace-transport-error.json index 849918850b6e..1575042ffffb 100644 --- a/mobile/rpc-foundation/goldens/settings-task-workspace-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-task-workspace-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.task-workspace", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-task-write.json b/mobile/rpc-foundation/goldens/settings-task-write.json index c2427e4abd2e..c0aa3ba1b23e 100644 --- a/mobile/rpc-foundation/goldens/settings-task-write.json +++ b/mobile/rpc-foundation/goldens/settings-task-write.json @@ -3,7 +3,7 @@ "family": "settings-best-effort", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-context-fulfilled.json b/mobile/rpc-foundation/goldens/settings-workspace-context-fulfilled.json index 9fd051522b7c..647269388f22 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-context-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-context-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-context-refuse-after-data.json b/mobile/rpc-foundation/goldens/settings-workspace-context-refuse-after-data.json index 26fd43778bff..5dad315f94de 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-context-refuse-after-data.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-context-refuse-after-data.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-context-refused.json b/mobile/rpc-foundation/goldens/settings-workspace-context-refused.json index ff80fcec21e6..5abf97f82062 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-context-refused.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-context-refused.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-context-transport-error.json b/mobile/rpc-foundation/goldens/settings-workspace-context-transport-error.json index cb3847b4becb..d7262a8d9335 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-context-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-context-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.workspace-context", "namedDeltas": ["new-workspace-runtime-context-null-results-degrade-to-absent"], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "fc73116d95985606fe32f22d3f14f434a6d5cd49219416c9fa0f47f971fa6ff0", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-submit-fulfilled.json b/mobile/rpc-foundation/goldens/settings-workspace-submit-fulfilled.json index 77dee7e13d73..c14e5708c0ce 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-submit-fulfilled.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-submit-fulfilled.json @@ -3,7 +3,7 @@ "family": "settings.workspace-submit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-submit-refused.json b/mobile/rpc-foundation/goldens/settings-workspace-submit-refused.json index a05ffe0f8ecb..37a2b5ef9cbc 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-submit-refused.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-submit-refused.json @@ -3,7 +3,7 @@ "family": "settings.workspace-submit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/settings-workspace-submit-transport-error.json b/mobile/rpc-foundation/goldens/settings-workspace-submit-transport-error.json index 5249b50344ff..5d7cc485d6b2 100644 --- a/mobile/rpc-foundation/goldens/settings-workspace-submit-transport-error.json +++ b/mobile/rpc-foundation/goldens/settings-workspace-submit-transport-error.json @@ -3,7 +3,7 @@ "family": "settings.workspace-submit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c2eed306311a844cd6f2f84b6513c0a1182f86a5e3cace434385b8287c80d7c5", diff --git a/mobile/rpc-foundation/goldens/speech-audio-chunk-acknowledged.json b/mobile/rpc-foundation/goldens/speech-audio-chunk-acknowledged.json index bbe5dfede8f4..6a67d75a0f40 100644 --- a/mobile/rpc-foundation/goldens/speech-audio-chunk-acknowledged.json +++ b/mobile/rpc-foundation/goldens/speech-audio-chunk-acknowledged.json @@ -3,7 +3,7 @@ "family": "speech.dictation-chunk", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-desktop-start-fulfilled.json b/mobile/rpc-foundation/goldens/speech-desktop-start-fulfilled.json index 87c4248cd47c..67ed20e3710f 100644 --- a/mobile/rpc-foundation/goldens/speech-desktop-start-fulfilled.json +++ b/mobile/rpc-foundation/goldens/speech-desktop-start-fulfilled.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-desktop-start-recording-failed.json b/mobile/rpc-foundation/goldens/speech-desktop-start-recording-failed.json index 38c3993f7c55..834ee80e8e16 100644 --- a/mobile/rpc-foundation/goldens/speech-desktop-start-recording-failed.json +++ b/mobile/rpc-foundation/goldens/speech-desktop-start-recording-failed.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-desktop-start-superseded.json b/mobile/rpc-foundation/goldens/speech-desktop-start-superseded.json index c412fe2e6ba0..b95b912f28e7 100644 --- a/mobile/rpc-foundation/goldens/speech-desktop-start-superseded.json +++ b/mobile/rpc-foundation/goldens/speech-desktop-start-superseded.json @@ -3,7 +3,7 @@ "family": "speech.dictation-start", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-dictation-session-cancelled.json b/mobile/rpc-foundation/goldens/speech-dictation-session-cancelled.json index 2e9f7373bffa..7f0ff48fca15 100644 --- a/mobile/rpc-foundation/goldens/speech-dictation-session-cancelled.json +++ b/mobile/rpc-foundation/goldens/speech-dictation-session-cancelled.json @@ -3,7 +3,7 @@ "family": "speech.dictation-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-dictation-session-transcript.json b/mobile/rpc-foundation/goldens/speech-dictation-session-transcript.json index f850611e6c25..7f5f2e8ec5db 100644 --- a/mobile/rpc-foundation/goldens/speech-dictation-session-transcript.json +++ b/mobile/rpc-foundation/goldens/speech-dictation-session-transcript.json @@ -3,7 +3,7 @@ "family": "speech.dictation-session", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-setup-sheet-denied-to-mobile.json b/mobile/rpc-foundation/goldens/speech-setup-sheet-denied-to-mobile.json index fb2d8d4f7ce6..76559248ae91 100644 --- a/mobile/rpc-foundation/goldens/speech-setup-sheet-denied-to-mobile.json +++ b/mobile/rpc-foundation/goldens/speech-setup-sheet-denied-to-mobile.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-setup-sheet-fulfilled.json b/mobile/rpc-foundation/goldens/speech-setup-sheet-fulfilled.json index 2195bfb30d7a..2148cd207629 100644 --- a/mobile/rpc-foundation/goldens/speech-setup-sheet-fulfilled.json +++ b/mobile/rpc-foundation/goldens/speech-setup-sheet-fulfilled.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-setup-sheet-legacy-desktop.json b/mobile/rpc-foundation/goldens/speech-setup-sheet-legacy-desktop.json index 30e2fffee620..73973586c8b4 100644 --- a/mobile/rpc-foundation/goldens/speech-setup-sheet-legacy-desktop.json +++ b/mobile/rpc-foundation/goldens/speech-setup-sheet-legacy-desktop.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/speech-setup-sheet-model-vocabulary.json b/mobile/rpc-foundation/goldens/speech-setup-sheet-model-vocabulary.json index 7ac10312b69c..224c6e49d737 100644 --- a/mobile/rpc-foundation/goldens/speech-setup-sheet-model-vocabulary.json +++ b/mobile/rpc-foundation/goldens/speech-setup-sheet-model-vocabulary.json @@ -3,7 +3,7 @@ "family": "speech.setup-sheet", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "5d978690e3626892b83bdba64537f9b1e1bb66c2060a00517ceead042a6d2334", diff --git a/mobile/rpc-foundation/goldens/structured-agent-session-created.json b/mobile/rpc-foundation/goldens/structured-agent-session-created.json index affd710223a7..dd1bf6e99a5a 100644 --- a/mobile/rpc-foundation/goldens/structured-agent-session-created.json +++ b/mobile/rpc-foundation/goldens/structured-agent-session-created.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-created.json b/mobile/rpc-foundation/goldens/structured-launch-created.json index 37241af0e8c6..bf2a2e0f42e5 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-created.json +++ b/mobile/rpc-foundation/goldens/structured-launch-created.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-definitive-refusal.json b/mobile/rpc-foundation/goldens/structured-launch-definitive-refusal.json index 25ba8d1df898..0d19d85ec3b4 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-definitive-refusal.json +++ b/mobile/rpc-foundation/goldens/structured-launch-definitive-refusal.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-replays-dropped-create.json b/mobile/rpc-foundation/goldens/structured-launch-replays-dropped-create.json index 5e88d8eac711..2902789d8c96 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-replays-dropped-create.json +++ b/mobile/rpc-foundation/goldens/structured-launch-replays-dropped-create.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-support-refused.json b/mobile/rpc-foundation/goldens/structured-launch-support-refused.json index f43915d8e835..e73320d67e3c 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-support-refused.json +++ b/mobile/rpc-foundation/goldens/structured-launch-support-refused.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/structured-launch-unsupported.json b/mobile/rpc-foundation/goldens/structured-launch-unsupported.json index f7faf6b482d5..1a87bc4c4ffd 100644 --- a/mobile/rpc-foundation/goldens/structured-launch-unsupported.json +++ b/mobile/rpc-foundation/goldens/structured-launch-unsupported.json @@ -3,7 +3,7 @@ "family": "agentSession.structured-launch", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d340697a64a198066b1037a550afb9a0de7507246a545901d2fc0a23407f38d6", diff --git a/mobile/rpc-foundation/goldens/tasks-route-repo-list.json b/mobile/rpc-foundation/goldens/tasks-route-repo-list.json index 3e084c448c7f..290bf8803853 100644 --- a/mobile/rpc-foundation/goldens/tasks-route-repo-list.json +++ b/mobile/rpc-foundation/goldens/tasks-route-repo-list.json @@ -3,7 +3,7 @@ "family": "tasks.route-repo-list", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "23f974df8b57c723069605de1db80c339ead286b18aae38e67fce03ea50c5180", diff --git a/mobile/rpc-foundation/goldens/terminal-gesture-flush-and-clear.json b/mobile/rpc-foundation/goldens/terminal-gesture-flush-and-clear.json index 53f0662a808e..2029b150b96f 100644 --- a/mobile/rpc-foundation/goldens/terminal-gesture-flush-and-clear.json +++ b/mobile/rpc-foundation/goldens/terminal-gesture-flush-and-clear.json @@ -3,7 +3,7 @@ "family": "session.terminal-gesture-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "9d119d5ec320e2538105d6ff673b9f4b8e3decbe46527947489dffbcf2ac0472", diff --git a/mobile/rpc-foundation/goldens/terminal-input-send-accepted.json b/mobile/rpc-foundation/goldens/terminal-input-send-accepted.json index af9abae2cc6a..90d2e5d7b699 100644 --- a/mobile/rpc-foundation/goldens/terminal-input-send-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-input-send-accepted.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-input-send-refused.json b/mobile/rpc-foundation/goldens/terminal-input-send-refused.json index b56cd3f63949..fc3cbf9ceb10 100644 --- a/mobile/rpc-foundation/goldens/terminal-input-send-refused.json +++ b/mobile/rpc-foundation/goldens/terminal-input-send-refused.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-live-input-accepted.json b/mobile/rpc-foundation/goldens/terminal-live-input-accepted.json index 2dc412990ce0..e4cf7f753315 100644 --- a/mobile/rpc-foundation/goldens/terminal-live-input-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-live-input-accepted.json @@ -3,7 +3,7 @@ "family": "session.terminal-input-send", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-paste-accepted.json b/mobile/rpc-foundation/goldens/terminal-paste-accepted.json index 63c315bedaef..a11282a2378d 100644 --- a/mobile/rpc-foundation/goldens/terminal-paste-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-paste-accepted.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-paste-refused.json b/mobile/rpc-foundation/goldens/terminal-paste-refused.json index 49d2d72949c1..6ee741a85e65 100644 --- a/mobile/rpc-foundation/goldens/terminal-paste-refused.json +++ b/mobile/rpc-foundation/goldens/terminal-paste-refused.json @@ -3,7 +3,7 @@ "family": "session.terminal-paste", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/terminal-query-reply-accepted.json b/mobile/rpc-foundation/goldens/terminal-query-reply-accepted.json index 267c1fba6eef..af4b89b745ed 100644 --- a/mobile/rpc-foundation/goldens/terminal-query-reply-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-query-reply-accepted.json @@ -3,7 +3,7 @@ "family": "terminal.query-reply", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-query-reply-unsubscribed.json b/mobile/rpc-foundation/goldens/terminal-query-reply-unsubscribed.json index ff7f371a4c43..2a4d6c75152c 100644 --- a/mobile/rpc-foundation/goldens/terminal-query-reply-unsubscribed.json +++ b/mobile/rpc-foundation/goldens/terminal-query-reply-unsubscribed.json @@ -3,7 +3,7 @@ "family": "terminal.query-reply", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-raw-input-refused.json b/mobile/rpc-foundation/goldens/terminal-raw-input-refused.json index 26ffb508c4a4..c8ec6a1c4c13 100644 --- a/mobile/rpc-foundation/goldens/terminal-raw-input-refused.json +++ b/mobile/rpc-foundation/goldens/terminal-raw-input-refused.json @@ -3,7 +3,7 @@ "family": "terminal.raw-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-raw-input-reported.json b/mobile/rpc-foundation/goldens/terminal-raw-input-reported.json index aee36c3ce7c0..daf232e08674 100644 --- a/mobile/rpc-foundation/goldens/terminal-raw-input-reported.json +++ b/mobile/rpc-foundation/goldens/terminal-raw-input-reported.json @@ -3,7 +3,7 @@ "family": "terminal.raw-input", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-takeover-report-accepted.json b/mobile/rpc-foundation/goldens/terminal-takeover-report-accepted.json index 123147a10b4e..cd7ab9ab2dff 100644 --- a/mobile/rpc-foundation/goldens/terminal-takeover-report-accepted.json +++ b/mobile/rpc-foundation/goldens/terminal-takeover-report-accepted.json @@ -3,7 +3,7 @@ "family": "terminal.takeover-report", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-takeover-report-retried.json b/mobile/rpc-foundation/goldens/terminal-takeover-report-retried.json index 006504661396..059ef635246d 100644 --- a/mobile/rpc-foundation/goldens/terminal-takeover-report-retried.json +++ b/mobile/rpc-foundation/goldens/terminal-takeover-report-retried.json @@ -3,7 +3,7 @@ "family": "terminal.takeover-report", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-viewport-refit-applied.json b/mobile/rpc-foundation/goldens/terminal-viewport-refit-applied.json index bfceb4f8565d..581b27eb0310 100644 --- a/mobile/rpc-foundation/goldens/terminal-viewport-refit-applied.json +++ b/mobile/rpc-foundation/goldens/terminal-viewport-refit-applied.json @@ -3,7 +3,7 @@ "family": "terminal.viewport-refit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-viewport-refit-legacy-desktop.json b/mobile/rpc-foundation/goldens/terminal-viewport-refit-legacy-desktop.json index d2517fbbb0d8..c60bedf21b24 100644 --- a/mobile/rpc-foundation/goldens/terminal-viewport-refit-legacy-desktop.json +++ b/mobile/rpc-foundation/goldens/terminal-viewport-refit-legacy-desktop.json @@ -3,7 +3,7 @@ "family": "terminal.viewport-refit", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "42e1fe434b591ab5a945b6b366bbb20b567085d58bade63413f2251e8202b255", diff --git a/mobile/rpc-foundation/goldens/terminal-worktree-connection-resolved.json b/mobile/rpc-foundation/goldens/terminal-worktree-connection-resolved.json index ffbc1b58c98a..73dda3c865be 100644 --- a/mobile/rpc-foundation/goldens/terminal-worktree-connection-resolved.json +++ b/mobile/rpc-foundation/goldens/terminal-worktree-connection-resolved.json @@ -3,7 +3,7 @@ "family": "session.worktree-connection", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "e7e3718f685e3713cf1b8209d59d618741f892bd286853b79bb456c59cec8d86", diff --git a/mobile/rpc-foundation/goldens/tk-create-github.json b/mobile/rpc-foundation/goldens/tk-create-github.json index 9830170d67b8..97b68c2b7862 100644 --- a/mobile/rpc-foundation/goldens/tk-create-github.json +++ b/mobile/rpc-foundation/goldens/tk-create-github.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-create-gitlab.json b/mobile/rpc-foundation/goldens/tk-create-gitlab.json index 8f1f8a62a986..9e8c31c0a144 100644 --- a/mobile/rpc-foundation/goldens/tk-create-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-create-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-create-linear.json b/mobile/rpc-foundation/goldens/tk-create-linear.json index 2a9126f46c34..cbe96ac449df 100644 --- a/mobile/rpc-foundation/goldens/tk-create-linear.json +++ b/mobile/rpc-foundation/goldens/tk-create-linear.json @@ -3,7 +3,7 @@ "family": "tasks.task-create-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-item-checks-files.json b/mobile/rpc-foundation/goldens/tk-item-checks-files.json index 114fedc21e0a..4cdfd0c51aff 100644 --- a/mobile/rpc-foundation/goldens/tk-item-checks-files.json +++ b/mobile/rpc-foundation/goldens/tk-item-checks-files.json @@ -3,7 +3,7 @@ "family": "tasks.item-checks-files", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/tk-item-comment-github.json b/mobile/rpc-foundation/goldens/tk-item-comment-github.json index 937620fb1714..2e0bdd7a3569 100644 --- a/mobile/rpc-foundation/goldens/tk-item-comment-github.json +++ b/mobile/rpc-foundation/goldens/tk-item-comment-github.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-comment-gitlab-mr.json b/mobile/rpc-foundation/goldens/tk-item-comment-gitlab-mr.json index 11fec15f8f1c..058313a23281 100644 --- a/mobile/rpc-foundation/goldens/tk-item-comment-gitlab-mr.json +++ b/mobile/rpc-foundation/goldens/tk-item-comment-gitlab-mr.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-comment-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-comment-gitlab.json index 8a390b7186a8..3ebefe16c046 100644 --- a/mobile/rpc-foundation/goldens/tk-item-comment-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-comment-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-comment-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-github-reactions.json b/mobile/rpc-foundation/goldens/tk-item-detail-github-reactions.json index b3d2c0fd311b..3e5c3a69a395 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-github-reactions.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-github-reactions.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-github.json b/mobile/rpc-foundation/goldens/tk-item-detail-github.json index 6a8dfa8fcf1c..2cf15710591f 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-github.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-github.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-gitlab-reactions.json b/mobile/rpc-foundation/goldens/tk-item-detail-gitlab-reactions.json index 7588e2b55743..1e93f61396b9 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-gitlab-reactions.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-gitlab-reactions.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-detail-gitlab.json index 57bb99c0af6c..6ecbce878a2c 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-linear.json b/mobile/rpc-foundation/goldens/tk-item-detail-linear.json index 02a387d6fd09..95534639bb01 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-linear.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-linear.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c0ef16b959002e4a3c5347114a0844b95670e274ef010d910b6671ac5f49e783", diff --git a/mobile/rpc-foundation/goldens/tk-item-detail-metadata.json b/mobile/rpc-foundation/goldens/tk-item-detail-metadata.json index bd56fe66b9d9..448813184229 100644 --- a/mobile/rpc-foundation/goldens/tk-item-detail-metadata.json +++ b/mobile/rpc-foundation/goldens/tk-item-detail-metadata.json @@ -3,7 +3,7 @@ "family": "tasks.item-detail-metadata", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/tk-item-merge-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-merge-gitlab.json index f5ff4f3bfe27..9f8de1556961 100644 --- a/mobile/rpc-foundation/goldens/tk-item-merge-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-merge-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-merge-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-metadata-github.json b/mobile/rpc-foundation/goldens/tk-item-metadata-github.json index e8db3fab93e9..b6da88a9d859 100644 --- a/mobile/rpc-foundation/goldens/tk-item-metadata-github.json +++ b/mobile/rpc-foundation/goldens/tk-item-metadata-github.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab-mr.json b/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab-mr.json index e7574077a8bc..ea380eb5a059 100644 --- a/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab-mr.json +++ b/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab-mr.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab.json index 75f62fb2bc81..810e824ceec4 100644 --- a/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-metadata-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-metadata-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/tk-item-reply-merge.json b/mobile/rpc-foundation/goldens/tk-item-reply-merge.json index c20fe0cd3cab..c62f847e1126 100644 --- a/mobile/rpc-foundation/goldens/tk-item-reply-merge.json +++ b/mobile/rpc-foundation/goldens/tk-item-reply-merge.json @@ -3,7 +3,7 @@ "family": "tasks.item-reply-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-review-github.json b/mobile/rpc-foundation/goldens/tk-item-review-github.json index 13691d478568..4deb1f092d16 100644 --- a/mobile/rpc-foundation/goldens/tk-item-review-github.json +++ b/mobile/rpc-foundation/goldens/tk-item-review-github.json @@ -3,7 +3,7 @@ "family": "tasks.item-review-github", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8f68885d57a9aa76d80ba0ee29a95bdbaa98cef29c79c68ce75d67202cde7bfe", diff --git a/mobile/rpc-foundation/goldens/tk-item-status-gitlab-mr.json b/mobile/rpc-foundation/goldens/tk-item-status-gitlab-mr.json index 589b2509acab..b06650daa5af 100644 --- a/mobile/rpc-foundation/goldens/tk-item-status-gitlab-mr.json +++ b/mobile/rpc-foundation/goldens/tk-item-status-gitlab-mr.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab-mr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/tk-item-status-gitlab.json b/mobile/rpc-foundation/goldens/tk-item-status-gitlab.json index 0575f6fb77b1..4b85268372e4 100644 --- a/mobile/rpc-foundation/goldens/tk-item-status-gitlab.json +++ b/mobile/rpc-foundation/goldens/tk-item-status-gitlab.json @@ -3,7 +3,7 @@ "family": "tasks.item-status-gitlab", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "8c4218bfb2af227da5386f29989cec438f2c6187f39ce1c06859e136ea920bfa", diff --git a/mobile/rpc-foundation/goldens/tk-linear-connect.json b/mobile/rpc-foundation/goldens/tk-linear-connect.json index 88ed753809b0..846d956b820e 100644 --- a/mobile/rpc-foundation/goldens/tk-linear-connect.json +++ b/mobile/rpc-foundation/goldens/tk-linear-connect.json @@ -3,7 +3,7 @@ "family": "tasks.linear-connect", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-linear-item.json b/mobile/rpc-foundation/goldens/tk-linear-item.json index 2be2f8b7b8b3..a53edae95990 100644 --- a/mobile/rpc-foundation/goldens/tk-linear-item.json +++ b/mobile/rpc-foundation/goldens/tk-linear-item.json @@ -3,7 +3,7 @@ "family": "tasks.linear-item", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "97cfbcd82778ed6517ca2d10b2f3ad5a8d366e380d7846c1e89d5a5baf17e739", diff --git a/mobile/rpc-foundation/goldens/tk-linear-team-context.json b/mobile/rpc-foundation/goldens/tk-linear-team-context.json index f95a5921fb73..3150b00e928f 100644 --- a/mobile/rpc-foundation/goldens/tk-linear-team-context.json +++ b/mobile/rpc-foundation/goldens/tk-linear-team-context.json @@ -3,7 +3,7 @@ "family": "tasks.linear-team-context", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "58ea1553e04017c993aea4753aace41ee664705a3fdb3b18569c5a9d7968cf06", diff --git a/mobile/rpc-foundation/goldens/tk-list-gitlab-items.json b/mobile/rpc-foundation/goldens/tk-list-gitlab-items.json index 17075a6ac7e6..9c91fd929cbe 100644 --- a/mobile/rpc-foundation/goldens/tk-list-gitlab-items.json +++ b/mobile/rpc-foundation/goldens/tk-list-gitlab-items.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-gitlab-items", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-list-gitlab-todos.json b/mobile/rpc-foundation/goldens/tk-list-gitlab-todos.json index 105030cfffcf..579f12b4e0cc 100644 --- a/mobile/rpc-foundation/goldens/tk-list-gitlab-todos.json +++ b/mobile/rpc-foundation/goldens/tk-list-gitlab-todos.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-gitlab-todos", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-list-linear.json b/mobile/rpc-foundation/goldens/tk-list-linear.json index e59427608a02..4d092d51f28c 100644 --- a/mobile/rpc-foundation/goldens/tk-list-linear.json +++ b/mobile/rpc-foundation/goldens/tk-list-linear.json @@ -3,7 +3,7 @@ "family": "tasks.task-list-linear", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/tk-project-board-load.json b/mobile/rpc-foundation/goldens/tk-project-board-load.json index 34f6c223cb83..943dbd2171a6 100644 --- a/mobile/rpc-foundation/goldens/tk-project-board-load.json +++ b/mobile/rpc-foundation/goldens/tk-project-board-load.json @@ -3,7 +3,7 @@ "family": "tasks.project-board-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/tk-project-repo-slugs.json b/mobile/rpc-foundation/goldens/tk-project-repo-slugs.json index a8da1a688d3a..81ffe92128b1 100644 --- a/mobile/rpc-foundation/goldens/tk-project-repo-slugs.json +++ b/mobile/rpc-foundation/goldens/tk-project-repo-slugs.json @@ -3,7 +3,7 @@ "family": "tasks.project-repo-slugs", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "c4272385ed3b0de4feab38de9e4f6363ecd6317fdd4de47f76a98eb18abaf371", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-comments-issue.json b/mobile/rpc-foundation/goldens/tk-project-row-comments-issue.json index e0551419589f..949d1dbdbbc6 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-comments-issue.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-comments-issue.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-issue", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-comments-pr.json b/mobile/rpc-foundation/goldens/tk-project-row-comments-pr.json index 4dc462a452db..5c9d694994bb 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-comments-pr.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-comments-pr.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-comments-pr", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-detail.json b/mobile/rpc-foundation/goldens/tk-project-row-detail.json index 77e96fd0a809..044028aef216 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-detail.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-detail.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-detail", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-fields.json b/mobile/rpc-foundation/goldens/tk-project-row-fields.json index 4b6aca5c43f3..55ad55163654 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-fields.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-fields.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-fields", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-files-merge.json b/mobile/rpc-foundation/goldens/tk-project-row-files-merge.json index 3ce1d9fe9843..67a69ea0393d 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-files-merge.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-files-merge.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-files-merge", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "b228732762828412ad3d9eec3ece00a897d866046e37044322c3911758d6e0a9", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-metadata-load.json b/mobile/rpc-foundation/goldens/tk-project-row-metadata-load.json index 18af22344d0e..3904cef43117 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-metadata-load.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-metadata-load.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-metadata-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "f8f6e5d500f959b9b15c5498885a05422747880b6aef4ad795bc3064ebbacea6", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-review-checks.json b/mobile/rpc-foundation/goldens/tk-project-row-review-checks.json index a0c52914a8fc..da2395d92e52 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-review-checks.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-review-checks.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-review-checks", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "370aeaee59978071ccb821da13c9e6114936c168947b608539cdb80d40cc9889", diff --git a/mobile/rpc-foundation/goldens/tk-project-row-threads.json b/mobile/rpc-foundation/goldens/tk-project-row-threads.json index edfa9242eef2..70ceddb80920 100644 --- a/mobile/rpc-foundation/goldens/tk-project-row-threads.json +++ b/mobile/rpc-foundation/goldens/tk-project-row-threads.json @@ -3,7 +3,7 @@ "family": "tasks.project-row-threads", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "55058202df36c8b951510215936e496ea88d3d71a6690090a13c52deb13e34e1", diff --git a/mobile/rpc-foundation/goldens/tk-provider-load.json b/mobile/rpc-foundation/goldens/tk-provider-load.json index 3d3e4ad8534b..7d5ac795b308 100644 --- a/mobile/rpc-foundation/goldens/tk-provider-load.json +++ b/mobile/rpc-foundation/goldens/tk-provider-load.json @@ -3,7 +3,7 @@ "family": "tasks.provider-load", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "07a15e900363faa25bc364f5bc1c330f96798abfeaed35210428c2ac558586b8", diff --git a/mobile/rpc-foundation/goldens/transport-capability-probe-cutover-reasks-fast.json b/mobile/rpc-foundation/goldens/transport-capability-probe-cutover-reasks-fast.json index cfbce33331d5..934a09b8de38 100644 --- a/mobile/rpc-foundation/goldens/transport-capability-probe-cutover-reasks-fast.json +++ b/mobile/rpc-foundation/goldens/transport-capability-probe-cutover-reasks-fast.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-capability-probe-non-string-capabilities-drop.json b/mobile/rpc-foundation/goldens/transport-capability-probe-non-string-capabilities-drop.json index 59e0b1ec0d12..f204e48c5006 100644 --- a/mobile/rpc-foundation/goldens/transport-capability-probe-non-string-capabilities-drop.json +++ b/mobile/rpc-foundation/goldens/transport-capability-probe-non-string-capabilities-drop.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-capability-probe-publishes.json b/mobile/rpc-foundation/goldens/transport-capability-probe-publishes.json index 8cd9d2180288..6fe86b71a24a 100644 --- a/mobile/rpc-foundation/goldens/transport-capability-probe-publishes.json +++ b/mobile/rpc-foundation/goldens/transport-capability-probe-publishes.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-capability-probe-refused-backs-off.json b/mobile/rpc-foundation/goldens/transport-capability-probe-refused-backs-off.json index 363f217f67e3..7d1c70b77d9a 100644 --- a/mobile/rpc-foundation/goldens/transport-capability-probe-refused-backs-off.json +++ b/mobile/rpc-foundation/goldens/transport-capability-probe-refused-backs-off.json @@ -3,7 +3,7 @@ "family": "transport.capability-probe", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-host-status-gates-drop-keeps-capabilities.json b/mobile/rpc-foundation/goldens/transport-host-status-gates-drop-keeps-capabilities.json index d19121177929..7e3d011ad973 100644 --- a/mobile/rpc-foundation/goldens/transport-host-status-gates-drop-keeps-capabilities.json +++ b/mobile/rpc-foundation/goldens/transport-host-status-gates-drop-keeps-capabilities.json @@ -3,7 +3,7 @@ "family": "transport.host-status-gates", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-host-status-gates-ready.json b/mobile/rpc-foundation/goldens/transport-host-status-gates-ready.json index 0d313eb204a3..49826dee6bd7 100644 --- a/mobile/rpc-foundation/goldens/transport-host-status-gates-ready.json +++ b/mobile/rpc-foundation/goldens/transport-host-status-gates-ready.json @@ -3,7 +3,7 @@ "family": "transport.host-status-gates", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-host-status-gates-refused-degrades.json b/mobile/rpc-foundation/goldens/transport-host-status-gates-refused-degrades.json index daafc2f194a5..a10131c2a39e 100644 --- a/mobile/rpc-foundation/goldens/transport-host-status-gates-refused-degrades.json +++ b/mobile/rpc-foundation/goldens/transport-host-status-gates-refused-degrades.json @@ -3,7 +3,7 @@ "family": "transport.host-status-gates", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-pairing-race-both-refused.json b/mobile/rpc-foundation/goldens/transport-pairing-race-both-refused.json index 1b02fe839e6f..460002781fda 100644 --- a/mobile/rpc-foundation/goldens/transport-pairing-race-both-refused.json +++ b/mobile/rpc-foundation/goldens/transport-pairing-race-both-refused.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-pairing-race-direct-completes-first.json b/mobile/rpc-foundation/goldens/transport-pairing-race-direct-completes-first.json index adcfd69373f9..0413371cb08e 100644 --- a/mobile/rpc-foundation/goldens/transport-pairing-race-direct-completes-first.json +++ b/mobile/rpc-foundation/goldens/transport-pairing-race-direct-completes-first.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-pairing-race-relay-completes-first.json b/mobile/rpc-foundation/goldens/transport-pairing-race-relay-completes-first.json index d65876fc4ecc..f1bdfadf093d 100644 --- a/mobile/rpc-foundation/goldens/transport-pairing-race-relay-completes-first.json +++ b/mobile/rpc-foundation/goldens/transport-pairing-race-relay-completes-first.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/transport-pairing-race-relay-wins-when-direct-refused.json b/mobile/rpc-foundation/goldens/transport-pairing-race-relay-wins-when-direct-refused.json index 86f3ee3ab582..51c4c340c412 100644 --- a/mobile/rpc-foundation/goldens/transport-pairing-race-relay-wins-when-direct-refused.json +++ b/mobile/rpc-foundation/goldens/transport-pairing-race-relay-wins-when-direct-refused.json @@ -3,7 +3,7 @@ "family": "transport.pairing-race", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "34b382b13fe75e8ef4002325287c95b3c4db62eeaaf3762af7fbaf6f836c2fa1", diff --git a/mobile/rpc-foundation/goldens/tw-capabilities-advertised.json b/mobile/rpc-foundation/goldens/tw-capabilities-advertised.json index 34dd6a265cac..6cb44346bcd5 100644 --- a/mobile/rpc-foundation/goldens/tw-capabilities-advertised.json +++ b/mobile/rpc-foundation/goldens/tw-capabilities-advertised.json @@ -3,7 +3,7 @@ "family": "worktree.runtime-capabilities", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-capabilities-cutover-retried.json b/mobile/rpc-foundation/goldens/tw-capabilities-cutover-retried.json index 7f8e6c35efed..9c2c0ce90be7 100644 --- a/mobile/rpc-foundation/goldens/tw-capabilities-cutover-retried.json +++ b/mobile/rpc-foundation/goldens/tw-capabilities-cutover-retried.json @@ -3,7 +3,7 @@ "family": "worktree.runtime-capabilities", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-capabilities-legacy-idempotency.json b/mobile/rpc-foundation/goldens/tw-capabilities-legacy-idempotency.json index 3ec385f6f9d5..293d40543934 100644 --- a/mobile/rpc-foundation/goldens/tw-capabilities-legacy-idempotency.json +++ b/mobile/rpc-foundation/goldens/tw-capabilities-legacy-idempotency.json @@ -3,7 +3,7 @@ "family": "worktree.runtime-capabilities", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-agent-launched.json b/mobile/rpc-foundation/goldens/tw-create-retry-agent-launched.json index 6d54ac9bd0f9..06897da697d2 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-agent-launched.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-agent-launched.json @@ -3,7 +3,7 @@ "family": "worktree.agent-launch-create", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-after-drop.json b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-after-drop.json index a339da97815f..d0a290e02d5f 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-after-drop.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-after-drop.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-while-connected.json b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-while-connected.json index f3a296d40383..705f673283ee 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-while-connected.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-while-connected.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-without-idempotency.json b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-without-idempotency.json index 226e3704417a..a9ee18f5fd37 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-without-idempotency.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-ambiguous-without-idempotency.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-created.json b/mobile/rpc-foundation/goldens/tw-create-retry-created.json index 328da8b46637..3d401c51a144 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-created.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-created.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-name-collision.json b/mobile/rpc-foundation/goldens/tw-create-retry-name-collision.json index 8e2f03728146..62b80b0b0f21 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-name-collision.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-name-collision.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-unretryable-refusal.json b/mobile/rpc-foundation/goldens/tw-create-retry-unretryable-refusal.json index 79d832aa93cb..7704fba5335d 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-unretryable-refusal.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-unretryable-refusal.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-create-retry-warning-kept.json b/mobile/rpc-foundation/goldens/tw-create-retry-warning-kept.json index 2f6fb9691fe4..7e8f49a396ed 100644 --- a/mobile/rpc-foundation/goldens/tw-create-retry-warning-kept.json +++ b/mobile/rpc-foundation/goldens/tw-create-retry-warning-kept.json @@ -3,7 +3,7 @@ "family": "worktree.create-retry", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-hosted-base-resolved.json b/mobile/rpc-foundation/goldens/tw-hosted-base-resolved.json index 8a68e2be5b0b..ae16a8732858 100644 --- a/mobile/rpc-foundation/goldens/tw-hosted-base-resolved.json +++ b/mobile/rpc-foundation/goldens/tw-hosted-base-resolved.json @@ -3,7 +3,7 @@ "family": "worktree.hosted-base", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-hosted-base-soft-error.json b/mobile/rpc-foundation/goldens/tw-hosted-base-soft-error.json index a5a19cb97450..f0814a999a19 100644 --- a/mobile/rpc-foundation/goldens/tw-hosted-base-soft-error.json +++ b/mobile/rpc-foundation/goldens/tw-hosted-base-soft-error.json @@ -3,7 +3,7 @@ "family": "worktree.hosted-base", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-paste-lookup-resolved.json b/mobile/rpc-foundation/goldens/tw-paste-lookup-resolved.json index 9fa9a5c28864..9885cf5025e2 100644 --- a/mobile/rpc-foundation/goldens/tw-paste-lookup-resolved.json +++ b/mobile/rpc-foundation/goldens/tw-paste-lookup-resolved.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-refused.json b/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-refused.json index 4636455e202c..ee51e1f7e208 100644 --- a/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-refused.json +++ b/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-refused.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-unsupported.json b/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-unsupported.json index 893cca287b6f..be1437b65588 100644 --- a/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-unsupported.json +++ b/mobile/rpc-foundation/goldens/tw-paste-lookup-slug-unsupported.json @@ -3,7 +3,7 @@ "family": "tasks.paste-lookup", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-setup-hook-trust-always.json b/mobile/rpc-foundation/goldens/tw-setup-hook-trust-always.json index 267496fd5558..1dc9de896728 100644 --- a/mobile/rpc-foundation/goldens/tw-setup-hook-trust-always.json +++ b/mobile/rpc-foundation/goldens/tw-setup-hook-trust-always.json @@ -3,7 +3,7 @@ "family": "worktree.setup-hook-trust", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-setup-hook-trust-approved.json b/mobile/rpc-foundation/goldens/tw-setup-hook-trust-approved.json index b7502a2fbd9d..29f6508a1023 100644 --- a/mobile/rpc-foundation/goldens/tw-setup-hook-trust-approved.json +++ b/mobile/rpc-foundation/goldens/tw-setup-hook-trust-approved.json @@ -3,7 +3,7 @@ "family": "worktree.setup-hook-trust", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-smart-search-all-providers.json b/mobile/rpc-foundation/goldens/tw-smart-search-all-providers.json index 4495984796dd..8efd95cbd83a 100644 --- a/mobile/rpc-foundation/goldens/tw-smart-search-all-providers.json +++ b/mobile/rpc-foundation/goldens/tw-smart-search-all-providers.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-smart-search-gitlab-provider-error.json b/mobile/rpc-foundation/goldens/tw-smart-search-gitlab-provider-error.json index 0dcb43858260..bc0034b9cf93 100644 --- a/mobile/rpc-foundation/goldens/tw-smart-search-gitlab-provider-error.json +++ b/mobile/rpc-foundation/goldens/tw-smart-search-gitlab-provider-error.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-smart-search-linear-listed.json b/mobile/rpc-foundation/goldens/tw-smart-search-linear-listed.json index 6dba57e250b5..732ba4a5fc75 100644 --- a/mobile/rpc-foundation/goldens/tw-smart-search-linear-listed.json +++ b/mobile/rpc-foundation/goldens/tw-smart-search-linear-listed.json @@ -3,7 +3,7 @@ "family": "tasks.smart-source-search", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "52a76b7a830b32287bce14abbe1b9d9ac70e71eafe5b4c6801c2eb14a4150125", diff --git a/mobile/rpc-foundation/goldens/tw-task-preferences-resume-write.json b/mobile/rpc-foundation/goldens/tw-task-preferences-resume-write.json index 52720072511e..ca77155f5df9 100644 --- a/mobile/rpc-foundation/goldens/tw-task-preferences-resume-write.json +++ b/mobile/rpc-foundation/goldens/tw-task-preferences-resume-write.json @@ -3,7 +3,7 @@ "family": "settings-best-effort", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "d3b7f33d810e1fa420ac41a628cde9fe4a9e65fd57f89fbca0a40fc7d74951ab", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-source-presets-refused.json b/mobile/rpc-foundation/goldens/tw-workspace-source-presets-refused.json index b65f14ebf0ab..4b8acbb29730 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-source-presets-refused.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-source-presets-refused.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-source", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-source-presets.json b/mobile/rpc-foundation/goldens/tw-workspace-source-presets.json index e6674e63ca30..d45a2618cd51 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-source-presets.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-source-presets.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-source", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-sparse-missing-preset.json b/mobile/rpc-foundation/goldens/tw-workspace-sparse-missing-preset.json index d908aa970ff1..9a3a7e5b6b9c 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-sparse-missing-preset.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-sparse-missing-preset.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-sparse", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-sparse-saved.json b/mobile/rpc-foundation/goldens/tw-workspace-sparse-saved.json index f7c7b9d3509b..7dc69202c867 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-sparse-saved.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-sparse-saved.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-sparse", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-ssh-connect-refused.json b/mobile/rpc-foundation/goldens/tw-workspace-ssh-connect-refused.json index 6b4d1c0fcb43..58893ee59742 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-ssh-connect-refused.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-ssh-connect-refused.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-ssh-connected.json b/mobile/rpc-foundation/goldens/tw-workspace-ssh-connected.json index c93bbbcdef57..1683f8218d2b 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-ssh-connected.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-ssh-connected.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-ssh-local-agents.json b/mobile/rpc-foundation/goldens/tw-workspace-ssh-local-agents.json index ccfccc512c36..16c4f4555c95 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-ssh-local-agents.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-ssh-local-agents.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh-local", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/tw-workspace-ssh-not-ready.json b/mobile/rpc-foundation/goldens/tw-workspace-ssh-not-ready.json index acd77a24c78a..7728d271c729 100644 --- a/mobile/rpc-foundation/goldens/tw-workspace-ssh-not-ready.json +++ b/mobile/rpc-foundation/goldens/tw-workspace-ssh-not-ready.json @@ -3,7 +3,7 @@ "family": "tasks.workspace-ssh", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e567302ac8acffcfd602c9b323ecf8b5b7c0c4692bda1a4c881011a91d98979", diff --git a/mobile/rpc-foundation/goldens/worktree-catalog-snapshot-unreadable.json b/mobile/rpc-foundation/goldens/worktree-catalog-snapshot-unreadable.json index 44cec939c661..8ebe6cbfabbe 100644 --- a/mobile/rpc-foundation/goldens/worktree-catalog-snapshot-unreadable.json +++ b/mobile/rpc-foundation/goldens/worktree-catalog-snapshot-unreadable.json @@ -3,7 +3,7 @@ "family": "worktree.catalog-snapshot", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/worktree-catalog-snapshot.json b/mobile/rpc-foundation/goldens/worktree-catalog-snapshot.json index c09e3cbce452..a4a8ae811e56 100644 --- a/mobile/rpc-foundation/goldens/worktree-catalog-snapshot.json +++ b/mobile/rpc-foundation/goldens/worktree-catalog-snapshot.json @@ -3,7 +3,7 @@ "family": "worktree.catalog-snapshot", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/worktree-home-catalog.json b/mobile/rpc-foundation/goldens/worktree-home-catalog.json index c0b50f6fdb90..3b2f9113feb3 100644 --- a/mobile/rpc-foundation/goldens/worktree-home-catalog.json +++ b/mobile/rpc-foundation/goldens/worktree-home-catalog.json @@ -3,7 +3,7 @@ "family": "worktree.home-catalog", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/goldens/worktree-retired-names.json b/mobile/rpc-foundation/goldens/worktree-retired-names.json index 14cdb3646167..2bbd621adcb3 100644 --- a/mobile/rpc-foundation/goldens/worktree-retired-names.json +++ b/mobile/rpc-foundation/goldens/worktree-retired-names.json @@ -3,7 +3,7 @@ "family": "worktree.retired-names", "namedDeltas": [], "runnerVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "lockfileSha256": "9317f3a98ab047f9f96fe26fd8531b8a632ac5954064b322f41a904148cbf6bb", "recorderSha256": "0317fe2aebe4743ce5e7ae194531aa91b4fe0a84df457640851fe6dfdb9362af", "adapterSha256": "4e942ddfbaa0ba6bfc2993969276987f6528ac53765d125e99a830e261f93a8e", diff --git a/mobile/rpc-foundation/pilot-scenarios.json b/mobile/rpc-foundation/pilot-scenarios.json index 254c36272b10..647e4dcad018 100644 --- a/mobile/rpc-foundation/pilot-scenarios.json +++ b/mobile/rpc-foundation/pilot-scenarios.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "baseline": "03995ae29d28dd39bd2546423831987db68985de", + "baseline": "ccdb324b63e4942891942edde1216586a51774bd", "scenarios": [ { "id": "b1", From ec9f35e2eeee0a9adb55282c8e7e7a7c46596b21 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 19:22:10 -0700 Subject: [PATCH 51/90] perf(ci): plan the unit shards before the static-analysis gate instead of behind it (#23743) A caller's `needs` gate the whole called workflow, so while the plan job lived in unit-tests.yml it could not start until static analysis and typecheck had both finished and passed -- and the shard matrix then waited on it. The two hops were serial when they did not need to be: planning reads the checkout, a git diff against HEAD^1, the import graph and the checked-in timing baseline in config/scripts/ci-shard-timings.json, and consumes nothing that static analysis, typecheck or the native-cache primer produce. Planning moves to its own reusable workflow so pr.yml can run it against code_paths alone, overlapping it with the gate. Measured across 99 runs, the shard matrix is created a median 93s earlier (p25 47s, p90 241s, never later). Planning stays a required predecessor of the shards, so an empty assignment cannot expand the matrix. The gate itself is deliberately left in place. It fires on 22% of runs, and the shard queue wait knees hard above ~9 concurrent ARM jobs -- 4s median below that against 218s at 15-19 -- so admitting 8 doomed shards per failed run would cost more in queue pressure than it returns in latency. Cost is one 37s ubuntu-latest job, which does not touch the ARM pool the shards contend for. A planning failure still fails the PR: the shards are skipped, and verify's check_job requires success whenever the classifier says tests should run, so it reports `test: expected success, got skipped`. --- .github/workflows/node-next-compat.yml | 6 ++- .github/workflows/pr.yml | 16 ++++++- .github/workflows/unit-plan.yml | 48 +++++++++++++++++++ .github/workflows/unit-tests.yml | 33 ++----------- config/scripts/pr-code-change-scope.test.mjs | 7 +++ .../scripts/pr-workflow-parallelism.test.mjs | 10 ++-- 6 files changed, 85 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/unit-plan.yml diff --git a/.github/workflows/node-next-compat.yml b/.github/workflows/node-next-compat.yml index cb0d303f8c5d..fc9b9cedaf92 100644 --- a/.github/workflows/node-next-compat.yml +++ b/.github/workflows/node-next-compat.yml @@ -34,8 +34,12 @@ jobs: native-runtime: node node-version: ${{ matrix.node }} + unit_plan: + uses: ./.github/workflows/unit-plan.yml + test: - needs: [test_native_cache] + needs: [test_native_cache, unit_plan] uses: ./.github/workflows/unit-tests.yml with: node_versions: '["24", "26"]' + shards: ${{ needs.unit_plan.outputs.shards }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ba3ba7556ed1..2a4065bff474 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -640,12 +640,24 @@ jobs: native-runtime: node node-version: '24' + # Why hoisted out of unit-tests.yml: a caller's `needs` gate the whole called workflow, so + # while planning lived in there it queued behind static analysis and typecheck and the shards + # then queued behind it. Planning needs none of their output, so running it against + # code_paths alone overlaps it with the gate. Measured a median 93s off the matrix's start. + unit_plan: + needs: [code_paths] + if: needs.code_paths.outputs.test == 'true' + uses: ./.github/workflows/unit-plan.yml + with: + selection_mode: ${{ vars.ORCA_UNIT_SELECTION_MODE || 'shadow' }} + test: - needs: [code_paths, test_native_cache, static_analysis, typecheck] + needs: [code_paths, unit_plan, test_native_cache, static_analysis, typecheck] # Honor cancellation while allowing the optional native-cache primer to skip. if: >- !cancelled() && needs.code_paths.outputs.test == 'true' && + needs.unit_plan.result == 'success' && needs.static_analysis.result == 'success' && needs.typecheck.result == 'success' && (needs.test_native_cache.result == 'success' || needs.test_native_cache.result == 'skipped') @@ -653,7 +665,7 @@ jobs: with: node_versions: '["24"]' runner: ubuntu-24.04-arm - selection_mode: ${{ vars.ORCA_UNIT_SELECTION_MODE || 'shadow' }} + shards: ${{ needs.unit_plan.outputs.shards }} # Why a separate job: the test needs a real Chrome, and the sharded `test` matrix # would pay for it on every shard to run one file in whichever shard it landed in. diff --git a/.github/workflows/unit-plan.yml b/.github/workflows/unit-plan.yml new file mode 100644 index 000000000000..b427908b26d1 --- /dev/null +++ b/.github/workflows/unit-plan.yml @@ -0,0 +1,48 @@ +name: Unit plan + +# Why its own workflow: the caller's `needs` gate the whole called workflow, so while this lived +# inside unit-tests.yml it waited on static analysis and typecheck before it could even start — +# and the shards then waited on it. Planning needs neither (its inputs are the checkout, a git +# diff against HEAD^1, the import graph, and the checked-in timing baseline), so hoisting it out +# lets it overlap the gate instead of queueing behind it. Measured: a median 93s off the shard +# matrix's start. +on: + workflow_call: + inputs: + selection_mode: + description: Shadow validates selection; selected applies it only to draft PRs. + required: false + default: shadow + type: string + + outputs: + shards: + description: JSON array of shard assignments for the unit matrix. + value: ${{ jobs.plan.outputs.shards }} + +permissions: + contents: read + +jobs: + plan: + runs-on: ubuntu-latest + timeout-minutes: 5 + outputs: + shards: ${{ steps.plan.outputs.shards }} + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 2 + persist-credentials: false + - uses: ./.github/actions/install-node-dependencies + - name: Plan unit selection + id: plan + env: + ORCA_UNIT_SELECTION_MODE: ${{ inputs.selection_mode }} + run: node config/scripts/ci-unit-plan.mjs + - uses: actions/upload-artifact@v7 + continue-on-error: true + with: + name: unit-selection-attempt-${{ github.run_attempt }} + path: ci-shards/unit-selection.json + retention-days: 14 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 9ed968476773..0090387b75cf 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -14,48 +14,23 @@ on: default: ubuntu-latest type: string - selection_mode: - description: Shadow validates selection; selected applies it only to draft PRs. - required: false - default: shadow + shards: + description: JSON array of shard assignments, produced by unit-plan.yml. + required: true type: string permissions: contents: read jobs: - plan: - runs-on: ubuntu-latest - timeout-minutes: 5 - outputs: - shards: ${{ steps.plan.outputs.shards }} - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 2 - persist-credentials: false - - uses: ./.github/actions/install-node-dependencies - - name: Plan unit selection - id: plan - env: - ORCA_UNIT_SELECTION_MODE: ${{ inputs.selection_mode }} - run: node config/scripts/ci-unit-plan.mjs - - uses: actions/upload-artifact@v7 - continue-on-error: true - with: - name: unit-selection-attempt-${{ github.run_attempt }} - path: ci-shards/unit-selection.json - retention-days: 14 - test: - needs: plan name: tests node ${{ matrix.node }} ${{ matrix.shard.index }}/${{ matrix.shard.count }} runs-on: ${{ inputs.runner }} strategy: fail-fast: false matrix: node: ${{ fromJSON(inputs.node_versions) }} - shard: ${{ fromJSON(needs.plan.outputs.shards) }} + shard: ${{ fromJSON(inputs.shards) }} steps: - name: Checkout diff --git a/config/scripts/pr-code-change-scope.test.mjs b/config/scripts/pr-code-change-scope.test.mjs index c23ea0e11406..1981623d2816 100644 --- a/config/scripts/pr-code-change-scope.test.mjs +++ b/config/scripts/pr-code-change-scope.test.mjs @@ -597,10 +597,17 @@ describe('PR Checks skip wiring', () => { } expect(prWorkflow.jobs.test.needs).toEqual([ 'code_paths', + 'unit_plan', 'test_native_cache', 'static_analysis', 'typecheck' ]) + // Planning is deliberately NOT behind the static-analysis gate: it consumes nothing those + // jobs produce, so gating it only made the shards queue behind it. It still has to succeed + // before the shards run, or the matrix would expand from an empty assignment. + expect(prWorkflow.jobs.unit_plan.needs).toEqual(['code_paths']) + expect(prWorkflow.jobs.unit_plan.if).toBe("needs.code_paths.outputs.test == 'true'") + expect(prWorkflow.jobs.test.if).toContain("needs.unit_plan.result == 'success'") expect(prWorkflow.jobs.test.if).toContain("needs.code_paths.outputs.test == 'true'") expect(prWorkflow.jobs.test.if).toContain("needs.test_native_cache.result == 'success'") expect(prWorkflow.jobs.test.if).toContain("needs.test_native_cache.result == 'skipped'") diff --git a/config/scripts/pr-workflow-parallelism.test.mjs b/config/scripts/pr-workflow-parallelism.test.mjs index 6804527fe3cc..6054f0261444 100644 --- a/config/scripts/pr-workflow-parallelism.test.mjs +++ b/config/scripts/pr-workflow-parallelism.test.mjs @@ -107,8 +107,12 @@ describe('PR workflow parallelism', () => { expect(nodeNextWorkflow.on.schedule).toHaveLength(1) expect(nodeNextWorkflow.on.workflow_dispatch).toBeNull() expect(sharedTest.strategy.matrix.node).toBe('${{ fromJSON(inputs.node_versions) }}') - expect(sharedTest.strategy.matrix.shard).toBe('${{ fromJSON(needs.plan.outputs.shards) }}') - expect(sharedTest.needs).toBe('plan') + expect(sharedTest.strategy.matrix.shard).toBe('${{ fromJSON(inputs.shards) }}') + // The shard matrix no longer needs an in-workflow plan job: planning moved to + // unit-plan.yml so it can run before the static-analysis gate clears. + expect(sharedTest.needs).toBeUndefined() + expect(unitTestWorkflow.jobs.plan).toBeUndefined() + expect(unitTestWorkflow.on.workflow_call.inputs.shards.required).toBe(true) expect(installStep.with['node-version']).toBe('${{ matrix.node }}') expect(installStep.with['cache-electron-package']).toBe('true') expect(testStep.run).toContain('--shard=${{ matrix.shard.index }}/${{ matrix.shard.count }}') @@ -120,7 +124,7 @@ describe('PR workflow parallelism', () => { expect(workflow.jobs.test.needs).toContain('test_native_cache') expect(nodeNextPrimerInstall.with['native-runtime']).toBe('node') expect(nodeNextPrimerInstall.with['node-version']).toBe('${{ matrix.node }}') - expect(nodeNextWorkflow.jobs.test.needs).toEqual(['test_native_cache']) + expect(nodeNextWorkflow.jobs.test.needs).toEqual(['test_native_cache', 'unit_plan']) }) it('runs real-shell coverage once outside the general shards', () => { From a134d1259e195862ca66916262fd2c54029e6849 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 28 Sep 2026 22:28:50 -0400 Subject: [PATCH 52/90] feat(mobile): tell users when a newer app binary is installable (#23755) * feat(mobile): tell users when a newer app binary is installable With OTA page updates, store releases get rare and users stop looking. The shell now asks the channel that installed it. Android sideload reads GitHub's mobile-android-v* tag refs and proves the release has an APK. iOS reads the App Store lookup. A home card above Desktops, dismissible per version, and Settings rows surface the result. The check runs on the desktop updater's cadence: cold start, foreground once 24 h have passed, and a 1 h retry after a failure. The releases atom feed was not used because it lists only the 10 newest releases, which are all desktop builds, so it never carries a mobile tag. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): parse update replies with zod schemas The anti-slop gate refuses Reflect.get on dynamic input. The GitHub refs, the release, the App Store lookup and the stored update record are now parsed into named schemas before they are read. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * docs(mobile): say why the Android update source reads tag refs Record why the Android source reads tag refs. The releases atom feed and /releases?per_page=100 are both newest-first windows that desktop releases fill. Either would silently report "current" once a run of desktop builds pushes the newest mobile release out. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): load update state once and apply review rulings Every check and dismissal now awaits one shared store load. This replaces the merge that guessed whether a check had landed during the load. A manual check that fails while the store loads therefore keeps its 1 h retry instead of re-checking at once. - checking is derived from the in-flight check. - start() uses a per-start flag, so a StrictMode double start applies one load. - A check that finishes after stop() writes nothing. - A corrupt stored update record loses only itself. - Tag refs are parsed with a single schema. - The runtime wiring is folded into one file, and the card moves to home/. - The recorded App Store fixture is oxfmt-formatted, with the same parsed value. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): keep the update timer armed across a stop and restart A check that stayed in flight across stop and restart returned 'failed' without rescheduling. The restart skipped arming because a check was in flight, which left a live checker with no timer until the next foreground. The stop counter is removed. schedule() already arms nothing while no start is active, and saving a real result after a stop is harmless. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * chore: retrigger CI after the RPC recording repin (#23757) landed on main Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * refactor(mobile): trim the update checker and Settings rows - The load sets prefs and the due time only. start() re-arms the schedule after it. - The Settings result hides through one effect keyed on the result. - onUpdate receives the URL. - The version row is bound once. - The retry and timeout constants are no longer exported. - The unused AppUpdateChecker type is deleted. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): run the update check when its timer fires The armed timer is the due time. Re-checking the wall clock when the timer fired meant a clock stepped back skipped the check and re-armed nothing. The due-time guard now applies only on foreground. The binary version still comes from expoConfig.version. SDK 55 removed Constants.nativeAppVersion, so the no-expo-updates invariant is now named in the comment. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * fix(mobile): recover from a future check time and use Apple's page URL If the device clock was ahead when a check ran and was corrected later, the stored check time is in the future. Cold starts then armed a timer for the whole skew, and foreground never came due. The stored state now reads as never checked in that case. The iOS link is the lookup's trackViewUrl instead of a URL built from trackId. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb * style(mobile): fit the future-check-time comment in the print width Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb --- mobile/app/_layout.tsx | 3 + mobile/app/settings.tsx | 2 + .../src/app-update/app-store-update-source.ts | 37 +++ .../src/app-update/app-update-checker.test.ts | 293 ++++++++++++++++++ mobile/src/app-update/app-update-checker.ts | 202 ++++++++++++ mobile/src/app-update/app-update-runtime.ts | 59 ++++ mobile/src/app-update/app-update-source.ts | 24 ++ .../src/app-update/app-update-sources.test.ts | 196 ++++++++++++ .../github-mobile-android-tag-refs.json | 242 +++++++++++++++ ...github-release-mobile-android-v0.0.50.json | 92 ++++++ .../itunes-lookup-com.stably.orca.mobile.json | 189 +++++++++++ .../github-release-update-source.ts | 77 +++++ mobile/src/home/AppUpdateCard.test.tsx | 50 +++ mobile/src/home/AppUpdateCard.tsx | 86 +++++ mobile/src/home/MobileHomeAppUpdateCard.tsx | 27 ++ mobile/src/home/MobileHomeListHeader.tsx | 2 + .../app-update-settings-rows.test.tsx | 90 ++++++ .../src/settings/app-update-settings-rows.tsx | 100 ++++++ .../settings/settings-app-update-section.tsx | 52 ++++ .../storage/app-update-preferences.test.ts | 32 ++ mobile/src/storage/app-update-preferences.ts | 64 ++++ 21 files changed, 1919 insertions(+) create mode 100644 mobile/src/app-update/app-store-update-source.ts create mode 100644 mobile/src/app-update/app-update-checker.test.ts create mode 100644 mobile/src/app-update/app-update-checker.ts create mode 100644 mobile/src/app-update/app-update-runtime.ts create mode 100644 mobile/src/app-update/app-update-source.ts create mode 100644 mobile/src/app-update/app-update-sources.test.ts create mode 100644 mobile/src/app-update/fixtures/github-mobile-android-tag-refs.json create mode 100644 mobile/src/app-update/fixtures/github-release-mobile-android-v0.0.50.json create mode 100644 mobile/src/app-update/fixtures/itunes-lookup-com.stably.orca.mobile.json create mode 100644 mobile/src/app-update/github-release-update-source.ts create mode 100644 mobile/src/home/AppUpdateCard.test.tsx create mode 100644 mobile/src/home/AppUpdateCard.tsx create mode 100644 mobile/src/home/MobileHomeAppUpdateCard.tsx create mode 100644 mobile/src/settings/app-update-settings-rows.test.tsx create mode 100644 mobile/src/settings/app-update-settings-rows.tsx create mode 100644 mobile/src/settings/settings-app-update-section.tsx create mode 100644 mobile/src/storage/app-update-preferences.test.ts create mode 100644 mobile/src/storage/app-update-preferences.ts diff --git a/mobile/app/_layout.tsx b/mobile/app/_layout.tsx index c65008db7ce0..711ee41ffd30 100644 --- a/mobile/app/_layout.tsx +++ b/mobile/app/_layout.tsx @@ -24,6 +24,7 @@ import { ensureDesktopNotificationChannel } from '../src/notifications/desktop-n import { loadHostCatalog } from '../src/transport/host-store' import { extractPairingCodeFromUrl } from '../src/transport/pairing' import { recoverMobileRelayPairing } from '../src/transport/mobile-relay-pairing-recovery' +import { appUpdateChecker } from '../src/app-update/app-update-runtime' // Why: keeps the native splash screen visible until the React tree is mounted // and ready to render. Without this the user sees a blank white/black frame @@ -65,6 +66,8 @@ export default function RootLayout() { // Why: a rolled APNs/FCM token stops delivering silently, so every paired host // has to be re-registered with the new one as soon as the provider hands it over. useEffect(() => startPushTokenSync(), []) + // Cold start, then foreground and timer checks on the desktop updater's cadence. + useEffect(() => appUpdateChecker.start(), []) useEffect(() => startAndroidForegroundPushPresentation(), []) // Why: route `orca://pair?...` deep links to the confirm screen so diff --git a/mobile/app/settings.tsx b/mobile/app/settings.tsx index eb954a8e83d0..8b3267e2f86b 100644 --- a/mobile/app/settings.tsx +++ b/mobile/app/settings.tsx @@ -2,6 +2,7 @@ import { Linking } from 'react-native' import { useRouter } from 'expo-router' import SettingsMenuScreen from '../src/settings/settings-menu-screen' import { PendingCredentialCleanupCard } from '../src/settings/pending-credential-cleanup-card' +import { SettingsAppUpdateSection } from '../src/settings/settings-app-update-section' export default function NativeSettingsRoute() { const router = useRouter() @@ -10,6 +11,7 @@ export default function NativeSettingsRoute() { push={(route) => router.push(route)} openExternal={(url) => Linking.openURL(url)} > + ) diff --git a/mobile/src/app-update/app-store-update-source.ts b/mobile/src/app-update/app-store-update-source.ts new file mode 100644 index 000000000000..cad70e0840d3 --- /dev/null +++ b/mobile/src/app-update/app-store-update-source.ts @@ -0,0 +1,37 @@ +import { z } from 'zod' +import type { AppUpdateCheckResult, AppUpdateSource } from './app-update-source' +import { isNewerReleaseVersion } from './app-update-source' + +const LOOKUP_URL = 'https://itunes.apple.com/lookup?bundleId=com.stably.orca.mobile' + +type Fetch = typeof fetch + +const lookupSchema = z.looseObject({ results: z.array(z.unknown()) }) +const listingSchema = z.looseObject({ version: z.string(), trackViewUrl: z.string() }) + +/** + * The store listing's version and page. TestFlight installs have no receipt signal without a new + * dependency; they stay quiet because their build is at or ahead of the store's version. + */ +export function parseAppStoreLookup(reply: unknown): { version: string; url: string } | null { + const lookup = lookupSchema.safeParse(reply) + const listing = listingSchema.safeParse(lookup.success ? lookup.data.results[0] : null) + return listing.success ? { version: listing.data.version, url: listing.data.trackViewUrl } : null +} + +export function createAppStoreUpdateSource(fetchImpl: Fetch): AppUpdateSource { + return { + async check(installedVersion, signal): Promise { + const reply = await fetchImpl(LOOKUP_URL, { signal }) + if (!reply.ok) { + throw new Error(`App Store lookup HTTP ${reply.status}`) + } + const listing = parseAppStoreLookup(await reply.json()) + return listing && isNewerReleaseVersion(listing.version, installedVersion) + ? { kind: 'available', version: listing.version, url: listing.url } + : { kind: 'current' } + } + } +} + +export const appStoreUpdateSource = createAppStoreUpdateSource((input, init) => fetch(input, init)) diff --git a/mobile/src/app-update/app-update-checker.test.ts b/mobile/src/app-update/app-update-checker.test.ts new file mode 100644 index 000000000000..c76c7d1be76c --- /dev/null +++ b/mobile/src/app-update/app-update-checker.test.ts @@ -0,0 +1,293 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import type { AppUpdatePreferences } from '../storage/app-update-preferences' +import { + APP_UPDATE_CHECK_INTERVAL_MS, + createAppUpdateChecker, + undismissedAppUpdate, + type AppUpdateCheckerDeps +} from './app-update-checker' +import type { AppUpdateCheckResult, AppUpdateSource } from './app-update-source' + +const HOUR = 60 * 60 * 1000 +const T0 = Date.UTC(2026, 8, 28, 12) +const RELEASE_051 = { version: '0.0.51', url: 'https://example.test/0.0.51' } + +type Harness = ReturnType + +function harness(opts: { + stored?: Partial + installedVersion?: string + replies?: (AppUpdateCheckResult | Error | 'hang' | Promise)[] + load?: Promise +}) { + const replies = [...(opts.replies ?? [])] + let foreground: () => void = () => {} + const saves: unknown[] = [] + const source: AppUpdateSource = { + check: vi.fn(async () => { + const reply = replies.shift() ?? { kind: 'current' } + if (reply instanceof Promise) { + return reply + } + if (reply === 'hang') { + return new Promise(() => {}) + } + if (reply instanceof Error) { + throw reply + } + return reply + }) + } + const deps = { + source, + installedVersion: opts.installedVersion ?? '0.0.48', + now: () => Date.now(), + setTimer: (run: () => void, delayMs: number) => setTimeout(run, delayMs), + clearTimer: (handle: ReturnType) => clearTimeout(handle), + subscribeForeground: (listener: () => void) => { + foreground = listener + return () => { + foreground = () => {} + } + }, + loadPreferences: vi.fn(async () => { + await opts.load + return { + lastCheckedAt: null, + latest: null, + dismissedVersion: null, + ...opts.stored + } + }), + saveCheck: async (checkedAt: number, latest: AppUpdatePreferences['latest']) => { + saves.push({ checkedAt, latest }) + }, + saveDismissedVersion: async (version: string) => { + saves.push({ dismissed: version }) + } + } satisfies AppUpdateCheckerDeps + const checker = createAppUpdateChecker(deps) + return { checker, source, saves, deps, foreground: () => foreground() } +} + +const checks = (h: Harness) => vi.mocked(h.source.check).mock.calls.length + +describe('app update checker', () => { + beforeEach(() => { + vi.useFakeTimers() + vi.setSystemTime(T0) + }) + afterEach(() => { + vi.useRealTimers() + }) + + it('checks on cold start when it has never succeeded, and records the result', async () => { + const h = harness({ replies: [{ kind: 'available', ...RELEASE_051 }] }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + expect(checks(h)).toBe(1) + expect(h.checker.getSnapshot()).toMatchObject({ lastCheckedAt: T0, available: RELEASE_051 }) + expect(h.saves).toEqual([{ checkedAt: T0, latest: RELEASE_051 }]) + }) + + it('skips the cold-start check inside 24 h, then runs it when the day is up', async () => { + const h = harness({ stored: { lastCheckedAt: T0 - 2 * HOUR, latest: RELEASE_051 } }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + expect(checks(h)).toBe(0) + expect(h.checker.getSnapshot().available).toEqual(RELEASE_051) + await vi.advanceTimersByTimeAsync(22 * HOUR - 1) + expect(checks(h)).toBe(0) + await vi.advanceTimersByTimeAsync(1) + expect(checks(h)).toBe(1) + }) + + it('checks on foreground only once the last success is 24 h old', async () => { + const h = harness({ stored: { lastCheckedAt: T0 - 23 * HOUR } }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + h.foreground() + await vi.advanceTimersByTimeAsync(0) + expect(checks(h)).toBe(0) + // Background suspends timers; the system clock still moves. + vi.setSystemTime(T0 + HOUR) + h.foreground() + await vi.advanceTimersByTimeAsync(0) + expect(checks(h)).toBe(1) + }) + + it('retries a failed check after 1 h, not sooner, and keeps the last success time', async () => { + const h = harness({ + stored: { lastCheckedAt: T0 - 30 * HOUR }, + replies: [new Error('offline')] + }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + expect(checks(h)).toBe(1) + expect(h.checker.getSnapshot().lastCheckedAt).toBe(T0 - 30 * HOUR) + h.foreground() + await vi.advanceTimersByTimeAsync(HOUR - 1) + expect(checks(h)).toBe(1) + await vi.advanceTimersByTimeAsync(1) + expect(checks(h)).toBe(2) + expect(h.checker.getSnapshot().lastCheckedAt).toBe(T0 + HOUR) + }) + + it('bounds a check at 8 s and counts it as failed', async () => { + const h = harness({ stored: { lastCheckedAt: T0 }, replies: ['hang'] }) + h.checker.start() + const outcome = h.checker.checkNow() + await vi.advanceTimersByTimeAsync(8000) + await expect(outcome).resolves.toBe('failed') + expect(h.checker.getSnapshot().checking).toBe(false) + }) + + it('joins a manual check to one already in flight', async () => { + const h = harness({ stored: { lastCheckedAt: T0 }, replies: [{ kind: 'current' }] }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + const [first, second] = [h.checker.checkNow(), h.checker.checkNow()] + await expect(Promise.all([first, second])).resolves.toEqual(['up-to-date', 'up-to-date']) + expect(checks(h)).toBe(1) + }) + + it('manual check reschedules the next automatic check a full day out', async () => { + const h = harness({ stored: { lastCheckedAt: T0 - 23 * HOUR } }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + await h.checker.checkNow() + await vi.advanceTimersByTimeAsync(24 * HOUR - 1) + expect(checks(h)).toBe(1) + await vi.advanceTimersByTimeAsync(1) + expect(checks(h)).toBe(2) + }) + + it('dismisses one version only; the next release offers again', async () => { + const h = harness({ + stored: { lastCheckedAt: T0 - 25 * HOUR }, + replies: [ + { kind: 'available', ...RELEASE_051 }, + { kind: 'available', version: '0.0.52', url: 'https://example.test/0.0.52' } + ] + }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + h.checker.dismiss('0.0.51') + await vi.advanceTimersByTimeAsync(0) + expect(undismissedAppUpdate(h.checker.getSnapshot())).toBeNull() + expect(h.checker.getSnapshot().available).toEqual(RELEASE_051) + expect(h.saves).toContainEqual({ dismissed: '0.0.51' }) + await h.checker.checkNow() + expect(undismissedAppUpdate(h.checker.getSnapshot())?.version).toBe('0.0.52') + }) + + it('keeps a stored dismissal across restarts', async () => { + const h = harness({ + stored: { lastCheckedAt: T0, latest: RELEASE_051, dismissedVersion: '0.0.51' } + }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + expect(undismissedAppUpdate(h.checker.getSnapshot())).toBeNull() + }) + + it('stops offering a stored update once the binary has been updated to it', async () => { + const h = harness({ + installedVersion: '0.0.51', + stored: { lastCheckedAt: T0, latest: RELEASE_051 } + }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + expect(h.checker.getSnapshot().available).toBeNull() + }) + + it('stops scheduling after stop()', async () => { + const h = harness({ stored: { lastCheckedAt: T0 - 2 * HOUR } }) + const stop = h.checker.start() + await vi.advanceTimersByTimeAsync(0) + stop() + await vi.advanceTimersByTimeAsync(2 * APP_UPDATE_CHECK_INTERVAL_MS) + expect(checks(h)).toBe(0) + }) + + it('keeps the 1 h retry for a manual check that fails while the store is still loading', async () => { + let finishLoad: () => void = () => {} + const h = harness({ + stored: { lastCheckedAt: T0 - 30 * HOUR }, + replies: [new Error('offline')], + load: new Promise((resolve) => { + finishLoad = resolve + }) + }) + h.checker.start() + const outcome = h.checker.checkNow() + finishLoad() + await expect(outcome).resolves.toBe('failed') + await vi.advanceTimersByTimeAsync(HOUR - 1) + expect(checks(h)).toBe(1) + await vi.advanceTimersByTimeAsync(1) + expect(checks(h)).toBe(2) + }) + + it('applies one load and runs one check across a StrictMode-style double start', async () => { + const h = harness({}) + h.checker.start()() + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + expect(h.deps.loadPreferences).toHaveBeenCalledTimes(1) + expect(checks(h)).toBe(1) + }) + + function deferredReply() { + let answer: (result: AppUpdateCheckResult) => void = () => {} + const reply = new Promise((resolve) => { + answer = resolve + }) + return { reply, answer: (result: AppUpdateCheckResult) => answer(result) } + } + + it('arms no timer for a check that finishes after stop()', async () => { + const pending = deferredReply() + const h = harness({ stored: { lastCheckedAt: T0 }, replies: [pending.reply] }) + const stop = h.checker.start() + await vi.advanceTimersByTimeAsync(0) + const outcome = h.checker.checkNow() + await vi.advanceTimersByTimeAsync(0) + stop() + pending.answer({ kind: 'current' }) + await outcome + expect(vi.getTimerCount()).toBe(0) + }) + + it('schedules the next check when a check in flight across stop and restart completes', async () => { + const pending = deferredReply() + const h = harness({ stored: { lastCheckedAt: T0 }, replies: [pending.reply] }) + const stop = h.checker.start() + await vi.advanceTimersByTimeAsync(0) + const outcome = h.checker.checkNow() + await vi.advanceTimersByTimeAsync(0) + stop() + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + pending.answer({ kind: 'current' }) + await outcome + expect(vi.getTimerCount()).toBe(1) + await vi.advanceTimersByTimeAsync(24 * HOUR) + expect(checks(h)).toBe(2) + }) + + it('runs the check when the armed timer fires even if the clock stepped back', async () => { + const h = harness({ stored: { lastCheckedAt: T0 - 2 * HOUR } }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + vi.setSystemTime(Date.now() - 10 * 60 * 1000) + await vi.advanceTimersByTimeAsync(22 * HOUR) + expect(checks(h)).toBe(1) + }) + + it('treats a stored check time ahead of the clock as never checked', async () => { + const h = harness({ stored: { lastCheckedAt: T0 + 365 * 24 * HOUR } }) + h.checker.start() + await vi.advanceTimersByTimeAsync(0) + expect(checks(h)).toBe(1) + }) +}) diff --git a/mobile/src/app-update/app-update-checker.ts b/mobile/src/app-update/app-update-checker.ts new file mode 100644 index 000000000000..7c2855d93734 --- /dev/null +++ b/mobile/src/app-update/app-update-checker.ts @@ -0,0 +1,202 @@ +import type { AppUpdatePreferences, KnownAppUpdate } from '../storage/app-update-preferences' +import { EMPTY_APP_UPDATE_PREFERENCES } from '../storage/app-update-preferences' +import type { AppUpdateSource } from './app-update-source' +import { isNewerReleaseVersion } from './app-update-source' + +// Same cadence as the desktop updater (src/main/updater-events.ts). +export const APP_UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000 +const APP_UPDATE_RETRY_INTERVAL_MS = 60 * 60 * 1000 +const APP_UPDATE_CHECK_TIMEOUT_MS = 8000 + +type TimerHandle = ReturnType + +export type AppUpdateCheckOutcome = 'available' | 'up-to-date' | 'failed' + +export type AppUpdateState = { + readonly lastCheckedAt: number | null + /** Newer than the installed binary; recomputed from `latest`, so installing it clears this. */ + readonly available: KnownAppUpdate | null + readonly dismissedVersion: string | null + readonly checking: boolean +} + +/** The update home should offer: dismissal hides only the version that was dismissed. */ +export function undismissedAppUpdate(state: AppUpdateState): KnownAppUpdate | null { + return state.available && state.available.version !== state.dismissedVersion + ? state.available + : null +} + +export type AppUpdateCheckerDeps = { + source: AppUpdateSource | null + installedVersion: string | null + now: () => number + setTimer: (run: () => void, delayMs: number) => TimerHandle + clearTimer: (handle: TimerHandle) => void + subscribeForeground: (onForeground: () => void) => () => void + loadPreferences: () => Promise + saveCheck: (checkedAt: number, latest: KnownAppUpdate | null) => Promise + saveDismissedVersion: (version: string) => Promise +} + +export function createAppUpdateChecker(deps: AppUpdateCheckerDeps) { + let prefs = EMPTY_APP_UPDATE_PREFERENCES + let loaded: Promise | null = null + let inFlight: Promise | null = null + let nextDueAt = 0 + let timer: TimerHandle | null = null + let activeStarts = 0 + let snapshot = buildSnapshot() + const listeners = new Set<() => void>() + + function buildSnapshot(): AppUpdateState { + const latest = prefs.latest + const available = + latest && + deps.installedVersion && + isNewerReleaseVersion(latest.version, deps.installedVersion) + ? latest + : null + return { + lastCheckedAt: prefs.lastCheckedAt, + available, + dismissedVersion: prefs.dismissedVersion, + checking: inFlight !== null + } + } + + function publish(): void { + snapshot = buildSnapshot() + for (const listener of listeners) { + listener() + } + } + + function clearScheduled(): void { + if (timer !== null) { + deps.clearTimer(timer) + timer = null + } + } + + function schedule(dueAt: number): void { + nextDueAt = dueAt + clearScheduled() + if (activeStarts > 0) { + timer = deps.setTimer( + () => { + timer = null + // The timer is the due time; re-reading the wall clock would stall on a clock step back. + if (activeStarts > 0 && inFlight === null) { + void checkNow() + } + }, + Math.max(0, dueAt - deps.now()) + ) + } + } + + /** The stored state is read once; every check and dismissal waits for it, so none is overwritten. */ + function ensureLoaded(): Promise { + loaded ??= deps.loadPreferences().then((stored) => { + prefs = stored + // A stored check time ahead of the clock (clock since corrected) would defer the next check. + const checkedAt = stored.lastCheckedAt + nextDueAt = + checkedAt === null || checkedAt > deps.now() ? 0 : checkedAt + APP_UPDATE_CHECK_INTERVAL_MS + publish() + }) + return loaded + } + + function runIfDue(): void { + void ensureLoaded().then(() => { + if (activeStarts > 0 && inFlight === null && deps.now() >= nextDueAt) { + void checkNow() + } + }) + } + + async function runCheck(source: AppUpdateSource, installed: string) { + await ensureLoaded() + const controller = new AbortController() + // Why race: the bound holds even for a request that does not honour the signal. + const timedOut = new Promise((_, reject) => { + controller.signal.addEventListener('abort', () => reject(new Error('update check timed out'))) + }) + const timeout = deps.setTimer(() => controller.abort(), APP_UPDATE_CHECK_TIMEOUT_MS) + try { + const result = await Promise.race([source.check(installed, controller.signal), timedOut]) + const checkedAt = deps.now() + const latest = + result.kind === 'available' ? { version: result.version, url: result.url } : null + prefs = { ...prefs, lastCheckedAt: checkedAt, latest } + schedule(checkedAt + APP_UPDATE_CHECK_INTERVAL_MS) + await deps.saveCheck(checkedAt, latest).catch(() => {}) + return latest ? 'available' : 'up-to-date' + } catch { + schedule(deps.now() + APP_UPDATE_RETRY_INTERVAL_MS) + return 'failed' + } finally { + deps.clearTimer(timeout) + } + } + + /** Runs now whatever the cadence says; joins a check already in flight. */ + function checkNow(): Promise { + const { source, installedVersion } = deps + if (!source || !installedVersion) { + return Promise.resolve('failed') + } + if (inFlight === null) { + inFlight = runCheck(source, installedVersion).finally(() => { + inFlight = null + publish() + }) + publish() + } + return inFlight + } + + /** Cold start: reads what the last run saw, then checks only if the cadence says it is due. */ + function start(): () => void { + let active = true + activeStarts += 1 + const unsubscribe = deps.subscribeForeground(runIfDue) + void ensureLoaded().then(() => { + if (active && inFlight === null) { + schedule(nextDueAt) + } + }) + return () => { + if (!active) { + return + } + active = false + activeStarts -= 1 + unsubscribe() + if (activeStarts === 0) { + clearScheduled() + } + } + } + + function dismiss(version: string): void { + void ensureLoaded().then(() => { + prefs = { ...prefs, dismissedVersion: version } + publish() + void deps.saveDismissedVersion(version).catch(() => {}) + }) + } + + return { + start, + checkNow, + dismiss, + getSnapshot: (): AppUpdateState => snapshot, + subscribe(listener: () => void): () => void { + listeners.add(listener) + return () => listeners.delete(listener) + } + } +} diff --git a/mobile/src/app-update/app-update-runtime.ts b/mobile/src/app-update/app-update-runtime.ts new file mode 100644 index 000000000000..aa2d72c76088 --- /dev/null +++ b/mobile/src/app-update/app-update-runtime.ts @@ -0,0 +1,59 @@ +import Constants from 'expo-constants' +import * as Linking from 'expo-linking' +import { useSyncExternalStore } from 'react' +import { AppState, Platform } from 'react-native' +import { + loadAppUpdatePreferences, + saveAppUpdateCheck, + saveDismissedAppUpdateVersion +} from '../storage/app-update-preferences' +import { appStoreUpdateSource } from './app-store-update-source' +import { createAppUpdateChecker, type AppUpdateState } from './app-update-checker' +import type { AppUpdateSource } from './app-update-source' +import { githubReleaseUpdateSource } from './github-release-update-source' + +/** + * Invariant: this app does not use expo-updates, so `expoConfig` is the manifest embedded in the + * binary and its version is the binary's (app.json `version`, Android `versionName`). SDK 55 + * removed `Constants.nativeAppVersion`; adopting expo-updates would make this the update's version. + */ +export const installedAppVersion: string | null = Constants.expoConfig?.version ?? null + +/** The channel that installed this binary. */ +function resolveAppUpdateSource(): AppUpdateSource | null { + if (Platform.OS === 'android') { + return githubReleaseUpdateSource + } + if (Platform.OS === 'ios') { + return appStoreUpdateSource + } + return null +} + +export const appUpdateChecker = createAppUpdateChecker({ + source: resolveAppUpdateSource(), + installedVersion: installedAppVersion, + now: () => Date.now(), + setTimer: (run, delayMs) => setTimeout(run, delayMs), + clearTimer: (handle) => clearTimeout(handle), + subscribeForeground: (onForeground) => { + const subscription = AppState.addEventListener('change', (state) => { + if (state === 'active') { + onForeground() + } + }) + return () => subscription.remove() + }, + loadPreferences: loadAppUpdatePreferences, + saveCheck: saveAppUpdateCheck, + saveDismissedVersion: saveDismissedAppUpdateVersion +}) + +export function useAppUpdateState(): AppUpdateState { + return useSyncExternalStore(appUpdateChecker.subscribe, appUpdateChecker.getSnapshot) +} + +/** Opens the channel's page for the update: the GitHub release (Android) or App Store (iOS). */ +export function openAppUpdate(url: string): void { + void Linking.openURL(url).catch(() => {}) +} diff --git a/mobile/src/app-update/app-update-source.ts b/mobile/src/app-update/app-update-source.ts new file mode 100644 index 000000000000..3fe41b7a1ab5 --- /dev/null +++ b/mobile/src/app-update/app-update-source.ts @@ -0,0 +1,24 @@ +import { + compareAppVersions, + isPrereleaseAppVersion, + isValidAppVersion +} from '../../../src/shared/app-version' + +export type AppUpdateCheckResult = + | { kind: 'available'; version: string; url: string } + | { kind: 'current' } + +/** One install channel. Rejects when the channel could not be asked; never retries itself. */ +export type AppUpdateSource = { + check(installedVersion: string, signal: AbortSignal): Promise +} + +/** True for a plain release version newer than the installed one; prerelease suffixes never qualify. */ +export function isNewerReleaseVersion(candidate: string, installed: string): boolean { + return ( + isValidAppVersion(candidate) && + isValidAppVersion(installed) && + !isPrereleaseAppVersion(candidate) && + compareAppVersions(candidate, installed) > 0 + ) +} diff --git a/mobile/src/app-update/app-update-sources.test.ts b/mobile/src/app-update/app-update-sources.test.ts new file mode 100644 index 000000000000..22c04b641a76 --- /dev/null +++ b/mobile/src/app-update/app-update-sources.test.ts @@ -0,0 +1,196 @@ +import { readFileSync } from 'node:fs' +import { describe, expect, it } from 'vitest' +import { createAppStoreUpdateSource, parseAppStoreLookup } from './app-store-update-source' +import { isNewerReleaseVersion } from './app-update-source' +import { + createGithubReleaseUpdateSource, + installableReleaseUrl, + parseMobileAndroidTagVersions +} from './github-release-update-source' + +// Recorded once from the live endpoints on 2026-09-28, unedited. +function fixture(name: string): unknown { + return JSON.parse(readFileSync(new URL(`./fixtures/${name}`, import.meta.url), 'utf8')) +} +const tagRefs = fixture('github-mobile-android-tag-refs.json') +const release050 = fixture('github-release-mobile-android-v0.0.50.json') +const lookup = fixture('itunes-lookup-com.stably.orca.mobile.json') + +const REFS_URL = + 'https://api.github.com/repos/stablyai/orca/git/matching-refs/tags/mobile-android-v' +const releaseUrl = (version: string) => + `https://api.github.com/repos/stablyai/orca/releases/tags/mobile-android-v${version}` + +function fakeFetch(routes: Record) { + const requested: string[] = [] + const fetchImpl: typeof fetch = async (input) => { + const url = String(input) + requested.push(url) + const route = routes[url] + if (!route) { + throw new Error(`unexpected request ${url}`) + } + return new Response(JSON.stringify(route.body ?? {}), { status: route.status }) + } + return { fetchImpl, requested } +} + +const signal = new AbortController().signal + +describe('version compare', () => { + it('orders plain versions numerically and ignores prerelease or malformed candidates', () => { + expect(isNewerReleaseVersion('0.0.51', '0.0.48')).toBe(true) + expect(isNewerReleaseVersion('0.0.10', '0.0.9')).toBe(true) + expect(isNewerReleaseVersion('0.0.48', '0.0.48')).toBe(false) + expect(isNewerReleaseVersion('0.0.47', '0.0.48')).toBe(false) + expect(isNewerReleaseVersion('0.0.52-rc.1', '0.0.48')).toBe(false) + expect(isNewerReleaseVersion('latest', '0.0.48')).toBe(false) + }) +}) + +describe('GitHub release source (Android sideload)', () => { + it('reads every mobile-android tag from the recorded refs', () => { + const versions = parseMobileAndroidTagVersions(tagRefs) + expect(versions).toHaveLength(24) + expect(versions).toContain('0.0.50') + expect(versions).not.toContain('0.0.49') + }) + + it('accepts the recorded release only because it is published with an APK', () => { + expect(installableReleaseUrl(release050)).toBe( + 'https://github.com/stablyai/orca/releases/tag/mobile-android-v0.0.50' + ) + expect(installableReleaseUrl({ ...Object(release050), draft: true })).toBeNull() + expect(installableReleaseUrl({ ...Object(release050), assets: [] })).toBeNull() + }) + + it('offers the newest tag above the installed version once its release is proven', async () => { + const { fetchImpl, requested } = fakeFetch({ + [REFS_URL]: { status: 200, body: tagRefs }, + [releaseUrl('0.0.50')]: { status: 200, body: release050 } + }) + await expect( + createGithubReleaseUpdateSource(fetchImpl).check('0.0.47', signal) + ).resolves.toEqual({ + kind: 'available', + version: '0.0.50', + url: 'https://github.com/stablyai/orca/releases/tag/mobile-android-v0.0.50' + }) + expect(requested).toEqual([REFS_URL, releaseUrl('0.0.50')]) + }) + + it('falls back past a tag whose build never published a release', async () => { + const release048 = { ...Object(release050), html_url: 'https://example.test/048' } + const { fetchImpl } = fakeFetch({ + [REFS_URL]: { status: 200, body: tagRefs }, + [releaseUrl('0.0.50')]: { status: 404 }, + [releaseUrl('0.0.48')]: { status: 200, body: release048 } + }) + await expect( + createGithubReleaseUpdateSource(fetchImpl).check('0.0.47', signal) + ).resolves.toEqual({ + kind: 'available', + version: '0.0.48', + url: 'https://example.test/048' + }) + }) + + it('probes at most three candidates and then reports current', async () => { + const { fetchImpl, requested } = fakeFetch({ + [REFS_URL]: { status: 200, body: tagRefs }, + [releaseUrl('0.0.50')]: { status: 404 }, + [releaseUrl('0.0.48')]: { status: 404 }, + [releaseUrl('0.0.47')]: { status: 404 } + }) + await expect( + createGithubReleaseUpdateSource(fetchImpl).check('0.0.14', signal) + ).resolves.toEqual({ + kind: 'current' + }) + expect(requested).toHaveLength(4) + }) + + it('makes no release probe when nothing is newer', async () => { + const { fetchImpl, requested } = fakeFetch({ [REFS_URL]: { status: 200, body: tagRefs } }) + await expect( + createGithubReleaseUpdateSource(fetchImpl).check('0.0.51', signal) + ).resolves.toEqual({ + kind: 'current' + }) + expect(requested).toEqual([REFS_URL]) + }) + + it('opens the release page GitHub reports, not one built from the tag', async () => { + const renamed = { + ...Object(release050), + html_url: 'https://github.com/stablyai/orca/releases/tag/renamed-page' + } + const { fetchImpl } = fakeFetch({ + [REFS_URL]: { status: 200, body: tagRefs }, + [releaseUrl('0.0.50')]: { status: 200, body: renamed } + }) + await expect( + createGithubReleaseUpdateSource(fetchImpl).check('0.0.48', signal) + ).resolves.toEqual({ + kind: 'available', + version: '0.0.50', + url: 'https://github.com/stablyai/orca/releases/tag/renamed-page' + }) + }) + + it('rejects on a release probe 5xx instead of moving to an older candidate', async () => { + const { fetchImpl, requested } = fakeFetch({ + [REFS_URL]: { status: 200, body: tagRefs }, + [releaseUrl('0.0.50')]: { status: 502 } + }) + await expect( + createGithubReleaseUpdateSource(fetchImpl).check('0.0.47', signal) + ).rejects.toThrow('release HTTP 502') + expect(requested).toEqual([REFS_URL, releaseUrl('0.0.50')]) + }) + + it('rejects when a release probe cannot reach GitHub', async () => { + const { fetchImpl } = fakeFetch({ [REFS_URL]: { status: 200, body: tagRefs } }) + await expect( + createGithubReleaseUpdateSource(fetchImpl).check('0.0.47', signal) + ).rejects.toThrow('unexpected request') + }) + + it('rejects when GitHub refuses, so the check counts as failed rather than current', async () => { + const { fetchImpl } = fakeFetch({ [REFS_URL]: { status: 403 } }) + await expect( + createGithubReleaseUpdateSource(fetchImpl).check('0.0.47', signal) + ).rejects.toThrow('tag refs HTTP 403') + }) +}) + +describe('App Store source (iOS)', () => { + const LOOKUP = 'https://itunes.apple.com/lookup?bundleId=com.stably.orca.mobile' + + it('reads the store version and App Store page from the recorded lookup', () => { + expect(parseAppStoreLookup(lookup)).toEqual({ + version: '0.0.51', + url: 'https://apps.apple.com/us/app/orca-ide/id6766130217?uo=4' + }) + }) + + it('offers the store version only when it is newer than the installed one', async () => { + const { fetchImpl } = fakeFetch({ [LOOKUP]: { status: 200, body: lookup } }) + const source = createAppStoreUpdateSource(fetchImpl) + await expect(source.check('0.0.48', signal)).resolves.toEqual({ + kind: 'available', + version: '0.0.51', + url: 'https://apps.apple.com/us/app/orca-ide/id6766130217?uo=4' + }) + await expect(source.check('0.0.51', signal)).resolves.toEqual({ kind: 'current' }) + }) + + it('stays quiet when the lookup has no listing for this bundle id', async () => { + const { fetchImpl } = fakeFetch({ + [LOOKUP]: { status: 200, body: { resultCount: 0, results: [] } } + }) + await expect(createAppStoreUpdateSource(fetchImpl).check('0.0.1', signal)).resolves.toEqual({ + kind: 'current' + }) + }) +}) diff --git a/mobile/src/app-update/fixtures/github-mobile-android-tag-refs.json b/mobile/src/app-update/fixtures/github-mobile-android-tag-refs.json new file mode 100644 index 000000000000..8be30db967b7 --- /dev/null +++ b/mobile/src/app-update/fixtures/github-mobile-android-tag-refs.json @@ -0,0 +1,242 @@ +[ + { + "ref": "refs/tags/mobile-android-v0.0.14", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjE0", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.14", + "object": { + "sha": "3247256da0e73409104e17ebf1c476a5cb60b3cf", + "type": "tag", + "url": "https://api.github.com/repos/stablyai/orca/git/tags/3247256da0e73409104e17ebf1c476a5cb60b3cf" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.15", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjE1", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.15", + "object": { + "sha": "7b8adaf5f943f1b07668a8e38662690fd8cbf0d0", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/7b8adaf5f943f1b07668a8e38662690fd8cbf0d0" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.16", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjE2", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.16", + "object": { + "sha": "20882d7a25c33a43b50ea19462a0e50f2deb11c4", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/20882d7a25c33a43b50ea19462a0e50f2deb11c4" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.17", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjE3", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.17", + "object": { + "sha": "c50391df84ee4034eca2cd5da49ca9ae4c5c4f7d", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/c50391df84ee4034eca2cd5da49ca9ae4c5c4f7d" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.18", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjE4", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.18", + "object": { + "sha": "9256bd39daaeda0fd86b67f1f50e70850e4f0005", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/9256bd39daaeda0fd86b67f1f50e70850e4f0005" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.19", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjE5", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.19", + "object": { + "sha": "d7322ec1f239db245c557f85370600ca67639137", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/d7322ec1f239db245c557f85370600ca67639137" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.21", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjIx", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.21", + "object": { + "sha": "ad13532ab1f8ea31fc434da4d503ba0c93260fb3", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/ad13532ab1f8ea31fc434da4d503ba0c93260fb3" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.22", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjIy", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.22", + "object": { + "sha": "748bced2e61d47444d6536eecadf8484394e4609", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/748bced2e61d47444d6536eecadf8484394e4609" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.24", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjI0", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.24", + "object": { + "sha": "3c963dd285783609ab0367cfd95a6b45de2b1603", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/3c963dd285783609ab0367cfd95a6b45de2b1603" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.25", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjI1", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.25", + "object": { + "sha": "d1cc78d5c5229478fb9f1675a3d3f506d332b367", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/d1cc78d5c5229478fb9f1675a3d3f506d332b367" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.26", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjI2", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.26", + "object": { + "sha": "cf04845f5b4d787292f041b05f839a8e151fa41b", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/cf04845f5b4d787292f041b05f839a8e151fa41b" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.27", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjI3", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.27", + "object": { + "sha": "20ebe858af628f3e2b5f73838310636dec6fe0ed", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/20ebe858af628f3e2b5f73838310636dec6fe0ed" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.30", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjMw", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.30", + "object": { + "sha": "ef87461bfe0346bcef163db971c990ea3adce495", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/ef87461bfe0346bcef163db971c990ea3adce495" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.31", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjMx", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.31", + "object": { + "sha": "1c275336eddf252a1d1378f9b55a6033278999e8", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/1c275336eddf252a1d1378f9b55a6033278999e8" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.32", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjMy", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.32", + "object": { + "sha": "c445f26541a0ecb465fc28a7e1a7b5ee5624a0dd", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/c445f26541a0ecb465fc28a7e1a7b5ee5624a0dd" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.36", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjM2", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.36", + "object": { + "sha": "4543bb68263a89ab520cea62ca69d7ac78330dd3", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/4543bb68263a89ab520cea62ca69d7ac78330dd3" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.37", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjM3", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.37", + "object": { + "sha": "5a2b329d8d7e96c974aecf4d3e12b707abd7d732", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/5a2b329d8d7e96c974aecf4d3e12b707abd7d732" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.42", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjQy", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.42", + "object": { + "sha": "20aeb0cb990a17f328b673f51717824d2f9c10ea", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/20aeb0cb990a17f328b673f51717824d2f9c10ea" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.43", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjQz", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.43", + "object": { + "sha": "cbca291aa7d7270fe8ed8cac5d08fc0b0910c309", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/cbca291aa7d7270fe8ed8cac5d08fc0b0910c309" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.44", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjQ0", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.44", + "object": { + "sha": "ecfc547ece7aa9483547df26661e90927d1983cc", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/ecfc547ece7aa9483547df26661e90927d1983cc" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.46", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjQ2", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.46", + "object": { + "sha": "47d462743c2b990b95942c75fb2c1c2493d7f478", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/47d462743c2b990b95942c75fb2c1c2493d7f478" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.47", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjQ3", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.47", + "object": { + "sha": "38c61379ffd19d3f573877ecfa1099e3616974dd", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/38c61379ffd19d3f573877ecfa1099e3616974dd" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.48", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjQ4", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.48", + "object": { + "sha": "7e3840a0683f83831502e15f583856fab8977685", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/7e3840a0683f83831502e15f583856fab8977685" + } + }, + { + "ref": "refs/tags/mobile-android-v0.0.50", + "node_id": "REF_kwDORpCz1toAIHJlZnMvdGFncy9tb2JpbGUtYW5kcm9pZC12MC4wLjUw", + "url": "https://api.github.com/repos/stablyai/orca/git/refs/tags/mobile-android-v0.0.50", + "object": { + "sha": "b5ee803d6c45dda9cfd4bb49d58aac47a22ebdc3", + "type": "commit", + "url": "https://api.github.com/repos/stablyai/orca/git/commits/b5ee803d6c45dda9cfd4bb49d58aac47a22ebdc3" + } + } +] diff --git a/mobile/src/app-update/fixtures/github-release-mobile-android-v0.0.50.json b/mobile/src/app-update/fixtures/github-release-mobile-android-v0.0.50.json new file mode 100644 index 000000000000..96976684578a --- /dev/null +++ b/mobile/src/app-update/fixtures/github-release-mobile-android-v0.0.50.json @@ -0,0 +1,92 @@ +{ + "url": "https://api.github.com/repos/stablyai/orca/releases/391254643", + "assets_url": "https://api.github.com/repos/stablyai/orca/releases/391254643/assets", + "upload_url": "https://uploads.github.com/repos/stablyai/orca/releases/391254643/assets{?name,label}", + "html_url": "https://github.com/stablyai/orca/releases/tag/mobile-android-v0.0.50", + "id": 391254643, + "author": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "node_id": "RE_kwDORpCz1s4XUhJz", + "tag_name": "mobile-android-v0.0.50", + "target_commitish": "main", + "name": "Orca Mobile Android mobile-android-v0.0.50", + "draft": false, + "immutable": false, + "prerelease": true, + "created_at": "2026-09-18T02:37:26Z", + "updated_at": "2026-09-18T06:19:48Z", + "published_at": "2026-09-18T06:19:48Z", + "assets": [ + { + "url": "https://api.github.com/repos/stablyai/orca/releases/assets/571968911", + "id": 571968911, + "node_id": "RA_kwDORpCz1s4iF42P", + "name": "app-release.apk", + "label": "", + "uploader": { + "login": "github-actions[bot]", + "id": 41898282, + "node_id": "MDM6Qm90NDE4OTgyODI=", + "avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/github-actions%5Bbot%5D", + "html_url": "https://github.com/apps/github-actions", + "followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers", + "following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}", + "gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}", + "starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions", + "organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs", + "repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos", + "events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}", + "received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events", + "type": "Bot", + "user_view_type": "public", + "site_admin": false + }, + "content_type": "application/vnd.android.package-archive", + "state": "uploaded", + "size": 133555371, + "digest": "sha256:79b285ca678e0fa00859f5d9348bfdd9d291eff7e1261cd12012c21e2234bad1", + "download_count": 10693, + "created_at": "2026-09-18T06:19:42Z", + "updated_at": "2026-09-18T06:19:46Z", + "browser_download_url": "https://github.com/stablyai/orca/releases/download/mobile-android-v0.0.50/app-release.apk" + } + ], + "tarball_url": "https://api.github.com/repos/stablyai/orca/tarball/mobile-android-v0.0.50", + "zipball_url": "https://api.github.com/repos/stablyai/orca/zipball/mobile-android-v0.0.50", + "body": "## What's Changed\n* Keep the floating workspace above a working native chat pane by @brennanb2025 in https://github.com/stablyai/orca/pull/18692\n* feat(relay-infra): dynamic NAT ports and alerts for the 2026-09-04 stall signals by @Jinwoo-H in https://github.com/stablyai/orca/pull/18693\n* fix(orca-profiles): tell the renderer when a cloud session is revoked by @Jinwoo-H in https://github.com/stablyai/orca/pull/18694\n* feat(relay): tell the phone when its desktop is signed out by @Jinwoo-H in https://github.com/stablyai/orca/pull/18698\n* perf(orchestration): bound the worker terminal archive in linear time by @nwparker in https://github.com/stablyai/orca/pull/18622\n* fix(startup): apply the HTTP/1.1 compatibility toggle for migrated profiles, and stop parsing the settings file pre-ready by @nwparker in https://github.com/stablyai/orca/pull/18621\n* perf(git): overlap the three independent submodule status reads by @nwparker in https://github.com/stablyai/orca/pull/18623\n* test(renderer): pin the runtime-target selector identity stability that #18685 fixed by @nwparker in https://github.com/stablyai/orca/pull/18625\n* perf(terminal): stop copying every PTY chunk for two startup-error detectors by @nwparker in https://github.com/stablyai/orca/pull/18626\n* perf(terminal): gate the Command Code banner scan before building its scan windows by @nwparker in https://github.com/stablyai/orca/pull/18628\n* perf(editor): build the closing-fence pattern once per fence, not once per line by @nwparker in https://github.com/stablyai/orca/pull/18629\n* perf(right-sidebar): cache the active checks status instead of rebuilding its cache keys per store write by @nwparker in https://github.com/stablyai/orca/pull/18631\n* perf(renderer): stop two store selectors allocating on every write by @nwparker in https://github.com/stablyai/orca/pull/18632\n* perf(source-control): stop reconciling selection on every panel render by @nwparker in https://github.com/stablyai/orca/pull/18637\n* perf(sidebar): stop building host projections the row model throws away by @nwparker in https://github.com/stablyai/orca/pull/18638\n* perf(agent-hooks): find spool newlines with Buffer.indexOf, not a per-byte loop by @nwparker in https://github.com/stablyai/orca/pull/18639\n* perf(claude-usage): reject non-assistant transcript lines before parsing them by @nwparker in https://github.com/stablyai/orca/pull/18640\n* perf(orchestration): project task columns so task reads hit the statement cache by @nwparker in https://github.com/stablyai/orca/pull/18641\n* perf(agent-hooks): stop cloning the whole status roster on every hook event by @nwparker in https://github.com/stablyai/orca/pull/18642\n* perf(sidebar): share one natural-worktree-id scan and drop a redundant row-key join by @nwparker in https://github.com/stablyai/orca/pull/18647\n* perf(terminal): use real event-loop yields between chunked writes by @nwparker in https://github.com/stablyai/orca/pull/18627\n* perf(settings): commit free-text account settings on a debounce, not per keystroke by @nwparker in https://github.com/stablyai/orca/pull/18651\n* feat(relay-infra): cell crash-rate alert and incident dashboard by @Jinwoo-H in https://github.com/stablyai/orca/pull/18717\n* feat(relay): let cells dial Cloud SQL over private IP by @Jinwoo-H in https://github.com/stablyai/orca/pull/18720\n* fix(desktop): never replay a refresh token after a timeout; jitter relay lease renewal by @Jinwoo-H in https://github.com/stablyai/orca/pull/18719\n* perf(ports): serve unchanged macOS listeners from remembered metadata by @nwparker in https://github.com/stablyai/orca/pull/18650\n* refactor(agent-session-journal): move the session journal onto SQLite by @brennanb2025 in https://github.com/stablyai/orca/pull/18652\n* fix(relay-ops): a thrown health fetch is not a health reading; auth probe does not require /ready by @Jinwoo-H in https://github.com/stablyai/orca/pull/18723\n* fix(agents): detect agent CLIs installed outside a version manager by @nwparker in https://github.com/stablyai/orca/pull/18336\n* perf(relay): per-cell inventory locks, delta counters, and a pool statement timeout by @Jinwoo-H in https://github.com/stablyai/orca/pull/18722\n* fix(worktrees): stop a failed worktree scan from being recorded as an authoritative empty listing by @nwparker in https://github.com/stablyai/orca/pull/18456\n* fix(native-chat): clarify active progress by @brennanb2025 in https://github.com/stablyai/orca/pull/18705\n* fix(browser-pane): stop a dead client-hosted guest from killing the workbench by @nwparker in https://github.com/stablyai/orca/pull/18334\n* feat(claude): move structured native chat onto the Claude Agent SDK and enable it on macOS and Linux by @brennanb2025 in https://github.com/stablyai/orca/pull/18560\n* Fix Smart create retaining a task checkout hash with Create more by @nwparker in https://github.com/stablyai/orca/pull/18727\n* infra(relay): drop the unapplied region label from runtime log metrics by @Jinwoo-H in https://github.com/stablyai/orca/pull/18734\n* feat(native-chat): expose split and move-to-pane actions in Chat UI mode by @brennanb2025 in https://github.com/stablyai/orca/pull/18714\n* fix(ui): unmount project selector before Add Project handoff by @Jinwoo-H in https://github.com/stablyai/orca/pull/18730\n* fix: show agent commands once without startup polling by @nwparker in https://github.com/stablyai/orca/pull/18729\n* fix(crash-reporting): make the own-Chromium gate a real choke point, and stop a refusal leaking the root by @nwparker in https://github.com/stablyai/orca/pull/18459\n* chore: update in-app Android APK link to 0.0.47 by @AmethystLiang in https://github.com/stablyai/orca/pull/18745\n* Answer the structured-session support probe without installing the host by @brennanb2025 in https://github.com/stablyai/orca/pull/18695\n* fix(native-chat): render Claude structured chat through the same UI as Codex by @brennanb2025 in https://github.com/stablyai/orca/pull/18743\n* fix(orchestration): fence the dispatch CLI preamble so it stops rendering as headings by @brennanb2025 in https://github.com/stablyai/orca/pull/18718\n* fix(relay-ops): retry a failed MIG inventory read once before calling a cell's power state unknown by @Jinwoo-H in https://github.com/stablyai/orca/pull/18740\n* fix(relay-ops): accept monitor evidence from an ancestor commit with identical monitor code by @Jinwoo-H in https://github.com/stablyai/orca/pull/18754\n* fix(terminal): stop a hidden pane's unmeasured 80x24 from overwriting a live PTY's size on reattach by @Jinwoo-H in https://github.com/stablyai/orca/pull/18706\n* fix: use fallback shell readiness and assert fish startup timing by @nwparker in https://github.com/stablyai/orca/pull/18755\n* fix(relay-ops): retry transient admin-endpoint failures in same-cap verify and rehome jobs by @Jinwoo-H in https://github.com/stablyai/orca/pull/18769\n* fix(native-chat): make document paths and links clickable in chat by @brennanb2025 in https://github.com/stablyai/orca/pull/18712\n* fix(native-chat): tell old mobile builds why a structured chat is missing by @brennanb2025 in https://github.com/stablyai/orca/pull/18756\n* fix(relay-ops): retry freshness-only preflight failures on the first same-cap wave too by @Jinwoo-H in https://github.com/stablyai/orca/pull/18778\n* fix(browser): match loading surfaces to the Orca theme by @Jinwoo-H in https://github.com/stablyai/orca/pull/18738\n* fix(browser): present Electron's own user agent so Cloudflare Turnstile clears by @Jinwoo-H in https://github.com/stablyai/orca/pull/18749\n* fix(relay-ops): align the cloud-data freshness bar with Cloud Monitoring publish lag by @Jinwoo-H in https://github.com/stablyai/orca/pull/18798\n* ci(package): retry apt fetches and docker builds behind the Ubuntu mirror by @nwparker in https://github.com/stablyai/orca/pull/18797\n* docs(relay): correct why the ConPTY teardown asset diverges from the desktop patch by @nwparker in https://github.com/stablyai/orca/pull/18636\n* fix: recover from an alternate shell install, and close the relay duplicate-echo gap by @nwparker in https://github.com/stablyai/orca/pull/18796\n* feat(mobile): port the restructured native-chat turn status and live tool progress by @brennanb2025 in https://github.com/stablyai/orca/pull/18761\n* perf(persistence): stop the session write re-scanning and rebuilding unchanged state by @nwparker in https://github.com/stablyai/orca/pull/18739\n* feat(native-chat): render agent file edits as inline diff cards by @brennanb2025 in https://github.com/stablyai/orca/pull/18765\n* fix(recovery): fail a renderer recovery reload that never loads, instead of leaving a dead window by @nwparker in https://github.com/stablyai/orca/pull/18466\n* fix(ssh): compile node-pty from the host's own Node headers instead of nodejs.org (STA-6674) by @nwparker in https://github.com/stablyai/orca/pull/18774\n* Bump mobile app.json to 0.0.48 by @brennanb2025 in https://github.com/stablyai/orca/pull/18801\n* fix(sidebar): confirm filter reset before revealing active workspace by @nwparker in https://github.com/stablyai/orca/pull/18708\n* perf(terminals): let idle panes share one process-table capture instead of forking their own by @nwparker in https://github.com/stablyai/orca/pull/18742\n* perf(native-chat): stop rebuilding every transcript row on every stream frame by @nwparker in https://github.com/stablyai/orca/pull/18744\n* perf(terminal): skip the partial-escape-tail walk on ESC-free PTY chunks by @nwparker in https://github.com/stablyai/orca/pull/18748\n* perf(renderer): index four projections that rescanned their inputs per keystroke by @nwparker in https://github.com/stablyai/orca/pull/18747\n* Show Claude background task status in Native Chat by @brennanb2025 in https://github.com/stablyai/orca/pull/18757\n* fix(sidebar): stop ⌘⇧↓ worktree navigation jumping to the first row by @nwparker in https://github.com/stablyai/orca/pull/18804\n* perf(persistence): skip rewriting unchanged terminal scrollback snapshots by @nwparker in https://github.com/stablyai/orca/pull/18764\n* fix(agent-session): refuse a pre-commit structured create with an envelope by @brennanb2025 in https://github.com/stablyai/orca/pull/18697\n* perf(relay): bound the symlink directory probes a remote readDir fans out by @nwparker in https://github.com/stablyai/orca/pull/18752\n* perf(terminal): cheap-tier process inspection for anchored local agent panes by @nwparker in https://github.com/stablyai/orca/pull/18780\n* fix(ssh): let the host say whether it armed the shell-ready marker by @nwparker in https://github.com/stablyai/orca/pull/18802\n* fix(native-chat): say when a structured launch fell back to a terminal by @brennanb2025 in https://github.com/stablyai/orca/pull/18762\n* fix(test): stop detached git maintenance racing the divergence fixture teardown by @nwparker in https://github.com/stablyai/orca/pull/18810\n* fix(cloud): let the same-cap roll isolate Asia cells by @Jinwoo-H in https://github.com/stablyai/orca/pull/18811\n* fix(renderer): stop a Node-only process-table module blanking the app at boot by @nwparker in https://github.com/stablyai/orca/pull/18814\n* feat(i18n): localize onboarding flow to Japanese by @tb-soshiro in https://github.com/stablyai/orca/pull/18787\n* fix(cloud): validate protocol-0 same-cap cell plans without rehome trust lines by @Jinwoo-H in https://github.com/stablyai/orca/pull/18818\n* perf(worktree): skip remote probes with no possible result by @nwparker in https://github.com/stablyai/orca/pull/18821\n* fix(native-chat): stop a settling handoff throwing an unhandled rejection at teardown by @nwparker in https://github.com/stablyai/orca/pull/18824\n* fix(claude): make the recovery barrier cover an exit still climbing the close ladder by @nwparker in https://github.com/stablyai/orca/pull/18826\n* Reduce minimum tab width from 88px to 72px by @AmethystLiang in https://github.com/stablyai/orca/pull/18871\n* perf(automations): reuse collation setup when sorting names by @nwparker in https://github.com/stablyai/orca/pull/18823\n* fix(relay-ops): per-region cell latency bar and attributable preflight failures by @Jinwoo-H in https://github.com/stablyai/orca/pull/18877\n* test(e2e): follow current sidebar project and activity actions by @nwparker in https://github.com/stablyai/orca/pull/18878\n* fix(runtime): bound terminal-wait blocked-prompt rules to the live screen bottom by @Jinwoo-H in https://github.com/stablyai/orca/pull/18817\n* test(e2e): fence SSH recovery and release exited Electron pipes by @nwparker in https://github.com/stablyai/orca/pull/18880\n* feat(perf): lint repeated sort setup and schedule regression contracts by @nwparker in https://github.com/stablyai/orca/pull/18822\n* feat(native-chat): label Codex tool rows by what the command actually did by @brennanb2025 in https://github.com/stablyai/orca/pull/18760\n* test: preserve Docker context in isolated VM recipes by @nwparker in https://github.com/stablyai/orca/pull/18884\n* Fix favicon retention across same-origin navigations by @AmethystLiang in https://github.com/stablyai/orca/pull/18879\n* test: isolate native crash restoration and refresh stale fixtures by @nwparker in https://github.com/stablyai/orca/pull/18883\n* test: pin worker visibility fixture command and handle by @nwparker in https://github.com/stablyai/orca/pull/18897\n* feat(cli): report SSH host platforms by @nwparker in https://github.com/stablyai/orca/pull/18896\n* test: canonicalize setup fixture paths before worktree lookup by @nwparker in https://github.com/stablyai/orca/pull/18912\n* perf(worktree): remove redundant creation and terminal startup work by @nwparker in https://github.com/stablyai/orca/pull/18793\n* test: align desktop platform oracles with native behavior by @nwparker in https://github.com/stablyai/orca/pull/18915\n* test: follow sidebar reveal confirmation with a stable workspace target by @nwparker in https://github.com/stablyai/orca/pull/18921\n* feat(native-chat): model Codex MCP and web-search items instead of leaking opcodes by @brennanb2025 in https://github.com/stablyai/orca/pull/18763\n* fix(native-chat): publish structured session status from the host so the sidebar never goes stale by @brennanb2025 in https://github.com/stablyai/orca/pull/18776\n* feat(native-chat): stop monitored tasks individually by @brennanb2025 in https://github.com/stablyai/orca/pull/18807\n* fix(native-chat): tell a pre-SQLite chat how to carry on by @brennanb2025 in https://github.com/stablyai/orca/pull/18808\n* fix(agent-session): never open a sibling terminal on an unproven create by @brennanb2025 in https://github.com/stablyai/orca/pull/18735\n* refactor(agent-session): consolidate wire type imports below lint limit by @nwparker in https://github.com/stablyai/orca/pull/18930\n* test(e2e): stabilize terminal launch and rename menu fixtures by @nwparker in https://github.com/stablyai/orca/pull/18928\n* fix(automation): keep explicit background launches off screen by @nwparker in https://github.com/stablyai/orca/pull/18898\n* feat(automations): restore column sorting on the list by @nwparker in https://github.com/stablyai/orca/pull/18885\n* test: pin terminal Codex home to an explicit managed account by @nwparker in https://github.com/stablyai/orca/pull/18935\n* test: deliver real terminal input and preserve setup reports by @nwparker in https://github.com/stablyai/orca/pull/18939\n* test: isolate skill cloud fixture ports across workers by @nwparker in https://github.com/stablyai/orca/pull/18942\n* test: align Source Control AI generation fixtures by @nwparker in https://github.com/stablyai/orca/pull/18941\n* ci: reduce runner overhead and disposable package compression by @nwparker in https://github.com/stablyai/orca/pull/18948\n* test: keep artifact share fixtures unexpired across calendar dates by @nwparker in https://github.com/stablyai/orca/pull/18955\n* docs(relay): 2026-09 reconnect findings, checklist, roadmap, and Roll 2 plan by @Jinwoo-H in https://github.com/stablyai/orca/pull/18958\n* test: make SSH artifact regression fixtures reliable at narrow widths by @nwparker in https://github.com/stablyai/orca/pull/18947\n* test: order restart fixture readiness around daemon recovery by @nwparker in https://github.com/stablyai/orca/pull/18949\n* fix(orchestration): typed error codes for dispatch and worker-start refusals by @Jinwoo-H in https://github.com/stablyai/orca/pull/18902\n* ci: skip idle Mac allocations and redundant native compiler setup by @nwparker in https://github.com/stablyai/orca/pull/18954\n* test: isolate Source Control generation from shared repository remotes by @nwparker in https://github.com/stablyai/orca/pull/18962\n* fix(relay): abandon dead client accepts, jitter and lengthen the control lease, fail direct probes fast by @Jinwoo-H in https://github.com/stablyai/orca/pull/18959\n* fix(hooks): register the Claude hook script directly on Windows (#18875) by @OrcaWin in https://github.com/stablyai/orca/pull/18905\n* fix(ci): store vetted refs in a reftable so case-twin branches don't fail the fetch by @nwparker in https://github.com/stablyai/orca/pull/18970\n* test: drain project menu focus restoration before teardown by @nwparker in https://github.com/stablyai/orca/pull/18971\n* ci: reduce dependency, checkout, and test deadline overhead by @nwparker in https://github.com/stablyai/orca/pull/18968\n* ci: preserve case-twin release refs through checkout and verify trust by @nwparker in https://github.com/stablyai/orca/pull/18980\n* test: honor background mode in paired client window helpers by @nwparker in https://github.com/stablyai/orca/pull/18978\n* test: bound release checkout fixtures and gate delayed imports by @nwparker in https://github.com/stablyai/orca/pull/18981\n* fix(native-chat): repair a structured chat tab permanently fenced by an inherited publication epoch by @brennanb2025 in https://github.com/stablyai/orca/pull/18906\n* ci: expose existing E2E spec selection for manual dispatch by @nwparker in https://github.com/stablyai/orca/pull/18987\n* test: isolate window mocks from inherited launch flags by @nwparker in https://github.com/stablyai/orca/pull/18989\n* test: match explorer filenames independently of git badges by @nwparker in https://github.com/stablyai/orca/pull/18997\n* test: synchronize large repository recovery with Retry request by @nwparker in https://github.com/stablyai/orca/pull/18999\n* perf(relay): drain fragmented frame buffers in linear time by @nwparker in https://github.com/stablyai/orca/pull/18891\n* perf(repos): avoid quadratic icon source scans by @nwparker in https://github.com/stablyai/orca/pull/18892\n* perf(browser): assemble fragmented tunnel frames once by @nwparker in https://github.com/stablyai/orca/pull/18893\n* perf(editor): reuse Markdown source blocks while positioning review notes by @nwparker in https://github.com/stablyai/orca/pull/18895\n* perf(editor): reuse live Markdown search matches across unrelated renders by @nwparker in https://github.com/stablyai/orca/pull/18903\n* perf: decode fragmented CLI replies without repeated scans by @nwparker in https://github.com/stablyai/orca/pull/18909\n* perf: avoid file-to-file scans when selecting deletion roots by @nwparker in https://github.com/stablyai/orca/pull/18913\n* perf: find mobile Markdown placeholder prefixes in one scan by @nwparker in https://github.com/stablyai/orca/pull/18914\n* perf: avoid repeated Quick Open exclusion string allocations by @nwparker in https://github.com/stablyai/orca/pull/18916\n* perf: skip unrelated shared symlink probes during Git status by @nwparker in https://github.com/stablyai/orca/pull/18918\n* perf: avoid splitting every path during file autocomplete by @nwparker in https://github.com/stablyai/orca/pull/18919\n* perf: avoid rescanning emitted source in analysis guards by @nwparker in https://github.com/stablyai/orca/pull/18920\n* perf(cli): skip feature formatters during help and error startup by @nwparker in https://github.com/stablyai/orca/pull/18923\n* perf(explorer): remove redundant dotfile path filter allocation by @nwparker in https://github.com/stablyai/orca/pull/18929\n* perf(watcher): skip remaining filesystem checks after cancellation by @nwparker in https://github.com/stablyai/orca/pull/18931\n* perf(hooks): use native reverse search for transcript lines by @nwparker in https://github.com/stablyai/orca/pull/18936\n* perf(skills): skip symlink probes beyond discovery depth by @nwparker in https://github.com/stablyai/orca/pull/18937\n* perf(mobile): cancel direct probes when their owner stops by @nwparker in https://github.com/stablyai/orca/pull/18940\n* perf(jira): preserve replacement attachment download singleflight by @nwparker in https://github.com/stablyai/orca/pull/18944\n* perf(speech): reuse the model download idle timer by @nwparker in https://github.com/stablyai/orca/pull/18945\n* perf(ssh): reuse and release relay startup buffers by @nwparker in https://github.com/stablyai/orca/pull/18953\n* perf(ssh): reuse streamed response idle timers by @nwparker in https://github.com/stablyai/orca/pull/18956\n* perf(browser): reuse decoded single-chunk upload buffers by @nwparker in https://github.com/stablyai/orca/pull/18960\n* perf(tabs): index saved tab order during hydration repair by @nwparker in https://github.com/stablyai/orca/pull/18964\n* perf(palette): reuse allowed quality arrays during matching by @nwparker in https://github.com/stablyai/orca/pull/18966\n* perf: remember equivalent session tab source identities by @nwparker in https://github.com/stablyai/orca/pull/18976\n* perf(cli): skip impossible typo distance comparisons by @nwparker in https://github.com/stablyai/orca/pull/18977\n* fix(tests): stabilize divider viewport and pointer-capture event ordering by @nwparker in https://github.com/stablyai/orca/pull/19004\n* fix(mobile): stop host streams after relay subscription cancellation by @nwparker in https://github.com/stablyai/orca/pull/18926\n* fix(tests): provide a window manager for Linux Electron CI by @nwparker in https://github.com/stablyai/orca/pull/19007\n* fix(windows): copy the daemon host exe verbatim instead of renaming it (MDE T1036) by @OrcaWin in https://github.com/stablyai/orca/pull/17865\n* fix(computer-use): run the Windows runtime as one persistent helper by @OrcaWin in https://github.com/stablyai/orca/pull/17858\n* fix(windows): drop EDR-flagged -ExecutionPolicy Bypass from encoded PowerShell by @OrcaWin in https://github.com/stablyai/orca/pull/17880\n* fix(windows): read command lines from the kernel, not each process's PEB by @OrcaWin in https://github.com/stablyai/orca/pull/17886\n* fix(windows): scan ports natively instead of encoded PowerShell by @OrcaWin in https://github.com/stablyai/orca/pull/17861\n* fix(security): apply the Windows path-hardening ACL that never ran by @OrcaWin in https://github.com/stablyai/orca/pull/17884\n* perf: avoid repeated whitespace scans in diagnostic redaction by @nwparker in https://github.com/stablyai/orca/pull/18908\n* Improve notification view by @AmethystLiang in https://github.com/stablyai/orca/pull/18699\n* test(child-process): lower DIRECT_IMPORTER_PIN to the ground two PRs took by @OrcaWin in https://github.com/stablyai/orca/pull/19009\n* fix(windows): resolve npm/pnpm .cmd shims past cmd.exe by @OrcaWin in https://github.com/stablyai/orca/pull/17869\n* test: lower child-process import pin after ACL migration by @nwparker in https://github.com/stablyai/orca/pull/19012\n* Open open new link should not navigate away from current link by @AmethystLiang in https://github.com/stablyai/orca/pull/18873\n* perf(windows): split the process table into two flag sets by @OrcaWin in https://github.com/stablyai/orca/pull/17866\n* fix(release): stop shipping an unsigned elevate.exe on Windows by @OrcaWin in https://github.com/stablyai/orca/pull/18044\n* fix(windows): sign the NSIS uninstaller via SignPath by @OrcaWin in https://github.com/stablyai/orca/pull/17868\n* fix(tests): complete hidden SSH dialog exits during cleanup by @nwparker in https://github.com/stablyai/orca/pull/18993\n* Support updating existing draft releases when regenerating notes by @AmethystLiang in https://github.com/stablyai/orca/pull/19014\n* fix(windows): drop no-op -ExecutionPolicy Bypass from -Command spawns by @OrcaWin in https://github.com/stablyai/orca/pull/17873\n* perf(search): assemble fragmented subprocess lines incrementally by @nwparker in https://github.com/stablyai/orca/pull/18973\n* test: use a valid repo filter in workspace reveal coverage by @nwparker in https://github.com/stablyai/orca/pull/19017\n* test: cover native X11 Hangul-plus-digit PTY bytes in CI by @nwparker in https://github.com/stablyai/orca/pull/19013\n* Stop evicted and expired worktree preparations by @nwparker in https://github.com/stablyai/orca/pull/18951\n* Let worktree creation proceed during stale preparation reclamation by @nwparker in https://github.com/stablyai/orca/pull/18967\n* fix(release): revalidate draft state before patching generated notes by @AmethystLiang in https://github.com/stablyai/orca/pull/19019\n* perf(worktree): overlap base refresh with prepared checkout by @nwparker in https://github.com/stablyai/orca/pull/18998\n* test: await fresh inventory after headless terminal materialization by @nwparker in https://github.com/stablyai/orca/pull/19028\n* fix(sidebar): stop a missed pointerup from hiding a remote host section by @nwparker in https://github.com/stablyai/orca/pull/19032\n* test: wait for board pointer readiness before marquee selection by @nwparker in https://github.com/stablyai/orca/pull/19029\n* fix(build): pin config/relay-assets LF so one release is one relay hash by @OrcaWin in https://github.com/stablyai/orca/pull/19024\n* docs(relay): record Roll 2 phase 0/1 (code merge, image, director deploy) by @Jinwoo-H in https://github.com/stablyai/orca/pull/18979\n* feat(github-projects): render Roadmap project views as a timeline by @NaoyaTatetsu in https://github.com/stablyai/orca/pull/17795\n* fix(mobile): preserve iPad hardware keyboard focus by @ramarivera in https://github.com/stablyai/orca/pull/12772\n* test: await reattach replay before checking mouse reset by @nwparker in https://github.com/stablyai/orca/pull/19039\n* test: require recorded Git activity in polling regression by @nwparker in https://github.com/stablyai/orca/pull/19041\n* fix(native-chat): resume a structured chat from Agent Session History by @OrcaWin in https://github.com/stablyai/orca/pull/18933\n* fix(source-control): stack Retry below the too-many-changes message by @nwparker in https://github.com/stablyai/orca/pull/19037\n* test: preserve Windows golden command failures by @nwparker in https://github.com/stablyai/orca/pull/19047\n* test: canonicalize Windows fresh-profile fixture path by @nwparker in https://github.com/stablyai/orca/pull/19049\n* test: repair Windows paste setup and newline expectations by @nwparker in https://github.com/stablyai/orca/pull/19050\n* fix(source-control): stack the Create PR notice's settings link below its message by @nwparker in https://github.com/stablyai/orca/pull/19046\n* test: align Windows shell icons with project runtime ownership by @nwparker in https://github.com/stablyai/orca/pull/19053\n* test: exercise supported ConPTY keyboard protocol reset by @nwparker in https://github.com/stablyai/orca/pull/19054\n* fix(native-chat): honor structured routing with saved options by @brennanb2025 in https://github.com/stablyai/orca/pull/19040\n* fix(packaging): ship Claude agent SDK with desktop builds by @brennanb2025 in https://github.com/stablyai/orca/pull/19042\n* test: reject unsupported app-server in golden agent fixture by @nwparker in https://github.com/stablyai/orca/pull/19056\n* test: reject unsupported app-server in WSL golden stub by @nwparker in https://github.com/stablyai/orca/pull/19062\n* test: canonicalize native Windows paths during repository teardown by @nwparker in https://github.com/stablyai/orca/pull/19064\n* test: run real WSL terminal launch and paste in PR CI by @nwparker in https://github.com/stablyai/orca/pull/19072\n* test: restore SSH bulk-open freeze coverage in headed CI by @nwparker in https://github.com/stablyai/orca/pull/19081\n* test: enable direct and client-hosted SSH browser coverage by @nwparker in https://github.com/stablyai/orca/pull/19090\n* test: reconnect after replacing same-ID runtime pairing by @nwparker in https://github.com/stablyai/orca/pull/19094\n* test: enable Docker SSH browser network route coverage in CI by @nwparker in https://github.com/stablyai/orca/pull/19095\n* docs(relay): Roll 2 cell roll record and checklist ticks by @Jinwoo-H in https://github.com/stablyai/orca/pull/19096\n* test: repair nested SSH fixture after HUB restart by @nwparker in https://github.com/stablyai/orca/pull/19098\n* test: enable localhost SSH terminal and hook journey in CI by @nwparker in https://github.com/stablyai/orca/pull/19097\n* Bump mobile Android versionCode to 16 to match the 0.0.48 release by @brennanb2025 in https://github.com/stablyai/orca/pull/19101\n* test: reuse authoritative SSH connection readiness in localhost fixture by @nwparker in https://github.com/stablyai/orca/pull/19102\n* test: follow retained Activity sidebar during pane selection by @nwparker in https://github.com/stablyai/orca/pull/19107\n* test: isolate source-control generation repositories per scenario by @nwparker in https://github.com/stablyai/orca/pull/19105\n* test: cover SSH reattach replay and enable deterministic Codex CI by @nwparker in https://github.com/stablyai/orca/pull/19106\n* fix(chat): stop terminal focus recovery from stealing Cmd+C in the Chat UI by @brennanb2025 in https://github.com/stablyai/orca/pull/18751\n* Add persistent turn-scoped chat activity indicator by @brennanb2025 in https://github.com/stablyai/orca/pull/19044\n* feat(orchestration): make multi-agent workflows durable by @Jinwoo-H in https://github.com/stablyai/orca/pull/16904\n* fix(ssh-relay): daemon owns the endpoint credential; a losing start never rotates it by @Jinwoo-H in https://github.com/stablyai/orca/pull/19052\n* Recover branch compare on visibility change by @AmethystLiang in https://github.com/stablyai/orca/pull/19021\n* fix(codex): keep large app-server replies alive by @brennanb2025 in https://github.com/stablyai/orca/pull/18590\n* docs(orchestration): never pick a worker model the user did not name by @Jinwoo-H in https://github.com/stablyai/orca/pull/19109\n* feat(mobile): structured native Claude chat by @brennanb2025 in https://github.com/stablyai/orca/pull/18741\n* Seed Cmd-J filter from sidebar scope by @AmethystLiang in https://github.com/stablyai/orca/pull/19036\n* skills: rewrite and trim the seven non-orchestration guides (do not merge without Jinwoo) by @Jinwoo-H in https://github.com/stablyai/orca/pull/18724\n* fix(ci): stop Android release notes exceeding the GitHub body limit by @brennanb2025 in https://github.com/stablyai/orca/pull/19114\n* Update mobile 0.0.48 Android download links by @brennanb2025 in https://github.com/stablyai/orca/pull/19117\n* fix(orchestration): keep worker lineage across app restart (STA-6366) by @Jinwoo-H in https://github.com/stablyai/orca/pull/19121\n* fix(browser): select full URL on initial address bar click by @Jinwoo-H in https://github.com/stablyai/orca/pull/19118\n* fix(windows): unblock structured native chat by exposing process creation time by @brennanb2025 in https://github.com/stablyai/orca/pull/18986\n* Revert \"skills: rewrite the seven non-orchestration guides to one outcome-first standard (#18724)\" by @Jinwoo-H in https://github.com/stablyai/orca/pull/19126\n* perf(store): keep the repo list's identity through workspace hydration by @nwparker in https://github.com/stablyai/orca/pull/19057\n* perf(tabs): keep tab-model identity when reconciliation changed something else by @nwparker in https://github.com/stablyai/orca/pull/19063\n* perf(mobile): skip the agent-status projection join when nothing changed by @nwparker in https://github.com/stablyai/orca/pull/19115\n* perf(worktrees): stop worktree removal from replacing maps it never touched by @nwparker in https://github.com/stablyai/orca/pull/19058\n* perf(selectors): stop two always-mounted selectors allocating per store write by @nwparker in https://github.com/stablyai/orca/pull/19113\n* perf(terminals): stop closing a tab from replacing maps it never touched by @nwparker in https://github.com/stablyai/orca/pull/19060\n* perf(terminals): keep shutdown maps' identity when there is nothing to clear by @nwparker in https://github.com/stablyai/orca/pull/19112\n* perf(store): detect Zustand rerender churn the current audit cannot see by @nwparker in https://github.com/stablyai/orca/pull/19059\n* fix(native-chat): stop seeding a stray terminal beside a chat create by @brennanb2025 in https://github.com/stablyai/orca/pull/19123\n* Improve cmd j ranking by @AmethystLiang in https://github.com/stablyai/orca/pull/19005\n* feat(native-chat): offer the link-action popover for chat links by @brennanb2025 in https://github.com/stablyai/orca/pull/19130\n* fix(ui): keep source control headers readable in narrow sidebars by @nwparker in https://github.com/stablyai/orca/pull/19146\n* fix(gh): log when gh/glab is killed at its deadline by @nwparker in https://github.com/stablyai/orca/pull/18555\n* fix: restore the full sidebar agent row for structured native chat by @brennanb2025 in https://github.com/stablyai/orca/pull/19137\n* fix(native-chat): suppress provider user echoes in Claude and Codex by @brennanb2025 in https://github.com/stablyai/orca/pull/19136\n* fix(native-chat): settle a structured send the provider proves it received after the ack window by @brennanb2025 in https://github.com/stablyai/orca/pull/19140\n* Show provider activity in chat turn tails by @brennanb2025 in https://github.com/stablyai/orca/pull/19055\n* fix(ui): ignore the persistent workspace list when detecting overlays by @nwparker in https://github.com/stablyai/orca/pull/18881\n* fix(windows): reject stale parent PID links in shutdown snapshots by @brennanb2025 in https://github.com/stablyai/orca/pull/19149\n* fix(native-chat): auto-rename the workspace on a structured chat's first turn by @brennanb2025 in https://github.com/stablyai/orca/pull/19138\n* Fix native chat completion sorting and restored activity timestamps by @brennanb2025 in https://github.com/stablyai/orca/pull/19144\n* test: exercise packaged browser compatibility in scheduled CI by @nwparker in https://github.com/stablyai/orca/pull/19157\n* test: refresh palette identities and structured-session journal fixtures by @nwparker in https://github.com/stablyai/orca/pull/19165\n* fix(terminal): preserve ordinary foreground command names by @nwparker in https://github.com/stablyai/orca/pull/18882\n* fix(cmd-j): pass browser tab ownership into palette search by @nwparker in https://github.com/stablyai/orca/pull/18925\n* fix: keep macOS shell ownership proof within recovery budget by @nwparker in https://github.com/stablyai/orca/pull/18932\n* fix: open editor rename after context menu releases focus by @nwparker in https://github.com/stablyai/orca/pull/18934\n* fix: avoid starting browser helpers just to reset absent sessions by @nwparker in https://github.com/stablyai/orca/pull/18952\n* fix: prefer retained provider snapshots during hidden terminal recovery by @nwparker in https://github.com/stablyai/orca/pull/18972\n* fix: preserve overlay focus during terminal mounting and layout by @nwparker in https://github.com/stablyai/orca/pull/18982\n* fix: preserve terminal command probes across control frames by @nwparker in https://github.com/stablyai/orca/pull/19006\n* fix: preserve paired host sessions during startup residue cleanup by @nwparker in https://github.com/stablyai/orca/pull/18922\n* fix: preserve renderer browser publication during client-hosted page updates by @nwparker in https://github.com/stablyai/orca/pull/18961\n* fix: honor remote terminal insertion in the calling client by @nwparker in https://github.com/stablyai/orca/pull/18995\n* fix: keep paired tab updates live after runtime terminal fallback by @nwparker in https://github.com/stablyai/orca/pull/19022\n* fix: avoid credit deadlock during large SSH PTY recovery by @nwparker in https://github.com/stablyai/orca/pull/19026\n* fix: recognize working WSL1 without a WSL2 kernel by @nwparker in https://github.com/stablyai/orca/pull/19061\n* fix(ports): coalesce advertised URL refresh bursts by @nwparker in https://github.com/stablyai/orca/pull/19150\n* perf(agent-status): stop no-op retirements rebuilding the retired-pane-key map by @nwparker in https://github.com/stablyai/orca/pull/19142\n* perf(worktrees): stop worktree teardown replacing arrays and maps it never touched by @nwparker in https://github.com/stablyai/orca/pull/19145\n* fix(cmd-j): remove duplicate browser ownership inputs by @nwparker in https://github.com/stablyai/orca/pull/19172\n* fix: recognize the kimi-code process as the kimi agent by @Aladex in https://github.com/stablyai/orca/pull/18634\n* fix: release floating terminal WebGL contexts while closed by @nwparker in https://github.com/stablyai/orca/pull/19000\n* fix: fence browser recovery to attach inventory placements by @nwparker in https://github.com/stablyai/orca/pull/18910\n* test: refresh paired palette host-qualified row locators by @nwparker in https://github.com/stablyai/orca/pull/19175\n* test: cover native Wayland Hangul in isolated CI by @nwparker in https://github.com/stablyai/orca/pull/19174\n* test(e2e): scope paired preview link checks to confirmation by @nwparker in https://github.com/stablyai/orca/pull/18924\n* test: await rendered remote agent placement before checking mirrors by @nwparker in https://github.com/stablyai/orca/pull/18983\n* test: scope selected runtime project assertions to the sidebar by @nwparker in https://github.com/stablyai/orca/pull/19003\n* test: confirm running-command prompts when closing tabs by @nwparker in https://github.com/stablyai/orca/pull/18965\n* Fix MiniMax China usage routing and credential handling by @weekbin in https://github.com/stablyai/orca/pull/14929\n* fix(rate-limits): stop reporting Grok usage as 0% when the API omits the percent by @TimothyVang in https://github.com/stablyai/orca/pull/17936\n* test: enable software WebGL for Linux CI headful specs by @nwparker in https://github.com/stablyai/orca/pull/19001\n* test: restore snapshot path before draining hydration FIFO by @nwparker in https://github.com/stablyai/orca/pull/19186\n* test: return paired browser state from the successful poll by @nwparker in https://github.com/stablyai/orca/pull/19189\n* feat: real background push notifications for the mobile app (#8129) by @Jinwoo-H in https://github.com/stablyai/orca/pull/18554\n* test: align worker recovery fixture with ownership policy by @nwparker in https://github.com/stablyai/orca/pull/19190\n* feat(orchestration): orchestrate native-born structured chat sessions by @brennanb2025 in https://github.com/stablyai/orca/pull/18827\n* fix(native-chat): remember structured chat model and effort picks by @brennanb2025 in https://github.com/stablyai/orca/pull/19147\n* fix(native-chat): list the slash commands and skills a structured Claude session actually loaded by @brennanb2025 in https://github.com/stablyai/orca/pull/19127\n* skills: rewrite and trim the seven non-orchestration guides by @Jinwoo-H in https://github.com/stablyai/orca/pull/19128\n* feat(chat): support structured /clear and /compact commands by @brennanb2025 in https://github.com/stablyai/orca/pull/19164\n* revert: hold mobile push feature for user testing by @Jinwoo-H in https://github.com/stablyai/orca/pull/19203\n* fix(editor): support Shift+wheel scrolling in combined diffs by @brohoya in https://github.com/stablyai/orca/pull/11756\n* feat(native-chat): resume an Agent Session History row into a new structured chat by @brennanb2025 in https://github.com/stablyai/orca/pull/19176\n* fix(mobile): stop double-scaling commit timestamps in history rows by @blade035 in https://github.com/stablyai/orca/pull/17731\n* fix(runtime): apply the structured-chat setting to every RPC caller by @brennanb2025 in https://github.com/stablyai/orca/pull/18700\n* fix(native-chat): settle structured chat turns stranded by a restart by @brennanb2025 in https://github.com/stablyai/orca/pull/19122\n* fix: eliminate quadratic whitespace trimming during fullscreen scrolling by @nwparker in https://github.com/stablyai/orca/pull/19214\n* Restore independent push gateway deployment by @Jinwoo-H in https://github.com/stablyai/orca/pull/19225\n* Fix push deployment source archive path by @Jinwoo-H in https://github.com/stablyai/orca/pull/19231\n* Reorganize MiniMax modules and de-duplicate shared test state by @nwparker in https://github.com/stablyai/orca/pull/19197\n* fix: repaint hidden output overflow after answered restore deadline by @nwparker in https://github.com/stablyai/orca/pull/18904\n* fix: retain MSYS shell descendants in their terminal job by @nwparker in https://github.com/stablyai/orca/pull/19068\n* fix(test): unbreak main — admit the adoption-replay create fixture through the structured-chat gate by @nwparker in https://github.com/stablyai/orca/pull/19246\n* Fix MiniMax credential-expiry reporting, region sync, and refresh by @nwparker in https://github.com/stablyai/orca/pull/19250\n* fix(orchestration): recover Codex idle after completion title race by @Jinwoo-H in https://github.com/stablyai/orca/pull/19243\n* feat(relay): time successful client accepts and control round trips by @Jinwoo-H in https://github.com/stablyai/orca/pull/19232\n* fix(relay): rehome hosts to their preferred region in either direction by @Jinwoo-H in https://github.com/stablyai/orca/pull/19241\n* perf(mobile): cut the relay reconnect critical path and admit dead sockets faster by @Jinwoo-H in https://github.com/stablyai/orca/pull/19236\n* feat(mobile): draw the last known tab strip while a session reconnects by @Jinwoo-H in https://github.com/stablyai/orca/pull/19258\n* feat(relay): alert on far-cell placement and skewed region hints by @Jinwoo-H in https://github.com/stablyai/orca/pull/19253\n* fix(test): give federation tests a real read-after-write sync barrier by @Jinwoo-H in https://github.com/stablyai/orca/pull/19262\n* revert(mobile): hold the relay reconnect path and cache-first reconnect for a separate mobile pass by @Jinwoo-H in https://github.com/stablyai/orca/pull/19265\n* relay: give the asia-east2 cells the regional rehome identity by @Jinwoo-H in https://github.com/stablyai/orca/pull/19239\n* fix(relay): emit pending-conn details to hosts that advertise the capability (cell side) by @Jinwoo-H in https://github.com/stablyai/orca/pull/19266\n* fix(relay): bound control RTT samples per ping and per flush window by @Jinwoo-H in https://github.com/stablyai/orca/pull/19268\n* fix(relay-ops): let the rehome trust probe approve the asia-east2 cells by @Jinwoo-H in https://github.com/stablyai/orca/pull/19275\n* fix(codex): distinguish personal and enterprise accounts sharing an email by @nwparker in https://github.com/stablyai/orca/pull/19279\n* test(relay): prove the pending-conn capability header reaches acceptControl by @Jinwoo-H in https://github.com/stablyai/orca/pull/19274\n* feat(windows): enable structured Codex chat on native Windows by @brennanb2025 in https://github.com/stablyai/orca/pull/18519\n* test(ssh): isolate the MFA fixture from the developer's real ~/.ssh by @brennanb2025 in https://github.com/stablyai/orca/pull/19300\n* Add localization for activity view and sidebar by @OrcaWin in https://github.com/stablyai/orca/pull/18589\n* fix(native-chat): make structured chat tabs renameable by @brennanb2025 in https://github.com/stablyai/orca/pull/19153\n* feat(native-chat): show Codex subagent activity instead of opcode rows by @brennanb2025 in https://github.com/stablyai/orca/pull/18773\n* fix(agent-status): stop a stale self-authored agent title from faking a pending question by @brennanb2025 in https://github.com/stablyai/orca/pull/19237\n* fix(terminal): remount a pane left unbound by a spawn that returned no PTY id by @brennanb2025 in https://github.com/stablyai/orca/pull/19223\n* fix(relay): stop rejecting the near region on a cold first probe by @Jinwoo-H in https://github.com/stablyai/orca/pull/19233\n* perf(mobile): cut the relay reconnect critical path and admit dead sockets faster (mobile pass) by @Jinwoo-H in https://github.com/stablyai/orca/pull/19280\n* perf(mobile): open a session with parallel startup RPCs and a pre-warmed terminal engine by @Jinwoo-H in https://github.com/stablyai/orca/pull/19260\n* fix(relay): attach a phone whose accept straddles a control rebind (desktop side) by @Jinwoo-H in https://github.com/stablyai/orca/pull/19238\n* tools: add a phone-vantage relay connect benchmark by @Jinwoo-H in https://github.com/stablyai/orca/pull/19251\n* feat(mobile): draw the last known tab strip while a session reconnects (mobile pass) by @Jinwoo-H in https://github.com/stablyai/orca/pull/19281\n* feat(relay): log the region probe and name the assigned cell by @Jinwoo-H in https://github.com/stablyai/orca/pull/19307\n* perf(mobile): race the direct and relay dials from t=0 on every reconnect by @Jinwoo-H in https://github.com/stablyai/orca/pull/19308\n* feat(mobile): time relay dial stages so diagnostics say where a slow connect went by @Jinwoo-H in https://github.com/stablyai/orca/pull/19245\n* Persist agents sidebar search visibility as pairing-local preference by @AmethystLiang in https://github.com/stablyai/orca/pull/19313\n* feat(chat): add structured session rewind backend by @brennanb2025 in https://github.com/stablyai/orca/pull/19235\n* Defer inactive browser pages across worktree switches by @AmethystLiang in https://github.com/stablyai/orca/pull/19326\n* fix(native-chat): stop an unanswered host from reading as one that refuses structured chat by @brennanb2025 in https://github.com/stablyai/orca/pull/19321\n* fix(native-chat): scope composer file drops to the pane that received them by @brennanb2025 in https://github.com/stablyai/orca/pull/19328\n* revert(mobile): pull the relay connect-speed mobile pass pending a smaller, verified re-land by @Jinwoo-H in https://github.com/stablyai/orca/pull/19348\n* fix(relay): never cache a region hint from a one-region catalog by @Jinwoo-H in https://github.com/stablyai/orca/pull/19349\n* Show native chat message timestamps on hover by @brennanb2025 in https://github.com/stablyai/orca/pull/19218\n* feat(native-chat): add execution details and tool row identity by @brennanb2025 in https://github.com/stablyai/orca/pull/19226\n* chore(mobile): remove stale max-lines exceptions by @nwparker in https://github.com/stablyai/orca/pull/19366\n* fix(native-chat): render compaction notices, plan documents, and images by @brennanb2025 in https://github.com/stablyai/orca/pull/19228\n* fix(sidebar): reveal collapsed workspaces without clearing filters by @nwparker in https://github.com/stablyai/orca/pull/19398\n* fix(orchestration): avoid full message scans on working terminal titles by @brennanb2025 in https://github.com/stablyai/orca/pull/19390\n* fix(deps): update desktop parsers for security and bounded resource use by @OrcaWin in https://github.com/stablyai/orca/pull/19361\n* fix(deps): harden cloud HTTP, WebSocket and build dependencies by @OrcaWin in https://github.com/stablyai/orca/pull/19362\n* chore(mobile): patch XML parser security in plist tooling by @OrcaWin in https://github.com/stablyai/orca/pull/19380\n* chore(docs): patch brace expansion resource exhaustion fixes by @OrcaWin in https://github.com/stablyai/orca/pull/19382\n* fix(deps): update react-i18next for TypeScript 7 and translation parsing by @OrcaWin in https://github.com/stablyai/orca/pull/19378\n* fix(deps): update DOMPurify for sanitizer and document-context fixes by @OrcaWin in https://github.com/stablyai/orca/pull/19377\n* fix(ci): read the changed-path list past the first pipe buffer by @nwparker in https://github.com/stablyai/orca/pull/19409\n* fix(xterm): remove scrollback decorations by identity by @bbingz in https://github.com/stablyai/orca/pull/13178\n* feat(native-chat): read a tool batch as a group by @brennanb2025 in https://github.com/stablyai/orca/pull/19372\n* fix(deps): upgrade Electron to 43.6 for startup performance and crash fixes by @OrcaWin in https://github.com/stablyai/orca/pull/19369\n* fix: preserve user input during terminal scrollback replay by @nwparker in https://github.com/stablyai/orca/pull/19075\n* Unify sidebar create actions into single dropdown menu by @AmethystLiang in https://github.com/stablyai/orca/pull/19375\n* fix: preserve terminal retirement proof across renderer publications by @nwparker in https://github.com/stablyai/orca/pull/19002\n* perf(renderer): avoid per-second spinner animation events by @OrcaWin in https://github.com/stablyai/orca/pull/19407\n* fix(pi): show input modals as waiting instead of working by @mmarabel in https://github.com/stablyai/orca/pull/18836\n* Fix sidebar create menu E2E races by @AmethystLiang in https://github.com/stablyai/orca/pull/19448\n* test: cover input in five simultaneously flooding SSH panes by @nwparker in https://github.com/stablyai/orca/pull/19071\n* fix(runtime): stop a first status publication retiring in-flight worktree scans by @nwparker in https://github.com/stablyai/orca/pull/19357\n* fix(clipboard): route runtime-owned SSH image paste through the runtime by @nwparker in https://github.com/stablyai/orca/pull/19352\n* fix(sidebar): label pinned rows with their host on a multi-host sidebar by @nwparker in https://github.com/stablyai/orca/pull/19351\n* Log error details on session kill failure by @AmethystLiang in https://github.com/stablyai/orca/pull/19381\n* Stabilize scrollbar gutter to prevent message list layout shift by @AmethystLiang in https://github.com/stablyai/orca/pull/19332\n* Rank activity status groups by attention level by @AmethystLiang in https://github.com/stablyai/orca/pull/19329\n* perf: index selected team IDs and choose primary team in one pass by @OrcaWin in https://github.com/stablyai/orca/pull/19504\n* perf: skip Git-status indexing without eligible editors by @OrcaWin in https://github.com/stablyai/orca/pull/19437\n* perf: stop filesystem authorization at the first matching root by @OrcaWin in https://github.com/stablyai/orca/pull/19438\n* perf: index editor ownership and restored workspace projections by @OrcaWin in https://github.com/stablyai/orca/pull/19444\n* fix: avoid duplicate repository groups during catalog refresh by @kiendle in https://github.com/stablyai/orca/pull/19170\n* Fix native PTY I/O failures disabling session termination by @AmethystLiang in https://github.com/stablyai/orca/pull/19523\n* perf: index project table option and iteration order by @OrcaWin in https://github.com/stablyai/orca/pull/19476\n* perf: stop clone URL discovery at the first usable source by @OrcaWin in https://github.com/stablyai/orca/pull/19477\n* perf: clone only changed work-item pages by @OrcaWin in https://github.com/stablyai/orca/pull/19478\n* perf: use counted membership for worker transcript roster twins by @OrcaWin in https://github.com/stablyai/orca/pull/19484\n* perf: skip sorting when all final automation runs fit by @OrcaWin in https://github.com/stablyai/orca/pull/19485\n* perf: parse Git history headers without splitting commit bodies by @OrcaWin in https://github.com/stablyai/orca/pull/19486\n* perf: index forgotten Codex turns for bounded ordinal retention by @OrcaWin in https://github.com/stablyai/orca/pull/19488\n* perf: cache matched and unmatched Claude usage cwd attribution by @OrcaWin in https://github.com/stablyai/orca/pull/19489\n* perf: sum omitted workspace sizes without intermediate objects by @OrcaWin in https://github.com/stablyai/orca/pull/19491\n* fix(activity): show working agents under \"unread only\" by giving working turns a read receipt by @AmethystLiang in https://github.com/stablyai/orca/pull/19535\n* test: fix automation and browser reconciliation e2e tests by @AmethystLiang in https://github.com/stablyai/orca/pull/19530\n* perf: index VM feature restoration and precompute sorting identities by @OrcaWin in https://github.com/stablyai/orca/pull/19457\n* perf: reuse normalized path matchers for batch deletion by @OrcaWin in https://github.com/stablyai/orca/pull/19458\n* perf: normalize only retained browser history candidates by @OrcaWin in https://github.com/stablyai/orca/pull/19460\n* perf: index prior memberships during project identity succession by @OrcaWin in https://github.com/stablyai/orca/pull/19463\n* perf: precompute Jira priority and timestamp sorting keys by @OrcaWin in https://github.com/stablyai/orca/pull/19472\n* perf: parse external automation dates once per run by @OrcaWin in https://github.com/stablyai/orca/pull/19474\n* Verify failure causality in PR checks fix prompt before making changes by @AmethystLiang in https://github.com/stablyai/orca/pull/19435\n* fix(remote): keep terminal tabs syncing after orphan recovery by @shaharmor in https://github.com/stablyai/orca/pull/19065\n* perf(native-chat): bound journal reads during paged catch-up by @nwparker in https://github.com/stablyai/orca/pull/19360\n* perf(native-chat): preserve historical tool rows while streaming by @nwparker in https://github.com/stablyai/orca/pull/19364\n* perf: memoize ancestry when selecting foreground agents by @OrcaWin in https://github.com/stablyai/orca/pull/19502\n* fix(terminal): fold-safe CAN/SUB and double-ESC handling in partial-escape tail by @nwparker in https://github.com/stablyai/orca/pull/19521\n* perf: lazily index case-insensitive Windows environment keys by @OrcaWin in https://github.com/stablyai/orca/pull/19483\n* perf: select highest usage totals without full sorting by @OrcaWin in https://github.com/stablyai/orca/pull/19490\n* fix(agent-hooks): guard every Windows missing-target fallback before it reads stdin by @nwparker in https://github.com/stablyai/orca/pull/19415\n* perf: count GitLab diff line prefixes without splitting all lines by @OrcaWin in https://github.com/stablyai/orca/pull/19505\n* fix(terminal): remove host-retired ghost panes in paired remote splits (#17770) by @nwparker in https://github.com/stablyai/orca/pull/19365\n* feat(terminal): make the contrast floor user-configurable (#10754) by @nwparker in https://github.com/stablyai/orca/pull/18126\n* fix(orchestration): file federated worker mail under the coordinator Run by @Jinwoo-H in https://github.com/stablyai/orca/pull/19542\n* fix(orchestration): refuse Task re-open under a live worker; allow stop re-issue on a stranded row by @Jinwoo-H in https://github.com/stablyai/orca/pull/19551\n* fix(i18n): drop orphan TerminalPane.minimumContrast entries that broke main static analysis by @nwparker in https://github.com/stablyai/orca/pull/19566\n* Remove settled-worker automatic resume and hibernation fences by @Jinwoo-H in https://github.com/stablyai/orca/pull/19544\n* fix(pi): finish the dialog-wait signal on every surface by @nwparker in https://github.com/stablyai/orca/pull/19533\n* Organize activity menu into filter and view sections by @AmethystLiang in https://github.com/stablyai/orca/pull/19547\n* fix(orchestration): own a worker terminal from creation, not after the boot wait by @Jinwoo-H in https://github.com/stablyai/orca/pull/19608\n* fix(orchestration): fence worker release on mobile keystrokes by @Jinwoo-H in https://github.com/stablyai/orca/pull/19337\n* fix(native-chat): place effort to the right of model picker by @brennanb2025 in https://github.com/stablyai/orca/pull/19617\n* Show picker-selected native chat skills as pills by @brennanb2025 in https://github.com/stablyai/orca/pull/19616\n* fix(native-chat): reveal message chrome on keyboard focus, not any focus by @brennanb2025 in https://github.com/stablyai/orca/pull/19426\n* Unify native chat and workspace tab command dispatch by @brennanb2025 in https://github.com/stablyai/orca/pull/19621\n* fix(browser): load newly opened background tabs by @brennanb2025 in https://github.com/stablyai/orca/pull/19633\n* fix(renderer): align native chat pane layering by @brennanb2025 in https://github.com/stablyai/orca/pull/19626\n* Summarize turn file changes and preserve resolved prompt receipts by @brennanb2025 in https://github.com/stablyai/orca/pull/19229\n* perf: track pane alias singleton or ambiguity without copying buckets by @OrcaWin in https://github.com/stablyai/orca/pull/19479\n* perf: preserve store state on unchanged document titles by @OrcaWin in https://github.com/stablyai/orca/pull/19459\n* perf: index document history workspace and path identities by @OrcaWin in https://github.com/stablyai/orca/pull/19461\n* perf: index unified tabs for browser palette entries by @OrcaWin in https://github.com/stablyai/orca/pull/19464\n* perf: append to owned project source lists without repeated copying by @OrcaWin in https://github.com/stablyai/orca/pull/19465\n* perf: lazily index workspace tabs during terminal binding replay by @OrcaWin in https://github.com/stablyai/orca/pull/19466\n* perf: retire exhausted buckets from host-balanced listings by @OrcaWin in https://github.com/stablyai/orca/pull/19493\n* perf: replay pending chat asks with a FIFO cursor by @OrcaWin in https://github.com/stablyai/orca/pull/19496\n* perf: cache same-axis pane subtree weights during equalization by @OrcaWin in https://github.com/stablyai/orca/pull/19500\n* perf: group chat history sequences lazily within result windows by @OrcaWin in https://github.com/stablyai/orca/pull/19501\n* perf: measure sidebar row geometry once before sorting delete anchors by @OrcaWin in https://github.com/stablyai/orca/pull/19503\n* perf: concatenate only carried JSONL line prefixes by @OrcaWin in https://github.com/stablyai/orca/pull/19506\n* perf: index discovered skill IDs and names for batch selection by @OrcaWin in https://github.com/stablyai/orca/pull/19507\n* perf: skip fuzzy ranking when exact file matches fill the window by @OrcaWin in https://github.com/stablyai/orca/pull/19509\n* perf: index tab membership when rebasing authoritative sessions by @OrcaWin in https://github.com/stablyai/orca/pull/19510\n* perf: reuse collators when sorting discovered skills by @OrcaWin in https://github.com/stablyai/orca/pull/19440\n* perf: reuse collators when scanning Warp themes by @OrcaWin in https://github.com/stablyai/orca/pull/19441\n* perf: avoid repeated pending SOCKS payload copies by @OrcaWin in https://github.com/stablyai/orca/pull/19439\n* perf(terminal): avoid quadratic status-marker scans in output bursts by @nwparker in https://github.com/stablyai/orca/pull/19373\n* perf: index selected-host SSH leases by PTY by @OrcaWin in https://github.com/stablyai/orca/pull/19467\n* perf: index selected ancestor coverage during sidebar drag by @OrcaWin in https://github.com/stablyai/orca/pull/19443\n* perf: index Resource Manager labels and accumulated workspace rows by @OrcaWin in https://github.com/stablyai/orca/pull/19480\n* perf: drop oversized diagnostic records before retaining serialized text by @OrcaWin in https://github.com/stablyai/orca/pull/19445\n* perf: index selected skills when reporting bundle failures by @OrcaWin in https://github.com/stablyai/orca/pull/19481\n* perf: bound tool pairing and avoid unused attribution arrays by @OrcaWin in https://github.com/stablyai/orca/pull/19468\n* perf: scope activation inventory to the owning host and workspace by @OrcaWin in https://github.com/stablyai/orca/pull/19447\n* perf: index closed browser page IDs during focus cleanup by @OrcaWin in https://github.com/stablyai/orca/pull/19449\n* perf: prune metadata caches only when an entry can expire by @OrcaWin in https://github.com/stablyai/orca/pull/19450\n* perf: index observable skill installations by locked name by @OrcaWin in https://github.com/stablyai/orca/pull/19451\n* perf: skip folder-scope construction for separate repository imports by @OrcaWin in https://github.com/stablyai/orca/pull/19452\n* perf: validate terminal adoption MRU membership with group sets by @OrcaWin in https://github.com/stablyai/orca/pull/19482\n* perf: index terminal neighbor order and remaining membership by @OrcaWin in https://github.com/stablyai/orca/pull/19453\n* perf: index usage session breakdowns during aggregation and merge by @OrcaWin in https://github.com/stablyai/orca/pull/19487\n* perf: reuse AI-vault path matchers and query and sort keys by @OrcaWin in https://github.com/stablyai/orca/pull/19469\n* perf: cache AI-vault project attribution by host and cwd by @OrcaWin in https://github.com/stablyai/orca/pull/19470\n* perf: select checks-panel workspace attribution in one pass by @OrcaWin in https://github.com/stablyai/orca/pull/19471\n* perf: cache update timestamps for Linear and Jira result sorting by @OrcaWin in https://github.com/stablyai/orca/pull/19473\n* perf: reuse naturally ordered unique Codex trust ranges by @OrcaWin in https://github.com/stablyai/orca/pull/19492\n* perf: count command-line escapes without regex match arrays by @OrcaWin in https://github.com/stablyai/orca/pull/19499\n* perf: check backfill date cardinality before expanding ranges by @OrcaWin in https://github.com/stablyai/orca/pull/19456\n* perf: reuse normalized task-page repository selection by @OrcaWin in https://github.com/stablyai/orca/pull/19454\n* fix(native-chat): unify launch routing and support structured worker placement by @brennanb2025 in https://github.com/stablyai/orca/pull/19431\n* feat(native-chat): show Claude subagent activity on the shared carrier by @brennanb2025 in https://github.com/stablyai/orca/pull/18806\n* fix(orchestration): unify structured-session status across worktree ps and sidebar by @brennanb2025 in https://github.com/stablyai/orca/pull/19217\n* fix(native-chat): expand Claude slash commands sent with an attachment by @brennanb2025 in https://github.com/stablyai/orca/pull/19654\n* fix(native-chat): keep collapsible chevrons beside their header text by @brennanb2025 in https://github.com/stablyai/orca/pull/19656\n* fix(orchestration): worker-start settles readiness on observed turn start, not write acceptance by @brennanb2025 in https://github.com/stablyai/orca/pull/19423\n* test(orchestration): pin the Run-required contract for unbound direct mail by @brennanb2025 in https://github.com/stablyai/orca/pull/19684\n* fix(orchestration): accept a missing Run id from older federation coordinators by @brennanb2025 in https://github.com/stablyai/orca/pull/19689\n* Render task checklists with update diffs and a composer progress panel by @brennanb2025 in https://github.com/stablyai/orca/pull/19230\n* fix(lint): preserve deliberate collator benchmark baselines by @brennanb2025 in https://github.com/stablyai/orca/pull/19686\n* fix(native-chat): merge duplicate native-chat-types import by @Jinwoo-H in https://github.com/stablyai/orca/pull/19698\n* fix(orchestration): file mail from terminals in no Run under an unbound Run by @Jinwoo-H in https://github.com/stablyai/orca/pull/19696\n* feat(native-chat): report Codex background tasks in the chat strip by @brennanb2025 in https://github.com/stablyai/orca/pull/19346\n* Unify tab surface selection across workspace activation by @brennanb2025 in https://github.com/stablyai/orca/pull/19635\n* refactor(ai-vault): split the session scanner into a transcript reader and consumers by @Jinwoo-H in https://github.com/stablyai/orca/pull/19666\n* perf: stop queued metadata work after watcher cancellation by @OrcaWin in https://github.com/stablyai/orca/pull/19446\n* perf(runtime): skip hibernation inventories without completed agents by @nwparker in https://github.com/stablyai/orca/pull/19391\n* perf(workspaces): skip unchanged heartbeat subscriber work by @nwparker in https://github.com/stablyai/orca/pull/19392\n* perf: probe requested pane keys instead of enumerating records by @OrcaWin in https://github.com/stablyai/orca/pull/19494\n* perf: resolve current-workspace document addresses before catalog scans by @OrcaWin in https://github.com/stablyai/orca/pull/19495\n* perf: materialize only the requested recent plugin audit lines by @OrcaWin in https://github.com/stablyai/orca/pull/19498\n* test(ci): replace fixed teardown waits with bounded polls by @nwparker in https://github.com/stablyai/orca/pull/19720\n* perf: stop merging OS-opened files at the pending queue cap by @OrcaWin in https://github.com/stablyai/orca/pull/19508\n* perf(terminal): skip plain text between partial escape sequences by @nwparker in https://github.com/stablyai/orca/pull/19393\n* perf(terminal): release oversized backing strings behind pending controls by @nwparker in https://github.com/stablyai/orca/pull/19396\n* perf(terminal): skip ordinary output in preview control scans by @nwparker in https://github.com/stablyai/orca/pull/19400\n* perf(terminal): own retained tail rows so they stop pinning their chunks by @nwparker in https://github.com/stablyai/orca/pull/19528\n* perf: check tunnel queue capacity before copying frame payloads by @OrcaWin in https://github.com/stablyai/orca/pull/19497\n* Replace the sidebar create dropdown with two direct action buttons by @AmethystLiang in https://github.com/stablyai/orca/pull/19653\n* fix(native-chat): keep worktree active during chat creation by @Jinwoo-H in https://github.com/stablyai/orca/pull/19753\n* fix(push): isolate deployment and validate candidates before activation by @Jinwoo-H in https://github.com/stablyai/orca/pull/19771\n* fix(native-chat): show Claude working from the send, not the provider echo by @brennanb2025 in https://github.com/stablyai/orca/pull/19822\n* fix(mobile): enable patch-free iOS text selection in native chat by @brennanb2025 in https://github.com/stablyai/orca/pull/19769\n* perf(terminal): resume OSC terminator search past the carried frame by @nwparker in https://github.com/stablyai/orca/pull/19839\n* perf(native-chat): bound retained items on the structured session path by @nwparker in https://github.com/stablyai/orca/pull/19841\n* perf(terminal): share one ESC dispatch table between the two scanners by @nwparker in https://github.com/stablyai/orca/pull/19842\n* fix(native-chat): one `/` picker for every agent, anywhere in the prompt by @brennanb2025 in https://github.com/stablyai/orca/pull/19832\n* feat(native-chat): the background-tasks strip says what is running by @brennanb2025 in https://github.com/stablyai/orca/pull/19311\n* fix(i18n): drop the stale TerminalPane.minimumContrast entries from the runtime catalog (main red again) by @nwparker in https://github.com/stablyai/orca/pull/19575\n* fix(native-chat): keep an older page from punching a hole in the transcript by @nwparker in https://github.com/stablyai/orca/pull/19845\n* refactor(agent-status): publish structured sessions into the hook server store by @brennanb2025 in https://github.com/stablyai/orca/pull/19683\n* fix(orchestration): scope @ group addresses to the sender's Run by @Jinwoo-H in https://github.com/stablyai/orca/pull/19783\n* feat(native-chat): show live background work and name each row by kind by @brennanb2025 in https://github.com/stablyai/orca/pull/19705\n* feat(sidebar): show native-chat subagents as sidebar child rows, like CLI agents already do by @brennanb2025 in https://github.com/stablyai/orca/pull/19807\n* feat(native-chat): focus the message box when a chat appears by @brennanb2025 in https://github.com/stablyai/orca/pull/19868\n* fix(relay): keep failed rehome polls out of the durable failure budget by @Jinwoo-H in https://github.com/stablyai/orca/pull/19915\n* fix(orchestration): revalidate an attempted Enter instead of resending it by @brennanb2025 in https://github.com/stablyai/orca/pull/19911\n* test(native-chat): split structured question fixtures by @brennanb2025 in https://github.com/stablyai/orca/pull/19924\n* Make the structured turn lifecycle row durable so completed durations survive by @brennanb2025 in https://github.com/stablyai/orca/pull/19695\n* refactor(native-chat): unify agent session launch and open drafts in structured chat by @brennanb2025 in https://github.com/stablyai/orca/pull/19681\n* feat(cloud): native push gateway and dedicated infrastructure (1/3) by @Jinwoo-H in https://github.com/stablyai/orca/pull/19912\n* fix(browser): restore the Chrome-shaped browser identity (STA-7147) by @brennanb2025 in https://github.com/stablyai/orca/pull/19927\n* refactor(mobile): extract settings, diagnostics and editor-document screens from their routes by @Jinwoo-H in https://github.com/stablyai/orca/pull/19675\n* fix(native-chat): never adopt an unlisted model as the launch default by @brennanb2025 in https://github.com/stablyai/orca/pull/19854\n* fix(native-chat): settle a structured send on admission, not on the provider echo by @brennanb2025 in https://github.com/stablyai/orca/pull/19863\n* feat(desktop): native mobile push integration (2/3) by @Jinwoo-H in https://github.com/stablyai/orca/pull/19935\n* fix(sidebar): let an agent row show the provider's own session title by @brennanb2025 in https://github.com/stablyai/orca/pull/19936\n* fix(editor): make markdown images inline so a paragraph stays schema-valid by @OrcaWin in https://github.com/stablyai/orca/pull/19746\n* feat(native-chat): record the provider's name for an agent session by @brennanb2025 in https://github.com/stablyai/orca/pull/19908\n* fix(release): port three release-gate fixes to main so cuts stop re-inheriting them by @brennanb2025 in https://github.com/stablyai/orca/pull/19945\n* refactor(renderer): share path head elision by @AmethystLiang in https://github.com/stablyai/orca/pull/19938\n* feat(cmd-j): compact palette location layout by @AmethystLiang in https://github.com/stablyai/orca/pull/19939\n* refactor(mobile): name the RPC acceptance policies call sites hand-rolled by @Jinwoo-H in https://github.com/stablyai/orca/pull/19960\n* fix: prompt unexpectedly signed-out Cloud users once per version by @Jinwoo-H in https://github.com/stablyai/orca/pull/19966\n* feat(ai-vault-search): session search index as a transcript reader consumer by @Jinwoo-H in https://github.com/stablyai/orca/pull/19687\n* fix(native-chat): pass agent-implemented slash commands through to the agent by @brennanb2025 in https://github.com/stablyai/orca/pull/19929\n* perf(terminal): stop rebuilding per-workspace collections on a worktree switch by @nwparker in https://github.com/stablyai/orca/pull/19975\n* feat(rpc): generate a shared params catalog from the host registry, gated on parse parity by @Jinwoo-H in https://github.com/stablyai/orca/pull/19961\n* feat(native-chat): describe slash commands from the provider's own report by @brennanb2025 in https://github.com/stablyai/orca/pull/19928\n* perf(terminal): stop spending reveal-restore frames on panes that replay nothing by @nwparker in https://github.com/stablyai/orca/pull/19972\n* i18n: Make file reveal labels translatable by @OrcaWin in https://github.com/stablyai/orca/pull/20010\n* perf(native-chat): mount only the transcript rows near the viewport by @brennanb2025 in https://github.com/stablyai/orca/pull/19869\n* feat(mobile): receive native push notifications from paired desktops by @Jinwoo-H in https://github.com/stablyai/orca/pull/19951\n* fix(workspaces): seed shells only for blank selection by @brennanb2025 in https://github.com/stablyai/orca/pull/19940\n* Hide desktop theme imports from paired web clients by @OrcaWin in https://github.com/stablyai/orca/pull/20015\n* feat(ai-vault-search): session search query engine over the index by @Jinwoo-H in https://github.com/stablyai/orca/pull/19750\n* refactor(shared): derive WellKnownAgentType from TuiAgent by @AmethystLiang in https://github.com/stablyai/orca/pull/19645\n* Revert \"feat(ai-vault-search): session search query engine over the index (#19750)\" by @Jinwoo-H in https://github.com/stablyai/orca/pull/20023\n* feat(ai-vault-search): session search indexer library owning backfill, reconcile and retention by @Jinwoo-H in https://github.com/stablyai/orca/pull/19751\n* refactor(rpc): make defineMethod preserve the method name and handler result by @Jinwoo-H in https://github.com/stablyai/orca/pull/20016\n* fix(daemon): pin owner-only modes on persisted terminal history by @nwparker in https://github.com/stablyai/orca/pull/19954\n* Revert mobile push rollout pending delivery investigation by @Jinwoo-H in https://github.com/stablyai/orca/pull/20040\n* fix(pi): retire stale spinner and prompt timers across reloads by @nwparker in https://github.com/stablyai/orca/pull/20035\n* fix(terminal): stop the recovery budget erasing itself during a remount by @OrcaWin in https://github.com/stablyai/orca/pull/19745\n* fix(monaco): bound embedded-language recursion in svelte/astro/vue grammars by @OrcaWin in https://github.com/stablyai/orca/pull/19748\n* fix(runtime): agent-neutral wait-blocked reasons by @OrcaWin in https://github.com/stablyai/orca/pull/19749\n* fix(worktrees): close an idle structured chat on delete instead of refusing by @brennanb2025 in https://github.com/stablyai/orca/pull/19762\n* fix(runtime): let connections own host status recovery by @Jinwoo-H in https://github.com/stablyai/orca/pull/20003\n* fix(native-chat): show one live-turn indicator, and make Thinking mean reasoning by @brennanb2025 in https://github.com/stablyai/orca/pull/19977\n* perf(terminal): mount only the visible pane on a worktree switch by @nwparker in https://github.com/stablyai/orca/pull/20034\n* test(monaco): drive the real Monarch tokenizer instead of walking rule tables by @nwparker in https://github.com/stablyai/orca/pull/19981\n* test(runtime): capture real Antigravity transcripts — the detector is inverted on live output by @nwparker in https://github.com/stablyai/orca/pull/19983\n* fix(pi): claim the status pane when the inherited owner PID is dead (STA-5245) by @brennanb2025 in https://github.com/stablyai/orca/pull/16631\n* fix(pi): load extension providers for source control generation by @nwparker in https://github.com/stablyai/orca/pull/20070\n* fix(terminal): keep a deliberately slept workspace cold until it is woken by @nwparker in https://github.com/stablyai/orca/pull/20075\n* perf(daemon): stop scanning every cell for OSC links that cannot exist by @nwparker in https://github.com/stablyai/orca/pull/20077\n* fix(terminal): move the recovery ledger onto the tab row and gate it on observed outcome by @nwparker in https://github.com/stablyai/orca/pull/20025\n* fix(push): preserve distinct Android alerts while offline by @Jinwoo-H in https://github.com/stablyai/orca/pull/20066\n* feat(native-chat): show when a Codex goal is set, changed, or cleared by @brennanb2025 in https://github.com/stablyai/orca/pull/19923\n* Fix remote hosted review browser routing by @Jinwoo-H in https://github.com/stablyai/orca/pull/20030\n* fix(mobile): surface host create warnings and terminal-create errors by @brennanb2025 in https://github.com/stablyai/orca/pull/20125\n* feat(relay): correct regional placement only when the source is idle by @Jinwoo-H in https://github.com/stablyai/orca/pull/20105\n* test(relay): harden regional rehome race coverage by @Jinwoo-H in https://github.com/stablyai/orca/pull/20136\n* feat(desktop): measure relay regions and reconnect after idle cutover by @Jinwoo-H in https://github.com/stablyai/orca/pull/20106\n* refactor(agent-status): delete the runtime's retained row store (PR 1b) by @brennanb2025 in https://github.com/stablyai/orca/pull/19785\n* fix(deps): take Electron 43.7.0 for the glibc environ use-after-free (#20081) by @nwparker in https://github.com/stablyai/orca/pull/20089\n* fix(browser): decode Chromium SameSite storage values (135 cookies silently lost per profile) by @brennanb2025 in https://github.com/stablyai/orca/pull/20076\n* fix(terminal): re-run deferred tab admission when a plan installs mid-activation by @brennanb2025 in https://github.com/stablyai/orca/pull/20176\n* fix(workspaces): complete a worktree create when a post-create step throws by @brennanb2025 in https://github.com/stablyai/orca/pull/20175\n* feat(relay): support protocol 3 in cell rollout gates by @Jinwoo-H in https://github.com/stablyai/orca/pull/20174\n* fix(e2e): remove four real flake sources and one caret race by @brennanb2025 in https://github.com/stablyai/orca/pull/20169\n* fix(source-control): pass the Antigravity prompt to agy --print by @nwparker in https://github.com/stablyai/orca/pull/20147\n* fix(e2e): run worktree first-paint probe on a mapped window by @brennanb2025 in https://github.com/stablyai/orca/pull/20197\n* fix(relay): bound idle rehome polling and skip disabled scans by @Jinwoo-H in https://github.com/stablyai/orca/pull/20203\n* fix(hooks): stop orphaned managed markers from consuming user TOML by @nwparker in https://github.com/stablyai/orca/pull/20148\n* fix(codex): reconcile marketplace and plugin tables through the config mirror by @nwparker in https://github.com/stablyai/orca/pull/20150\n* fix(relay): reuse canary across completed rollout batches by @Jinwoo-H in https://github.com/stablyai/orca/pull/20214\n* Restore mobile push and fix cold-start dismissals by @Jinwoo-H in https://github.com/stablyai/orca/pull/20068\n* fix(cloud): tolerate sparse director errors in rollout monitor by @Jinwoo-H in https://github.com/stablyai/orca/pull/20238\n* feat(ai-vault-search): session search query engine over the index by @Jinwoo-H in https://github.com/stablyai/orca/pull/20029\n* feat(mobile): add typed RPC operations and fence raw requests by @Jinwoo-H in https://github.com/stablyai/orca/pull/20018\n* fix(native-chat): shrink skill pill text by @brennanb2025 in https://github.com/stablyai/orca/pull/20254\n* fix(claude): refuse a structured model the provider does not list by @brennanb2025 in https://github.com/stablyai/orca/pull/19946\n* perf: defer closed menus to speed up cold worktree switching by @nwparker in https://github.com/stablyai/orca/pull/20311\n* test: replace fixed UI waits with observable readiness by @nwparker in https://github.com/stablyai/orca/pull/20369\n* ci: reuse immutable package setup across shutdown checks by @nwparker in https://github.com/stablyai/orca/pull/20368\n* perf: index Hermes session correlation instead of rescanning history by @nwparker in https://github.com/stablyai/orca/pull/20275\n* fix: prevent infinite loops in mobile Markdown rendering by @nwparker in https://github.com/stablyai/orca/pull/20313\n* perf: eliminate mobile review table delimiter backtracking by @nwparker in https://github.com/stablyai/orca/pull/20317\n* perf: eliminate repeated mobile Markdown link suffix scans by @nwparker in https://github.com/stablyai/orca/pull/20322\n* ci: narrow pnpm cache keys and shallow development checkouts by @nwparker in https://github.com/stablyai/orca/pull/20370\n* perf(browser): fill plain fields in one stdin edit by @nwparker in https://github.com/stablyai/orca/pull/20364\n* Fix landing footer menu placement by @nwparker in https://github.com/stablyai/orca/pull/20360\n* ci: balance existing unit and E2E shards using recorded timings by @nwparker in https://github.com/stablyai/orca/pull/20367\n* fix(cloud): diagnose wrapped relay trust probe failures by @Jinwoo-H in https://github.com/stablyai/orca/pull/20403\n* refactor(renderer): improve IPC error handling with clamped and unclamped variants by @AmethystLiang in https://github.com/stablyai/orca/pull/20340\n* Make sidebar nesting easier while preserving animated reordering by @nwparker in https://github.com/stablyai/orca/pull/20412\n* refactor(preload): drop the unused raw electron IPC bridge by @nwparker in https://github.com/stablyai/orca/pull/20419\n* fix(browser): move cookie scoping off psl's stale suffix list by @nwparker in https://github.com/stablyai/orca/pull/20421\n* fix(claude-accounts): stop path resolution from creating the config directory by @makoto-developer in https://github.com/stablyai/orca/pull/12309\n* perf: normalize title evidence once per label search by @nwparker in https://github.com/stablyai/orca/pull/20331\n* fix(runtime): GC expired proven-absent leaf PTY verdicts by @innocarpe in https://github.com/stablyai/orca/pull/12810\n* fix(ai-vault): close OpenCode handles when query_only setup fails by @bbingz in https://github.com/stablyai/orca/pull/14134\n* perf(wsl): release environment probe deadline timers by @OrcaWin in https://github.com/stablyai/orca/pull/20207\n* perf(daemon): bound immediate flush queue scans by @OrcaWin in https://github.com/stablyai/orca/pull/20209\n* perf(mobile): normalize history scope paths once per candidate by @nwparker in https://github.com/stablyai/orca/pull/20210\n* perf(automations): skip sorting count-only Hermes history by @OrcaWin in https://github.com/stablyai/orca/pull/20213\n* perf(chat): reuse streamed delta byte lengths by @OrcaWin in https://github.com/stablyai/orca/pull/20215\n* perf(files): skip unused Quick Open byte accounting by @OrcaWin in https://github.com/stablyai/orca/pull/20216\n* perf(relay): reuse host data attachment owner without inventory copies by @nwparker in https://github.com/stablyai/orca/pull/20219\n* perf(mobile): avoid materializing input characters on backspace by @OrcaWin in https://github.com/stablyai/orca/pull/20220\n* perf(browser): skip unneeded inventory compaction planning by @OrcaWin in https://github.com/stablyai/orca/pull/20221\n* perf(usage): skip session scans for empty breakdowns by @OrcaWin in https://github.com/stablyai/orca/pull/20222\n* perf(session): reuse persisted tab membership set by @OrcaWin in https://github.com/stablyai/orca/pull/20223\n* perf(diff): skip unused extension extraction during search by @OrcaWin in https://github.com/stablyai/orca/pull/20225\n* perf(mobile): bound autocomplete substring retention by @OrcaWin in https://github.com/stablyai/orca/pull/20226\n* perf: index pending terminal reconnect tab lookups by @OrcaWin in https://github.com/stablyai/orca/pull/20229\n* perf: skip ordinary strings in JSON structure checks by @OrcaWin in https://github.com/stablyai/orca/pull/20232\n* perf: avoid rescanning partial browser sidecar responses by @OrcaWin in https://github.com/stablyai/orca/pull/20242\n* perf: count local RPC request bytes incrementally by @OrcaWin in https://github.com/stablyai/orca/pull/20243\n* perf(history): cache numeric transcript timeline bounds by @OrcaWin in https://github.com/stablyai/orca/pull/20244\n* perf: stop heading lookup at the requested occurrence by @OrcaWin in https://github.com/stablyai/orca/pull/20246\n* perf: defer browser search row formatting until matched by @OrcaWin in https://github.com/stablyai/orca/pull/20248\n* perf: stop preparing over-limit palette queries by @OrcaWin in https://github.com/stablyai/orca/pull/20250\n* perf: avoid duplicate repository directory probes by @OrcaWin in https://github.com/stablyai/orca/pull/20253\n* perf: compile nested repository ignore patterns once by @OrcaWin in https://github.com/stablyai/orca/pull/20256\n* perf: avoid repeated model pricing name normalization by @OrcaWin in https://github.com/stablyai/orca/pull/20257\n* perf(skills): index source ownership counts per discovery by @OrcaWin in https://github.com/stablyai/orca/pull/20259\n* perf(plugins): stop collection traversal at message size limit by @nwparker in https://github.com/stablyai/orca/pull/20260\n* perf(history): scan legacy alternate-screen markers linearly by @OrcaWin in https://github.com/stablyai/orca/pull/20267\n* perf: reuse skill file digest when normalized bytes match by @OrcaWin in https://github.com/stablyai/orca/pull/20268\n* perf(native): avoid sanitizing snapshot values twice by @nwparker in https://github.com/stablyai/orca/pull/20271\n* perf: encode skill Git tree sort keys once by @OrcaWin in https://github.com/stablyai/orca/pull/20272\n* perf: skip decoding discarded diagnostic error bodies by @OrcaWin in https://github.com/stablyai/orca/pull/20276\n* perf: avoid flattening tabs for smart-sort liveness check by @OrcaWin in https://github.com/stablyai/orca/pull/20279\n* perf: accept UTF-8 text that fits the worst-case byte bound by @OrcaWin in https://github.com/stablyai/orca/pull/20286\n* perf: bound rich Markdown comment detection and preservation scans by @nwparker in https://github.com/stablyai/orca/pull/20287\n* perf(ipc): bound SSH ACK batch selection scans by @nwparker in https://github.com/stablyai/orca/pull/20288\n* perf: avoid copying completed terminal source ranges by @OrcaWin in https://github.com/stablyai/orca/pull/20289\n* perf(ssh): skip terminal source spans awaiting ACK publication by @OrcaWin in https://github.com/stablyai/orca/pull/20290\n* perf: reuse diagnostic bundle byte count by @OrcaWin in https://github.com/stablyai/orca/pull/20292\n* perf: normalize manifest text files once by @OrcaWin in https://github.com/stablyai/orca/pull/20294\n* perf: reuse formatter within reset timestamp conversion by @OrcaWin in https://github.com/stablyai/orca/pull/20295\n* perf: defer scrollback pruning indexes until needed by @OrcaWin in https://github.com/stablyai/orca/pull/20297\n* perf(daemon): reuse encoded unsplit NDJSON frames by @nwparker in https://github.com/stablyai/orca/pull/20298\n* perf(browser): index iframe session refs for snapshot lookup by @nwparker in https://github.com/stablyai/orca/pull/20300\n* perf: reuse computed project identity in projection by @OrcaWin in https://github.com/stablyai/orca/pull/20303\n* perf: stop archive size scan once over budget by @OrcaWin in https://github.com/stablyai/orca/pull/20304\n* perf: avoid per-item arrays in journal projection by @OrcaWin in https://github.com/stablyai/orca/pull/20305\n* perf: reuse Windows PATH normalization within merges by @OrcaWin in https://github.com/stablyai/orca/pull/20309\n* perf: find path basename without splitting all segments by @OrcaWin in https://github.com/stablyai/orca/pull/20312\n* perf(ssh): copy cleanup tab map only once by @OrcaWin in https://github.com/stablyai/orca/pull/20315\n* perf: fast-path Windows arguments without escapes by @OrcaWin in https://github.com/stablyai/orca/pull/20318\n* perf(checks): bound log excerpt byte-limit checks by @OrcaWin in https://github.com/stablyai/orca/pull/20319\n* perf: use native newline search in rich Markdown code stripping by @nwparker in https://github.com/stablyai/orca/pull/20320\n* perf: stop building chat diff sections beyond preview limit by @OrcaWin in https://github.com/stablyai/orca/pull/20321\n* perf: count chat tool calls without a filtered array by @OrcaWin in https://github.com/stablyai/orca/pull/20328\n* perf: reject file-count labels before parsing edit patches by @OrcaWin in https://github.com/stablyai/orca/pull/20330\n* perf(terminal): reuse bounded native snapshot byte checks by @OrcaWin in https://github.com/stablyai/orca/pull/20333\n* perf: select matching model IDs without sorting by @OrcaWin in https://github.com/stablyai/orca/pull/20334\n* perf: remove duplicate empty-file filtering from search finalization by @OrcaWin in https://github.com/stablyai/orca/pull/20335\n* perf: avoid repeated history page byte serialization by @nwparker in https://github.com/stablyai/orca/pull/20337\n* perf: collect terminal snapshot replay without wrapper arrays by @OrcaWin in https://github.com/stablyai/orca/pull/20338\n* perf: reuse accepted project group IDs for parent validation by @OrcaWin in https://github.com/stablyai/orca/pull/20341\n* perf: compute check severity once per sort by @OrcaWin in https://github.com/stablyai/orca/pull/20342\n* perf: count bot comments without a filtered array by @OrcaWin in https://github.com/stablyai/orca/pull/20343\n* perf: index relay drain migration inventories once by @nwparker in https://github.com/stablyai/orca/pull/20344\n* perf: avoid typed-array iteration in shared SHA-256 blocks by @OrcaWin in https://github.com/stablyai/orca/pull/20346\n* perf: reuse shared SHA-256 for renderer fallback by @OrcaWin in https://github.com/stablyai/orca/pull/20347\n* perf(computer): avoid rescanning fragmented native provider replies by @OrcaWin in https://github.com/stablyai/orca/pull/20348\n* perf: skip nonmatching spans in Quick Open scoring by @nwparker in https://github.com/stablyai/orca/pull/20349\n* perf: skip dominated quick command search fields by @nwparker in https://github.com/stablyai/orca/pull/20352\n* perf: reuse normalized executable during agent recognition by @OrcaWin in https://github.com/stablyai/orca/pull/20353\n* perf(localization): prefilter absent brands before regex matching by @OrcaWin in https://github.com/stablyai/orca/pull/20354\n* perf: avoid copying single-chunk process output by @OrcaWin in https://github.com/stablyai/orca/pull/20355\n* perf: scan chat activity text from its last line by @nwparker in https://github.com/stablyai/orca/pull/20356\n* perf(mobile): reuse UTF-8 prefix truncation for diagnostics by @OrcaWin in https://github.com/stablyai/orca/pull/20358\n* perf(checks): bound earlier error context collection by @OrcaWin in https://github.com/stablyai/orca/pull/20211\n* perf(mobile): reuse numeric collators across source control sorts by @nwparker in https://github.com/stablyai/orca/pull/20224\n* perf(mobile): precompute task sort keys and reuse repository collation by @nwparker in https://github.com/stablyai/orca/pull/20233\n* perf(agents): avoid cloning lineage ancestor sets by @OrcaWin in https://github.com/stablyai/orca/pull/20236\n* perf(plugins): reconcile shortcut conflicts once per owner by @nwparker in https://github.com/stablyai/orca/pull/20237\n* perf: avoid rescanning partial transcript records by @OrcaWin in https://github.com/stablyai/orca/pull/20239\n* perf: use native newline search for Markdown review excerpts by @nwparker in https://github.com/stablyai/orca/pull/20245\n* perf(ai-vault): deduplicate session scan batches incrementally by @OrcaWin in https://github.com/stablyai/orca/pull/20255\n* perf: stop review acknowledgement summaries at the first readable line by @nwparker in https://github.com/stablyai/orca/pull/20263\n* perf(git): classify bulk discard paths once by @nwparker in https://github.com/stablyai/orca/pull/20274\n* perf: eliminate quadratic palette phrase placement scans by @nwparker in https://github.com/stablyai/orca/pull/20306\n* perf: avoid repeated unclosed-tag scans in mobile reviews by @nwparker in https://github.com/stablyai/orca/pull/20329\n* perf(plugins): index contributed keybindings by command by @nwparker in https://github.com/stablyai/orca/pull/20241\n* perf(mobile): precompute Linear issue sort keys by @nwparker in https://github.com/stablyai/orca/pull/20249\n* perf(chat): join transcript line fragments at record boundaries by @OrcaWin in https://github.com/stablyai/orca/pull/20278\n* perf(cmd-j): scan phrase word boundaries monotonically by @nwparker in https://github.com/stablyai/orca/pull/20282\n* perf(ai-vault): count recent sessions for scan cutoffs by @OrcaWin in https://github.com/stablyai/orca/pull/20301\n* perf: remove repeated sibling scans from cyclic agent lineage cleanup by @nwparker in https://github.com/stablyai/orca/pull/20302\n* perf: reuse pending filesystem watcher debounce timers by @OrcaWin in https://github.com/stablyai/orca/pull/20264\n* fix(editor): eliminate multi-second Markdown blank-run scans by @nwparker in https://github.com/stablyai/orca/pull/20231\n* perf: avoid rescanning partial Windows desktop responses by @OrcaWin in https://github.com/stablyai/orca/pull/20235\n* fix(chat): bound journal replay memory by live history by @nwparker in https://github.com/stablyai/orca/pull/20247\n* perf(android): queue fragmented scrcpy video packets by @OrcaWin in https://github.com/stablyai/orca/pull/20230\n* perf(mobile): skip successful duplicate connection log saves by @nwparker in https://github.com/stablyai/orca/pull/20252\n* perf: skip impossible inline HTML comment matches during encoding by @nwparker in https://github.com/stablyai/orca/pull/20293\n* chore: remove 20.7 MiB of duplicate and unused media by @nwparker in https://github.com/stablyai/orca/pull/20416\n* perf: bound whitespace normalization for tool previews by @nwparker in https://github.com/stablyai/orca/pull/20332\n* fix(tabs): cancel split drags when the window loses focus by @OrcaWin in https://github.com/stablyai/orca/pull/20323\n* fix(updater): open background check errors from the status bar by @OrcaWin in https://github.com/stablyai/orca/pull/20270\n* perf(relay): sort latency samples once per percentile pair by @nwparker in https://github.com/stablyai/orca/pull/20427\n* perf(skills): test agent ownership without building a deduped list by @nwparker in https://github.com/stablyai/orca/pull/20428\n* perf(git): reject non-HEAD refs before sorting remotes by @nwparker in https://github.com/stablyai/orca/pull/20429\n* perf(mobile): release consumed terminal write-queue slots by @nwparker in https://github.com/stablyai/orca/pull/20430\n* perf(git): normalize tracked discard paths once per operation by @nwparker in https://github.com/stablyai/orca/pull/20299\n* refactor(windows): vendor the registry addon as @orca/windows-registry by @nwparker in https://github.com/stablyai/orca/pull/20438\n* fix(resource-manager): show saved folder workspace names and groups by @OrcaWin in https://github.com/stablyai/orca/pull/20324\n* test(relay): differential coverage for the single-pass host-data owner lookup by @nwparker in https://github.com/stablyai/orca/pull/20426\n* perf(mobile): reuse Linear grouping between list and board by @nwparker in https://github.com/stablyai/orca/pull/20431\n* chore(deps): pin serve-sim to an exact version by @nwparker in https://github.com/stablyai/orca/pull/20446\n* Add code quality lint for type assertions by @AmethystLiang in https://github.com/stablyai/orca/pull/19462\n* fix(ci): cache the vendored addon where node-gyp actually writes it by @nwparker in https://github.com/stablyai/orca/pull/20445\n* perf: accelerate cancellable remote transcript line scanning by @OrcaWin in https://github.com/stablyai/orca/pull/20351\n* fix(ci): match the truncated windows-process-tree virtual store dir by @nwparker in https://github.com/stablyai/orca/pull/20447\n* build(macos): parallelize native helpers with complete cancellation by @espetro in https://github.com/stablyai/orca/pull/19651\n* perf: skip WSL discovery when filtering native-only paths by @OrcaWin in https://github.com/stablyai/orca/pull/20266\n* perf(mobile): reuse Linear ordering for list and board grouping by @nwparker in https://github.com/stablyai/orca/pull/20314\n* Reduce native dependency installs to the host platform by @nwparker in https://github.com/stablyai/orca/pull/20420\n* perf(ai-vault): bound per-row bookkeeping in unlimited session scans by @nwparker in https://github.com/stablyai/orca/pull/20291\n* perf(tooling): reuse directory entry types in source scans by @OrcaWin in https://github.com/stablyai/orca/pull/20212\n* fix(skills): evict removed runtime discovery cache by @bbingz in https://github.com/stablyai/orca/pull/11489\n* fix(automations): isolate the scheduler tick and refuse oversized cron steps by @nwparker in https://github.com/stablyai/orca/pull/20152\n* fix(runtime): stop a name-only agent title from satisfying tui-idle by @nwparker in https://github.com/stablyai/orca/pull/20155\n* fix(agent-hooks): stop navigation Escape from inferring completion by @nwparker in https://github.com/stablyai/orca/pull/20149\n* fix(mobile): reuse current workspace on notification taps by @Jinwoo-H in https://github.com/stablyai/orca/pull/20310\n* fix(ai-vault): re-read a transcript rewritten to its previous size by @Jinwoo-H in https://github.com/stablyai/orca/pull/20261\n* fix(sidebar): show agent activity before workspace activation by @Jinwoo-H in https://github.com/stablyai/orca/pull/20398\n* test(rpc): add a compile-time params catalog parity gate by @Jinwoo-H in https://github.com/stablyai/orca/pull/20281\n* test(scripts): widen the Windows shim ratchet to catch package bin spawns by @Jinwoo-H in https://github.com/stablyai/orca/pull/20285\n* refactor(native-chat): give each structured dispatch state exactly one meaning by @brennanb2025 in https://github.com/stablyai/orca/pull/20133\n* feat(native-chat): decide a restart-stranded send against provider history by @brennanb2025 in https://github.com/stablyai/orca/pull/20139\n* fix(native-chat): wait for the runtime capability probe before resolving the creation launch route by @brennanb2025 in https://github.com/stablyai/orca/pull/19819\n* fix(worktrees): retire the chat tab of a chat with no child when its workspace goes by @brennanb2025 in https://github.com/stablyai/orca/pull/19970\n* feat(ai-vault-search): public session search contract and transports by @Jinwoo-H in https://github.com/stablyai/orca/pull/20277\n* refactor(mobile): migrate settings reads to RpcOperation by @Jinwoo-H in https://github.com/stablyai/orca/pull/20499\n* fix(mobile): give native chat one tail-follow owner so streaming stops jumping by @brennanb2025 in https://github.com/stablyai/orca/pull/20493\n* fix(mobile): preserve delivery ambiguity across transport cutover by @Jinwoo-H in https://github.com/stablyai/orca/pull/20280\n* fix(runtime): reject malformed file Base64 padding by @Jinwoo-H in https://github.com/stablyai/orca/pull/20283\n* fix(tasks): preserve repository results under GitHub search quota by @OrcaWin in https://github.com/stablyai/orca/pull/20460\n* fix(ai-vault): stream oversized remote session transcripts by @OrcaWin in https://github.com/stablyai/orca/pull/20455\n* fix(grok): stop replayed Claude/Cursor hooks reporting Grok panes as Claude by @brennanb2025 in https://github.com/stablyai/orca/pull/20507\n* fix(browser): press keys through a US-layout CDP key table instead of a subprocess per keystroke by @atreidesend in https://github.com/stablyai/orca/pull/15310\n* fix(rpc): validate provider-specific fields in TaskProviderIdentity by @Jinwoo-H in https://github.com/stablyai/orca/pull/20284\n* perf(terminal): batch file-link checks on their owning host by @OrcaWin in https://github.com/stablyai/orca/pull/20463\n* feat(native-chat): support file drag and drop by @brennanb2025 in https://github.com/stablyai/orca/pull/20494\n\n## New Contributors\n* @tb-soshiro made their first contribution in https://github.com/stablyai/orca/pull/18787\n* @NaoyaTatetsu made their first contribution in https://github.com/stablyai/orca/pull/17795\n* @ramarivera made their first contribution in https://github.com/stablyai/orca/pull/12772\n* @Aladex made their first contribution in https://github.com/stablyai/orca/pull/18634\n* @weekbin made their first contribution in https://github.com/stablyai/orca/pull/14929\n* @TimothyVang made their first contribution in https://github.com/stablyai/orca/pull/17936\n* @brohoya made their first contribution in https://github.com/stablyai/orca/pull/11756\n* @blade035 made their first contribution in https://github.com/stablyai/orca/pull/17731\n* @kiendle made their first contribution in https://github.com/stablyai/orca/pull/19170\n* @espetro made their first contribution in https://github.com/stablyai/orca/pull/19651\n* @atreidesend made their first contribution in https://github.com/stablyai/orca/pull/15310\n\n**Full Changelog**: https://github.com/stablyai/orca/compare/mobile-android-v0.0.48...mobile-android-v0.0.50\n", + "reactions": { + "url": "https://api.github.com/repos/stablyai/orca/releases/391254643/reactions", + "total_count": 18, + "+1": 0, + "-1": 0, + "laugh": 0, + "hooray": 0, + "confused": 0, + "heart": 14, + "rocket": 4, + "eyes": 0 + }, + "mentions_count": 21 +} diff --git a/mobile/src/app-update/fixtures/itunes-lookup-com.stably.orca.mobile.json b/mobile/src/app-update/fixtures/itunes-lookup-com.stably.orca.mobile.json new file mode 100644 index 000000000000..f4de826ef720 --- /dev/null +++ b/mobile/src/app-update/fixtures/itunes-lookup-com.stably.orca.mobile.json @@ -0,0 +1,189 @@ +{ + "resultCount": 1, + "results": [ + { + "isGameCenterEnabled": false, + "features": ["iosUniversal"], + "supportedDevices": [ + "iPhone5s-iPhone5s", + "iPadAir-iPadAir", + "iPadAirCellular-iPadAirCellular", + "iPadMiniRetina-iPadMiniRetina", + "iPadMiniRetinaCellular-iPadMiniRetinaCellular", + "iPhone6-iPhone6", + "iPhone6Plus-iPhone6Plus", + "iPadAir2-iPadAir2", + "iPadAir2Cellular-iPadAir2Cellular", + "iPadMini3-iPadMini3", + "iPadMini3Cellular-iPadMini3Cellular", + "iPodTouchSixthGen-iPodTouchSixthGen", + "iPhone6s-iPhone6s", + "iPhone6sPlus-iPhone6sPlus", + "iPadMini4-iPadMini4", + "iPadMini4Cellular-iPadMini4Cellular", + "iPadPro-iPadPro", + "iPadProCellular-iPadProCellular", + "iPadPro97-iPadPro97", + "iPadPro97Cellular-iPadPro97Cellular", + "iPhoneSE-iPhoneSE", + "iPhone7-iPhone7", + "iPhone7Plus-iPhone7Plus", + "iPad611-iPad611", + "iPad612-iPad612", + "iPad71-iPad71", + "iPad72-iPad72", + "iPad73-iPad73", + "iPad74-iPad74", + "iPhone8-iPhone8", + "iPhone8Plus-iPhone8Plus", + "iPhoneX-iPhoneX", + "iPad75-iPad75", + "iPad76-iPad76", + "iPhoneXS-iPhoneXS", + "iPhoneXSMax-iPhoneXSMax", + "iPhoneXR-iPhoneXR", + "iPad812-iPad812", + "iPad834-iPad834", + "iPad856-iPad856", + "iPad878-iPad878", + "iPadMini5-iPadMini5", + "iPadMini5Cellular-iPadMini5Cellular", + "iPadAir3-iPadAir3", + "iPadAir3Cellular-iPadAir3Cellular", + "iPodTouchSeventhGen-iPodTouchSeventhGen", + "iPhone11-iPhone11", + "iPhone11Pro-iPhone11Pro", + "iPadSeventhGen-iPadSeventhGen", + "iPadSeventhGenCellular-iPadSeventhGenCellular", + "iPhone11ProMax-iPhone11ProMax", + "iPhoneSESecondGen-iPhoneSESecondGen", + "iPadProSecondGen-iPadProSecondGen", + "iPadProSecondGenCellular-iPadProSecondGenCellular", + "iPadProFourthGen-iPadProFourthGen", + "iPadProFourthGenCellular-iPadProFourthGenCellular", + "iPhone12Mini-iPhone12Mini", + "iPhone12-iPhone12", + "iPhone12Pro-iPhone12Pro", + "iPhone12ProMax-iPhone12ProMax", + "iPadAir4-iPadAir4", + "iPadAir4Cellular-iPadAir4Cellular", + "iPadEighthGen-iPadEighthGen", + "iPadEighthGenCellular-iPadEighthGenCellular", + "iPadProThirdGen-iPadProThirdGen", + "iPadProThirdGenCellular-iPadProThirdGenCellular", + "iPadProFifthGen-iPadProFifthGen", + "iPadProFifthGenCellular-iPadProFifthGenCellular", + "iPhone13Pro-iPhone13Pro", + "iPhone13ProMax-iPhone13ProMax", + "iPhone13Mini-iPhone13Mini", + "iPhone13-iPhone13", + "iPadMiniSixthGen-iPadMiniSixthGen", + "iPadMiniSixthGenCellular-iPadMiniSixthGenCellular", + "iPadNinthGen-iPadNinthGen", + "iPadNinthGenCellular-iPadNinthGenCellular", + "iPhoneSEThirdGen-iPhoneSEThirdGen", + "iPadAirFifthGen-iPadAirFifthGen", + "iPadAirFifthGenCellular-iPadAirFifthGenCellular", + "iPhone14-iPhone14", + "iPhone14Plus-iPhone14Plus", + "iPhone14Pro-iPhone14Pro", + "iPhone14ProMax-iPhone14ProMax", + "iPadTenthGen-iPadTenthGen", + "iPadTenthGenCellular-iPadTenthGenCellular", + "iPadPro11FourthGen-iPadPro11FourthGen", + "iPadPro11FourthGenCellular-iPadPro11FourthGenCellular", + "iPadProSixthGen-iPadProSixthGen", + "iPadProSixthGenCellular-iPadProSixthGenCellular", + "iPhone15-iPhone15", + "iPhone15Plus-iPhone15Plus", + "iPhone15Pro-iPhone15Pro", + "iPhone15ProMax-iPhone15ProMax", + "iPadAir11M2-iPadAir11M2", + "iPadAir11M2Cellular-iPadAir11M2Cellular", + "iPadAir13M2-iPadAir13M2", + "iPadAir13M2Cellular-iPadAir13M2Cellular", + "iPadPro11M4-iPadPro11M4", + "iPadPro11M4Cellular-iPadPro11M4Cellular", + "iPadPro13M4-iPadPro13M4", + "iPadPro13M4Cellular-iPadPro13M4Cellular", + "iPhone16-iPhone16", + "iPhone16Plus-iPhone16Plus", + "iPhone16Pro-iPhone16Pro", + "iPhone16ProMax-iPhone16ProMax", + "iPadMiniA17Pro-iPadMiniA17Pro", + "iPadMiniA17ProCellular-iPadMiniA17ProCellular", + "iPhone16e-iPhone16e", + "iPadA16-iPadA16", + "iPadA16Cellular-iPadA16Cellular", + "iPadAir11M3-iPadAir11M3", + "iPadAir11M3Cellular-iPadAir11M3Cellular", + "iPadAir13M3-iPadAir13M3", + "iPadAir13M3Cellular-iPadAir13M3Cellular", + "iPhone17Pro-iPhone17Pro", + "iPhone17ProMax-iPhone17ProMax", + "iPhone17-iPhone17", + "iPhoneAir-iPhoneAir", + "iPadPro11M5-iPadPro11M5", + "iPadPro11M5Cellular-iPadPro11M5Cellular", + "iPadPro13M5-iPadPro13M5", + "iPadPro13M5Cellular-iPadPro13M5Cellular", + "iPhone17e-iPhone17e", + "iPadAir11M4-iPadAir11M4", + "iPadAir11M4Cellular-iPadAir11M4Cellular", + "iPadAir13M4-iPadAir13M4", + "iPadAir13M4Cellular-iPadAir13M4Cellular", + "iPhone18Pro-iPhone18Pro", + "iPhone18ProMax-iPhone18ProMax", + "iPhoneDuo-iPhoneDuo" + ], + "advisories": [], + "kind": "software", + "artistViewUrl": "https://apps.apple.com/us/developer/lovecast-llc/id1498017204?uo=4", + "artworkUrl60": "https://is1-ssl.mzstatic.com/image/thumb/Purple221/v4/89/b3/29/89b32922-c086-9d30-fd7c-ac48e1392aa6/AppIcon-0-0-1x_U007epad-0-1-85-220.png/60x60bb.jpg", + "artworkUrl100": "https://is1-ssl.mzstatic.com/image/thumb/Purple221/v4/89/b3/29/89b32922-c086-9d30-fd7c-ac48e1392aa6/AppIcon-0-0-1x_U007epad-0-1-85-220.png/100x100bb.jpg", + "appletvScreenshotUrls": [], + "artworkUrl512": "https://is1-ssl.mzstatic.com/image/thumb/Purple221/v4/89/b3/29/89b32922-c086-9d30-fd7c-ac48e1392aa6/AppIcon-0-0-1x_U007epad-0-1-85-220.png/512x512bb.jpg", + "screenshotUrls": [ + "https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/7d/c0/9e/7dc09e7d-e1df-c528-41c6-2eff0bac4b9b/01-terminal.png/320x480bb.jpg", + "https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/93/6f/1f/936f1fe8-a0fc-cfaa-2ecb-89d7c71f02f3/03-homepage.png/320x480bb.jpg", + "https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/d6/e2/9f/d6e29f00-bdd8-c29c-f533-97a4a217be03/02-workspace.png/320x480bb.jpg", + "https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/3e/82/15/3e8215b7-80db-f4b3-3942-bc634899c394/04-create-wt.png/320x480bb.jpg" + ], + "ipadScreenshotUrls": [ + "https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/e5/01/a2/e501a2f6-8e2c-11a2-ad6a-c9b42f49e905/apple-ipadpro13-spacegrey-portrait-promo-opaque.png/360x480bb.jpg" + ], + "releaseNotes": "Clearer chat while agents work\n• A proposed plan now appears as a plan you can read, not a generic approval prompt.\n• Approval requests show what the agent actually asked for instead of raw tool data.\n• The working timer counts from the message that started the turn.\n\nSteadier workspace setup\n• Creating a workspace no longer risks starting two if the reply is lost on the way back.\n• A worktree that launches an agent on creation opens straight into its chat.\n• A newly created tab stays put when the host list refreshes.\n\nFixes\n• Pairing no longer reports a declined permission as a missing feature.\n• The notification opt-in screen is clearer about what you are turning on.\n• Sign-in now accepts enterprise-managed GitHub accounts.", + "bundleId": "com.stably.orca.mobile", + "genres": ["Developer Tools"], + "price": 0.0, + "artistId": 1498017204, + "artistName": "Lovecast LLC", + "primaryGenreName": "Developer Tools", + "primaryGenreId": 6026, + "releaseDate": "2026-05-07T07:00:00Z", + "isVppDeviceBasedLicensingEnabled": true, + "trackName": "Orca IDE", + "trackId": 6766130217, + "sellerName": "Lovecast LLC", + "genreIds": ["6026"], + "currentVersionReleaseDate": "2026-09-19T07:09:57Z", + "version": "0.0.51", + "wrapperType": "software", + "currency": "USD", + "description": "Orca Mobile is the companion app for Orca, the open-source agentic coding workspace for macOS, Linux, and Windows. Pair your iPhone to your desktop in seconds and pick up a terminal session from the couch, the kitchen, or across the office.\n\nWHAT IT DOES\n\n• Live mirror of your desktop terminal, including running AI agent sessions (Claude Code, Codex, custom CLIs).\n• Full keyboard input — type, tab-complete, Ctrl-C, scroll back, all from the phone.\n• Multi-worktree, multi-terminal: jump between projects with a tap.\n• Phone-fit zoom and a smart on-screen keyboard with quick Ctrl/Alt accessory keys and shortcuts.\n• Background long-running commands and get a notification when a TUI goes idle (e.g. when Claude finishes thinking).\n\nHOW IT WORKS\n\nOrca Mobile is a thin client. Nothing runs on your phone except the viewer. Your code, your shells, your AI agents — all of that stays on your desktop. The phone shows you what's happening and forwards your keystrokes back over an encrypted local-network connection.\n\nPairing is end-to-end encrypted. Your desktop generates a one-time keypair and shows a QR code; you scan it from the app. After that, all traffic between phone and desktop is sealed with that pair's keys.\n\nPRIVACY\n\n• No analytics SDK, no crash reporter, no third-party SDKs of any kind in the iOS app.\n• Pairing tokens and your preference list live in the app's own sandbox. The app's traffic to your desktop is end-to-end encrypted on your local network only.\n• The Orca desktop app collects anonymized usage metrics per the policy at https://www.onorca.dev/privacy. The mobile app itself does not.\n• Open source: every line is auditable at https://github.com/stablyai/orca.\n\nREQUIREMENTS\n\n• An iPhone (iOS 16+) on the same Wi-Fi as your desktop.\n• The Orca desktop app, free, from https://www.onorca.dev/ or https://github.com/stablyai/orca/releases.", + "trackCensoredName": "Orca IDE", + "trackViewUrl": "https://apps.apple.com/us/app/orca-ide/id6766130217?uo=4", + "contentAdvisoryRating": "4+", + "averageUserRating": 4.58621000000000034191316444776020944118499755859375, + "averageUserRatingForCurrentVersion": 4.58621000000000034191316444776020944118499755859375, + "languageCodesISO2A": ["EN"], + "fileSizeBytes": "41495552", + "formattedPrice": "Free", + "userRatingCountForCurrentVersion": 29, + "trackContentRating": "4+", + "sellerUrl": "https://www.onorca.dev/", + "minimumOsVersion": "15.1", + "userRatingCount": 29 + } + ] +} diff --git a/mobile/src/app-update/github-release-update-source.ts b/mobile/src/app-update/github-release-update-source.ts new file mode 100644 index 000000000000..c32c34751213 --- /dev/null +++ b/mobile/src/app-update/github-release-update-source.ts @@ -0,0 +1,77 @@ +import { z } from 'zod' +import { compareAppVersions } from '../../../src/shared/app-version' +import type { AppUpdateCheckResult, AppUpdateSource } from './app-update-source' +import { isNewerReleaseVersion } from './app-update-source' + +const REPO_API = 'https://api.github.com/repos/stablyai/orca' +// Why tag refs, not releases.atom or /releases?per_page=100: both are newest-first windows that a +// run of desktop releases fills, pushing the newest mobile release out and reading as "current". +// The release `prerelease` flag is not a filter: every mobile-android-v* release is published as one. +const TAG_PREFIX = 'mobile-android-v' +// Why: the release workflow pushes the tag before the APK build, so a failed build leaves a +// tag with no release; probe a few older candidates, bounded like the desktop's manifest probe. +const MAX_RELEASE_PROBES = 3 + +type Fetch = typeof fetch + +const tagRefsSchema = z.array(z.looseObject({ ref: z.string() })) +const installableReleaseSchema = z.looseObject({ + draft: z.literal(false), + html_url: z.string(), + assets: z.array(z.looseObject({ name: z.string() })) +}) + +/** Versions named by the tag refs GitHub returns for the mobile-android prefix. */ +export function parseMobileAndroidTagVersions(refs: unknown): string[] { + const prefix = `refs/tags/${TAG_PREFIX}` + return tagRefsSchema + .parse(refs) + .filter(({ ref }) => ref.startsWith(prefix)) + .map(({ ref }) => ref.slice(prefix.length)) +} + +/** The release page when the tag has a published release carrying an APK, else null. */ +export function installableReleaseUrl(release: unknown): string | null { + const parsed = installableReleaseSchema.safeParse(release) + return parsed.success && parsed.data.assets.some((asset) => asset.name.endsWith('.apk')) + ? parsed.data.html_url + : null +} + +export function createGithubReleaseUpdateSource(fetchImpl: Fetch): AppUpdateSource { + return { + async check(installedVersion, signal): Promise { + const refsReply = await fetchImpl(`${REPO_API}/git/matching-refs/tags/${TAG_PREFIX}`, { + signal + }) + if (!refsReply.ok) { + throw new Error(`tag refs HTTP ${refsReply.status}`) + } + const candidates = parseMobileAndroidTagVersions(await refsReply.json()) + .filter((version) => isNewerReleaseVersion(version, installedVersion)) + .sort((left, right) => compareAppVersions(right, left)) + .slice(0, MAX_RELEASE_PROBES) + for (const version of candidates) { + const releaseReply = await fetchImpl( + `${REPO_API}/releases/tags/${encodeURIComponent(`${TAG_PREFIX}${version}`)}`, + { signal } + ) + if (releaseReply.status === 404) { + continue + } + if (!releaseReply.ok) { + throw new Error(`release HTTP ${releaseReply.status}`) + } + const url = installableReleaseUrl(await releaseReply.json()) + if (url) { + return { kind: 'available', version, url } + } + } + return { kind: 'current' } + } + } +} + +export const githubReleaseUpdateSource = createGithubReleaseUpdateSource((input, init) => + fetch(input, init) +) diff --git a/mobile/src/home/AppUpdateCard.test.tsx b/mobile/src/home/AppUpdateCard.test.tsx new file mode 100644 index 000000000000..7a98a91f91fa --- /dev/null +++ b/mobile/src/home/AppUpdateCard.test.tsx @@ -0,0 +1,50 @@ +import { createElement } from 'react' +import { act, create, type ReactTestRenderer } from 'react-test-renderer' +import { afterEach, describe, expect, it, vi } from 'vitest' +import { AppUpdateCard } from './AppUpdateCard' + +vi.mock('react-native', () => ({ + Pressable: 'Pressable', + StyleSheet: { create: (styles: T) => styles }, + Text: 'Text', + View: 'View' +})) +vi.mock('lucide-react-native', () => ({ ArrowUpFromLine: 'ArrowUpFromLine', X: 'X' })) + +describe('AppUpdateCard', () => { + let renderer: ReactTestRenderer | null = null + afterEach(() => { + act(() => renderer?.unmount()) + renderer = null + }) + + function render() { + const onPress = vi.fn() + const onDismiss = vi.fn() + act(() => { + renderer = create(createElement(AppUpdateCard, { version: '0.0.51', onPress, onDismiss })) + }) + const root = renderer!.root + const texts = root + .findAll((node) => String(node.type) === 'Text') + .flatMap((node) => node.children.filter((child) => typeof child === 'string')) + return { root, texts, onPress, onDismiss } + } + + it('says which version is available and how to get it, with a monochrome glyph', () => { + const { root, texts } = render() + expect(texts).toEqual(['Orca 0.0.51 is available', 'Tap to update']) + expect(root.find((node) => String(node.type) === 'ArrowUpFromLine').props.color).toBe('#e0e0e0') + }) + + it('opens the update from the card body and dismisses from the X', () => { + const { root, onPress, onDismiss } = render() + const [body, dismiss] = root.findAll((node) => String(node.type) === 'Pressable') + expect(dismiss.props.accessibilityLabel).toBe('Dismiss Orca 0.0.51 update') + act(() => body.props.onPress()) + expect(onPress).toHaveBeenCalledTimes(1) + expect(onDismiss).not.toHaveBeenCalled() + act(() => dismiss.props.onPress()) + expect(onDismiss).toHaveBeenCalledTimes(1) + }) +}) diff --git a/mobile/src/home/AppUpdateCard.tsx b/mobile/src/home/AppUpdateCard.tsx new file mode 100644 index 000000000000..6713bcbfd123 --- /dev/null +++ b/mobile/src/home/AppUpdateCard.tsx @@ -0,0 +1,86 @@ +import { ArrowUpFromLine, X } from 'lucide-react-native' +import { Pressable, StyleSheet, Text, View } from 'react-native' +import { colors, radii, spacing } from '../theme/mobile-theme' + +/** Home's update notice, drawn in the host card's frame so it reads as part of that list. */ +export function AppUpdateCard(props: { + version: string + onPress: () => void + onDismiss: () => void +}) { + const title = `Orca ${props.version} is available` + return ( + + [styles.cardMain, pressed && styles.cardPressed]} + onPress={props.onPress} + > + + + + + + {title} + + + Tap to update + + + + [styles.dismissButton, pressed && styles.dismissPressed]} + onPress={props.onDismiss} + > + + + + ) +} + +// Same frame, icon well and spacing as MobileHostCard. +const styles = StyleSheet.create({ + card: { + flexDirection: 'row', + alignItems: 'center', + borderRadius: radii.card, + backgroundColor: colors.bgPanel, + borderWidth: 1, + borderColor: colors.borderSubtle, + overflow: 'hidden' + }, + cardMain: { + flex: 1, + minWidth: 0, + flexDirection: 'row', + alignItems: 'center', + paddingLeft: spacing.md, + paddingVertical: 12 + }, + cardPressed: { backgroundColor: colors.bgRaised }, + icon: { + width: 46, + height: 46, + borderRadius: 13, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: colors.bgRaised, + marginRight: 14 + }, + main: { flex: 1, minWidth: 0, marginRight: spacing.sm }, + title: { color: colors.textPrimary, fontSize: 15, fontWeight: '600', lineHeight: 20 }, + subtitle: { color: colors.textSecondary, fontSize: 12, lineHeight: 16 }, + dismissButton: { + width: 40, + height: 40, + marginHorizontal: spacing.xs, + borderRadius: radii.row, + alignItems: 'center', + justifyContent: 'center' + }, + dismissPressed: { backgroundColor: colors.bgRaised } +}) diff --git a/mobile/src/home/MobileHomeAppUpdateCard.tsx b/mobile/src/home/MobileHomeAppUpdateCard.tsx new file mode 100644 index 000000000000..51bc41d86027 --- /dev/null +++ b/mobile/src/home/MobileHomeAppUpdateCard.tsx @@ -0,0 +1,27 @@ +import { StyleSheet, View } from 'react-native' +import { undismissedAppUpdate } from '../app-update/app-update-checker' +import { + appUpdateChecker, + openAppUpdate, + useAppUpdateState +} from '../app-update/app-update-runtime' +import { AppUpdateCard } from './AppUpdateCard' +import { spacing } from '../theme/mobile-theme' + +export function MobileHomeAppUpdateCard() { + const available = undismissedAppUpdate(useAppUpdateState()) + if (!available) { + return null + } + return ( + + openAppUpdate(available.url)} + onDismiss={() => appUpdateChecker.dismiss(available.version)} + /> + + ) +} + +const styles = StyleSheet.create({ slot: { marginBottom: spacing.lg } }) diff --git a/mobile/src/home/MobileHomeListHeader.tsx b/mobile/src/home/MobileHomeListHeader.tsx index 7e47c9ae9d62..f7da47c9733f 100644 --- a/mobile/src/home/MobileHomeListHeader.tsx +++ b/mobile/src/home/MobileHomeListHeader.tsx @@ -1,6 +1,7 @@ import { StyleSheet, Text, View } from 'react-native' import type { HomeStatsSummary } from '../stats/home-stats-total' import { colors, spacing } from '../theme/mobile-theme' +import { MobileHomeAppUpdateCard } from './MobileHomeAppUpdateCard' function formatDuration(ms: number): string { const totalMinutes = Math.floor(ms / 60_000) @@ -36,6 +37,7 @@ export function MobileHomeListHeader({ stats }: { stats: HomeStatsSummary | null ) : null} + Desktops ) diff --git a/mobile/src/settings/app-update-settings-rows.test.tsx b/mobile/src/settings/app-update-settings-rows.test.tsx new file mode 100644 index 000000000000..77177bf7d638 --- /dev/null +++ b/mobile/src/settings/app-update-settings-rows.test.tsx @@ -0,0 +1,90 @@ +import { createElement } from 'react' +import { act, create, type ReactTestRenderer } from 'react-test-renderer' +import { afterEach, describe, expect, it, vi } from 'vitest' +import { AppUpdateSettingsRows, type AppUpdateCheckRowStatus } from './app-update-settings-rows' + +vi.mock('react-native', () => ({ + Pressable: 'Pressable', + StyleSheet: { create: (styles: T) => styles, hairlineWidth: 1 }, + Text: 'Text', + View: 'View' +})) + +const NOW = Date.UTC(2026, 8, 28, 12) +const HOUR = 60 * 60 * 1000 + +describe('AppUpdateSettingsRows', () => { + let renderer: ReactTestRenderer | null = null + afterEach(() => { + act(() => renderer?.unmount()) + renderer = null + }) + + function render(opts: { + available?: { version: string; url: string } | null + lastCheckedAt?: number | null + checkStatus?: AppUpdateCheckRowStatus + }) { + const onUpdate = vi.fn() + const onCheck = vi.fn() + act(() => { + renderer = create( + createElement(AppUpdateSettingsRows, { + installedVersion: '0.0.48', + available: opts.available ?? null, + lastCheckedAt: opts.lastCheckedAt ?? null, + now: NOW, + checkStatus: opts.checkStatus ?? 'idle', + onUpdate, + onCheck + }) + ) + }) + const root = renderer!.root + const texts = root + .findAll((node) => String(node.type) === 'Text') + .map((node) => node.children.filter((child) => typeof child === 'string').join('')) + return { + root, + texts, + onUpdate, + onCheck, + pressables: root.findAll((node) => String(node.type) === 'Pressable') + } + } + + it('offers the known update as a tappable row with an Update action', () => { + const { texts, pressables, onUpdate } = render({ + available: { version: '0.0.51', url: 'https://example.test' }, + lastCheckedAt: NOW - 2 * HOUR + }) + expect(texts).toEqual([ + 'Update to Orca 0.0.51', + 'Update', + 'Check for updates', + 'Last checked 2h ago' + ]) + act(() => pressables[0].props.onPress()) + expect(onUpdate).toHaveBeenCalledTimes(1) + }) + + it('shows a plain, untappable version row when current, and Never before a first success', () => { + const { texts, pressables } = render({}) + expect(texts).toEqual(['Version 0.0.48', 'Check for updates', 'Never']) + expect(pressables).toHaveLength(1) + expect(pressables[0].props.accessibilityLabel).toBe('Check for updates, Never') + }) + + it('runs the check from its row and shows the transient outcome in place', () => { + const idle = render({ lastCheckedAt: NOW - 30_000 }) + expect(idle.texts.at(-1)).toBe('Last checked just now') + act(() => idle.pressables[0].props.onPress()) + expect(idle.onCheck).toHaveBeenCalledTimes(1) + act(() => renderer?.unmount()) + expect(render({ checkStatus: 'checking' }).pressables[0].props.disabled).toBe(true) + act(() => renderer?.unmount()) + expect(render({ checkStatus: 'up-to-date' }).texts.at(-1)).toBe('Up to date') + act(() => renderer?.unmount()) + expect(render({ checkStatus: 'failed' }).texts.at(-1)).toBe("Couldn't check") + }) +}) diff --git a/mobile/src/settings/app-update-settings-rows.tsx b/mobile/src/settings/app-update-settings-rows.tsx new file mode 100644 index 000000000000..b605a89105b2 --- /dev/null +++ b/mobile/src/settings/app-update-settings-rows.tsx @@ -0,0 +1,100 @@ +import { Pressable, StyleSheet, Text, View } from 'react-native' +import type { KnownAppUpdate } from '../storage/app-update-preferences' +import { colors, spacing, typography } from '../theme/mobile-theme' +import { formatTimeAgo } from '../worktree/agent-row-display' + +export type AppUpdateCheckRowStatus = 'idle' | 'checking' | 'up-to-date' | 'failed' + +function checkRowValue(status: AppUpdateCheckRowStatus, lastCheckedAt: number | null, now: number) { + if (status === 'checking') { + return 'Checking…' + } + if (status === 'up-to-date') { + return 'Up to date' + } + if (status === 'failed') { + return "Couldn't check" + } + if (lastCheckedAt === null) { + return 'Never' + } + const ago = formatTimeAgo(lastCheckedAt, now) + return `Last checked ${ago === 'just now' ? ago : `${ago} ago`}` +} + +/** Settings' version row and manual check; the update row stays after the home card is dismissed. */ +export function AppUpdateSettingsRows(props: { + installedVersion: string | null + available: KnownAppUpdate | null + lastCheckedAt: number | null + now: number + checkStatus: AppUpdateCheckRowStatus + onUpdate: (url: string) => void + onCheck: () => void +}) { + const checkValue = checkRowValue(props.checkStatus, props.lastCheckedAt, props.now) + const { available, installedVersion, onUpdate } = props + const versionRow = available ? ( + [styles.row, pressed && styles.rowPressed]} + onPress={() => onUpdate(available.url)} + > + Update to Orca {available.version} + Update + + ) : installedVersion ? ( + + Version {installedVersion} + + ) : null + return ( + + {versionRow} + {versionRow && } + [styles.row, pressed && styles.rowPressed]} + onPress={props.onCheck} + > + Check for updates + {checkValue} + + + ) +} + +// Same panel, rows and separator as MobileSettingsSection. +const styles = StyleSheet.create({ + section: { + backgroundColor: colors.bgPanel, + borderRadius: 12, + overflow: 'hidden', + marginTop: spacing.md + }, + row: { + flexDirection: 'row', + alignItems: 'center', + gap: spacing.sm + 2, + paddingVertical: spacing.md, + paddingHorizontal: spacing.md + 2 + }, + rowPressed: { backgroundColor: colors.bgRaised }, + rowLabel: { + flex: 1, + fontSize: typography.bodySize, + fontWeight: '500', + color: colors.textPrimary + }, + rowValue: { fontSize: typography.metaSize, color: colors.textSecondary }, + actionValue: { fontSize: typography.bodySize, fontWeight: '600', color: colors.textPrimary }, + separator: { + height: StyleSheet.hairlineWidth, + backgroundColor: colors.borderSubtle, + marginHorizontal: spacing.md + } +}) diff --git a/mobile/src/settings/settings-app-update-section.tsx b/mobile/src/settings/settings-app-update-section.tsx new file mode 100644 index 000000000000..4edc93d95a90 --- /dev/null +++ b/mobile/src/settings/settings-app-update-section.tsx @@ -0,0 +1,52 @@ +import { useEffect, useState } from 'react' +import { + appUpdateChecker, + installedAppVersion, + openAppUpdate, + useAppUpdateState +} from '../app-update/app-update-runtime' +import { AppUpdateSettingsRows, type AppUpdateCheckRowStatus } from './app-update-settings-rows' + +const CHECK_RESULT_VISIBLE_MS = 3000 +const RELATIVE_TIME_TICK_MS = 60_000 + +export function SettingsAppUpdateSection() { + const state = useAppUpdateState() + const [result, setResult] = useState<'up-to-date' | 'failed' | null>(null) + // A check newer than this reads as "just now", so the tick only has to age the label. + const [now, setNow] = useState(() => Date.now()) + + useEffect(() => { + const tick = setInterval(() => setNow(Date.now()), RELATIVE_TIME_TICK_MS) + return () => clearInterval(tick) + }, []) + + useEffect(() => { + if (result === null) { + return + } + const hide = setTimeout(() => setResult(null), CHECK_RESULT_VISIBLE_MS) + return () => clearTimeout(hide) + }, [result]) + + const runCheck = () => { + setResult(null) + void appUpdateChecker.checkNow().then((outcome) => { + // An available update shows in the row above, so only the other outcomes need words here. + setResult(outcome === 'available' ? null : outcome) + }) + } + + const checkStatus: AppUpdateCheckRowStatus = state.checking ? 'checking' : (result ?? 'idle') + return ( + + ) +} diff --git a/mobile/src/storage/app-update-preferences.test.ts b/mobile/src/storage/app-update-preferences.test.ts new file mode 100644 index 000000000000..dbd7ba4215d7 --- /dev/null +++ b/mobile/src/storage/app-update-preferences.test.ts @@ -0,0 +1,32 @@ +import { describe, expect, it, vi } from 'vitest' +import { loadAppUpdatePreferences } from './app-update-preferences' + +const stored = new Map() +vi.mock('@react-native-async-storage/async-storage', () => ({ + default: { + multiGet: async (keys: string[]) => keys.map((key) => [key, stored.get(key) ?? null]) + } +})) + +describe('loadAppUpdatePreferences', () => { + it('drops only a corrupt update record, keeping the check time and dismissal beside it', async () => { + stored.set('orca:appUpdate:lastCheckedAt', '1700000000000') + stored.set('orca:appUpdate:latest', '{not json') + stored.set('orca:appUpdate:dismissedVersion', '0.0.51') + await expect(loadAppUpdatePreferences()).resolves.toEqual({ + lastCheckedAt: 1700000000000, + latest: null, + dismissedVersion: '0.0.51' + }) + }) + + it('reads a well-formed update record', async () => { + stored.set( + 'orca:appUpdate:latest', + JSON.stringify({ version: '0.0.52', url: 'https://x.test' }) + ) + await expect(loadAppUpdatePreferences()).resolves.toMatchObject({ + latest: { version: '0.0.52', url: 'https://x.test' } + }) + }) +}) diff --git a/mobile/src/storage/app-update-preferences.ts b/mobile/src/storage/app-update-preferences.ts new file mode 100644 index 000000000000..51e199a68b1e --- /dev/null +++ b/mobile/src/storage/app-update-preferences.ts @@ -0,0 +1,64 @@ +import AsyncStorage from '@react-native-async-storage/async-storage' +import { z } from 'zod' + +const LAST_CHECKED_AT_KEY = 'orca:appUpdate:lastCheckedAt' +const LATEST_KEY = 'orca:appUpdate:latest' +const DISMISSED_VERSION_KEY = 'orca:appUpdate:dismissedVersion' + +export type KnownAppUpdate = { readonly version: string; readonly url: string } + +export type AppUpdatePreferences = { + /** Last successful check; failures never move it. */ + readonly lastCheckedAt: number | null + /** Newest installable release that check saw, or null when it saw none. */ + readonly latest: KnownAppUpdate | null + readonly dismissedVersion: string | null +} + +export const EMPTY_APP_UPDATE_PREFERENCES: AppUpdatePreferences = { + lastCheckedAt: null, + latest: null, + dismissedVersion: null +} + +const knownAppUpdateSchema = z.object({ version: z.string(), url: z.string() }) + +// A corrupt record loses only itself, never the check time or the dismissal stored beside it. +function parseLatest(raw: string | null): KnownAppUpdate | null { + try { + const parsed = raw ? knownAppUpdateSchema.safeParse(JSON.parse(raw)) : null + return parsed?.success ? parsed.data : null + } catch { + return null + } +} + +export async function loadAppUpdatePreferences(): Promise { + try { + const [[, checkedAt], [, latest], [, dismissed]] = await AsyncStorage.multiGet([ + LAST_CHECKED_AT_KEY, + LATEST_KEY, + DISMISSED_VERSION_KEY + ]) + const lastCheckedAt = checkedAt === null ? null : Number(checkedAt) + return { + lastCheckedAt: + lastCheckedAt !== null && Number.isFinite(lastCheckedAt) ? lastCheckedAt : null, + latest: parseLatest(latest), + dismissedVersion: dismissed + } + } catch { + return EMPTY_APP_UPDATE_PREFERENCES + } +} + +export async function saveAppUpdateCheck(checkedAt: number, latest: KnownAppUpdate | null) { + await AsyncStorage.multiSet([ + [LAST_CHECKED_AT_KEY, String(checkedAt)], + [LATEST_KEY, latest ? JSON.stringify(latest) : ''] + ]) +} + +export async function saveDismissedAppUpdateVersion(version: string): Promise { + await AsyncStorage.setItem(DISMISSED_VERSION_KEY, version) +} From 85ad2929309ec01d24d3cd3fe7a357deeb8e83e3 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:23:28 -0700 Subject: [PATCH 53/90] fix(status-bar): re-measure collapsing levels when only the collapsed width moves (#23773) --- .../status-bar/status-bar-density.test.ts | 15 +++++++++------ .../components/status-bar/status-bar-density.ts | 12 ++++++++++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/components/status-bar/status-bar-density.test.ts b/src/renderer/src/components/status-bar/status-bar-density.test.ts index 27b905e962d2..668f5c90a9e9 100644 --- a/src/renderer/src/components/status-bar/status-bar-density.test.ts +++ b/src/renderer/src/components/status-bar/status-bar-density.test.ts @@ -59,12 +59,15 @@ describe('recordStatusBarDensityWidth', () => { ]) }) - it('keeps other levels when only the collapsed width moves', () => { - // Collapsing different chips changes the fit width, never the natural one. - expect(recordStatusBarDensityWidth([w(700), w(600, 450)], 1, w(600, 430))).toEqual([ - w(700), - w(600, 430) - ]) + it('drops only the other collapsing levels when only the collapsed width moves', () => { + // Urgency changes which chips collapse, moving fit widths but never the natural one. + expect( + recordStatusBarDensityWidth( + [w(700), w(600), w(500), w(600, 450), w(500, 400)], + 3, + w(600, 430) + ) + ).toEqual([w(700), w(600), w(500), w(600, 430), undefined]) }) it('keeps other levels on a sub-pixel re-measure', () => { diff --git a/src/renderer/src/components/status-bar/status-bar-density.ts b/src/renderer/src/components/status-bar/status-bar-density.ts index 17748c19d45b..6801d9103589 100644 --- a/src/renderer/src/components/status-bar/status-bar-density.ts +++ b/src/renderer/src/components/status-bar/status-bar-density.ts @@ -56,9 +56,17 @@ export function recordStatusBarDensityWidth( width: StatusBarLevelWidth ): (StatusBarLevelWidth | undefined)[] { const previous = levelWidths[level] - const next = + const naturalChanged = previous !== undefined && Math.abs(previous.natural - width.natural) > WIDTH_TOLERANCE_PX - ? [] + // Why: urgency can change which chips pin without moving the natural width. + const fitChanged = + previous !== undefined && Math.abs(previous.fit - width.fit) > WIDTH_TOLERANCE_PX + const next = naturalChanged + ? [] + : fitChanged + ? levelWidths.map((entry, index) => + STATUS_BAR_DENSITY_LEVELS[index]?.collapseUsage ? undefined : entry + ) : [...levelWidths] next[level] = width return next From a5ce8251e3bf515636d3e949459e84594b9b88ac Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:33:59 -0700 Subject: [PATCH 54/90] Agent launches carry the surface that started them (#23697) * feat(agent-launch): every launch carries the surface that started it The host now attributes every agent it builds to the surface that asked for it, resolving a missing or unrecognized surface to 'unknown' in one place instead of silently skipping it. The CLI names itself on worktree.create and orchestration workers name themselves host-side. * fix(agent-launch): attribute the agent a startup-draft create launches The host builds a third kind of agent launch: a worktree.create with a startupDraft and no startupAgent, where the host picks the agent itself. It carried no launch record at all and ignored the caller's launchSource. Route it through the same resolver as the other two builders, and derive the startupAgent terminal record only from the resolver so no prebuilt record can stand in for it. * fix(agent-launch): attribute the agent a host-built agent session launches terminal.createAgentSession builds a fresh agent's launch on the host, like the other startup builders, but spawned it with no launch record, so those launches were never counted. Record them through the same resolver; the request names no surface, so they count as unknown. * test(agent-launch): require an attribution decision for every host-built agent startup --- src/cli/handlers/worktree.ts | 3 +- src/cli/index-worktree-create-agent.test.ts | 6 +- .../host-agent-startup-call-sites.txt | 10 ++ .../agent-launch/agent-started-telemetry.ts | 30 ++++++ .../host-agent-startup-attribution.test.ts | 99 +++++++++++++++++++ .../orca-runtime-activate-managed-worktree.ts | 4 +- .../orca-runtime-create-agent-session.ts | 3 + .../orca-runtime-create-managed-worktree.ts | 7 +- ...runtime-resolve-worktree-removal-target.ts | 5 +- ...nal-creation-and-readiness-part-12.spec.ts | 70 +++++++++++++ ...worktree-setup-and-startup-part-04.spec.ts | 5 +- .../rpc/methods/agent-launch-surfaces.ts | 34 +------ .../runtime/rpc/methods/agent-launch.test.ts | 36 +++++-- .../orchestration/federation/federation.ts | 2 + .../worker/composed-workers.test.ts | 1 + .../orchestration/worker/worker-topology.ts | 1 + .../worker/worker-worktree-creation.ts | 1 + .../worker/workers-new-worktree.test.ts | 1 + .../rpc/methods/worktree-create-args.ts | 1 + .../worktree-create-launch-source.test.ts | 41 ++++++++ .../runtime-managed-worktree-create-types.ts | 1 + .../runtime/runtime-terminal-contracts.ts | 3 + .../runtime-worktree-agent-startup.test.ts | 45 +++++++++ .../runtime/runtime-worktree-agent-startup.ts | 40 ++++---- src/shared/agent-launch-intent.ts | 4 +- .../rpc-contract/agent-launch-params.ts | 12 +-- .../rpc-contract/launch-source-param.ts | 12 +++ .../rpc-contract/worktree-create-params.ts | 3 + src/shared/telemetry-property-schemas.ts | 4 + 29 files changed, 401 insertions(+), 83 deletions(-) create mode 100644 src/main/agent-launch/__fixtures__/host-agent-startup-call-sites.txt create mode 100644 src/main/agent-launch/agent-started-telemetry.ts create mode 100644 src/main/agent-launch/host-agent-startup-attribution.test.ts create mode 100644 src/main/runtime/rpc/methods/worktree-create-launch-source.test.ts create mode 100644 src/shared/rpc-contract/launch-source-param.ts diff --git a/src/cli/handlers/worktree.ts b/src/cli/handlers/worktree.ts index 62ddd27155a0..3541beef20b5 100644 --- a/src/cli/handlers/worktree.ts +++ b/src/cli/handlers/worktree.ts @@ -245,7 +245,8 @@ export const WORKTREE_HANDLERS: Record = { ...(startupAgent ? { startupAgent, - startupPrompt: getPresentStringFlag(flags, 'prompt', { allowEmpty: true }) ?? '' + startupPrompt: getPresentStringFlag(flags, 'prompt', { allowEmpty: true }) ?? '', + launchSource: 'cli' } : {}) }) diff --git a/src/cli/index-worktree-create-agent.test.ts b/src/cli/index-worktree-create-agent.test.ts index f1d79ef21df2..6ae1266b91c6 100644 --- a/src/cli/index-worktree-create-agent.test.ts +++ b/src/cli/index-worktree-create-agent.test.ts @@ -138,7 +138,8 @@ describe('orca cli worktree awareness', () => { callerTerminalHandle: undefined, cliProvenanceRequest: {}, startupAgent: 'codex', - startupPrompt: 'hi' + startupPrompt: 'hi', + launchSource: 'cli' }) }) @@ -187,7 +188,8 @@ describe('orca cli worktree awareness', () => { callerTerminalHandle: undefined, cliProvenanceRequest: {}, startupAgent: 'codex', - startupPrompt: 'hi' + startupPrompt: 'hi', + launchSource: 'cli' }) }) diff --git a/src/main/agent-launch/__fixtures__/host-agent-startup-call-sites.txt b/src/main/agent-launch/__fixtures__/host-agent-startup-call-sites.txt new file mode 100644 index 000000000000..de078fd731e9 --- /dev/null +++ b/src/main/agent-launch/__fixtures__/host-agent-startup-call-sites.txt @@ -0,0 +1,10 @@ +# Host-side calls to the agent startup-plan builders, per file: . +# attributes a fresh agent the host builds; carries agentStartedTelemetry +# resume continues an existing agent session; not a new start +# mobile-followup the phone's session-tab launch; attribution is a separate follow-up +# The resolve-worktree-removal-target call also serves a bare typed command, which stays unattributed. +src/main/runtime/orca-runtime-create-agent-session.ts 2 attributes +src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts 1 attributes +src/main/runtime/runtime-worktree-agent-startup.ts 3 attributes +src/main/runtime/orca-runtime-get-agent-session-execution-namespace.ts 1 resume +src/main/runtime/orca-runtime-resolve-mobile-session-terminal-command.ts 1 mobile-followup diff --git a/src/main/agent-launch/agent-started-telemetry.ts b/src/main/agent-launch/agent-started-telemetry.ts new file mode 100644 index 000000000000..2d1ff76179dc --- /dev/null +++ b/src/main/agent-launch/agent-started-telemetry.ts @@ -0,0 +1,30 @@ +/** + * The `agent_started` triple for an agent launch the host builds, of which only `launch_source` + * comes from the caller. + * + * `agent_kind` and `request_kind` are derived rather than accepted — the host already knows both, + * and a value it derives is a value a caller cannot misreport. `request_kind` is always `new` + * because a host-built launch is always a fresh agent. + * + * Every launch is attributed: a caller that names no surface, or one this build has never heard of + * (a newer client), is recorded as `unknown` rather than dropped. The wire keeps the arm set open so + * an older host cannot refuse a newer client's launch over a label, and resolving it here, leniently, + * keeps that label from gating the launch at the point it is actually used. + */ + +import { tuiAgentToAgentKind } from '../../shared/agent-kind' +import { launchSourceSchema } from '../../shared/telemetry-property-schemas' +import type { TuiAgent } from '../../shared/tui-agent' +import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' + +export function agentStartedTelemetry( + agent: TuiAgent, + launchSource: string | undefined +): NonNullable { + const parsed = launchSourceSchema.safeParse(launchSource) + return { + agent_kind: tuiAgentToAgentKind(agent), + launch_source: parsed.success ? parsed.data : 'unknown', + request_kind: 'new' + } +} diff --git a/src/main/agent-launch/host-agent-startup-attribution.test.ts b/src/main/agent-launch/host-agent-startup-attribution.test.ts new file mode 100644 index 000000000000..612caab80017 --- /dev/null +++ b/src/main/agent-launch/host-agent-startup-attribution.test.ts @@ -0,0 +1,99 @@ +import { readFileSync, readdirSync, statSync } from 'node:fs' +import { join, relative, resolve } from 'node:path' +import { describe, expect, it } from 'vitest' + +/** + * Every host-side call that builds an agent's startup command has made an attribution decision. + * + * `agent_started` is recorded per call site, and twice a new host builder shipped without one, so + * that agent's launches were silently uncounted. A new call, or another call in a listed file, + * fails here until its author decides and records whether that launch is a fresh start. + */ +const DECISIONS = ['attributes', 'resume', 'mobile-followup'] as const + +const LISTED: ReadonlyMap = new Map( + readFileSync(join(__dirname, '__fixtures__', 'host-agent-startup-call-sites.txt'), 'utf8') + .split('\n') + .map((line) => line.trim()) + .filter((line) => line.length > 0 && !line.startsWith('#')) + .map((line) => { + const [path, calls, decision] = line.split(/\s+/) + return [path, { calls: Number(calls), decision }] as const + }) +) + +const BUILDER_CALL = + /\b(?:buildAgentStartupPlan|buildAgentDraftLaunchPlan|buildAgentResumeStartupPlan)\s*\(/g + +const DECIDE = + 'Decide attribution: a fresh agent the host builds must carry ' + + '`agentStartedTelemetry(agent, launchSource)` (src/main/agent-launch/agent-started-telemetry.ts) ' + + 'on its startup; a resume or a bare typed command must not. Then record the file, its call ' + + 'count and the decision in __fixtures__/host-agent-startup-call-sites.txt.' + +function isTestFile(path: string): boolean { + return /\.(?:test|spec)\.tsx?$/.test(path) || path.includes('/__tests__/') +} + +function collectSourceFiles(root: string): string[] { + return readdirSync(root).flatMap((entry) => { + const full = join(root, entry) + if (statSync(full).isDirectory()) { + return entry === '__fixtures__' ? [] : collectSourceFiles(full) + } + return /\.tsx?$/.test(entry) ? [full] : [] + }) +} + +/** Drop comment-only lines so prose naming a builder is not a call. */ +function codeText(contents: string): string { + return contents + .split('\n') + .filter((line) => !/^\s*(?:\/\/|\/\*|\*)/.test(line)) + .join('\n') +} + +describe('host agent startup attribution', () => { + const repoRoot = resolve(__dirname, '..', '..', '..') + const files = collectSourceFiles(join(repoRoot, 'src', 'main')) + const found = new Map() + for (const file of files) { + const path = relative(repoRoot, file).split('\\').join('/') + const calls = isTestFile(path) + ? 0 + : (codeText(readFileSync(file, 'utf8')).match(BUILDER_CALL)?.length ?? 0) + if (calls > 0) { + found.set(path, calls) + } + } + + it('scans a plausible number of files', () => { + // A broken root would make the guard silently vacuous. + expect(files.length).toBeGreaterThan(500) + }) + + it('has an attribution decision for every builder call', () => { + const undecided = [...found] + .filter(([path, calls]) => calls > (LISTED.get(path)?.calls ?? 0)) + .map(([path, calls]) => `${path}: ${calls} calls, ${LISTED.get(path)?.calls ?? 0} decided`) + expect(undecided, `New host-built agent startup. ${DECIDE}`).toEqual([]) + }) + + it('has no stale entry', () => { + // A count left above reality lets the next call in that file land without a decision. + const stale = [...LISTED] + .filter(([path, entry]) => entry.calls > (found.get(path) ?? 0)) + .map(([path, entry]) => `${path}: ${found.get(path) ?? 0} calls, ${entry.calls} listed`) + expect(stale, 'Lower or delete the entry to match the calls that remain.').toEqual([]) + }) + + it('uses the known decision vocabulary', () => { + const unknown = [...LISTED].filter( + ([, entry]) => !DECISIONS.some((decision) => decision === entry.decision) + ) + expect( + unknown.map(([path]) => path), + `Use one of: ${DECISIONS.join(', ')}.` + ).toEqual([]) + }) +}) diff --git a/src/main/runtime/orca-runtime-activate-managed-worktree.ts b/src/main/runtime/orca-runtime-activate-managed-worktree.ts index 48d81fc79cc9..28ee6cc0a92a 100644 --- a/src/main/runtime/orca-runtime-activate-managed-worktree.ts +++ b/src/main/runtime/orca-runtime-activate-managed-worktree.ts @@ -118,7 +118,8 @@ export class OrcaRuntimeWithActivateManagedWorktree extends OrcaRuntimeWithListM protected async buildStartupForDraft( repo: Repo, draft: string, - requestedAgent?: TuiAgent + requestedAgent?: TuiAgent, + launchSource?: string ): Promise<{ agent: TuiAgent startup: WorktreeStartupLaunch @@ -131,6 +132,7 @@ export class OrcaRuntimeWithActivateManagedWorktree extends OrcaRuntimeWithListM repo, draft, ...(requestedAgent ? { requestedAgent } : {}), + ...(launchSource ? { launchSource } : {}), settings: this.store.getSettings(), getLaunchPlatform: () => this.getAgentLaunchPlatformForRepo(repo) }) diff --git a/src/main/runtime/orca-runtime-create-agent-session.ts b/src/main/runtime/orca-runtime-create-agent-session.ts index 6c5d11b83496..61d80e60b099 100644 --- a/src/main/runtime/orca-runtime-create-agent-session.ts +++ b/src/main/runtime/orca-runtime-create-agent-session.ts @@ -27,6 +27,7 @@ import { deterministicAgentSessionUuid, isAgentSessionOperationOutcomeUnknown } from './runtime-agent-launch-resolution' +import { agentStartedTelemetry } from '../agent-launch/agent-started-telemetry' export class OrcaRuntimeWithCreateAgentSession extends OrcaRuntimeWithGetAgentSessionExecutionNamespace { async createAgentSession( @@ -201,6 +202,8 @@ export class OrcaRuntimeWithCreateAgentSession extends OrcaRuntimeWithGetAgentSe launchAgent: request.agent, terminalKittyKeyboardProtocol: request.terminalKittyKeyboardProtocol, startupCommandDelivery: startup.startupCommandDelivery, + // A fresh agent this host built; the request has no surface field, so it counts as `unknown`. + telemetry: agentStartedTelemetry(request.agent, undefined), cwd: startupCwd, presentation: request.presentation ?? 'background', tabId: operationTabId, diff --git a/src/main/runtime/orca-runtime-create-managed-worktree.ts b/src/main/runtime/orca-runtime-create-managed-worktree.ts index 79c0b612c051..c293d65460f8 100644 --- a/src/main/runtime/orca-runtime-create-managed-worktree.ts +++ b/src/main/runtime/orca-runtime-create-managed-worktree.ts @@ -68,7 +68,12 @@ export class OrcaRuntimeWithCreateManagedWorktree extends OrcaRuntimeWithGetWork : null const draftStartup = !args.startup && !agentStartup && args.startupDraft - ? await this.buildStartupForDraft(repo, args.startupDraft, requestedAgent) + ? await this.buildStartupForDraft( + repo, + args.startupDraft, + requestedAgent, + args.startupLaunchSource + ) : null const effectiveStartup = args.startup ?? agentStartup?.startup ?? draftStartup?.startup const effectiveStartupFollowup = agentStartup?.followup diff --git a/src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts b/src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts index 94dba6bdc833..eeac6dd9a78f 100644 --- a/src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts +++ b/src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts @@ -21,6 +21,7 @@ import { resolveLocalProjectRuntimeForWorktreeId } from '../local-project-runtim import { resolveBareAgentLaunchCommand } from './runtime-agent-launch-resolution' import { buildAgentStartupPlan } from '../../shared/tui-agent-startup' import { resolveAgentStartupPlanInputs } from '../../shared/agent-startup-plan-inputs' +import { agentStartedTelemetry } from '../agent-launch/agent-started-telemetry' export class OrcaRuntimeWithResolveWorktreeRemovalTarget extends OrcaRuntimeWithRemoveManagedWorktree { protected async resolveWorktreeRemovalTarget( @@ -250,7 +251,9 @@ export class OrcaRuntimeWithResolveWorktreeRemovalTarget extends OrcaRuntimeWith ...(startupPlan.env ? { env: startupPlan.env } : {}), launchConfig: startupPlan.launchConfig, launchAgent: agent, - startupCommandDelivery: startupPlan.startupCommandDelivery + startupCommandDelivery: startupPlan.startupCommandDelivery, + // A bare command the user typed stays out of launch accounting, as before. + ...(opts.startupAgent ? { telemetry: agentStartedTelemetry(agent, opts.launchSource) } : {}) } } } diff --git a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts index 6aa0c6bd70f9..92612c2e7633 100644 --- a/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts +++ b/src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts @@ -223,4 +223,74 @@ describe('OrcaRuntimeService', () => { expect(spawn.mock.calls[0]?.[0]?.command).not.toMatch(/--model/) }) + + // Every agent the runtime builds is attributed, so a launch whose caller named no surface still + // counts; only the caller's surface is taken, the rest is derived from the agent it resolved. + it.each([ + ['orchestration', 'orchestration'], + [undefined, 'unknown'], + ['a_surface_added_later', 'unknown'] + ])('attributes a startup-agent launch named %s as %s', async (launchSource, expected) => { + const spawn = vi.fn().mockResolvedValue({ id: 'pty-attributed' }) + const runtime = new OrcaRuntimeService(store) + runtime.setPtyController({ + spawn, + write: () => true, + kill: () => true, + getForegroundProcess: async () => null + }) + + await runtime.createTerminal(`path:${TEST_WORKTREE_PATH}`, { + startupAgent: 'claude', + ...(launchSource ? { launchSource } : {}) + }) + + expect(spawn.mock.calls[0]?.[0]?.telemetry).toEqual({ + agent_kind: 'claude-code', + launch_source: expected, + request_kind: 'new' + }) + }) + + it('attributes a fresh agent session the host builds as unknown', async () => { + const spawn = vi.fn().mockResolvedValue({ id: 'pty-session' }) + const runtime = new OrcaRuntimeService(store) + runtime.setPtyController({ + spawn, + write: () => true, + kill: () => true, + getForegroundProcess: async () => null + }) + + await runtime.createAgentSession( + { + clientOperationId: `${Date.now()}-${'cd'.repeat(16)}`, + worktree: `id:${TEST_WORKTREE_ID}`, + agent: 'claude' + }, + { clientId: 'remote-desktop', clientKind: 'runtime' } + ) + + expect(spawn.mock.calls[0]?.[0]?.telemetry).toEqual({ + agent_kind: 'claude-code', + launch_source: 'unknown', + request_kind: 'new' + }) + }) + + it('leaves a bare agent command the user typed out of launch attribution', async () => { + const spawn = vi.fn().mockResolvedValue({ id: 'pty-bare' }) + const runtime = new OrcaRuntimeService(store) + runtime.setPtyController({ + spawn, + write: () => true, + kill: () => true, + getForegroundProcess: async () => null + }) + + await runtime.createTerminal(`path:${TEST_WORKTREE_PATH}`, { command: 'claude' }) + + expect(spawn.mock.calls[0]?.[0]?.launchAgent).toBe('claude') + expect(spawn.mock.calls[0]?.[0]?.telemetry).toBeUndefined() + }) }) diff --git a/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.ts b/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.ts index cc2c2cae2ba5..d3d2ee8b44a5 100644 --- a/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.ts +++ b/src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.ts @@ -509,6 +509,7 @@ describe('OrcaRuntimeService', () => { repoSelector: 'id:repo-1', name: 'runtime-explicit-draft', startupDraft: draftUrl, + startupLaunchSource: 'cli', createdWithAgent: 'codex', activate: true }) @@ -519,7 +520,9 @@ describe('OrcaRuntimeService', () => { expect.objectContaining({ cwd: '/tmp/workspaces/runtime-explicit-draft', command: "codex '--dangerously-bypass-approvals-and-sandbox'", - worktreeId: result.worktree.id + worktreeId: result.worktree.id, + // The host picked and launched this agent, so it carries the caller's surface too. + telemetry: { agent_kind: 'codex', launch_source: 'cli', request_kind: 'new' } }) ) expect(metaById[result.worktree.id]).toMatchObject({ createdWithAgent: 'codex' }) diff --git a/src/main/runtime/rpc/methods/agent-launch-surfaces.ts b/src/main/runtime/rpc/methods/agent-launch-surfaces.ts index 07dcdb531865..3f184cd50b5c 100644 --- a/src/main/runtime/rpc/methods/agent-launch-surfaces.ts +++ b/src/main/runtime/rpc/methods/agent-launch-surfaces.ts @@ -14,10 +14,6 @@ */ import { randomUUID } from 'node:crypto' -import { tuiAgentToAgentKind } from '../../../../shared/agent-kind' -import { launchSourceSchema } from '../../../../shared/telemetry-property-schemas' -import type { TuiAgent } from '../../../../shared/tui-agent' -import type { TerminalCreateOptions } from '../../runtime-terminal-contracts' import { narrowStructuredLaunchSeedOptions } from '../../../../shared/native-chat-session-option-defaults' import { createStructuredAgentSessionOperationId } from '../../../../shared/structured-agent-session-mutation' import { structuredAgentSessionTabId } from '../../../../shared/structured-agent-session-projection' @@ -138,7 +134,7 @@ export function agentLaunchSurfaceFactory( ...(launchPreferences ? { launchPreferences } : {}), // A live reserved pane would be attached, not launched into, so the runtime refuses it. ...(paneKey ? { ...paneIdentity(paneKey), requireFreshPane: true } : {}), - ...agentLaunchTelemetry(agent, launchSource), + ...(launchSource ? { launchSource } : {}), onPtySpawnDispatched: terminalSpawn.onPtySpawnDispatched }) const terminal = await created.catch(terminalSpawn.rethrow) @@ -159,34 +155,6 @@ export function agentLaunchSurfaceFactory( } } -/** - * The `agent_started` triple, of which only `launch_source` came from the caller. - * - * `agent_kind` and `request_kind` are derived rather than accepted — the host already knows both, - * and a value it derives is a value a caller cannot misreport. `request_kind` is always `new` - * because a launch reusing a terminal returns before any surface is created. - * - * An unrecognized `launch_source` drops the telemetry and starts the agent anyway. The wire keeps - * the arm set open so an older host cannot refuse a newer client's launch over a label, which is - * only honoured if the refusal does not reappear here: attribution is bookkeeping, and bookkeeping - * must not gate the user's launch. - */ -function agentLaunchTelemetry( - agent: TuiAgent, - launchSource: string | undefined -): Pick { - const parsed = launchSourceSchema.safeParse(launchSource) - return parsed.success - ? { - telemetry: { - agent_kind: tuiAgentToAgentKind(agent), - launch_source: parsed.data, - request_kind: 'new' - } - } - : {} -} - function requireInstalledHost(): StructuredAgentSessionHost { const host = getStructuredAgentSessionHost() if (!host) { diff --git a/src/main/runtime/rpc/methods/agent-launch.test.ts b/src/main/runtime/rpc/methods/agent-launch.test.ts index b39dbc350f0f..75045cf74c48 100644 --- a/src/main/runtime/rpc/methods/agent-launch.test.ts +++ b/src/main/runtime/rpc/methods/agent-launch.test.ts @@ -331,6 +331,23 @@ describe('the worktree factory', () => { }) }) + it("attributes a create by the launch's own source, never a copy inside the create payload", async () => { + const createWithSource = { + ...CREATE_LAUNCH, + target: { + kind: 'create-worktree', + create: { ...CREATE_LAUNCH.target.create, launchSource: 'cli' } + } + } + const named = runtimeStub({ settings: {} }) + await launch({ ...createWithSource, launchSource: 'onboarding' }, named) + expect(createArgs(named)).toMatchObject({ startupLaunchSource: 'onboarding' }) + + const unnamed = runtimeStub({ settings: {} }) + await launch(createWithSource, unnamed) + expect(createArgs(unnamed)).not.toHaveProperty('startupLaunchSource') + }) + it('preserves an explicit no-arguments value for an agent-first worktree create', async () => { const runtime = runtimeStub({ settings: {} }) await launch({ ...CREATE_LAUNCH, agentArgs: null }, runtime) @@ -554,15 +571,14 @@ describe('launch inputs that cross the wire', () => { }) }) - it('derives agent_kind and request_kind, taking only launch_source from the caller', async () => { + it("hands the caller's launch_source to the runtime, which attributes the launch", async () => { const runtime = runtimeStub({ settings: {} }) await launch({ ...EXISTING_LAUNCH, launchSource: 'source_control_recovery' }, runtime) - expect(terminalOptions(runtime).telemetry).toEqual({ - agent_kind: 'claude-code', - launch_source: 'source_control_recovery', - request_kind: 'new' - }) + // The runtime derives agent_kind and request_kind from the agent it builds, so the handler + // forwards only the one member it cannot know, and never a prebuilt triple. + expect(terminalOptions(runtime)).toMatchObject({ launchSource: 'source_control_recovery' }) + expect(terminalOptions(runtime)).not.toHaveProperty('telemetry') }) it('starts the agent anyway when launch_source is one this build has never heard of', async () => { @@ -573,16 +589,16 @@ describe('launch inputs that cross the wire', () => { ) // The whole point of the open arm set: attribution is bookkeeping, and bookkeeping must never - // gate a user action. The row is dropped; the launch is not. + // gate a user action. The runtime records it as `unknown`; the launch still starts. expect(result.outcome).toEqual({ kind: 'terminal', handle: 'term_1' }) - expect(terminalOptions(runtime)).not.toHaveProperty('telemetry') + expect(terminalOptions(runtime)).toMatchObject({ launchSource: 'a_surface_added_later' }) }) - it('sends no telemetry at all when the caller named no launch source', async () => { + it('names no launch source when the caller named none', async () => { const runtime = runtimeStub({ settings: {} }) await launch(EXISTING_LAUNCH, runtime) - expect(terminalOptions(runtime)).not.toHaveProperty('telemetry') + expect(terminalOptions(runtime)).not.toHaveProperty('launchSource') }) it('keeps a structured preference when the cwd names the workspace root', async () => { diff --git a/src/main/runtime/rpc/methods/orchestration/federation/federation.ts b/src/main/runtime/rpc/methods/orchestration/federation/federation.ts index 6f7a1bba0779..067f583e37b4 100644 --- a/src/main/runtime/rpc/methods/orchestration/federation/federation.ts +++ b/src/main/runtime/rpc/methods/orchestration/federation/federation.ts @@ -114,6 +114,7 @@ export const ORCHESTRATION_FEDERATION_ATTACH_METHODS = [ observeSetupCompletion: true, createdWithAgent: agent as TuiAgent, startupAgent: agent as TuiAgent, + startupLaunchSource: 'orchestration', ...(launch.preferences ? { startupLaunchPreferences: launch.preferences } : {}), activate: false, lineage: { noParent: true } @@ -185,6 +186,7 @@ export const ORCHESTRATION_FEDERATION_ATTACH_METHODS = [ // Why: agent ids are not shell commands (`cursor` is the desktop app, // its CLI is `cursor-agent`); resolve through the TUI agent config. startupAgent: agent as TuiAgent, + launchSource: 'orchestration', ...(launch.preferences ? { launchPreferences: launch.preferences } : {}), title: `worker-${params.taskId}`, presentation: 'background' diff --git a/src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts index 8459a9886e49..d265858b0243 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/composed-workers.test.ts @@ -155,6 +155,7 @@ describe('orchestration RPC methods', () => { // the tab without scrolling the sidebar to the worker's workspace. expect(runtime.createTerminal).toHaveBeenCalledWith('id:repo::worktree', { startupAgent: 'codex', + launchSource: 'orchestration', title: `worker-${task.id}`, surfaceOwner: false }) diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts index b18eb9ee6c25..3e86dea3e28d 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-topology.ts @@ -69,6 +69,7 @@ export async function createExistingWorktreeWorkerTerminal(args: { // desktop app while its CLI is `cursor-agent`. Let the runtime build the // configured launcher instead of executing the raw id. startupAgent: args.agent, + launchSource: 'orchestration', ...(args.launchPreferences ? { launchPreferences: args.launchPreferences } : {}), title: `worker-${args.taskId}`, // Why: dispatching a worker is background work; it must not pull the sidebar diff --git a/src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts b/src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts index fe0c11e374d8..cbdab8d1f940 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/worker-worktree-creation.ts @@ -61,6 +61,7 @@ export async function createWorkerWorktree(args: { ...(args.withAgentTerminal ? { startupAgent: args.agent, + startupLaunchSource: 'orchestration', ...(args.launchPreferences ? { startupLaunchPreferences: args.launchPreferences } : {}) } : {}), diff --git a/src/main/runtime/rpc/methods/orchestration/worker/workers-new-worktree.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/workers-new-worktree.test.ts index 5164ac0b22f3..cda3354e8165 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/workers-new-worktree.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/workers-new-worktree.test.ts @@ -140,6 +140,7 @@ describe('orchestration new-worktree workers', () => { expect(runtime.createManagedWorktree).toHaveBeenCalledWith( expect.objectContaining({ startupAgent: 'codex', + startupLaunchSource: 'orchestration', awaitTerminalProvisioning: true, observeSetupCompletion: true, lineage: expect.objectContaining({ noParent: true, parentWorktree: undefined }) diff --git a/src/main/runtime/rpc/methods/worktree-create-args.ts b/src/main/runtime/rpc/methods/worktree-create-args.ts index 932659758bb5..c05dc906f40d 100644 --- a/src/main/runtime/rpc/methods/worktree-create-args.ts +++ b/src/main/runtime/rpc/methods/worktree-create-args.ts @@ -78,6 +78,7 @@ export function buildManagedWorktreeCreateArgs( : undefined, ...(params.startupAgent ? { startupAgent: params.startupAgent } : {}), ...(params.startupPrompt !== undefined ? { startupPrompt: params.startupPrompt } : {}), + ...(params.launchSource ? { startupLaunchSource: params.launchSource } : {}), startupDraft: params.startupDraft, lineage: { parentWorkspace: params.parentWorkspace, diff --git a/src/main/runtime/rpc/methods/worktree-create-launch-source.test.ts b/src/main/runtime/rpc/methods/worktree-create-launch-source.test.ts new file mode 100644 index 000000000000..2cfd6c3de920 --- /dev/null +++ b/src/main/runtime/rpc/methods/worktree-create-launch-source.test.ts @@ -0,0 +1,41 @@ +import { describe, expect, it, vi } from 'vitest' +import { RpcDispatcher } from '../dispatcher' +import type { OrcaRuntimeService } from '../../orca-runtime' +import { WORKTREE_METHODS } from './worktree' + +const repo = { + id: 'repo-1', + path: '/workspace/repo', + displayName: 'repo', + badgeColor: '#000', + addedAt: 1, + kind: 'git' as const +} + +describe('worktree.create launch source', () => { + it('hands the surface that asked for a startup agent to the runtime', async () => { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the fixture implements every runtime method worktree.create reaches for a create with no provenance request. + const runtime = { + getRuntimeId: () => 'test-runtime', + dedupeWorktreeCreate: (_repo: string, _id: string | undefined, run: () => Promise) => + run(), + showRepo: vi.fn().mockResolvedValue(repo), + createManagedWorktree: vi.fn().mockResolvedValue({ worktree: { id: 'wt-1' } }) + } as unknown as OrcaRuntimeService + const dispatcher = new RpcDispatcher({ runtime, methods: WORKTREE_METHODS }) + + // An open label: a surface this host has never heard of must not refuse the create. + for (const launchSource of ['cli', 'a_surface_added_later']) { + const response = await dispatcher.dispatch({ + id: 'req-1', + authToken: 'tok', + method: 'worktree.create', + params: { repo: 'repo-1', name: 'agent-startup', startupAgent: 'codex', launchSource } + }) + expect(response).toMatchObject({ ok: true }) + expect(runtime.createManagedWorktree).toHaveBeenLastCalledWith( + expect.objectContaining({ startupAgent: 'codex', startupLaunchSource: launchSource }) + ) + } + }) +}) diff --git a/src/main/runtime/runtime-managed-worktree-create-types.ts b/src/main/runtime/runtime-managed-worktree-create-types.ts index bdc8c2a0a127..9edd5b23836b 100644 --- a/src/main/runtime/runtime-managed-worktree-create-types.ts +++ b/src/main/runtime/runtime-managed-worktree-create-types.ts @@ -54,6 +54,7 @@ export type RuntimeManagedWorktreeCreateArgs = { /** Per-launch inputs used when `startupAgent` is the created terminal surface. */ startupAgentArgs?: string | null startupCwd?: string + /** The surface behind a host-built startup agent (`startupAgent` or `startupDraft`). */ startupLaunchSource?: string /** A caller-minted `tabId:leafId` for the startup terminal's pane. */ startupPaneKey?: string diff --git a/src/main/runtime/runtime-terminal-contracts.ts b/src/main/runtime/runtime-terminal-contracts.ts index fa0e7a0afa0f..e08fffa273cf 100644 --- a/src/main/runtime/runtime-terminal-contracts.ts +++ b/src/main/runtime/runtime-terminal-contracts.ts @@ -62,6 +62,9 @@ export type TerminalCreateOptions = { viewMode?: 'terminal' | 'chat' startupCommandDelivery?: WorktreeStartupLaunch['startupCommandDelivery'] telemetry?: WorktreeStartupLaunch['telemetry'] + /** The surface that asked for this `startupAgent` launch; the runtime attributes every one it + * builds, as `unknown` when this is absent or unrecognized. Ignored without `startupAgent`. */ + launchSource?: string title?: string focus?: boolean rendererBacked?: boolean diff --git a/src/main/runtime/runtime-worktree-agent-startup.test.ts b/src/main/runtime/runtime-worktree-agent-startup.test.ts index deb2eea281af..ba2c57b78545 100644 --- a/src/main/runtime/runtime-worktree-agent-startup.test.ts +++ b/src/main/runtime/runtime-worktree-agent-startup.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import type { Repo } from '../../shared/repo-types' +import { tuiAgentToAgentKind } from '../../shared/agent-kind' const mocks = vi.hoisted(() => ({ markAntigravityWorkspaceTrusted: vi.fn(), @@ -102,6 +103,22 @@ describe('buildWorktreeStartupForAgent host resolution', () => { request_kind: 'new' }) }) + + it('attributes a startup agent whose caller named no surface as unknown', () => { + const result = buildWorktreeStartupForAgent({ + repo: makeRepo({}), + settings, + agent: 'claude', + getLaunchPlatform: () => 'linux', + toSessionOptions: () => undefined + }) + + expect(result.startup.telemetry).toEqual({ + agent_kind: 'claude-code', + launch_source: 'unknown', + request_kind: 'new' + }) + }) }) describe('buildWorktreeStartupForDraft agent detection', () => { @@ -135,6 +152,34 @@ describe('buildWorktreeStartupForDraft agent detection', () => { expect(mocks.detectRemoteAgents).not.toHaveBeenCalled() expect(result?.agent).toBe('claude') }) + + // The host picks and launches this agent itself, so it is attributed like any other it builds, + // whether the draft rides the launch command or is pasted once the agent is up. + it.each([ + ['claude', 'cli', 'cli', false], + ['claude', undefined, 'unknown', false], + ['claude-agent-teams', 'orchestration', 'orchestration', true], + ['claude-agent-teams', undefined, 'unknown', true] + ] as const)( + 'attributes a %s draft launch named %s as %s', + async (agent, launchSource, expected, pasted) => { + const result = await buildWorktreeStartupForDraft({ + repo: makeRepo({}), + settings, + draft: 'ship it', + requestedAgent: agent, + getLaunchPlatform: () => 'linux', + ...(launchSource ? { launchSource } : {}) + }) + + expect(result?.draftPaste !== undefined).toBe(pasted) + expect(result?.startup.telemetry).toEqual({ + agent_kind: tuiAgentToAgentKind(agent), + launch_source: expected, + request_kind: 'new' + }) + } + ) }) describe('markLocalWorktreeTrusted', () => { diff --git a/src/main/runtime/runtime-worktree-agent-startup.ts b/src/main/runtime/runtime-worktree-agent-startup.ts index 10f335a4b057..faca0baf8fa4 100644 --- a/src/main/runtime/runtime-worktree-agent-startup.ts +++ b/src/main/runtime/runtime-worktree-agent-startup.ts @@ -1,10 +1,9 @@ import { markQoderWorkspaceTrusted } from '../qoder/workspace-trust' +import { agentStartedTelemetry } from '../agent-launch/agent-started-telemetry' import type { AgentLaunchPreferences } from '../../shared/agent-session-host-authority' -import { tuiAgentToAgentKind } from '../../shared/agent-kind' import type { Repo } from '../../shared/repo-types' import type { TuiAgent } from '../../shared/tui-agent' import type { WorktreeStartupLaunch } from '../../shared/worktree/launch-types' -import { launchSourceSchema } from '../../shared/telemetry-property-schemas' import { repoIsRemote } from '../../shared/agent-launch-remote' import { getRepoSshConnectionId } from '../../shared/execution-host' import { isTuiAgent, TUI_AGENT_CONFIG } from '../../shared/tui-agent-config' @@ -28,6 +27,11 @@ import type { RuntimeStore } from './runtime-store-contract' export type WorktreeStartupDraftPaste = { agent: TuiAgent; content: string } export type WorktreeStartupFollowup = { expectedProcess: string; prompt: string } +/** A fresh agent the host builds always carries its `agent_started` record; dropping it fails to compile. */ +type AttributedWorktreeStartupLaunch = WorktreeStartupLaunch & { + telemetry: NonNullable +} + type StartupEnvironment = { repo: Repo settings: ReturnType @@ -42,7 +46,7 @@ export async function buildWorktreeStartupForDraft( environment: StartupEnvironment & { draft: string; requestedAgent?: TuiAgent } ): Promise<{ agent: TuiAgent - startup: WorktreeStartupLaunch + startup: AttributedWorktreeStartupLaunch draftPaste?: WorktreeStartupDraftPaste } | null> { const content = environment.draft.trim() @@ -85,6 +89,7 @@ export async function buildWorktreeStartupForDraft( isRemote: repoIsRemote(repo), ...(environment.agentArgs !== undefined ? { agentArgs: environment.agentArgs } : {}) }) + const telemetry = agentStartedTelemetry(agent, environment.launchSource) const draftPlan = buildAgentDraftLaunchPlan({ ...launchArgs, draft: content }) if (draftPlan) { return { @@ -95,7 +100,8 @@ export async function buildWorktreeStartupForDraft( ...(draftPlan.startupCommandDelivery ? { startupCommandDelivery: draftPlan.startupCommandDelivery } : {}), - ...(draftPlan.env ? { env: draftPlan.env } : {}) + ...(draftPlan.env ? { env: draftPlan.env } : {}), + telemetry } } } @@ -115,7 +121,8 @@ export async function buildWorktreeStartupForDraft( ...(startupPlan.startupCommandDelivery ? { startupCommandDelivery: startupPlan.startupCommandDelivery } : {}), - ...(startupPlan.env ? { env: startupPlan.env } : {}) + ...(startupPlan.env ? { env: startupPlan.env } : {}), + telemetry }, draftPaste: { agent, content } } @@ -130,7 +137,11 @@ export function buildWorktreeStartupForAgent( preferences?: AgentLaunchPreferences ) => Parameters[0]['sessionOptions'] | undefined } -): { agent: TuiAgent; startup: WorktreeStartupLaunch; followup?: WorktreeStartupFollowup } { +): { + agent: TuiAgent + startup: AttributedWorktreeStartupLaunch + followup?: WorktreeStartupFollowup +} { const { agent, repo, settings } = environment if (!isTuiAgentEnabled(agent, settings.disabledTuiAgents)) { throw new Error('Selected agent is disabled. Choose an enabled agent before creating.') @@ -150,7 +161,6 @@ export function buildWorktreeStartupForAgent( if (!startupPlan) { throw new Error(`Could not build launch command for ${agent}.`) } - const telemetry = agentLaunchTelemetry(agent, environment.launchSource) return { agent, startup: { @@ -160,7 +170,7 @@ export function buildWorktreeStartupForAgent( ? { startupCommandDelivery: startupPlan.startupCommandDelivery } : {}), ...(startupPlan.env ? { env: startupPlan.env } : {}), - ...(telemetry ? { telemetry } : {}) + telemetry: agentStartedTelemetry(agent, environment.launchSource) }, ...(startupPlan.followupPrompt ? { @@ -173,20 +183,6 @@ export function buildWorktreeStartupForAgent( } } -function agentLaunchTelemetry( - agent: TuiAgent, - launchSource: string | undefined -): WorktreeStartupLaunch['telemetry'] | undefined { - const parsed = launchSourceSchema.safeParse(launchSource) - return parsed.success - ? { - agent_kind: tuiAgentToAgentKind(agent), - launch_source: parsed.data, - request_kind: 'new' - } - : undefined -} - export async function markLocalWorktreeTrusted( agent: TuiAgent, workspacePath: string diff --git a/src/shared/agent-launch-intent.ts b/src/shared/agent-launch-intent.ts index 016b759d8773..bffb93c1b9a2 100644 --- a/src/shared/agent-launch-intent.ts +++ b/src/shared/agent-launch-intent.ts @@ -305,7 +305,9 @@ export const AGENT_LAUNCH_RESERVED_CREATE_FIELDS = [ 'startupDraft', 'startupLaunchConfig', 'startupEnv', - 'startupCommandDelivery' + 'startupCommandDelivery', + // The launch carries its own; a create's copy would be a second, possibly contradicting, answer. + 'launchSource' ] as const /** Strips the reserved agent fields from a create payload. Callers migrating from diff --git a/src/shared/rpc-contract/agent-launch-params.ts b/src/shared/rpc-contract/agent-launch-params.ts index 3fd12f52eede..3926c610708a 100644 --- a/src/shared/rpc-contract/agent-launch-params.ts +++ b/src/shared/rpc-contract/agent-launch-params.ts @@ -18,6 +18,7 @@ import { isValidHostTerminalTabId } from '../terminal-tab-id' import { isTuiAgent } from '../tui-agent-config' import type { TuiAgent } from '../tui-agent' import { WorktreeCreate } from './worktree-create-params' +import { LaunchSourceParam } from './launch-source-param' import { TerminalTabIdParam } from './agent-session-params' import { SessionId } from './structured-agent-session-params' import { isStructuredAgentSessionIdFor } from '../structured-agent-session-create' @@ -78,16 +79,7 @@ export const AgentLaunchFields = z.object({ /** A start directory other than the workspace root. Terminal-only, and the host downgrades a * structured launch that carries one rather than ignoring it. */ cwd: z.string().min(1, 'Empty launch cwd').optional(), - /** - * Telemetry attribution, deliberately `z.string()` rather than the closed `launchSourceSchema`. - * - * Params are validated by the HOST, so a closed enum here is a version claim pointing the wrong - * way: a newer client naming a launch surface an older host has never heard of would have its - * whole launch refused over a label nothing reads as behaviour. Bookkeeping must not gate a user - * action, so the arm set stays open here and the host parses it leniently at the point it is - * actually used — the same `safeParse`-and-skip the PTY spawn already does. - */ - launchSource: z.string().optional(), + launchSource: LaunchSourceParam.optional(), /** * The pane a terminal launch should create, minted by a caller that places its own tabs. * diff --git a/src/shared/rpc-contract/launch-source-param.ts b/src/shared/rpc-contract/launch-source-param.ts new file mode 100644 index 000000000000..610044224833 --- /dev/null +++ b/src/shared/rpc-contract/launch-source-param.ts @@ -0,0 +1,12 @@ +import { z } from 'zod' + +/** + * Which surface started an agent launch, deliberately `z.string()` rather than the closed + * `launchSourceSchema`. + * + * Params are validated by the HOST, so a closed enum here is a version claim pointing the wrong + * way: a newer client naming a launch surface an older host has never heard of would have its + * whole launch refused over a label nothing reads as behaviour. Bookkeeping must not gate a user + * action, so the arm set stays open here and the host resolves it leniently where it is used. + */ +export const LaunchSourceParam = z.string() diff --git a/src/shared/rpc-contract/worktree-create-params.ts b/src/shared/rpc-contract/worktree-create-params.ts index 7c0b1f55fadf..04de055a6393 100644 --- a/src/shared/rpc-contract/worktree-create-params.ts +++ b/src/shared/rpc-contract/worktree-create-params.ts @@ -5,6 +5,7 @@ import { workspaceSourceSchema } from '../telemetry-events' import { RUNTIME_NAVIGATION_TARGETS } from '../runtime-navigation' import { sleepingAgentLaunchConfigSchema } from '../workspace-session-sleeping-agents' import { isTuiAgent } from '../tui-agent-config' +import { LaunchSourceParam } from './launch-source-param' import { OptionalBoolean, OptionalFiniteNumber, @@ -110,6 +111,8 @@ export const WorktreeCreate = z // workspaces execute in a different shell than the client process. startupAgent: OptionalTuiAgent, startupPrompt: OptionalString, + // Which surface asked for the agent the host launches from `startupAgent` or `startupDraft`. + launchSource: LaunchSourceParam.optional(), // Why: task-driven mobile creates need desktop parity: the host chooses // the same default/detected agent and drafts the linked issue/PR URL into it. startupDraft: OptionalString, diff --git a/src/shared/telemetry-property-schemas.ts b/src/shared/telemetry-property-schemas.ts index 89f62138407b..a45a2f8d9f20 100644 --- a/src/shared/telemetry-property-schemas.ts +++ b/src/shared/telemetry-property-schemas.ts @@ -141,6 +141,10 @@ export const launchSourceSchema = z.enum([ 'conflict_resolution', 'source_control_recovery', 'terminal_context_menu', + // Launches the host performs for a caller outside the desktop app. + 'cli', + 'mobile', + 'orchestration', 'unknown' ]) export type LaunchSource = z.infer From 94b5a7d256da1bec656980800b7dafbdcb9a6c63 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:47:45 -0700 Subject: [PATCH 55/90] fix(native-chat): only Codex's turn completion ends a Codex turn (#23682) * fix(native-chat): the sink queue keeps a settlement's first batch, as the journal does The journal applies a lifecycle batch's settlement id once and skips any later batch with the same id. The deferred sink queue coalesced the same key the other way: a second batch replaced the first while it was still queued. So which record survived depended on whether the first had drained yet. A lifecycle batch now keeps the queued operation with its key, and a later one is accepted and dropped, which is what the journal does once the first is written. * fix(native-chat): only turn/completed ends a Codex turn Codex follows every turn-ending `error` (willRetry=false) with a failed `turn/completed` for the same turn, 0-32 ms later. That was captured from the real app-server on 0.141.0 and 0.158.0 across eight failure scenarios, and it is how Codex builds a failed turn: it records the error as the turn's last error, records any pending input, and then derives `failed` from that error when it completes the turn. The translator ended the turn twice: once on the error, and again on the completion, with a guard to make the first end final. Ending on the error threw away what only the completion carries: Codex's duration, and the completion's receipt time. It also forgot the turn before Codex recorded the turn's pending input. Now the error is only the row the user reads, inside the still-open turn, and `turn/completed` is the turn's only live end. A process exit between the two is the existing exit sweep's observed end, recorded as interrupted. A failed completion is stored as completed with outcome failure, live and on restore alike. Only `interrupted` maps to the interrupted state. The first-end-final guard is gone. Codex sends one completion per turn, the only redelivery Orca has is the retry of a refused frame (which changes nothing), and the settlement id already keeps the first record in the queue and the journal. * refactor(codex): delete the unreachable oversized-notification settlement The translator settled a streamed item when the transport rejected its notification as oversized. Nothing can produce that frame. The Codex stdio reader frames with `maxLineBytes: Number.POSITIVE_INFINITY` (codex-app-server-record-reader.ts), which it has done since the app-server records were uncapped. With an infinite limit the framer never reports `line-too-long`: no line, pending suffix or paused queue can exceed it. So the dispatcher never emits `frame:oversized-notification`, and the arm that settles it never runs. The arm, its helper module and its test go. In place of the test, the connection test now proves the reason: a notification past the old 16 MiB wire limit arrives whole, and no oversized frame is reported. * test(codex): replace the captured ids in the turn-endings fixture with synthetic ones The replay reads ids only to group frames, so the real thread, turn and response ids from the capture account carry nothing the test needs. The fixture moves beside the Codex tests that read it. * test(codex): use a neutral made-up status as the unknown-status example 'cancelled' read as a stop being recorded as a completion. * test(codex): a restored turn with a status Orca cannot place ends with no verdict Codex's history carries the same status field as the live completion, so the restore path is pinned to the same mapping: completed, and no outcome. --- .../codex-app-server-turn-endings.jsonl | 172 +++++++++++++++ .../codex/codex-app-server-connection.test.ts | 30 +++ ...ex-structured-journal-provider-verdicts.ts | 40 ---- .../codex-structured-journal-settlement.ts | 76 ------- ...x-structured-journal-translation-frames.ts | 68 ------ ...ctured-journal-translation-streams.test.ts | 49 ----- ...red-journal-translation-turn-boundaries.ts | 58 +---- ...journal-translation-turn-lifecycle.test.ts | 63 +++++- ...rnal-translation-turn-settles-once.test.ts | 135 ++++++++++-- ...ructured-journal-translation-turn-state.ts | 13 +- ...ex-structured-journal-translation-turns.ts | 6 +- ...-structured-journal-translation-writers.ts | 4 +- ...dex-structured-journal-translation.test.ts | 51 ++--- .../codex-structured-journal-translation.ts | 38 +--- ...ctured-journal-turn-endings-replay.test.ts | 206 ++++++++++++++++++ ...-journal-turn-settles-once-journal.test.ts | 56 ++++- .../codex/codex-structured-thread-facts.ts | 6 - ...ructured-agent-session-event-sink-queue.ts | 7 +- ...tructured-agent-session-event-sink.test.ts | 26 +++ .../structured-agent-session-event-sink.ts | 1 + 20 files changed, 696 insertions(+), 409 deletions(-) create mode 100644 src/main/codex/__fixtures__/codex-app-server-turn-endings.jsonl delete mode 100644 src/main/codex/codex-structured-journal-provider-verdicts.ts delete mode 100644 src/main/codex/codex-structured-journal-translation-frames.ts create mode 100644 src/main/codex/codex-structured-journal-turn-endings-replay.test.ts diff --git a/src/main/codex/__fixtures__/codex-app-server-turn-endings.jsonl b/src/main/codex/__fixtures__/codex-app-server-turn-endings.jsonl new file mode 100644 index 000000000000..7889b24d1130 --- /dev/null +++ b/src/main/codex/__fixtures__/codex-app-server-turn-endings.jsonl @@ -0,0 +1,172 @@ +{"case":"0.141.0-bad-model","t":371,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000001","status":{"type":"active"}}} +{"case":"0.141.0-bad-model","t":371,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000001","turn":{"id":"00000000-0000-7000-8000-000000000002","status":"inProgress"}}} +{"case":"0.141.0-bad-model","t":1745,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000001","turnId":"00000000-0000-7000-8000-000000000002","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000003","clientId":null,"content":[]}}} +{"case":"0.141.0-bad-model","t":1745,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000001","turnId":"00000000-0000-7000-8000-000000000002","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000003","clientId":null,"content":[]}}} +{"case":"0.141.0-bad-model","t":2831,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000001","status":{"type":"systemError"}}} +{"case":"0.141.0-bad-model","t":2831,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000001","turnId":"00000000-0000-7000-8000-000000000002","willRetry":false,"error":{"message":"{\"type\":\"error\",\"status\":400,\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The 'gpt-qa-nonexistent' model is not supported when using Codex with a ChatGPT account.\"}}","codexErrorInfo":"other"}}} +{"case":"0.141.0-bad-model","t":2831,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000001","turn":{"id":"00000000-0000-7000-8000-000000000002","status":"failed","error":{"message":"{\"type\":\"error\",\"status\":400,\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The 'gpt-qa-nonexistent' model is not supported when using Codex with a ChatGPT account.\"}}","codexErrorInfo":"other"},"durationMs":2488}}} +{"case":"0.141.0-bad-turn-cwd","t":1458,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000004","status":{"type":"active"}}} +{"case":"0.141.0-bad-turn-cwd","t":1458,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000004","turn":{"id":"00000000-0000-7000-8000-000000000005","status":"inProgress"}}} +{"case":"0.141.0-bad-turn-cwd","t":5792,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000004","turnId":"00000000-0000-7000-8000-000000000005","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000006","clientId":null,"content":[]}}} +{"case":"0.141.0-bad-turn-cwd","t":5792,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000004","turnId":"00000000-0000-7000-8000-000000000005","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000006","clientId":null,"content":[]}}} +{"case":"0.141.0-bad-turn-cwd","t":7645,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000004","turnId":"00000000-0000-7000-8000-000000000005","item":{"type":"agentMessage","id":"msg_1","text":""}}} +{"case":"0.141.0-bad-turn-cwd","t":7938,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000004","turnId":"00000000-0000-7000-8000-000000000005","item":{"type":"agentMessage","id":"msg_1","text":"pong"}}} +{"case":"0.141.0-bad-turn-cwd","t":7959,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000004","status":{"type":"idle"}}} +{"case":"0.141.0-bad-turn-cwd","t":7959,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000004","turn":{"id":"00000000-0000-7000-8000-000000000005","status":"completed","durationMs":6532}}} +{"case":"0.141.0-compact-overloaded","t":582,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000007","status":{"type":"active"}}} +{"case":"0.141.0-compact-overloaded","t":582,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000007","turn":{"id":"00000000-0000-7000-8000-000000000008","status":"inProgress"}}} +{"case":"0.141.0-compact-overloaded","t":2940,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000007","turnId":"00000000-0000-7000-8000-000000000008","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000009","clientId":null,"content":[]}}} +{"case":"0.141.0-compact-overloaded","t":2940,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000007","turnId":"00000000-0000-7000-8000-000000000008","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000009","clientId":null,"content":[]}}} +{"case":"0.141.0-compact-overloaded","t":3011,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000007","turnId":"00000000-0000-7000-8000-000000000008","item":{"type":"agentMessage","id":"msg_ok","text":"pong"}}} +{"case":"0.141.0-compact-overloaded","t":3011,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000007","turnId":"00000000-0000-7000-8000-000000000008","item":{"type":"agentMessage","id":"msg_ok","text":"pong"}}} +{"case":"0.141.0-compact-overloaded","t":3017,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000007","status":{"type":"idle"}}} +{"case":"0.141.0-compact-overloaded","t":3017,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000007","turn":{"id":"00000000-0000-7000-8000-000000000008","status":"completed","durationMs":2474}}} +{"case":"0.141.0-compact-overloaded","t":3076,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000007","status":{"type":"active"}}} +{"case":"0.141.0-compact-overloaded","t":3076,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000007","turn":{"id":"00000000-0000-7000-8000-000000000010","status":"inProgress"}}} +{"case":"0.141.0-compact-overloaded","t":3081,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000007","turnId":"00000000-0000-7000-8000-000000000010","item":{"type":"contextCompaction","id":"00000000-0000-7000-8000-000000000011"}}} +{"case":"0.141.0-compact-overloaded","t":3684,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000007","turnId":"00000000-0000-7000-8000-000000000010","willRetry":true,"error":{"message":"Reconnecting... 1/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Selected model is at capacity. Please try a different model."}}} +{"case":"0.141.0-compact-overloaded","t":4508,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000007","turnId":"00000000-0000-7000-8000-000000000010","willRetry":true,"error":{"message":"Reconnecting... 2/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Selected model is at capacity. Please try a different model."}}} +{"case":"0.141.0-compact-overloaded","t":5511,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000007","status":{"type":"systemError"}}} +{"case":"0.141.0-compact-overloaded","t":5511,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000007","turnId":"00000000-0000-7000-8000-000000000010","willRetry":false,"error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"}}} +{"case":"0.141.0-compact-overloaded","t":5511,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000007","turn":{"id":"00000000-0000-7000-8000-000000000010","status":"failed","error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"},"durationMs":2435}}} +{"case":"0.141.0-conn-refused","t":588,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000012","status":{"type":"active"}}} +{"case":"0.141.0-conn-refused","t":588,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000012","turn":{"id":"00000000-0000-7000-8000-000000000013","status":"inProgress"}}} +{"case":"0.141.0-conn-refused","t":700,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000012","turnId":"00000000-0000-7000-8000-000000000013","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000014","clientId":null,"content":[]}}} +{"case":"0.141.0-conn-refused","t":700,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000012","turnId":"00000000-0000-7000-8000-000000000013","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000014","clientId":null,"content":[]}}} +{"case":"0.141.0-conn-refused","t":1354,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000012","turnId":"00000000-0000-7000-8000-000000000013","willRetry":true,"error":{"message":"Reconnecting... 1/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"stream disconnected before completion: error sending request for url (http://127.0.0.1:9/v1/responses)"}}} +{"case":"0.141.0-conn-refused","t":2134,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000012","turnId":"00000000-0000-7000-8000-000000000013","willRetry":true,"error":{"message":"Reconnecting... 2/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"stream disconnected before completion: error sending request for url (http://127.0.0.1:9/v1/responses)"}}} +{"case":"0.141.0-conn-refused","t":3116,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000012","status":{"type":"systemError"}}} +{"case":"0.141.0-conn-refused","t":3116,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000012","turnId":"00000000-0000-7000-8000-000000000013","willRetry":false,"error":{"message":"stream disconnected before completion: error sending request for url (http://127.0.0.1:9/v1/responses)","codexErrorInfo":"other"}}} +{"case":"0.141.0-conn-refused","t":3116,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000012","turn":{"id":"00000000-0000-7000-8000-000000000013","status":"failed","error":{"message":"stream disconnected before completion: error sending request for url (http://127.0.0.1:9/v1/responses)","codexErrorInfo":"other"},"durationMs":2556}}} +{"case":"0.141.0-control","t":487,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000015","status":{"type":"active"}}} +{"case":"0.141.0-control","t":487,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000015","turn":{"id":"00000000-0000-7000-8000-000000000016","status":"inProgress"}}} +{"case":"0.141.0-control","t":2657,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000015","turnId":"00000000-0000-7000-8000-000000000016","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000017","clientId":null,"content":[]}}} +{"case":"0.141.0-control","t":2657,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000015","turnId":"00000000-0000-7000-8000-000000000016","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000017","clientId":null,"content":[]}}} +{"case":"0.141.0-control","t":4651,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000015","turnId":"00000000-0000-7000-8000-000000000016","item":{"type":"agentMessage","id":"msg_2","text":""}}} +{"case":"0.141.0-control","t":4661,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000015","turnId":"00000000-0000-7000-8000-000000000016","item":{"type":"agentMessage","id":"msg_2","text":"pong"}}} +{"case":"0.141.0-control","t":4811,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000015","status":{"type":"idle"}}} +{"case":"0.141.0-control","t":4811,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000015","turn":{"id":"00000000-0000-7000-8000-000000000016","status":"completed","durationMs":4351}}} +{"case":"0.141.0-interrupt","t":670,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000018","status":{"type":"active"}}} +{"case":"0.141.0-interrupt","t":670,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000018","turn":{"id":"00000000-0000-7000-8000-000000000019","status":"inProgress"}}} +{"case":"0.141.0-interrupt","t":2618,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000018","turnId":"00000000-0000-7000-8000-000000000019","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000020","clientId":null,"content":[]}}} +{"case":"0.141.0-interrupt","t":2618,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000018","turnId":"00000000-0000-7000-8000-000000000019","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000020","clientId":null,"content":[]}}} +{"case":"0.141.0-interrupt","t":4153,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000018","turnId":"00000000-0000-7000-8000-000000000019","item":{"type":"agentMessage","id":"msg_3","text":""}}} +{"case":"0.141.0-interrupt","t":5669,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000018","status":{"type":"idle"}}} +{"case":"0.141.0-interrupt","t":5669,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000018","turn":{"id":"00000000-0000-7000-8000-000000000019","status":"interrupted","durationMs":5027}}} +{"case":"0.141.0-model-too-new-a","t":1276,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000021","status":{"type":"active"}}} +{"case":"0.141.0-model-too-new-a","t":1276,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000021","turn":{"id":"00000000-0000-7000-8000-000000000022","status":"inProgress"}}} +{"case":"0.141.0-model-too-new-a","t":6105,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000021","turnId":"00000000-0000-7000-8000-000000000022","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000023","clientId":null,"content":[]}}} +{"case":"0.141.0-model-too-new-a","t":6105,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000021","turnId":"00000000-0000-7000-8000-000000000022","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000023","clientId":null,"content":[]}}} +{"case":"0.141.0-model-too-new-a","t":7424,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000021","status":{"type":"systemError"}}} +{"case":"0.141.0-model-too-new-a","t":7424,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000021","turnId":"00000000-0000-7000-8000-000000000022","willRetry":false,"error":{"message":"{\"type\":\"error\",\"status\":400,\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The 'gpt-6-astra' model requires a newer version of Codex. Please upgrade to the latest app or CLI and try again.\"}}","codexErrorInfo":"other"}}} +{"case":"0.141.0-model-too-new-a","t":7424,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000021","turn":{"id":"00000000-0000-7000-8000-000000000022","status":"failed","error":{"message":"{\"type\":\"error\",\"status\":400,\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The 'gpt-6-astra' model requires a newer version of Codex. Please upgrade to the latest app or CLI and try again.\"}}","codexErrorInfo":"other"},"durationMs":6195}}} +{"case":"0.141.0-model-too-new-b","t":387,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000024","status":{"type":"active"}}} +{"case":"0.141.0-model-too-new-b","t":387,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000024","turn":{"id":"00000000-0000-7000-8000-000000000025","status":"inProgress"}}} +{"case":"0.141.0-model-too-new-b","t":1162,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000024","turnId":"00000000-0000-7000-8000-000000000025","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000026","clientId":null,"content":[]}}} +{"case":"0.141.0-model-too-new-b","t":1162,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000024","turnId":"00000000-0000-7000-8000-000000000025","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000026","clientId":null,"content":[]}}} +{"case":"0.141.0-model-too-new-b","t":1993,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000024","status":{"type":"systemError"}}} +{"case":"0.141.0-model-too-new-b","t":1993,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000024","turnId":"00000000-0000-7000-8000-000000000025","willRetry":false,"error":{"message":"{\"type\":\"error\",\"status\":400,\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The 'gpt-6-astra' model requires a newer version of Codex. Please upgrade to the latest app or CLI and try again.\"}}","codexErrorInfo":"other"}}} +{"case":"0.141.0-model-too-new-b","t":1993,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000024","turn":{"id":"00000000-0000-7000-8000-000000000025","status":"failed","error":{"message":"{\"type\":\"error\",\"status\":400,\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The 'gpt-6-astra' model requires a newer version of Codex. Please upgrade to the latest app or CLI and try again.\"}}","codexErrorInfo":"other"},"durationMs":1633}}} +{"case":"0.141.0-overloaded-503","t":407,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000027","status":{"type":"active"}}} +{"case":"0.141.0-overloaded-503","t":407,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000027","turn":{"id":"00000000-0000-7000-8000-000000000028","status":"inProgress"}}} +{"case":"0.141.0-overloaded-503","t":574,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000027","turnId":"00000000-0000-7000-8000-000000000028","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000029","clientId":null,"content":[]}}} +{"case":"0.141.0-overloaded-503","t":574,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000027","turnId":"00000000-0000-7000-8000-000000000028","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000029","clientId":null,"content":[]}}} +{"case":"0.141.0-overloaded-503","t":1296,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000027","status":{"type":"systemError"}}} +{"case":"0.141.0-overloaded-503","t":1296,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000027","turnId":"00000000-0000-7000-8000-000000000028","willRetry":false,"error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"}}} +{"case":"0.141.0-overloaded-503","t":1296,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000027","turn":{"id":"00000000-0000-7000-8000-000000000028","status":"failed","error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"},"durationMs":921}}} +{"case":"0.141.0-overloaded-sse","t":510,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000030","status":{"type":"active"}}} +{"case":"0.141.0-overloaded-sse","t":510,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000030","turn":{"id":"00000000-0000-7000-8000-000000000031","status":"inProgress"}}} +{"case":"0.141.0-overloaded-sse","t":611,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000030","turnId":"00000000-0000-7000-8000-000000000031","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000032","clientId":null,"content":[]}}} +{"case":"0.141.0-overloaded-sse","t":611,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000030","turnId":"00000000-0000-7000-8000-000000000031","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000032","clientId":null,"content":[]}}} +{"case":"0.141.0-overloaded-sse","t":695,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000030","status":{"type":"systemError"}}} +{"case":"0.141.0-overloaded-sse","t":695,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000030","turnId":"00000000-0000-7000-8000-000000000031","willRetry":false,"error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"}}} +{"case":"0.141.0-overloaded-sse","t":695,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000030","turn":{"id":"00000000-0000-7000-8000-000000000031","status":"failed","error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"},"durationMs":213}}} +{"case":"0.141.0-stream-drop","t":510,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000033","status":{"type":"active"}}} +{"case":"0.141.0-stream-drop","t":510,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000033","turn":{"id":"00000000-0000-7000-8000-000000000034","status":"inProgress"}}} +{"case":"0.141.0-stream-drop","t":621,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000033","turnId":"00000000-0000-7000-8000-000000000034","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000035","clientId":null,"content":[]}}} +{"case":"0.141.0-stream-drop","t":621,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000033","turnId":"00000000-0000-7000-8000-000000000034","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000035","clientId":null,"content":[]}}} +{"case":"0.141.0-stream-drop","t":740,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000033","turnId":"00000000-0000-7000-8000-000000000034","willRetry":true,"error":{"message":"Reconnecting... 1/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"stream disconnected before completion: stream closed before response.completed"}}} +{"case":"0.141.0-stream-drop","t":942,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000033","turnId":"00000000-0000-7000-8000-000000000034","willRetry":true,"error":{"message":"Reconnecting... 2/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"stream disconnected before completion: stream closed before response.completed"}}} +{"case":"0.141.0-stream-drop","t":1320,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000033","status":{"type":"systemError"}}} +{"case":"0.141.0-stream-drop","t":1320,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000033","turnId":"00000000-0000-7000-8000-000000000034","willRetry":false,"error":{"message":"stream disconnected before completion: stream closed before response.completed","codexErrorInfo":"other"}}} +{"case":"0.141.0-stream-drop","t":1320,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000033","turn":{"id":"00000000-0000-7000-8000-000000000034","status":"failed","error":{"message":"stream disconnected before completion: stream closed before response.completed","codexErrorInfo":"other"},"durationMs":838}}} +{"case":"0.158.0-bad-model","t":1232,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000036","status":{"type":"active"}}} +{"case":"0.158.0-bad-model","t":1232,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000036","turn":{"id":"00000000-0000-7000-8000-000000000037","status":"inProgress"}}} +{"case":"0.158.0-bad-model","t":7177,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000036","turnId":"00000000-0000-7000-8000-000000000037","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000038","clientId":null,"content":[]}}} +{"case":"0.158.0-bad-model","t":7215,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000036","turnId":"00000000-0000-7000-8000-000000000037","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000038","clientId":null,"content":[]}}} +{"case":"0.158.0-bad-model","t":8236,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000036","status":{"type":"systemError"}}} +{"case":"0.158.0-bad-model","t":8236,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000036","turnId":"00000000-0000-7000-8000-000000000037","willRetry":false,"error":{"message":"{\"type\":\"error\",\"status\":400,\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The 'gpt-qa-nonexistent' model is not supported when using Codex with a ChatGPT account.\"}}","codexErrorInfo":"other"}}} +{"case":"0.158.0-bad-model","t":8257,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000036","turn":{"id":"00000000-0000-7000-8000-000000000037","status":"failed","error":{"message":"{\"type\":\"error\",\"status\":400,\"error\":{\"type\":\"invalid_request_error\",\"message\":\"The 'gpt-qa-nonexistent' model is not supported when using Codex with a ChatGPT account.\"}}","codexErrorInfo":"other"},"durationMs":7576}}} +{"case":"0.158.0-bad-turn-cwd","t":4437,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000039","status":{"type":"active"}}} +{"case":"0.158.0-bad-turn-cwd","t":4438,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000039","turn":{"id":"00000000-0000-7000-8000-000000000040","status":"inProgress"}}} +{"case":"0.158.0-bad-turn-cwd","t":7840,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000039","turnId":"00000000-0000-7000-8000-000000000040","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000041","clientId":null,"content":[]}}} +{"case":"0.158.0-bad-turn-cwd","t":7851,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000039","turnId":"00000000-0000-7000-8000-000000000040","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000041","clientId":null,"content":[]}}} +{"case":"0.158.0-bad-turn-cwd","t":9220,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000039","turnId":"00000000-0000-7000-8000-000000000040","item":{"type":"agentMessage","id":"msg_4","text":""}}} +{"case":"0.158.0-bad-turn-cwd","t":9421,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000039","turnId":"00000000-0000-7000-8000-000000000040","item":{"type":"agentMessage","id":"msg_4","text":"pong"}}} +{"case":"0.158.0-bad-turn-cwd","t":9566,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000039","status":{"type":"idle"}}} +{"case":"0.158.0-bad-turn-cwd","t":9566,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000039","turn":{"id":"00000000-0000-7000-8000-000000000040","status":"completed","durationMs":5172}}} +{"case":"0.158.0-compact-overloaded","t":943,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000042","status":{"type":"active"}}} +{"case":"0.158.0-compact-overloaded","t":944,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000042","turn":{"id":"00000000-0000-7000-8000-000000000043","status":"inProgress"}}} +{"case":"0.158.0-compact-overloaded","t":5760,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000042","turnId":"00000000-0000-7000-8000-000000000043","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000044","clientId":null,"content":[]}}} +{"case":"0.158.0-compact-overloaded","t":5765,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000042","turnId":"00000000-0000-7000-8000-000000000043","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000044","clientId":null,"content":[]}}} +{"case":"0.158.0-compact-overloaded","t":5770,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000042","turnId":"00000000-0000-7000-8000-000000000043","item":{"type":"agentMessage","id":"msg_ok","text":"pong"}}} +{"case":"0.158.0-compact-overloaded","t":5771,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000042","turnId":"00000000-0000-7000-8000-000000000043","item":{"type":"agentMessage","id":"msg_ok","text":"pong"}}} +{"case":"0.158.0-compact-overloaded","t":5795,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000042","status":{"type":"idle"}}} +{"case":"0.158.0-compact-overloaded","t":5795,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000042","turn":{"id":"00000000-0000-7000-8000-000000000043","status":"completed","durationMs":4899}}} +{"case":"0.158.0-compact-overloaded","t":5820,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000042","status":{"type":"active"}}} +{"case":"0.158.0-compact-overloaded","t":5820,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000042","turn":{"id":"00000000-0000-7000-8000-000000000045","status":"inProgress"}}} +{"case":"0.158.0-compact-overloaded","t":5821,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000042","turnId":"00000000-0000-7000-8000-000000000045","item":{"type":"contextCompaction","id":"00000000-0000-7000-8000-000000000046"}}} +{"case":"0.158.0-compact-overloaded","t":6421,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000042","turnId":"00000000-0000-7000-8000-000000000045","willRetry":true,"error":{"message":"Reconnecting... 1/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Selected model is at capacity. Please try a different model."}}} +{"case":"0.158.0-compact-overloaded","t":7232,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000042","turnId":"00000000-0000-7000-8000-000000000045","willRetry":true,"error":{"message":"Reconnecting... 2/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Selected model is at capacity. Please try a different model."}}} +{"case":"0.158.0-compact-overloaded","t":8204,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000042","status":{"type":"systemError"}}} +{"case":"0.158.0-compact-overloaded","t":8204,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000042","turnId":"00000000-0000-7000-8000-000000000045","willRetry":false,"error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"}}} +{"case":"0.158.0-compact-overloaded","t":8207,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000042","turn":{"id":"00000000-0000-7000-8000-000000000045","status":"failed","error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"},"durationMs":2388}}} +{"case":"0.158.0-conn-refused","t":1343,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000047","status":{"type":"active"}}} +{"case":"0.158.0-conn-refused","t":1343,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000047","turn":{"id":"00000000-0000-7000-8000-000000000048","status":"inProgress"}}} +{"case":"0.158.0-conn-refused","t":2002,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000047","turnId":"00000000-0000-7000-8000-000000000048","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000049","clientId":null,"content":[]}}} +{"case":"0.158.0-conn-refused","t":2013,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000047","turnId":"00000000-0000-7000-8000-000000000048","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000049","clientId":null,"content":[]}}} +{"case":"0.158.0-conn-refused","t":2616,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000047","turnId":"00000000-0000-7000-8000-000000000048","willRetry":true,"error":{"message":"Reconnecting... waiting for network","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Connection failed: error sending request"}}} +{"case":"0.158.0-conn-refused","t":8185,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000047","turnId":"00000000-0000-7000-8000-000000000048","willRetry":true,"error":{"message":"Reconnecting... waiting for network","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Connection failed: error sending request"}}} +{"case":"0.158.0-conn-refused","t":18778,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000047","turnId":"00000000-0000-7000-8000-000000000048","willRetry":true,"error":{"message":"Reconnecting... waiting for network","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Connection failed: error sending request"}}} +{"case":"0.158.0-conn-refused","t":39406,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000047","turnId":"00000000-0000-7000-8000-000000000048","willRetry":true,"error":{"message":"Reconnecting... waiting for network","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Connection failed: error sending request"}}} +{"case":"0.158.0-conn-refused","t":79975,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000047","turnId":"00000000-0000-7000-8000-000000000048","willRetry":true,"error":{"message":"Reconnecting... waiting for network","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Connection failed: error sending request"}}} +{"case":"0.158.0-conn-refused","t":140587,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000047","turnId":"00000000-0000-7000-8000-000000000048","willRetry":true,"error":{"message":"Reconnecting... waiting for network","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Connection failed: error sending request"}}} +{"case":"0.158.0-conn-refused","t":201225,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000047","turnId":"00000000-0000-7000-8000-000000000048","willRetry":true,"error":{"message":"Reconnecting... waiting for network","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"Connection failed: error sending request"}}} +{"case":"0.158.0-control","t":3620,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000050","status":{"type":"active"}}} +{"case":"0.158.0-control","t":3621,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000050","turn":{"id":"00000000-0000-7000-8000-000000000051","status":"inProgress"}}} +{"case":"0.158.0-control","t":5019,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000050","turnId":"00000000-0000-7000-8000-000000000051","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000052","clientId":null,"content":[]}}} +{"case":"0.158.0-control","t":5254,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000050","turnId":"00000000-0000-7000-8000-000000000051","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000052","clientId":null,"content":[]}}} +{"case":"0.158.0-control","t":7276,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000050","turnId":"00000000-0000-7000-8000-000000000051","item":{"type":"agentMessage","id":"msg_5","text":""}}} +{"case":"0.158.0-control","t":7480,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000050","turnId":"00000000-0000-7000-8000-000000000051","item":{"type":"agentMessage","id":"msg_5","text":"pong"}}} +{"case":"0.158.0-control","t":7659,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000050","status":{"type":"idle"}}} +{"case":"0.158.0-control","t":7659,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000050","turn":{"id":"00000000-0000-7000-8000-000000000051","status":"completed","durationMs":4520}}} +{"case":"0.158.0-interrupt","t":929,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000053","status":{"type":"active"}}} +{"case":"0.158.0-interrupt","t":929,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000053","turn":{"id":"00000000-0000-7000-8000-000000000054","status":"inProgress"}}} +{"case":"0.158.0-interrupt","t":2320,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000053","turnId":"00000000-0000-7000-8000-000000000054","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000055","clientId":null,"content":[]}}} +{"case":"0.158.0-interrupt","t":2325,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000053","turnId":"00000000-0000-7000-8000-000000000054","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000055","clientId":null,"content":[]}}} +{"case":"0.158.0-interrupt","t":4063,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000053","turnId":"00000000-0000-7000-8000-000000000054","item":{"type":"agentMessage","id":"msg_6","text":""}}} +{"case":"0.158.0-interrupt","t":5582,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000053","status":{"type":"idle"}}} +{"case":"0.158.0-interrupt","t":5582,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000053","turn":{"id":"00000000-0000-7000-8000-000000000054","status":"interrupted","durationMs":4711}}} +{"case":"0.158.0-overloaded-503","t":455,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000056","status":{"type":"active"}}} +{"case":"0.158.0-overloaded-503","t":455,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000056","turn":{"id":"00000000-0000-7000-8000-000000000057","status":"inProgress"}}} +{"case":"0.158.0-overloaded-503","t":1114,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000056","turnId":"00000000-0000-7000-8000-000000000057","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000058","clientId":null,"content":[]}}} +{"case":"0.158.0-overloaded-503","t":1131,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000056","turnId":"00000000-0000-7000-8000-000000000057","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000058","clientId":null,"content":[]}}} +{"case":"0.158.0-overloaded-503","t":1722,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000056","status":{"type":"systemError"}}} +{"case":"0.158.0-overloaded-503","t":1722,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000056","turnId":"00000000-0000-7000-8000-000000000057","willRetry":false,"error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"}}} +{"case":"0.158.0-overloaded-503","t":1753,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000056","turn":{"id":"00000000-0000-7000-8000-000000000057","status":"failed","error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"},"durationMs":1302}}} +{"case":"0.158.0-overloaded-sse","t":944,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000059","status":{"type":"active"}}} +{"case":"0.158.0-overloaded-sse","t":944,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000059","turn":{"id":"00000000-0000-7000-8000-000000000060","status":"inProgress"}}} +{"case":"0.158.0-overloaded-sse","t":1196,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000059","turnId":"00000000-0000-7000-8000-000000000060","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000061","clientId":null,"content":[]}}} +{"case":"0.158.0-overloaded-sse","t":1199,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000059","turnId":"00000000-0000-7000-8000-000000000060","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000061","clientId":null,"content":[]}}} +{"case":"0.158.0-overloaded-sse","t":1204,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000059","status":{"type":"systemError"}}} +{"case":"0.158.0-overloaded-sse","t":1204,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000059","turnId":"00000000-0000-7000-8000-000000000060","willRetry":false,"error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"}}} +{"case":"0.158.0-overloaded-sse","t":1206,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000059","turn":{"id":"00000000-0000-7000-8000-000000000060","status":"failed","error":{"message":"Selected model is at capacity. Please try a different model.","codexErrorInfo":"serverOverloaded"},"durationMs":481}}} +{"case":"0.158.0-stream-drop","t":1136,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000062","status":{"type":"active"}}} +{"case":"0.158.0-stream-drop","t":1136,"method":"turn/started","params":{"threadId":"00000000-0000-7000-8000-000000000062","turn":{"id":"00000000-0000-7000-8000-000000000063","status":"inProgress"}}} +{"case":"0.158.0-stream-drop","t":1721,"method":"item/started","params":{"threadId":"00000000-0000-7000-8000-000000000062","turnId":"00000000-0000-7000-8000-000000000063","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000064","clientId":null,"content":[]}}} +{"case":"0.158.0-stream-drop","t":1733,"method":"item/completed","params":{"threadId":"00000000-0000-7000-8000-000000000062","turnId":"00000000-0000-7000-8000-000000000063","item":{"type":"userMessage","id":"00000000-0000-7000-8000-000000000064","clientId":null,"content":[]}}} +{"case":"0.158.0-stream-drop","t":1738,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000062","turnId":"00000000-0000-7000-8000-000000000063","willRetry":true,"error":{"message":"Reconnecting... 1/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"stream disconnected before completion: stream closed before response.completed"}}} +{"case":"0.158.0-stream-drop","t":1959,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000062","turnId":"00000000-0000-7000-8000-000000000063","willRetry":true,"error":{"message":"Reconnecting... 2/2","codexErrorInfo":{"responseStreamDisconnected":{"httpStatusCode":null}},"additionalDetails":"stream disconnected before completion: stream closed before response.completed"}}} +{"case":"0.158.0-stream-drop","t":2514,"method":"thread/status/changed","params":{"threadId":"00000000-0000-7000-8000-000000000062","status":{"type":"systemError"}}} +{"case":"0.158.0-stream-drop","t":2514,"method":"error","params":{"threadId":"00000000-0000-7000-8000-000000000062","turnId":"00000000-0000-7000-8000-000000000063","willRetry":false,"error":{"message":"stream disconnected before completion: stream closed before response.completed","codexErrorInfo":"other"}}} +{"case":"0.158.0-stream-drop","t":2546,"method":"turn/completed","params":{"threadId":"00000000-0000-7000-8000-000000000062","turn":{"id":"00000000-0000-7000-8000-000000000063","status":"failed","error":{"message":"stream disconnected before completion: stream closed before response.completed","codexErrorInfo":"other"},"durationMs":1761}}} diff --git a/src/main/codex/codex-app-server-connection.test.ts b/src/main/codex/codex-app-server-connection.test.ts index 7fe63c6e4180..a4ebd72cf014 100644 --- a/src/main/codex/codex-app-server-connection.test.ts +++ b/src/main/codex/codex-app-server-connection.test.ts @@ -583,6 +583,36 @@ describe('openCodexAppServerConnection', () => { await connection.close() }) + it('delivers a notification beyond the daemon wire limit whole, never as an oversized frame', async () => { + const { child, spawnImpl } = stubChild() + answerInitialize(child) + const frames: string[] = [] + const deltas: unknown[] = [] + const connection = await openCodexAppServerConnection( + { command: 'codex', args: ['app-server'] }, + { + onUnhandledFrame: (kind) => frames.push(kind), + onNotification: (method, params) => { + if (method === 'item/commandExecution/outputDelta') { + deltas.push(params) + } + } + }, + spawnImpl + ) + + const params = { threadId: 'thread-1', itemId: 'exec-1', delta: '' } + params.delta = 'x'.repeat(16 * 1024 * 1024 + 1) + child.stdout.write( + `${JSON.stringify({ method: 'item/commandExecution/outputDelta', params })}\n` + ) + + await vi.waitFor(() => expect(deltas).toEqual([params])) + expect(frames).toEqual([]) + expect(connection.closed).toBe(false) + await connection.close() + }) + it('keeps malformed and non-object JSON non-fatal and processes the next record', async () => { const { child, spawnImpl } = stubChild() answerInitialize(child) diff --git a/src/main/codex/codex-structured-journal-provider-verdicts.ts b/src/main/codex/codex-structured-journal-provider-verdicts.ts deleted file mode 100644 index c8685dfedab9..000000000000 --- a/src/main/codex/codex-structured-journal-provider-verdicts.ts +++ /dev/null @@ -1,40 +0,0 @@ -// What Codex's own verdict frames mean beyond the row they print. -// -// Both are decoration to the transcript and load-bearing to the session's state, -// which is why they are read here rather than left to the generic-frame fallback. - -import { codexThreadStoppedRunning, readCodexErrorWillRetry } from './codex-structured-thread-facts' - -export type CodexProviderVerdict = - /** - * Codex ended this turn with a fault. - * - * The app server emits `error` ONLY for a failure that affects turn status, and - * hardcodes `willRetry: false` there; a stream error it is about to retry carries - * `willRetry: true` and ends nothing. `turn/completed` may never follow, so this - * frame is the turn's only end — without it the running lifecycle row is a latch - * nothing re-derives and the chat reads working for the life of the session. - */ - | 'turn-failed' - /** - * Codex reports the thread is no longer running. - * - * This settles no OPEN turn: the app server clears `running` on every error, - * including the ones it says do not affect turn status, so a turn still open - * here is still running and `turn/completed` is its end. What it does settle is - * a send whose dispatch was never answered — a timed-out dispatch is recorded - * as unverified delivery, reads as work still owed, and nothing else in a live - * session re-derives it. - */ - | 'thread-stopped-running' - | null - -export function readCodexProviderVerdict(method: string, params: unknown): CodexProviderVerdict { - if (method === 'error') { - return readCodexErrorWillRetry(params) ? null : 'turn-failed' - } - if (method === 'thread/status/changed') { - return codexThreadStoppedRunning(params) ? 'thread-stopped-running' : null - } - return null -} diff --git a/src/main/codex/codex-structured-journal-settlement.ts b/src/main/codex/codex-structured-journal-settlement.ts index e2164b9498dd..39d52e6b0475 100644 --- a/src/main/codex/codex-structured-journal-settlement.ts +++ b/src/main/codex/codex-structured-journal-settlement.ts @@ -174,82 +174,6 @@ export function settleCodexJournalTurn(input: { return ADMITTED } -/** Settle streamed items whose terminal notification was rejected as oversized. */ -export function settleCodexOversizedNotification(input: { - sessionId: string - threadId: string - method: string - sink: StructuredAgentSessionEventSink - streams: CodexStructuredItemStreams - activeItems: Map - linkageFor: CodexRowLinkage -}): StructuredAgentSessionSinkAdmission { - const itemType = oversizedStreamItemType(input.method) - if (!itemType) { - return ADMITTED - } - const mutations: JournalLifecycleMutationInput[] = [] - const activeItemsToForget: { key: string; threadId: string; itemId: string }[] = [] - for (const [key, active] of input.activeItems) { - if (active.threadId !== input.threadId || active.item.type !== itemType) { - continue - } - const streamed = input.streams.snapshot(active.threadId, active.item.id) - const translated = streamed - ? codexStreamingJournalItem(active.item, streamed.text) - : codexJournalItem(active.item) - const body = interruptedBody(translated.body) - if (body) { - mutations.push(settledRow(input.linkageFor, active, body)) - } - activeItemsToForget.push({ key, threadId: active.threadId, itemId: active.item.id }) - } - if (mutations.length === 0) { - return ADMITTED - } - const admission = appendCodexLifecycleMutations( - input.sink, - `oversized-notification:${input.sessionId}:${input.threadId}:${input.method}`, - mutations - ) - if (!admission.accepted) { - return admission - } - for (const active of activeItemsToForget) { - input.streams.forget(active.threadId, active.itemId) - input.activeItems.delete(active.key) - } - return ADMITTED -} - -function oversizedStreamItemType(method: string): CodexThreadItem['type'] | null { - if (method === 'item/agentMessage/delta') { - return 'agentMessage' - } - if (method === 'item/plan/delta') { - return 'plan' - } - if ( - method === 'command/exec/outputDelta' || - method === 'process/outputDelta' || - method === 'item/commandExecution/outputDelta' || - method === 'item/commandExecution/terminalInteraction' - ) { - return 'commandExecution' - } - if (method === 'item/fileChange/outputDelta' || method === 'item/fileChange/patchUpdated') { - return 'fileChange' - } - if ( - method === 'item/reasoning/summaryTextDelta' || - method === 'item/reasoning/summaryPartAdded' || - method === 'item/reasoning/textDelta' - ) { - return 'reasoning' - } - return null -} - /** A settled item or prompt, naming its producer: the settlement can be the row's first write. */ function settledRow( linkageFor: CodexRowLinkage, diff --git a/src/main/codex/codex-structured-journal-translation-frames.ts b/src/main/codex/codex-structured-journal-translation-frames.ts deleted file mode 100644 index f94c10bfe667..000000000000 --- a/src/main/codex/codex-structured-journal-translation-frames.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * The translator's provider-frame arms. - * - * Each returns null for a frame it does not own, which is the translator's - * signal to keep looking. Split out so the translator reads as routing rather - * than as the shape checks each arm performs. - */ - -import type { CodexStructuredSessionEvent } from './codex-structured-session-adapter' -import type { CodexJournalItems } from './codex-structured-journal-items' -import type { CodexJournalTranslationAdmission } from './codex-structured-journal-contracts' -import { settleCodexOversizedNotification } from './codex-structured-journal-settlement' -import { - readCodexJournalRecord, - readCodexJournalString -} from './codex-structured-journal-translation-values' - -type OversizedInput = Parameters[0] - -/** A notification the transport refused to carry whole: settle whatever it - * opened rather than leaving the item mid-flight. */ -export function settleCodexOversizedNotificationFrame(input: { - sessionId: string - threadId: string - kind: string - payload: unknown - sink: OversizedInput['sink'] - streams: OversizedInput['streams'] - activeItems: OversizedInput['activeItems'] - linkageFor: OversizedInput['linkageFor'] -}): CodexJournalTranslationAdmission | null { - if (input.kind !== 'frame:oversized-notification') { - return null - } - const method = readCodexJournalString(readCodexJournalRecord(input.payload), 'method') - return method - ? settleCodexOversizedNotification({ - sessionId: input.sessionId, - threadId: input.threadId, - method, - sink: input.sink, - streams: input.streams, - activeItems: input.activeItems, - linkageFor: input.linkageFor - }) - : null -} - -export function createCodexOversizedNotificationSettler( - deps: { sink: OversizedInput['sink']; linkageFor: OversizedInput['linkageFor'] }, - items: Pick -) { - return settleOversizedNotification - - /** Settles the item a notification the transport refused to carry left - * mid-flight; null when the frame is not one. */ - function settleOversizedNotification( - event: Extract - ): CodexJournalTranslationAdmission | null { - return settleCodexOversizedNotificationFrame({ - ...event, - sink: deps.sink, - streams: items.streams, - activeItems: items.activeItems, - linkageFor: deps.linkageFor - }) - } -} diff --git a/src/main/codex/codex-structured-journal-translation-streams.test.ts b/src/main/codex/codex-structured-journal-translation-streams.test.ts index 8a924a9d78ab..ce6fd220132f 100644 --- a/src/main/codex/codex-structured-journal-translation-streams.test.ts +++ b/src/main/codex/codex-structured-journal-translation-streams.test.ts @@ -215,55 +215,6 @@ describe('codex journal translation', () => { ).toEqual(['notification:future/notification', 'request:future/request', 'frame:unclassified']) }) - it('terminalizes the active streamed item when an oversized notification is rejected', () => { - const { translator, tap } = translatorWith() - translator.handle(TURN_STARTED) - translator.handle( - notification('item/started', { - item: { - type: 'commandExecution', - id: 'exec-oversized', - command: 'run', - status: 'inProgress' - } - }) - ) - const admission = translator.handle({ - type: 'provider-frame', - sessionId: SESSION_ID, - threadId: THREAD_ID, - kind: 'frame:oversized-notification', - payload: { - reason: 'record-too-large', - observedBytes: 20 * 1024 * 1024, - maxBytes: 16 * 1024 * 1024, - classification: 'notification', - method: 'item/commandExecution/outputDelta' - } - }) - - expect(admission).toEqual({ accepted: true }) - expect(tap.rows).toEqual([ - expect.objectContaining({ - body: expect.objectContaining({ kind: 'tool-call', state: 'running' }) - }), - expect.objectContaining({ - body: expect.objectContaining({ kind: 'tool-call', state: 'failed' }) - }), - expect.objectContaining({ - body: expect.objectContaining({ - kind: 'status', - providerFrame: expect.objectContaining({ kind: 'frame:oversized-notification' }) - }) - }) - ]) - const diagnostic = tap.rows[2]?.body - expect( - diagnostic?.kind === 'status' ? diagnostic.providerFrame?.payload.byteLength : 0 - ).toBeGreaterThan(0) - expect(JSON.stringify(diagnostic)).toContain('record-too-large') - }) - it('admits suppressed diagnostics before settling a completed turn', () => { const tap = recorder() let rejectSuppression = true diff --git a/src/main/codex/codex-structured-journal-translation-turn-boundaries.ts b/src/main/codex/codex-structured-journal-translation-turn-boundaries.ts index 2c958858816c..3116a329c97b 100644 --- a/src/main/codex/codex-structured-journal-translation-turn-boundaries.ts +++ b/src/main/codex/codex-structured-journal-translation-turn-boundaries.ts @@ -140,6 +140,8 @@ export class CodexJournalTurnBoundaries { return admission } + /** Codex ends every turn with exactly one `turn/completed`, a failed one after + * its `error` frame included, so this is the only live end. */ complete(event: TurnBoundaryEvent): CodexJournalTranslationAdmission { const suppressionAdmission = this.deps.flushSuppression() if (!suppressionAdmission.accepted) { @@ -154,58 +156,14 @@ export class CodexJournalTurnBoundaries { // turn boundary is no evidence contact was lost. Only `settleSession` may // write `unverifiable`. const status = readCodexTurnStatus(event.params) - return this.end(event, turnId, { - state: codexTurnLifecycleState(status), - outcome: codexTurnOutcome(status), - completedAt: this.receiptTime(event), - durationMs: readCodexTurnDurationMs(event.params) - }) - } - - /** - * Settles the turn a terminal `error` names. - * - * Codex reports a fault that ended a turn as an `error` notification carrying - * that turn's id, and `turn/completed` may never follow it — the app server - * marks the thread not-running off the error alone. Without this the running - * lifecycle row is a latch nothing re-derives, and the chat reads "Working" - * for the life of the session. A retrying stream error is NOT a turn end and - * never reaches here. - */ - fail(event: TurnBoundaryEvent): CodexJournalTranslationAdmission { - const suppressionAdmission = this.deps.flushSuppression() - if (!suppressionAdmission.accepted) { - return suppressionAdmission - } - const turnId = readCodexTurnId(event.params) ?? this.deps.activeTurns.current(event.threadId) - // An error ends only a turn this host saw open; its `turn/completed` settles any other. - if (!turnId || !this.deps.activeTurns.isActive(event.threadId, turnId)) { - return CODEX_JOURNAL_ADMITTED - } - return this.end(event, turnId, { - state: 'completed', - outcome: 'failure', - completedAt: this.receiptTime(event) - }) - } - - /** - * A turn's first terminal settlement is final. Codex follows a turn-ending - * `error` with a failed `turn/completed` for the same turn, and by then the - * start and attributed send this row carries are forgotten, so a second end - * could only overwrite the record with less. - */ - private end( - event: TurnBoundaryEvent, - turnId: string, - terminal: TurnTerminal - ): CodexJournalTranslationAdmission { - if (this.recentTurns.has(event.threadId, turnId)) { - return CODEX_JOURNAL_ADMITTED - } const turnLifecycle = event.threadId === this.deps.primaryThreadId() - ? this.settled(event.threadId, turnId, terminal) + ? this.settled(event.threadId, turnId, { + state: codexTurnLifecycleState(status), + outcome: codexTurnOutcome(status), + completedAt: this.receiptTime(event), + durationMs: readCodexTurnDurationMs(event.params) + }) : null const requestOrigin = this.deps.activeTurns.requestOrigin(event.threadId, turnId) const latestDispatchSequence = this.deps.activeTurns.latestDispatchSequence( diff --git a/src/main/codex/codex-structured-journal-translation-turn-lifecycle.test.ts b/src/main/codex/codex-structured-journal-translation-turn-lifecycle.test.ts index 6fc1e88d1840..62aa5f828a12 100644 --- a/src/main/codex/codex-structured-journal-translation-turn-lifecycle.test.ts +++ b/src/main/codex/codex-structured-journal-translation-turn-lifecycle.test.ts @@ -346,7 +346,7 @@ describe('codex turn lifecycle rows', () => { const lifecycle = reduced(tap.rows).find((row) => row.key === LIFECYCLE_KEY) expect(lifecycle?.body).toMatchObject({ kind: 'turn', - state: 'interrupted', + state: 'completed', outcome: 'failure', requestedAt: 900 }) @@ -381,17 +381,17 @@ describe('codex turn lifecycle rows', () => { }) // `TurnStatus` in the app-server protocol is `completed | interrupted | failed | - // inProgress`, and every one of those collapses to the same terminal lifecycle - // arm. `outcome` is what keeps a Codex failure distinguishable from a stop, and - // a status this build cannot place stays unknown rather than borrowing one. + // inProgress`. Only `interrupted` is a stop; every other end completed the + // turn, and `outcome` says how. A status this build cannot place stays unknown + // rather than borrowing a verdict. it.each([ - ['interrupted', 'cancellation'], - ['failed', 'failure'], - ['cancelled', undefined], - ['inProgress', undefined] + ['interrupted', 'interrupted', 'cancellation'], + ['failed', 'completed', 'failure'], + ['someFutureStatus', 'completed', undefined], + ['inProgress', 'completed', undefined] ] as const)( - 'maps a %s turn status to an interrupted lifecycle with outcome %s', - (status, outcome) => { + 'maps a %s turn status to a %s lifecycle with outcome %s', + (status, state, outcome) => { const tap = recorder() const translator = translatorFor(tap) @@ -405,7 +405,7 @@ describe('codex turn lifecycle rows', () => { body: { kind: 'turn', turnId: TURN_ID, - state: 'interrupted', + state, ...(outcome ? { outcome } : {}), userItemId: USER_ITEM_ID, startedAt: 1_000, @@ -512,6 +512,21 @@ describe('codex turn lifecycle rows', () => { completedAt: 1_700_000_101, items: [] }, + { + id: 'turn-failed', + status: 'failed', + startedAt: 1_700_000_150, + completedAt: 1_700_000_152, + durationMs: 2_400, + items: [] + }, + { + id: 'turn-unplaced', + status: 'someFutureStatus', + startedAt: 1_700_000_170, + completedAt: 1_700_000_171, + items: [] + }, { id: 'turn-open', status: 'inProgress', startedAt: 1_700_000_200, items: [] }, { id: 'turn-untimed', status: 'completed', items: [] } ] @@ -544,6 +559,32 @@ describe('codex turn lifecycle rows', () => { startedAt: 1_700_000_100_000, completedAt: 1_700_000_101_000 } + }, + { + // The same shape a live failed completion writes. + key: 'legacy:codex:session-1:turn-lifecycle%3Aturn-failed', + body: { + kind: 'turn', + turnId: 'turn-failed', + state: 'completed', + outcome: 'failure', + userItemId: 'codex:thread-abc:turn-failed:0', + startedAt: 1_700_000_150_000, + completedAt: 1_700_000_152_000, + durationMs: 2_400 + } + }, + { + // Ended, but not a status this build can place: no verdict, never a clean finish. + key: 'legacy:codex:session-1:turn-lifecycle%3Aturn-unplaced', + body: { + kind: 'turn', + turnId: 'turn-unplaced', + state: 'completed', + userItemId: 'codex:thread-abc:turn-unplaced:0', + startedAt: 1_700_000_170_000, + completedAt: 1_700_000_171_000 + } } ]) expect(tap.tombstones).toEqual([]) diff --git a/src/main/codex/codex-structured-journal-translation-turn-settles-once.test.ts b/src/main/codex/codex-structured-journal-translation-turn-settles-once.test.ts index a5c02bd3bfeb..77638a7d1ead 100644 --- a/src/main/codex/codex-structured-journal-translation-turn-settles-once.test.ts +++ b/src/main/codex/codex-structured-journal-translation-turn-settles-once.test.ts @@ -21,13 +21,28 @@ type Row = { key: string; body: AgentJournalItemBody } function recorder() { const rows: Row[] = [] + let refuseTerminal = 0 const sink: StructuredAgentSessionEventSink = { appendItem: (identity: AgentJournalItemIdentity, body) => rows.push({ key: agentJournalItemKey(identity), body }), + tryAppendItem: (identity: AgentJournalItemIdentity, body) => { + if (body.kind === 'turn' && body.state !== 'running' && refuseTerminal > 0) { + refuseTerminal -= 1 + return { accepted: false, reason: 'backpressure' } + } + rows.push({ key: agentJournalItemKey(identity), body }) + return { accepted: true } + }, appendTombstone: () => {}, publish: () => {} } - return { sink, rows } + return { + sink, + rows, + refuseNextTerminalWrite: () => { + refuseTerminal += 1 + } + } } function notification(method: string, params: unknown, observedAt: number) { @@ -50,11 +65,15 @@ function translator(tap: ReturnType) { }) } -/** Every terminal write for a turn, in order: what a reader could observe. */ +/** Every lifecycle write for a turn, in order: what a reader could observe. */ +function turnWrites(rows: readonly Row[], turnId: string) { + return rows.flatMap((row) => + row.body.kind === 'turn' && row.body.turnId === turnId ? [row.body] : [] + ) +} + function terminalWrites(rows: readonly Row[], turnId: string) { - return rows - .map((row) => row.body) - .filter((body) => body.kind === 'turn' && body.turnId === turnId && body.state !== 'running') + return turnWrites(rows, turnId).filter((body) => body.state !== 'running') } /** The body the journal reducer keeps for a turn's lifecycle row. */ @@ -109,8 +128,8 @@ function runFailedTurn(handle: (event: CodexStructuredSessionEvent) => unknown) ) } -describe('a Codex turn settles once', () => { - it('keeps the failure the error settled when the failed completion follows it', () => { +describe('a Codex turn ends once, on its completion', () => { + it('records the failed completion Codex sends after the error, with the start this host saw', () => { const tap = recorder() const codex = translator(tap) @@ -125,37 +144,107 @@ describe('a Codex turn settles once', () => { userItemId: agentJournalSubmissionKey(CLIENT_MESSAGE_ID), startedAt: 1_000, requestedAt: 900, - completedAt: 2_000 + completedAt: 2_100, + durationMs: 1_100 }) expect( tap.rows.filter((row) => row.body.kind === 'status' && row.body.tone === 'error') ).toHaveLength(1) }) - it('ignores a duplicate completion for a turn it already settled', () => { + it('records an exit between the error and the completion as interrupted, with no verdict', () => { + // Orca records only an end it observed. The exit is that end; the failure + // Codex would have named arrives only in the completion, which never came. const tap = recorder() const codex = translator(tap) + const events: CodexStructuredSessionEvent[] = [] + runFailedTurn((event) => events.push(event)) - codex.handle(notification('turn/started', { turn: { id: TURN_ID } }, 1_000)) - codex.handle( - notification( - 'turn/completed', - { turn: { id: TURN_ID, status: 'completed', durationMs: 900 } }, - 2_000 - ) - ) - codex.handle(notification('turn/completed', { turn: { id: TURN_ID, status: 'failed' } }, 3_000)) + for (const event of events.slice(0, -1)) { + codex.handle(event) + } + codex.handle({ + type: 'ended', + sessionId: SESSION_ID, + reason: 'lost child', + cause: 'unexpected-exit', + fence: 1, + acquisitionGeneration: 'generation-1', + observedAt: 2_050 + }) - expect(terminalWrites(tap.rows, TURN_ID)).toHaveLength(1) + expect(terminalWrites(tap.rows, TURN_ID)).toEqual([ + { + kind: 'turn', + turnId: TURN_ID, + state: 'interrupted', + userItemId: agentJournalSubmissionKey(CLIENT_MESSAGE_ID), + startedAt: 1_000, + requestedAt: 900, + completedAt: 2_050 + } + ]) + expect( + tap.rows.filter((row) => row.body.kind === 'status' && row.body.tone === 'error') + ).toHaveLength(1) + }) + + it('revises the still-open turn with a send Codex echoes between the error and the completion', () => { + // Codex records a failed turn's pending input after its `error` frame and + // before `turn/completed`, so the echo belongs to a turn that is still open. + const tap = recorder() + const codex = translator(tap) + const events: CodexStructuredSessionEvent[] = [] + runFailedTurn((event) => events.push(event)) + const [started, echo, reply, error, completion] = events + + for (const event of [started, reply, error, echo, completion]) { + if (event) { + codex.handle(event) + } + } + + expect(turnWrites(tap.rows, TURN_ID).map((body) => body.state)).toEqual([ + 'running', + 'running', + 'completed' + ]) expect(settledRecord(tap.rows, TURN_ID)).toMatchObject({ - state: 'completed', - outcome: 'success', + outcome: 'failure', + userItemId: agentJournalSubmissionKey(CLIENT_MESSAGE_ID), + requestedAt: 900, startedAt: 1_000, - completedAt: 2_000, - durationMs: 900 + durationMs: 1_100 }) }) + it('settles once when the sink refuses the completion and its retry lands', () => { + // A refused frame is Orca's only redelivery of a completion, and a refused + // end changes nothing, so the retry settles the turn exactly once. + const tap = recorder() + const codex = translator(tap) + const completion = notification( + 'turn/completed', + { turn: { id: TURN_ID, status: 'completed', durationMs: 900 } }, + 2_000 + ) + + codex.handle(notification('turn/started', { turn: { id: TURN_ID } }, 1_000)) + tap.refuseNextTerminalWrite() + expect(codex.handle(completion)).toEqual({ accepted: false, reason: 'backpressure' }) + expect(codex.handle(completion)).toEqual({ accepted: true }) + + expect(terminalWrites(tap.rows, TURN_ID)).toEqual([ + expect.objectContaining({ + state: 'completed', + outcome: 'success', + startedAt: 1_000, + completedAt: 2_000, + durationMs: 900 + }) + ]) + }) + it('settles an ordinary turn exactly as before', () => { const tap = recorder() const codex = translator(tap) diff --git a/src/main/codex/codex-structured-journal-translation-turn-state.ts b/src/main/codex/codex-structured-journal-translation-turn-state.ts index 832f57f3096f..4c1e739705d2 100644 --- a/src/main/codex/codex-structured-journal-translation-turn-state.ts +++ b/src/main/codex/codex-structured-journal-translation-turn-state.ts @@ -57,12 +57,6 @@ export class CodexJournalActiveTurns { return [...(this.byThread.get(threadId) ?? [])].at(-1) ?? null } - /** Whether this turn is still open here. A terminal row already written carries - * the turn's start and duration, so a later end must not overwrite it. */ - isActive(threadId: string, turnId: string): boolean { - return this.byThread.get(threadId)?.has(turnId) === true - } - startedAt(threadId: string, turnId: string): number | undefined { return this.startedAtByTurn.get(this.turnKey(threadId, turnId)) } @@ -167,8 +161,7 @@ type RecentTurn = { bytes: number } -/** Bounded terminal lifecycle window: exact echoes that arrive after completion - * revise it, and a later end for a turn in it is not a second settlement. */ +/** Bounded terminal lifecycle window: exact echoes that arrive after completion revise it. */ export class CodexJournalRecentTurns { private readonly turns = new Map() private retainedBytes = 0 @@ -232,10 +225,6 @@ export class CodexJournalRecentTurns { } } - has(threadId: string, turnId: string): boolean { - return this.turns.has(this.turnKey(threadId, turnId)) - } - requestOriginRevision( threadId: string, turnId: string, diff --git a/src/main/codex/codex-structured-journal-translation-turns.ts b/src/main/codex/codex-structured-journal-translation-turns.ts index 8678c1755994..52dca66a35b5 100644 --- a/src/main/codex/codex-structured-journal-translation-turns.ts +++ b/src/main/codex/codex-structured-journal-translation-turns.ts @@ -43,12 +43,12 @@ export function codexTurnLifecycleBody( return agentJournalTurnBody(turnLifecycle) } -/** Maps a `turn/completed` status; a missing one is a clean finish. A terminal - * `error` also ends a turn and names its own outcome rather than coming here. */ +/** Maps a `turn/completed` status, live or restored. Only `interrupted` is a stop; + * a failed turn completed, and `codexTurnOutcome` says it failed. */ export function codexTurnLifecycleState( status: string | null ): Extract { - return status === null || status === 'completed' ? 'completed' : 'interrupted' + return status === 'interrupted' ? 'interrupted' : 'completed' } /** diff --git a/src/main/codex/codex-structured-journal-translation-writers.ts b/src/main/codex/codex-structured-journal-translation-writers.ts index c4fba2c13708..72c1026452d8 100644 --- a/src/main/codex/codex-structured-journal-translation-writers.ts +++ b/src/main/codex/codex-structured-journal-translation-writers.ts @@ -8,7 +8,6 @@ import { CodexJournalGenericFrames } from './codex-structured-journal-generic-fr import { CodexJournalGoals } from './codex-structured-journal-goals' import { CodexJournalItems } from './codex-structured-journal-items' import { CodexJournalPrompts } from './codex-structured-journal-prompts' -import { createCodexOversizedNotificationSettler } from './codex-structured-journal-translation-frames' import { CodexJournalActiveTurns } from './codex-structured-journal-translation-turn-state' import { CodexSubagentRoster } from './codex-subagent-roster' @@ -39,7 +38,6 @@ export function createCodexJournalTranslatorWriters(deps: CodexJournalTranslator producerDeps, (threadId, itemId) => items.detailFor(threadId, itemId), activeTurn - ), - settleOversizedNotification: createCodexOversizedNotificationSettler(producerDeps, items) + ) } } diff --git a/src/main/codex/codex-structured-journal-translation.test.ts b/src/main/codex/codex-structured-journal-translation.test.ts index d902b7b47252..676d9054ed70 100644 --- a/src/main/codex/codex-structured-journal-translation.test.ts +++ b/src/main/codex/codex-structured-journal-translation.test.ts @@ -287,7 +287,7 @@ describe('codex journal translation', () => { ).toBe('idle') }) - describe('a terminal error ends the turn it names', () => { + describe('a turn-ending error is a row on the turn it names, and the completion ends it', () => { function statusOf(rows: readonly Row[]) { return projectStructuredAgentSessionStatus( reduced(rows).map((row, sequence) => ({ @@ -308,7 +308,11 @@ describe('codex journal translation', () => { }) } - it('settles the turn and keeps the provider sentence as its own row', () => { + const FAILED_COMPLETION = notification('turn/completed', { + turn: { id: TURN_ID, status: 'failed', durationMs: 2_400 } + }) + + it('keeps the turn working through the error, and the failed completion settles it', () => { const tap = recorder() const translator = createCodexJournalTranslator({ sink: tap.sink, @@ -316,9 +320,12 @@ describe('codex journal translation', () => { }) translator.handle(TURN_STARTED) + translator.handle(errorNotification({ turnId: TURN_ID, willRetry: false })) + expect(statusOf(tap.rows)).toBe('working') + expect(tap.rows.filter((row) => row.body.kind === 'turn')).toHaveLength(1) - translator.handle(errorNotification({ turnId: TURN_ID, willRetry: false })) + translator.handle(FAILED_COMPLETION) expect(statusOf(tap.rows)).toBe('idle') expect(reduced(tap.rows).map((row) => row.body)).toContainEqual( @@ -326,7 +333,8 @@ describe('codex journal translation', () => { kind: 'turn', turnId: TURN_ID, state: 'completed', - outcome: 'failure' + outcome: 'failure', + durationMs: 2_400 }) ) // The message the user reads is still a row of its own. @@ -353,7 +361,7 @@ describe('codex journal translation', () => { expect(tap.rows.filter((row) => row.body.kind === 'turn')).toHaveLength(1) }) - it('does not overwrite the terminal row of a turn that already completed', () => { + it('writes only its row for an error after the turn completed', () => { const tap = recorder() const translator = createCodexJournalTranslator({ sink: tap.sink, @@ -361,21 +369,16 @@ describe('codex journal translation', () => { }) translator.handle(TURN_STARTED) - translator.handle( - notification('turn/completed', { - turn: { id: TURN_ID, status: 'failed', durationMs: 4_000 } - }) - ) + translator.handle(FAILED_COMPLETION) const settled = reduced(tap.rows).find((row) => row.body.kind === 'turn')?.body translator.handle(errorNotification({ turnId: TURN_ID, willRetry: false })) - // The completion carries the duration a late error could not reconstruct. expect(reduced(tap.rows).find((row) => row.body.kind === 'turn')?.body).toEqual(settled) expect(statusOf(tap.rows)).toBe('idle') }) - it('settles the running turn when the error names no turn', () => { + it('settles nothing when the error names no turn', () => { const tap = recorder() const translator = createCodexJournalTranslator({ sink: tap.sink, @@ -385,21 +388,8 @@ describe('codex journal translation', () => { translator.handle(TURN_STARTED) translator.handle(errorNotification({ willRetry: false })) - expect(statusOf(tap.rows)).toBe('idle') - }) - - it('does not reopen a running row when the completion arrives after the error', () => { - const tap = recorder() - const translator = createCodexJournalTranslator({ - sink: tap.sink, - primaryThreadId: () => THREAD_ID - }) - - translator.handle(TURN_STARTED) - translator.handle(errorNotification({ turnId: TURN_ID, willRetry: false })) - translator.handle(notification('turn/completed', { turn: { id: TURN_ID, status: 'failed' } })) - - expect(statusOf(tap.rows)).toBe('idle') + expect(statusOf(tap.rows)).toBe('working') + expect(tap.rows.filter((row) => row.body.kind === 'turn')).toHaveLength(1) }) }) @@ -446,14 +436,12 @@ describe('codex journal translation', () => { expect(stopped).toEqual([]) }) - it('releases after systemError arrives before the terminal error notification', () => { + it('releases after the failed completion that follows systemError and the error', () => { const stopped: string[] = [] const { translator } = translatorReporting(stopped) translator.handle(TURN_STARTED) translator.handle(statusChanged('systemError')) - expect(stopped).toEqual([]) - translator.handle( notification('error', { turnId: TURN_ID, @@ -461,6 +449,9 @@ describe('codex journal translation', () => { error: { message: 'fatal' } }) ) + expect(stopped).toEqual([]) + + translator.handle(notification('turn/completed', { turn: { id: TURN_ID, status: 'failed' } })) expect(stopped).toEqual([THREAD_ID]) }) diff --git a/src/main/codex/codex-structured-journal-translation.ts b/src/main/codex/codex-structured-journal-translation.ts index fb90cb73128a..fadab8b4589c 100644 --- a/src/main/codex/codex-structured-journal-translation.ts +++ b/src/main/codex/codex-structured-journal-translation.ts @@ -11,9 +11,8 @@ import { restoreCodexJournalThread } from './codex-structured-journal-translatio import { CodexJournalTurnBoundaries } from './codex-structured-journal-translation-turn-boundaries' import { createCodexJournalTranslatorWriters } from './codex-structured-journal-translation-writers' import { publishCodexTurnLifecycle } from './codex-structured-journal-translation-turns' -import { readCodexProviderVerdict } from './codex-structured-journal-provider-verdicts' import { createCodexThreadItemRouter } from './codex-structured-journal-thread-item-routing' -import { readCodexTurnId } from './codex-structured-thread-facts' +import { codexThreadStoppedRunning, readCodexTurnId } from './codex-structured-thread-facts' import type { CodexStructuredSessionEvent } from './codex-structured-session-adapter' export type { @@ -36,17 +35,8 @@ export { export function createCodexJournalTranslator( deps: CodexJournalTranslatorDeps ): CodexJournalTranslator { - const { - activeTurns, - subagents, - linkageFor, - genericFrames, - items, - compactions, - goals, - prompts, - settleOversizedNotification - } = createCodexJournalTranslatorWriters(deps) + const { activeTurns, subagents, linkageFor, genericFrames, items, compactions, goals, prompts } = + createCodexJournalTranslatorWriters(deps) const flushStreams = (): CodexJournalTranslationAdmission => items.streams.flush() ? CODEX_JOURNAL_ADMITTED : { accepted: false, reason: 'backpressure' } let readActivity = createCodexProviderActivityReader() @@ -205,10 +195,6 @@ export function createCodexJournalTranslator( ) } if (event.type === 'provider-frame') { - const settlement = settleOversizedNotification(event) - if (settlement && !settlement.accepted) { - return settlement - } return genericFrames.appendUnhandled(event.kind, event.payload, event.threadId) } if (event.method === 'turn/started' || event.method === 'turn/completed') { @@ -249,28 +235,24 @@ export function createCodexJournalTranslator( return publishActivity(event, routed) } } - const verdict = readCodexProviderVerdict(event.method, event.params) + // A thread that stopped running settles no open turn: Codex clears `running` + // on every error, and an open turn ends on its `turn/completed`. It releases + // a send whose dispatch was never answered, which nothing else re-derives live. if ( - verdict === 'thread-stopped-running' && + event.method === 'thread/status/changed' && + codexThreadStoppedRunning(event.params) && event.threadId === (deps.primaryThreadId?.() ?? null) ) { primaryThreadStoppedRunning = true reportPrimaryThreadStoppedRunning() } - // The row carries the provider's sentence and is written first, so it lands - // inside the turn this same frame is about to end. + // A turn-ending `error` is a row inside the turn it names; the failed + // `turn/completed` Codex sends after it is that turn's end. const unhandled = genericFrames.appendUnhandled( `notification:${event.method}`, event.params, event.threadId ) - if (unhandled.accepted && verdict === 'turn-failed') { - const failed = turnBoundaries.fail(event) - if (!failed.accepted) { - return failed - } - reportPrimaryThreadStoppedRunning() - } return publishActivity(event, unhandled) }, cancelPrompt: (journalItemId) => prompts.cancel(journalItemId), diff --git a/src/main/codex/codex-structured-journal-turn-endings-replay.test.ts b/src/main/codex/codex-structured-journal-turn-endings-replay.test.ts new file mode 100644 index 000000000000..d1de7e747663 --- /dev/null +++ b/src/main/codex/codex-structured-journal-turn-endings-replay.test.ts @@ -0,0 +1,206 @@ +// Real `codex app-server` frame orders, replayed through the translator. +// +// The fixture is trimmed from captures of the real binary on 0.141.0 (the oldest +// version Orca exercises) and 0.158.0, with only the upstream provider faked: +// statuses, `willRetry`, the provider's sentence and `durationMs`, at the host +// receipt time `t` each frame arrived. Ids are replaced with synthetic ones. + +import { readFileSync } from 'node:fs' +import { join } from 'node:path' +import { describe, expect, it } from 'vitest' +import type { + AgentJournalItemBody, + AgentJournalItemIdentity +} from '../../shared/agent-session-journal-types' +import { agentJournalItemKey } from '../../shared/agent-session-journal-item-key' +import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' +import { createCodexJournalTranslator } from './codex-structured-journal-translation' +import { + readCodexThreadId, + readCodexTurnDurationMs, + readCodexTurnId, + readCodexTurnStatus +} from './codex-structured-thread-facts' + +const SESSION_ID = 'session-1' + +type CapturedFrame = { case: string; t: number; method: string; params: Record } +type Row = { key: string; body: AgentJournalItemBody } + +const FRAMES: CapturedFrame[] = readFileSync( + join(__dirname, '__fixtures__', 'codex-app-server-turn-endings.jsonl'), + 'utf8' +) + .split('\n') + .filter((line) => line.length > 0) + .map((line) => JSON.parse(line)) + +function framesOf(name: string): CapturedFrame[] { + const frames = FRAMES.filter((frame) => frame.case === name) + expect(frames.length).toBeGreaterThan(0) + return frames +} + +/** Replays a case's frames, or only its first `count`. */ +function replay(name: string, count = Number.POSITIVE_INFINITY) { + const frames = framesOf(name).slice(0, count) + const threadId = readCodexThreadId(frames[0]?.params) ?? '' + const rows: Row[] = [] + const sink: StructuredAgentSessionEventSink = { + appendItem: (identity: AgentJournalItemIdentity, body) => + rows.push({ key: agentJournalItemKey(identity), body }), + appendTombstone: () => {}, + publish: () => {} + } + const translator = createCodexJournalTranslator({ + sink, + sessionId: SESSION_ID, + primaryThreadId: () => threadId + }) + for (const frame of frames) { + expect( + translator.handle({ + type: 'notification', + sessionId: SESSION_ID, + threadId, + method: frame.method, + params: frame.params, + observedAt: frame.t + }) + ).toEqual({ accepted: true }) + } + return { frames, rows, translator } +} + +function turnWrites(rows: readonly Row[], turnId: string) { + return rows + .map((row) => row.body) + .filter((body) => body.kind === 'turn' && body.turnId === turnId) +} + +function terminalWrites(rows: readonly Row[], turnId: string) { + return turnWrites(rows, turnId).filter((body) => body.kind === 'turn' && body.state !== 'running') +} + +function receipt(frames: readonly CapturedFrame[], method: string, turnId: string): number { + const frame = frames.find( + (entry) => entry.method === method && readCodexTurnId(entry.params) === turnId + ) + if (!frame) { + throw new Error(`no ${method} for ${turnId}`) + } + return frame.t +} + +function completion(frames: readonly CapturedFrame[], turnId: string) { + const frame = frames.find( + (entry) => entry.method === 'turn/completed' && readCodexTurnId(entry.params) === turnId + ) + return frame + ? { + t: frame.t, + status: readCodexTurnStatus(frame.params), + durationMs: readCodexTurnDurationMs(frame.params) + } + : null +} + +const VERDICT: Record = { + completed: { state: 'completed', outcome: 'success' }, + failed: { state: 'completed', outcome: 'failure' }, + interrupted: { state: 'interrupted', outcome: 'cancellation' } +} + +const ENDED_CASES = [...new Set(FRAMES.map((frame) => frame.case))].filter( + (name) => name !== '0.158.0-conn-refused' +) + +describe('captured Codex turns end once, on their own completion', () => { + it.each(ENDED_CASES)('%s', (name) => { + const { frames, rows } = replay(name) + const turnIds = frames + .filter((frame) => frame.method === 'turn/started') + .map((frame) => readCodexTurnId(frame.params) ?? '') + + expect(turnIds.length).toBeGreaterThan(0) + for (const turnId of turnIds) { + const end = completion(frames, turnId) + expect(end).not.toBeNull() + if (!end) { + continue + } + const verdict = VERDICT[end.status ?? ''] + expect(verdict).toBeDefined() + // One terminal write per turn, and it is Codex's own completion: its time, + // its duration and its verdict, with the start this host saw. + expect(terminalWrites(rows, turnId)).toEqual([ + expect.objectContaining({ + state: verdict?.state, + outcome: verdict?.outcome, + startedAt: receipt(frames, 'turn/started', turnId), + completedAt: end.t, + durationMs: end.durationMs + }) + ]) + } + }) + + it('keeps every failed turn working through its error until the completion', () => { + for (const name of ENDED_CASES) { + const frames = framesOf(name) + const failedTurns = frames + .filter((frame) => frame.method === 'error' && frame.params.willRetry === false) + .map((frame) => readCodexTurnId(frame.params) ?? '') + for (const turnId of failedTurns) { + const errorAt = frames.findIndex( + (frame) => + frame.method === 'error' && + frame.params.willRetry === false && + readCodexTurnId(frame.params) === turnId + ) + // Through the error, the turn is open; the completion right after it ends it. + expect(terminalWrites(replay(name, errorAt + 1).rows, turnId)).toEqual([]) + expect(terminalWrites(replay(name).rows, turnId)).toHaveLength(1) + } + } + }) + + it('keeps a turn Codex is still retrying on 0.158.0 running, and the exit sweep ends it', () => { + const { frames, rows, translator } = replay('0.158.0-conn-refused') + const turnId = + readCodexTurnId(frames.find((frame) => frame.method === 'turn/started')?.params) ?? '' + const retries = frames.filter((frame) => frame.method === 'error') + + // Seven "Reconnecting... waiting for network" frames over four minutes, all + // willRetry, and no completion: the turn is genuinely still open. + expect(retries).toHaveLength(7) + expect(retries.every((frame) => frame.params.willRetry === true)).toBe(true) + expect(turnWrites(rows, turnId)).toEqual([ + expect.objectContaining({ + state: 'running', + startedAt: receipt(frames, 'turn/started', turnId) + }) + ]) + + translator.handle({ + type: 'ended', + sessionId: SESSION_ID, + reason: 'lost child', + cause: 'unexpected-exit', + fence: 1, + acquisitionGeneration: 'generation-1', + observedAt: 250_000 + }) + + expect(terminalWrites(rows, turnId)).toEqual([ + { + kind: 'turn', + turnId, + state: 'interrupted', + userItemId: `codex:${readCodexThreadId(frames[0]?.params)}:${turnId}:0`, + startedAt: receipt(frames, 'turn/started', turnId), + completedAt: 250_000 + } + ]) + }) +}) diff --git a/src/main/codex/codex-structured-journal-turn-settles-once-journal.test.ts b/src/main/codex/codex-structured-journal-turn-settles-once-journal.test.ts index 6459b59755ce..4e3caaa8bc00 100644 --- a/src/main/codex/codex-structured-journal-turn-settles-once-journal.test.ts +++ b/src/main/codex/codex-structured-journal-turn-settles-once-journal.test.ts @@ -73,8 +73,14 @@ async function session() { } } +function turnRecord(rows: Awaited>['items']>>) { + return rows + .map((item) => readAgentJournalTurn(item.body)) + .findLast((record) => record?.turnId === TURN) +} + describe('a failed Codex turn in the journal', () => { - it('keeps the failure and its duration when the failed completion lands while the error is still queued', async () => { + it('keeps the failed completion, its duration and the start, when it lands while the error is still queued', async () => { const { on, drained, items } = await session() on('turn/started', { turn: { id: TURN } }, 1_000) on( @@ -85,7 +91,7 @@ describe('a failed Codex turn in the journal', () => { await drained() // Codex writes both frames back to back; the error's status row is still being - // written when the failed completion arrives, so the error's settlement is queued. + // written when the failed completion arrives. on( 'error', { turnId: TURN, willRetry: false, error: { message: 'stream disconnected' } }, @@ -94,18 +100,50 @@ describe('a failed Codex turn in the journal', () => { on('turn/completed', { turn: { id: TURN, status: 'failed', durationMs: 1_900 } }, 3_100) const rows = await items() - const turn = rows - .map((item) => readAgentJournalTurn(item.body)) - .findLast((record) => record?.turnId === TURN) - expect(turn).toMatchObject({ + expect(turnRecord(rows)).toMatchObject({ state: 'completed', outcome: 'failure', startedAt: 1_000, - completedAt: 3_000 + completedAt: 3_100, + durationMs: 1_900 }) - // The duration "Worked for" shows under the turn's message. + // "Worked for" under the turn's message reads Codex's own duration. expect( completedStructuredAgentTurnSeconds(selectStructuredAgentRunningTurnTiming(rows, TURN)) - ).toBe(2) + ).toBe(1) }) + + // Codex ends a turn once, so a second completion is not expected. If one came, + // the settlement id keeps the first record, whether it is still queued or written. + it.each([ + ['still queued', false], + ['already written', true] + ] as const)( + 'keeps the first completion when a second one arrives while the first is %s', + async (_label, drainFirst) => { + const { on, drained, items } = await session() + on('turn/started', { turn: { id: TURN } }, 1_000) + await drained() + + // The reply's row is being written, so the first completion waits behind it. + on( + 'item/completed', + { turnId: TURN, item: { type: 'agentMessage', id: 'agent-1', text: 'Done' } }, + 1_900 + ) + on('turn/completed', { turn: { id: TURN, status: 'completed', durationMs: 900 } }, 2_000) + if (drainFirst) { + await drained() + } + on('turn/completed', { turn: { id: TURN, status: 'failed' } }, 3_000) + + expect(turnRecord(await items())).toMatchObject({ + state: 'completed', + outcome: 'success', + startedAt: 1_000, + completedAt: 2_000, + durationMs: 900 + }) + } + ) }) diff --git a/src/main/codex/codex-structured-thread-facts.ts b/src/main/codex/codex-structured-thread-facts.ts index 755006d17fa2..f2a42e6d3dbf 100644 --- a/src/main/codex/codex-structured-thread-facts.ts +++ b/src/main/codex/codex-structured-thread-facts.ts @@ -62,12 +62,6 @@ export function readCodexTurnDurationMs(payload: unknown): number | null { return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null } -/** `error` carries `willRetry`: Codex sets it on a stream error it is about to - * retry, and omits it (false) on one that ended the turn the frame names. */ -export function readCodexErrorWillRetry(payload: unknown): boolean { - return record(payload)?.willRetry === true -} - /** `thread/status/changed` carries a TAGGED status (`{status:{type}}`), never a * bare string. `idle` and `systemError` are the two arms that mean the thread * is not running; `active` and `notLoaded` are not. */ diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink-queue.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink-queue.ts index c9a32533db44..428a3c1c0d4b 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink-queue.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink-queue.ts @@ -15,6 +15,8 @@ export type StructuredAgentSessionSinkOperation = { lifecycleBytes?: number lifecycle?: boolean coalescingKey?: string + /** The queued operation with this key wins, as the journal keeps a settlement's first batch. */ + keepsFirst?: boolean run: (target: StructuredAgentSessionEventTarget) => Promise | void } @@ -117,10 +119,13 @@ export class StructuredAgentSessionSinkQueue { if (this.failure !== null) { return { accepted: false, reason: 'failed' } } - const sequence = ++this.acceptedSequence const key = options.coalescingKey ?? operation.coalescingKey const replaceAt = key ? this.queue.findIndex((queued) => queued.coalescingKey === key) : -1 const replaced = replaceAt >= 0 ? this.queue[replaceAt] : undefined + if (replaced && operation.keepsFirst) { + return { accepted: true } + } + const sequence = ++this.acceptedSequence const lifecycle = operation.lifecycle ?? options.lifecycle === true const lifecycleBytes = lifecycle ? (operation.lifecycleBytes ?? operation.bytes) : 0 const nextBytes = this.queuedBytes - (replaced?.bytes ?? 0) + operation.bytes diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.test.ts index 6c3747fb824a..b8c1d0b7c0e4 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.test.ts @@ -384,6 +384,32 @@ describe('deferred structured agent-session event sink', () => { expect(log).toEqual([{ call: 'appendItem', fence: 6, ordinal: 1 }]) }) + it('keeps the first queued lifecycle batch for a settlement, as the journal does', async () => { + // The journal applies a settlement id once and skips any later batch with it, + // so the queue must not let a later batch replace one it has not run yet. + const log: Recorded[] = [] + const deferred = createDeferredStructuredAgentSessionEventSink() + const batch = (ordinal: number) => [ + { kind: 'item' as const, identity: identity(ordinal), body: BODY } + ] + + deferred.sink.appendLifecycleBatch?.('turn-completed:turn-1', batch(0)) + expect(deferred.sink.tryAppendLifecycleBatch?.('turn-completed:turn-1', batch(1))).toEqual({ + accepted: true + }) + expect(deferred.state().queuedOperations).toBe(1) + + const bound = target(6, log) + deferred.bind(bound) + await deferred.drained() + + expect( + vi + .mocked(bound.journal.appendLifecycleBatch) + .mock.calls.map(([input]) => input.mutations.map((mutation) => mutation.identity)) + ).toEqual([[identity(0)]]) + }) + it('keeps a replacement checkpoint after distinct intervening operations', async () => { const log: Recorded[] = [] const deferred = createDeferredStructuredAgentSessionEventSink() diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.ts index 923342b7fa6d..ad92e1c24cab 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-event-sink.ts @@ -205,6 +205,7 @@ export function createDeferredStructuredAgentSessionEventSink( { bytes: Buffer.byteLength(JSON.stringify({ settlementId, mutations }), 'utf8') + 512, coalescingKey: `lifecycle:${settlementId}`, + keepsFirst: true, run: (bound) => bound.journal.appendLifecycleBatch({ settlementId, From b283a096885a999cacaf847162f6808c0b267321 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:47:51 -0700 Subject: [PATCH 56/90] fix(native-chat): stop flashing "still starting" on every chat launch (#23666) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(native-chat): stop flashing "still starting" on every chat launch Every structured chat passes through a short startup phase, and the pane showed " is still starting…" for all of it, so a normal launch flashed the notice for a fraction of a second. The notice now goes through a keyed delayed status: it appears only once startup outlasts a grace period, stays up for a minimum time once shown, and resets per session. * fix(native-chat): reset startup notice for each provider child --- ...ed-agent-session-status-feed-child.test.ts | 76 ++++++++++++++ ...-agent-session-status-feed-test-session.ts | 3 +- ...ructured-agent-session-status-feed.test.ts | 28 ++---- .../structured-agent-session-status-feed.ts | 19 +++- ...red-agent-session-subagent-recency.test.ts | 8 +- ...ree-structured-agent-rows-liveness.test.ts | 2 +- .../NativeChatStructuredSession.tsx | 9 +- ...NativeChatStructuredSessionStatus.test.tsx | 98 +++++++++++++++++-- .../NativeChatStructuredSessionStatus.tsx | 12 ++- ...tructuredAgentSessionStatusBridge.test.tsx | 96 +++++++++++++++--- .../StructuredAgentSessionStatusBridge.tsx | 20 +++- src/renderer/src/hooks/use-delayed-status.ts | 17 ++++ src/renderer/src/lib/delayed-status.test.ts | 89 +++++++++++++++++ src/renderer/src/lib/delayed-status.ts | 92 +++++++++++++++++ ...gent-session-status-feed-lifecycle.test.ts | 11 ++- .../structured-agent-session-status-feed.ts | 7 +- src/shared/agent-session-wire.ts | 3 + 17 files changed, 533 insertions(+), 57 deletions(-) create mode 100644 src/main/native-chat/agent-session-wire/structured-agent-session-status-feed-child.test.ts create mode 100644 src/renderer/src/hooks/use-delayed-status.ts create mode 100644 src/renderer/src/lib/delayed-status.test.ts create mode 100644 src/renderer/src/lib/delayed-status.ts diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed-child.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed-child.test.ts new file mode 100644 index 000000000000..78e10bec076d --- /dev/null +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed-child.test.ts @@ -0,0 +1,76 @@ +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, expect, it } from 'vitest' +import type { AgentSessionStatusEvent } from '../../../shared/agent-session-wire' +import { createTrackedJournalOpener } from '../agent-session-journal/journal-store-test-open' +import { StructuredAgentSessionStatusFeed } from './structured-agent-session-status-feed' +import { indexedStatusFeedSession } from './structured-agent-session-status-feed-test-session' + +const SESSION = 'status-session' +const journals = createTrackedJournalOpener() +let root: string + +beforeEach(async () => { + root = await mkdtemp(join(tmpdir(), 'orca-status-child-')) +}) + +afterEach(async () => { + await journals.closeAll() + await rm(root, { recursive: true, force: true }) +}) + +it('publishes each provider child even when a replacement has the same startup phase', async () => { + const journal = await journals.open({ + identity: { + sessionId: SESSION, + workspaceId: 'workspace-1', + hostId: 'local', + agent: 'codex', + providerHandle: { kind: 'codex', threadId: 'thread-1' } + }, + journalDir: join(root, SESSION) + }) + const sessions = new Map>() + const setChild = ( + child: { + phase: 'starting' | 'ready' + generation: string + fence: number + } | null + ) => sessions.set(SESSION, indexedStatusFeedSession({ journal, child })) + setChild({ phase: 'starting', generation: 'child-1', fence: 1 }) + const events: AgentSessionStatusEvent[] = [] + const feed = new StructuredAgentSessionStatusFeed({ + sessions, + getRecord: () => null, + now: () => 1 + }) + const dispose = feed.subscribe({ id: 'list-1', emit: (event) => events.push(event) }) + expect(events.at(-1)).toMatchObject({ + type: 'snapshot', + sessions: [ + { + hostExecutionOwned: true, + hostExecutionPhase: 'starting', + hostExecutionChild: { generation: 'child-1', fence: 1 } + } + ] + }) + setChild({ phase: 'starting', generation: 'child-2', fence: 2 }) + feed.publish(SESSION, journal) + expect(events.at(-1)).toMatchObject({ + session: { + hostExecutionPhase: 'starting', + hostExecutionChild: { generation: 'child-2', fence: 2 } + } + }) + setChild({ phase: 'ready', generation: 'child-2', fence: 2 }) + feed.publish(SESSION, journal) + expect(events.at(-1)).toMatchObject({ session: { hostExecutionPhase: 'ready' } }) + setChild(null) + feed.publish(SESSION, journal) + expect(events.at(-1)).not.toMatchObject({ session: { hostExecutionPhase: expect.any(String) } }) + expect(events.at(-1)).not.toMatchObject({ session: { hostExecutionChild: expect.any(Object) } }) + dispose() +}) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed-test-session.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed-test-session.ts index c130aaf9d597..da7275cc6418 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed-test-session.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed-test-session.ts @@ -1,8 +1,9 @@ import type { AgentSessionJournal } from '../agent-session-journal/journal-store' +import type { StructuredAgentSessionProviderChildIdentity } from './structured-agent-session-host-types' export function indexedStatusFeedSession(session: { journal: AgentSessionJournal - child?: { phase: 'starting' | 'ready' } | null + child?: (StructuredAgentSessionProviderChildIdentity & { phase: 'starting' | 'ready' }) | null }) { return { journal: session.journal, diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.ts index a26cd324217f..eda619694e35 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.test.ts @@ -95,27 +95,11 @@ function feedFor( } describe('StructuredAgentSessionStatusFeed', () => { - it('projects whether the owned child has proven its start, and nothing once it is not owned', async () => { - const journal = await openJournal() - const session = { journal, child: { phase: 'starting' as const } } - const sessions = new Map[0]>([[SESSION, session]]) - const { feed, events, dispose } = feedFor(sessions) - expect(events.at(-1)).toMatchObject({ - type: 'snapshot', - sessions: [{ hostExecutionOwned: true, hostExecutionPhase: 'starting' }] - }) - sessions.set(SESSION, { ...session, child: { phase: 'ready' } }) - feed.publish(SESSION, journal) - expect(events.at(-1)).toMatchObject({ session: { hostExecutionPhase: 'ready' } }) - sessions.set(SESSION, { ...session, child: null }) - feed.publish(SESSION, journal) - expect(events.at(-1)).not.toMatchObject({ session: { hostExecutionPhase: expect.any(String) } }) - dispose() - }) - it('publishes provider ownership transitions without changing journal time', async () => { const journal = await openJournal() - const sessions = new Map([[SESSION, { journal, child: { phase: 'ready' } }]]) + const sessions = new Map([ + [SESSION, { journal, child: { phase: 'ready', generation: 'child-1', fence: 1 } }] + ]) const { feed, events, dispose } = feedFor(sessions) events.length = 0 await journal.appendItem( @@ -800,7 +784,9 @@ describe('the status sink sees the roster the broadcast cache deliberately lacks it('receives every change once, ownership revocation, and the forget edge', async () => { const journal = await openJournal() - const sessions = new Map([[SESSION, { journal, child: { phase: 'ready' } }]]) + const sessions = new Map([ + [SESSION, { journal, child: { phase: 'ready', generation: 'child-1', fence: 1 } }] + ]) const { sink, published, forgotten } = sinkFor() const { feed } = feedFor(sessions, null, undefined, undefined, sink) await journal.appendItem( @@ -822,6 +808,8 @@ describe('the status sink sees the roster the broadcast cache deliberately lacks feed.revokeLive(SESSION) expect(published.at(-1)).toMatchObject({ sessionId: SESSION, status: 'idle' }) expect(published.at(-1)?.hostExecutionOwned).toBeUndefined() + expect(published.at(-1)?.hostExecutionPhase).toBeUndefined() + expect(published.at(-1)?.hostExecutionChild).toBeUndefined() // Exactly what `close` does after eviction: the cache keeps the projection, the sink does not. sessions.delete(SESSION) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts index 05937aca5148..22a61a006bb6 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-status-feed.ts @@ -25,7 +25,7 @@ import type { AgentChildWorkEvidence } from '../../../shared/agent-status-child- import { projectStructuredAgentSessionStatusState } from '../../../shared/structured-agent-session-projection' import { structuredAgentSessionAgentStatus } from '../../../shared/structured-agent-session-agent-status' import type { AgentSessionJournal } from '../agent-session-journal/journal-store' -import type { StructuredAgentSessionProviderChildPhase } from './structured-agent-session-adapter' +import type { StructuredAgentSessionProviderChild } from './structured-agent-session-host-types' import { structuredAgentSessionProviderSessionMetadata } from './structured-agent-session-history-result' import { StructuredAgentSessionStatusOwnership, @@ -46,7 +46,7 @@ export type StructuredAgentSessionStatusSubscriber = { type StatusFeedSession = { journal: AgentSessionJournal params: { location: AgentSessionRecord['location']; provider: AgentSessionRecord['provider'] } - child?: { phase: StructuredAgentSessionProviderChildPhase } | null + child?: Pick | null } export type StructuredAgentSessionStatusFeedDeps = { @@ -73,6 +73,8 @@ function summariesEqual(a: AgentSessionStatusSummary, b: AgentSessionStatusSumma a.status === b.status && a.hostExecutionOwned === b.hostExecutionOwned && a.hostExecutionPhase === b.hostExecutionPhase && + a.hostExecutionChild?.generation === b.hostExecutionChild?.generation && + a.hostExecutionChild?.fence === b.hostExecutionChild?.fence && a.rewindBlockedReason === b.rewindBlockedReason && // A moved state clock changes ranking; row activity alone, including a subagent's, does not. // An idle state the journal cannot date still republishes, since readers date it by `updatedAt`, @@ -203,7 +205,12 @@ export class StructuredAgentSessionStatusFeed { if (!previous) { return } - const { hostExecutionOwned: _hostExecutionOwned, ...retained } = previous + const { + hostExecutionOwned: _hostExecutionOwned, + hostExecutionPhase: _hostExecutionPhase, + hostExecutionChild: _hostExecutionChild, + ...retained + } = previous this.published.set(sessionId, retained) this.sink(retained) this.broadcast({ @@ -273,7 +280,11 @@ export class StructuredAgentSessionStatusFeed { workspaceId: session.params.location.workspaceId, agent: session.params.provider, ...(session.child - ? { hostExecutionOwned: true as const, hostExecutionPhase: session.child.phase } + ? { + hostExecutionOwned: true as const, + hostExecutionPhase: session.child.phase, + hostExecutionChild: { generation: session.child.generation, fence: session.child.fence } + } : {}), ...projected, ...(record?.rewind?.phase === 'prepared' || record?.rewind?.phase === 'provider-succeeded' diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-subagent-recency.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-subagent-recency.test.ts index 4053988233ff..cb8b3d7d7c53 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-subagent-recency.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-subagent-recency.test.ts @@ -64,7 +64,13 @@ async function openSession() { const server = new AgentHookServer() const feed = new StructuredAgentSessionStatusFeed({ sessions: new Map([ - [SESSION, indexedStatusFeedSession({ journal, child: { phase: 'ready' } })] + [ + SESSION, + indexedStatusFeedSession({ + journal, + child: { phase: 'ready', generation: 'child-1', fence: 1 } + }) + ] ]), getRecord: () => null, now: () => 1, diff --git a/src/main/runtime/runtime-worktree-structured-agent-rows-liveness.test.ts b/src/main/runtime/runtime-worktree-structured-agent-rows-liveness.test.ts index 27d5ba48b299..a1373f43c718 100644 --- a/src/main/runtime/runtime-worktree-structured-agent-rows-liveness.test.ts +++ b/src/main/runtime/runtime-worktree-structured-agent-rows-liveness.test.ts @@ -89,7 +89,7 @@ async function awaitingApproval() { SESSION, { journal, - child: { phase: 'ready' as const }, + child: { phase: 'ready' as const, generation: 'child-1', fence: 1 }, params: { location: { executionHostId: 'local' as const, diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx index 6daa3d3f62c9..b66f1770d330 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx @@ -22,7 +22,7 @@ import { NativeChatStructuredSessionStatus } from './NativeChatStructuredSession import { useNativeChatLaunchDraftSignal } from './use-native-chat-launch-draft-adoption' import { NativeChatLaunchRetry } from './NativeChatLaunchRetry' import { useNativeChatProvisionalLaunch } from './use-native-chat-provisional-launch' -import { useStructuredAgentSessionHostExecutionPhase } from './StructuredAgentSessionStatusBridge' +import { useStructuredAgentSessionHostExecution } from './StructuredAgentSessionStatusBridge' import { structuredAgentLabel } from '@/lib/structured-agent-session-launch-label' import { NativeChatThreadGoalBanner } from './NativeChatThreadGoalBanner' import { structuredAgentSessionReadFailureNotice } from './structured-agent-session-read-failure-notice' @@ -42,10 +42,10 @@ export function NativeChatStructuredSession( ) const { sendThroughRelaunch } = provisionalLaunch // The host's own word on whether the provider child has answered startup yet. - const startupPhase = useStructuredAgentSessionHostExecutionPhase(props.sessionId, props.target) + const hostExecution = useStructuredAgentSessionHostExecution(props.sessionId, props.target) const controller = useStructuredAgentSession({ ...props, - providerStarting: startupPhase === 'starting', + providerStarting: hostExecution.phase === 'starting', transportEnabled: provisionalLaunch.transportEnabled, ...(provisionalLaunch.launch ? { launch: provisionalLaunch.launch } : {}) }) @@ -298,7 +298,8 @@ export function NativeChatStructuredSession( { + cleanup() + vi.useRealTimers() +}) const NO_TASKS = { show: false, @@ -17,12 +24,17 @@ const NO_TASKS = { supportsStopAll: false } -function renderStatus(startupPhase: 'starting' | 'ready' | null) { - return render( +function statusElement( + startupPhase: 'starting' | 'ready' | null, + sessionId = 'session-1', + startupChildKey: string | null = null +) { + return ( { - it('says the agent is still starting while the host reports a starting child', () => { + it('stays quiet through a normal startup', () => { + vi.useFakeTimers() + const view = renderStatus('starting') + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS - 1)) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + view.rerender(statusElement('ready')) + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS)) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + }) + + it('says the agent is still starting once startup runs long', () => { + vi.useFakeTimers() renderStatus('starting') + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS)) expect(screen.getByText(/Claude is still starting/)).toBeInTheDocument() expect(screen.getByText(/close this chat/)).toBeInTheDocument() }) + it('restarts the grace period for a relaunch or another session', () => { + vi.useFakeTimers() + const view = renderStatus('starting') + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS)) + view.rerender(statusElement('ready')) + act(() => vi.advanceTimersByTime(STATUS_MIN_VISIBLE_MS)) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + view.rerender(statusElement('starting')) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS)) + expect(screen.getByText(/still starting/)).toBeInTheDocument() + view.rerender(statusElement('starting', 'session-2')) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + }) + + it('hides an old notice and gives a replacement child its full grace period', () => { + vi.useFakeTimers() + const view = render(statusElement('starting', 'session-1', 'child-1')) + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS)) + expect(screen.getByText(/still starting/)).toBeInTheDocument() + view.rerender(statusElement('ready', 'session-1', 'child-1')) + act(() => vi.advanceTimersByTime(100)) + view.rerender(statusElement('starting', 'session-1', 'child-2')) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + act(() => vi.advanceTimersByTime(STATUS_MIN_VISIBLE_MS)) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS - STATUS_MIN_VISIBLE_MS)) + expect(screen.getByText(/still starting/)).toBeInTheDocument() + }) + + it('resets for a replacement child even when no intermediate phase reaches the view', () => { + vi.useFakeTimers() + const view = render(statusElement('starting', 'session-1', 'child-1')) + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS)) + view.rerender(statusElement('starting', 'session-1', 'child-2')) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS - 1)) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + act(() => vi.advanceTimersByTime(1)) + expect(screen.getByText(/still starting/)).toBeInTheDocument() + }) + + it('resets on an observed restart when an older host has no child identity', () => { + vi.useFakeTimers() + const view = renderStatus('starting') + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS)) + view.rerender(statusElement('ready')) + act(() => vi.advanceTimersByTime(100)) + view.rerender(statusElement('starting')) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + act(() => vi.advanceTimersByTime(SLOW_STARTUP_NOTICE_DELAY_MS - 1)) + expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() + act(() => vi.advanceTimersByTime(1)) + expect(screen.getByText(/still starting/)).toBeInTheDocument() + }) + it('shows nothing about startup once the child is ready or the host has no word', () => { renderStatus('ready') expect(screen.queryByText(/still starting/)).not.toBeInTheDocument() diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSessionStatus.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSessionStatus.tsx index 2f33b0ed0c3a..315188861506 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSessionStatus.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSessionStatus.tsx @@ -1,5 +1,6 @@ import { useState } from 'react' import { translate } from '@/i18n/i18n' +import { useDelayedStatus } from '@/hooks/use-delayed-status' import { NativeChatBackgroundTasksStatus } from './NativeChatBackgroundTasksStatus' import type { StructuredSessionBackgroundTasksView } from './structured-session-background-tasks-view' @@ -11,12 +12,16 @@ type StoppingBackgroundTasks = { const NO_STOPPING_TASKS: ReadonlySet = new Set() +// Why: every launch passes through `starting`; only a slow start deserves the notice. +export const SLOW_STARTUP_NOTICE_DELAY_MS = 5_000 + export function NativeChatStructuredSessionStatus(props: { sessionId: string /** What to call the agent in copy about its process. */ agentLabel: string /** The host's word on the provider child; `starting` is published but not yet answering. */ startupPhase: 'starting' | 'ready' | null + startupChildKey: string | number | null error: string | null /** A read the pane is reconnecting on its own: said plainly, not as an error. */ reconnecting?: boolean @@ -28,6 +33,11 @@ export function NativeChatStructuredSessionStatus(props: { const [stopping, setStopping] = useState(null) const [expanded, setExpanded] = useState<{ sessionId: string; expanded: boolean } | null>(null) const activeStopping = stopping?.sessionId === props.sessionId ? stopping : null + const shownStartupPhase = useDelayedStatus( + JSON.stringify([props.sessionId, typeof props.startupChildKey, props.startupChildKey]), + props.startupPhase === 'starting' ? 'starting' : null, + SLOW_STARTUP_NOTICE_DELAY_MS + ) const onStop = (taskId?: string) => { const sessionId = props.sessionId @@ -61,7 +71,7 @@ export function NativeChatStructuredSessionStatus(props: { return ( <> - {props.startupPhase === 'starting' ? ( + {shownStartupPhase === 'starting' ? (

{translate( 'auto.components.native.chat.NativeChatStructuredSessionStatus.starting', diff --git a/src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.test.tsx b/src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.test.tsx index 6cdaa2646e4a..42091c79de99 100644 --- a/src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.test.tsx +++ b/src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.test.tsx @@ -64,7 +64,7 @@ vi.mock('@/runtime/structured-agent-session-client', () => ({ import { getStructuredAgentSessionTabs, StructuredAgentSessionStatusBridge, - useStructuredAgentSessionHostExecutionPhase + useStructuredAgentSessionHostExecution } from './StructuredAgentSessionStatusBridge' import { resetStructuredAgentSessionStatusFeedsForTests } from '@/runtime/structured-agent-session-status-feed' @@ -698,28 +698,102 @@ describe('StructuredAgentSessionStatusBridge', () => { expect(mocks.setAgentStatus).not.toHaveBeenCalled() }) - it('re-renders a startup-phase reader only when the phase changes', async () => { - const phases: (string | null)[] = [] + it('re-renders a startup reader only when its phase or child changes', async () => { + const executions: ReturnType[] = [] function PhaseProbe(): null { - phases.push(useStructuredAgentSessionHostExecutionPhase('session-1', { kind: 'local' })) + executions.push(useStructuredAgentSessionHostExecution('session-1', { kind: 'local' })) return null } render() await waitFor(() => expect(mocks.subscribeStatus).toHaveBeenCalledOnce()) - act(() => feed().emit({ type: 'status', session: summary({ hostExecutionPhase: 'starting' }) })) - const rendersWhileStarting = phases.length act(() => feed().emit({ type: 'status', - session: summary({ hostExecutionPhase: 'starting', latestPrompt: 'next', updatedAt: 2 }) + session: summary({ + hostExecutionPhase: 'starting', + hostExecutionChild: { generation: 'child-1', fence: 1 } + }) + }) + ) + const rendersWhileStarting = executions.length + act(() => + feed().emit({ + type: 'status', + session: summary({ + hostExecutionPhase: 'starting', + hostExecutionChild: { generation: 'child-1', fence: 1 }, + latestPrompt: 'next', + updatedAt: 2 + }) + }) + ) + expect(executions).toHaveLength(rendersWhileStarting) + act(() => + feed().emit({ + type: 'status', + session: summary({ + hostExecutionPhase: 'starting', + hostExecutionChild: { generation: 'child-1', fence: 2 } + }) + }) + ) + expect(executions).toHaveLength(rendersWhileStarting) + + act(() => + feed().emit({ + type: 'status', + session: summary({ + hostExecutionPhase: 'ready', + hostExecutionChild: { generation: 'child-1', fence: 1 } + }) + }) + ) + expect(executions.at(-1)?.phase).toBe('ready') + act(() => + feed().emit({ + type: 'status', + session: summary({ + hostExecutionPhase: 'starting', + hostExecutionChild: { generation: 'child-2', fence: 2 } + }) }) ) - expect(phases).toHaveLength(rendersWhileStarting) + expect(executions.at(-1)).toEqual({ + phase: 'starting', + childKey: 'child-2' + }) + expect(executions.some(({ phase }) => phase === 'starting')).toBe(true) + }) - act(() => feed().emit({ type: 'status', session: summary({ hostExecutionPhase: 'ready' }) })) - expect(phases.at(-1)).toBe('ready') - expect(phases).toContain('starting') + it('uses the fence for a child whose acquisition has no generation', async () => { + const executions: ReturnType[] = [] + function PhaseProbe(): null { + executions.push(useStructuredAgentSessionHostExecution('session-1', { kind: 'local' })) + return null + } + render() + await waitFor(() => expect(mocks.subscribeStatus).toHaveBeenCalledOnce()) + act(() => + feed().emit({ + type: 'status', + session: summary({ + hostExecutionPhase: 'starting', + hostExecutionChild: { generation: null, fence: 1 } + }) + }) + ) + expect(executions.at(-1)?.childKey).toBe(1) + act(() => + feed().emit({ + type: 'status', + session: summary({ + hostExecutionPhase: 'starting', + hostExecutionChild: { generation: null, fence: 2 } + }) + }) + ) + expect(executions.at(-1)?.childKey).toBe(2) }) }) diff --git a/src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsx b/src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsx index b0c546b3f9b6..8205d96a5af5 100644 --- a/src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsx +++ b/src/renderer/src/components/native-chat/StructuredAgentSessionStatusBridge.tsx @@ -47,18 +47,30 @@ export function useStructuredAgentSessionStatusSummary( return { summary, observation } } -/** Only the host's startup phase, so a chat re-renders when that changes, not on every status. */ -export function useStructuredAgentSessionHostExecutionPhase( +/** The host's child state, projected to stable primitives so journal updates do not re-render chat. */ +export function useStructuredAgentSessionHostExecution( sessionId: string, target: RuntimeClientTarget -): NonNullable | null { +): { + phase: NonNullable | null + childKey: string | number | null +} { const feed = useMemo(() => getStructuredAgentSessionStatusFeed(target), [target]) useEffect(() => feed.activate(), [feed]) - return useSyncExternalStore( + const phase = useSyncExternalStore( feed.subscribe, () => feed.getSnapshot().get(sessionId)?.hostExecutionPhase ?? null, () => null ) + const childKey = useSyncExternalStore( + feed.subscribe, + () => { + const child = feed.getSnapshot().get(sessionId)?.hostExecutionChild + return child?.generation ?? child?.fence ?? null + }, + () => null + ) + return { phase, childKey } } function projectStatus( diff --git a/src/renderer/src/hooks/use-delayed-status.ts b/src/renderer/src/hooks/use-delayed-status.ts new file mode 100644 index 000000000000..c895107bb4ae --- /dev/null +++ b/src/renderer/src/hooks/use-delayed-status.ts @@ -0,0 +1,17 @@ +import { useEffect, useState } from 'react' +import { createDelayedStatus, type ShownStatus } from '@/lib/delayed-status' + +/** + * Returns `value` only once it has lasted past `showDelayMs`, then holds it for a + * minimum time, so a short status never flashes. `key` is what the status belongs + * to (for example a session); a new key drops it at once. + */ +export function useDelayedStatus(key: string, value: A | null, showDelayMs: number): A | null { + const [shown, setShown] = useState | null>(null) + const [status] = useState(() => createDelayedStatus(setShown, { showDelayMs })) + useEffect(() => () => status.dispose(), [status]) + useEffect(() => { + status.update(key, value) + }, [status, key, value]) + return shown?.key === key ? shown.value : null +} diff --git a/src/renderer/src/lib/delayed-status.test.ts b/src/renderer/src/lib/delayed-status.test.ts new file mode 100644 index 000000000000..11778a3d414e --- /dev/null +++ b/src/renderer/src/lib/delayed-status.test.ts @@ -0,0 +1,89 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { createDelayedStatus, STATUS_MIN_VISIBLE_MS, type ShownStatus } from './delayed-status' + +const SHOW_DELAY_MS = 1_000 + +function track() { + const changes: (ShownStatus | null)[] = [] + const status = createDelayedStatus((shown) => changes.push(shown), { + showDelayMs: SHOW_DELAY_MS + }) + return { status, changes } +} + +beforeEach(() => { + vi.useFakeTimers() +}) + +afterEach(() => { + vi.useRealTimers() +}) + +describe('createDelayedStatus', () => { + it('never shows a status that clears within the show delay', () => { + const { status, changes } = track() + status.update('a', 'starting') + vi.advanceTimersByTime(SHOW_DELAY_MS - 1) + status.update('a', null) + vi.advanceTimersByTime(SHOW_DELAY_MS * 2) + expect(changes).toEqual([]) + }) + + it('shows a status that outlasts the show delay', () => { + const { status, changes } = track() + status.update('a', 'starting') + vi.advanceTimersByTime(SHOW_DELAY_MS) + expect(changes).toEqual([{ key: 'a', value: 'starting' }]) + }) + + it('keeps a shown status up for the minimum visible time', () => { + const { status, changes } = track() + status.update('a', 'starting') + vi.advanceTimersByTime(SHOW_DELAY_MS) + status.update('a', null) + vi.advanceTimersByTime(STATUS_MIN_VISIBLE_MS - 1) + expect(changes).toEqual([{ key: 'a', value: 'starting' }]) + vi.advanceTimersByTime(1) + expect(changes).toEqual([{ key: 'a', value: 'starting' }, null]) + }) + + it('hides at once when the status clears after the minimum visible time', () => { + const { status, changes } = track() + status.update('a', 'starting') + vi.advanceTimersByTime(SHOW_DELAY_MS + STATUS_MIN_VISIBLE_MS) + status.update('a', null) + expect(changes).toEqual([{ key: 'a', value: 'starting' }, null]) + }) + + it('restarts the show delay when an unkeyed status clears and returns during its hold', () => { + const { status, changes } = track() + status.update('a', 'starting') + vi.advanceTimersByTime(SHOW_DELAY_MS) + status.update('a', null) + vi.advanceTimersByTime(100) + status.update('a', 'starting') + expect(changes).toEqual([{ key: 'a', value: 'starting' }, null]) + vi.advanceTimersByTime(SHOW_DELAY_MS - 1) + expect(changes).toHaveLength(2) + vi.advanceTimersByTime(1) + expect(changes.at(-1)).toEqual({ key: 'a', value: 'starting' }) + }) + + it('drops the shown status at once for a new key, which waits its own delay', () => { + const { status, changes } = track() + status.update('a', 'starting') + vi.advanceTimersByTime(SHOW_DELAY_MS) + status.update('b', 'starting') + expect(changes).toEqual([{ key: 'a', value: 'starting' }, null]) + vi.advanceTimersByTime(SHOW_DELAY_MS) + expect(changes.at(-1)).toEqual({ key: 'b', value: 'starting' }) + }) + + it('does not show after dispose', () => { + const { status, changes } = track() + status.update('a', 'starting') + status.dispose() + vi.advanceTimersByTime(SHOW_DELAY_MS * 2) + expect(changes).toEqual([]) + }) +}) diff --git a/src/renderer/src/lib/delayed-status.ts b/src/renderer/src/lib/delayed-status.ts new file mode 100644 index 000000000000..8c388c966e4b --- /dev/null +++ b/src/renderer/src/lib/delayed-status.ts @@ -0,0 +1,92 @@ +/** How long a shown status stays up, so it cannot flash right at the show delay. */ +export const STATUS_MIN_VISIBLE_MS = 400 + +/** The status a view should show, and the key it belongs to. */ +export type ShownStatus = { + key: string + value: A +} + +export type DelayedStatus = { + /** Reports the real status for `key`. A new key drops the shown status at once. */ + update: (key: string, value: A | null) => void + /** Cancels pending timers. A later `update` starts again from the real status. */ + dispose: () => void +} + +/** + * Turns a real status into the status a view shows. A status that clears within + * `showDelayMs` is never shown; a shown status stays for at least `minVisibleMs`. + * Values compare by identity, so use strings or other stable values. + */ +export function createDelayedStatus( + onChange: (shown: ShownStatus | null) => void, + options: { showDelayMs: number; minVisibleMs?: number } +): DelayedStatus { + const minVisibleMs = options.minVisibleMs ?? STATUS_MIN_VISIBLE_MS + let key = '' + let latest: A | null = null + let shown: A | null = null + // While hidden, this is the show delay. While shown, the minimum visible time. + let timer: ReturnType | undefined + + const clearTimer = (): void => { + clearTimeout(timer) + timer = undefined + } + const hide = (): void => { + shown = null + onChange(null) + } + const show = (value: A): void => { + shown = value + onChange({ key, value }) + clearTimer() + timer = setTimeout(() => { + timer = undefined + if (latest === null) { + hide() + } + }, minVisibleMs) + } + + return { + update: (nextKey, value) => { + if (nextKey !== key) { + key = nextKey + clearTimer() + if (shown !== null) { + hide() + } + } + if (shown !== null && latest === null && value !== null) { + clearTimer() + hide() + } + latest = value + + if (shown === null) { + if (value === null) { + clearTimer() + } else if (timer === undefined) { + timer = setTimeout(() => { + timer = undefined + if (latest !== null) { + show(latest) + } + }, options.showDelayMs) + } + return + } + + if (value !== null) { + if (value !== shown) { + show(value) + } + } else if (timer === undefined) { + hide() + } + }, + dispose: clearTimer + } +} diff --git a/src/renderer/src/runtime/structured-agent-session-status-feed-lifecycle.test.ts b/src/renderer/src/runtime/structured-agent-session-status-feed-lifecycle.test.ts index 4f98700d8067..e192bddae52e 100644 --- a/src/renderer/src/runtime/structured-agent-session-status-feed-lifecycle.test.ts +++ b/src/renderer/src/runtime/structured-agent-session-status-feed-lifecycle.test.ts @@ -27,7 +27,9 @@ const owned: AgentSessionStatusSummary = { status: 'working', latestPrompt: 'work', updatedAt: 1, - hostExecutionOwned: true + hostExecutionOwned: true, + hostExecutionPhase: 'starting', + hostExecutionChild: { generation: 'child-1', fence: 1 } } const done: AgentSessionStatusSummary = { ...owned, @@ -69,7 +71,12 @@ describe('structured status feed execution authority lifecycle', () => { subscription().emit({ type: 'snapshot', sessions: [owned, done] }) subscription().emit({ type: 'end' }) expect(subscription().unsubscribe).toHaveBeenCalledOnce() - expect(feed.getSnapshot().get('running')).toEqual({ ...owned, hostExecutionOwned: undefined }) + expect(feed.getSnapshot().get('running')).toEqual({ + ...owned, + hostExecutionOwned: undefined, + hostExecutionPhase: undefined, + hostExecutionChild: undefined + }) expect(feed.getSnapshot().get('completed')).toBe(done) subscription().emit({ type: 'status', session: owned }) expect(feed.getSnapshot().get('running')?.hostExecutionOwned).toBeUndefined() diff --git a/src/renderer/src/runtime/structured-agent-session-status-feed.ts b/src/renderer/src/runtime/structured-agent-session-status-feed.ts index 84bbcacdeccf..7e4d7f27eb8e 100644 --- a/src/renderer/src/runtime/structured-agent-session-status-feed.ts +++ b/src/renderer/src/runtime/structured-agent-session-status-feed.ts @@ -95,7 +95,12 @@ function createOwner(target: RuntimeClientTarget): OwnedStatusFeed { if (!next) { next = new Map(snapshot) } - const { hostExecutionOwned: _owned, hostExecutionPhase: _phase, ...retained } = summary + const { + hostExecutionOwned: _owned, + hostExecutionPhase: _phase, + hostExecutionChild: _child, + ...retained + } = summary next.set(sessionId, retained) } if (next) { diff --git a/src/shared/agent-session-wire.ts b/src/shared/agent-session-wire.ts index 445582c4ad31..513243f8f543 100644 --- a/src/shared/agent-session-wire.ts +++ b/src/shared/agent-session-wire.ts @@ -187,6 +187,9 @@ export type AgentSessionStatusSummary = { /** With `hostExecutionOwned`: whether that child has proven its start. `starting` is a * published session whose provider has not yet answered startup; absent on older hosts. */ hostExecutionPhase?: 'starting' | 'ready' + /** The current provider child, distinct from the conversation and from replacement children. + * Absent on older hosts and whenever this host has no live child. */ + hostExecutionChild?: { generation: string | null; fence: number } latestPrompt: string /** Provider model in force for the next turn; absent until the host has read the options. */ model?: string From 2dc2693953705275c1d80477c555baa938631ace Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:48:34 -0700 Subject: [PATCH 57/90] fix(native-chat): a turn a proven crash cut short reads interrupted (#23456) * fix(native-chat): a turn a proven crash cut short reads interrupted, ending when it was last seen working * fix(native-chat): end a probe-proven turn at the last row the journal wrote live A revised item keeps its first sighting's timestamp, so a long command or a streamed reply read as ending when it started. The reducer now tracks the latest live row the same way it tracks all activity. * test(native-chat): give the unexpected-exit fake journal its live-activity read * refactor(native-chat): read the journal's live bound only for a probe-proven death * fix(native-chat): mark what a journal open settles for a gone host as crash reconciliation A crashed host's working roster is retired when the journal reopens. That row was written live, so a probe-proven turn ended at the relaunch and counted the downtime. * fix(native-chat): bound a probe-proven death with the last time Orca proved the owner alive A crash mid-tool left the turn ending at the tool call's start, because Claude writes nothing while a Bash call runs. The death evidence now records the lease's last renewal before the death as lastProvenAliveAt, and the turn ends at the later of that and the last live row, capped at the probe. Parking a lease in recovery no longer stamps lastRenewedAt, since nothing proved the owner alive then; a child that outlived Orca would otherwise have its turn count the downtime. * test(native-chat): a failed acquisition parked in recovery keeps its last proof of life, and the timing read goes through the display selector * refactor(native-chat): move the submission dispatch folds out of the journal reducer Main grew the reducer to its line limit, so the live-activity bound tipped it over. The dispatch row and echo-acceptance folds move unchanged into their own module. * test(native-chat): a send or reader that opens a crashed chat settles a proven death interrupted Main's open-time settle test still asserted the old rule, where only a watched exit proved a death. * docs(native-chat): say which proofs of death record a last proof of life * fix(native-chat): a proof of life bounds only the owner that wrote the turn A start after a crash that spawned a child and then failed without proving it gone parks that child for recovery; when recovery finds it gone, the proof of death carries its proof of life, which is after the crash. The older turn then ended there and counted the downtime. The journal now derives the fence of its newest live writer, and the lease that holds the proof names the owner it released by the fence it moved to. The last renewal counts only when that move was one step past the writer of the turn. * test(native-chat): a crash with a send in doubt still ends at the last proof of life The reopen settles that send at the new fence, so the owner check must read the fence of live rows only. * fix(native-chat): a proof of death judges only the turn its own owner wrote The settle read the record's latest proof of death for whatever turn a gone generation left running. After a crash, a start that reserved a new fence cleared the relaunch's proof, and if it then failed, its own child's death (a watched exit at the failure, or a probe finding the child it left for recovery gone) ended the older turn an hour after the crash. Every proof of death now records ownerFence, the fence of the owner or reservation it is about; a fence names exactly one owner. The journal derives the fence each item was created at, and a running turn is interrupted only by a proof naming its own owner; otherwise it is unverifiable. Evidence older builds wrote keeps their rule. This replaces the derived one-step fence check. * test(native-chat): every writer of a watched exit names the owner it released A watched exit that names no owner reads the older rule, so the settle alone cannot tell a dropped field; the writers are pinned directly, including past a recovery floor. * test(native-chat): give the fake journal's cast its safety rationale * fix(native-chat): a proof of death written after a chat opened revises the turn it left unverifiable On desktop the chat on screen at relaunch opens before the startup reconcile has probed its owner, so the open settles the cut-off turn unverifiable. When the reconcile then records the proof, it re-runs the same settle for every open conversation, which revises that owner's unverifiable turns to interrupted with the proof's end. Any later open re-runs it too, so a failed write converges. Only upward, only for a proof that names the turn's own owner. * test(native-chat): a chat read before the reconcile reads unverifiable, then interrupted Covers the reconcile revising an open chat to the last renewal (27 s) and a subscriber being sent both states, a start after the crash whose running turn the queued revision leaves alone, a failed revision write converging at the next open, a proof about another owner or from an older build never revising, and a second settle writing nothing. * fix(native-chat): revise an open chat's turn wherever a proof of death is written The store tells its listeners, once committed, of each record a transaction gave a new proof of death, so every writer (the startup reconcile, a recovery that stopped a child which outlived Orca, a failed start, a watched exit) triggers the same serialized resettle for a chat already open. The reconcile's own callback is gone. Quit stops listening first, and a queued resettle is drained with the starts. * test(native-chat): a failed exit settlement is retried in place once the exit is recorded Recording a watched exit now queues the same settle an open runs, so the turn converges without waiting for the chat to be reopened. The reopen and read-after-restart cases now refuse that retry too, so they still pin the open's own settle. * test(native-chat): tests that pin a send settling a failed exit refuse the in-place retry too The exit's release now queues the same settle, so two tests named for the send's settle refuse that retry as well; the comments that said nothing retries it now say what does. * fix(native-chat): name the explanation row by the death it explains, so a retried settle adds no second row * fix(native-chat): end a crashed turn at its owner's provider output, never at a later send A send accepted into a crashed chat before the proof of death wrote a submission row live, and the journal-wide last-live-row bound counted it, so the revised turn ended at the send and counted Orca's downtime. The bound is now the last row the owner's provider child wrote, per writer fence: submissions, dispatch rows and crash reconciliation are Orca's or the user's, and a newer owner's work says nothing about the dead one. * fix(native-chat): end a crashed turn at its last proof of life, never at a timeline row The end of a probe-proven death was the later of the last renewal and the last live timeline row. A send accepted into a crashed chat before the proof writes a row live, so the revised turn ended at the send and counted Orca's downtime. Rows cannot tell the agent's output from Orca's or the user's, so the end is now the last renewal alone, never after the probe, and never before the turn began. The journal's live-activity bound and the reopen's recovered marker, which existed only for it, are gone. * test(native-chat): drop a stale reference to the removed live-activity bound --- .../agent-session-journal/journal-reducer.ts | 20 +- .../agent-session-journal/journal-store.ts | 3 + ...uctured-agent-session-conversation-open.ts | 59 +- ...tured-agent-session-crash-turn-end.test.ts | 528 ++++++++++++++++++ ...gent-session-dead-generation-settlement.ts | 31 +- .../structured-agent-session-host-delivery.ts | 20 + ...uctured-agent-session-host-test-abandon.ts | 2 +- .../structured-agent-session-host.ts | 2 +- ...agent-session-send-open-stale-turn.test.ts | 27 +- ...ured-agent-session-stale-turn-open.test.ts | 23 +- ...d-agent-session-stale-turn-verdict.test.ts | 347 +++++++++++- ...ctured-agent-session-stale-turn-verdict.ts | 96 +++- ...red-agent-session-surface-lifetime.test.ts | 4 +- ...ured-agent-session-unexpected-exit.test.ts | 3 +- ...tructured-agent-session-unexpected-exit.ts | 4 +- ...t-session-wedged-profile-migration.test.ts | 53 +- ...-session-acquisition-failure-settlement.ts | 66 ++- ...session-death-evidence-persistence.test.ts | 228 ++++++++ .../runtime/agent-session-record-store.ts | 30 +- ...agent-session-restart-lease-transitions.ts | 15 +- ...session-surface-release-transition.test.ts | 2 + ...gent-session-surface-release-transition.ts | 3 +- .../structured-agent-session-at-rest.test.ts | 6 +- .../agent-session-lease-adjudication.test.ts | 32 +- .../agent-session-lease-adjudication.ts | 24 +- src/shared/agent-session-record.ts | 20 +- ...sion-death-evidence-downgrade.unit.test.ts | 61 ++ 27 files changed, 1569 insertions(+), 140 deletions(-) create mode 100644 src/main/native-chat/agent-session-wire/structured-agent-session-crash-turn-end.test.ts create mode 100644 src/main/runtime/agent-session-death-evidence-persistence.test.ts create mode 100644 tests/e2e/cross-version-wire/agent-session-death-evidence-downgrade.unit.test.ts diff --git a/src/main/native-chat/agent-session-journal/journal-reducer.ts b/src/main/native-chat/agent-session-journal/journal-reducer.ts index 7ce1f4ef1c1d..d7e22575702d 100644 --- a/src/main/native-chat/agent-session-journal/journal-reducer.ts +++ b/src/main/native-chat/agent-session-journal/journal-reducer.ts @@ -42,6 +42,8 @@ export type JournalReducerState = { oldestSequence: number highestFence: number items: Map + /** Fence of the writer that created each item: the generation a running turn belongs to. */ + itemFences: Map /** Revision of a removed item, so a late lower revision cannot resurrect it. */ tombstones: Map submissions: Map @@ -61,6 +63,7 @@ export function createJournalReducerState(sessionId: string, epoch: string): Jou oldestSequence: 1, highestFence: 0, items: new Map(), + itemFences: new Map(), tombstones: new Map(), submissions: new Map(), receipts: new Map(), @@ -82,7 +85,13 @@ export function applyJournalRow(state: JournalReducerState, row: JournalRow): vo } const itemId = resolveJournalItemId(state, row.itemId, row.body) acceptSubmissionFromProviderItem(state, row.itemId, itemId, row) - upsertItem(state, itemId, row.revision, journalRenderItem(itemId, row.revision, row.body, row)) + upsertItem( + state, + itemId, + row.revision, + journalRenderItem(itemId, row.revision, row.body, row), + row.fence + ) return } if (row.kind === 'tombstone') { @@ -103,7 +112,7 @@ export function applyJournalRow(state: JournalReducerState, row: JournalRow): vo acceptSubmissionFromProviderItem(state, mutation.itemId, itemId, row) const producer = journalBatchMutationProducer(row, mutation) const item = journalRenderItem(itemId, revision, body, row, producer, sequenceIndex) - upsertItem(state, itemId, revision, item) + upsertItem(state, itemId, revision, item, row.fence) } else { removeItem(state, resolveItemId(state, mutation.itemId), mutation.revision) } @@ -187,7 +196,8 @@ function upsertItem( state: JournalReducerState, itemId: string, revision: number, - next: AgentJournalRenderItem + next: AgentJournalRenderItem, + fence: number ): void { const tombstoned = state.tombstones.get(itemId) if (tombstoned !== undefined && revision <= tombstoned) { @@ -199,6 +209,7 @@ function upsertItem( } if (!existing) { state.items.set(itemId, next) + state.itemFences.set(itemId, fence) state.tombstones.delete(itemId) return } @@ -237,6 +248,7 @@ function removeItem(state: JournalReducerState, itemId: string, revision: number } state.tombstones.set(itemId, revision) state.items.delete(itemId) + state.itemFences.delete(itemId) } function applySubmission( @@ -255,7 +267,7 @@ function applySubmission( ...(row.handoverRecorded ? { handoverRecorded: true, acceptedSequence: row.seq } : {}) }) const itemId = agentJournalSubmissionKey(row.clientMessageId) - upsertItem(state, itemId, 0, journalRenderItem(itemId, 0, row.body, row)) + upsertItem(state, itemId, 0, journalRenderItem(itemId, 0, row.body, row), row.fence) } function acceptSubmissionFromProviderItem( diff --git a/src/main/native-chat/agent-session-journal/journal-store.ts b/src/main/native-chat/agent-session-journal/journal-store.ts index 45c42b45f8ad..3be3aebbc514 100644 --- a/src/main/native-chat/agent-session-journal/journal-store.ts +++ b/src/main/native-chat/agent-session-journal/journal-store.ts @@ -234,6 +234,9 @@ export class AgentSessionJournal { /** Includes revisions and completion tombstones, whose timestamps disappear from render items. */ lastActivityAt = (): number => this.state.lastActivityAt + /** Fence of the writer that created the item, while it is in the timeline. */ + itemFence = (itemId: string): number | undefined => this.state.itemFences.get(itemId) + submissions = (): AgentJournalSubmission[] => [...this.state.submissions.values()] pendingSubmissions = (): AgentJournalSubmission[] => diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-open.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-open.ts index bce79ca71f87..dd8853954e3f 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-open.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-open.ts @@ -10,6 +10,7 @@ import type { AgentJournalResetReason } from '../../../shared/agent-session-journal-types' import { journalDirectoryFor } from '../agent-session-journal/journal-paths' +import type { AgentSessionJournal } from '../agent-session-journal/journal-store' import { openAgentSessionJournalWithRecovery } from './agent-session-journal-recovery' import { computeAgentSessionPayloadFingerprint } from '../../../shared/agent-session-mutation-envelope' import type { AgentSessionRecord } from '../../../shared/agent-session-record' @@ -103,23 +104,11 @@ export async function openStructuredAgentSessionConversationJournal( } catch (error) { deps.onEventSinkError?.({ sessionId, error }) } - try { - // No child in this process writes to a journal nobody had open, so whatever it shows running - // belongs to a generation that is gone, whatever the lease still claims. Settled before any - // reader or child sees it. - if (!options.acquisition) { - await settleStaleStructuredAgentSessionState({ - journal: opened.journal, - sessionId, - fence, - acquisitionGeneration: null, - deathEvidence: record.lease.deathEvidence ?? null, - failureTextContext: structuredAgentSessionFailureWordsContext(record) - }) - } - } catch (error) { - // Best effort: the next acquire re-derives it. - deps.onEventSinkError?.({ sessionId, error }) + // No child in this process writes to a journal nobody had open, so whatever it shows running + // belongs to a generation that is gone, whatever the lease still claims. Settled before any + // reader or child sees it. + if (!options.acquisition) { + await settleGoneGeneration(deps, record, opened.journal) } return { session: { journal: opened.journal, params, child: null }, @@ -127,6 +116,42 @@ export async function openStructuredAgentSessionConversationJournal( } } +/** + * The open's settle again, for a conversation already open: a proof of death written since it + * opened (the startup reconcile, a recovery) revises what the open could only call `unverifiable`. + * A record holds a proof only while released, so no child here is writing. A no-op once revised. + */ +export async function resettleOpenStructuredAgentSessionConversation( + deps: StructuredAgentSessionConversationOpenDeps, + sessionId: string, + session: StructuredAgentSessionHostSession | undefined +): Promise { + const record = deps.store.getRecord(sessionId) + if (session && record?.lease.deathEvidence) { + await settleGoneGeneration(deps, record, session.journal) + } +} + +async function settleGoneGeneration( + deps: Pick, + record: AgentSessionRecord, + journal: AgentSessionJournal +): Promise { + try { + await settleStaleStructuredAgentSessionState({ + journal, + sessionId: record.sessionId, + fence: record.lease.runtimeFence, + acquisitionGeneration: null, + deathEvidence: record.lease.deathEvidence ?? null, + failureTextContext: structuredAgentSessionFailureWordsContext(record) + }) + } catch (error) { + // Best effort: the next open or acquire re-derives it. + deps.onEventSinkError?.({ sessionId: record.sessionId, error }) + } +} + export function attachParamsForRecord( record: AgentSessionRecord, input: { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-crash-turn-end.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-crash-turn-end.test.ts new file mode 100644 index 000000000000..0d83491ee21f --- /dev/null +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-crash-turn-end.test.ts @@ -0,0 +1,528 @@ +// Where a turn a crash cut short ends, when the provider wrote nothing while it worked. +// +// Claude reports a Bash call once when it starts and again only when it finishes, so a command +// that runs for half a minute leaves one journal row at its start. The lease renewal the host +// wrote every ten seconds is what saw the child working after that row. + +import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import type { AgentSessionOwnerProbe } from '../../../shared/agent-session-lease-adjudication' +import type { AgentSessionRecord } from '../../../shared/agent-session-record' +import type { AgentSessionSubscribeEvent } from '../../../shared/agent-session-wire' +import { readAgentJournalTurn } from '../../../shared/agent-session-turn-record' +import { + completedStructuredAgentTurnSeconds, + selectStructuredAgentTurnTimings +} from '../../../shared/structured-agent-session-turn-timing' +import { AgentSessionRecordStore } from '../../runtime/agent-session-record-store' +import { AGENT_SESSION_STORE_FILE_NAME } from '../../runtime/agent-session-record-store-file' +import { journalDirectoryFor } from '../agent-session-journal/journal-paths' +import { openAgentSessionJournal } from '../agent-session-journal/journal-store-factory' +import { + AgentSessionAcquisitionExitUnprovenError, + type StructuredAgentSessionAdapter +} from './structured-agent-session-adapter' +import { resettleOpenStructuredAgentSessionConversation } from './structured-agent-session-conversation-open' +import { StructuredAgentSessionHost } from './structured-agent-session-host' +import { STRUCTURED_AGENT_SESSION_IDLE_MS } from './structured-agent-session-idle-sweep' +import type { StructuredAgentSessionHostDeps } from './structured-agent-session-host-types' +import { + hostTestAttachParams, + HOST_TEST_LOCATION as LOCATION, + HOST_TEST_SESSION as SESSION +} from './structured-agent-session-host-test-data' + +const PROVIDER_SESSION = 'provider-session-alpha-1' +/** The tool call's row: the last thing the provider wrote before the crash. */ +const TOOL_STARTED_AT = 1_800_000_000_000 +/** The last renewal before the crash, while the command was still running. */ +const LAST_RENEWED_AT = TOOL_STARTED_AT + 25_000 +/** Orca comes back an hour later. */ +const RELAUNCHED_AT = TOOL_STARTED_AT + 60 * 60 * 1000 + +let root: string +let store: AgentSessionRecordStore +let host: StructuredAgentSessionHost + +function crashedClaudeRecord(): AgentSessionRecord { + const linkId = 'claude-13-link' + return { + schemaVersion: 2, + sessionId: SESSION, + location: LOCATION, + provider: 'claude', + providerHandleChain: [ + { + linkId, + handle: { provider: 'claude', sessionId: PROVIDER_SESSION, leafUuid: null }, + origin: 'created', + mintedAtFence: 13, + observedAt: TOOL_STARTED_AT - 60_000 + } + ], + accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude' }, + createdAt: TOOL_STARTED_AT - 60_000, + updatedAt: LAST_RENEWED_AT, + lease: { + sessionId: SESSION, + runtimeKind: 'native', + runtimeFence: 13, + handoffStage: null, + provenHandleLinkId: linkId, + ownerProcess: { + hostId: 'local', + pid: 12_546, + processStartTimeMs: TOOL_STARTED_AT - 60_000, + spawnToken: 'spawn-crashed' + }, + reservedSpawnToken: 'spawn-crashed', + leaseDeadlineAt: LAST_RENEWED_AT + 30_000, + lastRenewedAt: LAST_RENEWED_AT, + handoffOperationId: null, + journalCheckpoint: null, + claimKeyId: 'key-1', + claimStatus: 'live', + unreconciled: false, + deathEvidence: null + } + } +} + +async function seedCrashedStore(): Promise { + const directory = join(root, 'store') + await mkdir(directory, { recursive: true }) + await writeFile( + join(directory, AGENT_SESSION_STORE_FILE_NAME), + JSON.stringify({ + schemaVersion: 2, + hostId: 'local', + records: { [SESSION]: crashedClaudeRecord() }, + operations: {}, + retiredClaimKeys: [], + unusableRecords: {} + }), + 'utf-8' + ) + store = await AgentSessionRecordStore.open({ directory, hostId: 'local' }) +} + +/** A running turn whose only row after its start is a Bash call that never reported back, for a + * send the provider never acknowledged: the reopen settles it at the fence after the crash. */ +async function seedClaudeToolTurn(): Promise { + let now = TOOL_STARTED_AT - 2_000 + const journal = await openAgentSessionJournal({ + identity: { + sessionId: SESSION, + workspaceId: LOCATION.workspaceId, + hostId: LOCATION.executionHostId, + agent: 'claude', + providerHandle: { kind: 'claude', sessionId: PROVIDER_SESSION, leafUuid: null } + }, + journalDir: journalDirectoryFor(root, { + workspaceId: LOCATION.workspaceId, + sessionId: SESSION + }), + now: () => now + }) + await journal.appendSubmission({ + clientMessageId: 'send-1', + payloadFingerprint: '0'.repeat(64), + body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text: 'run the loop' }] }, + fence: 13 + }) + await journal.appendItem( + { provider: 'claude', sessionId: PROVIDER_SESSION, uuid: 'uuid-turn' }, + { kind: 'turn', turnId: 'turn-1', state: 'running', startedAt: now }, + { fence: 13 } + ) + now = TOOL_STARTED_AT + await journal.appendItem( + { provider: 'claude', sessionId: PROVIDER_SESSION, uuid: 'uuid-bash' }, + { + kind: 'tool-call', + name: 'Bash', + input: { command: 'for i in $(seq 90); do sleep 1; done' }, + state: 'running' + }, + { fence: 13 } + ) + await journal.close() +} + +function openHost(overrides: Partial): void { + host = new StructuredAgentSessionHost({ + store, + adapter: { + acquire: vi.fn(), + dispatch: vi.fn(), + cancelTurn: vi.fn(), + answerPrompt: vi.fn(), + setOption: vi.fn(), + supportsCreate: () => true + }, + journalRoot: root, + claimKeyId: 'key-1', + mintSpawnToken: () => 'spawn-new', + now: () => RELAUNCHED_AT, + ...overrides + }) +} + +/** What a client reads over the wire. */ +async function settledTurn() { + return (await host.journalSnapshot(SESSION)).items + .map((item) => readAgentJournalTurn(item.body)) + .find(Boolean) +} + +beforeEach(async () => { + root = await mkdtemp(join(tmpdir(), 'orca-crash-turn-end-')) + await seedCrashedStore() + await seedClaudeToolTurn() +}) + +afterEach(async () => { + await host?.flushAllStreamedEvents() + await rm(root, { recursive: true, force: true }) +}) + +describe('a turn a crash cut short mid-tool', () => { + it('ends at the last renewal, not at the tool call the provider last reported', async () => { + openHost({ probeOwner: async () => ({ outcome: 'pid-absent' }) }) + + await host.restoreReadableSessions() + + expect(store.getRecord(SESSION)?.lease.deathEvidence).toMatchObject({ + kind: 'pid-absent', + observedAt: RELAUNCHED_AT, + lastProvenAliveAt: LAST_RENEWED_AT + }) + expect(await settledTurn()).toMatchObject({ + state: 'interrupted', + completedAt: LAST_RENEWED_AT + }) + // "Worked for 27s", where the tool call's row alone reads 2s. + const [timing] = selectStructuredAgentTurnTimings( + (await host.journalSnapshot(SESSION)).items + ).values() + expect(completedStructuredAgentTurnSeconds(timing)).toBe(27) + }) + + it('ends at the pre-crash renewal when the child outlived Orca and recovery stopped it', async () => { + // The orphan is alive at relaunch, but its output went nowhere: none of that is work shown. + let alive = true + const probeOwner = async (): Promise => + alive + ? { outcome: 'identity-matched', matchedOn: ['spawn-token'] } + : { outcome: 'pid-absent' } + const stopOwnerProcess = vi.fn(() => { + alive = false + }) + openHost({ probeOwner, stopOwnerProcess }) + + await host.restoreReadableSessions() + + expect(stopOwnerProcess).toHaveBeenCalledOnce() + expect(store.getRecord(SESSION)?.lease.deathEvidence).toMatchObject({ + kind: 'pid-absent', + lastProvenAliveAt: LAST_RENEWED_AT + }) + expect(await settledTurn()).toMatchObject({ + state: 'interrupted', + completedAt: LAST_RENEWED_AT + }) + }) +}) + +/** Every turn state a subscriber was sent, in order: snapshots, then live batches. */ +function turnStatesSent(events: readonly AgentSessionSubscribeEvent[]) { + return events + .flatMap((event) => + event.type === 'snapshot' ? event.page.items : event.type === 'batch' ? event.batch.items : [] + ) + .flatMap((item) => readAgentJournalTurn(item.body) ?? []) +} + +function attach(fence: number) { + return host.attach( + { callerKey: 'client-1' }, + hostTestAttachParams(fence, { + provider: 'claude', + agent: 'claude', + accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude' }, + providerHandle: { kind: 'claude', sessionId: PROVIDER_SESSION, leafUuid: null } + }) + ) +} + +/** Runs whatever this session's serialize already has queued. */ +function drainSession(): Promise { + return host.collaboratorsForTests().serialize(SESSION, async () => {}) +} + +// On desktop the chat on screen at relaunch opens before the startup reconcile has probed its owner, +// so the open can only call the turn unverifiable; the proof, whoever writes it, then revises it. +describe('a turn a read reached before the reconcile proved its owner dead', () => { + it('reads unverifiable, then interrupted at the last renewal, and a subscriber is sent both', async () => { + openHost({ probeOwner: async () => ({ outcome: 'pid-absent' }) }) + const events: AgentSessionSubscribeEvent[] = [] + const unsubscribe = await host.subscribe({ + id: 'reader-1', + sessionId: SESSION, + emit: (event) => events.push(event) + }) + expect(await settledTurn()).toEqual(UNVERIFIABLE_TURN) + + await host.reconcileRestartLeases() + await drainSession() + + // A paired or phone client learns of the revision through the ordinary journal publish. + await vi.waitFor(() => + expect(turnStatesSent(events)).toMatchObject([ + { state: 'unverifiable' }, + { state: 'interrupted', completedAt: LAST_RENEWED_AT } + ]) + ) + const { items } = await host.journalSnapshot(SESSION) + const [timing] = selectStructuredAgentTurnTimings(items).values() + expect(completedStructuredAgentTurnSeconds(timing)).toBe(27) + expect(items.filter((item) => item.body.kind === 'status')).toHaveLength(1) + unsubscribe() + }) + + it('revises nothing twice, whoever re-runs the settle', async () => { + openHost({ probeOwner: async () => ({ outcome: 'pid-absent' }) }) + await host.history({ sessionId: SESSION, direction: 'tail' }) + await host.reconcileRestartLeases() + await drainSession() + const settled = await host.journalSnapshot(SESSION) + + await host + .collaboratorsForTests() + .serialize(SESSION, () => + resettleOpenStructuredAgentSessionConversation( + host.deps, + SESSION, + host.collaboratorsForTests().sessions.get(SESSION) + ) + ) + await host.restoreReadableSessions() + + expect(await host.journalSnapshot(SESSION)).toEqual(settled) + }) + + it('revises it when recovery stops a child that outlived Orca, with no send', async () => { + let alive = true + const probeOwner = async (): Promise => + alive + ? { outcome: 'identity-matched', matchedOn: ['spawn-token'] } + : { outcome: 'pid-absent' } + const stopOwnerProcess = vi.fn(() => { + alive = false + }) + const acquire = vi.fn() + openHost({ + adapter: { + acquire, + dispatch: vi.fn(), + cancelTurn: vi.fn(), + answerPrompt: vi.fn(), + setOption: vi.fn(), + supportsCreate: () => true + }, + probeOwner, + stopOwnerProcess + }) + await host.history({ sessionId: SESSION, direction: 'tail' }) + expect(await settledTurn()).toEqual(UNVERIFIABLE_TURN) + + // The reconcile only parks the live orphan in recovery; recovery's stop is what proves it gone. + await host.restoreReadableSessions() + await drainSession() + + expect(stopOwnerProcess).toHaveBeenCalledOnce() + expect(acquire).not.toHaveBeenCalled() + expect(await settledTurn()).toMatchObject({ + state: 'interrupted', + completedAt: LAST_RENEWED_AT + }) + }) + + it('never touches the turn a start after the crash is writing', async () => { + const acquire = vi.fn( + async ({ fence, spawnToken, onSpawned, events }) => { + const process = { + hostId: 'local', + pid: 8_000, + processStartTimeMs: RELAUNCHED_AT, + spawnToken + } + await onSpawned?.(process) + // The new child is already working when its start lands, ahead of the queued revision. + events?.appendItem( + { provider: 'claude', sessionId: PROVIDER_SESSION, uuid: 'uuid-turn-2' }, + { kind: 'turn', turnId: 'turn-2', state: 'running', startedAt: RELAUNCHED_AT } + ) + return { + process, + link: { + linkId: `claude-${fence}-link`, + handle: { provider: 'claude', sessionId: PROVIDER_SESSION, leafUuid: null }, + origin: 'resumed', + mintedAtFence: fence, + observedAt: RELAUNCHED_AT + } + } + } + ) + openHost({ + adapter: { + acquire, + dispatch: vi.fn(), + cancelTurn: vi.fn(), + answerPrompt: vi.fn(), + setOption: vi.fn(), + supportsCreate: () => true + }, + probeOwner: async () => ({ outcome: 'pid-absent' }) + }) + await host.history({ sessionId: SESSION, direction: 'tail' }) + + // The start runs the reconcile itself, so the revision it queues waits behind the start. + await expect(attach(14)).resolves.toMatchObject({ ok: true }) + await host.flushStreamedEvents(SESSION) + await drainSession() + + const turns = (await host.journalSnapshot(SESSION)).items.flatMap( + (item) => readAgentJournalTurn(item.body) ?? [] + ) + expect(turns).toMatchObject([ + { turnId: 'turn-1', state: 'interrupted', completedAt: LAST_RENEWED_AT }, + { turnId: 'turn-2', state: 'running' } + ]) + }) + + it('stays unverifiable when the revision cannot be written, and a later open revises it', async () => { + let now = RELAUNCHED_AT + const onEventSinkError = vi.fn() + openHost({ + probeOwner: async () => ({ outcome: 'pid-absent' }), + now: () => now, + onEventSinkError + }) + await host.history({ sessionId: SESSION, direction: 'tail' }) + const { journal } = host.collaboratorsForTests().sessions.get(SESSION)! + vi.spyOn(journal, 'appendLifecycleBatch').mockRejectedValueOnce(new Error('disk full')) + + await host.reconcileRestartLeases() + await drainSession() + + expect(onEventSinkError).toHaveBeenCalledOnce() + expect(await settledTurn()).toEqual(UNVERIFIABLE_TURN) + // The proof is durable on the record, so the next open converges. + now += STRUCTURED_AGENT_SESSION_IDLE_MS + 1 + await host.collaboratorsForTests().lifetime.idleSweep.tick() + expect(host.hasSession(SESSION)).toBe(false) + expect(await settledTurn()).toMatchObject({ + state: 'interrupted', + completedAt: LAST_RENEWED_AT + }) + }) +}) + +/** A relaunched host whose first start after the crash, at fence 15, fails with `failure`; every + * later start succeeds. The crashed owner, and any child left behind, probe gone. */ +async function hostWithFailingFirstStart(failure: Error) { + let now = RELAUNCHED_AT + const acquire = vi.fn( + async ({ fence, spawnToken, onSpawned }) => { + const process = { hostId: 'local', pid: 7_000 + fence, processStartTimeMs: now, spawnToken } + await onSpawned?.(process) + if (fence === 15) { + throw failure + } + return { + process, + link: { + linkId: `claude-${fence}-link`, + handle: { provider: 'claude', sessionId: PROVIDER_SESSION, leafUuid: null }, + origin: 'resumed', + mintedAtFence: fence, + observedAt: now + } + } + } + ) + openHost({ + adapter: { + acquire, + releaseAcquisition: async () => true, + dispatch: vi.fn(), + cancelTurn: vi.fn(), + answerPrompt: vi.fn(), + setOption: vi.fn(), + supportsCreate: () => true + }, + probeOwner: async () => ({ outcome: 'pid-absent' }), + now: () => now + }) + await host.reconcileRestartLeases() + return { + attach, + advance: (ms: number) => { + now += ms + } + } +} + +/** The turn as the crashed owner left it, with no end: nothing proves when that owner stopped. */ +const UNVERIFIABLE_TURN = { + turnId: 'turn-1', + state: 'unverifiable', + startedAt: TOOL_STARTED_AT - 2_000 +} + +// The relaunch proved the fence-13 owner gone, but a start reserving fence 15 clears that proof +// before the turn is settled; what the record holds afterwards is about the start's own child. +describe('a turn a newer start could not settle before it failed', () => { + it('is not judged by the death of the child it left for recovery', async () => { + const { attach, advance } = await hostWithFailingFirstStart( + new AgentSessionAcquisitionExitUnprovenError(new Error('hung')) + ) + + await attach(14).catch(() => undefined) + expect(store.getRecord(SESSION)?.lease).toMatchObject({ + runtimeFence: 15, + handoffStage: 'recovering', + lastRenewedAt: RELAUNCHED_AT + }) + advance(60_000) + // Recovery records that child's death, then the client retries at the fence it was told. + await expect(attach(15)).resolves.toMatchObject({ refusal: { currentFence: 16 } }) + expect(store.getRecord(SESSION)?.lease.deathEvidence).toMatchObject({ + ownerFence: 15, + lastProvenAliveAt: RELAUNCHED_AT + }) + await expect(attach(16)).resolves.toMatchObject({ ok: true }) + + expect(await settledTurn()).toEqual(UNVERIFIABLE_TURN) + }) + + it('is not judged by the watched exit of a start that failed', async () => { + const { attach, advance } = await hostWithFailingFirstStart(new Error('claude exited (code 1)')) + + await expect(attach(14)).resolves.toMatchObject({ ok: false }) + expect(store.getRecord(SESSION)?.lease.deathEvidence).toMatchObject({ + kind: 'exit-observed', + ownerFence: 15, + observedAt: RELAUNCHED_AT + }) + advance(60_000) + await expect(attach(16)).resolves.toMatchObject({ ok: true }) + + // Main ended it at the failed start, an hour after the crash, with the start's reason. + expect(await settledTurn()).toEqual(UNVERIFIABLE_TURN) + }) +}) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-dead-generation-settlement.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-dead-generation-settlement.ts index f6a166c7c02d..8ee3430c5c91 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-dead-generation-settlement.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-dead-generation-settlement.ts @@ -25,6 +25,7 @@ import { } from './structured-agent-session-start-failure-row' import type { AgentSessionDeathEvidence } from '../../../shared/agent-session-record' import { + provenUnverifiableTurnRevisions, runningTurnLifecycleRevisions, turnVerdictFromDeathEvidence, type StructuredAgentSessionTurnVerdict @@ -185,9 +186,9 @@ export async function settleStructuredAgentSessionDeadGeneration(input: { /** * Settles whatever a generation with no child in this process left running: found when a new child * is acquired, or when a chat is reopened for reading. Derived from the journal and the lease's - * death evidence each time, so nothing is owed in between. Only an observed exit earns an end time - * and the exit copy. Must run before a new child's buffered events land, or a live turn would be - * judged. + * death evidence each time, so nothing is owed in between. Proven death ends the turn interrupted, + * and a proof written after an earlier settle revises what that settle left `unverifiable`. Must + * run before a new child's buffered events land, or a live turn would be judged. */ export async function settleStaleStructuredAgentSessionState(input: { journal: AgentSessionJournal @@ -200,7 +201,10 @@ export async function settleStaleStructuredAgentSessionState(input: { }): Promise { const { journal } = input const items = journal.snapshot().items - const verdict = turnVerdictFromDeathEvidence(input.deathEvidence) + // Each turn is judged by the evidence only if it names that turn's owner. + const verdictFor = (item: AgentJournalRenderItem) => + turnVerdictFromDeathEvidence(input.deathEvidence, journal.itemFence(item.itemId)) + // Per attempt: a retry re-partitions only what is left, and a reused chunk id would skip it. const generation = input.acquisitionGeneration ?? `seq-${journal.cursor().sequence}` const settlementId = `stale-session:${input.sessionId}:${input.fence}:${generation}` const mutations: JournalLifecycleMutationInput[] = [] @@ -211,11 +215,24 @@ export async function settleStaleStructuredAgentSessionState(input: { mutations.push({ kind: 'item', identity, body }) } } - mutations.push(...runningTurnLifecycleRevisions(items, verdict)) - if (verdict.state === 'interrupted' && items.some(isInProgressItem)) { + const proven = provenUnverifiableTurnRevisions(items, input.deathEvidence, journal) + mutations.push( + ...items.flatMap((item) => runningTurnLifecycleRevisions([item], verdictFor(item))), + ...proven + ) + const evidence = input.deathEvidence + if ( + evidence && + (proven.length > 0 || + items.some((item) => isInProgressItem(item) && verdictFor(item).state === 'interrupted')) + ) { mutations.unshift({ kind: 'item', - identity: { provider: 'orca', clientMessageId: settlementId }, + // Named by the death it explains, so a retry after a partly written settle adds no second row. + identity: { + provider: 'orca', + clientMessageId: `stale-session:${input.sessionId}:death-${evidence.ownerFence ?? 'unowned'}-${evidence.observedAt}` + }, // The death evidence is Orca's log text, never a sentence for a person: the row says only // that the provider stopped. body: { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-host-delivery.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-host-delivery.ts index dace93edc621..d85d1dfee0f2 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-host-delivery.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-host-delivery.ts @@ -7,6 +7,7 @@ import type { AgentJournalResetReason } from '../../../shared/agent-session-jour import type { AgentSessionJournal } from '../agent-session-journal/journal-store' import { openStructuredAgentSessionConversation, + resettleOpenStructuredAgentSessionConversation, type OpenedStructuredAgentSessionConversation, type StructuredAgentSessionConversationOpenOptions } from './structured-agent-session-conversation-open' @@ -28,6 +29,8 @@ export type StructuredAgentSessionConversationDelivery = { sessionId: string, options?: StructuredAgentSessionConversationOpenOptions ) => Promise + /** Stops the loop and the resettle on a proof of death; quit's first step. */ + dispose: () => void /** Indexes a conversation some other open produced, as `open` would have. */ adoptOpened: ( sessionId: string, @@ -76,9 +79,26 @@ export function createStructuredAgentSessionConversationDelivery(input: { loop.wake(sessionId) } } + // A chat open before its owner's death was proven revises what its open settled. Queued, never + // awaited: the writer can hold this session's serialize (an attach recovering its lease). + const stopResettling = deps.store.onDeathEvidence((sessionId) => { + if (sessions.has(sessionId)) { + void input + .trackStart( + input.serialize(sessionId, () => + resettleOpenStructuredAgentSessionConversation(deps, sessionId, sessions.get(sessionId)) + ) + ) + .catch((error: unknown) => deps.onEventSinkError?.({ sessionId, error })) + } + }) return { loop, adoptOpened, + dispose: () => { + loop.dispose() + stopResettling() + }, open: (sessionId, options) => openStructuredAgentSessionConversation({ deps, sessions, adoptOpened }, sessionId, options) } diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-host-test-abandon.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-host-test-abandon.ts index de928eb32e7f..a4069875bade 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-host-test-abandon.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-host-test-abandon.ts @@ -16,7 +16,7 @@ export async function abandonStructuredAgentSessionHost( host: StructuredAgentSessionHost ): Promise { // First, so the drain below cannot race the loop into enqueueing another step. - host['conversationDelivery'].loop.dispose() + host['conversationDelivery'].dispose() host['lifetime'].dispose() await host['runtimeState'].stopLeaseRenewal() await host['tasks'].drainAttaches() diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-host.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-host.ts index eba441430749..26697d3f6819 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-host.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-host.ts @@ -247,7 +247,7 @@ export class StructuredAgentSessionHost { // Trigger inlined rather than imported: `AgentSessionResumeTrigger` in shared is the canonical // type, and this file has no line budget left for the import. async flushAllStreamedEvents(options?: { trigger?: 'quit' | 'update' }): Promise { - this.conversationDelivery.loop.dispose() + this.conversationDelivery.dispose() await flushStructuredAgentSessionHost({ ...this.lifetimeContext(), idleSweep: this.lifetime, diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-send-open-stale-turn.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-send-open-stale-turn.test.ts index a1f196d8b612..0a14f4361197 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-send-open-stale-turn.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-send-open-stale-turn.test.ts @@ -86,7 +86,6 @@ async function relaunchAfterCrashMidTurn( return { host, acquire } } -/** Neither proof of the old owner's death is an observed exit, so the turn ends `unverifiable`. */ async function turnStates(host: StructuredAgentSessionHost) { return (await host.journalSnapshot(SESSION)).items .flatMap((item) => readAgentJournalTurn(item.body) ?? []) @@ -94,18 +93,20 @@ async function turnStates(host: StructuredAgentSessionHost) { } // A host that cannot prove the old owner gone leaves its lease in recovery, still claimed, until -// the next acquire resolves it: the open is not that acquire, and the turn is no less gone. +// the next acquire resolves it: the open is not that acquire, and the turn is no less gone. Only +// the proof decides whether it reads interrupted. const PROBES = [ - ['the old owner is proven gone', { outcome: 'pid-absent' }], + ['the old owner is proven gone', { outcome: 'pid-absent' }, 'interrupted'], [ 'nothing proves the old owner gone', - { outcome: 'indeterminate', reason: 'This host cannot probe structured session owners.' } + { outcome: 'indeterminate', reason: 'This host cannot probe structured session owners.' }, + 'unverifiable' ] -] as const satisfies readonly (readonly [string, AgentSessionOwnerProbe])[] +] as const satisfies readonly (readonly [string, AgentSessionOwnerProbe, string])[] it.each(PROBES)( 'settles a turn a dead generation left running when a send opens the chat and its start fails, when %s', - async (_when, probe) => { + async (_when, probe, settled) => { const { host, acquire } = await relaunchAfterCrashMidTurn(probe) expect(host.hasSession(SESSION)).toBe(false) @@ -123,32 +124,34 @@ it.each(PROBES)( ) expect(acquire).toHaveBeenCalledOnce() - expect(await turnStates(host)).toEqual(['unverifiable']) + expect(await turnStates(host)).toEqual([settled]) await host.flushAllStreamedEvents() } ) it.each(PROBES)( 'settles the same turn when a reader opens the chat, when %s', - async (_when, probe) => { + async (_when, probe, settled) => { const { host } = await relaunchAfterCrashMidTurn(probe) await host.revealSession(SESSION) - expect(await turnStates(host)).toEqual(['unverifiable']) + expect(await turnStates(host)).toEqual([settled]) await host.flushAllStreamedEvents() } ) -// On desktop the chat on screen at relaunch reads before startup reconciles the leases. -it('settles it when a read reaches the chat before the startup reconcile', async () => { +// On desktop the chat on screen at relaunch reads before startup reconciles the leases: nothing +// has proved its owner gone yet, and the reconcile's proof then revises what the open settled. +it('settles it when a read reaches the chat before the startup reconcile, then revises it', async () => { const { host } = await relaunchAfterCrashMidTurn({ outcome: 'pid-absent' }, { reconcile: false }) expect(hostTestState().store.getRecord(SESSION)?.lease.claimStatus).toBe('live') await host.history({ sessionId: SESSION, direction: 'tail' }) + expect(await turnStates(host)).toEqual(['unverifiable']) await host.reconcileRestartLeases() await host.restoreReadableSessions([SESSION]) - expect(await turnStates(host)).toEqual(['unverifiable']) + expect(await turnStates(host)).toEqual(['interrupted']) await host.flushAllStreamedEvents() }) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-open.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-open.test.ts index 5598cd3c4f72..83959233f6f3 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-open.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-open.test.ts @@ -28,8 +28,9 @@ afterEach(async () => { await rig.dispose() }) -/** A turn in flight whose agent exits, and whose exit settlement the journal refuses. */ -async function exitWithUnwrittenSettlement(): Promise { +/** A turn in flight whose agent exits, and whose exit settlement the journal refuses: by default + * also the retry that recording the exit queues, so only an open is left to settle it. */ +async function exitWithUnwrittenSettlement(refusedWrites = 2): Promise { await foundRestTestChat(rig) const open = rig.host.collaboratorsForTests().sessions.get(SESSION)! const running = open.child! @@ -40,7 +41,10 @@ async function exitWithUnwrittenSettlement(): Promise { { kind: 'turn', turnId: 'working', state: 'running' } ) await rig.host.flushStreamedEvents(SESSION) - vi.spyOn(open.journal, 'appendLifecycleBatch').mockRejectedValueOnce(new Error('disk full')) + const append = vi.spyOn(open.journal, 'appendLifecycleBatch') + for (let refused = 0; refused < refusedWrites; refused += 1) { + append.mockRejectedValueOnce(new Error('disk full')) + } await rig.host.handleAdapterEvent({ type: 'ended', sessionId: SESSION, @@ -55,6 +59,7 @@ async function exitWithUnwrittenSettlement(): Promise { deathEvidence: { kind: 'exit-observed' } }) ) + await rig.host.collaboratorsForTests().serialize(SESSION, async () => {}) } async function workingTurnState(): Promise { @@ -65,6 +70,18 @@ async function workingTurnState(): Promise { } describe('a turn its gone agent left running', () => { + it('is settled in place by the retry recording the exit queues, with no reopen', async () => { + await exitWithUnwrittenSettlement(1) + + expect(rig.host.collaboratorsForTests().sessions.has(SESSION)).toBe(true) + expect(await workingTurnState()).toBe('interrupted') + const { items } = await rig.host.journalSnapshot(SESSION) + expect(JSON.stringify(items)).toContain( + 'Codex stopped while this response was in progress. You can continue in this conversation.' + ) + expect(rig.adapter.acquire).toHaveBeenCalledOnce() + }) + it('is settled when the idle-closed conversation is opened again, and its reader sees it', async () => { await exitWithUnwrittenSettlement() expect(await workingTurnState()).toBe('running') diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-verdict.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-verdict.test.ts index 4ab7b3ad010c..2c7a91e76378 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-verdict.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-verdict.test.ts @@ -4,6 +4,8 @@ import { join } from 'node:path' import { describe, expect, it, vi } from 'vitest' import { agentJournalItemKey } from '../../../shared/agent-session-journal-item-key' import type { AgentJournalRenderItem } from '../../../shared/agent-session-journal-types' +import type { AgentSessionDeathEvidence } from '../../../shared/agent-session-record' +import { readAgentJournalTurn } from '../../../shared/agent-session-turn-record' import type { AgentSessionJournal } from '../agent-session-journal/journal-store' import { createTrackedJournalOpener } from '../agent-session-journal/journal-store-test-open' import { settleStaleStructuredAgentSessionState } from './structured-agent-session-dead-generation-settlement' @@ -75,17 +77,77 @@ function promptItem(state: 'pending' | 'resolved', sequence: number): AgentJourn } describe('turn verdict from death evidence', () => { - it('earns an end time only from an observed exit', () => { + /** Judges a turn the fence-1 owner wrote, by evidence naming that owner. */ + const verdictForTurn = (evidence: AgentSessionDeathEvidence | null | undefined) => + turnVerdictFromDeathEvidence(evidence && { ownerFence: 1, ...evidence }, 1) + + it('ends a watched exit at the exit', () => { + expect(verdictForTurn({ kind: 'exit-observed', detail: 'exit', observedAt: 500 })).toEqual({ + state: 'interrupted', + completedAt: 500 + }) + }) + + it.each(['pid-absent', 'identity-mismatch'] as const)( + 'ends a %s proof at the last proof of life, never after the probe', + (kind) => { + const proof = (lastProvenAliveAt?: number) => ({ + kind, + detail: 'gone', + observedAt: 9_000, + ...(lastProvenAliveAt === undefined ? {} : { lastProvenAliveAt }) + }) + // Probed at 9000, long after the crash: the downtime is never counted as work. + expect(verdictForTurn(proof(8_000))).toEqual({ state: 'interrupted', completedAt: 8_000 }) + expect(verdictForTurn(proof(9_500))).toEqual({ state: 'interrupted', completedAt: 9_000 }) + // A proof that recorded no proof of life has only the probe. + expect(verdictForTurn(proof())).toEqual({ state: 'interrupted', completedAt: 9_000 }) + } + ) + + it('ends a watched exit at the exit even when a renewal is recorded', () => { expect( - turnVerdictFromDeathEvidence({ kind: 'exit-observed', detail: 'exit', observedAt: 500 }) + verdictForTurn({ + kind: 'exit-observed', + detail: 'exit', + observedAt: 500, + lastProvenAliveAt: 400 + }) ).toEqual({ state: 'interrupted', completedAt: 500 }) - expect( - turnVerdictFromDeathEvidence({ kind: 'pid-absent', detail: 'gone', observedAt: 500 }) - ).toEqual({ state: 'unverifiable' }) - expect( - turnVerdictFromDeathEvidence({ kind: 'identity-mismatch', detail: 'pid', observedAt: 500 }) - ).toEqual({ state: 'unverifiable' }) - expect(turnVerdictFromDeathEvidence(null)).toEqual({ state: 'unverifiable' }) + }) + + it('leaves a release nothing proved unverifiable', () => { + expect(verdictForTurn(null)).toEqual({ state: 'unverifiable' }) + expect(verdictForTurn(undefined)).toEqual({ state: 'unverifiable' }) + }) + it('keeps the rule an older build applied to evidence that names no owner', () => { + // Only a watched exit was proof then; a probe's proof stays unverifiable. + const legacy = { detail: 'gone', observedAt: 9_000, lastProvenAliveAt: 8_000 } + expect(turnVerdictFromDeathEvidence({ ...legacy, kind: 'exit-observed' }, 1)).toEqual({ + state: 'interrupted', + completedAt: 9_000 + }) + expect(turnVerdictFromDeathEvidence({ ...legacy, kind: 'pid-absent' }, 1)).toEqual({ + state: 'unverifiable' + }) + }) + + it('gives a turn no end from evidence about any other owner', () => { + const proof = { + kind: 'pid-absent' as const, + detail: 'gone', + observedAt: 9_000, + lastProvenAliveAt: 8_000 + } + // A newer start's death, and a turn whose writer the timeline no longer knows: neither proves + // the turn's own owner gone. + for (const [evidence, turnFence] of [ + [{ ...proof, ownerFence: 3 }, 1], + [{ ...proof, kind: 'exit-observed' as const, ownerFence: 3 }, 1], + [{ ...proof, ownerFence: 1 }, undefined] + ] as const) { + expect(turnVerdictFromDeathEvidence(evidence, turnFence)).toEqual({ state: 'unverifiable' }) + } }) }) @@ -162,6 +224,13 @@ describe('running turn lifecycle revisions', () => { }) }) + it('never ends a turn before it began, when the last proof of life predates it', () => { + const item = lifecycleItem('turn-2', 'running', 2, { startedAt: 500 }) + expect( + runningTurnLifecycleRevisions([item], { state: 'interrupted', completedAt: 300 }) + ).toMatchObject([{ body: { kind: 'turn', state: 'interrupted', completedAt: 500 } }]) + }) + it('revises a legacy status-form running row from an older host into a typed turn', () => { expect( runningTurnLifecycleRevisions([legacyLifecycleItem('turn-2', 30)], { state: 'unverifiable' }) @@ -180,11 +249,22 @@ describe('running turn lifecycle revisions', () => { }) }) +/** A probe that found the fence-1 owner gone at 9000, last proven alive at 100. */ +const PROVEN: AgentSessionDeathEvidence = { + kind: 'pid-absent', + detail: 'recorded pid absent on host', + observedAt: 9_000, + ownerFence: 1, + lastProvenAliveAt: 100 +} + describe('stale session state on a cold acquire', () => { function journalWith(items: AgentJournalRenderItem[]) { const appendLifecycleBatch = vi.fn(async () => ({ epoch: 'epoch-1', sequence: 9 })) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the settle reads only these journal members. const journal = { snapshot: () => ({ items }), + itemFence: () => 1, cursor: () => ({ epoch: 'epoch-1', sequence: 8 }), appendLifecycleBatch } as unknown as AgentSessionJournal @@ -310,6 +390,255 @@ describe('stale session state on a cold acquire', () => { } }) + it('ends a probe-proven turn at its last proof of life, not at a row written after it', async () => { + const root = await mkdtemp(join(tmpdir(), 'orca-stale-session-')) + const journals = createTrackedJournalOpener() + let now = 100 + try { + const journal = await journals.open({ + identity: { + sessionId: 'session-1', + workspaceId: 'workspace-1', + hostId: 'local', + agent: 'codex', + providerHandle: { kind: 'codex', threadId: THREAD } + }, + journalDir: root, + now: () => now + }) + const command = { provider: 'codex' as const, threadId: THREAD, turnId: 'turn-1', ordinal: 1 } + const shell = { kind: 'tool-call' as const, name: 'shell', input: { command: 'pnpm test' } } + await journal.appendItem( + { ...command, ordinal: 0 }, + { kind: 'turn', turnId: 'turn-1', state: 'running', startedAt: 100 }, + { fence: 1 } + ) + now = 200 + await journal.appendItem(command, { ...shell, state: 'running' }, { fence: 1 }) + // Rows can outlast the last renewal; only the renewal is proof of life. + now = 700 + await journal.appendItem( + command, + { ...shell, input: { command: 'pnpm test', streamed: 'ok' }, state: 'running' }, + { fence: 1 } + ) + now = 9_000 + + await settleStaleStructuredAgentSessionState({ + journal, + sessionId: 'session-1', + fence: 2, + acquisitionGeneration: 'generation-2', + deathEvidence: { + kind: 'pid-absent', + detail: 'recorded pid absent on host', + observedAt: 9_000, + ownerFence: 1, + lastProvenAliveAt: 650 + } + }) + + const items = journal.snapshot().items + expect(items.map((item) => readAgentJournalTurn(item.body)).find(Boolean)).toMatchObject({ + state: 'interrupted', + completedAt: 650 + }) + // The probe's detail is Orca's, so the row carries none. + expect( + items.flatMap((item) => (item.body.kind === 'status' ? [item.body.text] : [])) + ).toEqual([ + 'The agent stopped while this response was in progress. You can continue in this conversation.' + ]) + } finally { + await journals.closeAll() + await rm(root, { recursive: true, force: true }) + } + }) + + it('ends a crashed turn at its last proof of life, not at a send accepted before the proof', async () => { + const root = await mkdtemp(join(tmpdir(), 'orca-stale-session-')) + const journals = createTrackedJournalOpener() + let now = 100 + try { + const journal = await journals.open({ + identity: { + sessionId: 'session-1', + workspaceId: 'workspace-1', + hostId: 'local', + agent: 'codex', + providerHandle: { kind: 'codex', threadId: THREAD } + }, + journalDir: root, + now: () => now + }) + await journal.appendItem( + RUNNING_IDENTITY, + { kind: 'turn', turnId: 'turn-2', state: 'running', startedAt: 100 }, + { fence: 1 } + ) + now = 200 + await journal.appendItem( + { ...RUNNING_IDENTITY, ordinal: 1 }, + { kind: 'tool-call', name: 'shell', input: { command: 'pnpm test' }, state: 'running' }, + { fence: 1 } + ) + const settle = (deathEvidence: AgentSessionDeathEvidence | null) => + settleStaleStructuredAgentSessionState({ + journal, + sessionId: 'session-1', + fence: 1, + acquisitionGeneration: null, + deathEvidence + }) + // An hour later the relaunch opens the chat before anything proved the owner gone. + now = 3_600_000 + await settle(null) + const turn = () => journal.snapshot().items.map((item) => readAgentJournalTurn(item.body))[0] + expect(turn()).toMatchObject({ state: 'unverifiable' }) + now = 3_605_000 + await journal.appendSubmission({ + clientMessageId: 'send-1', + payloadFingerprint: 'fingerprint-1', + body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text: 'still there?' }] }, + fence: 1, + handoverRecorded: true + }) + await journal.resolveDispatch({ clientMessageId: 'send-1', state: 'pending', fence: 1 }) + now = 3_606_000 + + await settle({ + kind: 'pid-absent', + detail: 'gone', + observedAt: 3_606_000, + ownerFence: 1, + lastProvenAliveAt: 210 + }) + + expect(turn()).toMatchObject({ state: 'interrupted', completedAt: 210 }) + } finally { + await journals.closeAll() + await rm(root, { recursive: true, force: true }) + } + }) + + it('revises an unverifiable turn only from a proof naming its own owner, and only once', async () => { + const root = await mkdtemp(join(tmpdir(), 'orca-stale-session-')) + const journals = createTrackedJournalOpener() + let now = 100 + try { + const journal = await journals.open({ + identity: { + sessionId: 'session-1', + workspaceId: 'workspace-1', + hostId: 'local', + agent: 'codex', + providerHandle: { kind: 'codex', threadId: THREAD } + }, + journalDir: root, + now: () => now + }) + await journal.appendItem( + RUNNING_IDENTITY, + { kind: 'turn', turnId: 'turn-2', state: 'running', startedAt: 100 }, + { fence: 1 } + ) + now = 400 + // The open, before anything proved the fence-1 owner gone. + const settle = (deathEvidence: AgentSessionDeathEvidence | null) => + settleStaleStructuredAgentSessionState({ + journal, + sessionId: 'session-1', + fence: 2, + acquisitionGeneration: null, + deathEvidence + }) + await settle(null) + now = 9_000 + const turn = () => journal.snapshot().items.map((item) => readAgentJournalTurn(item.body))[0] + expect(turn()).toMatchObject({ state: 'unverifiable' }) + + const unrevised = journal.cursor() + await expect(settle({ ...PROVEN, ownerFence: 2 })).resolves.toBe(0) + const { ownerFence: _ownerFence, ...olderBuildProof } = PROVEN + await expect(settle({ ...olderBuildProof, kind: 'exit-observed' })).resolves.toBe(0) + expect(journal.cursor()).toEqual(unrevised) + expect(turn()).toMatchObject({ state: 'unverifiable' }) + + await expect(settle(PROVEN)).resolves.toBe(2) + expect(turn()).toEqual({ + turnId: 'turn-2', + state: 'interrupted', + startedAt: 100, + completedAt: 100 + }) + const revised = journal.cursor() + await expect(settle(PROVEN)).resolves.toBe(0) + expect(journal.cursor()).toEqual(revised) + expect(journal.snapshot().items.filter((item) => item.body.kind === 'status')).toHaveLength(1) + } finally { + await journals.closeAll() + await rm(root, { recursive: true, force: true }) + } + }) + + it('adds one row for a death however many attempts its settle takes to write', async () => { + const root = await mkdtemp(join(tmpdir(), 'orca-stale-session-')) + const journals = createTrackedJournalOpener() + let now = 100 + try { + const journal = await journals.open({ + identity: { + sessionId: 'session-1', + workspaceId: 'workspace-1', + hostId: 'local', + agent: 'codex', + providerHandle: { kind: 'codex', threadId: THREAD } + }, + journalDir: root, + now: () => now + }) + // Enough running turns that the settle writes two batches, and its retry two again. + for (let index = 0; index < 399; index++) { + const turnId = `turn-${index}` + await journal.appendItem( + { ...RUNNING_IDENTITY, turnId }, + { kind: 'turn', turnId, state: 'running', startedAt: 100 }, + { fence: 1 } + ) + } + now = 9_000 + const settle = () => + settleStaleStructuredAgentSessionState({ + journal, + sessionId: 'session-1', + fence: 2, + acquisitionGeneration: null, + deathEvidence: PROVEN + }) + const turns = () => + journal.snapshot().items.flatMap((item) => readAgentJournalTurn(item.body) ?? []) + const statusRows = () => + journal.snapshot().items.filter((item) => item.body.kind === 'status') + const append = journal.appendLifecycleBatch.bind(journal) + const secondBatchFails = vi + .spyOn(journal, 'appendLifecycleBatch') + .mockImplementationOnce(append) + .mockRejectedValueOnce(new Error('disk full')) + + await expect(settle()).rejects.toThrow('disk full') + secondBatchFails.mockRestore() + expect(turns().filter((turn) => turn.state === 'running')).toHaveLength(200) + expect(statusRows()).toHaveLength(1) + + await settle() + expect(turns().filter((turn) => turn.state !== 'interrupted')).toEqual([]) + expect(statusRows()).toHaveLength(1) + } finally { + await journals.closeAll() + await rm(root, { recursive: true, force: true }) + } + }) + it('writes nothing when no turn is running and keys on the journal position without a generation', async () => { const idle = journalWith([ lifecycleItem('turn-1', 'completed', 1, { startedAt: 10, completedAt: 20 }) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-verdict.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-verdict.ts index b6e9b9bde5ea..b23018aeba83 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-verdict.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-stale-turn-verdict.ts @@ -1,8 +1,10 @@ // What the host may durably say about a turn whose provider child is gone. // -// `interrupted` requires the host to have seen the child exit; that receipt is the only end time it -// is allowed to record. Everything weaker — a pid probe, an identity mismatch, a journal found -// running with no observed exit on the record — is `unverifiable` and carries no end at all. +// `interrupted` requires proof that the child which wrote the turn is gone: death evidence naming +// that turn's owner by fence — a watched exit, or a local probe that found the recorded pid gone or +// reused. A release nothing proved — lost contact, an unverifiable identity, a stop that outlived the +// ladder — carries none, and neither does a later owner's death; the turn is then `unverifiable` +// with no end at all, until a proof naming its owner is written and revises it. import { parseAgentJournalItemKey } from '../../../shared/agent-session-journal-item-key' import type { @@ -15,6 +17,7 @@ import { } from '../../../shared/agent-session-turn-record' import type { AgentSessionDeathEvidence } from '../../../shared/agent-session-record' import type { JournalLifecycleMutationInput } from '../agent-session-journal/journal-row-builders' +import type { AgentSessionJournal } from '../agent-session-journal/journal-store' export type StructuredAgentSessionTurnVerdict = | { state: 'interrupted'; completedAt: number } @@ -25,11 +28,31 @@ export const UNVERIFIABLE_TURN_VERDICT: StructuredAgentSessionTurnVerdict = { } export function turnVerdictFromDeathEvidence( - evidence: AgentSessionDeathEvidence | null | undefined + evidence: AgentSessionDeathEvidence | null | undefined, + /** Fence of the owner that wrote the turn. */ + turnFence: number | undefined ): StructuredAgentSessionTurnVerdict { - return evidence?.kind === 'exit-observed' - ? { state: 'interrupted', completedAt: evidence.observedAt } - : UNVERIFIABLE_TURN_VERDICT + if (!evidence) { + return UNVERIFIABLE_TURN_VERDICT + } + if (evidence.ownerFence === undefined) { + // Evidence an older build wrote names no owner; it keeps the rule that build applied. + return evidence.kind === 'exit-observed' + ? { state: 'interrupted', completedAt: evidence.observedAt } + : UNVERIFIABLE_TURN_VERDICT + } + if (evidence.ownerFence !== turnFence) { + return UNVERIFIABLE_TURN_VERDICT + } + if (evidence.kind === 'exit-observed') { + return { state: 'interrupted', completedAt: evidence.observedAt } + } + // A probe finds a dead child long after it died; its last renewal bounds the end, so the turn never + // counts the time Orca was down. Timeline rows don't: a send can land there after the death. + return { + state: 'interrupted', + completedAt: Math.min(evidence.lastProvenAliveAt ?? evidence.observedAt, evidence.observedAt) + } } /** Revises every still-running lifecycle item in place, keeping its identity and start. */ @@ -37,23 +60,43 @@ export function runningTurnLifecycleRevisions( items: readonly AgentJournalRenderItem[], verdict: StructuredAgentSessionTurnVerdict ): JournalLifecycleMutationInput[] { - const revisions: JournalLifecycleMutationInput[] = [] - for (const item of items) { + return items.flatMap((item) => { const turn = readAgentJournalTurn(item.body) - if (turn?.state !== 'running') { - continue - } - const identity = parseAgentJournalItemKey(item.itemId) - if (!identity) { - continue - } - revisions.push({ - kind: 'item', - identity, - body: agentJournalTurnBody(settledLifecycle(turn, verdict)) - }) + return turn?.state === 'running' ? turnLifecycleRevision(item, turn, verdict) : [] + }) +} + +/** + * A turn an earlier settle could only call `unverifiable`, because the proof had not been written + * yet, revised once a proof names the owner that wrote it. Only ever upward, and never from an + * older build's proof, which names no owner. + */ +export function provenUnverifiableTurnRevisions( + items: readonly AgentJournalRenderItem[], + evidence: AgentSessionDeathEvidence | null | undefined, + journal: Pick +): JournalLifecycleMutationInput[] { + const ownerFence = evidence?.ownerFence + if (ownerFence === undefined) { + return [] } - return revisions + return items.flatMap((item) => { + const turn = readAgentJournalTurn(item.body) + return turn?.state === 'unverifiable' && journal.itemFence(item.itemId) === ownerFence + ? turnLifecycleRevision(item, turn, turnVerdictFromDeathEvidence(evidence, ownerFence)) + : [] + }) +} + +function turnLifecycleRevision( + item: AgentJournalRenderItem, + turn: AgentJournalTurnLifecycle, + verdict: StructuredAgentSessionTurnVerdict +): JournalLifecycleMutationInput[] { + const identity = parseAgentJournalItemKey(item.itemId) + return identity + ? [{ kind: 'item', identity, body: agentJournalTurnBody(settledLifecycle(turn, verdict)) }] + : [] } /** The verdict owns the turn's end and nothing else; every other field the row @@ -69,7 +112,10 @@ function settledLifecycle( durationMs: _durationMs, ...kept } = lifecycle - return verdict.state === 'interrupted' - ? { ...kept, state: verdict.state, completedAt: verdict.completedAt } - : { ...kept, state: verdict.state } + if (verdict.state !== 'interrupted') { + return { ...kept, state: verdict.state } + } + // A renewal can predate the turn, which started with its owner alive; it never ends before that. + const began = Math.max(lifecycle.requestedAt ?? 0, lifecycle.startedAt ?? 0) + return { ...kept, state: verdict.state, completedAt: Math.max(verdict.completedAt, began) } } diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-surface-lifetime.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-surface-lifetime.test.ts index 98e50783bdf3..b04a9b3d820a 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-surface-lifetime.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-surface-lifetime.test.ts @@ -767,7 +767,9 @@ describe('an unexpected provider exit', () => { runtimeFence: exitedFence + 1, deathEvidence: { kind: 'exit-observed', detail: 'provider exited', observedAt: NOW } }) - // Nothing retries the settlement; the journal writes again, and the next acquire re-derives it. + // The retry recording the exit queues is refused too; once the journal writes again, the next + // acquire re-derives it. + await host.collaboratorsForTests().serialize(SESSION, async () => {}) refusing.mockRestore() dispatch.mockResolvedValueOnce({ diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.test.ts index 0685af605499..451629f7b45f 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.test.ts @@ -96,6 +96,7 @@ describe('provider-exit settlement', () => { snapshot: () => ({ items: [lifecycleItem('turn-1', 1, { state: 'running', startedAt: 1_000 })] }), + itemFence: () => 7, appendLifecycleBatch, markPendingSubmissionsUnknown: vi.fn(async () => []) } @@ -123,7 +124,7 @@ describe('provider-exit settlement', () => { observedAt } ) - // Released, not latched: the next acquire or read restore settles what this write left. + // Released, not latched: a later settle from this evidence finishes what this write left. expect(record.lease).toMatchObject({ claimStatus: 'released', handoffStage: null, diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.ts index 3a47d1240f24..5025c5a6f82f 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-unexpected-exit.ts @@ -131,8 +131,8 @@ export async function settleUnexpectedStructuredAgentSessionExit< acquisitionGeneration: child.generation, now: context.now(), exitObservedAt: observedAt, - // Bare cause: whatever this settlement could not write is settled from it later, by the - // next acquire or read restore, and `exit-observed` already says the rest. + // Bare cause: whatever this settlement could not write is settled from it later (the + // settle recording it queues, or the next open or acquire); `exit-observed` says the rest. exitReason: unexpectedEvent.reason.slice(0, MAX_UNEXPECTED_EXIT_REASON_CHARS) }) } catch (error) { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-wedged-profile-migration.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-wedged-profile-migration.test.ts index 98b212a8606c..a492b0b65ce1 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-wedged-profile-migration.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-wedged-profile-migration.test.ts @@ -191,6 +191,9 @@ function isAcquirable(lease: NonNullable>['le ) } +/** After the owner's last renewal, so a turn it proves dead ends at its start, never before. */ +const SEEDED_TURN_STARTED_AT = NOW - 5_000 + async function seedRunningTurn(provider: 'codex' | 'claude' = 'codex'): Promise { const journal = await openAgentSessionJournal({ identity: { @@ -209,7 +212,7 @@ async function seedRunningTurn(provider: 'codex' | 'claude' = 'codex'): Promise< provider === 'codex' ? { provider: 'codex', threadId: THREAD, turnId: 'turn-1', ordinal: 0 } : { provider: 'claude', sessionId: 'provider-session-alpha-1', uuid: 'uuid-running' }, - { kind: 'turn', turnId: 'turn-1', state: 'running', startedAt: NOW - 5_000 }, + { kind: 'turn', turnId: 'turn-1', state: 'running', startedAt: SEEDED_TURN_STARTED_AT }, { fence: 13 } ) await journal.close() @@ -306,6 +309,16 @@ describe('already-wedged profiles become usable on load', () => { 'a quit that left the owner for a probe to prove gone', wedgedRecord({ claimStatus: 'live', handoffStage: null, ownerProcess: DEAD_OWNER }), null, + { state: 'interrupted', completedAt: SEEDED_TURN_STARTED_AT } + ], + [ + 'a quit that left an owner on a host this one cannot probe', + wedgedRecord({ + claimStatus: 'live', + handoffStage: null, + ownerProcess: { ...DEAD_OWNER, hostId: 'remote-host' } + }), + null, { state: 'unverifiable' } ] ] as const)( @@ -314,8 +327,18 @@ describe('already-wedged profiles become usable on load', () => { await seedStore({ ...seeded, lease: { ...seeded.lease, deathEvidence } }) await seedRunningTurn() const published: AgentSessionStatusSummary[] = [] + const remote = seeded.lease.ownerProcess?.hostId === 'remote-host' openHost({ - statusSink: { publish: (summary) => published.push(summary), forget: () => {} } + statusSink: { publish: (summary) => published.push(summary), forget: () => {} }, + // Loss of contact is never proof of death: a remote owner only ever probes indeterminate. + ...(remote + ? { + probeOwner: async () => ({ + outcome: 'indeterminate' as const, + reason: 'owner runs on remote-host, which this host cannot probe' + }) + } + : {}) }) await host.restoreReadableSessions() @@ -328,9 +351,25 @@ describe('already-wedged profiles become usable on load', () => { ...verdict }) expect(activeStructuredAgentSessionTurnId(restoredJournal().snapshot().items)).toBe(null) + // The row never carries the proof's detail, which is Orca's log text. + const statusRows = restoredJournal() + .snapshot() + .items.flatMap((item) => (item.body.kind === 'status' ? [item.body.text] : [])) + expect(statusRows).toEqual( + remote + ? [] + : [ + 'Codex stopped while this response was in progress. You can continue in this conversation.' + ] + ) // What the sidebar reads: every status this restart published says the chat is not working. expect(published.filter((summary) => summary.sessionId === SESSION)).not.toEqual([]) expect(published.map((summary) => summary.status)).not.toContain('working') + // A crash is not something the user did: no outcome is claimed, so no reader files it as a + // cancellation the user already knows about. + expect(published.map((summary) => summary.turnOutcome)).toEqual( + published.map(() => undefined) + ) } ) @@ -350,11 +389,12 @@ describe('already-wedged profiles become usable on load', () => { expect(acquire).toHaveBeenCalledOnce() expect(activeStructuredAgentSessionTurnId(restoredJournal().snapshot().items)).toBe(null) - // A pid probe proved the owner gone; nobody saw it exit, so the turn has no end. + // A pid probe proved the owner gone, so the turn was cut short when it was last proven alive. expect(turnLifecycle('turn-1')).toEqual({ turnId: 'turn-1', - state: 'unverifiable', + state: 'interrupted', startedAt: NOW - 5_000, + completedAt: SEEDED_TURN_STARTED_AT, recovered: true }) expect(store.getRecord(SESSION)?.lease).toMatchObject({ @@ -443,11 +483,12 @@ describe('already-wedged profiles become usable on load', () => { expect(acquire).toHaveBeenCalledOnce() expect(store.getRecord(SESSION)?.lease).toMatchObject({ claimStatus: 'live' }) - // A pid probe proved the owner gone; nobody saw it exit, so the turn has no end. + // A pid probe proved the owner gone, so the turn was cut short when it was last proven alive. expect(turnLifecycle('turn-1')).toEqual({ turnId: 'turn-1', - state: 'unverifiable', + state: 'interrupted', startedAt: NOW - 5_000, + completedAt: SEEDED_TURN_STARTED_AT, recovered: true }) } diff --git a/src/main/runtime/agent-session-acquisition-failure-settlement.ts b/src/main/runtime/agent-session-acquisition-failure-settlement.ts index a3e114081186..f6efaa890c37 100644 --- a/src/main/runtime/agent-session-acquisition-failure-settlement.ts +++ b/src/main/runtime/agent-session-acquisition-failure-settlement.ts @@ -86,12 +86,14 @@ export function settleFailedAgentSessionPostAcquisitionAttachment( } const next = args.exitProof === 'unproven' - ? withLease(record, { - ...record.lease, - handoffStage: 'recovering', - handoffOperationId: null, - lastRenewedAt: args.now - }) + ? { + ...withLease(record, { + ...record.lease, + handoffStage: 'recovering', + handoffOperationId: null + }), + updatedAt: args.now + } : withLease(record, { ...record.lease, runtimeFence: nextAgentSessionFence(record.lease), @@ -101,18 +103,15 @@ export function settleFailedAgentSessionPostAcquisitionAttachment( claimStatus: 'released', lastRenewedAt: args.now, handoffOperationId: null, - deathEvidence: - args.exitProof === 'root-exit-observed' - ? { - kind: 'exit-observed', - detail: 'the provider process exited; its descendants were not proven gone', - observedAt: args.now - } - : { - kind: 'exit-observed', - detail: 'post-acquisition cleanup proved no provider child remains', - observedAt: args.now - } + deathEvidence: { + kind: 'exit-observed', + detail: + args.exitProof === 'root-exit-observed' + ? 'the provider process exited; its descendants were not proven gone' + : 'post-acquisition cleanup proved no provider child remains', + observedAt: args.now, + ownerFence: record.lease.runtimeFence + } }) state.records.set(args.sessionId, next) state.operations = settleAgentSessionOperation(state.operations, args) @@ -133,14 +132,17 @@ function settleFailedLease( throw new Error('agent_session_ownership_unknown') } if (args.exitProof === 'unproven' && record.lease.ownerProcess) { - return withLease(record, { - ...record.lease, - handoffStage: 'recovering', - // The operation is durably settled failed below; a lease still naming it would - // read as an in-flight transfer to every consumer that keys on the stage + id pair. - handoffOperationId: null, - lastRenewedAt: args.now - }) + // Parking in recovery proves nothing alive, so `lastRenewedAt` keeps the spawn's proof. + return { + ...withLease(record, { + ...record.lease, + handoffStage: 'recovering', + // The operation is durably settled failed below; a lease still naming it would + // read as an in-flight transfer to every consumer that keys on the stage + id pair. + handoffOperationId: null + }), + updatedAt: args.now + } } return withLease(record, { ...record.lease, @@ -151,7 +153,7 @@ function settleFailedLease( claimStatus: 'released', lastRenewedAt: args.now, handoffOperationId: null, - deathEvidence: acquisitionDeathEvidence(args.exitProof, args.now) + deathEvidence: acquisitionDeathEvidence(args.exitProof, args.now, record.lease.runtimeFence) }) } @@ -159,25 +161,27 @@ function settleFailedLease( * when nothing was. */ function acquisitionDeathEvidence( exitProof: AgentSessionAcquisitionExitProof, - observedAt: number + observedAt: number, + ownerFence: number ): AgentSessionDeathEvidence | null { if (exitProof === 'unproven') { return null } + const proof = { observedAt, ownerFence } if (exitProof === 'processless') { - return { kind: 'pid-absent', detail: 'reservation failed before spawn', observedAt } + return { kind: 'pid-absent', detail: 'reservation failed before spawn', ...proof } } if (exitProof === 'root-exit-observed') { return { kind: 'exit-observed', detail: 'the provider process exited; its descendants were not proven gone', - observedAt + ...proof } } // Cleanup proved no child of this attempt remains; it may never have spawned. return { kind: 'exit-observed', detail: 'acquisition cleanup proved no provider child remains', - observedAt + ...proof } } diff --git a/src/main/runtime/agent-session-death-evidence-persistence.test.ts b/src/main/runtime/agent-session-death-evidence-persistence.test.ts new file mode 100644 index 000000000000..6e0bff8098cd --- /dev/null +++ b/src/main/runtime/agent-session-death-evidence-persistence.test.ts @@ -0,0 +1,228 @@ +import { mkdtemp, rm, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import type { AgentSessionDeathEvidence } from '../../shared/agent-session-record' +import { + agentSessionLeaseFixture, + agentSessionRecordFixture +} from '../../shared/agent-session-record.test-fixture' +import type { AgentSessionFailedAcquisitionSettlement } from './agent-session-acquisition-failure-settlement' +import { AgentSessionRecordStore } from './agent-session-record-store' +import { agentSessionStorePath } from './agent-session-record-store-file' + +const SESSION = 'session-alpha-1' +/** The fixture lease's last renewal. */ +const LAST_RENEWED_AT = 30_000 + +let directory: string + +async function seed(deathEvidence: AgentSessionDeathEvidence | null): Promise { + const lease = + deathEvidence === null + ? agentSessionLeaseFixture() + : agentSessionLeaseFixture({ + ownerProcess: null, + reservedSpawnToken: null, + claimStatus: 'released', + deathEvidence + }) + await writeFile( + agentSessionStorePath(directory), + JSON.stringify({ + schemaVersion: 2, + hostId: 'local', + records: { [SESSION]: agentSessionRecordFixture(lease) }, + operations: {}, + retiredClaimKeys: [], + unusableRecords: {} + }) + ) +} + +function open(): Promise { + return AgentSessionRecordStore.open({ directory, hostId: 'local' }) +} + +beforeEach(async () => { + directory = await mkdtemp(join(tmpdir(), 'orca-death-evidence-')) +}) + +afterEach(async () => { + await rm(directory, { recursive: true, force: true }) +}) + +describe('death evidence on disk', () => { + it('records the last renewal before the crash and reads it back after another restart', async () => { + await seed(null) + const crashed = await open() + await crashed.reconcileOnRestart({ + probe: async () => ({ outcome: 'pid-absent' }), + now: 90_000 + }) + const evidence = { + kind: 'pid-absent', + detail: 'recorded pid absent on host', + observedAt: 90_000, + ownerFence: 7, + lastProvenAliveAt: LAST_RENEWED_AT + } + expect(crashed.getRecord(SESSION)?.lease.deathEvidence).toEqual(evidence) + expect((await open()).getRecord(SESSION)?.lease.deathEvidence).toEqual(evidence) + }) + + it('loads evidence an older build wrote without a proven-alive time', async () => { + const olderBuild = { kind: 'pid-absent' as const, detail: 'gone', observedAt: 90_000 } + await seed(olderBuild) + const store = await open() + expect(store.isSessionUnreadable(SESSION)).toBe(false) + expect(store.getRecord(SESSION)?.lease.deathEvidence).toEqual(olderBuild) + }) + + it.each([ + ['proves the owner alive after the probe found it gone', { lastProvenAliveAt: 90_001 }], + ['names no possible owner', { ownerFence: -1 }] + ])('quarantines evidence that %s', async (_why, field) => { + await seed({ kind: 'pid-absent', detail: 'gone', observedAt: 90_000, ...field }) + expect((await open()).isSessionUnreadable(SESSION)).toBe(true) + }) +}) + +describe('who is told a proof of death landed', () => { + it('tells a listener once the proof is committed, and never for a write that proves nothing', async () => { + await seed(null) + const store = await open() + const told: unknown[] = [] + store.onDeathEvidence((sessionId) => told.push(store.getRecord(sessionId)?.lease.deathEvidence)) + const unsubscribed = vi.fn() + store.onDeathEvidence(unsubscribed)() + + await expect( + store.evictProvenDeadOwner({ + sessionId: SESSION, + expectedFence: 6, + probe: { outcome: 'pid-absent' }, + now: 80_000 + }) + ).rejects.toThrow() + await store.reconcileOnRestart({ probe: async () => ({ outcome: 'pid-absent' }), now: 90_000 }) + // The proof already on the record is not news to a later write. + await store.setSessionTabVisibility(SESSION, true) + + expect(told).toEqual([expect.objectContaining({ kind: 'pid-absent', ownerFence: 7 })]) + expect(unsubscribed).not.toHaveBeenCalled() + }) +}) + +describe('a failed acquisition', () => { + const NOW = 1_800_000_000_000 + const OPERATION_ID = `${NOW}-${'1'.padStart(32, '0')}` + + /** Reserve and observe the spawn at NOW, as an attach does before it can fail. */ + async function spawnedOwner(store: AgentSessionRecordStore): Promise { + const reserved = await store.reserveOwner({ + sessionId: SESSION, + location: agentSessionRecordFixture().location, + provider: 'claude', + accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude' }, + expectedFence: null, + spawnToken: 'spawn-a', + claimKeyId: 'key-1', + handoffOperationId: OPERATION_ID, + probe: { outcome: 'indeterminate', reason: 'no answer' }, + operation: { callerKey: 'client-1', operationId: OPERATION_ID, fingerprint: 'fp-1' }, + now: NOW + }) + const fence = reserved.record.lease.runtimeFence + await store.commitProcessIdentity({ + sessionId: SESSION, + fence, + process: { hostId: 'local', pid: 4242, processStartTimeMs: NOW, spawnToken: 'spawn-a' }, + now: NOW + }) + return fence + } + + function unproven(fence: number, now: number): AgentSessionFailedAcquisitionSettlement { + return { + sessionId: SESSION, + fence, + spawnToken: 'spawn-a', + callerKey: 'client-1', + operationId: OPERATION_ID, + outcome: { status: 'failed', code: 'agent_session_operation_invalid', message: 'failed' }, + exitProof: 'unproven', + now + } + } + + it.each([ + ['before the owner proved its handle', false], + ['after the owner proved its handle', true] + ] as const)( + 'parks in recovery keeping the last proof of life, not the failure, %s', + async (_when, proved) => { + const store = await open() + const fence = await spawnedOwner(store) + if (proved) { + await store.proveOwner({ + sessionId: SESSION, + fence, + link: { + linkId: 'link-1', + handle: { provider: 'claude', sessionId: 'provider-session-1', leafUuid: null }, + origin: 'created', + mintedAtFence: fence, + observedAt: NOW + }, + now: NOW + }) + await store.settleFailedPostAcquisitionAttachment(unproven(fence, NOW + 60_000)) + } else { + await store.settleFailedAcquisition(unproven(fence, NOW + 60_000)) + } + expect(store.getRecord(SESSION)?.lease).toMatchObject({ + handoffStage: 'recovering', + lastRenewedAt: NOW + }) + + const evicted = await store.evictProvenDeadOwner({ + sessionId: SESSION, + expectedFence: fence, + probe: { outcome: 'pid-absent' }, + now: NOW + 120_000 + }) + expect(evicted.lease.deathEvidence).toMatchObject({ lastProvenAliveAt: NOW }) + } + ) + + it.each(['exit-proven', 'root-exit-observed', 'processless'] as const)( + 'names its own fence in the proof when cleanup settles it %s', + async (exitProof) => { + const store = await open() + const fence = await spawnedOwner(store) + const settled = + exitProof === 'processless' + ? await store.settleFailedAcquisition({ ...unproven(fence, NOW), exitProof }) + : await (async () => { + await store.proveOwner({ + sessionId: SESSION, + fence, + link: { + linkId: 'link-1', + handle: { provider: 'claude', sessionId: 'provider-session-1', leafUuid: null }, + origin: 'created', + mintedAtFence: fence, + observedAt: NOW + }, + now: NOW + }) + return store.settleFailedPostAcquisitionAttachment({ + ...unproven(fence, NOW), + exitProof + }) + })() + expect(settled.lease.deathEvidence).toMatchObject({ ownerFence: fence }) + } + ) +}) diff --git a/src/main/runtime/agent-session-record-store.ts b/src/main/runtime/agent-session-record-store.ts index 314323a32380..925fa38d8d18 100644 --- a/src/main/runtime/agent-session-record-store.ts +++ b/src/main/runtime/agent-session-record-store.ts @@ -77,6 +77,8 @@ export const AGENT_SESSION_LEASE_TTL_MS = 30_000, AGENT_SESSION_LEASE_RENEW_INTERVAL_MS = 10_000 export class AgentSessionRecordStore { + private readonly deathEvidenceListeners = new Set<(sessionId: string) => void>() + private constructor(private readonly transactions: AgentSessionStoreTransactionQueue) {} static async open(args: { directory: string; hostId: string }): Promise { @@ -328,6 +330,32 @@ export class AgentSessionRecordStore { }) } + /** Told, once committed, of each session a transaction wrote a proof of death for — whichever + * transition wrote it, since every one lands here. Must not throw. */ + onDeathEvidence(listener: (sessionId: string) => void): () => void { + this.deathEvidenceListeners.add(listener) + return () => this.deathEvidenceListeners.delete(listener) + } + /** Serialize every mutation against the latest committed disk state. */ - private transact = (apply: () => T): Promise => this.transactions.transact(apply) + private transact = async (apply: () => T): Promise => { + let proven: string[] = [] + const result = await this.transactions.transact(() => { + if (this.deathEvidenceListeners.size === 0) { + return apply() + } + const before = new Map( + [...this.state.records].map(([id, record]) => [id, record.lease.deathEvidence]) + ) + const applied = apply() + proven = [...this.state.records] + .filter(([id, { lease }]) => lease.deathEvidence && lease.deathEvidence !== before.get(id)) + .map(([id]) => id) + return applied + }) + for (const sessionId of proven) { + this.deathEvidenceListeners.forEach((listener) => listener(sessionId)) + } + return result + } } diff --git a/src/main/runtime/agent-session-restart-lease-transitions.ts b/src/main/runtime/agent-session-restart-lease-transitions.ts index 70104588a584..b4269d21c677 100644 --- a/src/main/runtime/agent-session-restart-lease-transitions.ts +++ b/src/main/runtime/agent-session-restart-lease-transitions.ts @@ -52,10 +52,13 @@ export function applyAgentSessionRestartAdjudication(args: { deathEvidence: adjudication.evidence }) } - return withLease(record, { - ...record.lease, - handoffStage: adjudication.stage, - unreconciled: false, - lastRenewedAt: args.now - }) + // Parking in recovery proves nothing alive, so `lastRenewedAt` keeps the pre-crash proof. + return { + ...withLease(record, { + ...record.lease, + handoffStage: adjudication.stage, + unreconciled: false + }), + updatedAt: args.now + } } diff --git a/src/main/runtime/agent-session-surface-release-transition.test.ts b/src/main/runtime/agent-session-surface-release-transition.test.ts index 5e671acc77f5..0ea30d901976 100644 --- a/src/main/runtime/agent-session-surface-release-transition.test.ts +++ b/src/main/runtime/agent-session-surface-release-transition.test.ts @@ -18,5 +18,7 @@ describe('agent session surface release transition', () => { }) expect(released.lease.runtimeFence).toBe(9) + // The proof names the owner it released, not the fence the floor moved to. + expect(released.lease.deathEvidence).toMatchObject({ kind: 'exit-observed', ownerFence: 7 }) }) }) diff --git a/src/main/runtime/agent-session-surface-release-transition.ts b/src/main/runtime/agent-session-surface-release-transition.ts index 7da1e7633eff..fe98a8705248 100644 --- a/src/main/runtime/agent-session-surface-release-transition.ts +++ b/src/main/runtime/agent-session-surface-release-transition.ts @@ -51,7 +51,8 @@ export function releaseAgentSessionOwnerAfterSurfaceClose(args: { deathEvidence: { kind: 'exit-observed', detail: args.exitReason ?? 'the last surface holding this session released it', - observedAt: args.exitObservedAt ?? args.now + observedAt: args.exitObservedAt ?? args.now, + ownerFence: record.lease.runtimeFence } }) } diff --git a/src/main/runtime/rpc/methods/structured-agent-session-at-rest.test.ts b/src/main/runtime/rpc/methods/structured-agent-session-at-rest.test.ts index df00957215f0..1cc5050d8031 100644 --- a/src/main/runtime/rpc/methods/structured-agent-session-at-rest.test.ts +++ b/src/main/runtime/rpc/methods/structured-agent-session-at-rest.test.ts @@ -424,7 +424,10 @@ describe('an agent exit', () => { { kind: 'turn', turnId: 'working', state: 'running' } ) await rig.host.flushStreamedEvents(SESSION) - vi.spyOn(open.journal, 'appendLifecycleBatch').mockRejectedValueOnce(new Error('disk full')) + // The exit's own write and the retry recording the exit queues are both refused. + vi.spyOn(open.journal, 'appendLifecycleBatch') + .mockRejectedValueOnce(new Error('disk full')) + .mockRejectedValueOnce(new Error('disk full')) await rig.host.handleAdapterEvent({ type: 'ended', sessionId: SESSION, @@ -440,6 +443,7 @@ describe('an agent exit', () => { deathEvidence: { kind: 'exit-observed' } }) ) + await rig.host.collaboratorsForTests().serialize(SESSION, async () => {}) const sent = await rig.host.send( CALLER, diff --git a/src/shared/agent-session-lease-adjudication.test.ts b/src/shared/agent-session-lease-adjudication.test.ts index 7256f940aa43..35e794efd0d2 100644 --- a/src/shared/agent-session-lease-adjudication.test.ts +++ b/src/shared/agent-session-lease-adjudication.test.ts @@ -222,14 +222,28 @@ describe('restart reconciliation', () => { expect(result).toEqual({ disposition: 'evicted', nextFence: 8, + // The death happened between the last renewal and the probe. evidence: { kind: 'identity-mismatch', detail: 'mismatched process-start-time', - observedAt: 9_000 + observedAt: 9_000, + ownerFence: 7, + lastProvenAliveAt: 500 } }) }) + it('never records the owner alive after the probe that found it gone', () => { + // A clock stepped back across the restart would otherwise write an interval load rejects. + expect( + adjudicateAgentSessionRestart({ + lease: lease({ lastRenewedAt: 9_500 }), + probe: { outcome: 'pid-absent' }, + observedAt: 9_000 + }) + ).toMatchObject({ evidence: { observedAt: 9_000, lastProvenAliveAt: 9_000 } }) + }) + it('hands an unverifiable owner to recovery resolution instead of evicting it', () => { expect( adjudicateAgentSessionRestart({ @@ -269,7 +283,13 @@ describe('restart reconciliation', () => { ).toEqual({ disposition: 'evicted', nextFence: 8, - evidence: { kind: 'pid-absent', detail: 'recorded pid absent on host', observedAt: 9_000 } + evidence: { + kind: 'pid-absent', + detail: 'recorded pid absent on host', + observedAt: 9_000, + ownerFence: 7, + lastProvenAliveAt: 500 + } }) }) @@ -308,7 +328,13 @@ describe('restart reconciliation', () => { ).toEqual({ disposition: 'evicted', nextFence: 8, - evidence: { kind: 'pid-absent', detail: 'reservation never spawned', observedAt: 9_000 } + // The proof is about this reservation's own fence. + evidence: { + kind: 'pid-absent', + detail: 'reservation never spawned', + observedAt: 9_000, + ownerFence: 7 + } }) } ) diff --git a/src/shared/agent-session-lease-adjudication.ts b/src/shared/agent-session-lease-adjudication.ts index b0b806ddad72..271b136456f0 100644 --- a/src/shared/agent-session-lease-adjudication.ts +++ b/src/shared/agent-session-lease-adjudication.ts @@ -80,16 +80,23 @@ export function isProvenAliveProbe(probe: AgentSessionOwnerProbe): boolean { function deathEvidenceFor( probe: AgentSessionOwnerProbe, - observedAt: number + observedAt: number, + lease: AgentSessionLease ): AgentSessionDeathEvidence | null { + // Capped so a clock that stepped back across the restart still writes a valid interval. + const interval = { + observedAt, + ownerFence: lease.runtimeFence, + lastProvenAliveAt: Math.min(lease.lastRenewedAt, observedAt) + } if (probe.outcome === 'exit-observed') { - return { kind: 'exit-observed', detail: 'observed process exit', observedAt } + return { kind: 'exit-observed', detail: 'observed process exit', ...interval } } if (probe.outcome === 'pid-absent') { - return { kind: 'pid-absent', detail: 'recorded pid absent on host', observedAt } + return { kind: 'pid-absent', detail: 'recorded pid absent on host', ...interval } } if (probe.outcome === 'identity-mismatch') { - return { kind: 'identity-mismatch', detail: `mismatched ${probe.field}`, observedAt } + return { kind: 'identity-mismatch', detail: `mismatched ${probe.field}`, ...interval } } return null } @@ -240,7 +247,12 @@ export function adjudicateAgentSessionRestart(args: { nextFence: nextAgentSessionFence(lease), evidence: probe.outcome === 'reservation-unused' - ? { kind: 'pid-absent', detail: 'reservation never spawned', observedAt } + ? { + kind: 'pid-absent', + detail: 'reservation never spawned', + observedAt, + ownerFence: lease.runtimeFence + } : null } } @@ -253,7 +265,7 @@ export function adjudicateAgentSessionRestart(args: { reason: 'owner outlived the runtime that held its transport' } } - const evidence = deathEvidenceFor(probe, observedAt) + const evidence = deathEvidenceFor(probe, observedAt, lease) if (evidence) { return { disposition: 'evicted', nextFence: nextAgentSessionFence(lease), evidence } } diff --git a/src/shared/agent-session-record.ts b/src/shared/agent-session-record.ts index 2b85695a8459..12a26e64ac77 100644 --- a/src/shared/agent-session-record.ts +++ b/src/shared/agent-session-record.ts @@ -87,6 +87,13 @@ export type AgentSessionDeathEvidence = { kind: 'exit-observed' | 'pid-absent' | 'identity-mismatch' detail: string observedAt: number + /** Fence of the owner (or reservation) this death is about; a fence names exactly one. Absent on + * evidence older builds wrote, which then speaks for no turn. */ + ownerFence?: number + /** The death interval's lower bound: the last time the runtime holding the owner's transport + * proved it alive. Only a probe's proof records it: absent on a surface-release exit, a failed + * start, and evidence older builds wrote. */ + lastProvenAliveAt?: number } export type AgentSessionLease = { @@ -102,6 +109,8 @@ export type AgentSessionLease = { /** Reserved before any process exists, then matched against the child's environment. */ reservedSpawnToken: string | null leaseDeadlineAt: number + /** While `ownerProcess` is set, the last time its transport holder proved it alive; parking in + * `recovering` proves nothing, so it leaves this alone. */ lastRenewedAt: number handoffOperationId: string | null journalCheckpoint: AgentSessionJournalCheckpoint | null @@ -276,13 +285,20 @@ function isAgentSessionDeathEvidence(value: unknown): value is AgentSessionDeath return false } const evidence = value as Partial + const { observedAt, lastProvenAliveAt, ownerFence } = evidence return ( (evidence.kind === 'exit-observed' || evidence.kind === 'pid-absent' || evidence.kind === 'identity-mismatch') && isBoundedString(evidence.detail, MAX_ID_LENGTH) && - Number.isSafeInteger(evidence.observedAt) && - (evidence.observedAt as number) >= 0 + typeof observedAt === 'number' && + Number.isSafeInteger(observedAt) && + observedAt >= 0 && + (ownerFence === undefined || (Number.isSafeInteger(ownerFence) && ownerFence >= 0)) && + (lastProvenAliveAt === undefined || + (Number.isSafeInteger(lastProvenAliveAt) && + lastProvenAliveAt >= 0 && + lastProvenAliveAt <= observedAt)) ) } diff --git a/tests/e2e/cross-version-wire/agent-session-death-evidence-downgrade.unit.test.ts b/tests/e2e/cross-version-wire/agent-session-death-evidence-downgrade.unit.test.ts new file mode 100644 index 000000000000..96780a185176 --- /dev/null +++ b/tests/e2e/cross-version-wire/agent-session-death-evidence-downgrade.unit.test.ts @@ -0,0 +1,61 @@ +import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { expect, test } from 'vitest' +import { + agentSessionLeaseFixture, + agentSessionRecordFixture +} from '../../../src/shared/agent-session-record.test-fixture' +import { AgentSessionRecordStore } from '../../../src/main/runtime/agent-session-record-store' +import { agentSessionStorePath } from '../../../src/main/runtime/agent-session-record-store-file' +import { importReleaseCheckoutModule, materializeReleaseCheckout } from './release-checkout' + +// The last release before a proof of death named its owner and its last proof of life. +const BASELINE_REF = 'v1.4.211' +const SESSION = 'session-alpha-1' + +test('an older build loads a proof of death that names its owner and its last proof of life', async () => { + const directory = mkdtempSync(join(tmpdir(), 'orca-death-evidence-downgrade-')) + try { + // A live owner at fence 7, last renewed at 30000, found gone when this build relaunches. + writeFileSync( + agentSessionStorePath(directory), + JSON.stringify({ + schemaVersion: 2, + hostId: 'local', + records: { [SESSION]: agentSessionRecordFixture(agentSessionLeaseFixture()) }, + operations: {}, + retiredClaimKeys: [], + unusableRecords: {} + }) + ) + const store = await AgentSessionRecordStore.open({ directory, hostId: 'local' }) + await store.reconcileOnRestart({ probe: async () => ({ outcome: 'pid-absent' }), now: 90_000 }) + const evidence = store.getRecord(SESSION)?.lease.deathEvidence + expect(evidence).toEqual({ + kind: 'pid-absent', + detail: 'recorded pid absent on host', + observedAt: 90_000, + ownerFence: 7, + lastProvenAliveAt: 30_000 + }) + + const checkout = await materializeReleaseCheckout(BASELINE_REF) + const baseline = await importReleaseCheckoutModule( + checkout, + 'src/main/runtime/agent-session-record-store.ts' + ) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the pinned release exports this class with the open/read members called below; a missing one fails the test. + const OldStore = baseline.AgentSessionRecordStore as { + open: (args: { directory: string; hostId: string }) => Promise + } + const old = await OldStore.open({ directory, hostId: 'local' }) + expect(old.isSessionUnreadable(SESSION)).toBe(false) + expect(old.getRecord(SESSION)?.lease).toMatchObject({ + claimStatus: 'released', + deathEvidence: evidence + }) + } finally { + rmSync(directory, { recursive: true, force: true }) + } +}) From b4c19f12c47887d1ab5c459823a2ed21f79ccdb6 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:49:32 -0700 Subject: [PATCH 58/90] fix(claude): run structured Claude under the POSIX provider supervisor (#23476) * fix(codex): the provider supervisor outlives its provider group when stopped A signalled supervisor forwards the signal to the provider group, escalates to SIGKILL after the grace, and exits only once the group is gone, so recovery's proof that the recorded pid is dead also proves the provider is. It refuses to spawn when its parent is already not the owner named in its spec, and watches that owner rather than whichever parent it first saw. The grace is a spec field. Recovery's SIGTERM stage now outlasts the supervisor's own stop, since a SIGKILL that lands first cannot be handled and leaves the group running. * fix(codex): a closed owner pipe no longer ends the supervisor before its provider group When Orca dies, the supervisor's stdout pipe has no reader. Provider output in the window before the parent-death watch fired raised an unhandled EPIPE that exited the supervisor with the provider group still running. * fix(codex): bound the supervisor grace so recovery's SIGTERM stage always covers it Recovery sized its SIGTERM stage from the default grace, so a launch with a longer grace would be SIGKILLed mid-stop and orphan its group with no test noticing. The spec now refuses any grace above one exported maximum, and recovery derives its SIGTERM stage from that maximum. * fix(codex): every supervisor stop asks the provider with SIGTERM first Owner death, stdin end after the grace, and a signal to the supervisor now all take one path: SIGTERM the provider group, SIGKILL it after the grace, and exit only once it is gone. The signal handlers are registered before the provider is spawned, so a stop that lands in the spawn window still reaps it. The longest stop grows to two graces plus the reap wait, and both recovery's SIGTERM stage and the connection's graceful close now wait that long before forcing, since forcing the supervisor sooner can orphan its group. * fix(claude): run the structured Claude child under the POSIX provider supervisor A close now stops Claude with a SIGTERM through the supervisor instead of letting stdin end finish the turn, and Orca's death stops it through the supervisor. * test(claude): pin the supervised stop against a real Claude CLI, opt-in * test(claude): a requested stop reads interrupted through the frames the supervised SIGTERM makes Claude emit * test(claude): show what the real CLI did when it never ran the tool * test(claude): Orca's death now reaps Claude's own tool through its SIGTERM * refactor(claude): take supervision from the spawn spec so the close ladder cannot disagree with the spawn createProviderSpawnSpec now reports whether it wrapped the provider in the supervisor, and the Claude spawner reads that instead of repeating the platform check. The close ladder's SIGTERM follows the process actually spawned. * fix(native-chat): derive quit's chat-eviction bound from the longest supervised provider close Quit's child-eviction phase was a hand-picked 8 s. It is now the sink drain plus the longest supervised close over Claude and Codex plus a named 1 s margin, so a provider close that grows widens it instead of silently outrunning it. A close's tree-kill fallback stays outside the bound: once main exits, the supervisor stops its provider group on owner death, which a new test now proves for a clean owner exit, and next launch's recovery settles the lease. --- .../claude-agent-sdk-process-spawn.test.ts | 104 +++++++- .../claude/claude-agent-sdk-process-spawn.ts | 38 ++- .../claude-child-exit-proof-ladder.test.ts | 72 ++++++ .../claude/claude-child-exit-proof-ladder.ts | 19 +- .../claude/claude-child-root-termination.ts | 3 + .../claude-stream-json-connection.test.ts | 101 +++++--- .../claude/claude-stream-json-connection.ts | 7 +- .../claude-structured-requested-stop.test.ts | 90 +++++++ .../claude-supervised-stop-real-cli.test.ts | 244 ++++++++++++++++++ ...claude-supervised-stop.integration.test.ts | 225 ++++++++++++++++ src/main/codex/codex-app-server-connection.ts | 2 +- ...erver-posix-supervisor.integration.test.ts | 32 ++- .../codex-app-server-posix-supervisor.test.ts | 3 +- .../codex-app-server-posix-supervisor.ts | 26 +- ...ctured-agent-session-host-teardown.test.ts | 68 ++++- .../structured-agent-session-host-teardown.ts | 21 +- ...tured-agent-session-recovery-resolution.ts | 4 +- 17 files changed, 979 insertions(+), 80 deletions(-) create mode 100644 src/main/claude/claude-child-exit-proof-ladder.test.ts create mode 100644 src/main/claude/claude-structured-requested-stop.test.ts create mode 100644 src/main/claude/claude-supervised-stop-real-cli.test.ts create mode 100644 src/main/claude/claude-supervised-stop.integration.test.ts diff --git a/src/main/claude/claude-agent-sdk-process-spawn.test.ts b/src/main/claude/claude-agent-sdk-process-spawn.test.ts index cd3520cf6d53..1b6c192d433a 100644 --- a/src/main/claude/claude-agent-sdk-process-spawn.test.ts +++ b/src/main/claude/claude-agent-sdk-process-spawn.test.ts @@ -4,14 +4,22 @@ import { describe, expect, it, vi } from 'vitest' import type { SpawnOptions as SdkSpawnOptions } from '@anthropic-ai/claude-agent-sdk' import { resolveSpawn, type spawnProcess } from '../../shared/child-process/run-process' import type { ProcessSpec } from '../../shared/child-process/process-spec' +import type * as ProviderSupervisor from '../codex/codex-app-server-posix-supervisor' +import { createProviderSpawnSpec } from '../codex/codex-app-server-posix-supervisor' import { createClaudeCodeProcessSpawn } from './claude-agent-sdk-process-spawn' +import { proveClaudeChildExitWithReaper } from './claude-child-exit-proof-ladder' + +vi.mock('../codex/codex-app-server-posix-supervisor', async (importOriginal) => { + const actual = await importOriginal() + return { ...actual, createProviderSpawnSpec: vi.fn(actual.createProviderSpawnSpec) } +}) type FakeChild = EventEmitter & { pid: number stdin: PassThrough stdout: PassThrough stderr: PassThrough - kill: ReturnType + kill: ReturnType boolean>> } function fakeSpawn() { @@ -20,7 +28,7 @@ function fakeSpawn() { child.stdin = new PassThrough() child.stdout = new PassThrough() child.stderr = new PassThrough() - child.kill = vi.fn(() => true) + child.kill = vi.fn((_signal?: NodeJS.Signals | number) => true) const specs: ProcessSpec[] = [] const spawnImpl = ((spec: ProcessSpec) => { specs.push(spec) @@ -43,7 +51,7 @@ function sdkOptions(overrides: Partial = {}): SdkSpawnOptions { describe('claude agent SDK process spawn', () => { it('routes the SDK spawn through Orca and retains the pid the lease adjudicates on', () => { const process = fakeSpawn() - const spawn = createClaudeCodeProcessSpawn(process.spawnImpl) + const spawn = createClaudeCodeProcessSpawn(process.spawnImpl, 'win32') expect(spawn.pid).toBeUndefined() expect(spawn.child).toBeNull() @@ -52,15 +60,103 @@ describe('claude agent SDK process spawn', () => { expect(child).toBe(process.child) expect(spawn.child).toBe(process.child) expect(spawn.pid).toBe(4321) + // Windows has no supervisor: Claude itself is the child. + expect(spawn.supervised).toBe(false) expect(process.specs[0]).toEqual({ program: '/usr/local/bin/claude', args: ['--output-format', 'stream-json'], cwd: '/work/repo', env: { PATH: '/usr/bin', CLAUDE_CONFIG_DIR: '/accounts/one' }, + detached: false, stdio: ['pipe', 'pipe', 'pipe'] }) }) + it.each(['darwin', 'linux'] as const)( + 'starts Claude under the provider supervisor on %s, which is then the pid the lease records', + (platform) => { + const process = fakeSpawn() + const spawn = createClaudeCodeProcessSpawn(process.spawnImpl, platform) + spawn.spawn(sdkOptions()) + + const [spec] = process.specs + if (!spec) { + throw new Error('the spawner never built a spec') + } + expect(spawn.supervised).toBe(true) + expect(spawn.pid).toBe(4321) + expect(spec.program).toBe(globalThis.process.execPath) + expect(spec.args?.[0]).toBe('-e') + expect(spec.detached).toBe(true) + expect(spec.cwd).toBe('/work/repo') + const supervisorSpec = JSON.parse( + Buffer.from(String(spec.env?.ORCA_PROVIDER_SUPERVISOR_SPEC), 'base64').toString() + ) + expect(supervisorSpec).toMatchObject({ + command: '/usr/local/bin/claude', + args: ['--output-format', 'stream-json'], + cwd: '/work/repo', + ownerPid: globalThis.process.pid + }) + // The supervisor passes its env to Claude minus its own two keys. + expect(spec.env).toMatchObject({ PATH: '/usr/bin', CLAUDE_CONFIG_DIR: '/accounts/one' }) + } + ) + + it.each([ + { platform: 'darwin', specSupervised: false }, + { platform: 'win32', specSupervised: true } + ] as const)( + 'stops Claude by the spawn spec\u2019s supervision on $platform, never the platform', + async ({ platform, specSupervised }) => { + const actual = await vi.importActual( + '../codex/codex-app-server-posix-supervisor' + ) + vi.mocked(createProviderSpawnSpec).mockImplementationOnce((...args) => ({ + ...actual.createProviderSpawnSpec(...args), + supervised: specSupervised + })) + const process = fakeSpawn() + const spawn = createClaudeCodeProcessSpawn(process.spawnImpl, platform) + spawn.spawn(sdkOptions()) + expect(spawn.supervised).toBe(specSupervised) + + let exited = false + let settle = (): void => {} + const exitPromise = new Promise((resolve) => { + settle = resolve + }) + // Claude leaves shortly after stdin ends, so the ladder never needs its forced rung. + process.child.stdin.on('finish', () => + setTimeout(() => { + exited = true + settle() + }, 10) + ) + const tree = { + capture: vi.fn(async () => {}), + reap: vi.fn(async () => 'exited' as const), + treeVerdict: 'exited' as const + } + await proveClaudeChildExitWithReaper( + { + child: process.child, + exitPromise, + exited: () => exited, + tree, + supervised: spawn.supervised + }, + () => tree + ) + // SIGTERM to an unsupervised Claude on Windows is TerminateProcess; a skipped one leaves it running. + if (specSupervised) { + expect(process.child.kill).toHaveBeenCalledWith('SIGTERM') + } else { + expect(process.child.kill).not.toHaveBeenCalled() + } + } + ) + it('keeps the child out of the SDK abort path so exit proof stays Orca-owned', () => { const process = fakeSpawn() const controller = new AbortController() @@ -86,7 +182,7 @@ describe('claude agent SDK process spawn', () => { it('hands a Windows .cmd shim to Orca\u2019s argument encoder', () => { const process = fakeSpawn() - createClaudeCodeProcessSpawn(process.spawnImpl).spawn( + createClaudeCodeProcessSpawn(process.spawnImpl, 'win32').spawn( sdkOptions({ command: 'C:\\Users\\dev\\AppData\\npm\\claude.cmd', args: ['--setting-sources=user,project,local', '--session-id', 'a b&c'] diff --git a/src/main/claude/claude-agent-sdk-process-spawn.ts b/src/main/claude/claude-agent-sdk-process-spawn.ts index a2b1ad7f1585..bbb4b295aade 100644 --- a/src/main/claude/claude-agent-sdk-process-spawn.ts +++ b/src/main/claude/claude-agent-sdk-process-spawn.ts @@ -1,5 +1,6 @@ import type { SpawnOptions as ClaudeAgentSdkSpawnOptions } from '@anthropic-ai/claude-agent-sdk' import { spawnProcess } from '../../shared/child-process/run-process' +import { createProviderSpawnSpec } from '../codex/codex-app-server-posix-supervisor' /** Derived rather than imported: only src/shared/child-process may name node:child_process. */ type ClaudeCodeChild = ReturnType @@ -11,8 +12,13 @@ export type ClaudeCodeProcessSpawn = { spawn: (options: ClaudeAgentSdkSpawnOptions) => ClaudeCodeChild /** The retained child, so Orca keeps its own tree-kill and exit-proof ladder. Null until the SDK spawns. */ readonly child: ClaudeCodeChild | null - /** Ownership proof: the durable lease adjudicates on this pid plus start time plus the spawn token. */ + /** + * Ownership proof: the durable lease adjudicates on this pid plus start time plus the spawn + * token. On POSIX it is the provider supervisor's, which outlives Claude by construction. + */ readonly pid: number | undefined + /** The spawn spec's verdict, so the close ladder never re-decides it. False until the SDK spawns. */ + readonly supervised: boolean readonly stderrTail: string } @@ -31,24 +37,41 @@ function definedEnv(env: Record): Record { + const spec = createProviderSpawnSpec( + { + command: options.command, + args: [...options.args], + ...(options.cwd === undefined ? {} : { cwd: options.cwd }) + }, + definedEnv(options.env), + platform + ) // Why `options.signal` is dropped: it would let the SDK kill the child outside // Orca's ladder, and close() may never report an exit it did not observe. const spawned = spawnImpl({ - program: options.command, - args: [...options.args], - ...(options.cwd === undefined ? {} : { cwd: options.cwd }), - env: definedEnv(options.env), + program: spec.program, + args: spec.args, + cwd: spec.cwd, + env: spec.env, + detached: spec.detached, stdio: ['pipe', 'pipe', 'pipe'] }) child = spawned + supervised = spec.supervised // The SDK drains stderr only for its own local spawn, so a custom spawner must: // otherwise the child blocks on a full pipe and exit errors lose their tail. spawned.stderr.setEncoding('utf8').on('data', (chunk: string) => { @@ -62,6 +85,9 @@ export function createClaudeCodeProcessSpawn( get pid() { return child?.pid }, + get supervised() { + return supervised + }, get stderrTail() { return stderrTail } diff --git a/src/main/claude/claude-child-exit-proof-ladder.test.ts b/src/main/claude/claude-child-exit-proof-ladder.test.ts new file mode 100644 index 000000000000..2d8da7f629dc --- /dev/null +++ b/src/main/claude/claude-child-exit-proof-ladder.test.ts @@ -0,0 +1,72 @@ +import { describe, expect, it, vi } from 'vitest' +import { PROVIDER_SUPERVISOR_MAX_STOP_MS } from '../codex/codex-app-server-posix-supervisor' +import type { ClaudeChildTreeReaper } from './claude-agent-sdk-exit-proof' +import { proveClaudeChildExitWithReaper } from './claude-child-exit-proof-ladder' + +function fakeTree(): ClaudeChildTreeReaper & { reap: ReturnType } { + return { + capture: vi.fn(async () => {}), + refresh: vi.fn(async () => {}), + reap: vi.fn(async () => 'exited' as const), + treeVerdict: 'exited' + } +} + +/** A root that leaves only once a SIGTERM has had `stopMs` to act, the way a supervisor does. */ +function rootStoppedBySigterm(stopMs: number) { + let exited = false + let settle = (): void => {} + const exitPromise = new Promise((resolve) => { + settle = resolve + }) + const kill = vi.fn((signal?: NodeJS.Signals | number) => { + if (signal === 'SIGTERM') { + setTimeout(() => { + exited = true + settle() + }, stopMs) + } + return true + }) + const stdin = { end: vi.fn() } + return { + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: The ladder reads only pid, kill and stdin.end from its child. + child: { pid: 4321, kill, stdin } as unknown as Parameters< + typeof proveClaudeChildExitWithReaper + >[0]['child'], + kill, + stdin, + exitPromise, + exited: () => exited + } +} + +describe('Claude child exit proof ladder', () => { + it('stops a supervised child with SIGTERM and waits out the supervisor stop before forcing', async () => { + // Slower than the unsupervised 1.5 s grace, still inside the supervisor's own bound. + const root = rootStoppedBySigterm(PROVIDER_SUPERVISOR_MAX_STOP_MS - 500) + const tree = fakeTree() + + await expect( + proveClaudeChildExitWithReaper({ ...root, supervised: true, tree }, () => tree) + ).resolves.toBe(true) + + expect(root.stdin.end).toHaveBeenCalled() + expect(root.kill).toHaveBeenCalledWith('SIGTERM') + // Forcing here would SIGKILL the supervisor mid-stop and orphan Claude in its own group. + expect(root.kill).not.toHaveBeenCalledWith('SIGKILL') + expect(tree.reap).not.toHaveBeenCalled() + }, 10_000) + + it('never signals an unsupervised child for the graceful stop', async () => { + const root = rootStoppedBySigterm(0) + const tree = fakeTree() + + await proveClaudeChildExitWithReaper({ ...root, tree }, () => tree) + + // On Windows a direct SIGTERM is TerminateProcess: stdin end stays the only graceful rung. + expect(root.stdin.end).toHaveBeenCalled() + expect(root.kill).not.toHaveBeenCalledWith('SIGTERM') + expect(tree.reap).toHaveBeenCalled() + }, 10_000) +}) diff --git a/src/main/claude/claude-child-exit-proof-ladder.ts b/src/main/claude/claude-child-exit-proof-ladder.ts index 85ed629f1b92..37d4e47508d7 100644 --- a/src/main/claude/claude-child-exit-proof-ladder.ts +++ b/src/main/claude/claude-child-exit-proof-ladder.ts @@ -1,8 +1,11 @@ import type { SpawnedProcess } from '../../shared/child-process/run-process' import { waitForProcessExitUntil } from '../codex/codex-process-exit-deadline' +import { PROVIDER_SUPERVISOR_MAX_STOP_MS } from '../codex/codex-app-server-posix-supervisor' import type { ClaudeChildTreeReaper } from './claude-agent-sdk-exit-proof' -const GRACEFUL_EXIT_MS = 1_500 +export const GRACEFUL_EXIT_MS = 1_500 +// A signalled supervisor escalates on its own; forcing it sooner kills it and orphans Claude. +export const SUPERVISED_GRACEFUL_EXIT_MS = PROVIDER_SUPERVISOR_MAX_STOP_MS + 500 const FORCED_EXIT_MS = 1_000 export type ClaudeChildExitProofInput = { @@ -10,6 +13,8 @@ export type ClaudeChildExitProofInput = { exitPromise: Promise exited: () => boolean tree?: ClaudeChildTreeReaper + /** The child is the POSIX provider supervisor: SIGTERM stops Claude, which reaps its tools. */ + supervised?: boolean } export async function proveClaudeChildExitWithReaper( @@ -17,16 +22,24 @@ export async function proveClaudeChildExitWithReaper( createTree: () => ClaudeChildTreeReaper ): Promise { const tree = input.tree ?? createTree() - // Arm before stdin closes: only a live root can identify its descendants. + // Arm before the stop: only a live root can identify its descendants. await tree.capture() try { input.child.stdin?.end() } catch { // The reap below still owns the process. } + // Stdin end alone lets Claude finish its turn, tools and edits included; a close is a stop. + // Windows has no supervisor, and a direct SIGTERM there is TerminateProcess. + if (input.supervised && !input.exited()) { + input.child.kill('SIGTERM') + } let reaped = false if (!input.exited()) { - await waitForProcessExitUntil(input.exitPromise, GRACEFUL_EXIT_MS) + await waitForProcessExitUntil( + input.exitPromise, + input.supervised ? SUPERVISED_GRACEFUL_EXIT_MS : GRACEFUL_EXIT_MS + ) if (!input.exited()) { reaped = true await tree.refresh?.() diff --git a/src/main/claude/claude-child-root-termination.ts b/src/main/claude/claude-child-root-termination.ts index bed422532e19..bba299195789 100644 --- a/src/main/claude/claude-child-root-termination.ts +++ b/src/main/claude/claude-child-root-termination.ts @@ -19,6 +19,9 @@ type RootTerminationInput = { * nothing. A probe here could only let an unreadable process table cost the tree * the one fallback that still works once every table read has failed. * + * On POSIX the root is the provider supervisor, killed only after its own stop had + * its whole bound; Claude, in its own group, is reached by the descendant kill. + * * False means no signal was sent, because the root had already left. */ export function terminateClaudeRoot(input: RootTerminationInput): boolean { diff --git a/src/main/claude/claude-stream-json-connection.test.ts b/src/main/claude/claude-stream-json-connection.test.ts index 6d3f0d89f305..e3682f033064 100644 --- a/src/main/claude/claude-stream-json-connection.test.ts +++ b/src/main/claude/claude-stream-json-connection.test.ts @@ -107,6 +107,18 @@ async function open( return connection } +function launchedArgv(spec: ProcessSpec | undefined): string[] { + const supervised = spec?.env?.ORCA_PROVIDER_SUPERVISOR_SPEC + if (!supervised) { + return [spec?.program ?? '', ...(spec?.args ?? [])] + } + const launch: unknown = JSON.parse(Buffer.from(supervised, 'base64').toString()) + if (!launch || typeof launch !== 'object' || !('command' in launch) || !('args' in launch)) { + return [] + } + return [String(launch.command), ...(Array.isArray(launch.args) ? launch.args.map(String) : [])] +} + function childEnv(): Record { return (spawned.at(-1)?.env ?? {}) as Record } @@ -201,8 +213,9 @@ describe('Claude stream-json connection', () => { const report = await until(() => readReportSafely(scenario), 'the scripted CLI report') expect(report.argv[0]).toBe(FAKE_CLI) // The .mjs fixture makes the SDK run it under node; a real CLI path is the program - // itself. Either way the resolved path is what Orca's spawner is asked to execute. - expect([spawned.at(-1)?.program, ...(spawned.at(-1)?.args ?? [])]).toContain(FAKE_CLI) + // itself. Either way the resolved path is what Orca's spawner is asked to execute, + // through the POSIX supervisor's spec where there is one. + expect(launchedArgv(spawned.at(-1))).toContain(FAKE_CLI) expect(report.argv).toContain('--replay-user-messages') expect(report.argv).toContain(`--session-id=${SESSION_ID}`) }) @@ -647,37 +660,63 @@ describe('Claude stream-json connection', () => { 20_000 ) - it('settles a spawn error followed by close as processless and closes idempotently', async () => { - const scenario = scriptScenario([HOLD_OPEN]) - const missingCli = join(scenario.cwd, 'claude-that-does-not-exist') - let fault: Error | null = null - let exit: Error | null = null - const connection = await open( - { ...launchFor(scenario), pathToClaudeCodeExecutable: missingCli }, - { - onFault: (error) => { - fault = error - }, - onExit: (error) => { - exit = error + it.skipIf(process.platform === 'win32')( + 'reports a missing CLI under the supervisor as a root exit that names the spawn error', + async () => { + const scenario = scriptScenario([HOLD_OPEN]) + const missingCli = join(scenario.cwd, 'claude-that-does-not-exist') + let exit: Error | null = null + const connection = await open( + { ...launchFor(scenario), pathToClaudeCodeExecutable: missingCli }, + { + onExit: (error) => { + exit = error + } } - } - ) + ) - await until( - () => (connection.exitVerdict.root === 'processless' ? connection.exitVerdict : null), - 'the processless spawn settlement' - ) - expect(connection.pid).toBeUndefined() - expect(fault).toBeInstanceOf(Error) - expect(exit).toBeNull() - await expect(Promise.all([connection.close(), connection.close()])).resolves.toEqual([ - true, - true - ]) - await expect(connection.close()).resolves.toBe(true) - expect(connection.exitVerdict).toEqual({ root: 'processless', tree: 'exited' }) - }) + const reported = await until(() => exit, 'the supervised spawn failure') + // The supervisor spawned, so this is its exit; only its stderr can say why. + expect(reported.message).toMatch(/\(code 127\).*ENOENT/s) + // A first-hand root exit, which releases the lease like a processless start did. + expect(connection.exitVerdict.root).toBe('exited') + } + ) + + it.skipIf(process.platform !== 'win32')( + 'settles a spawn error followed by close as processless and closes idempotently', + async () => { + const scenario = scriptScenario([HOLD_OPEN]) + const missingCli = join(scenario.cwd, 'claude-that-does-not-exist') + let fault: Error | null = null + let exit: Error | null = null + const connection = await open( + { ...launchFor(scenario), pathToClaudeCodeExecutable: missingCli }, + { + onFault: (error) => { + fault = error + }, + onExit: (error) => { + exit = error + } + } + ) + + await until( + () => (connection.exitVerdict.root === 'processless' ? connection.exitVerdict : null), + 'the processless spawn settlement' + ) + expect(connection.pid).toBeUndefined() + expect(fault).toBeInstanceOf(Error) + expect(exit).toBeNull() + await expect(Promise.all([connection.close(), connection.close()])).resolves.toEqual([ + true, + true + ]) + await expect(connection.close()).resolves.toBe(true) + expect(connection.exitVerdict).toEqual({ root: 'processless', tree: 'exited' }) + } + ) it('does not treat a child error event as first-hand root exit proof', async () => { const scenario = scriptScenario([HOLD_OPEN]) diff --git a/src/main/claude/claude-stream-json-connection.ts b/src/main/claude/claude-stream-json-connection.ts index 486407c0137e..6f67e04b36ea 100644 --- a/src/main/claude/claude-stream-json-connection.ts +++ b/src/main/claude/claude-stream-json-connection.ts @@ -309,15 +309,16 @@ export async function openClaudeStreamJsonConnection( closePromise ??= (async () => { closing = true resumeReading() - // Arm the descendant proof before ending stdin. The SDK may exit the root - // immediately; a post-exit walk cannot recover descendants that reparented. + // Arm the descendant proof before the stop. The root may exit immediately; + // a post-exit walk cannot recover descendants that reparented. await (tree.refresh?.() ?? tree.capture()) inbox.end() const proven = await proveClaudeChildExit({ child, exitPromise, exited: rootSettled, - tree + tree, + supervised: spawner.supervised }) inbox.fail(new Error('claude stream-json connection closed')) if (!proven) { diff --git a/src/main/claude/claude-structured-requested-stop.test.ts b/src/main/claude/claude-structured-requested-stop.test.ts new file mode 100644 index 000000000000..993109f4a378 --- /dev/null +++ b/src/main/claude/claude-structured-requested-stop.test.ts @@ -0,0 +1,90 @@ +import { describe, expect, it } from 'vitest' +import type { + AgentJournalItemBody, + AgentJournalItemIdentity +} from '../../shared/agent-session-journal-types' +import { readAgentJournalTurn } from '../../shared/agent-session-turn-record' +import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' +import type { ClaudeStructuredSessionEvent } from './claude-structured-session-state' +import { + PROVIDER_SESSION_ID, + USER_MESSAGE, + adapterFor, + fakeClaude, + identityFor +} from './claude-structured-session-test-support' + +function journalSink() { + const items: { identity: AgentJournalItemIdentity; body: AgentJournalItemBody }[] = [] + const sink: StructuredAgentSessionEventSink = { + appendItem: (identity, body) => items.push({ identity, body }), + appendTombstone: () => {}, + publish: () => {} + } + return { sink, items } +} + +function frame(type: 'assistant' | 'user', uuid: string, content: unknown[]) { + return { + type, + uuid, + session_id: PROVIDER_SESSION_ID, + parent_tool_use_id: null, + message: { role: type, content } + } +} + +describe('a requested stop of a structured Claude chat', () => { + it('reads interrupted, not failed or crashed, through the frames the stop makes Claude emit', async () => { + const claude = fakeClaude({ replayUuid: 'turn-1' }) + const events: ClaudeStructuredSessionEvent[] = [] + const adapter = adapterFor(claude, {}, events) + const journal = journalSink() + await adapter.acquire({ + identity: identityFor(), + fence: 7, + spawnToken: 'spawn-9', + events: journal.sink + }) + await adapter.dispatch({ + sessionId: 'session-1', + clientMessageId: 'client-1', + body: USER_MESSAGE, + fence: 7 + }) + const connection = claude.connections[0]! + connection.handlers.onMessage?.( + frame('assistant', 'assistant-1', [ + { type: 'tool_use', id: 'tool-1', name: 'Bash', input: { command: 'sleep 120' } } + ]) + ) + // What Claude 2.1.283 emitted within 35 ms of the supervised SIGTERM mid-tool, recorded + // against the real CLI: the killed tool's result, a status frame, and no `result` frame. + connection.close = async () => { + connection.handlers.onMessage?.( + frame('user', 'user-2', [ + { type: 'tool_result', tool_use_id: 'tool-1', is_error: true, content: 'Exit code 137' } + ]) + ) + connection.handlers.onMessage?.({ + type: 'system', + subtype: 'status', + uuid: 'status-1', + session_id: PROVIDER_SESSION_ID + }) + connection.closed = true + return true + } + + await expect(adapter.closeSession('session-1')).resolves.toBe(true) + + const turns = journal.items.flatMap((item) => { + const turn = readAgentJournalTurn(item.body) + return turn ? [turn] : [] + }) + expect(turns.at(-1)).toMatchObject({ turnId: 'turn-1', state: 'interrupted' }) + const ended = events.filter((event) => event.type === 'ended') + expect(ended).toEqual([expect.objectContaining({ reason: 'claude session closed' })]) + expect(ended[0]).not.toHaveProperty('cause') + }) +}) diff --git a/src/main/claude/claude-supervised-stop-real-cli.test.ts b/src/main/claude/claude-supervised-stop-real-cli.test.ts new file mode 100644 index 000000000000..82432e3fd6e6 --- /dev/null +++ b/src/main/claude/claude-supervised-stop-real-cli.test.ts @@ -0,0 +1,244 @@ +import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { homedir, tmpdir } from 'node:os' +import { join } from 'node:path' +import { randomUUID } from 'node:crypto' +import { afterEach, describe, expect, it } from 'vitest' +import { runProcess } from '../../shared/child-process/run-process' +import { resolveSessionFilePath } from '../native-chat/session-file-resolver' +import { SUPERVISED_GRACEFUL_EXIT_MS } from './claude-child-exit-proof-ladder' +import { + openClaudeStreamJsonConnection, + type ClaudeStreamJsonConnection +} from './claude-stream-json-connection' +import { + CLAUDE_STRUCTURED_BASE_OPTIONS, + claudeStructuredPermissionOptions +} from './claude-structured-launch-resolution' + +// Opt-in only: spends a real (haiku) turn per case. Run it in an isolated HOME with +// ORCA_REAL_CLAUDE_BIN set, and ORCA_REAL_CLAUDE_SETTINGS when auth lives in a settings file. +const CLAUDE_BIN = process.env.ORCA_REAL_CLAUDE_BIN ?? '' +const enabled = + process.env.ORCA_REAL_CLAUDE_SUPERVISED_STOP === '1' && + process.platform !== 'win32' && + CLAUDE_BIN.length > 0 +const FRAMES_OUT = process.env.ORCA_REAL_CLAUDE_FRAMES_OUT +const TOOL_MARKER = 'orca_supervised_stop_probe' +const TOOL_PROMPT = `Use the Bash tool to run exactly this command, with no timeout argument, and nothing else: python3 -c "import time; time.sleep(120) # ${TOOL_MARKER}"` + +type Frame = { at: number; message: Record } +type Row = { pid: number; ppid: number; command: string } + +const recordedPids = new Set() +const tempDirs: string[] = [] +const connections: ClaudeStreamJsonConnection[] = [] + +function alive(pid: number): boolean { + try { + process.kill(pid, 0) + return true + } catch (error) { + return !(error instanceof Error && 'code' in error && error.code === 'ESRCH') + } +} + +async function processTable(): Promise { + const result = await runProcess({ program: 'ps', args: ['-axo', 'pid=,ppid=,command='] }) + return result.stdout.split('\n').flatMap((line) => { + const match = /^\s*(\d+)\s+(\d+)\s+(.*)$/.exec(line) + return match ? [{ pid: Number(match[1]), ppid: Number(match[2]), command: match[3] }] : [] + }) +} + +async function descendantsOf(rootPid: number): Promise { + const rows = await processTable() + const found: Row[] = [] + const frontier = [rootPid] + while (frontier.length > 0) { + const parent = frontier.pop() + for (const row of rows.filter((candidate) => candidate.ppid === parent)) { + found.push(row) + frontier.push(row.pid) + } + } + return found +} + +async function until(read: () => Promise | T | null, what: string, ms = 90_000) { + const deadline = Date.now() + ms + for (;;) { + const value = await read() + if (value !== null) { + return value + } + if (Date.now() >= deadline) { + throw new Error(`timed out waiting for ${what}`) + } + await new Promise((resolve) => setTimeout(resolve, 250)) + } +} + +async function open(sessionId: string, cwd: string, resume: boolean, frames: Frame[]) { + const settings = process.env.ORCA_REAL_CLAUDE_SETTINGS + const permission = claudeStructuredPermissionOptions('bypassPermissions') + const connection = await openClaudeStreamJsonConnection( + { + pathToClaudeCodeExecutable: CLAUDE_BIN, + options: { + ...CLAUDE_STRUCTURED_BASE_OPTIONS, + model: 'haiku', + extraArgs: { + ...CLAUDE_STRUCTURED_BASE_OPTIONS.extraArgs, + ...permission.extraArgs, + ...(settings ? { settings } : {}) + }, + ...(resume ? { resume: sessionId } : { sessionId }) + }, + cwd + }, + { onMessage: (message) => frames.push({ at: Date.now(), message }) } + ) + connections.push(connection) + recordedPids.add(connection.pid!) + return connection +} + +function userMessage(text: string): Record { + return { + type: 'user', + message: { role: 'user', content: [{ type: 'text', text }] }, + parent_tool_use_id: null, + session_id: '' + } +} + +async function transcriptLines(sessionId: string): Promise { + const configDir = process.env.CLAUDE_CONFIG_DIR?.trim() || join(homedir(), '.claude') + const path = await until( + () => + resolveSessionFilePath('claude', sessionId, { + claudeProjectsDir: join(configDir, 'projects') + }), + 'the transcript', + 15_000 + ) + return readFileSync(path, 'utf8') +} + +function expectLineAtomic(contents: string): void { + expect(contents.length).toBeGreaterThan(0) + expect(contents.endsWith('\n')).toBe(true) + for (const line of contents.split('\n').filter((entry) => entry.trim())) { + expect(() => JSON.parse(line)).not.toThrow() + } +} + +function isRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null +} + +function summarize(frames: Frame[], since: number): string[] { + return frames + .filter((frame) => frame.at >= since) + .map(({ at, message }) => { + const inner = isRecord(message.message) ? message.message.content : undefined + const blocks = (Array.isArray(inner) ? inner : []) + .filter(isRecord) + .map((block) => + block.type === 'tool_result' + ? `tool_result(is_error=${String(block.is_error)}:${JSON.stringify(block.content).slice(0, 80)})` + : String(block.type) + ) + return `+${at - since}ms ${String(message.type)}/${String(message.subtype ?? '')}${ + message.type === 'result' ? `(is_error=${String(message.is_error)})` : '' + } ${blocks.join(',')}`.trim() + }) +} + +async function resumeAndAsk(sessionId: string, cwd: string): Promise { + const frames: Frame[] = [] + const resumed = await open(sessionId, cwd, true, frames) + await resumed.send(userMessage('In one short line: what command did I ask you to run?')) + const result = await until( + () => frames.find((frame) => frame.message.type === 'result')?.message ?? null, + 'the resumed turn result' + ) + expect(result.subtype).toBe('success') + await expect(resumed.close()).resolves.toBe(true) +} + +type StopCase = 'close mid-tool' | 'SIGTERM to the supervisor mid-tool' | 'close while idle' + +afterEach(async () => { + for (const pid of recordedPids) { + if (alive(pid)) { + process.kill(pid, 'SIGKILL') + } + } + recordedPids.clear() + connections.splice(0) + for (const dir of tempDirs.splice(0)) { + rmSync(dir, { recursive: true, force: true }) + } +}) + +describe.runIf(enabled)('real Claude stopped through the POSIX supervisor', () => { + it.each(['close mid-tool', 'SIGTERM to the supervisor mid-tool', 'close while idle'])( + '%s: stops Claude and its tool, keeps the transcript line-atomic, and resumes', + async (stopCase) => { + const cwd = mkdtempSync(join(tmpdir(), 'orca-real-claude-stop-')) + tempDirs.push(cwd) + const sessionId = randomUUID() + const frames: Frame[] = [] + const connection = await open(sessionId, cwd, false, frames) + const supervisor = connection.pid! + const midTool = stopCase !== 'close while idle' + await connection.send(userMessage(midTool ? TOOL_PROMPT : 'Reply with the single word: ok')) + const descendants = midTool + ? await until(async () => { + const rows = await descendantsOf(supervisor) + return rows.some((row) => row.command.includes(TOOL_MARKER)) ? rows : null + }, 'the Bash tool').catch((error: unknown) => { + console.log('[no tool] frames so far:', summarize(frames, 0)) + throw error + }) + : await until( + async () => + frames.some((frame) => frame.message.type === 'result') + ? await descendantsOf(supervisor) + : null, + 'the idle turn' + ) + for (const row of descendants) { + recordedPids.add(row.pid) + } + + const signalledAt = Date.now() + if (stopCase === 'SIGTERM to the supervisor mid-tool') { + process.kill(supervisor, 'SIGTERM') + } else { + await expect(connection.close()).resolves.toBe(true) + } + const gone = await until( + () => ([supervisor, ...descendants.map((row) => row.pid)].some(alive) ? null : true), + 'the supervisor, Claude and its tools to exit', + SUPERVISED_GRACEFUL_EXIT_MS + 2_000 + ) + const stoppedMs = Date.now() - signalledAt + const after = summarize(frames, signalledAt) + console.log(`[${stopCase}] stopped in ${stoppedMs} ms; frames after the stop:`, after) + if (FRAMES_OUT) { + writeFileSync( + `${FRAMES_OUT}.${stopCase.replaceAll(' ', '-')}.json`, + JSON.stringify({ stoppedMs, after }, null, 2) + ) + } + expect(gone).toBe(true) + + expectLineAtomic(await transcriptLines(sessionId)) + await resumeAndAsk(sessionId, cwd) + expectLineAtomic(await transcriptLines(sessionId)) + }, + 180_000 + ) +}) diff --git a/src/main/claude/claude-supervised-stop.integration.test.ts b/src/main/claude/claude-supervised-stop.integration.test.ts new file mode 100644 index 000000000000..d0a5f9ea0cc4 --- /dev/null +++ b/src/main/claude/claude-supervised-stop.integration.test.ts @@ -0,0 +1,225 @@ +import { spawn, type ChildProcess } from 'node:child_process' +import { existsSync, mkdtempSync, rmSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' +import type { SpawnOptions as SdkSpawnOptions } from '@anthropic-ai/claude-agent-sdk' +import { spawnProcess } from '../../shared/child-process/run-process' +import type { ProcessSpec } from '../../shared/child-process/process-spec' +import { + PROVIDER_SIGTERM_GRACE_MS, + PROVIDER_STDIN_END_GRACE_MS, + PROVIDER_SUPERVISOR_MAX_STOP_MS +} from '../codex/codex-app-server-posix-supervisor' +import { proveClaudeChildExit } from './claude-agent-sdk-exit-proof' +import { createClaudeCodeProcessSpawn } from './claude-agent-sdk-process-spawn' + +// Stands in for Claude mid-turn: stdin end does not stop it, the way EOF lets the real CLI finish +// its turn. Its tool leads its own group, as the CLI's Bash tool shells do, and only Claude's own +// SIGTERM handler reaps it. The daemon double-forks out of the tree before anything looks. +const FAKE_CLAUDE = String.raw` + const { spawn } = require('node:child_process') + const { writeFileSync } = require('node:fs') + process.stdin.resume() + process.stdout.on('error', () => {}) + const tool = spawn(process.execPath, ['-e', 'setInterval(() => {}, 60000)'], { + detached: true, + stdio: 'ignore' + }) + const forker = spawn( + process.execPath, + ['-e', "const d = require('node:child_process').spawn(process.execPath, ['-e', 'setInterval(() => {}, 60000)'], { detached: true, stdio: 'ignore' }); d.unref(); process.stdout.write(String(d.pid))"], + { stdio: ['ignore', 'pipe', 'ignore'] } + ) + let daemon = '' + forker.stdout.on('data', (chunk) => { daemon += chunk }) + forker.once('exit', () => { + process.stdout.write(JSON.stringify({ claude: process.pid, tool: tool.pid, daemon: Number(daemon) }) + '\n') + }) + process.on('SIGTERM', () => { + if (process.env.ORCA_TEST_CLAUDE_IGNORES_SIGTERM) return + try { process.kill(-tool.pid, 'SIGKILL') } catch {} + writeFileSync(process.env.ORCA_TEST_SIGTERM_MARKER, 'reaped') + process.exit(143) + }) + setInterval(() => {}, 60000) +` + +// Stands in for Orca's main: starts exactly the spec Claude's spawner built, then can be SIGKILLed. +const OWNER = String.raw` + const { spawn } = require('node:child_process') + const spec = JSON.parse(process.env.ORCA_TEST_SPAWN_SPEC) + const env = { ...spec.env } + if (env.ORCA_PROVIDER_SUPERVISOR_SPEC) { + const supervisor = JSON.parse(Buffer.from(env.ORCA_PROVIDER_SUPERVISOR_SPEC, 'base64').toString()) + supervisor.ownerPid = process.pid + env.ORCA_PROVIDER_SUPERVISOR_SPEC = Buffer.from(JSON.stringify(supervisor)).toString('base64') + } + const child = spawn(spec.program, spec.args, { + cwd: spec.cwd, + env, + detached: spec.detached, + stdio: ['pipe', 'pipe', 'ignore'] + }) + process.stdout.write(JSON.stringify({ root: child.pid }) + '\n') + child.stdout.pipe(process.stdout) + setInterval(() => {}, 60000) +` + +const recordedPids = new Set() +const tempDirs: string[] = [] + +function alive(pid: number): boolean { + try { + process.kill(pid, 0) + return true + } catch (error) { + return !(error instanceof Error && 'code' in error && error.code === 'ESRCH') + } +} + +async function waitFor(predicate: () => boolean, timeoutMs: number): Promise { + const deadline = Date.now() + timeoutMs + while (!predicate()) { + if (Date.now() >= deadline) { + return false + } + await new Promise((resolve) => setTimeout(resolve, 25)) + } + return true +} + +function readPids(child: ChildProcess, keys: readonly string[]): Promise> { + return new Promise((resolve, reject) => { + const pids: Record = {} + let buffered = '' + const timeout = setTimeout(() => reject(new Error(`no ${keys.join('/')} pids`)), 10_000) + const onData = (chunk: Buffer): void => { + buffered += chunk.toString() + const lines = buffered.split('\n') + buffered = lines.pop() ?? '' + for (const line of lines) { + const parsed: unknown = JSON.parse(line) + for (const [key, pid] of Object.entries(parsed ?? {})) { + if (typeof pid === 'number' && pid > 0) { + pids[key] = pid + recordedPids.add(pid) + } + } + } + if (keys.every((key) => key in pids)) { + clearTimeout(timeout) + child.stdout!.off('data', onData) + child.stdout!.resume() + resolve(pids) + } + } + child.stdout!.on('data', onData) + }) +} + +function sdkOptions(env: Record): SdkSpawnOptions { + const dir = mkdtempSync(join(tmpdir(), 'orca-claude-supervised-')) + tempDirs.push(dir) + return { + command: process.execPath, + args: ['-e', FAKE_CLAUDE], + cwd: dir, + env: { + ...process.env, + ORCA_TEST_SIGTERM_MARKER: join(dir, 'sigterm-reap'), + ...env + }, + signal: new AbortController().signal + } +} + +/** Claude spawned through Orca's own spawner and stopped by Orca's own close ladder. */ +async function spawnClaude(env: Record = {}) { + const spawner = createClaudeCodeProcessSpawn(spawnProcess) + const options = sdkOptions(env) + const child = spawner.spawn(options) + recordedPids.add(child.pid!) + let exited = false + const exit = new Promise<{ code: number | null; signal: NodeJS.Signals | null }>((resolve) => + child.once('exit', (code, signal) => { + exited = true + resolve({ code, signal }) + }) + ) + const pids = await readPids(child, ['claude', 'tool', 'daemon']) + const close = (): Promise => + proveClaudeChildExit({ + child, + exitPromise: exit.then(() => undefined), + exited: () => exited, + supervised: spawner.supervised + }) + return { child, exit, pids, close, marker: String(options.env.ORCA_TEST_SIGTERM_MARKER) } +} + +afterEach(() => { + for (const pid of recordedPids) { + if (alive(pid)) { + process.kill(pid, 'SIGKILL') + } + } + recordedPids.clear() + for (const dir of tempDirs.splice(0)) { + rmSync(dir, { recursive: true, force: true }) + } +}) + +describe.runIf(process.platform !== 'win32')('Claude under the POSIX provider supervisor', () => { + it('stops a mid-turn Claude on close instead of letting stdin end finish its turn', async () => { + const { child, exit, pids, close, marker } = await spawnClaude() + expect(child.pid).not.toBe(pids.claude) + + const startedAt = Date.now() + await expect(close()).resolves.toBe(true) + + // Claude's own SIGTERM reap ran at once, not after the supervisor's stdin-end grace. + expect(Date.now() - startedAt).toBeLessThan(PROVIDER_STDIN_END_GRACE_MS) + expect(existsSync(marker)).toBe(true) + await expect(exit).resolves.toEqual({ code: null, signal: 'SIGTERM' }) + expect(alive(pids.claude)).toBe(false) + expect(alive(pids.tool)).toBe(false) + }) + + it('lets the supervisor escalate a Claude that ignores SIGTERM, and exits only after it', async () => { + const { exit, pids, close } = await spawnClaude({ ORCA_TEST_CLAUDE_IGNORES_SIGTERM: '1' }) + + const startedAt = Date.now() + await expect(close()).resolves.toBe(true) + + const elapsed = Date.now() - startedAt + expect(elapsed).toBeGreaterThanOrEqual(PROVIDER_SIGTERM_GRACE_MS) + expect(elapsed).toBeLessThan(PROVIDER_SUPERVISOR_MAX_STOP_MS + 1_000) + // The supervisor's own SIGTERM stop finished the job; nothing forced the supervisor itself. + await expect(exit).resolves.toEqual({ code: null, signal: 'SIGTERM' }) + expect(alive(pids.claude)).toBe(false) + }) + + it("stops Claude and its tool when Orca's main dies, and leaves a daemon that left its tree alone", async () => { + const specs: ProcessSpec[] = [] + createClaudeCodeProcessSpawn((spec) => { + specs.push(spec) + return spawnProcess({ program: 'true' }) + }).spawn(sdkOptions({})) + const owner = spawn(process.execPath, ['-e', OWNER], { + env: { ...process.env, ORCA_TEST_SPAWN_SPEC: JSON.stringify(specs[0]) }, + stdio: ['ignore', 'pipe', 'ignore'] + }) + recordedPids.add(owner.pid!) + const pids = await readPids(owner, ['root', 'claude', 'tool', 'daemon']) + + owner.kill('SIGKILL') + + expect(await waitFor(() => !alive(pids.claude), PROVIDER_SUPERVISOR_MAX_STOP_MS)).toBe(true) + expect(await waitFor(() => !alive(pids.root), PROVIDER_SUPERVISOR_MAX_STOP_MS)).toBe(true) + // In its own group, so only Claude's SIGTERM handler could have reaped it. + expect(alive(pids.tool)).toBe(false) + // Not the conversation's writer: nothing proves it orphaned, so the stop never reaches it. + expect(alive(pids.daemon)).toBe(true) + }) +}) diff --git a/src/main/codex/codex-app-server-connection.ts b/src/main/codex/codex-app-server-connection.ts index ef566bca3360..5bed3b594d7d 100644 --- a/src/main/codex/codex-app-server-connection.ts +++ b/src/main/codex/codex-app-server-connection.ts @@ -46,7 +46,7 @@ export type CodexAppServerLaunch = { } const DEFAULT_REQUEST_TIMEOUT_MS = 30_000 -const GRACEFUL_EXIT_MS = 1_500 +export const GRACEFUL_EXIT_MS = 1_500 const FORCED_EXIT_MS = 1_000 const STDERR_TAIL_MAX_BYTES = 8192 diff --git a/src/main/codex/codex-app-server-posix-supervisor.integration.test.ts b/src/main/codex/codex-app-server-posix-supervisor.integration.test.ts index e23cdbc88c34..846afaa973f4 100644 --- a/src/main/codex/codex-app-server-posix-supervisor.integration.test.ts +++ b/src/main/codex/codex-app-server-posix-supervisor.integration.test.ts @@ -52,8 +52,11 @@ const RECORDS_SIGTERM_PROVIDER = String.raw` // Stands in for Orca: launches the supervisor as its own child, then can be killed outright. A // second child holds the supervisor's stdin open, so only the parent-death watch can notice. +// A clean-quit owner has no holder and exits normally on SIGUSR2, the way Orca quits. const OWNER = String.raw` const { spawn } = require('node:child_process') + const quitsCleanly = Boolean(process.env.ORCA_TEST_OWNER_QUITS_CLEANLY) + if (quitsCleanly) process.on('SIGUSR2', () => process.exit(0)) const spec = JSON.parse(Buffer.from(process.env.ORCA_PROVIDER_SUPERVISOR_SPEC, 'base64').toString()) spec.ownerPid = process.pid const supervisor = spawn(process.execPath, ['-e', process.env.ORCA_TEST_SUPERVISOR_SCRIPT], { @@ -61,10 +64,12 @@ const OWNER = String.raw` stdio: ['pipe', 'pipe', 'ignore'], detached: true }) - const holder = spawn(process.execPath, ['-e', 'setInterval(() => {}, 60000)'], { - stdio: ['ignore', supervisor.stdin, 'ignore'] - }) - process.stdout.write(JSON.stringify({ supervisor: supervisor.pid, holder: holder.pid }) + '\n') + const holder = quitsCleanly + ? null + : spawn(process.execPath, ['-e', 'setInterval(() => {}, 60000)'], { + stdio: ['ignore', supervisor.stdin, 'ignore'] + }) + process.stdout.write(JSON.stringify({ supervisor: supervisor.pid, ...(holder && { holder: holder.pid }) }) + '\n') supervisor.stdout.pipe(process.stdout) setInterval(() => {}, 60000) ` @@ -175,7 +180,7 @@ async function launchUnderOwner( stdio: ['ignore', 'pipe', 'ignore'] }) recordedPids.add(owner.pid!) - const pids = await readPids(owner, ['supervisor', 'holder', 'provider', 'grandchild']) + const pids = await readPids(owner, ['supervisor', 'provider', 'grandchild']) return { owner, pids } } @@ -318,6 +323,23 @@ describe.runIf(process.platform !== 'win32')('POSIX provider supervisor processe expect(alive(provider)).toBe(false) }) + it('reaps the provider group and exits when its owner quits cleanly', async () => { + const { owner, pids } = await launchUnderOwner( + { sigtermGraceMs: 300 }, + { ORCA_TEST_OWNER_QUITS_CLEANLY: '1' } + ) + const ownerExit = new Promise((resolve) => + owner.once('exit', (code, signal) => resolve({ code, signal })) + ) + + owner.kill('SIGUSR2') + + await expect(ownerExit).resolves.toEqual({ code: 0, signal: null }) + expect(await waitFor(() => !alive(-pids.provider), 3_000)).toBe(true) + expect(await waitFor(() => !alive(pids.supervisor), 3_000)).toBe(true) + expect(alive(pids.grandchild)).toBe(false) + }) + it('asks the provider to stop with SIGTERM when its owner dies', async () => { const signalFile = join(tempDir(), 'provider-signal') const { owner, pids } = await launchUnderOwner( diff --git a/src/main/codex/codex-app-server-posix-supervisor.test.ts b/src/main/codex/codex-app-server-posix-supervisor.test.ts index 28a088716f6c..6dbe03e5b2a2 100644 --- a/src/main/codex/codex-app-server-posix-supervisor.test.ts +++ b/src/main/codex/codex-app-server-posix-supervisor.test.ts @@ -72,7 +72,8 @@ describe('structured provider supervision', () => { args: ['app-server', '--flag'], env: { PATH: '/bin' }, cwd: '/work/repo', - detached: false + detached: false, + supervised: false }) }) }) diff --git a/src/main/codex/codex-app-server-posix-supervisor.ts b/src/main/codex/codex-app-server-posix-supervisor.ts index 30714ee79112..21dd56aeb5b5 100644 --- a/src/main/codex/codex-app-server-posix-supervisor.ts +++ b/src/main/codex/codex-app-server-posix-supervisor.ts @@ -113,9 +113,10 @@ timer = setInterval(() => { if (ownerGone()) stopProviderGroup(null) }, 100) timer.unref() -child.once('error', () => { +child.once('error', (error) => { clearInterval(timer) - process.exit(127) + // The owner sees only this pid's exit; stderr is where a missing provider binary can say so. + process.stderr.write(String(error && error.message) + '\\n', () => process.exit(127)) }) child.once('exit', (code, signal) => { void reapProviderExit(code, signal) @@ -176,13 +177,22 @@ export function createProviderSpawnSpec( launch: CodexAppServerLaunch, childEnv: NodeJS.ProcessEnv, platform: NodeJS.Platform -): { program: string; args: string[]; env: NodeJS.ProcessEnv; cwd: string; detached: boolean } { - const supervised = platform === 'win32' ? null : supervisedPosixLaunch(launch, childEnv) +): { + program: string + args: string[] + env: NodeJS.ProcessEnv + cwd: string + detached: boolean + /** The child is the supervisor, whose SIGTERM stops the provider and then itself. */ + supervised: boolean +} { + const supervisor = platform === 'win32' ? null : supervisedPosixLaunch(launch, childEnv) return { - program: supervised?.command ?? launch.command, - args: supervised?.args ?? launch.args, - env: supervised?.env ?? childEnv, + program: supervisor?.command ?? launch.command, + args: supervisor?.args ?? launch.args, + env: supervisor?.env ?? childEnv, cwd: launch.cwd ?? process.cwd(), - detached: platform !== 'win32' + detached: platform !== 'win32', + supervised: supervisor !== null } } diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.test.ts index 760b2603d99c..1baaafb6f6b7 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.test.ts @@ -1,17 +1,23 @@ import { describe, expect, it, vi } from 'vitest' +import { WILL_QUIT_TEARDOWN_DEADLINE_MS } from '../../../shared/quit-teardown-deadline' +import { + GRACEFUL_EXIT_MS as CLAUDE_WINDOWS_GRACEFUL_EXIT_MS, + SUPERVISED_GRACEFUL_EXIT_MS +} from '../../claude/claude-child-exit-proof-ladder' +import { GRACEFUL_EXIT_MS as CODEX_WINDOWS_GRACEFUL_EXIT_MS } from '../../codex/codex-app-server-connection' import { PROVIDER_SUPERVISOR_MAX_STOP_MS } from '../../codex/codex-app-server-posix-supervisor' import { SNAPSHOT_DRAIN_TIMEOUT_MS } from './structured-agent-session-eviction' import { CHILD_EVICTION_TIMEOUT_MS, + EVICTION_MARGIN_MS, + RESUME_MARKER_RECORD_TIMEOUT_MS, structuredAgentSessionHostTeardownPhases } from './structured-agent-session-host-teardown' -// Codex close observes the supervisor's exit after its timers fire, which run late on a loaded host. -const SUPERVISOR_EXIT_OBSERVATION_HEADROOM_MS = 1_000 +const noop = async (): Promise => undefined describe('structured agent-session host teardown', () => { it('names every phase, so the quit-path order is pinned rather than incidental', () => { - const noop = async (): Promise => undefined const phases = structuredAgentSessionHostTeardownPhases({ idleSweep: { dispose: noop }, runtimeState: { stopLeaseRenewal: () => undefined, flushAllEventSinks: noop }, @@ -31,14 +37,54 @@ describe('structured agent-session host teardown', () => { ]) }) - it("fits the Codex supervisor's longest stop inside quit's child-eviction bound", () => { - // A quit that times out first leaves the provider running and its lease unreleased. Eviction - // drains the sink for the resume offer before it stops the child, inside the same bound. - expect( - SNAPSHOT_DRAIN_TIMEOUT_MS + - PROVIDER_SUPERVISOR_MAX_STOP_MS + - SUPERVISOR_EXIT_OBSERVATION_HEADROOM_MS - ).toBeLessThan(CHILD_EVICTION_TIMEOUT_MS) + it("derives quit's child-eviction bound from every provider's supervised close", () => { + // Eviction drains the sink for the resume offer before it stops the child, inside one bound. + // Each close's tree-kill fallback is deliberately outside it: once main exits the supervisor + // stops its group itself, and next launch's recovery settles the lease. + const closes = { + claude: SUPERVISED_GRACEFUL_EXIT_MS, + codex: PROVIDER_SUPERVISOR_MAX_STOP_MS, + // No supervisor on Windows, so its closes wait less than any supervised one. + claudeWindows: CLAUDE_WINDOWS_GRACEFUL_EXIT_MS, + codexWindows: CODEX_WINDOWS_GRACEFUL_EXIT_MS + } + expect(CHILD_EVICTION_TIMEOUT_MS).toBe( + SNAPSHOT_DRAIN_TIMEOUT_MS + Math.max(closes.claude, closes.codex) + EVICTION_MARGIN_MS + ) + for (const closeMs of Object.values(closes)) { + expect(SNAPSHOT_DRAIN_TIMEOUT_MS + closeMs + EVICTION_MARGIN_MS).toBeLessThanOrEqual( + CHILD_EVICTION_TIMEOUT_MS + ) + } + // The resume markers recorded after eviction still fit under quit's global deadline. + expect(CHILD_EVICTION_TIMEOUT_MS + RESUME_MARKER_RECORD_TIMEOUT_MS).toBeLessThan( + WILL_QUIT_TEARDOWN_DEADLINE_MS + ) + }) + + it('ends child eviction as soon as every chat has closed, not at its bound', async () => { + vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) + const evict = structuredAgentSessionHostTeardownPhases({ + idleSweep: { dispose: noop }, + runtimeState: { stopLeaseRenewal: () => undefined, flushAllEventSinks: noop }, + tasks: { drainAttaches: noop }, + evictOwnedSessions: noop, + beginResumeMarkers: () => {}, + recordResumeMarkers: noop + }).find((phase) => phase.name === 'evict-owned-sessions') + try { + let finished = false + const run = Promise.resolve(evict?.run()).then(() => { + finished = true + }) + // No timer advances: the phase settles with the eviction, not at CHILD_EVICTION_TIMEOUT_MS. + await vi.advanceTimersByTimeAsync(0) + expect(finished).toBe(true) + await run + expect(vi.getTimerCount()).toBe(0) + } finally { + vi.useRealTimers() + } }) it('bounds stalled recovery publication without preventing later cleanup', async () => { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.ts index eade95a7dd2c..bc9a48c5dacb 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-host-teardown.ts @@ -7,6 +7,9 @@ // nothing can ever close them. import type { AgentSessionResumeTrigger } from '../../../shared/agent-session-resume-marker' +import { SUPERVISED_GRACEFUL_EXIT_MS } from '../../claude/claude-child-exit-proof-ladder' +import { PROVIDER_SUPERVISOR_MAX_STOP_MS } from '../../codex/codex-app-server-posix-supervisor' +import { SNAPSHOT_DRAIN_TIMEOUT_MS } from './structured-agent-session-eviction' import type { StructuredAgentSessionRestartResume } from './structured-agent-session-restart-resume-host' import { abandonQueuedStructuredAgentSessionMessages, @@ -23,12 +26,20 @@ export type StructuredAgentSessionTeardownPhase = { } /** Advisory persistence must not hold shutdown open. */ -const RESUME_MARKER_RECORD_TIMEOUT_MS = 2_000 +export const RESUME_MARKER_RECORD_TIMEOUT_MS = 2_000 -/** Eight steps at ten seconds each would outlast the global quit deadline, and a quit that dies - * mid-eviction leaves the lease unreleased — the exact state restart has to clean up. Bounded - * well below that deadline so the phases after this one still get to run. */ -export const CHILD_EVICTION_TIMEOUT_MS = 8_000 +/** Covers a provider's stop observed late on a loaded host. */ +export const EVICTION_MARGIN_MS = 1_000 + +/** A quit that dies mid-eviction leaves the lease unreleased — the exact state restart has to + * clean up — so this covers the sink drain plus the longest supervised provider close, well below + * the global quit deadline so later phases still run. A close's tree-kill fallback is outside it: + * once main exits the supervisor stops its group itself, and next launch's recovery settles the + * lease. Windows closes have no supervisor and wait less. */ +export const CHILD_EVICTION_TIMEOUT_MS = + SNAPSHOT_DRAIN_TIMEOUT_MS + + Math.max(SUPERVISED_GRACEFUL_EXIT_MS, PROVIDER_SUPERVISOR_MAX_STOP_MS) + + EVICTION_MARGIN_MS /** Bounds a phase without swallowing its failure, which `withTimeout` alone would. */ async function withPhaseTimeout(run: () => Promise, timeoutMs: number): Promise { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.ts index 36d950a09a48..385d438f7a04 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-recovery-resolution.ts @@ -30,8 +30,8 @@ export type StructuredSessionRecoveryResolutionDeps = { } const STOP_PROBE_INTERVAL_MS = 250 -// A POSIX Codex owner is its provider supervisor, which exits only after its provider group. A -// SIGKILL that lands first leaves the group running, so SIGTERM outlasts the supervisor's stop. +// A POSIX structured owner is its provider supervisor, which exits only after its provider +// group. A SIGKILL that lands first leaves the group running, so SIGTERM outlasts its stop. const STOP_PROBES: Record = { SIGTERM: Math.ceil(PROVIDER_SUPERVISOR_MAX_STOP_MS / STOP_PROBE_INTERVAL_MS) + 1, SIGKILL: 4 From b776e9ac9961d787325f23225790514173f1ca6f Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:52:36 -0700 Subject: [PATCH 59/90] fix(browser): give a tab's identity one owner so viewport presets stop dropping client hints (#23718) * fix(browser): give a tab's identity one owner so viewport presets stop dropping client hints A desktop viewport preset installed a CDP user-agent override with no userAgentMetadata. Chromium then drops navigator.userAgentData and every sec-ch-ua header for that tab: a Chrome UA with no client hints. Identity was decided separately by the session request hook, the Google sign-in switch and the viewport code, and nothing decided per tab who it should claim to be. resolveBrowserTabIdentity now derives it from the process identity mode, whether the URL is a Google auth host, and whether a mobile preset is requested. applyTabIdentity is the one writer: it keeps the WebContents UA on the process or Firefox identity and clears the CDP override whenever that layer already presents the identity. Viewport emulation only records the requested preset; its metrics and touch steps log failures independently, so a rejected step can no longer skip the identity restore. * test(browser): read the presented identity instead of casting the guest stub * test(browser): drop a comment that described desktop presets writing a UA * fix(browser): keep same-document navigations and unapplied presets off the tab identity A same-document navigation (pushState/replaceState) now never rewrites the WebContents user agent. Chromium reloads a still-loading document when its user agent changes, so an OAuth callback that strips its code with replaceState after a redirect off Google sign-in was requested twice, replaying the one-time code. Measured on Electron 43.7.5: the callback URL hits the server twice with the write, once without. The session request hook now derives the mobile identity from the CDP override the tab actually holds instead of the requested preset. A preset whose write never landed (debugger attach refused while DevTools is open, a failed write, a detach) no longer puts the iPhone user agent and mobile client hints on the wire while the document reports desktop. * fix(browser): restore identity after a failed navigation without reloading the error page did-fail-load fires while the failed URL's error page is still loading, and WebContents.setUserAgent() at that moment makes Chromium reload it. After a redirect onto or off the Google sign-in host (identity moved over CDP only), the restore rewrote the WebContents UA there and replayed the failed request. The restore now goes over CDP; the next navigation rewrites the WebContents UA. * refactor(browser): let only a navigation start write the WebContents user agent Two review rounds each found a caller that asked the identity writer to rewrite the WebContents UA at a moment Chromium reloads or cancels the page (a same-document navigation, a failed load). A boolean at every call site left that decision to the callers. The writer now has two entry points: presentTabIdentityAtNavigationStart, the only one that may write the WebContents UA and only for a cross-document navigation, and retargetTabIdentity, which goes over CDP only and serves redirects, failed loads and preset changes. A table test pins the rule for every entry point. * test(browser): reject touch emulation regardless of payload in the identity-restore test The mock rejected only maxTouchPoints 0, so the test would stop exercising a failed touch step once the touch payload is fixed. --- .../browser-manager-auth-user-agent.test.ts | 58 +-- src/main/browser/browser-manager-bindings.ts | 4 +- .../browser/browser-manager-guest-cleanup.ts | 2 +- ...browser-manager-guest-navigation-policy.ts | 10 +- .../browser/browser-manager-guest-policy.ts | 4 +- .../browser/browser-manager-navigation.ts | 288 ++++++------- .../browser/browser-manager-registration.ts | 12 +- src/main/browser/browser-manager-state.ts | 18 +- .../browser-manager-tab-identity.test.ts | 385 ++++++++++++++++++ src/main/browser/browser-manager-types.ts | 17 +- .../browser-manager-viewport-override.test.ts | 197 +++++---- ...browser-manager-viewport-ownership.test.ts | 77 ++-- .../browser-manager-viewport-scroll-state.ts | 13 +- .../browser-manager-viewport-test-fixtures.ts | 40 +- src/main/browser/browser-manager-viewport.ts | 134 +++--- .../browser/browser-session-registry.test.ts | 2 +- ...ession-ua-cloudflare-live.electron.test.ts | 4 +- src/main/browser/browser-session-ua.ts | 17 +- src/main/browser/browser-tab-identity.test.ts | 78 ++++ src/main/browser/browser-tab-identity.ts | 90 ++++ .../browser-viewport-user-agent.test.ts | 66 --- .../browser/browser-viewport-user-agent.ts | 75 ---- tests/tools/google-signin-ua-probe.cjs | 2 +- 23 files changed, 1015 insertions(+), 578 deletions(-) create mode 100644 src/main/browser/browser-manager-tab-identity.test.ts create mode 100644 src/main/browser/browser-tab-identity.test.ts create mode 100644 src/main/browser/browser-tab-identity.ts delete mode 100644 src/main/browser/browser-viewport-user-agent.test.ts delete mode 100644 src/main/browser/browser-viewport-user-agent.ts diff --git a/src/main/browser/browser-manager-auth-user-agent.test.ts b/src/main/browser/browser-manager-auth-user-agent.test.ts index d85a785a8871..1a24369f58cd 100644 --- a/src/main/browser/browser-manager-auth-user-agent.test.ts +++ b/src/main/browser/browser-manager-auth-user-agent.test.ts @@ -137,10 +137,22 @@ describe('browserManager', () => { { userAgent: guestBaseUserAgent } ]) - // A navigation that doesn't change the required UA must not thrash setUserAgent. + // The next direct navigation is the first safe moment to rewrite the WebContents UA, so it + // restores the process identity there and drops the CDP override that stood in for it. setUserAgent.mockClear() + sendCommand.mockClear() didStartNavigation(null, 'https://example.com/', false, true) + expect(setUserAgent).toHaveBeenCalledOnce() + expect(setUserAgent).toHaveBeenLastCalledWith(guestBaseUserAgent) + expect(sendCommand).toHaveBeenCalledWith('Emulation.setUserAgentOverride', { userAgent: '' }) + await expect(sendCommand.mock.results.at(-1)?.value).resolves.toBeUndefined() + + // A navigation that doesn't change the required UA must not thrash either layer. + setUserAgent.mockClear() + sendCommand.mockClear() + didStartNavigation(null, 'https://example.org/', false, true) expect(setUserAgent).not.toHaveBeenCalled() + expect(sendCommand).not.toHaveBeenCalled() }) it('leaves the UA untouched on Google auth hosts in native process mode', () => { @@ -270,7 +282,8 @@ describe('browserManager', () => { // Why: the CDP override outranks the WebContents UA, so getUserAgent() still reports the base // identity. Leaving the auth host must read the override, not that stale value, or the guest - // keeps presenting Firefox on every later host. + // keeps presenting Firefox on every later host. The WebContents UA already presents the process + // identity, so leaving clears the override rather than restating the UA without client hints. sendCommand.mockClear() const didStartNavigation = guestOnMock.mock.calls.find( ([event]) => event === 'did-start-navigation' @@ -282,8 +295,8 @@ describe('browserManager', () => { expect(guest.setUserAgent).not.toHaveBeenCalled() expect(sendCommand.mock.calls).toEqual([ - ['Emulation.setUserAgentOverride', { userAgent: guestBaseUserAgent }], - ['Emulation.setUserAgentOverride', { userAgent: guestBaseUserAgent }] + ['Emulation.setUserAgentOverride', { userAgent: '' }], + ['Emulation.setUserAgentOverride', { userAgent: '' }] ]) // A newer confirmed write outranks an older write that remains in flight. @@ -330,9 +343,7 @@ describe('browserManager', () => { sendCommand.mockClear() didStartNavigation(null, 'https://example.com/', false, true) - expect(sendCommand).toHaveBeenCalledWith('Emulation.setUserAgentOverride', { - userAgent: guestBaseUserAgent - }) + expect(sendCommand).toHaveBeenCalledWith('Emulation.setUserAgentOverride', { userAgent: '' }) browserManager.unregisterGuest('browser-redirect-ua') }) @@ -420,14 +431,14 @@ describe('browserManager', () => { ) }) - // Why: the direct-navigation branch still writes the Firefox UA through WebContents.setUserAgent, - // and nothing ever restores it once the guest switches to the CDP override. A viewport preset that - // read getUserAgent() back as its base identity would therefore republish Firefox on every ordinary - // host — the wire UA saying Firefox while sec-ch-ua still says Chrome, the exact cross-layer tell - // this scope exists to remove. - it('keeps a viewport preset on the session identity after an auth-host visit', async () => { + // Why: a direct navigation onto the auth host writes Firefox into the WebContents UA, and a redirect + // off it cannot rewrite that layer without cancelling the navigation. Clearing the CDP override + // there would expose that stale Firefox UA on an ordinary host, so the override must carry the + // process identity until the next direct navigation can restore the WebContents UA and clear it. + it('never clears the override onto a stale Firefox WebContents UA and heals it on the next navigation', async () => { browserMocks.processUserAgent = GUEST_CLEAN_UA - const { guest, debuggerSendCommand } = makeViewportGuest(9001) + const { guest, debuggerSendCommand, presentedUserAgent, standingUserAgentOverride } = + makeViewportGuest(9001) webContentsFromIdMock.mockReturnValue(guest) browserManager.attachGuestPolicies(guest as never) browserManager.registerGuest({ @@ -452,22 +463,23 @@ describe('browserManager', () => { didStartNavigation(null, 'https://accounts.google.com/v3/signin/identifier', false, true) await flushViewportOps() - // The direct branch pins the WebContents UA to Firefox and never restores it. expect((guest.getUserAgent as () => string)()).toBe(googleAuthUserAgent()) + debuggerSendCommand.mockClear() willRedirect({ preventDefault: vi.fn() }, 'https://myaccount.google.com/', false, true) await flushViewportOps() + expect(debuggerSendCommand).toHaveBeenLastCalledWith('Emulation.setUserAgentOverride', { + userAgent: GUEST_CLEAN_UA + }) + expect(presentedUserAgent()).toBe(GUEST_CLEAN_UA) debuggerSendCommand.mockClear() didStartNavigation(null, 'https://github.com/', false, true) await flushViewportOps() - - const uaWrites = debuggerSendCommand.mock.calls.filter( - ([method]) => method === 'Emulation.setUserAgentOverride' - ) - expect(uaWrites.length).toBeGreaterThan(0) - for (const [, params] of uaWrites) { - expect((params as { userAgent: string }).userAgent).toBe(GUEST_CLEAN_UA) - } + expect(debuggerSendCommand).toHaveBeenLastCalledWith('Emulation.setUserAgentOverride', { + userAgent: '' + }) + expect(standingUserAgentOverride()).toBeNull() + expect(presentedUserAgent()).toBe(GUEST_CLEAN_UA) }) }) diff --git a/src/main/browser/browser-manager-bindings.ts b/src/main/browser/browser-manager-bindings.ts index 931c5c6bc3b4..a87c7e73e084 100644 --- a/src/main/browser/browser-manager-bindings.ts +++ b/src/main/browser/browser-manager-bindings.ts @@ -77,8 +77,8 @@ export abstract class BrowserManagerBindings extends BrowserManagerGrab { resolveRenderer: (tabId) => resolveRendererWebContents(this.rendererWebContentsIdByTabId, tabId), isViewportPresetActive: () => { - const state = this.viewportPresetActiveByTabId.get(browserTabId) - return state?.guestWebContentsId === guest.id && state.active + const state = this.viewportPresetByTabId.get(browserTabId) + return state?.guestWebContentsId === guest.id && state.override !== null }, canViewportScroll: (mouse) => this.canViewportScroll(browserTabId, mouse), onViewportWheelConsumed: (deltaX, deltaY) => diff --git a/src/main/browser/browser-manager-guest-cleanup.ts b/src/main/browser/browser-manager-guest-cleanup.ts index a815e95e431b..67ded30cecc7 100644 --- a/src/main/browser/browser-manager-guest-cleanup.ts +++ b/src/main/browser/browser-manager-guest-cleanup.ts @@ -23,7 +23,7 @@ export abstract class BrowserManagerGuestCleanup extends BrowserManagerGuestNavi this.offscreenGuestIds.delete(guestWebContentsId) this.popupOwnerContextByGuestId.delete(guestWebContentsId) this.pageInitiatedTabBudgetByRootGuestId.delete(guestWebContentsId) - this.authUserAgentOverrideStateByGuestId.delete(guestWebContentsId) + this.cdpUserAgentOverrideStateByGuestId.delete(guestWebContentsId) this.pendingNavigationByGuestId.delete(guestWebContentsId) // Why: a popup must stop inheriting authorization the moment its owner retires, before Chromium destroys the child. if (isPrimaryGuest) { diff --git a/src/main/browser/browser-manager-guest-navigation-policy.ts b/src/main/browser/browser-manager-guest-navigation-policy.ts index a2b8bf0b329d..9e8a301476fb 100644 --- a/src/main/browser/browser-manager-guest-navigation-policy.ts +++ b/src/main/browser/browser-manager-guest-navigation-policy.ts @@ -35,7 +35,7 @@ export abstract class BrowserManagerGuestNavigationPolicy extends BrowserManager return } this.updatePendingNavigationForRedirect(guest.id, url) - this.applyGoogleAuthUserAgent(guest, url, { duringRedirect: true }) + void this.retargetTabIdentity(guest, url) } const didFailLoadHandler = ( @@ -51,8 +51,8 @@ export abstract class BrowserManagerGuestNavigationPolicy extends BrowserManager // Why: a nav that never committed must not leave its target standing as the tab's host. const failedNavigationWasCurrent = this.failPendingNavigation(guest.id, validatedURL) if (failedNavigationWasCurrent) { - // The attempted host never committed, so restore every UA layer to the document that remains. - this.applyGoogleAuthUserAgent(guest, guest.getURL()) + // Restore the identity of the document that remains (usually the failed URL's error page). + void this.retargetTabIdentity(guest, guest.getURL()) } const browserPageId = this.tabIdByWebContentsId.get(guest.id) const certificateFailure = browserPageId @@ -91,7 +91,7 @@ export abstract class BrowserManagerGuestNavigationPolicy extends BrowserManager const didStartNavigationHandler = ( _event: Electron.Event, url: string, - _isInPlace: boolean, + isInPlace: boolean, isMainFrame: boolean ): void => { if (!isMainFrame || isChromiumInternalErrorUrl(url)) { @@ -100,7 +100,7 @@ export abstract class BrowserManagerGuestNavigationPolicy extends BrowserManager // Why: getURL() still reports the previous committed URL until this navigation commits, so // every UA writer must read the in-flight target or they disagree about the tab's host. this.startPendingNavigation(guest.id, url) - this.applyGoogleAuthUserAgent(guest, url) + void this.presentTabIdentityAtNavigationStart(guest, url, isInPlace) this.certificateTrustController?.onMainFrameNavigationStarted(guest.id) // Why: a pre-registration failure belongs only to its own nav; a replacement nav must not replay it. this.pendingLoadFailuresByGuestId.delete(guest.id) diff --git a/src/main/browser/browser-manager-guest-policy.ts b/src/main/browser/browser-manager-guest-policy.ts index dd418d71af78..9c99175096ff 100644 --- a/src/main/browser/browser-manager-guest-policy.ts +++ b/src/main/browser/browser-manager-guest-policy.ts @@ -26,7 +26,7 @@ export abstract class BrowserManagerGuestPolicy extends BrowserManagerGuestClean if (inheritedOwnerContext) { this.popupOwnerContextByGuestId.set(guest.id, inheritedOwnerContext) } - const disposeAuthDetachTracking = this.trackDebuggerDetachForAuthUserAgent(guest) + const disposeDetachTracking = this.trackDebuggerDetachForUserAgentOverride(guest) // Why: disable throttling so background screenshots still get frames; else the compositor stalls and capture returns empty. guest.setBackgroundThrottling(false) const disposePopupPolicy = this.installGuestPopupPolicy(guest, !inheritedOwnerContext) @@ -34,7 +34,7 @@ export abstract class BrowserManagerGuestPolicy extends BrowserManagerGuestClean // Why: store cleanup so unregisterGuest can drop these listeners on teardown and let the WebContents wrapper GC. this.policyCleanupByGuestId.set(guest.id, () => { - disposeAuthDetachTracking() + disposeDetachTracking() disposePopupPolicy() disposeNavigationPolicy() }) diff --git a/src/main/browser/browser-manager-navigation.ts b/src/main/browser/browser-manager-navigation.ts index a7dcf5cd4fce..d96d41e79be8 100644 --- a/src/main/browser/browser-manager-navigation.ts +++ b/src/main/browser/browser-manager-navigation.ts @@ -1,145 +1,152 @@ import { openPopupWithOriginBar, type PopupChildWindowOptions } from './popup-origin-bar-window' import { getBrowserProcessUserAgentIdentity } from './browser-process-user-agent' import type { BrowserSessionRequestUserAgentResolver } from './browser-session-ua' -import { googleAuthUserAgent, isGoogleAuthUrl } from './browser-google-auth-ua' +import { isGoogleAuthUrl } from './browser-google-auth-ua' import { - buildViewportUserAgentOverride, - type ViewportUserAgentOverride -} from './browser-viewport-user-agent' + googleAuthTabIdentity, + resolveBrowserTabIdentity, + type BrowserTabIdentity +} from './browser-tab-identity' import { safeOrigin, - type AuthUserAgentOverrideOperation, - type AuthUserAgentOverrideState + type CdpUserAgentOverride, + type CdpUserAgentOverrideOperation, + type CdpUserAgentOverrideState } from './browser-manager-types' import { BrowserManagerVisibility } from './browser-manager-visibility' export abstract class BrowserManagerNavigation extends BrowserManagerVisibility { resolveBrowserGuestRequestUserAgent( request: Parameters[0] - ): ViewportUserAgentOverride { - const identity = getBrowserProcessUserAgentIdentity() - const firefoxUa = googleAuthUserAgent() + ): BrowserTabIdentity { + const processIdentity = getBrowserProcessUserAgentIdentity() + const googleAuth = googleAuthTabIdentity() const pendingNavigation = request.webContentsId === undefined ? undefined : this.pendingNavigationByGuestId.get(request.webContentsId) // Firefox is delivered per-target and cannot reach workers; keep it clean-only to preserve one // coherent identity per mode instead of pairing a Firefox document with native workers. - const googleAuthEnabled = identity.mode === 'clean' + const googleAuthEnabled = processIdentity.mode === 'clean' if ( googleAuthEnabled && - request.currentUserAgent === firefoxUa && + request.currentUserAgent === googleAuth.userAgent && (!pendingNavigation || isGoogleAuthUrl(pendingNavigation.currentUrl)) ) { - return { userAgent: firefoxUa } + return googleAuth } - const overrideState = + const standingOverride = request.webContentsId === undefined ? undefined - : this.authUserAgentOverrideStateByGuestId.get(request.webContentsId) - const latestPendingOverride = overrideState?.pending.at(-1) - const currentOverride = - latestPendingOverride && - latestPendingOverride.sequence > (overrideState?.confirmed?.sequence ?? -1) - ? latestPendingOverride - : overrideState?.confirmed + : this.standingCdpUserAgentOverride(request.webContentsId) if ( googleAuthEnabled && - !currentOverride && - request.effectiveUserAgent === firefoxUa && + !standingOverride && + request.effectiveUserAgent === googleAuth.userAgent && (!pendingNavigation || isGoogleAuthUrl(pendingNavigation.currentUrl)) ) { - return { userAgent: firefoxUa } + return googleAuth } - if (googleAuthEnabled && currentOverride?.userAgent === firefoxUa) { - return { userAgent: firefoxUa } + if (googleAuthEnabled && standingOverride?.userAgent === googleAuth.userAgent) { + return googleAuth } - const browserPageId = - request.webContentsId === undefined - ? undefined - : this.tabIdByWebContentsId.get(request.webContentsId) // Shared and service worker requests carry no webContentsId, and resolving a session-wide mobile // intent for one put the mobile UA on the wire for a context whose own navigator.userAgent is // desktop-clean — and for every tab sharing the session. One context, one identity: those workers // stay on the session identity, while emulation reaches documents and the emulated tab's dedicated - // workers, which carry the owning webContentsId and so resolve through browserPageId. - const mobile = browserPageId - ? (this.viewportUaOverrideMobileByTabId.get(browserPageId) ?? false) - : false - return buildViewportUserAgentOverride({ + // workers, which carry the owning webContentsId. + // Why the standing override and not the requested preset: the wire must match what the document + // presents, and a preset whose CDP write never landed (no debugger, a failed write) presents none. + return resolveBrowserTabIdentity({ url: request.url, - mobile, - baseUserAgent: identity.userAgent, - googleAuthEnabled + mobile: standingOverride?.userAgentMetadata?.mobile === true, + processIdentity }) } - // Why: navigator.userAgent (read by Google's auth JS) reflects the WebContents UA, - // not the request header, so the Firefox switch in the session request hook - // must be matched here per navigation or the two layers disagree — itself a bot tell. - protected applyGoogleAuthUserAgent( + // Why: gate on the DIRECT page id, not ownerTabId — a popup has no device-metrics override of its + // own, so inheriting the owner tab's preset would pair a mobile UA with a desktop viewport. + protected hasMobileViewportPreset(guestWebContentsId: number): boolean { + const browserPageId = this.tabIdByWebContentsId.get(guestWebContentsId) + const preset = browserPageId ? this.viewportPresetByTabId.get(browserPageId) : undefined + return preset?.guestWebContentsId === guestWebContentsId && preset.override?.mobile === true + } + + /** + * The only writer of the WebContents UA. Chromium cancels a redirect, and reloads a loading + * document, when that UA changes at any other moment; a cross-document did-start-navigation is + * the one point where it lands on the new document alone. Call it synchronously from that event. + */ + protected presentTabIdentityAtNavigationStart( guest: Electron.WebContents, url: string, - options: { duringRedirect?: boolean } = {} - ): void { - const browserPageId = this.tabIdByWebContentsId.get(guest.id) - const identity = getBrowserProcessUserAgentIdentity() - if (identity.mode === 'native') { - if (browserPageId) { - this.reapplyViewportUserAgentOverride(guest, browserPageId, url) - } - return - } - const firefoxUa = googleAuthUserAgent() - const overrideState = this.authUserAgentOverrideStateByGuestId.get(guest.id) - const latestPendingOverride = overrideState?.pending.at(-1) - const confirmedOverride = overrideState?.confirmed - const currentOverride = - latestPendingOverride && latestPendingOverride.sequence > (confirmedOverride?.sequence ?? -1) - ? latestPendingOverride - : confirmedOverride - const currentUa = currentOverride?.userAgent ?? guest.getUserAgent() - const nextUa = isGoogleAuthUrl(url) - ? firefoxUa - : // Only restore when the auth-host override is actually in place, so normal - // navigation never touches the session UA. - currentUa === firefoxUa + sameDocument: boolean + ): Promise { + const identity = this.resolveGuestTabIdentity(guest, url) + // The WebContents UA carries no mobile identity: that needs metadata only CDP can send. + const webContentsUserAgent = + identity.kind === 'google-auth' ? identity.userAgent - : null - let authOverrideIssuedOverCdp = false - if (nextUa !== null && nextUa !== currentUa) { - // Why: WebContents.setUserAgent() during a redirect makes Chromium cancel the in-flight - // navigation (ERR_ABORTED) and replay the original request, which a POST-started OAuth chain - // cannot survive — the sign-in lands on a blank tab. CDP retargets navigator.userAgent without - // touching the navigation, and it outranks the WebContents UA from then on, so a guest that - // switches to it stays on it. The wire UA never depended on this write: - // The session request hook rewrites User-Agent for auth-host URLs on its own. - if (options.duringRedirect === true || overrideState !== undefined) { - if (this.canOverrideUserAgentOverCdp(guest)) { - authOverrideIssuedOverCdp = true - // Why: go through the viewport builder rather than writing nextUa raw, so both CDP writers - // resolve one identity for this URL — Firefox on auth hosts, the profile's clean base off - // them, any mobile preset preserved. Writing the session UA directly would put the - // unlaundered Electron token back on the wire. - void this.applyAuthUserAgentOverrideOverCdp( - guest, - (browserPageId ? this.viewportUaOverrideMobileByTabId.get(browserPageId) : undefined) ?? - false, - url, - nextUa - ) - } - // Why: with no debugger there is no way to retarget the identity without cancelling the - // redirect. A stale navigator.userAgent is recoverable; a dead navigation is not. - } else { - guest.setUserAgent(nextUa) - } + : getBrowserProcessUserAgentIdentity().userAgent + let presentedByWebContents = guest.getUserAgent() + if (!sameDocument && presentedByWebContents !== webContentsUserAgent) { + guest.setUserAgent(webContentsUserAgent) + presentedByWebContents = webContentsUserAgent } - // Why: gate on the DIRECT page id, not ownerTabId — a popup has no device-metrics override of - // its own, so inheriting the owner tab's preset UA would pair a mobile UA with a desktop viewport. - if (browserPageId && !authOverrideIssuedOverCdp) { - this.reapplyViewportUserAgentOverride(guest, browserPageId, url) + return this.writeTabIdentityOverride(guest, identity, presentedByWebContents) + } + + /** Every other identity change (redirects, failed loads, preset changes) goes over CDP only. */ + protected retargetTabIdentity(guest: Electron.WebContents, url: string): Promise { + return this.writeTabIdentityOverride( + guest, + this.resolveGuestTabIdentity(guest, url), + guest.getUserAgent() + ) + } + + private resolveGuestTabIdentity(guest: Electron.WebContents, url: string): BrowserTabIdentity { + return resolveBrowserTabIdentity({ + url, + mobile: this.hasMobileViewportPreset(guest.id), + processIdentity: getBrowserProcessUserAgentIdentity() + }) + } + + // Why clear rather than restate: any override without userAgentMetadata makes Chromium drop + // navigator.userAgentData and every sec-ch-ua header, so it stands only when the WebContents UA + // cannot present the identity itself. + private writeTabIdentityOverride( + guest: Electron.WebContents, + identity: BrowserTabIdentity, + presentedByWebContents: string + ): Promise { + const override: CdpUserAgentOverride = + identity.kind === 'mobile' + ? { userAgent: identity.userAgent, userAgentMetadata: identity.userAgentMetadata } + : presentedByWebContents === identity.userAgent + ? { userAgent: '' } + : // Only reachable before a navigation start can rewrite the WebContents UA (a redirect + // off the auth host, a failed load); the next cross-document navigation clears it. + { userAgent: identity.userAgent } + if (override.userAgent === '' && !this.standingCdpUserAgentOverride(guest.id)) { + return Promise.resolve(true) } + // Why: with no debugger there is no way to retarget the identity without cancelling a redirect. + // A stale navigator.userAgent is recoverable; a dead navigation is not. The wire UA never + // depended on this write: the session request hook rewrites User-Agent on its own. + return this.writeCdpUserAgentOverride(guest, override) + } + + /** The override Chromium holds or is about to hold; undefined when none stands. */ + protected standingCdpUserAgentOverride(guestId: number): CdpUserAgentOverride | undefined { + const state = this.cdpUserAgentOverrideStateByGuestId.get(guestId) + const latestPending = state?.pending.at(-1) + const current = + latestPending && latestPending.sequence > (state?.confirmed?.sequence ?? -1) + ? latestPending + : state?.confirmed + return current && current.override.userAgent !== '' ? current.override : undefined } protected canOverrideUserAgentOverCdp(guest: Electron.WebContents): boolean { @@ -150,39 +157,43 @@ export abstract class BrowserManagerNavigation extends BrowserManagerVisibility } } - protected applyAuthUserAgentOverrideOverCdp( + // Why no queue: debugger.sendCommand dispatches in call order over one channel, so the later-issued + // write wins. The sequence only keeps a failed or superseded write from being recorded as standing. + protected writeCdpUserAgentOverride( guest: Electron.WebContents, - mobile: boolean, - url: string, - userAgent: string + override: CdpUserAgentOverride ): Promise { if (!this.canOverrideUserAgentOverCdp(guest)) { return Promise.resolve(false) } - const state = this.authUserAgentOverrideStateByGuestId.get(guest.id) ?? { + const state = this.cdpUserAgentOverrideStateByGuestId.get(guest.id) ?? { confirmed: null, nextSequence: 0, pending: [] } - const operation = { sequence: ++state.nextSequence, userAgent } + const operation = { sequence: ++state.nextSequence, override } state.pending.push(operation) - this.authUserAgentOverrideStateByGuestId.set(guest.id, state) - return this.sendViewportUserAgentOverride(guest, mobile, url, userAgent).then( - () => this.settleAuthUserAgentOverride(guest.id, state, operation, true), - () => { - this.settleAuthUserAgentOverride(guest.id, state, operation, false) + this.cdpUserAgentOverrideStateByGuestId.set(guest.id, state) + return guest.debugger.sendCommand('Emulation.setUserAgentOverride', override).then( + () => this.settleCdpUserAgentOverride(guest.id, state, operation, true), + (error: unknown) => { + this.settleCdpUserAgentOverride(guest.id, state, operation, false) + console.warn('[browser-manager] failed to write the tab user agent override', { + guestWebContentsId: guest.id, + error: error instanceof Error ? error.message : String(error) + }) return false } ) } - protected settleAuthUserAgentOverride( + protected settleCdpUserAgentOverride( guestId: number, - state: AuthUserAgentOverrideState, - operation: AuthUserAgentOverrideOperation, + state: CdpUserAgentOverrideState, + operation: CdpUserAgentOverrideOperation, succeeded: boolean ): boolean { - if (this.authUserAgentOverrideStateByGuestId.get(guestId) !== state) { + if (this.cdpUserAgentOverrideStateByGuestId.get(guestId) !== state) { return false } if (succeeded && (state.confirmed?.sequence ?? -1) < operation.sequence) { @@ -192,10 +203,13 @@ export abstract class BrowserManagerNavigation extends BrowserManagerVisibility if (pendingIndex !== -1) { state.pending.splice(pendingIndex, 1) } - if (state.confirmed === null && state.pending.length === 0) { - this.authUserAgentOverrideStateByGuestId.delete(guestId) + if ( + (state.confirmed === null || state.confirmed.override.userAgent === '') && + state.pending.length === 0 + ) { + this.cdpUserAgentOverrideStateByGuestId.delete(guestId) } - return true + return succeeded } protected startPendingNavigation(guestId: number, url: string): void { @@ -242,48 +256,6 @@ export abstract class BrowserManagerNavigation extends BrowserManagerVisibility return this.pendingNavigationByGuestId.get(guest.id)?.currentUrl ?? guest.getURL() } - // Why: Emulation.setUserAgentOverride is set once and stands across every later navigation, - // outranking setUserAgent for navigator.userAgent. A viewport preset applied before reaching an - // auth host would otherwise pin navigator.userAgent to the Chrome-shaped preset UA while the - // request header says Firefox — the two-layer disagreement this scope exists to remove. - protected reapplyViewportUserAgentOverride( - guest: Electron.WebContents, - browserTabId: string, - url: string - ): void { - const mobile = this.viewportUaOverrideMobileByTabId.get(browserTabId) - if (mobile === undefined) { - return - } - // Why: no queue needed — debugger.sendCommand dispatches in call order over one channel, so the - // later-issued write wins. What matters is that both writers resolve the SAME host, which they - // now do via the navigation target rather than the stale committed URL. - void this.sendViewportUserAgentOverride(guest, mobile, url).catch(() => {}) - } - - protected async sendViewportUserAgentOverride( - guest: Electron.WebContents, - mobile: boolean, - url?: string, - baseUserAgent?: string - ): Promise { - if (guest.isDestroyed() || !guest.debugger.isAttached()) { - return - } - await guest.debugger.sendCommand( - 'Emulation.setUserAgentOverride', - buildViewportUserAgentOverride({ - url: url ?? this.resolveTabNavigationUrl(guest), - mobile, - // Why: the session UA is the profile's stable base identity. guest.getUserAgent() is not: - // applyGoogleAuthUserAgent leaves it pinned to the Firefox auth UA once a guest switches to - // the CDP override, so reading it back here would republish that identity on ordinary hosts. - baseUserAgent: baseUserAgent ?? getBrowserProcessUserAgentIdentity().userAgent, - googleAuthEnabled: getBrowserProcessUserAgentIdentity().mode === 'clean' - }) - ) - } - /** Route guests own their own popup handler, so their denials arrive here instead. */ reportRouteGuestPopupBlocked(input: { openerWebContentsId: number; url: string }): void { this.forwardOrQueuePopupEvent(input.openerWebContentsId, { diff --git a/src/main/browser/browser-manager-registration.ts b/src/main/browser/browser-manager-registration.ts index 816c0d61cb24..f6f7b41bbb9b 100644 --- a/src/main/browser/browser-manager-registration.ts +++ b/src/main/browser/browser-manager-registration.ts @@ -46,7 +46,7 @@ export abstract class BrowserManagerRegistration extends BrowserManagerGuestPoli const previousWebContentsId = this.webContentsIdByTabId.get(browserTabId) if (previousWebContentsId !== undefined && previousWebContentsId !== webContentsId) { this.retireStaleGuestWebContents(previousWebContentsId) - this.viewportPresetActiveByTabId.delete(browserTabId) + this.viewportPresetByTabId.delete(browserTabId) this.viewportScrollStateByTabId.delete(browserTabId) } this.webContentsIdByTabId.set(browserTabId, webContentsId) @@ -135,8 +135,7 @@ export abstract class BrowserManagerRegistration extends BrowserManagerGuestPoli this.worktreeIdByTabId.delete(browserTabId) // Why: drop the viewport-op chain so the Map doesn't retain a promise keyed to a destroyed guest. this.viewportOpsByTabId.delete(browserTabId) - this.viewportUaOverrideMobileByTabId.delete(browserTabId) - this.viewportPresetActiveByTabId.delete(browserTabId) + this.viewportPresetByTabId.delete(browserTabId) this.viewportScrollStateByTabId.delete(browserTabId) if (wcId !== undefined) { this.pendingNavigationByGuestId.delete(wcId) @@ -171,7 +170,7 @@ export abstract class BrowserManagerRegistration extends BrowserManagerGuestPoli const previousWebContentsId = this.webContentsIdByTabId.get(browserPageId) if (previousWebContentsId !== undefined && previousWebContentsId !== webContentsId) { this.retireStaleGuestWebContents(previousWebContentsId) - this.viewportPresetActiveByTabId.delete(browserPageId) + this.viewportPresetByTabId.delete(browserPageId) this.viewportScrollStateByTabId.delete(browserPageId) } this.webContentsIdByTabId.set(browserPageId, webContentsId) @@ -206,10 +205,9 @@ export abstract class BrowserManagerRegistration extends BrowserManagerGuestPoli this.pageInitiatedTabBudgetByRootGuestId.clear() this.worktreeIdByTabId.clear() this.sessionProfileIdByPageId.clear() - this.viewportUaOverrideMobileByTabId.clear() - this.viewportPresetActiveByTabId.clear() + this.viewportPresetByTabId.clear() this.viewportScrollStateByTabId.clear() - this.authUserAgentOverrideStateByGuestId.clear() + this.cdpUserAgentOverrideStateByGuestId.clear() this.pendingNavigationByGuestId.clear() this.pendingLoadFailuresByGuestId.clear() this.loadErrorsByGuestId.clear() diff --git a/src/main/browser/browser-manager-state.ts b/src/main/browser/browser-manager-state.ts index da7fa256b4e0..da56552d6c41 100644 --- a/src/main/browser/browser-manager-state.ts +++ b/src/main/browser/browser-manager-state.ts @@ -9,7 +9,7 @@ import type { BrowserLoadError } from '../../shared/browser-workspace-types' import { resolveBrowserRouteGuestPopupOpener } from './browser-route-guest-popup-ownership' import type { ActiveDownload, - AuthUserAgentOverrideState, + CdpUserAgentOverrideState, PendingMainFrameNavigation, PendingPermissionEvent, PendingPopupEvent, @@ -125,14 +125,11 @@ export abstract class BrowserManagerState extends BrowserManagerViewportScrollSt protected readonly sessionProfileIdByPageId = new Map() // Why: serialize per-tab setViewportOverride so rapid toggles don't interleave CDP commands and leave emulation in a wrong state. protected readonly viewportOpsByTabId = new Map>() - // Why: presence means the preset requires a CDP UA override (installed or in flight), so navigation - // can re-issue it against the target URL's identity. - protected readonly viewportUaOverrideMobileByTabId = new Map() // Why: the confirmed CDP identity outranks getUserAgent; pending intent keeps rapid navigations // ordered without claiming a failed write was installed. - protected readonly authUserAgentOverrideStateByGuestId = new Map< + protected readonly cdpUserAgentOverrideStateByGuestId = new Map< number, - AuthUserAgentOverrideState + CdpUserAgentOverrideState >() // Why: the in-flight main-frame navigation target, held only until commit or failure — getURL() // still reports the outgoing page until then. See resolveTabNavigationUrl. @@ -191,12 +188,11 @@ export abstract class BrowserManagerState extends BrowserManagerViewportScrollSt this.settingsResolver = resolver } - // Why: a debugger detach clears every CDP override Chromium holds, including the Google auth-host - // UA override, so the confirmed-override record must be dropped or the next auth navigation - // believes the identity is still installed and skips the write. - protected trackDebuggerDetachForAuthUserAgent(guest: Electron.WebContents): () => void { + // Why: a debugger detach clears every CDP override Chromium holds, including the UA override, so + // the confirmed-override record must be dropped or navigation believes an override still stands. + protected trackDebuggerDetachForUserAgentOverride(guest: Electron.WebContents): () => void { const onDetach = (): void => { - this.authUserAgentOverrideStateByGuestId.delete(guest.id) + this.cdpUserAgentOverrideStateByGuestId.delete(guest.id) } try { guest.debugger.on('detach', onDetach) diff --git a/src/main/browser/browser-manager-tab-identity.test.ts b/src/main/browser/browser-manager-tab-identity.test.ts new file mode 100644 index 000000000000..d8678a6e2cd0 --- /dev/null +++ b/src/main/browser/browser-manager-tab-identity.test.ts @@ -0,0 +1,385 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' + +const mocks = vi.hoisted(() => ({ + appGetPathMock: vi.fn(() => '/downloads'), + shellOpenExternalMock: vi.fn(), + browserWindowFromWebContentsMock: vi.fn(), + menuBuildFromTemplateMock: vi.fn(), + guestOffMock: vi.fn(), + guestOnMock: vi.fn(), + guestSetBackgroundThrottlingMock: vi.fn(), + guestSetWindowOpenHandlerMock: vi.fn(), + guestOpenDevToolsMock: vi.fn(), + webContentsFromIdMock: vi.fn(), + screenGetCursorScreenPointMock: vi.fn(() => ({ x: 0, y: 0 })), + openPopupWithOriginBarMock: vi.fn(), + processUserAgentMode: 'clean', + processUserAgent: '' +})) + +vi.mock('electron', () => ({ + app: { getPath: mocks.appGetPathMock }, + BrowserWindow: { fromWebContents: mocks.browserWindowFromWebContentsMock }, + clipboard: { writeText: vi.fn() }, + shell: { openExternal: mocks.shellOpenExternalMock }, + Menu: { buildFromTemplate: mocks.menuBuildFromTemplateMock }, + screen: { getCursorScreenPoint: mocks.screenGetCursorScreenPointMock }, + webContents: { fromId: mocks.webContentsFromIdMock } +})) +vi.mock('./popup-origin-bar-window', () => ({ + openPopupWithOriginBar: mocks.openPopupWithOriginBarMock +})) +vi.mock('./browser-process-user-agent', () => ({ + getBrowserProcessUserAgentIdentity: () => ({ + mode: mocks.processUserAgentMode, + userAgent: mocks.processUserAgent + }) +})) + +import { browserManager } from './browser-manager' +import { googleAuthUserAgent } from './browser-google-auth-ua' +import { resetBrowserManagerMocks, resetBrowserManagerState } from './browser-manager-test-harness' +import { + createViewportGuestFactory, + flushViewportOps, + GUEST_CLEAN_UA, + GUEST_ELECTRON_UA, + type ViewportGuestHandle +} from './browser-manager-viewport-test-fixtures' + +const makeGuest = createViewportGuestFactory(mocks) +const guests = new Map>() +const PRESETS = { + none: null, + desktop: { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false }, + mobile: { width: 375, height: 667, deviceScaleFactor: 2, mobile: true } +} as const +type Preset = keyof typeof PRESETS +const MODES = [ + ['clean', GUEST_CLEAN_UA], + ['native', GUEST_ELECTRON_UA] +] as const +const ORDINARY_URL = 'https://example.com/' +const AUTH_URL = 'https://accounts.google.com/v3/signin/identifier' +const APP_TOKENS = /Electron\/|orca\//i +let nextGuestId = 7000 + +type Observed = { + presented: string + standingOverride: Record | null + requestIdentity: ReturnType +} + +/** Opens a tab on `url` the way a real load does: did-start-navigation runs before any preset. */ +function openTab(url: string): { tab: string; id: number; handle: ViewportGuestHandle } { + const id = nextGuestId++ + const tab = `tab-${id}` + const handle = makeGuest(id, url) + guests.set(id, handle.guest) + expect(browserManager.registerOffscreenGuest({ browserPageId: tab, webContentsId: id })).toBe( + true + ) + navigate(url) + return { tab, id, handle } +} + +function navigate(url: string, { inPlace = false } = {}): void { + const didStartNavigation = mocks.guestOnMock.mock.calls.findLast( + ([event]) => event === 'did-start-navigation' + )?.[1] + expect(didStartNavigation).toBeTypeOf('function') + didStartNavigation(null, url, inPlace, true) +} + +function redirectTo(url: string): void { + const willRedirect = mocks.guestOnMock.mock.calls.findLast( + ([event]) => event === 'will-redirect' + )?.[1] + willRedirect({ preventDefault: vi.fn() }, url, false, true) +} + +// A redirect target that fails: the one failed-load path whose restore could otherwise write the UA. +function failLoad(url: string): void { + redirectTo(url) + const didFailLoad = mocks.guestOnMock.mock.calls.findLast( + ([event]) => event === 'did-fail-load' + )?.[1] + didFailLoad(null, -102, 'ERR_CONNECTION_REFUSED', url, true) +} + +async function observe( + { id, handle }: { id: number; handle: ViewportGuestHandle }, + url: string +): Promise { + await flushViewportOps() + return { + presented: handle.presentedUserAgent(), + standingOverride: handle.standingUserAgentOverride(), + requestIdentity: browserManager.resolveBrowserGuestRequestUserAgent({ + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the resolver reads no Session member. + session: handle.guest.session as Electron.Session, + url, + webContentsId: id + }) + } +} + +async function presentWith(url: string, preset: Preset): Promise { + const opened = openTab(url) + const override = PRESETS[preset] + if (override) { + await browserManager.setViewportOverride(opened.tab, override) + } + return observe(opened, url) +} + +// Why: Chromium drops navigator.userAgentData and every sec-ch-ua header for a UA override that +// carries no userAgentMetadata, so only Firefox (which sends no hints) may stand without it. +function expectClientHintsKept(observed: Observed): void { + const override = observed.standingOverride + if (override && override.userAgent !== googleAuthUserAgent()) { + expect(override.userAgentMetadata).toBeDefined() + } +} + +describe('tab identity ownership', () => { + beforeEach(() => { + expect(process.env.ORCA_BACKGROUND_LAUNCH).toBe('1') + resetBrowserManagerMocks(mocks) + resetBrowserManagerState() + guests.clear() + mocks.webContentsFromIdMock.mockImplementation((id) => guests.get(id)) + }) + afterEach(() => { + browserManager.unregisterAll() + vi.restoreAllMocks() + }) + + describe.each(MODES)('in %s mode', (mode, processUserAgent) => { + beforeEach(() => { + mocks.processUserAgentMode = mode + mocks.processUserAgent = processUserAgent + }) + + it.each([ORDINARY_URL, AUTH_URL])( + 'presents the same identity with a desktop preset as with none on %s', + async (url) => { + const none = await presentWith(url, 'none') + const desktop = await presentWith(url, 'desktop') + expect(desktop).toEqual(none) + expectClientHintsKept(desktop) + const expected = + mode === 'clean' && url === AUTH_URL ? googleAuthUserAgent() : processUserAgent + expect(desktop.presented).toBe(expected) + expect(desktop.requestIdentity.userAgent).toBe(expected) + expect(desktop.requestIdentity.kind).toBe( + expected === processUserAgent ? 'process' : 'google-auth' + ) + } + ) + + it('presents the mobile identity with matching client hints on an ordinary host', async () => { + const observed = await presentWith(ORDINARY_URL, 'mobile') + expect(observed.presented).toContain('iPhone') + expect(observed.standingOverride).toMatchObject({ + userAgentMetadata: expect.objectContaining({ mobile: true, platform: 'iOS' }) + }) + expect(observed.requestIdentity.kind).toBe('mobile') + expect(observed.requestIdentity.userAgent).toBe(observed.presented) + }) + + it('keeps the Google sign-in identity ahead of a mobile preset only in clean mode', async () => { + const observed = await presentWith(AUTH_URL, 'mobile') + expectClientHintsKept(observed) + if (mode === 'clean') { + expect(observed.presented).toBe(googleAuthUserAgent()) + expect(observed.requestIdentity.kind).toBe('google-auth') + } else { + expect(observed.presented).toContain('iPhone') + expect(observed.requestIdentity.kind).toBe('mobile') + } + }) + + it.each(['desktop', 'none'] as const)( + 'restores the process identity when switching from mobile to %s', + async (next) => { + const opened = openTab(ORDINARY_URL) + await browserManager.setViewportOverride(opened.tab, PRESETS.mobile) + expect(opened.handle.presentedUserAgent()).toContain('iPhone') + + await browserManager.setViewportOverride(opened.tab, PRESETS[next]) + const observed = await observe(opened, ORDINARY_URL) + expect(observed.presented).toBe(processUserAgent) + expect(observed.standingOverride).toBeNull() + expect(observed.requestIdentity).toEqual({ kind: 'process', userAgent: processUserAgent }) + } + ) + }) + + it('never puts the Electron or app tokens on a clean-mode tab under any preset', async () => { + mocks.processUserAgentMode = 'clean' + mocks.processUserAgent = GUEST_CLEAN_UA + for (const url of [ORDINARY_URL, AUTH_URL]) { + for (const preset of ['none', 'desktop', 'mobile'] as const) { + const observed = await presentWith(url, preset) + expect(observed.presented).not.toMatch(APP_TOKENS) + expect(observed.requestIdentity.userAgent).not.toMatch(APP_TOKENS) + } + } + }) + + // Why: Chromium rejects touch emulation with maxTouchPoints 0, so every step after it used to be + // skipped and the mobile UA outlived its preset. Identity is no longer a step after touch. + it('restores the process identity and reports the failure when touch emulation is rejected', async () => { + mocks.processUserAgentMode = 'clean' + mocks.processUserAgent = GUEST_CLEAN_UA + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const opened = openTab(ORDINARY_URL) + await browserManager.setViewportOverride(opened.tab, PRESETS.mobile) + // Rejects whatever the payload, so the test outlives a fix to the payload itself. + opened.handle.debuggerSendCommand.mockImplementation((method: string) => + method === 'Emulation.setTouchEmulationEnabled' + ? Promise.reject(new Error('Touch points must be between 1 and 16')) + : Promise.resolve(undefined) + ) + + await expect(browserManager.setViewportOverride(opened.tab, PRESETS.desktop)).resolves.toBe( + false + ) + const observed = await observe(opened, ORDINARY_URL) + expect(observed.presented).toBe(GUEST_CLEAN_UA) + expect(observed.standingOverride).toBeNull() + expect(warn).toHaveBeenCalledWith( + '[browser-manager] setViewportOverride: touch emulation failed', + expect.objectContaining({ error: 'Touch points must be between 1 and 16' }) + ) + }) + + it('still presents the requested mobile identity when device metrics fail', async () => { + mocks.processUserAgentMode = 'clean' + mocks.processUserAgent = GUEST_CLEAN_UA + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const opened = openTab(ORDINARY_URL) + opened.handle.debuggerSendCommand.mockImplementation((method: string) => + method === 'Emulation.setDeviceMetricsOverride' + ? Promise.reject(new Error('metrics failed')) + : Promise.resolve(undefined) + ) + + await expect(browserManager.setViewportOverride(opened.tab, PRESETS.mobile)).resolves.toBe( + false + ) + expect((await observe(opened, ORDINARY_URL)).presented).toContain('iPhone') + }) + + it('heals a mid-redirect process override on the next navigation', async () => { + mocks.processUserAgentMode = 'clean' + mocks.processUserAgent = GUEST_CLEAN_UA + const opened = openTab(AUTH_URL) + await browserManager.setViewportOverride(opened.tab, PRESETS.desktop) + const willRedirect = mocks.guestOnMock.mock.calls.findLast( + ([event]) => event === 'will-redirect' + )?.[1] + willRedirect({ preventDefault: vi.fn() }, ORDINARY_URL, false, true) + // The WebContents UA still says Firefox, so clearing here would expose it on an ordinary host. + expect((await observe(opened, ORDINARY_URL)).presented).toBe(GUEST_CLEAN_UA) + + navigate('https://example.org/') + const healed = await observe(opened, 'https://example.org/') + expect(healed.presented).toBe(GUEST_CLEAN_UA) + expect(healed.standingOverride).toBeNull() + }) + + // Why a table over every entry point: Chromium cancels a redirect, and reloads a loading document, + // when the WebContents UA changes anywhere but a cross-document navigation start. + it.each([ + ['a redirect', () => redirectTo(ORDINARY_URL)], + ['a failed load', () => failLoad(ORDINARY_URL)], + ['a desktop preset', (tab: string) => browserManager.setViewportOverride(tab, PRESETS.desktop)], + ['a mobile preset', (tab: string) => browserManager.setViewportOverride(tab, PRESETS.mobile)], + ['clearing a preset', (tab: string) => browserManager.setViewportOverride(tab, null)], + ['a same-document navigation', () => navigate(`${AUTH_URL}#step`, { inPlace: true })] + ])( + 'writes the WebContents UA only at a cross-document navigation start, not on %s', + async (_label, act) => { + mocks.processUserAgentMode = 'clean' + mocks.processUserAgent = GUEST_CLEAN_UA + const opened = openTab(AUTH_URL) + expect(opened.handle.guest.setUserAgent).toHaveBeenCalledOnce() + + await act(opened.tab) + await flushViewportOps() + expect(opened.handle.guest.setUserAgent).toHaveBeenCalledOnce() + + navigate('https://example.org/') + // Synchronous: the write must land inside did-start-navigation, before any await. + expect(opened.handle.guest.setUserAgent).toHaveBeenCalledTimes(2) + expect(opened.handle.webContentsUserAgent()).toBe(GUEST_CLEAN_UA) + } + ) + + // Why: setUserAgent() while a document loads makes Chromium reload it, and an OAuth callback that + // strips its code with replaceState would be requested twice — the one-time code replayed. + it('leaves the WebContents UA alone on a same-document navigation', async () => { + mocks.processUserAgentMode = 'clean' + mocks.processUserAgent = GUEST_CLEAN_UA + const opened = openTab(AUTH_URL) + const willRedirect = mocks.guestOnMock.mock.calls.findLast( + ([event]) => event === 'will-redirect' + )?.[1] + willRedirect({ preventDefault: vi.fn() }, `${ORDINARY_URL}callback?code=1`, false, true) + await flushViewportOps() + + navigate(`${ORDINARY_URL}callback`, { inPlace: true }) + expect(opened.handle.webContentsUserAgent()).toBe(googleAuthUserAgent()) + expect((await observe(opened, ORDINARY_URL)).presented).toBe(GUEST_CLEAN_UA) + + navigate('https://example.org/') + expect(opened.handle.webContentsUserAgent()).toBe(GUEST_CLEAN_UA) + }) + + // Why: a failed navigation commits an error page that is still loading at did-fail-load, and + // setUserAgent() then makes Chromium reload it — the failed request replayed. + it('leaves the WebContents UA alone when a redirected navigation fails', async () => { + mocks.processUserAgentMode = 'clean' + mocks.processUserAgent = GUEST_CLEAN_UA + const opened = openTab(ORDINARY_URL) + navigate(`${ORDINARY_URL}start`) + const willRedirect = mocks.guestOnMock.mock.calls.findLast( + ([event]) => event === 'will-redirect' + )?.[1] + willRedirect({ preventDefault: vi.fn() }, AUTH_URL, false, true) + await flushViewportOps() + + opened.handle.commitNavigationTo(AUTH_URL) + const didFailLoad = mocks.guestOnMock.mock.calls.findLast( + ([event]) => event === 'did-fail-load' + )?.[1] + didFailLoad(null, -102, 'ERR_CONNECTION_REFUSED', AUTH_URL, true) + expect(opened.handle.webContentsUserAgent()).toBe(GUEST_CLEAN_UA) + const observed = await observe(opened, AUTH_URL) + expect(observed.presented).toBe(googleAuthUserAgent()) + expect(observed.requestIdentity.kind).toBe('google-auth') + }) + + // Why: a debugger that cannot attach (DevTools open on the guest) installs no mobile identity, so + // requests claiming one would disagree with the document's own navigator.userAgent. + it('keeps requests on the presented identity when a mobile preset cannot attach', async () => { + mocks.processUserAgentMode = 'clean' + mocks.processUserAgent = GUEST_CLEAN_UA + vi.spyOn(console, 'warn').mockImplementation(() => {}) + const opened = openTab(ORDINARY_URL) + opened.handle.debuggerIsAttached.mockReturnValue(false) + opened.handle.debuggerAttach.mockImplementation(() => { + throw new Error('Another debugger is already attached') + }) + + await expect(browserManager.setViewportOverride(opened.tab, PRESETS.mobile)).resolves.toBe( + false + ) + navigate('https://example.org/') + const observed = await observe(opened, 'https://example.org/') + expect(observed.presented).toBe(GUEST_CLEAN_UA) + expect(observed.requestIdentity).toEqual({ kind: 'process', userAgent: GUEST_CLEAN_UA }) + }) +}) diff --git a/src/main/browser/browser-manager-types.ts b/src/main/browser/browser-manager-types.ts index 3d3825d6ebe5..302cf6468ed7 100644 --- a/src/main/browser/browser-manager-types.ts +++ b/src/main/browser/browser-manager-types.ts @@ -1,4 +1,5 @@ import { normalizeExternalBrowserUrl } from '../../shared/browser-url' +import type { UserAgentMetadata } from './browser-tab-identity' import type { BrowserDownloadFinishedEvent, BrowserDownloadProgressEvent, @@ -60,15 +61,21 @@ export type PendingMainFrameNavigation = { supersededUrls: string[] } -export type AuthUserAgentOverrideOperation = { - sequence: number +/** An Emulation.setUserAgentOverride payload; an empty userAgent clears the override. */ +export type CdpUserAgentOverride = { userAgent: string + userAgentMetadata?: UserAgentMetadata +} + +export type CdpUserAgentOverrideOperation = { + sequence: number + override: CdpUserAgentOverride } -export type AuthUserAgentOverrideState = { - confirmed: AuthUserAgentOverrideOperation | null +export type CdpUserAgentOverrideState = { + confirmed: CdpUserAgentOverrideOperation | null nextSequence: number - pending: AuthUserAgentOverrideOperation[] + pending: CdpUserAgentOverrideOperation[] } export const SAFE_POPUP_WINDOW_OPTIONS = { diff --git a/src/main/browser/browser-manager-viewport-override.test.ts b/src/main/browser/browser-manager-viewport-override.test.ts index 41835a6cd3ea..a8a4f3bacd4e 100644 --- a/src/main/browser/browser-manager-viewport-override.test.ts +++ b/src/main/browser/browser-manager-viewport-override.test.ts @@ -156,7 +156,8 @@ describe('browserManager', () => { if (mobile) { expect(userAgentOverride).toMatchObject({ userAgent: expect.stringContaining('iPhone') }) } else { - expect(userAgentOverride).toEqual({ userAgent: GUEST_ELECTRON_UA }) + // A desktop preset presents the process identity itself, so there is nothing to override. + expect(userAgentOverride).toBeUndefined() } } ) @@ -193,8 +194,8 @@ describe('browserManager', () => { } ) - it('re-issues the standing UA override when navigating onto and back off an auth host', async () => { - const { guest, debuggerSendCommand } = makeGuest(4247) + it('keeps a desktop-preset tab on the right identity onto and back off an auth host', async () => { + const { guest, debuggerSendCommand, presentedUserAgent } = makeGuest(4247) webContentsFromIdMock.mockReturnValue(guest) browserManager.attachGuestPolicies(guest as never) browserManager.registerGuest({ @@ -214,30 +215,25 @@ describe('browserManager', () => { isMainFrame: boolean ) => void - // Case A: the desktop preset lands first, while the tab is still off the auth host. + // The desktop preset lands first, while the tab is still off the auth host. await browserManager.setViewportOverride('tab-auth-nav', { width: 1024, height: 768, deviceScaleFactor: 1, mobile: false }) - expect(debuggerSendCommand).toHaveBeenLastCalledWith('Emulation.setUserAgentOverride', { - userAgent: GUEST_CLEAN_UA - }) + expect(lastUserAgentOverride(debuggerSendCommand)).toBeUndefined() + expect(presentedUserAgent()).toBe(GUEST_CLEAN_UA) - // Navigating to the auth host must move the standing override to the Firefox identity. - debuggerSendCommand.mockClear() didStartNavigation(null, 'https://accounts.google.com/v3/signin/identifier', false, true) await flushViewportOps() - expect(debuggerSendCommand).toHaveBeenCalledWith('Emulation.setUserAgentOverride', { - userAgent: googleAuthUserAgent() - }) + expect(presentedUserAgent()).toBe(googleAuthUserAgent()) - // Leaving the auth host restores the clean Chrome-shaped preset UA. - debuggerSendCommand.mockClear() + // A redirect cannot rewrite the Firefox WebContents UA, so the override carries the process UA. willRedirect({ preventDefault: vi.fn() }, 'https://example.com/', false, true) await flushViewportOps() - expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ userAgent: GUEST_CLEAN_UA }) + expect(guest.setUserAgent).toHaveBeenCalledTimes(1) + expect(presentedUserAgent()).toBe(GUEST_CLEAN_UA) }) // Why: not an ordering race — debugger.sendCommand dispatches in call order over one channel, so @@ -255,12 +251,13 @@ describe('browserManager', () => { return calls.at(-1)?.[1] as Record | undefined } - // Why mobile: on the desktop branch the break is masked by coincidence — applyGoogleAuthUserAgent - // has already switched the WebContents UA to Firefox, and cleanElectronUserAgent passes a Firefox - // UA through untouched, so the stale-URL desktop path happens to emit Firefox anyway. The mobile - // branch derives a Chrome-shaped iPhone UA from that same base and exposes the real defect. + // Why mobile: a desktop preset installs no override at all, so only the mobile write can leave a + // Chrome-shaped UA standing on the auth host. it('does not leave the Chrome preset UA standing when a mobile preset lands mid-navigation onto an auth host', async () => { - const { guest, debuggerSendCommand } = makeGuest(4251, 'https://example.com/') + const { guest, debuggerSendCommand, presentedUserAgent } = makeGuest( + 4251, + 'https://example.com/' + ) // Hold the preset's first CDP command open so the navigation lands inside its await window. let releaseMetrics = (): void => {} const metricsGate = new Promise((resolve) => { @@ -294,13 +291,18 @@ describe('browserManager', () => { // Without a shared chain + shared URL source, the preset resumes, reads getURL() as the // pre-navigation host, and pins the tab to the Chrome-shaped UA while it is on the auth host. - expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ - userAgent: googleAuthUserAgent() - }) + expect(presentedUserAgent()).toBe(googleAuthUserAgent()) + expect(debuggerSendCommand).not.toHaveBeenCalledWith( + 'Emulation.setUserAgentOverride', + expect.objectContaining({ userAgent: expect.stringContaining('iPhone') }) + ) }) it('does not leave the Firefox UA standing when a preset lands mid-navigation off an auth host', async () => { - const { guest, debuggerSendCommand } = makeGuest(4252, 'https://accounts.google.com/') + const { guest, debuggerSendCommand, presentedUserAgent } = makeGuest( + 4252, + 'https://accounts.google.com/' + ) webContentsFromIdMock.mockReturnValue(guest) browserManager.attachGuestPolicies(guest as never) browserManager.registerGuest({ @@ -347,11 +349,12 @@ describe('browserManager', () => { // Without the fix the resuming preset re-reads getURL() as the auth host and clobbers the // navigation's correct write, stranding the Firefox UA on a non-auth page. - expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ userAgent: GUEST_CLEAN_UA }) + expect(presentedUserAgent()).toBe(GUEST_CLEAN_UA) + expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ userAgent: '' }) }) it('falls back to the committed URL once a navigation commits or fails', async () => { - const { guest, debuggerSendCommand, commitNavigationTo } = makeGuest( + const { guest, debuggerSendCommand, commitNavigationTo, presentedUserAgent } = makeGuest( 4253, 'https://example.com/' ) @@ -392,8 +395,9 @@ describe('browserManager', () => { didFailLoad(null, -3, 'Aborted', 'https://accounts.google.com/', true) await flushViewportOps() - expect(guest.setUserAgent).toHaveBeenLastCalledWith(GUEST_CLEAN_UA) - expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ userAgent: GUEST_CLEAN_UA }) + // The restore goes over CDP: only did-start-navigation wrote the WebContents UA. + expect(guest.setUserAgent).toHaveBeenCalledOnce() + expect(presentedUserAgent()).toBe(GUEST_CLEAN_UA) // A later preset must also resolve the committed, non-auth URL. debuggerSendCommand.mockClear() @@ -407,7 +411,6 @@ describe('browserManager', () => { didNavigate(null, 'https://accounts.google.com/signin') await flushViewportOps() - debuggerSendCommand.mockClear() await browserManager.setViewportOverride('tab-pending-cleared', { width: 1024, height: 768, @@ -415,13 +418,14 @@ describe('browserManager', () => { mobile: false }) await flushViewportOps() - expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ - userAgent: googleAuthUserAgent() - }) + expect(presentedUserAgent()).toBe(googleAuthUserAgent()) }) it('does not let a superseded navigation failure revert a newer target', async () => { - const { guest, debuggerSendCommand } = makeGuest(4255, 'https://example.com/') + const { guest, debuggerSendCommand, presentedUserAgent } = makeGuest( + 4255, + 'https://example.com/' + ) webContentsFromIdMock.mockReturnValue(guest) browserManager.attachGuestPolicies(guest as never) browserManager.registerGuest({ @@ -460,20 +464,19 @@ describe('browserManager', () => { willRedirect({ preventDefault: vi.fn() }, 'https://accounts.google.com/same', false, true) didStartNavigation(null, 'https://accounts.google.com/same', false, true) await flushViewportOps() - expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ - userAgent: googleAuthUserAgent() - }) + expect(presentedUserAgent()).toBe(googleAuthUserAgent()) debuggerSendCommand.mockClear() didFailLoad(null, -3, 'Aborted', 'https://accounts.google.com/same', true) await flushViewportOps() - // Why: the redirect path never writes the WebContents UA — that write cancels the navigation. - expect(guest.setUserAgent).not.toHaveBeenCalled() + // Only the direct navigation onto the auth host wrote the WebContents UA. + expect(guest.setUserAgent).toHaveBeenCalledOnce() expect(debuggerSendCommand).not.toHaveBeenCalledWith( 'Emulation.setUserAgentOverride', - expect.objectContaining({ userAgent: GUEST_CLEAN_UA }) + expect.anything() ) + expect(presentedUserAgent()).toBe(googleAuthUserAgent()) }) it('switches identity for a server redirect and restores it if the redirect fails', async () => { @@ -529,10 +532,11 @@ describe('browserManager', () => { userAgent: googleAuthUserAgent() }) + // The WebContents UA never left the process identity, so restoring it clears the override. didFailLoad(null, -3, 'Aborted', 'https://accounts.google.com/redirected', true) await flushViewportOps() expect(guest.setUserAgent).not.toHaveBeenCalled() - expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ userAgent: GUEST_CLEAN_UA }) + expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ userAgent: '' }) }) it('preserves the auth identity when a viewport preset is cleared after a redirect', async () => { @@ -584,7 +588,11 @@ describe('browserManager', () => { }) await browserManager.setViewportOverride('tab-mobile-popup-owner', MOBILE_VIEWPORT_OVERRIDE) - const { guest: popupGuest, debuggerSendCommand } = makeGuest(4264, 'https://mail.google.com/') + const { + guest: popupGuest, + debuggerSendCommand, + presentedUserAgent + } = makeGuest(4264, 'https://mail.google.com/') const popupOn = vi.fn() popupGuest.on = popupOn browserManager.attachGuestPolicies(popupGuest as never, { @@ -607,11 +615,18 @@ describe('browserManager', () => { didStartNavigation(null, 'https://example.com/', false, true) await flushViewportOps() - expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ userAgent: GUEST_CLEAN_UA }) + expect(presentedUserAgent()).toBe(GUEST_CLEAN_UA) + expect(debuggerSendCommand).not.toHaveBeenCalledWith( + 'Emulation.setUserAgentOverride', + expect.objectContaining({ userAgent: expect.stringContaining('iPhone') }) + ) }) it('reapplies a preset when navigation starts during its final UA write', async () => { - const { guest, debuggerSendCommand } = makeGuest(4257, 'https://example.com/') + const { guest, debuggerSendCommand, presentedUserAgent } = makeGuest( + 4257, + 'https://example.com/' + ) let releaseFirstUa = (): void => {} const firstUaGate = new Promise((resolve) => { releaseFirstUa = resolve @@ -634,25 +649,26 @@ describe('browserManager', () => { ([event]) => event === 'did-start-navigation' )?.[1] as (event: unknown, url: string, isInPlace: boolean, isMainFrame: boolean) => void - const presetDone = browserManager.setViewportOverride('tab-final-apply-race', { - width: 1024, - height: 768, - deviceScaleFactor: 1, - mobile: false - }) + const presetDone = browserManager.setViewportOverride( + 'tab-final-apply-race', + MOBILE_VIEWPORT_OVERRIDE + ) await flushViewportOps() didStartNavigation(null, 'https://accounts.google.com/', false, true) await flushViewportOps() - expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ - userAgent: googleAuthUserAgent() - }) + // The navigation's write is issued after the held mobile write, so it wins however they settle. releaseFirstUa() await presetDone + await flushViewportOps() + expect(presentedUserAgent()).toBe(googleAuthUserAgent()) }) it('does not reinstall a preset while its final UA clear is in flight', async () => { - const { guest, debuggerSendCommand } = makeGuest(4258, 'https://example.com/') + const { guest, debuggerSendCommand, presentedUserAgent } = makeGuest( + 4258, + 'https://example.com/' + ) webContentsFromIdMock.mockReturnValue(guest) browserManager.attachGuestPolicies(guest as never) browserManager.registerGuest({ @@ -664,12 +680,7 @@ describe('browserManager', () => { ([event]) => event === 'did-start-navigation' )?.[1] as (event: unknown, url: string, isInPlace: boolean, isMainFrame: boolean) => void - await browserManager.setViewportOverride('tab-final-clear-race', { - width: 1024, - height: 768, - deviceScaleFactor: 1, - mobile: false - }) + await browserManager.setViewportOverride('tab-final-clear-race', MOBILE_VIEWPORT_OVERRIDE) let releaseClearUa = (): void => {} const clearUaGate = new Promise((resolve) => { releaseClearUa = resolve @@ -686,19 +697,25 @@ describe('browserManager', () => { debuggerSendCommand.mockClear() didStartNavigation(null, 'https://accounts.google.com/', false, true) await flushViewportOps() - expect(debuggerSendCommand).not.toHaveBeenCalledWith('Emulation.setUserAgentOverride', { - userAgent: googleAuthUserAgent() - }) + expect(debuggerSendCommand).not.toHaveBeenCalledWith( + 'Emulation.setUserAgentOverride', + expect.objectContaining({ userAgent: expect.stringContaining('iPhone') }) + ) releaseClearUa() await clearDone + await flushViewportOps() + expect(presentedUserAgent()).toBe(googleAuthUserAgent()) }) // Why: a failed clear leaves the CDP override standing on the target. Dropping the tracking entry // first makes it untracked, so the navigation path can never correct it again and the tab carries // a Chrome-shaped navigator.userAgent onto the auth hosts — the exact failure this PR prevents. it('keeps tracking the standing override when the CDP clear fails', async () => { - const { guest, debuggerSendCommand } = makeGuest(4254, 'https://example.com/') + const { guest, debuggerSendCommand, presentedUserAgent } = makeGuest( + 4254, + 'https://example.com/' + ) webContentsFromIdMock.mockReturnValue(guest) browserManager.attachGuestPolicies(guest as never) browserManager.registerGuest({ @@ -710,15 +727,10 @@ describe('browserManager', () => { ([event]) => event === 'did-start-navigation' )?.[1] as (event: unknown, url: string, isInPlace: boolean, isMainFrame: boolean) => void - await browserManager.setViewportOverride('tab-failed-clear', { - width: 1024, - height: 768, - deviceScaleFactor: 1, - mobile: false - }) + await browserManager.setViewportOverride('tab-failed-clear', MOBILE_VIEWPORT_OVERRIDE) await flushViewportOps() - // The final UA clear fails after tracking was optimistically removed. + // The final UA clear fails, leaving the mobile override standing. debuggerSendCommand.mockImplementation( (method: string, params: { userAgent?: string } | undefined) => method === 'Emulation.setUserAgentOverride' && params?.userAgent === '' @@ -736,8 +748,9 @@ describe('browserManager', () => { didStartNavigation(null, 'https://accounts.google.com/v3/signin/identifier', false, true) await flushViewportOps() expect(debuggerSendCommand).toHaveBeenCalledWith('Emulation.setUserAgentOverride', { - userAgent: googleAuthUserAgent() + userAgent: '' }) + expect(presentedUserAgent()).toBe(googleAuthUserAgent()) }) it('does not touch the UA override on navigation when no preset is standing', async () => { @@ -774,12 +787,7 @@ describe('browserManager', () => { ([event]) => event === 'did-start-navigation' )?.[1] as (event: unknown, url: string, isInPlace: boolean, isMainFrame: boolean) => void - await browserManager.setViewportOverride('tab-cleared-preset', { - width: 1024, - height: 768, - deviceScaleFactor: 1, - mobile: false - }) + await browserManager.setViewportOverride('tab-cleared-preset', MOBILE_VIEWPORT_OVERRIDE) await browserManager.setViewportOverride('tab-cleared-preset', null) debuggerSendCommand.mockClear() @@ -791,7 +799,7 @@ describe('browserManager', () => { ) }) - it('reapplies the native process identity instead of the Google exception', async () => { + it('keeps a native-mode mobile preset off the Google exception on navigation', async () => { browserMocks.processUserAgentMode = 'native' browserMocks.processUserAgent = GUEST_ELECTRON_UA const { guest, debuggerSendCommand } = makeGuest(4250) @@ -807,17 +815,13 @@ describe('browserManager', () => { ([event]) => event === 'did-start-navigation' )?.[1] as (event: unknown, url: string, isInPlace: boolean, isMainFrame: boolean) => void - await browserManager.setViewportOverride('tab-native-nav', { - width: 1024, - height: 768, - deviceScaleFactor: 1, - mobile: false - }) + await browserManager.setViewportOverride('tab-native-nav', MOBILE_VIEWPORT_OVERRIDE) debuggerSendCommand.mockClear() didStartNavigation(null, 'https://accounts.google.com/', false, true) await flushViewportOps() - expect(debuggerSendCommand).toHaveBeenCalledWith('Emulation.setUserAgentOverride', { - userAgent: GUEST_ELECTRON_UA + expect(guest.setUserAgent).not.toHaveBeenCalled() + expect(lastUserAgentOverride(debuggerSendCommand)).toMatchObject({ + userAgent: expect.stringContaining('iPhone') }) }) @@ -839,9 +843,26 @@ describe('browserManager', () => { enabled: false, maxTouchPoints: 0 }) - expect(debuggerSendCommand).toHaveBeenCalledWith('Emulation.setUserAgentOverride', { - userAgent: '' + // Nothing overrode the identity, so there is nothing to clear. + expect(lastUserAgentOverride(debuggerSendCommand)).toBeUndefined() + }) + + it('clears the mobile identity for override=null', async () => { + const { guest, debuggerSendCommand, presentedUserAgent } = makeGuest(4344) + webContentsFromIdMock.mockReturnValue(guest) + browserManager.attachGuestPolicies(guest as never) + browserManager.registerGuest({ + browserPageId: 'tab-clear-mobile', + webContentsId: guest.id as number, + rendererWebContentsId }) + + await browserManager.setViewportOverride('tab-clear-mobile', MOBILE_VIEWPORT_OVERRIDE) + await expect(browserManager.setViewportOverride('tab-clear-mobile', null)).resolves.toBe(true) + await flushViewportOps() + + expect(lastUserAgentOverride(debuggerSendCommand)).toEqual({ userAgent: '' }) + expect(presentedUserAgent()).toBe(GUEST_CLEAN_UA) }) it('attaches the debugger if not already attached and does not detach after', async () => { diff --git a/src/main/browser/browser-manager-viewport-ownership.test.ts b/src/main/browser/browser-manager-viewport-ownership.test.ts index 8b4492f36fd5..db2d0b9a38f4 100644 --- a/src/main/browser/browser-manager-viewport-ownership.test.ts +++ b/src/main/browser/browser-manager-viewport-ownership.test.ts @@ -50,16 +50,16 @@ const mobile = { width: 375, height: 667, deviceScaleFactor: 2, mobile: true } const desktop = { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false } const guests = new Map>() const registeredGuests = readViewportStateMap('webContentsIdByTabId') -const uaIntents = readViewportStateMap('viewportUaOverrideMobileByTabId') -const presetIntents = readViewportStateMap('viewportPresetActiveByTabId') +const presetIntents = readViewportStateMap('viewportPresetByTabId') const pendingOperations = readViewportStateMap('viewportOpsByTabId') +const cdpUserAgentOverrides = readViewportStateMap('cdpUserAgentOverrideStateByGuestId') function readViewportStateMap( name: | 'webContentsIdByTabId' - | 'viewportUaOverrideMobileByTabId' - | 'viewportPresetActiveByTabId' + | 'viewportPresetByTabId' | 'viewportOpsByTabId' + | 'cdpUserAgentOverrideStateByGuestId' ): Map { const value: unknown = browserManager[name] if (!(value instanceof Map)) { @@ -116,7 +116,7 @@ describe('browser viewport operation ownership', () => { const result = browserManager.setViewportOverride('closed', mobile) await gate.entered browserManager.unregisterGuest('closed') - expect(uaIntents.size).toBe(0) + expect(presetIntents.size).toBe(0) const isDestroyed = handle.guest.isDestroyed expect(vi.isMockFunction(isDestroyed)).toBe(true) if (vi.isMockFunction(isDestroyed)) { @@ -126,7 +126,7 @@ describe('browser viewport operation ownership', () => { await expect(result).resolves.toBe(false) expect(registeredGuests.size).toBe(0) expect(presetIntents.size).toBe(0) - expect(uaIntents.get('closed')).toBeUndefined() + expect(cdpUserAgentOverrides.size).toBe(0) }) it('does not restore closed-tab UA intent after a failed clear', async () => { @@ -143,7 +143,8 @@ describe('browser viewport operation ownership', () => { } gate.reject(new Error('Target closed')) await expect(result).resolves.toBe(false) - expect(uaIntents.get('clear-close')).toBeUndefined() + expect(presetIntents.get('clear-close')).toBeUndefined() + expect(cdpUserAgentOverrides.size).toBe(0) }) it('preserves replacement desktop intent after an old clear fails', async () => { @@ -155,14 +156,12 @@ describe('browser viewport operation ownership', () => { browserManager.unregisterGuest('replacement') register('replacement', 103) await expect(browserManager.setViewportOverride('replacement', desktop)).resolves.toBe(true) - expect(uaIntents.get('replacement')).toBe(false) gate.reject(new Error('Old target closed')) await expect(result).resolves.toBe(false) expect(registeredGuests.get('replacement')).toBe(103) - expect(uaIntents.get('replacement')).toBe(false) expect(presetIntents.get('replacement')).toEqual({ guestWebContentsId: 103, - active: true + override: desktop }) }) @@ -177,11 +176,13 @@ describe('browser viewport operation ownership', () => { await browserManager.setViewportOverride('late-delete', mobile) gate.resolve() await expect(result).resolves.toBe(false) - expect(uaIntents.has('late-delete')).toBe(true) + expect(presetIntents.get('late-delete')).toEqual({ guestWebContentsId: 105, override: mobile }) expect(registeredGuests.get('late-delete')).toBe(105) }) - it('same-owner clear failure still restores the legitimate earlier intent', async () => { + // The request is still "no preset"; what survives the failure is the record that the mobile + // override stands, which is what lets the next navigation clear it. + it('same-owner clear failure keeps the standing mobile override tracked', async () => { const handle = register('same-owner', 106) await browserManager.setViewportOverride('same-owner', mobile) const gate = pause(handle, 'Emulation.setUserAgentOverride') @@ -189,7 +190,9 @@ describe('browser viewport operation ownership', () => { await gate.entered gate.reject(new Error('Protocol error')) await expect(result).resolves.toBe(false) - expect(uaIntents.get('same-owner')).toBe(true) + expect(presetIntents.get('same-owner')).toEqual({ guestWebContentsId: 106, override: null }) + expect(handle.presentedUserAgent()).toContain('iPhone') + expect(cdpUserAgentOverrides.has(106)).toBe(true) }) it('old apply cannot overwrite a replacement guest desktop intent', async () => { @@ -202,7 +205,11 @@ describe('browser viewport operation ownership', () => { await browserManager.setViewportOverride('late-apply', desktop) gate.resolve() await expect(pending).resolves.toBe(false) - expect(uaIntents.get('late-apply')).toBe(false) + expect(presetIntents.get('late-apply')).toEqual({ guestWebContentsId: 111, override: desktop }) + expect(old.debuggerSendCommand).not.toHaveBeenCalledWith( + 'Emulation.setUserAgentOverride', + expect.anything() + ) }) it('an old guest cannot write UA intent after replacement in native process mode', async () => { @@ -216,7 +223,11 @@ describe('browser viewport operation ownership', () => { register('native-replacement', 113) gate.resolve() await expect(pending).resolves.toBe(false) - expect(uaIntents.get('native-replacement')).toBeUndefined() + expect(presetIntents.get('native-replacement')).toBeUndefined() + expect(old.debuggerSendCommand).not.toHaveBeenCalledWith( + 'Emulation.setUserAgentOverride', + expect.anything() + ) }) it('old queued operations cannot remove or join a replacement promise tail', async () => { @@ -240,7 +251,11 @@ describe('browser viewport operation ownership', () => { await expect(replacementFirst).resolves.toBe(true) await expect(replacementSecond).resolves.toBe(true) expect(pendingOperations.size).toBe(0) - expect(uaIntents.get('queued-replacement')).toBe(true) + expect(presetIntents.get('queued-replacement')).toEqual({ + guestWebContentsId: 115, + override: mobile + }) + expect(replacement.presentedUserAgent()).toContain('iPhone') }) it('normal same-owner toggles preserve last-requested order and remove the promise tail', async () => { @@ -252,19 +267,18 @@ describe('browser viewport operation ownership', () => { const third = browserManager.setViewportOverride('serialized', null) gate.resolve() expect(await Promise.all([first, second, third])).toEqual([true, true, true]) + // Identity follows the last request, which was "no preset" before any identity write ran, so the + // mobile UA is never installed at all. expect(handle.debuggerSendCommand.mock.calls.map(([method]) => method)).toEqual([ 'Emulation.setDeviceMetricsOverride', 'Emulation.setTouchEmulationEnabled', - 'Emulation.setUserAgentOverride', 'Emulation.setDeviceMetricsOverride', 'Emulation.setTouchEmulationEnabled', - 'Emulation.setUserAgentOverride', 'Emulation.clearDeviceMetricsOverride', - 'Emulation.setTouchEmulationEnabled', - 'Emulation.setUserAgentOverride' + 'Emulation.setTouchEmulationEnabled' ]) expect(pendingOperations.size).toBe(0) - expect(uaIntents.size).toBe(0) + expect(presetIntents.get('serialized')).toEqual({ guestWebContentsId: 116, override: null }) }) it.each([false, true])( @@ -276,13 +290,20 @@ describe('browser viewport operation ownership', () => { await expect( browserManager.setViewportOverride('native', mobileMode ? mobile : desktop) ).resolves.toBe(true) - expect(handle.debuggerSendCommand).toHaveBeenCalledWith( - 'Emulation.setUserAgentOverride', - mobileMode - ? expect.objectContaining({ userAgent: expect.stringContaining('iPhone') }) - : { userAgent: GUEST_ELECTRON_UA } + if (mobileMode) { + expect(handle.debuggerSendCommand).toHaveBeenCalledWith( + 'Emulation.setUserAgentOverride', + expect.objectContaining({ userAgent: expect.stringContaining('iPhone') }) + ) + } else { + expect(handle.debuggerSendCommand).not.toHaveBeenCalledWith( + 'Emulation.setUserAgentOverride', + expect.anything() + ) + } + expect(handle.presentedUserAgent()).toEqual( + mobileMode ? expect.stringContaining('iPhone') : GUEST_ELECTRON_UA ) - expect(uaIntents.get('native')).toBe(mobileMode) } ) @@ -304,7 +325,7 @@ describe('browser viewport operation ownership', () => { expect(await Promise.all(operations.map(({ pending }) => pending))).toEqual( Array(16).fill(false) ) - expect(uaIntents.size).toBe(0) + expect(cdpUserAgentOverrides.size).toBe(0) expect(registeredGuests.size).toBe(0) expect(pendingOperations.size).toBe(0) expect(presetIntents.size).toBe(0) diff --git a/src/main/browser/browser-manager-viewport-scroll-state.ts b/src/main/browser/browser-manager-viewport-scroll-state.ts index 1f83534c856a..04063fb3c302 100644 --- a/src/main/browser/browser-manager-viewport-scroll-state.ts +++ b/src/main/browser/browser-manager-viewport-scroll-state.ts @@ -1,5 +1,8 @@ import { webContents } from 'electron' -import type { BrowserViewportScrollState } from '../../shared/browser-workspace-types' +import type { + BrowserViewportOverride, + BrowserViewportScrollState +} from '../../shared/browser-workspace-types' /** * Renderer routing plus the host-side viewport-preset geometry the wheel path needs to decide @@ -7,11 +10,11 @@ import type { BrowserViewportScrollState } from '../../shared/browser-workspace- */ export abstract class BrowserManagerViewportScrollState { protected readonly rendererWebContentsIdByTabId = new Map() - // Why: host-side wheel panning follows the requested local viewport on the owning guest; - // replacement guests must not inherit a retired guest's state. - protected readonly viewportPresetActiveByTabId = new Map< + // Why: the requested preset, not the applied one — host-side wheel panning and the tab's identity + // both follow what was asked for; replacement guests must not inherit a retired guest's preset. + protected readonly viewportPresetByTabId = new Map< string, - { guestWebContentsId: number; active: boolean } + { guestWebContentsId: number; override: BrowserViewportOverride | null } >() protected readonly viewportScrollStateByTabId = new Map() diff --git a/src/main/browser/browser-manager-viewport-test-fixtures.ts b/src/main/browser/browser-manager-viewport-test-fixtures.ts index b440a768b71c..4d6437cf5d95 100644 --- a/src/main/browser/browser-manager-viewport-test-fixtures.ts +++ b/src/main/browser/browser-manager-viewport-test-fixtures.ts @@ -21,19 +21,47 @@ export type ViewportGuestHandle = { debuggerAttach: ReturnType setGuestUserAgent: (ua: string) => void commitNavigationTo: (nextUrl: string) => void + webContentsUserAgent: () => string + /** What navigator.userAgent reports: the latest applied CDP override, else the WebContents UA. */ + presentedUserAgent: () => string + /** The CDP UA override Chromium holds, or null when none stands. */ + standingUserAgentOverride: () => Record | null } // Why: the guest wires the file's own hoisted mocks, which cannot be imported here. +// Why the process identity: the session UA and app.userAgentFallback both carry it, so that is what a +// real guest's getUserAgent() reports until something writes the WebContents UA. export function createViewportGuestFactory( - mocks: BrowserManagerMocks + mocks: BrowserManagerMocks & { processUserAgent?: string } ): (id: number, url?: string) => ViewportGuestHandle { return function makeGuest(id: number, url = 'https://example.com/'): ViewportGuestHandle { const debuggerSendCommand = vi.fn().mockResolvedValue(undefined) const debuggerIsAttached = vi.fn(() => true) const debuggerAttach = vi.fn() - let currentUa = GUEST_ELECTRON_UA + let currentUa = mocks.processUserAgent ?? GUEST_ELECTRON_UA // Why: getURL() reports the last COMMITTED url — it does not move at did-start-navigation. let committedUrl = url + // Chromium applies CDP commands in issue order, so a later-issued write wins however they settle, + // and a rejected write changes nothing. An empty userAgent clears the override. + let issuedUserAgentWrites = 0 + let appliedUserAgentWrite = 0 + let cdpOverride: Record | null = null + const sendCommand = (method: string, params?: Record): unknown => { + const result: unknown = debuggerSendCommand(method, params) + if (method === 'Emulation.setUserAgentOverride') { + const ordinal = ++issuedUserAgentWrites + void Promise.resolve(result).then( + () => { + if (ordinal > appliedUserAgentWrite) { + appliedUserAgentWrite = ordinal + cdpOverride = params?.userAgent ? params : null + } + }, + () => {} + ) + } + return result + } const guest = { id, isDestroyed: vi.fn(() => false), @@ -53,7 +81,7 @@ export function createViewportGuestFactory( debugger: { isAttached: debuggerIsAttached, attach: debuggerAttach, - sendCommand: debuggerSendCommand, + sendCommand, on: vi.fn(), off: vi.fn() } @@ -68,7 +96,11 @@ export function createViewportGuestFactory( }, commitNavigationTo: (nextUrl: string) => { committedUrl = nextUrl - } + }, + webContentsUserAgent: () => currentUa, + presentedUserAgent: () => + typeof cdpOverride?.userAgent === 'string' ? cdpOverride.userAgent : currentUa, + standingUserAgentOverride: () => cdpOverride } } } diff --git a/src/main/browser/browser-manager-viewport.ts b/src/main/browser/browser-manager-viewport.ts index a4e263dcceda..b85e6d0424fb 100644 --- a/src/main/browser/browser-manager-viewport.ts +++ b/src/main/browser/browser-manager-viewport.ts @@ -5,9 +5,7 @@ import { type BrowserAnnotationViewportBridgeOptions } from '../../shared/browser-annotation-viewport-bridge' import type { BrowserViewportOverride } from '../../shared/browser-workspace-types' -import { googleAuthUserAgent, isGoogleAuthUrl } from './browser-google-auth-ua' import { BrowserManagerDownloadLifecycle } from './browser-manager-download-lifecycle' -import { getBrowserProcessUserAgentIdentity } from './browser-process-user-agent' export abstract class BrowserManagerViewport extends BrowserManagerDownloadLifecycle { // Why: guests are isolated from Orca's preload bridge, so main owns the devtools escape hatch after a tab→guest lookup. @@ -39,11 +37,11 @@ export abstract class BrowserManagerViewport extends BrowserManagerDownloadLifec // Why: chain per-tab so rapid toggles don't interleave CDP commands and the last-requested override wins. const expectedWebContentsId = this.webContentsIdByTabId.get(browserTabId) if (expectedWebContentsId !== undefined) { - // Keep host panning available while CDP applies the requested dimensions. The guest id fence - // prevents this intent from leaking to a replacement guest; clearing the preset removes it. - this.viewportPresetActiveByTabId.set(browserTabId, { + // Record the request before CDP runs: host panning and the tab's identity both follow it, so a + // navigation mid-apply already sees it. The guest id fence keeps it off a replacement guest. + this.viewportPresetByTabId.set(browserTabId, { guestWebContentsId: expectedWebContentsId, - active: override !== null + override }) } // The renderer resizes the host before CDP completes; discard the old geometry until it @@ -146,84 +144,54 @@ export abstract class BrowserManagerViewport extends BrowserManagerDownloadLifec } const dbg = guest.debugger + const metricsApplied = await this.runViewportEmulationStep( + browserTabId, + 'device metrics', + () => + override + ? dbg.sendCommand('Emulation.setDeviceMetricsOverride', { + width: override.width, + height: override.height, + deviceScaleFactor: override.deviceScaleFactor, + mobile: override.mobile + }) + : dbg.sendCommand('Emulation.clearDeviceMetricsOverride', {}) + ) + const touchApplied = await this.runViewportEmulationStep(browserTabId, 'touch emulation', () => + dbg.sendCommand('Emulation.setTouchEmulationEnabled', { + enabled: override?.mobile ?? false, + maxTouchPoints: override?.mobile ? 5 : 0 + }) + ) + if (this.webContentsIdByTabId.get(browserTabId) !== webContentsId) { + return false + } + // Why: identity is not an emulation step. It follows the requested preset whatever the steps + // above did, so a failed metrics or touch write can never strand a mobile identity on the tab. + const identityApplied = await this.runViewportEmulationStep(browserTabId, 'identity', () => + this.retargetTabIdentity(guest, this.resolveTabNavigationUrl(guest)) + ) + return ( + metricsApplied && + touchApplied && + identityApplied && + this.webContentsIdByTabId.get(browserTabId) === webContentsId + ) + } + + private async runViewportEmulationStep( + browserTabId: string, + step: string, + send: () => Promise + ): Promise { try { - if (override) { - await dbg.sendCommand('Emulation.setDeviceMetricsOverride', { - width: override.width, - height: override.height, - deviceScaleFactor: override.deviceScaleFactor, - mobile: override.mobile - }) - if (this.webContentsIdByTabId.get(browserTabId) === webContentsId) { - this.viewportPresetActiveByTabId.set(browserTabId, { - guestWebContentsId: webContentsId, - active: true - }) - } - await dbg.sendCommand('Emulation.setTouchEmulationEnabled', { - enabled: override.mobile, - maxTouchPoints: override.mobile ? 5 : 0 - }) - if (this.webContentsIdByTabId.get(browserTabId) !== webContentsId) { - return false - } - // Navigation must see the preset while the final CDP write is in flight. - this.viewportUaOverrideMobileByTabId.set(browserTabId, override.mobile) - await this.sendViewportUserAgentOverride(guest, override.mobile) - } else { - await dbg.sendCommand('Emulation.clearDeviceMetricsOverride', {}) - if (this.webContentsIdByTabId.get(browserTabId) === webContentsId) { - this.viewportPresetActiveByTabId.set(browserTabId, { - guestWebContentsId: webContentsId, - active: false - }) - } - await dbg.sendCommand('Emulation.setTouchEmulationEnabled', { - enabled: false, - maxTouchPoints: 0 - }) - if (this.webContentsIdByTabId.get(browserTabId) !== webContentsId) { - return false - } - const trackedMobile = this.viewportUaOverrideMobileByTabId.get(browserTabId) - // A navigation after this point must not re-install the override behind the clear. - this.viewportUaOverrideMobileByTabId.delete(browserTabId) - try { - if (this.authUserAgentOverrideStateByGuestId.has(guest.id)) { - const url = this.resolveTabNavigationUrl(guest) - const identity = getBrowserProcessUserAgentIdentity() - // Firefox is delivered per-target and cannot reach workers; keep it clean-only to preserve - // one coherent identity per mode instead of pairing a Firefox document with native workers. - const restored = await this.applyAuthUserAgentOverrideOverCdp( - guest, - false, - url, - identity.mode === 'clean' && isGoogleAuthUrl(url) - ? googleAuthUserAgent() - : identity.userAgent - ) - if (!restored) { - throw new Error('Failed to preserve auth user agent') - } - } else { - // Why: passing an empty string restores the session default UA. - await dbg.sendCommand('Emulation.setUserAgentOverride', { userAgent: '' }) - } - } catch (error) { - if ( - trackedMobile !== undefined && - this.webContentsIdByTabId.get(browserTabId) === webContentsId - ) { - this.viewportUaOverrideMobileByTabId.set(browserTabId, trackedMobile) - } - throw error - } - } - if (this.webContentsIdByTabId.get(browserTabId) !== webContentsId) { - return false - } - return true - } catch { + // A step that reports its own failure resolves false rather than throwing. + return (await send()) !== false + } catch (error) { + console.warn(`[browser-manager] setViewportOverride: ${step} failed`, { + browserTabId, + error: error instanceof Error ? error.message : String(error) + }) return false } } diff --git a/src/main/browser/browser-session-registry.test.ts b/src/main/browser/browser-session-registry.test.ts index 27965a56433b..a3e84b290f09 100644 --- a/src/main/browser/browser-session-registry.test.ts +++ b/src/main/browser/browser-session-registry.test.ts @@ -556,7 +556,7 @@ describe('BrowserSessionRegistry', () => { { webRequest: { onBeforeSendHeaders } } as never, (request) => request.currentUserAgent === googleAuthUserAgent() - ? { userAgent: googleAuthUserAgent() } + ? { kind: 'google-auth', userAgent: googleAuthUserAgent() } : undefined ) expect(onBeforeSendHeaders).toHaveBeenCalledWith( diff --git a/src/main/browser/browser-session-ua-cloudflare-live.electron.test.ts b/src/main/browser/browser-session-ua-cloudflare-live.electron.test.ts index 05331ab5c65b..c6cba96c6d7d 100644 --- a/src/main/browser/browser-session-ua-cloudflare-live.electron.test.ts +++ b/src/main/browser/browser-session-ua-cloudflare-live.electron.test.ts @@ -252,10 +252,10 @@ async function run() { if (arm === 'branch') { installBrowserSessionUserAgentPolicy(sess, request => { if (request.resourceType !== 'mainFrame' && (request.currentUserAgent === firefoxUserAgent || request.effectiveUserAgent === firefoxUserAgent)) { - return { userAgent: firefoxUserAgent } + return { kind: 'google-auth', userAgent: firefoxUserAgent } } if (request.resourceType === 'mainFrame' && request.currentUserAgent === firefoxUserAgent) { - return { userAgent: cleanUserAgent } + return { kind: 'process', userAgent: cleanUserAgent } } return undefined }) diff --git a/src/main/browser/browser-session-ua.ts b/src/main/browser/browser-session-ua.ts index 5b4d4735dcd6..fc05fe357cc4 100644 --- a/src/main/browser/browser-session-ua.ts +++ b/src/main/browser/browser-session-ua.ts @@ -1,5 +1,5 @@ import type { Session } from 'electron' -import type { ViewportUserAgentOverride } from './browser-viewport-user-agent' +import type { BrowserTabIdentity, UserAgentMetadata } from './browser-tab-identity' export { cleanElectronUserAgent } from './browser-process-user-agent' import { getBrowserProcessUserAgentIdentity } from './browser-process-user-agent' @@ -19,7 +19,7 @@ export type BrowserSessionRequestUserAgentResolver = (args: { webContentsId?: number currentUserAgent?: string effectiveUserAgent?: string -}) => ViewportUserAgentOverride | undefined +}) => BrowserTabIdentity | undefined function quoteClientHint(value: string): string { return `"${value.replace(/["\\]/g, '\\$&')}"` @@ -33,7 +33,7 @@ function formatClientHintBrands(brands: { brand: string; version: string }[]): s function applyUserAgentMetadataHeaders( headers: Record, - metadata: NonNullable + metadata: UserAgentMetadata ): void { const values: Record = { 'sec-ch-ua': formatClientHintBrands(metadata.brands), @@ -101,15 +101,10 @@ export function installBrowserSessionUserAgentPolicy( callback({ requestHeaders: headers }) return } - if (identity.userAgent) { - setUserAgentHeader(headers, identity.userAgent) - } - if (identity.userAgent === firefoxUa) { + setUserAgentHeader(headers, identity.userAgent) + if (identity.kind === 'google-auth') { stripClientHints(headers) - callback({ requestHeaders: headers }) - return - } - if (identity.userAgentMetadata) { + } else if (identity.kind === 'mobile') { applyUserAgentMetadataHeaders(headers, identity.userAgentMetadata) } callback({ requestHeaders: headers }) diff --git a/src/main/browser/browser-tab-identity.test.ts b/src/main/browser/browser-tab-identity.test.ts new file mode 100644 index 000000000000..520eae508196 --- /dev/null +++ b/src/main/browser/browser-tab-identity.test.ts @@ -0,0 +1,78 @@ +import { describe, expect, it } from 'vitest' + +import { googleAuthUserAgent } from './browser-google-auth-ua' +import { resolveBrowserTabIdentity } from './browser-tab-identity' + +const CHROME_UA = + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36' +const NATIVE_UA = + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Orca/1.0.0 Chrome/134.0.0.0 Electron/43.0.0 Safari/537.36' +const clean = { mode: 'clean', userAgent: CHROME_UA } as const +const native = { mode: 'native', userAgent: NATIVE_UA } as const +const AUTH_URL = 'https://accounts.google.com/v3/signin/identifier' + +describe('resolveBrowserTabIdentity', () => { + it('presents Firefox on Google auth hosts in clean mode regardless of the preset', () => { + for (const mobile of [false, true]) { + expect(resolveBrowserTabIdentity({ url: AUTH_URL, mobile, processIdentity: clean })).toEqual({ + kind: 'google-auth', + userAgent: googleAuthUserAgent() + }) + } + }) + + it('leaves Google auth hosts on the native identity in native mode', () => { + expect( + resolveBrowserTabIdentity({ url: AUTH_URL, mobile: false, processIdentity: native }) + ).toEqual({ kind: 'process', userAgent: NATIVE_UA }) + expect( + resolveBrowserTabIdentity({ url: AUTH_URL, mobile: true, processIdentity: native }).kind + ).toBe('mobile') + }) + + it('presents the process identity itself off the auth hosts without a mobile preset', () => { + for (const processIdentity of [clean, native]) { + expect( + resolveBrowserTabIdentity({ + url: 'https://myaccount.google.com/', + mobile: false, + processIdentity + }) + ).toEqual({ kind: 'process', userAgent: processIdentity.userAgent }) + } + }) + + it('splices the real Chrome major into the mobile UA and its client hints', () => { + const identity = resolveBrowserTabIdentity({ + url: 'https://example.com/', + mobile: true, + processIdentity: clean + }) + expect(identity.kind).toBe('mobile') + expect(identity.userAgent).toContain('iPhone') + expect(identity.userAgent).toContain('CriOS/134.0.0.0') + if (identity.kind === 'mobile') { + expect(identity.userAgentMetadata.mobile).toBe(true) + expect(identity.userAgentMetadata.platform).toBe('iOS') + expect(identity.userAgentMetadata.brands).toContainEqual({ + brand: 'Google Chrome', + version: '134' + }) + } + }) + + it('falls back to a known Chrome major when the process UA carries none', () => { + const identity = resolveBrowserTabIdentity({ + url: 'https://example.com/', + mobile: true, + processIdentity: { mode: 'clean', userAgent: googleAuthUserAgent() } + }) + expect(identity.userAgent).toContain('CriOS/134.0.0.0') + }) + + it('treats an unparseable URL as a non-auth host', () => { + expect( + resolveBrowserTabIdentity({ url: 'not a url', mobile: false, processIdentity: clean }) + ).toEqual({ kind: 'process', userAgent: CHROME_UA }) + }) +}) diff --git a/src/main/browser/browser-tab-identity.ts b/src/main/browser/browser-tab-identity.ts new file mode 100644 index 000000000000..713b0310a4ae --- /dev/null +++ b/src/main/browser/browser-tab-identity.ts @@ -0,0 +1,90 @@ +// Why one owner: a tab's identity is read by the session request hook and written to the guest over +// two layers (the WebContents UA and a CDP override that outranks it). When each layer derived it on +// its own, a desktop viewport preset installed a CDP override with no userAgentMetadata, and Chromium +// then drops navigator.userAgentData and every sec-ch-ua header for that tab — a Chrome UA with no +// client hints, which bot checks read as a spoof. Every layer now asks this module instead. + +import type { BrowserProcessUserAgentIdentity } from './browser-process-user-agent' +import { googleAuthUserAgent, isGoogleAuthUrl } from './browser-google-auth-ua' + +type UserAgentBrand = { brand: string; version: string } + +export type UserAgentMetadata = { + brands: UserAgentBrand[] + fullVersionList: UserAgentBrand[] + fullVersion: string + platform: string + platformVersion: string + architecture: string + model: string + mobile: boolean +} + +export type BrowserTabIdentity = + /** The process identity, with its client hints left to Chromium. */ + | { kind: 'process'; userAgent: string } + /** Firefox on Google's auth hosts; real Firefox sends no client hints. */ + | { kind: 'google-auth'; userAgent: string } + | { kind: 'mobile'; userAgent: string; userAgentMetadata: UserAgentMetadata } + +export function googleAuthTabIdentity(): BrowserTabIdentity { + return { kind: 'google-auth', userAgent: googleAuthUserAgent() } +} + +/** + * The identity a tab presents at `url`. Desktop presets and "no preset" are deliberately the same + * input: only a mobile preset changes who the tab claims to be. + */ +export function resolveBrowserTabIdentity(args: { + url: string + mobile: boolean + processIdentity: BrowserProcessUserAgentIdentity +}): BrowserTabIdentity { + // Firefox is delivered per-target and cannot reach workers; keep it clean-only to preserve one + // coherent identity per mode instead of pairing a Firefox document with native workers. + if (args.processIdentity.mode === 'clean' && isGoogleAuthUrl(args.url)) { + return googleAuthTabIdentity() + } + if (args.mobile) { + return buildMobileTabIdentity(args.processIdentity.userAgent) + } + return { kind: 'process', userAgent: args.processIdentity.userAgent } +} + +// Why: responsive sites UA-sniff; this is Chrome DevTools' default iPhone UA template with the real +// Chrome major spliced in so the userAgentMetadata brands below agree with it. +function buildMobileUserAgent(chromeMajor: string): string { + return `Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/${chromeMajor}.0.0.0 Mobile/15E148 Safari/604.1` +} + +function extractChromeMajor(ua: string): string { + const match = ua.match(/Chrome\/(\d+)/) + return match ? match[1] : '134' +} + +function buildMobileTabIdentity(processUserAgent: string): BrowserTabIdentity { + const chromeMajor = extractChromeMajor(processUserAgent) + // Why: userAgentMetadata must accompany the mobile UA so client hints match, or bot-detection flags the desktop-hint leak. + return { + kind: 'mobile', + userAgent: buildMobileUserAgent(chromeMajor), + userAgentMetadata: { + brands: [ + { brand: 'Google Chrome', version: chromeMajor }, + { brand: 'Chromium', version: chromeMajor }, + { brand: 'Not/A)Brand', version: '24' } + ], + fullVersionList: [ + { brand: 'Google Chrome', version: `${chromeMajor}.0.0.0` }, + { brand: 'Chromium', version: `${chromeMajor}.0.0.0` }, + { brand: 'Not/A)Brand', version: '24.0.0.0' } + ], + fullVersion: `${chromeMajor}.0.0.0`, + platform: 'iOS', + platformVersion: '17.0', + architecture: '', + model: 'iPhone', + mobile: true + } + } +} diff --git a/src/main/browser/browser-viewport-user-agent.test.ts b/src/main/browser/browser-viewport-user-agent.test.ts deleted file mode 100644 index 1d069a209ada..000000000000 --- a/src/main/browser/browser-viewport-user-agent.test.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { describe, expect, it } from 'vitest' - -import { googleAuthUserAgent } from './browser-google-auth-ua' -import { buildViewportUserAgentOverride } from './browser-viewport-user-agent' - -const CHROME_UA = - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36' - -describe('buildViewportUserAgentOverride', () => { - it('presents the Firefox UA on Google auth hosts regardless of the preset', () => { - for (const mobile of [false, true]) { - const override = buildViewportUserAgentOverride({ - url: 'https://accounts.google.com/v3/signin/identifier', - mobile, - baseUserAgent: CHROME_UA - }) - expect(override.userAgent).toBe(googleAuthUserAgent()) - // Real Firefox emits no client hints, so Chrome brands would contradict the stripped headers. - expect(override.userAgentMetadata).toBeUndefined() - } - }) - - it('keeps the clean desktop UA off the auth hosts', () => { - const override = buildViewportUserAgentOverride({ - url: 'https://myaccount.google.com/', - mobile: false, - baseUserAgent: CHROME_UA - }) - expect(override.userAgent).toBe(CHROME_UA) - expect(override.userAgentMetadata).toBeUndefined() - }) - - it('splices the real Chrome major into the mobile UA and its client hints', () => { - const override = buildViewportUserAgentOverride({ - url: 'https://example.com/', - mobile: true, - baseUserAgent: CHROME_UA - }) - expect(override.userAgent).toContain('iPhone') - expect(override.userAgent).toContain('CriOS/134.0.0.0') - expect(override.userAgentMetadata?.mobile).toBe(true) - expect(override.userAgentMetadata?.platform).toBe('iOS') - expect(override.userAgentMetadata?.brands).toContainEqual({ - brand: 'Google Chrome', - version: '134' - }) - }) - - it('falls back to a known Chrome major when the base UA carries none', () => { - const override = buildViewportUserAgentOverride({ - url: 'https://example.com/', - mobile: true, - baseUserAgent: googleAuthUserAgent() - }) - expect(override.userAgent).toContain('CriOS/134.0.0.0') - }) - - it('treats an unparseable URL as a non-auth host', () => { - const override = buildViewportUserAgentOverride({ - url: 'not a url', - mobile: false, - baseUserAgent: CHROME_UA - }) - expect(override.userAgent).toBe(CHROME_UA) - }) -}) diff --git a/src/main/browser/browser-viewport-user-agent.ts b/src/main/browser/browser-viewport-user-agent.ts deleted file mode 100644 index 31c06307b463..000000000000 --- a/src/main/browser/browser-viewport-user-agent.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Why: a CDP Emulation.setUserAgentOverride outranks WebContents.setUserAgent for both -// navigator.userAgent and the outgoing request header, and it stands across every later -// navigation until explicitly cleared. So the viewport preset's UA is a third identity layer -// that must agree with the auth-host Firefox switch, or applying a preset silently reintroduces -// the exact UA mismatch this scope exists to remove. - -import { googleAuthUserAgent, isGoogleAuthUrl } from './browser-google-auth-ua' - -type UserAgentBrand = { brand: string; version: string } - -export type ViewportUserAgentOverride = { - userAgent: string - userAgentMetadata?: { - brands: UserAgentBrand[] - fullVersionList: UserAgentBrand[] - fullVersion: string - platform: string - platformVersion: string - architecture: string - model: string - mobile: boolean - } -} - -// Why: responsive sites UA-sniff; this is Chrome DevTools' default iPhone UA template with the real -// Chrome major spliced in so the userAgentMetadata brands below agree with it. -function buildMobileUserAgent(chromeMajor: string): string { - return `Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/${chromeMajor}.0.0.0 Mobile/15E148 Safari/604.1` -} - -function extractChromeMajor(ua: string): string { - const match = ua.match(/Chrome\/(\d+)/) - return match ? match[1] : '134' -} - -export function buildViewportUserAgentOverride(args: { - url: string - mobile: boolean - baseUserAgent: string - googleAuthEnabled?: boolean -}): ViewportUserAgentOverride { - if (args.googleAuthEnabled !== false && isGoogleAuthUrl(args.url)) { - // Why: match the header-level Firefox switch exactly, and send no userAgentMetadata — real - // Firefox emits no client hints, so Chrome brands here would contradict the stripped headers. - return { userAgent: googleAuthUserAgent() } - } - if (!args.mobile) { - // Why: desktop presets republish the session's clean identity, or a preset would put the - // Electron/app tokens back on the wire and a transplanted session gets revoked (STA-7147). - return { userAgent: args.baseUserAgent } - } - const chromeMajor = extractChromeMajor(args.baseUserAgent) - // Why: userAgentMetadata must accompany the mobile UA so client hints match, or bot-detection flags the desktop-hint leak. - return { - userAgent: buildMobileUserAgent(chromeMajor), - userAgentMetadata: { - brands: [ - { brand: 'Google Chrome', version: chromeMajor }, - { brand: 'Chromium', version: chromeMajor }, - { brand: 'Not/A)Brand', version: '24' } - ], - fullVersionList: [ - { brand: 'Google Chrome', version: `${chromeMajor}.0.0.0` }, - { brand: 'Chromium', version: `${chromeMajor}.0.0.0` }, - { brand: 'Not/A)Brand', version: '24.0.0.0' } - ], - fullVersion: `${chromeMajor}.0.0.0`, - platform: 'iOS', - platformVersion: '17.0', - architecture: '', - model: 'iPhone', - mobile: true - } - } -} diff --git a/tests/tools/google-signin-ua-probe.cjs b/tests/tools/google-signin-ua-probe.cjs index 47d8b419d7ac..2b3e96387201 100644 --- a/tests/tools/google-signin-ua-probe.cjs +++ b/tests/tools/google-signin-ua-probe.cjs @@ -241,7 +241,7 @@ app.whenReady().then(async () => { return } if (isAppMode) { - // Mirror applyGoogleAuthUserAgent: Firefox UA on auth navs, restore the + // Mirror presentTabIdentityAtNavigationStart: Firefox UA on auth navs, restore the // cleaned session UA otherwise. This WebContents UA is what leaks onto // cross-host subresource requests while the auth document is on screen. const current = window.webContents.getUserAgent() From 3976ad4c5983d83a5124a2d97762fb0a609fb6c9 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:55:05 -0700 Subject: [PATCH 60/90] perf(test): remove obsolete structural snapshots (#23777) --- config/scripts/ci-shard-timings.json | 1 - src/main/git/repo-api-parity.test.ts | 37 ---- .../claude-trust-dialog-transcript.test.ts | 16 +- .../refactor-hook-contract.test-support.ts | 163 ------------------ .../task-page-source-family.test-support.ts | 43 ----- .../terminal-pane-hook-order-parity.test.ts | 125 -------------- ...-pane-quick-command-initialization.test.ts | 23 +++ 7 files changed, 36 insertions(+), 372 deletions(-) delete mode 100644 src/main/git/repo-api-parity.test.ts delete mode 100644 src/renderer/src/components/refactor-hook-contract.test-support.ts delete mode 100644 src/renderer/src/components/terminal-pane/terminal-pane-hook-order-parity.test.ts create mode 100644 src/renderer/src/components/terminal-pane/terminal-pane-quick-command-initialization.test.ts diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 1a187718dd23..664e82686623 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -1721,7 +1721,6 @@ "src/main/git/remove-worktree-branch-cleanup.test.ts": 163, "src/main/git/remove-worktree-clean-preflight.test.ts": 125, "src/main/git/remove-worktree.test.ts": 159, - "src/main/git/repo-api-parity.test.ts": 194, "src/main/git/repo-branch-conflict-batched-probe.test.ts": 73, "src/main/git/repo-branch-conflict-real-git.test.ts": 351, "src/main/git/repo-branch-conflict.test.ts": 214, diff --git a/src/main/git/repo-api-parity.test.ts b/src/main/git/repo-api-parity.test.ts deleted file mode 100644 index 9143b7bf65fb..000000000000 --- a/src/main/git/repo-api-parity.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { describe, expect, it } from 'vitest' -import * as repo from './repo' - -describe('repo public API parity', () => { - it('keeps the historical runtime export surface', () => { - expect(Object.keys(repo).sort()).toEqual( - [ - 'DEFAULT_BASE_REF_PROBES', - 'buildSearchBaseRefsArgv', - 'getBaseRefDefault', - 'getBranchConflictKind', - 'getDefaultBaseRef', - 'getDefaultRemote', - 'getGitRepoRoot', - 'getLinkedWorktreeMainRepoRoot', - 'getRecentDriftSubjects', - 'getRemoteCommitUrl', - 'getRemoteCount', - 'getRemoteDrift', - 'getRemoteFileUrl', - 'getRemoteUrl', - 'getRepoName', - 'isForEachRefExcludeUnsupportedError', - 'isGitRepo', - 'mergeBaseRefSearchResultGroups', - 'normalizeGitRepoRootForInputPath', - 'normalizeRefSearchQuery', - 'parseAndFilterSearchRefDetails', - 'parseRemoteCount', - 'resolveDefaultBaseRefViaExec', - 'resolveDefaultBaseRefWithLocalGit', - 'searchBaseRefDetails', - 'searchBaseRefs' - ].sort() - ) - }) -}) diff --git a/src/main/runtime/claude-trust-dialog-transcript.test.ts b/src/main/runtime/claude-trust-dialog-transcript.test.ts index d459fc515024..5913c54b0199 100644 --- a/src/main/runtime/claude-trust-dialog-transcript.test.ts +++ b/src/main/runtime/claude-trust-dialog-transcript.test.ts @@ -31,6 +31,8 @@ async function waitOnReplay( size, data: '' }) + // Pane creation awaits real timers; replay and polling use the virtual clock. + vi.useFakeTimers() const bytes = Buffer.from(data, 'utf8') const step = readSize ?? bytes.length // Why a streaming decoder: a PTY read can end inside a multi-byte character, as a real one does. @@ -42,14 +44,22 @@ async function waitOnReplay( if (options.after) { runtime.onPtyData(TRANSCRIPT_PANE_PTY_ID, options.after, Date.now()) } - // Why a wide budget: a blocked verdict lands on the first ~2 s poll tick; the slack absorbs load. - return runtime.waitForTerminal(handle, { + const timeoutMs = options.timeoutMs ?? 15_000 + const promise = runtime.waitForTerminal(handle, { condition: 'tui-idle', - timeoutMs: options.timeoutMs ?? 15_000 + timeoutMs }) + // Attach before advancing so the expected timeout is never an unhandled rejection. + promise.catch(() => {}) + await vi.advanceTimersByTimeAsync(timeoutMs) + return promise } describe("Claude's workspace trust dialog, from captured transcripts", () => { + afterEach(() => { + vi.useRealTimers() + }) + it('reports the dialog as a blocking prompt instead of waiting out the whole budget', async () => { await expect(waitOnReplay('claude-dialog-trust-workspace', null)).resolves.toMatchObject({ satisfied: false, diff --git a/src/renderer/src/components/refactor-hook-contract.test-support.ts b/src/renderer/src/components/refactor-hook-contract.test-support.ts deleted file mode 100644 index cb191c7c86fe..000000000000 --- a/src/renderer/src/components/refactor-hook-contract.test-support.ts +++ /dev/null @@ -1,163 +0,0 @@ -import { createHash } from 'node:crypto' -// TypeScript 7 is a native CLI; AST tests still need the legacy JavaScript API. -import ts from 'typescript-api' - -export type HookContractFact = { - dependencies: string[] | null - name: string -} - -type HookDefinition = { - body: ts.Node - sourceFile: ts.SourceFile -} - -export type HookSource = { - relativePath: string - source: string -} - -export type HookDefinitions = ReadonlyMap - -function readFunctionName(node: ts.Node): string | null { - if ((ts.isFunctionDeclaration(node) || ts.isFunctionExpression(node)) && node.name) { - return node.name.text - } - if ( - ts.isArrowFunction(node) && - ts.isVariableDeclaration(node.parent) && - ts.isIdentifier(node.parent.name) - ) { - return node.parent.name.text - } - return null -} - -function readHookName(node: ts.CallExpression): string | null { - if (ts.isIdentifier(node.expression) && /^use[A-Z]/.test(node.expression.text)) { - return node.expression.text - } - if ( - ts.isPropertyAccessExpression(node.expression) && - /^use[A-Z]/.test(node.expression.name.text) - ) { - return node.expression.name.text - } - return null -} - -function normalize(node: ts.Node, sourceFile: ts.SourceFile): string { - return node - .getText(sourceFile) - .replace(/\/\*[\s\S]*?\*\//g, '') - .replace(/\/\/.*$/gm, '') - .replace(/\s+/g, '') -} - -export function readHookDefinitions( - sources: readonly HookSource[], - includesDefinition: (name: string) => boolean -): HookDefinitions { - const definitions = new Map() - for (const { relativePath, source } of sources) { - const sourceFile = ts.createSourceFile( - relativePath, - source, - ts.ScriptTarget.Latest, - true, - relativePath.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS - ) - const visit = (node: ts.Node): void => { - if ( - (ts.isFunctionDeclaration(node) || - ts.isFunctionExpression(node) || - ts.isArrowFunction(node)) && - node.body - ) { - const name = readFunctionName(node) - if (name && includesDefinition(name)) { - definitions.set(name, { body: node.body, sourceFile }) - } - } - ts.forEachChild(node, visit) - } - visit(sourceFile) - } - return definitions -} - -export function readFlattenedHookFacts( - definitions: HookDefinitions, - rootName: string -): HookContractFact[] { - const flatten = (name: string, active: ReadonlySet): HookContractFact[] => { - const definition = definitions.get(name) - if (!definition || active.has(name)) { - throw new Error(`Invalid hook stage: ${name}`) - } - const facts: HookContractFact[] = [] - const nextActive = new Set([...active, name]) - const visit = (node: ts.Node): void => { - if (ts.isCallExpression(node)) { - const hookName = readHookName(node) - if (hookName) { - if (definitions.has(hookName)) { - facts.push(...flatten(hookName, nextActive)) - } else { - const dependencyArray = [...node.arguments] - .toReversed() - .find((argument) => ts.isArrayLiteralExpression(argument)) - facts.push({ - dependencies: dependencyArray - ? [...dependencyArray.elements].map((element) => - normalize(element, definition.sourceFile) - ) - : null, - name: hookName - }) - } - } - } - ts.forEachChild(node, visit) - } - visit(definition.body) - return facts - } - - return flatten(rootName, new Set()) -} - -export function hashContract(values: readonly string[]): string { - return createHash('sha256').update(values.join('\n')).digest('hex') -} - -export function readDependencyContract(facts: readonly HookContractFact[]): string[] { - return facts.flatMap(({ dependencies, name }) => - dependencies === null ? [] : [`${name}|[${dependencies.join(',')}]`] - ) -} - -export function projectDependencyContract( - facts: readonly HookContractFact[], - allowedAdditions: Readonly> -): string[] { - const dependencyFacts = facts.filter( - (fact): fact is HookContractFact & { dependencies: string[] } => fact.dependencies !== null - ) - for (const ordinal of Object.keys(allowedAdditions).map(Number)) { - if (!Number.isInteger(ordinal) || ordinal < 0 || ordinal >= dependencyFacts.length) { - throw new Error(`Invalid dependency-array ordinal: ${ordinal}`) - } - } - return dependencyFacts.map(({ dependencies, name }, ordinal) => { - const projected = [...dependencies] - for (const addition of allowedAdditions[ordinal] ?? []) { - const index = projected.indexOf(addition) - if (index === -1) { - throw new Error(`Missing allowed dependency addition at ${ordinal}: ${addition}`) - } - projected.splice(index, 1) - } - return `${name}|[${projected.join(',')}]` - }) -} diff --git a/src/renderer/src/components/task-page-source-family.test-support.ts b/src/renderer/src/components/task-page-source-family.test-support.ts index 2253f11295e6..14dd9a76d2e9 100644 --- a/src/renderer/src/components/task-page-source-family.test-support.ts +++ b/src/renderer/src/components/task-page-source-family.test-support.ts @@ -1,25 +1,8 @@ import { readFileSync, readdirSync } from 'node:fs' import { join } from 'node:path' -import { - type HookContractFact, - readFlattenedHookFacts, - readHookDefinitions -} from './refactor-hook-contract.test-support' - const TASK_PAGE_FLAT_SOURCE_PATTERN = /^(?:use-task-page-.*\.ts|task-page-.*\.tsx?)$/ const TASK_PAGE_DIRECTORY = 'task-page' -const TASK_PAGE_EXTRACTED_LOWERCASE_FILES = new Set([ - 'task-page-draft-storage.tsx', - 'task-page-github-landing-refresh-run.tsx', - 'task-page-github-quiet-refresh-run.tsx', - 'task-page-github-review-model.tsx', - 'task-page-github-reviewer-actions.ts', - 'task-page-linear-issue-model.tsx', - 'task-page-linear-jira-list-model.tsx', - 'task-page-source-context.tsx' -]) - function isSourceFile(name: string): boolean { return !name.includes('.test.') && !name.includes('.test-support.') } @@ -45,13 +28,6 @@ export const TASK_PAGE_SOURCE_FILES = [ ...readTaskPageDirectory(TASK_PAGE_DIRECTORY) ].sort() -export const TASK_PAGE_REFACTOR_SOURCE_FILES = TASK_PAGE_SOURCE_FILES.filter( - (name) => - (name.startsWith(`${TASK_PAGE_DIRECTORY}/`) && name.endsWith('.tsx')) || - /^use-task-page-.*\.ts$/.test(name) || - TASK_PAGE_EXTRACTED_LOWERCASE_FILES.has(name) -) - export function readTaskPageSource(relativePath: string): string { return readFileSync(join(__dirname, relativePath), 'utf8') } @@ -61,22 +37,3 @@ export function readTaskPageSourceFamily(): string { (relativePath) => `// TaskPage source: ${relativePath}\n${readTaskPageSource(relativePath)}` ).join('\n') } - -export function readTaskPageRefactorSourceFamily(): string { - return TASK_PAGE_REFACTOR_SOURCE_FILES.map(readTaskPageSource).join('\n') -} - -export function readFlattenedTaskPageHookFacts(): HookContractFact[] { - const definitions = readHookDefinitions( - TASK_PAGE_REFACTOR_SOURCE_FILES.map((relativePath) => ({ - relativePath, - source: readTaskPageSource(relativePath) - })), - (name) => name === 'TaskPage' || name.startsWith('useTaskPage') - ) - return readFlattenedHookFacts(definitions, 'TaskPage') -} - -export function readFlattenedTaskPageHookOrder(): string[] { - return readFlattenedTaskPageHookFacts().map(({ name }) => name) -} diff --git a/src/renderer/src/components/terminal-pane/terminal-pane-hook-order-parity.test.ts b/src/renderer/src/components/terminal-pane/terminal-pane-hook-order-parity.test.ts deleted file mode 100644 index ded0bbf5c2ac..000000000000 --- a/src/renderer/src/components/terminal-pane/terminal-pane-hook-order-parity.test.ts +++ /dev/null @@ -1,125 +0,0 @@ -import { createHash } from 'node:crypto' -import { readFileSync, readdirSync } from 'node:fs' -import { join } from 'node:path' -// TypeScript 7 is a native CLI; AST tests still need the legacy JavaScript API. -import ts from 'typescript-api' -import { describe, expect, it } from 'vitest' - -const TERMINAL_PANE_HOOK_SOURCE_PATTERN = - /^(?:TerminalPane\.tsx|use-terminal-pane-(?:chat-state|close-actions|context-actions|controller|foundation|global-listeners|layout-bindings|layout-persistence|lifecycle-stage|mobile-actions|paste-listeners|process-exit-actions|projection|reconciliation|startup-actions|store-actions|store-bindings|title-effects|title-state)\.ts)$/ -// Rebased onto main after the workbench surface-per-workspace and deferred -// split-cwd changes; the pane session-ID projection added one render hook (230 hooks). -// Then 27 stable-action `useAppStore` subscriptions folded into four -// `useTerminalPaneStoreActions()` calls, each one `useMemo` (204 hooks, 8 useMemo). -// Restoring the terminal/chat switcher added four `useCallback`s -- three in -// chat-state (can-toggle, toggle-for-leaf, toggle-active) and the context-menu -// toggle in projection (208 hooks, still 8 useMemo). -// Then chat-state's orchestration dispatch-status subscription went with the -// paused notice that read it (207 hooks, still 8 useMemo). -// Then host-authoritative layout removal added two `useRef`s in reconciliation -// (last host layout leaf set, retired leaf set) (209 hooks, still 8 useMemo). -// Then search match count + Cmd+F focus parity (#9035) added a `useRef` and a `useCallback` in -// foundation (search input ref, focus-search-input) (211 hooks, still 8 useMemo). -// Then the pending split-close admission added one `useRef` in close-actions -// (the confirmed-close continuation) (212 hooks, still 8 useMemo). -// Then the dead adopted-structured-session portal went with its local target `useMemo` -// in projection (211 hooks, 7 useMemo). -// Then chat ownership through toggles and restore (#23049) added a `useRef`, a `useLayoutEffect` -// and a `useEffect` across chat-state, layout-persistence and title-effects (214 hooks, still 7 useMemo). -const PRE_REFACTOR_HOOK_ORDER_SHA256 = - '3736b71c612bb28b9b5298c7704ee1b32c7afc0254e75d0072ff4df870ec3be9' - -const sourceFiles = readdirSync(__dirname) - .filter((name) => TERMINAL_PANE_HOOK_SOURCE_PATTERN.test(name)) - .sort() - -function readFunctionDefinitions(): Map { - const definitions = new Map() - for (const relativePath of sourceFiles) { - const filePath = join(__dirname, relativePath) - const sourceFile = ts.createSourceFile( - filePath, - readFileSync(filePath, 'utf8'), - ts.ScriptTarget.Latest, - true, - relativePath.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS - ) - const visit = (node: ts.Node): void => { - if ( - ts.isFunctionDeclaration(node) && - node.name && - (node.name.text === 'TerminalPane' || node.name.text.startsWith('useTerminalPane')) - ) { - definitions.set(node.name.text, node) - } - ts.forEachChild(node, visit) - } - visit(sourceFile) - } - return definitions -} - -function readFlattenedHookOrder(): string[] { - const definitions = readFunctionDefinitions() - const flatten = (name: string, active: ReadonlySet): string[] => { - const definition = definitions.get(name) - if (!definition?.body) { - throw new Error(`Missing terminal pane hook stage: ${name}`) - } - if (active.has(name)) { - throw new Error(`Recursive terminal pane hook stage: ${name}`) - } - const nextActive = new Set([...active, name]) - const hooks: string[] = [] - const visit = (node: ts.Node): void => { - if ( - ts.isCallExpression(node) && - ts.isIdentifier(node.expression) && - /^use[A-Z]/.test(node.expression.text) - ) { - const hookName = node.expression.text - hooks.push(...(definitions.has(hookName) ? flatten(hookName, nextActive) : [hookName])) - } - ts.forEachChild(node, visit) - } - visit(definition.body) - return hooks - } - - return flatten('TerminalPane', new Set()) -} - -describe('TerminalPane refactor hook parity', () => { - it('preserves the recursively flattened render hook order', () => { - const hooks = readFlattenedHookOrder() - expect(hooks).toHaveLength(214) - expect(hooks.filter((hook) => hook === 'useMemo')).toHaveLength(7) - expect(createHash('sha256').update(hooks.join('\n')).digest('hex')).toBe( - PRE_REFACTOR_HOOK_ORDER_SHA256 - ) - }) - - it('aggregates every extracted hook stage', () => { - expect(sourceFiles).toHaveLength(20) - expect(sourceFiles).toContain('TerminalPane.tsx') - expect(sourceFiles).toContain('use-terminal-pane-controller.ts') - }) - - it('defers quick-command host work until the context menu opens', () => { - const startupSource = readFileSync( - join(__dirname, 'use-terminal-pane-startup-actions.ts'), - 'utf8' - ) - const contextSource = readFileSync( - join(__dirname, 'use-terminal-pane-context-actions.ts'), - 'utf8' - ) - - expect(startupSource).toContain('const quickCommandRepoId =') - expect(startupSource).not.toContain('useTerminalQuickCommandHosts') - expect(contextSource).toContain('useTerminalQuickCommandHosts(worktreeId, contextMenu.open)') - expect(contextSource).toContain('terminalQuickCommandMatchesWorkspaceProject') - expect(contextSource).toContain('projectHostSetupProjection.setups') - expect(contextSource).toContain('quickCommandExecutionHostId') - }) -}) diff --git a/src/renderer/src/components/terminal-pane/terminal-pane-quick-command-initialization.test.ts b/src/renderer/src/components/terminal-pane/terminal-pane-quick-command-initialization.test.ts new file mode 100644 index 000000000000..b64f75831603 --- /dev/null +++ b/src/renderer/src/components/terminal-pane/terminal-pane-quick-command-initialization.test.ts @@ -0,0 +1,23 @@ +import { readFileSync } from 'node:fs' +import { join } from 'node:path' +import { describe, expect, it } from 'vitest' + +describe('TerminalPane quick-command initialization', () => { + it('defers quick-command host work until the context menu opens', () => { + const startupSource = readFileSync( + join(__dirname, 'use-terminal-pane-startup-actions.ts'), + 'utf8' + ) + const contextSource = readFileSync( + join(__dirname, 'use-terminal-pane-context-actions.ts'), + 'utf8' + ) + + expect(startupSource).toContain('const quickCommandRepoId =') + expect(startupSource).not.toContain('useTerminalQuickCommandHosts') + expect(contextSource).toContain('useTerminalQuickCommandHosts(worktreeId, contextMenu.open)') + expect(contextSource).toContain('terminalQuickCommandMatchesWorkspaceProject') + expect(contextSource).toContain('projectHostSetupProjection.setups') + expect(contextSource).toContain('quickCommandExecutionHostId') + }) +}) From 2ae7c00e847e2cfdfa44bdfffa1d343ee1ca6686 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:09:13 -0700 Subject: [PATCH 61/90] fix(opencode): keep OpenCode 2 panes Working across plugin reloads (#23700) * fix(opencode): keep OpenCode 2 panes Working across plugin reloads OpenCode 2 disposes and re-sets-up every plugin whenever its plugins dir changes, while sessions keep running. The status plugin published a final Idle on dispose, so a pane read Done mid-turn. Orca also rewrote the plugin file on every PTY spawn, so opening any terminal triggered that reload. Dispose now releases the factory's bookkeeping without publishing a verdict; the next lifecycle event settles the pane, and Orca's ended-process reconciliation still retires panes whose agent exited. The plugin file is written only when its bytes differ. * fix(opencode): skip rewriting an unchanged plugin in the SSH relay install too The relay's canonical-config install still unlinked and rewrote the status plugin on every OpenCode launch over SSH, which restarts every plugin in a remote OpenCode 2 server. Share one install-currency check (lstat + the existing byte comparison) between the local and relay writers, and pin write-if-changed with mtime so the tests also fail on filesystems that reuse a freed inode. * fix(opencode): keep the final Idle when OpenCode 1 tears its instance down OpenCode 1 disposes a plugin only when it tears the instance down, and that teardown cancels every running session, so the Idle published on dispose is true there; the cancelled run's own idle may never reach the plugin. Only OpenCode 2 disposes on a hot reload while turns keep running. The generated module serves both hosts, so the OpenCode 2 setup() entry point now tells the shared factory that sessions outlive disposal; the server() path keeps the previous disposal behaviour, including the hand-off to a surviving factory. * fix(opencode): compare a symlinked plugin by its target before rewriting OpenCode 2 loads plugins through file-level symlinks and reads the revision from the target's mtime, so a user whose Orca plugin file is a symlink (per-file dotfile managers) failed the regular-file check and got a write through the link, and a reload, on every spawn. The config-dir and relay installs now skip the write when the resolved target already has Orca's bytes; when stale they behave as before. Only the per-source overlay keeps the regular-file check, since a link there mirrors a user entry. Installers also skip the write inside a guarded block rather than returning early, so later install steps still run. * test(opencode): skip the plugin symlink tests on Windows like their neighbours Creating a file symlink on Windows needs Developer Mode or admin rights. * test(opencode): stub fetch without a type assertion in the dispose host test --- .../opencode/hook-plugin-dispose-host.test.ts | 165 ++++++++++++++++++ src/main/opencode/hook-service.test.ts | 62 ++++++- src/main/opencode/hook-service.ts | 23 ++- .../opencode/status-plugin-factory-source.ts | 16 +- .../opencode2/status-plugin-setup-source.ts | 3 +- src/relay/opencode-canonical-config.ts | 13 +- src/relay/plugin-overlay.test.ts | 47 +++++ src/shared/opencode-installed-plugin.test.ts | 47 +++++ src/shared/opencode-installed-plugin.ts | 22 +++ 9 files changed, 378 insertions(+), 20 deletions(-) create mode 100644 src/main/opencode/hook-plugin-dispose-host.test.ts create mode 100644 src/shared/opencode-installed-plugin.test.ts create mode 100644 src/shared/opencode-installed-plugin.ts diff --git a/src/main/opencode/hook-plugin-dispose-host.test.ts b/src/main/opencode/hook-plugin-dispose-host.test.ts new file mode 100644 index 000000000000..179714d8c831 --- /dev/null +++ b/src/main/opencode/hook-plugin-dispose-host.test.ts @@ -0,0 +1,165 @@ +/** + * Executes the generated plugin through each OpenCode host entry point, because + * what disposal means differs by host: OpenCode 1 disposes only on instance + * teardown (which cancels every run), OpenCode 2 also on a plugin hot reload. + */ +import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { pathToFileURL } from 'node:url' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' + +const { getPathMock } = vi.hoisted(() => ({ + getPathMock: vi.fn<(name: string) => string>() +})) + +vi.mock('electron', () => ({ + app: { getPath: getPathMock } +})) + +import { _internals } from './hook-service' + +type PluginHooks = { + event: (input: { event: unknown }) => Promise + dispose?: () => Promise +} +type HostEvent = { type: string; data: Record } +type PluginModule = { + default?: { + server?: (ctx: unknown) => Promise + setup?: (ctx: unknown) => Promise<() => Promise> + } +} + +const ENV_KEYS = [ + 'ORCA_PANE_KEY', + 'ORCA_OPENCODE_AGENT', + 'ORCA_AGENT_HOOK_ENDPOINT', + 'ORCA_AGENT_HOOK_PORT', + 'ORCA_AGENT_HOOK_TOKEN' +] as const + +// A live OpenCode 2 event bus: stays open until the subscriber aborts. +function createEventBus(): { + push: (event: HostEvent) => void + subscribe: (input: { signal: AbortSignal }) => AsyncGenerator +} { + const queue: HostEvent[] = [] + let wake: (() => void) | null = null + return { + push(event) { + queue.push(event) + wake?.() + }, + async *subscribe({ signal }) { + while (!signal.aborted) { + const next = queue.shift() + if (next) { + yield next + continue + } + await new Promise((resolve) => { + wake = resolve + signal.addEventListener('abort', () => resolve(), { once: true }) + }) + wake = null + } + } + } +} + +describe.each(['opencode', 'opencode2'] as const)('%s plugin disposal by host', (agent) => { + let tempDir: string + let savedEnv: Record + let names: string[] + + beforeEach(() => { + tempDir = mkdtempSync(join(tmpdir(), 'orca-opencode-dispose-host-')) + savedEnv = {} + for (const key of ENV_KEYS) { + savedEnv[key] = process.env[key] + } + process.env.ORCA_PANE_KEY = 'tab-1:leaf-1' + process.env.ORCA_OPENCODE_AGENT = agent + delete process.env.ORCA_AGENT_HOOK_ENDPOINT + process.env.ORCA_AGENT_HOOK_PORT = '59999' + process.env.ORCA_AGENT_HOOK_TOKEN = 'test-token' + names = [] + vi.stubGlobal( + 'fetch', + vi.fn(async (_input: RequestInfo | URL, init?: RequestInit) => { + names.push(String(JSON.parse(String(init?.body)).payload?.hook_event_name)) + return new Response('{}', { status: 200 }) + }) + ) + }) + + afterEach(() => { + vi.unstubAllGlobals() + for (const key of ENV_KEYS) { + if (savedEnv[key] === undefined) { + delete process.env[key] + } else { + process.env[key] = savedEnv[key] + } + } + rmSync(tempDir, { recursive: true, force: true }) + }) + + async function loadPluginModule(): Promise { + const pluginPath = join(tempDir, `orca-${agent}-status.mjs`) + writeFileSync( + pluginPath, + agent === 'opencode2' + ? _internals.getOpenCode2PluginSource() + : _internals.getOpenCodePluginSource() + ) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the generated plugin module exports this shape. + return (await import(pathToFileURL(pluginPath).href)) as PluginModule + } + + function setupContext(bus: ReturnType): unknown { + return { + session: { + get: async ({ sessionID }: { sessionID: string }) => ({ id: sessionID }), + hook: async () => ({ dispose: async () => {} }) + }, + event: { subscribe: bus.subscribe } + } + } + + it('publishes a final Idle when the OpenCode 1 instance tears down mid-turn', async () => { + const module = await loadPluginModule() + const hooks = await module.default?.server?.({ + client: { session: { get: async () => ({ data: { id: 'ses_root' } }) } } + }) + await hooks?.event({ + event: { + type: 'session.status', + properties: { sessionID: 'ses_root', status: { type: 'busy' } } + } + }) + await hooks?.dispose?.() + + expect(names).toEqual(['SessionBusy', 'SessionIdle']) + }) + + it('keeps the pane Working when OpenCode 2 reloads the plugin mid-turn', async () => { + const module = await loadPluginModule() + const firstBus = createEventBus() + const firstCleanup = await module.default?.setup?.(setupContext(firstBus)) + firstBus.push({ type: 'session.execution.started', data: { sessionID: 'ses_root' } }) + await vi.waitFor(() => expect(names).toEqual(['SessionBusy'])) + + await firstCleanup?.() + expect(names).toEqual(['SessionBusy']) + + // The turn kept running; its end reaches the reloaded plugin. + const secondBus = createEventBus() + const secondCleanup = await module.default?.setup?.(setupContext(secondBus)) + secondBus.push({ type: 'session.execution.succeeded', data: { sessionID: 'ses_root' } }) + await vi.waitFor(() => expect(names).toEqual(['SessionBusy', 'SessionIdle'])) + await secondCleanup?.() + expect(names).toEqual(['SessionBusy', 'SessionIdle']) + }) +}) diff --git a/src/main/opencode/hook-service.test.ts b/src/main/opencode/hook-service.test.ts index 66fb3c86a47d..e99550c59ea5 100644 --- a/src/main/opencode/hook-service.test.ts +++ b/src/main/opencode/hook-service.test.ts @@ -97,11 +97,11 @@ describe('OpenCode hook plugin source', () => { const digest = (source: string): string => createHash('sha256').update(source).digest('hex') expect(digest(getOpenCodePluginSource())).toBe( - 'c81893814f08bfb2f9b5c133c5355b53d485982402d89e92ff15fc4e7d543079' + '655d603f31c3e4462b4c600861833cbdba9dd541f693e11a349e7a57b8c059d7' ) expect( digest(getOpenCodeFamilyPluginSource('/hook/mimo-code', { emitSessionStart: false })) - ).toBe('2267e2ab6e854e71c9bae12afed97e464f93b2b14f3e25dca133ca6666c98752') + ).toBe('d36d869823cc3dd506565e0512beb278fe4fd6533bd12be30bd98db140ca9f3e') }) it('filters child sessions via parentID lookup before forwarding events', () => { @@ -294,6 +294,51 @@ describe('OpenCodeHookService buildPtyEnv / clearPty round-trip', () => { expect(pluginSource).toContain('messageID: part.messageID') }) + // Why: OpenCode 2 reloads a plugin whose file mtime changed, which restarted status mid-turn. + it('leaves a current installed plugin untouched and replaces a stale one', () => { + const service = new OpenCodeHookService() + service.buildPtyEnv(daemonSessionId) + const pluginPath = join(resolveOpenCodeConfigDirectory(), 'plugins', 'orca-opencode-status.js') + const past = new Date('2020-01-01T00:00:00Z') + utimesSync(pluginPath, past, past) + + service.buildPtyEnv(daemonSessionId) + expect(statSync(pluginPath).mtimeMs).toBe(past.getTime()) + + writeFileSync(pluginPath, 'stale plugin') + service.buildPtyEnv(daemonSessionId) + expect(readFileSync(pluginPath, 'utf8')).toBe(_internals.getOpenCodePluginSource()) + }) + + // Why: OpenCode 2 loads through a file-level symlink (dotfile managers) and stats its target. + it.skipIf(process.platform === 'win32')( + 'compares a symlinked plugin by its target and writes through only when stale', + () => { + const service = new OpenCodeHookService() + const pluginPath = join( + resolveOpenCodeConfigDirectory(), + 'plugins', + 'orca-opencode-status.js' + ) + const targetPath = join(userDataDir, 'dotfiles-orca-opencode-status.js') + writeFileSync(targetPath, _internals.getOpenCodePluginSource()) + rmSync(pluginPath, { force: true }) + symlinkSync(targetPath, pluginPath) + const past = new Date('2020-01-01T00:00:00Z') + utimesSync(targetPath, past, past) + + service.buildPtyEnv(daemonSessionId) + expect(statSync(targetPath).mtimeMs).toBe(past.getTime()) + + writeFileSync(targetPath, 'stale plugin') + service.buildPtyEnv(daemonSessionId) + expect(lstatSync(pluginPath).isSymbolicLink()).toBe(true) + expect(readFileSync(targetPath, 'utf8')).toBe(_internals.getOpenCodePluginSource()) + rmSync(pluginPath, { force: true }) + rmSync(targetPath, { force: true }) + } + ) + // Why: #22234 — OpenCode 2 installs under the plain `opencode` name, and its loader // rejects a default export that only has server(). Asserting the emitted *source* is // not enough; the installed file is what the v2 server validates, so load it. @@ -700,6 +745,19 @@ describe('OpenCodeHookService overlay mode (user OPENCODE_CONFIG_DIR set)', () = expectUserConfigIntact() }) + it('leaves a current overlay plugin file in place across spawns', () => { + const service = new OpenCodeHookService() + const overlayDir = service.buildPtyEnv(ptyId, userConfigDir).OPENCODE_CONFIG_DIR! + const pluginPath = join(overlayDir, 'plugins', 'orca-opencode-status.js') + const past = new Date('2020-01-01T00:00:00Z') + utimesSync(pluginPath, past, past) + + service.buildPtyEnv(ptyId, userConfigDir) + + expect(statSync(pluginPath).mtimeMs).toBe(past.getTime()) + expect(readFileSync(pluginPath, 'utf8')).toBe(_internals.getOpenCodePluginSource()) + }) + it('reconciles stale mirrored entries while preserving OpenCode runtime files', () => { const service = new OpenCodeHookService() const firstEnv = service.buildPtyEnv(ptyId, userConfigDir) diff --git a/src/main/opencode/hook-service.ts b/src/main/opencode/hook-service.ts index e7ec0cc8b2ff..74f24577c6ed 100644 --- a/src/main/opencode/hook-service.ts +++ b/src/main/opencode/hook-service.ts @@ -28,6 +28,10 @@ import { OPENCODE2_LEGACY_HOOKS_DIR, OPENCODE_LEGACY_HOOKS_DIR } from './legacy-shared-config-dir' +import { + isInstalledOpenCodePluginCurrent, + isOverlayOpenCodePluginCurrent +} from '../../shared/opencode-installed-plugin' const ORCA_OPENCODE_PLUGIN_FILE = 'orca-opencode-status.js' const OPENCODE_OVERLAY_DIR = 'opencode-config-overlays' @@ -278,18 +282,25 @@ export class OpenCodeHookService { const pluginsDir = join(overlayDir, 'plugins') mkdirSync(pluginsDir, { recursive: true }) const pluginPath = join(pluginsDir, this.pluginFileName) - try { - unlinkSync(pluginPath) - } catch { - // File may not exist on a fresh overlay; a real failure surfaces on writeFileSync below. + const source = this.pluginSource() + if (!isOverlayOpenCodePluginCurrent(pluginPath, source)) { + try { + unlinkSync(pluginPath) + } catch { + // File may not exist on a fresh overlay; a real failure surfaces on writeFileSync below. + } + writeFileSync(pluginPath, source) } - writeFileSync(pluginPath, this.pluginSource()) } private writePluginToConfigDir(configDir: string): void { const pluginsDir = join(configDir, 'plugins') mkdirSync(pluginsDir, { recursive: true }) - writeFileSync(join(pluginsDir, this.pluginFileName), this.pluginSource()) + const pluginPath = join(pluginsDir, this.pluginFileName) + const source = this.pluginSource() + if (!isInstalledOpenCodePluginCurrent(pluginPath, source)) { + writeFileSync(pluginPath, source) + } } } diff --git a/src/main/opencode/status-plugin-factory-source.ts b/src/main/opencode/status-plugin-factory-source.ts index 8348cc968eb7..218d15c3e41f 100644 --- a/src/main/opencode/status-plugin-factory-source.ts +++ b/src/main/opencode/status-plugin-factory-source.ts @@ -23,6 +23,7 @@ export function getStatusPluginFactorySource(options: { 'export const OrcaOpenCodeStatusPlugin = async (_ctx) => {', ` if (process.env.ORCA_OPENCODE_AGENT && process.env.ORCA_OPENCODE_AGENT !== '${expectedAgent}') return {};`, ' const client = _ctx?.client;', + ' const sessionsOutliveDispose = _ctx?.sessionsOutliveDispose === true;', ' const factoryID = ++nextFactoryID;', ' activeFactoryIDs.add(factoryID);', ' let disposed = false;', @@ -242,7 +243,14 @@ export function getStatusPluginFactorySource(options: { ' pendingAssistantPart = null;', ' }', ' const ownsDeliveredMessagePart = deliveredMessagePartFactoryID === factoryID;', - ' if (desiredFactoryID === factoryID || ownsDeliveredMessagePart) {', + ' // Why: OpenCode 1 disposes only on instance teardown, which cancels every run, so a final', + ' // Idle is true. OpenCode 2 also disposes on a hot reload mid-turn, so it publishes nothing.', + ' if (sessionsOutliveDispose) {', + ' if (desiredFactoryID === factoryID) {', + ' clearStatusRetry();', + ' statusRevision += 1;', + ' }', + ' } else if (desiredFactoryID === factoryID || ownsDeliveredMessagePart) {', ' clearStatusRetry();', ' statusRevision += 1;', ' // A MessagePart may have changed the listener to Working after the', @@ -250,17 +258,13 @@ export function getStatusPluginFactorySource(options: { ' statusDeliveryDirty = ownsDeliveredMessagePart;', ' busyRecoveryUsed = false;', ' busyRecoveryEndpointKey = "";', - ' const fallbackFactoryID = Array.from(activeFactoryIDs).find(', - ' (id) => id !== factoryID', - ' );', + ' const fallbackFactoryID = Array.from(activeFactoryIDs).find((id) => id !== factoryID);', ' if (fallbackFactoryID !== undefined) {', ' await publishAggregateStatus(', ' fallbackFactoryID,', ' desiredStatusProperties?.sessionID', ' );', ' } else {', - ' // Why: Instance disposal can happen while the PTY stays alive;', - ' // publish a final idle so Orca does not retain a dead owner.', ' if (!deliveredStatusKey.startsWith("idle:") || ownsDeliveredMessagePart) {', ' await setStatus(', ' "idle",', diff --git a/src/main/opencode2/status-plugin-setup-source.ts b/src/main/opencode2/status-plugin-setup-source.ts index c68c15cbda2c..7b825056ecd8 100644 --- a/src/main/opencode2/status-plugin-setup-source.ts +++ b/src/main/opencode2/status-plugin-setup-source.ts @@ -24,7 +24,8 @@ async function setupOpenCode2Status(ctx) { // Without it, resolveRootSessionID returns null for every session and a // subagent's work publishes as if it were the root's. const client = { session: { get: async (input, options) => { const result = await ctx.session.get(input, options); return result && typeof result.id === "string" ? { data: result } : result; } } }; - hooks = await OrcaOpenCodeStatusPlugin({ client }); + // Why: this host disposes plugins on a hot reload while turns keep running. + hooks = await OrcaOpenCodeStatusPlugin({ client, sessionsOutliveDispose: true }); if (!hooks || typeof hooks.event !== "function") return noop; const promptRegistration = await ctx.session.hook("prompt", async (properties) => { await hooks.event({ event: { type: "session.next.prompt.admitted", properties } }); diff --git a/src/relay/opencode-canonical-config.ts b/src/relay/opencode-canonical-config.ts index 4bcb9f3e151a..38682d3f2746 100644 --- a/src/relay/opencode-canonical-config.ts +++ b/src/relay/opencode-canonical-config.ts @@ -1,6 +1,7 @@ import { mkdirSync, unlinkSync, writeFileSync } from 'node:fs' import { isAbsolute, join, relative, resolve } from 'node:path' import { resolveOpenCodeConfigDirectory } from '../shared/opencode-config-directory' +import { isInstalledOpenCodePluginCurrent } from '../shared/opencode-installed-plugin' const RELAY_HOOKS_DIR = '.orca-relay' @@ -18,12 +19,14 @@ export function installOpenCodePluginInCanonicalConfig( agent === 'opencode2' ? 'orca-opencode2-status.js' : 'orca-opencode-status.js' const pluginPath = join(configDir, 'plugins', pluginFileName) mkdirSync(join(configDir, 'plugins'), { recursive: true }) - try { - unlinkSync(pluginPath) - } catch { - // The file may not exist on the first install. + if (!isInstalledOpenCodePluginCurrent(pluginPath, source)) { + try { + unlinkSync(pluginPath) + } catch { + // The file may not exist on the first install. + } + writeFileSync(pluginPath, source) } - writeFileSync(pluginPath, source) return true } catch (err) { process.stderr.write( diff --git a/src/relay/plugin-overlay.test.ts b/src/relay/plugin-overlay.test.ts index 14feb631876c..d4d38a31fba5 100644 --- a/src/relay/plugin-overlay.test.ts +++ b/src/relay/plugin-overlay.test.ts @@ -1,12 +1,15 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest' import { existsSync, + lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, + statSync, symlinkSync, + utimesSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' @@ -74,6 +77,50 @@ describe('PluginOverlayManager', () => { ).toBe('v2 plugin') }) + // Why: OpenCode 2 reloads a plugin whose file mtime changed, even with unchanged bytes. + it('leaves a current canonical plugin untouched and replaces a stale one', () => { + const env = { XDG_CONFIG_HOME: join(homeDir, 'xdg') } + const pluginPath = join(homeDir, 'xdg', 'opencode', 'plugins', 'orca-opencode2-status.js') + manager.setSources({ opencode2PluginSource: 'v2 plugin' }) + manager.installOpenCodePlugin('opencode2', env) + const past = new Date('2020-01-01T00:00:00Z') + utimesSync(pluginPath, past, past) + + expect(manager.installOpenCodePlugin('opencode2', env)).toBe(true) + expect(statSync(pluginPath).mtimeMs).toBe(past.getTime()) + + manager.setSources({ opencode2PluginSource: 'v2 plugin, next release' }) + expect(manager.installOpenCodePlugin('opencode2', env)).toBe(true) + expect(readFileSync(pluginPath, 'utf8')).toBe('v2 plugin, next release') + }) + + // Why: OpenCode 2 loads through a file-level symlink (dotfile managers) and stats its target. + it.skipIf(process.platform === 'win32')( + 'leaves a symlinked canonical plugin with current bytes untouched', + () => { + const env = { XDG_CONFIG_HOME: join(homeDir, 'xdg') } + const pluginsDir = join(homeDir, 'xdg', 'opencode', 'plugins') + const pluginPath = join(pluginsDir, 'orca-opencode2-status.js') + const targetPath = join(homeDir, 'dotfiles-orca-opencode2-status.js') + mkdirSync(pluginsDir, { recursive: true }) + writeFileSync(targetPath, 'v2 plugin') + symlinkSync(targetPath, pluginPath) + const past = new Date('2020-01-01T00:00:00Z') + utimesSync(targetPath, past, past) + manager.setSources({ opencode2PluginSource: 'v2 plugin' }) + + expect(manager.installOpenCodePlugin('opencode2', env)).toBe(true) + expect(lstatSync(pluginPath).isSymbolicLink()).toBe(true) + expect(statSync(targetPath).mtimeMs).toBe(past.getTime()) + + manager.setSources({ opencode2PluginSource: 'v2 plugin, next release' }) + expect(manager.installOpenCodePlugin('opencode2', env)).toBe(true) + expect(lstatSync(pluginPath).isFile()).toBe(true) + expect(readFileSync(pluginPath, 'utf8')).toBe('v2 plugin, next release') + expect(readFileSync(targetPath, 'utf8')).toBe('v2 plugin') + } + ) + it('mirrors a preexisting remote OpenCode config dir before adding Orca plugin', () => { const userConfigDir = join(homeDir, 'company-opencode') mkdirSync(join(userConfigDir, 'plugins'), { recursive: true }) diff --git a/src/shared/opencode-installed-plugin.test.ts b/src/shared/opencode-installed-plugin.test.ts new file mode 100644 index 000000000000..d7814c1229b8 --- /dev/null +++ b/src/shared/opencode-installed-plugin.test.ts @@ -0,0 +1,47 @@ +import { mkdtempSync, rmSync, symlinkSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import { + isInstalledOpenCodePluginCurrent, + isOverlayOpenCodePluginCurrent +} from './opencode-installed-plugin' + +describe('installed OpenCode plugin currency', () => { + let dir: string + let pluginPath: string + + beforeEach(() => { + dir = mkdtempSync(join(tmpdir(), 'orca-opencode-installed-plugin-')) + pluginPath = join(dir, 'orca-opencode-status.js') + }) + + afterEach(() => { + rmSync(dir, { recursive: true, force: true }) + }) + + it('treats a missing or different file as stale', () => { + expect(isInstalledOpenCodePluginCurrent(pluginPath, 'plugin')).toBe(false) + expect(isOverlayOpenCodePluginCurrent(pluginPath, 'plugin')).toBe(false) + writeFileSync(pluginPath, 'older plugin') + expect(isInstalledOpenCodePluginCurrent(pluginPath, 'plugin')).toBe(false) + expect(isOverlayOpenCodePluginCurrent(pluginPath, 'plugin')).toBe(false) + }) + + it('treats a regular file with the same bytes as current', () => { + writeFileSync(pluginPath, 'plugin') + expect(isInstalledOpenCodePluginCurrent(pluginPath, 'plugin')).toBe(true) + expect(isOverlayOpenCodePluginCurrent(pluginPath, 'plugin')).toBe(true) + }) + + it.skipIf(process.platform === 'win32')( + 'follows a symlink except in an overlay, where a link is a mirrored user entry', + () => { + const targetPath = join(dir, 'target.js') + writeFileSync(targetPath, 'plugin') + symlinkSync(targetPath, pluginPath) + expect(isInstalledOpenCodePluginCurrent(pluginPath, 'plugin')).toBe(true) + expect(isOverlayOpenCodePluginCurrent(pluginPath, 'plugin')).toBe(false) + } + ) +}) diff --git a/src/shared/opencode-installed-plugin.ts b/src/shared/opencode-installed-plugin.ts new file mode 100644 index 000000000000..33a80f4d1683 --- /dev/null +++ b/src/shared/opencode-installed-plugin.ts @@ -0,0 +1,22 @@ +import { lstatSync } from 'node:fs' +import { nodeFileContentsEqualSync } from './node-file-content-equality' + +// Why: OpenCode 2 reloads a plugin (and every plugin loaded after it) when its file's mtime changes, +// even with identical bytes, so installers must skip the write when Orca's plugin is already current. +// Follows symlinks: OpenCode 2 loads through them, so a linked file with Orca's bytes is current. +export function isInstalledOpenCodePluginCurrent(pluginPath: string, source: string): boolean { + try { + return nodeFileContentsEqualSync(pluginPath, source) + } catch { + return false + } +} + +// Overlay variant: a symlink there mirrors a user entry, never Orca's file, even when the bytes match. +export function isOverlayOpenCodePluginCurrent(pluginPath: string, source: string): boolean { + try { + return lstatSync(pluginPath).isFile() && nodeFileContentsEqualSync(pluginPath, source) + } catch { + return false + } +} From e899809ff88a29af6b00a9dff38d54f1df1f120f Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:15:39 -0700 Subject: [PATCH 62/90] fix(mobile): unsubscribe session tabs by request on the direct connection (#22943) * fix(mobile): unsubscribe session tabs by request on the direct connection * fix(mobile): hold a direct session tabs unsubscribe until the first snapshot The desktop registers a tab-list stream only as it emits the first snapshot. A direct unsubscribe sent before that found nothing, and with per-request addressing no later worktree-wide sweep collects the late stream, so it kept its desktop listener until the socket closed. Hold the unsubscribe until the snapshot arrives, as the relay connection does. * test(mobile): cover a held session tabs unsubscribe whose subscribe fails * fix(mobile): keep the session tabs hold within the registry line budget after merging main Move the pre-snapshot hold into the session tabs stream module, note that only older hosts need it, and give the unsubscribe test the real registration version now that a worktree-wide unsubscribe spares later streams. --- .../rpc-client-session-tabs-stream.ts | 34 +++++++ .../rpc-client-stream-registry.test.ts | 98 +++++++++++++++++++ .../transport/rpc-client-stream-registry.ts | 9 ++ mobile/src/transport/rpc-client.test.ts | 17 +++- .../rpc-subscription-result-shapes.ts | 4 + .../methods/session-tabs-unsubscribe.test.ts | 55 ++++++++++- 6 files changed, 211 insertions(+), 6 deletions(-) create mode 100644 mobile/src/transport/rpc-client-session-tabs-stream.ts diff --git a/mobile/src/transport/rpc-client-session-tabs-stream.ts b/mobile/src/transport/rpc-client-session-tabs-stream.ts new file mode 100644 index 000000000000..f98a7586921d --- /dev/null +++ b/mobile/src/transport/rpc-client-session-tabs-stream.ts @@ -0,0 +1,34 @@ +import { isSnapshotResult } from './rpc-subscription-result-shapes' + +type SessionTabsStreamState = { + method: string + sent?: boolean + receivedSnapshot?: boolean + cancelled?: boolean +} + +/** Older hosts register a tabs stream only as they emit the first snapshot, so an earlier unsubscribe + * finds nothing there. Newer hosts register on arrival and still send that snapshot, so the hold only delays. */ +function awaitsRegistration(stream: SessionTabsStreamState): boolean { + return ( + stream.method === 'session.tabs.subscribe' && stream.sent === true && !stream.receivedSnapshot + ) +} + +/** Cancels a stream still awaiting its first snapshot; that snapshot then triggers the unsubscribe. */ +export function holdUnsubscribe(stream: SessionTabsStreamState): boolean { + if (!awaitsRegistration(stream)) { + return false + } + stream.cancelled = true + return true +} + +/** Returns true when `result` is the tabs stream's snapshot, i.e. the host has registered it. */ +export function recordSnapshot(stream: SessionTabsStreamState, result: unknown): boolean { + if (stream.method !== 'session.tabs.subscribe' || !isSnapshotResult(result)) { + return false + } + stream.receivedSnapshot = true + return true +} diff --git a/mobile/src/transport/rpc-client-stream-registry.test.ts b/mobile/src/transport/rpc-client-stream-registry.test.ts index 6afcd8a7ef35..ce2103336189 100644 --- a/mobile/src/transport/rpc-client-stream-registry.test.ts +++ b/mobile/src/transport/rpc-client-stream-registry.test.ts @@ -79,6 +79,104 @@ describe('RpcClientStreamRegistry', () => { ]) }) + it('unsubscribes a session tabs stream by its own request id', () => { + const { registry, sent } = createRegistry() + const disposeOlder = registry.subscribe( + 'session.tabs.subscribe', + { worktree: 'wt-1' }, + () => {} + ) + registry.subscribe('session.tabs.subscribe', { worktree: 'wt-1' }, () => {}) + const [older, newer] = sent + registry.handleResponse(streamingResponse(older!.id, { type: 'snapshot', tabs: [] })) + + disposeOlder() + + // Without the request id the host sweeps every stream for the worktree, including the newer one. + expect(sent[2]).toMatchObject({ + method: 'session.tabs.unsubscribe', + params: { worktree: 'wt-1', subscriptionId: older!.id } + }) + expect(newer!.id).not.toBe(older!.id) + expect(sent).toHaveLength(3) + }) + + it('holds a session tabs unsubscribe until the host registers the stream', () => { + const { registry, sent } = createRegistry() + const events: unknown[] = [] + const dispose = registry.subscribe('session.tabs.subscribe', { worktree: 'wt-1' }, (event) => + events.push(event) + ) + const subscribe = sent[0]! + + dispose() + // Older hosts register only as they emit the first snapshot, so an earlier unsubscribe finds nothing. + expect(sent).toHaveLength(1) + + registry.handleResponse(streamingResponse(subscribe.id, { type: 'snapshot', tabs: [] })) + + expect(sent[1]).toMatchObject({ + method: 'session.tabs.unsubscribe', + params: { worktree: 'wt-1', subscriptionId: subscribe.id } + }) + // A host that registered on arrival ends the stream; that end must not unsubscribe again. + registry.handleResponse(streamingResponse(subscribe.id, { type: 'end' })) + expect(sent).toHaveLength(2) + expect(events).toEqual([]) + expect(registry.size()).toBe(0) + }) + + it('holds a session tabs unsubscribe again after a reconnect replays the stream', () => { + const { registry, sent } = createRegistry() + const dispose = registry.subscribe('session.tabs.subscribe', { worktree: 'wt-1' }, () => {}) + const subscribe = sent[0]! + registry.handleResponse(streamingResponse(subscribe.id, { type: 'snapshot', tabs: [] })) + + registry.markForReplay() + registry.replayAfterAuthentication() + dispose() + + expect(sent.map((request) => request.method)).toEqual([ + 'session.tabs.subscribe', + 'session.tabs.subscribe' + ]) + registry.handleResponse(streamingResponse(subscribe.id, { type: 'snapshot', tabs: [] })) + expect(sent[2]).toMatchObject({ + method: 'session.tabs.unsubscribe', + params: { worktree: 'wt-1', subscriptionId: subscribe.id } + }) + }) + + it('drops a held session tabs unsubscribe when the subscribe fails or reconnects first', () => { + const { registry, sent } = createRegistry() + const events: unknown[] = [] + const disposeFailed = registry.subscribe( + 'session.tabs.subscribe', + { worktree: 'wt-1' }, + (event) => events.push(event) + ) + const disposeReplayed = registry.subscribe( + 'session.tabs.subscribe', + { worktree: 'wt-2' }, + () => {} + ) + const failed = sent[0]! + disposeFailed() + disposeReplayed() + + registry.handleResponse({ + id: failed.id, + ok: false, + error: { code: 'worktree_not_found', message: 'Worktree not found' } + }) + registry.markForReplay() + registry.replayAfterAuthentication() + + expect(sent).toHaveLength(2) + expect(events).toEqual([]) + expect(registry.size()).toBe(0) + }) + it('ends one transcript stream on dispose and leaves a sibling on the same socket (U-03)', () => { const { registry, sent } = createRegistry() const disposeFirst = registry.subscribe('agentSession.subscribe', { sessionId: 's1' }, () => {}) diff --git a/mobile/src/transport/rpc-client-stream-registry.ts b/mobile/src/transport/rpc-client-stream-registry.ts index ebfdb7419970..4062e80b49b5 100644 --- a/mobile/src/transport/rpc-client-stream-registry.ts +++ b/mobile/src/transport/rpc-client-stream-registry.ts @@ -14,6 +14,7 @@ import { isTerminalSubscribedResult } from './rpc-subscription-result-shapes' import { RpcClientTerminalStreamRouter } from './rpc-client-terminal-stream-router' +import * as sessionTabsStream from './rpc-client-session-tabs-stream' import type { ConnectionState, RpcResponse, RpcSuccess } from './types' export type RpcStreamingListener = (result: unknown) => void @@ -30,6 +31,7 @@ type StreamRequest = { subscriptionId?: string cancelled?: boolean sent?: boolean + receivedSnapshot?: boolean } type StreamRegistryOptions = { @@ -108,6 +110,7 @@ export class RpcClientStreamRegistry { this.pendingBrowserRequestId = null for (const [id, stream] of this.streams) { stream.sent = false + stream.receivedSnapshot = false // The id named a registration on the closed socket; the replay's ready brings the new one. stream.subscriptionId = undefined this.resetTerminalRouting(id) @@ -169,6 +172,10 @@ export class RpcClientStreamRegistry { return } const result = response.result + if (sessionTabsStream.recordSnapshot(stream, result) && stream.cancelled) { + this.dispose(response.id) + return + } if (isStreamingSubscriptionReadyResult(result)) { stream.subscriptionId = result.subscriptionId if (stream.cancelled) { @@ -215,6 +222,8 @@ export class RpcClientStreamRegistry { // Why: `requestId` names this exact request; hosts that predate it strip it and use the slot. this.sendRpc('terminal.unsubscribe', { ...params, requestId: id }) } + } else if (stream && sessionTabsStream.holdUnsubscribe(stream)) { + return } else { const unsubscribe = buildStreamUnsubscribe(stream?.method, stream?.params, id) if (unsubscribe) { diff --git a/mobile/src/transport/rpc-client.test.ts b/mobile/src/transport/rpc-client.test.ts index e88e6c220e6c..ff290f72b84c 100644 --- a/mobile/src/transport/rpc-client.test.ts +++ b/mobile/src/transport/rpc-client.test.ts @@ -196,12 +196,21 @@ describe('mobile rpc-client connection timeout', () => { { worktree: 'id:wt-1' }, () => {} ) + const request = sentRequest(socket, 'session.tabs.subscribe') + socket.receive( + `encrypted:${JSON.stringify({ + id: request.id, + ok: true, + streaming: true, + result: { type: 'snapshot', worktree: 'id:wt-1', tabs: [] }, + _meta: { runtimeId: 'r1' } + })}` + ) unsubscribe() - expect( - socket.sent.some((payload) => payload.includes('"method":"session.tabs.unsubscribe"')) - ).toBe(true) - expect(socket.sent.some((payload) => payload.includes('"worktree":"id:wt-1"'))).toBe(true) + expect(sentRequests(socket, 'session.tabs.unsubscribe')).toEqual([ + expect.objectContaining({ params: { worktree: 'id:wt-1', subscriptionId: request.id } }) + ]) client.close() }) diff --git a/mobile/src/transport/rpc-subscription-result-shapes.ts b/mobile/src/transport/rpc-subscription-result-shapes.ts index cf09acdb6ca6..4c624658126a 100644 --- a/mobile/src/transport/rpc-subscription-result-shapes.ts +++ b/mobile/src/transport/rpc-subscription-result-shapes.ts @@ -19,3 +19,7 @@ export function isStreamingSubscriptionReadyResult( typeof (value as { subscriptionId?: unknown }).subscriptionId === 'string' ) } + +export function isSnapshotResult(value: unknown): value is { type: 'snapshot' } { + return typeof value === 'object' && value !== null && 'type' in value && value.type === 'snapshot' +} diff --git a/src/main/runtime/rpc/methods/session-tabs-unsubscribe.test.ts b/src/main/runtime/rpc/methods/session-tabs-unsubscribe.test.ts index 8490181d0eab..021224bd6497 100644 --- a/src/main/runtime/rpc/methods/session-tabs-unsubscribe.test.ts +++ b/src/main/runtime/rpc/methods/session-tabs-unsubscribe.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import type { OrcaRuntimeService } from '../../orca-runtime' +import { RuntimeSubscriptionRegistry } from '../../runtime-subscription-registry' import { RpcDispatcher } from '../dispatcher' import { SESSION_TAB_METHODS } from './session-tabs' @@ -61,11 +62,61 @@ describe('session tab unsubscribe RPC methods', () => { expect(cleanupSubscription).toHaveBeenCalledWith('session.tabs:conn-1:*:sub-all-1') expect(cleanupSubscriptionsByPrefix).not.toHaveBeenCalled() }) + + it('ends only the named stream when a newer one watches the same worktree', async () => { + const { dispatcher, ends } = await subscribeTwiceToOneWorktree() + + await dispatcher.dispatchStreaming( + request('session.tabs.unsubscribe', { worktree: 'id:wt-1', subscriptionId: 'sub-old' }), + vi.fn(), + { connectionId: 'conn-1' } + ) + + await vi.waitFor(() => expect(ends['sub-old']).toBe(1)) + expect(ends['sub-new']).toBe(0) + }) + + it('ends every stream for the worktree when the unsubscribe names no request', async () => { + const { dispatcher, ends } = await subscribeTwiceToOneWorktree() + + await dispatcher.dispatchStreaming( + request('session.tabs.unsubscribe', { worktree: 'id:wt-1' }), + vi.fn(), + { connectionId: 'conn-1' } + ) + + await vi.waitFor(() => expect(ends).toEqual({ 'sub-old': 1, 'sub-new': 1 })) + }) }) +async function subscribeTwiceToOneWorktree() { + const registry = new RuntimeSubscriptionRegistry() + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: Partial runtime backed by the real subscription registry; it supplies every member session.tabs subscribe/unsubscribe call. + const runtime = { + ...runtimeWithCleanup(registry.cleanup.bind(registry), registry.cleanupByPrefix.bind(registry)), + registerSubscriptionCleanup: registry.register.bind(registry), + getSubscriptionRegistrationVersion: registry.getRegistrationVersion.bind(registry), + onMobileSessionTabsChanged: () => () => {} + } as unknown as OrcaRuntimeService + const dispatcher = new RpcDispatcher({ runtime, methods: SESSION_TAB_METHODS }) + const ends: Record = { 'sub-old': 0, 'sub-new': 0 } + for (const id of ['sub-old', 'sub-new']) { + await dispatcher.dispatchStreaming( + { ...request('session.tabs.subscribe', { worktree: 'id:wt-1' }), id }, + (message) => { + if (JSON.parse(message).result?.type === 'end') { + ends[id]! += 1 + } + }, + { connectionId: 'conn-1' } + ) + } + return { dispatcher, ends } +} + function runtimeWithCleanup( - cleanupSubscription: ReturnType, - cleanupSubscriptionsByPrefix = vi.fn() + cleanupSubscription: (id: string) => void, + cleanupSubscriptionsByPrefix: (prefix: string, throughVersion?: number) => void = vi.fn() ): OrcaRuntimeService { // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the unsubscribe methods reach only these members; a missing one throws and fails the test. return { From c5fc0c6f269096a5cc205119b30fa8e345ada027 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:17:07 -0700 Subject: [PATCH 63/90] fix(ci): keep a squash-merged RPC recording pin reachable through its pull request (#23720) * fix(ci): keep a squash-merged RPC recording pin reachable through its pull request Main's "RPC recording pin" check has been red since #22762: that branch pinned the recording corpus to its own commit 03995ae, and the squash-merge left that commit out of main's history. Every behaviour-change squash did the same, and each needed a hand-made repin PR to clear it (#23565, #23535, #23046 and more). The guard now accepts a pin that is either in this history or in the head of the pull request whose squash wrote it into the manifest. It finds that pull request from the `(#n)` subject of the commit that added the pin and fetches `refs/pull//head`, which GitHub keeps after the branch is deleted. The reproduce step uses the same lookup, so it can still check the pinned tree out. * fix(ci): give the recording pin lookup room to walk a blobless clone In CI's blobless clone, `git log -S` fetches the manifest's blobs one commit at a time, a few seconds each. Under the 30 s process default the walk was killed after a handful of manifest commits, which main's history already exceeds (up to 7 manifest commits between a pin landing and the next pin change), and the guard then failed with an empty "Could not find the commit that pinned" error. The lookup and the pull request fetch now carry explicit budgets and say when they timed out. The not-an-ancestor instruction now names the pull request whose head was checked, or says the commit that pinned it names none. Adds the two merge-preview shapes the guard runs on: a branch opened after a squash resolves main's pin through the squash's pull request, and a branch whose rebase dropped its own pinned commit fails on its pull request instead of on main. * fix(mobile): tell a missing recording pin apart from product drift After a squash the pinned commit can live only in its pull request's head, so a clone that never fetched it makes `git diff --quiet ` exit 128. The recorder reported that as "Product sources or lockfile differ from the pinned main baseline", which sends the developer to repin a tree that may match. It now prints git's error and the command that fetches the pin. * fix(ci): ask GitHub which pull request holds a squash-dropped recording pin The recording pin guard found the pull request that keeps a squash-dropped pin by walking main's first-parent history for the commit that wrote the pin into the manifest and reading "(#n)" off its subject. A merger who edits the squash title loses the number, and the push to main turns red anyway. That already happened on main: of the 22 squashes that left a pin outside main's history, #21674's title had no "(#n)". The guard now asks GitHub for the pull requests associated with the pinned commit (GET /repos/{owner}/{repo}/commits/{sha}/pulls) and, for each in turn, fetches refs/pull//head and accepts only when git proves the pin is an ancestor of that head. GitHub only nominates candidates, so a wrong answer can fail the guard but never pass it. The endpoint named the right pull request for all 22 historical cases, #21674 included, and names none for commits a force-push orphaned. This removes the pickaxe walk, its 600 s budget and its lazy blob fetches in a blobless clone, the first-parent subtlety, and the subject regex. A revert that restores an older pull-request-only pin now resolves too, because the lookup is by the pin itself rather than by the commit that last wrote it. CI passes the job token to both guard steps and grants the job pull-requests: read. Local runs work without a token on this public repo and send GITHUB_TOKEN or GH_TOKEN when set. A failed lookup throws with the HTTP status, and names the rate limit when an unauthenticated call is refused. --- .github/workflows/mobile.yml | 22 +- .../mobile-recording-pin-checkout.test.mjs | 9 +- mobile/scripts/rpc-recording-pin-guard.mts | 111 ++------- .../scripts/rpc-recording-pin-guard.test.ts | 233 ++++++++++++++++-- .../rpc-recording-pin-reachability.mts | 204 +++++++++++++++ mobile/scripts/rpc-recording.mts | 10 +- .../src/test-support/rpc-recording/README.md | 12 +- 7 files changed, 483 insertions(+), 118 deletions(-) create mode 100644 mobile/scripts/rpc-recording-pin-reachability.mts diff --git a/.github/workflows/mobile.yml b/.github/workflows/mobile.yml index 7ec322b02036..bc9f8241f94b 100644 --- a/.github/workflows/mobile.yml +++ b/.github/workflows/mobile.yml @@ -41,9 +41,8 @@ on: - 'config/scripts/mobile-test-change-scope*' - 'config/scripts/pr-code-change-scope.mjs' - 'config/scripts/mobile-recording-pin-checkout.test.mjs' - # Why main too: a behaviour-change branch legitimately pins its own last fenced commit, and that - # commit only stops being reachable when the branch squash-merges. The pull_request run cannot - # see that; this one is where the pin guard finds it. + # Why main too: a squash is where a spliced corpus lands, and where a behaviour-change branch's + # own pinned commit leaves main's history for its pull request's head ref, which the guard follows. push: branches: - main @@ -182,6 +181,10 @@ jobs: name: RPC recording pin # Why ARM: pure Node plus git; the golden comparison masks `platform`. runs-on: ubuntu-24.04-arm + # Why pull-requests: the guard asks GitHub which pull requests hold a pin main's history lacks. + permissions: + contents: read + pull-requests: read defaults: run: @@ -191,7 +194,7 @@ jobs: - name: Checkout uses: actions/checkout@v6 with: - # The ancestry verdict is read straight off history. On a shallow checkout + # The reachability verdict is read straight off history. On a shallow checkout # `git merge-base --is-ancestor` answers from grafted parents, so the guard refuses to # answer at all rather than reporting a pass it has no evidence for -- and the pinned tree # below has to be checkable out. @@ -211,12 +214,14 @@ jobs: # Seconds. No `--ref`, so the pin is judged against the same tree it was read out of. On a # pull request that is the merge preview, which already carries main's repins; judging the # branch head instead fails every branch cut before the day's repin, and its instruction would - # tell the author to pin their own head -- creating the break this guard exists to catch. A - # branch that pins its own commit passes here and fails on the push after the squash, which is - # where the pin actually leaves the history. + # tell the author to pin their own head. A branch that pins its own commit still passes on the + # push after the squash: the guard asks GitHub which pull requests hold the pin and fetches + # their `refs/pull//head`, which GitHub keeps for good. The token lifts the API rate limit. - name: Check the recording pin is reachable shell: bash - run: pnpm exec tsx scripts/rpc-recording-pin-guard.mts ancestry + env: + GITHUB_TOKEN: ${{ github.token }} + run: pnpm exec tsx scripts/rpc-recording-pin-guard.mts reachable # ~2 min locally for the record itself, so it is gated rather than run twice over. A pull # request that moves none of the corpus, the manifest or the recorder cannot move this @@ -226,6 +231,7 @@ jobs: - name: Reproduce the corpus from the pinned tree shell: bash env: + GITHUB_TOKEN: ${{ github.token }} PIN_GUARD_BASE: ${{ github.event.pull_request.base.sha }} run: | if [ -n "$PIN_GUARD_BASE" ]; then diff --git a/config/scripts/mobile-recording-pin-checkout.test.mjs b/config/scripts/mobile-recording-pin-checkout.test.mjs index f45db12bdbeb..7ff6251afd6d 100644 --- a/config/scripts/mobile-recording-pin-checkout.test.mjs +++ b/config/scripts/mobile-recording-pin-checkout.test.mjs @@ -19,12 +19,15 @@ it('keeps full ancestry and credentials for lazy pinned-tree reads', () => { expect(job.if).toBeUndefined() expect(workflow.on.push.branches).toEqual(['main']) expect(workflow.concurrency.group).toContain('github.sha') - expect(job.steps.find((step) => step.name === 'Check the recording pin is reachable').run).toBe( - 'pnpm exec tsx scripts/rpc-recording-pin-guard.mts ancestry' - ) + const reachable = job.steps.find((step) => step.name === 'Check the recording pin is reachable') + expect(reachable.run).toBe('pnpm exec tsx scripts/rpc-recording-pin-guard.mts reachable') const reproduce = job.steps.find( (step) => step.name === 'Reproduce the corpus from the pinned tree' ) + // Both steps ask GitHub which pull requests hold a pin main's history lacks. + expect(job.permissions).toEqual({ contents: 'read', 'pull-requests': 'read' }) + expect(reachable.env.GITHUB_TOKEN).toContain('github.token') + expect(reproduce.env.GITHUB_TOKEN).toContain('github.token') expect(reproduce.run).toContain('reproduce --if-changed-since "$PIN_GUARD_BASE"') expect(reproduce.run).toContain( 'else\n pnpm exec tsx scripts/rpc-recording-pin-guard.mts reproduce\nfi' diff --git a/mobile/scripts/rpc-recording-pin-guard.mts b/mobile/scripts/rpc-recording-pin-guard.mts index c7b11a484950..807893dcb285 100644 --- a/mobile/scripts/rpc-recording-pin-guard.mts +++ b/mobile/scripts/rpc-recording-pin-guard.mts @@ -1,10 +1,12 @@ /** * Guards the two claims `mobile/rpc-foundation/goldens` makes about its pin. * - * `ancestry` — `baseline` names a commit in this history. A behaviour-change branch pins its own - * last fenced commit; that commit stops being reachable the moment the branch - * squash-merges, and nobody can run `--record` on main again until a hand-made repin - * lands. Ordinary product drift past a reachable pin is normal and is not a failure. + * `reachable` — `baseline` names a commit this repository keeps: one in this history, or one in + * the head of a pull request GitHub associates with that commit. A behaviour-change + * branch pins its own last fenced commit, which the squash leaves out of main's + * history; `refs/pull//head` outlives the branch, so the pin stays checkable out. + * GitHub only names the candidates; git's ancestry check decides. Ordinary product + * drift past a kept pin is normal and is not a failure. * `reproduce` — the goldens on disk are what the recorder produces from the PINNED tree. The * recording suites replay the corpus against the CURRENT tree on every run, which is * the same claim only while the fenced tree still matches the pin. @@ -17,6 +19,7 @@ import { join, resolve } from 'node:path' import { runProcess } from '../../src/shared/child-process/run-process.ts' import { RECORDING_DRIVERS } from '../src/test-support/rpc-recording/recording-drivers.ts' import { readScenarios } from '../src/test-support/rpc-recording/scenario-input.ts' +import { checkPinReachable, PIN_MANIFEST } from './rpc-recording-pin-reachability.mts' /** The recorder is exempt from the fence, so a reproduction lays the candidate copy over the pin. */ const RECORDER_OVERLAY = 'mobile/src/test-support/rpc-recording' @@ -67,90 +70,11 @@ export function assertReproductionSuitesExist(root: string): void { } } -export type PinAncestryFailure = 'shallow' | 'unreachable' | 'not-an-ancestor' -export type PinAncestryVerdict = - | { ok: true; baseline: string; ref: string } - | { ok: false; baseline: string; ref: string; failure: PinAncestryFailure; message: string } - async function git(cwd: string, args: readonly string[]) { return await runProcess({ program: 'git', args: [...args], cwd }) } function readPinnedBaseline(root: string): string { - return readScenarios(resolve(root, 'mobile/rpc-foundation/pilot-scenarios.json')).baseline -} -export function repinInstruction(baseline: string, ref: string, cause: string): string { - return [ - `The RPC recording corpus is pinned to a commit that ${cause}.`, - '', - ` baseline ${baseline} (mobile/rpc-foundation/pilot-scenarios.json)`, - ` head ${ref}`, - '', - 'Every golden under mobile/rpc-foundation/goldens claims it was recorded from that tree, and', - '`--record` refuses on any other tree, so the corpus cannot be refreshed until the pin names a', - 'commit that is reachable from here. Repin and re-record, both in one commit:', - '', - ` git switch -c repin-rpc-recording ${ref}`, - ` # set "baseline" in mobile/rpc-foundation/pilot-scenarios.json to ${ref}`, - ' ORCA_BACKGROUND_LAUNCH=1 RPC_FOUNDATION_RECORD=1 \\', - ' pnpm --dir mobile exec tsx scripts/rpc-recording.mts --record', - '', - 'Re-record everything: the repin rewrites the `baseline` header of every golden, so a partial', - 'refresh leaves the corpus pinned to two different trees. See', - 'mobile/src/test-support/rpc-recording/README.md, "Recording a behaviour change".' - ].join('\n') -} -const SHALLOW_MESSAGE = [ - 'Cannot judge the recording pin: this is a shallow clone.', - '', - '`git merge-base --is-ancestor` answers from grafted history, so it would report a verdict this', - 'guard has no evidence for. Check out with `fetch-depth: 0`.' -].join('\n') - -export async function checkPinAncestry( - root: string, - baseline: string, - ref: string -): Promise { - const shallow = await git(root, ['rev-parse', '--is-shallow-repository']) - if (shallow.code !== 0) { - throw new Error(`Could not ask git whether the clone is shallow: ${shallow.stderr.trim()}`) - } - if (shallow.stdout.trim() !== 'false') { - return { ok: false, baseline, ref, failure: 'shallow', message: SHALLOW_MESSAGE } - } - const head = await git(root, ['rev-parse', '--verify', '--quiet', `${ref}^{commit}`]) - if (head.code !== 0) { - throw new Error(`Cannot resolve ${ref} to a commit in this repository`) - } - // Resolved, because the instruction below is a command to paste: `HEAD` in it moves with whatever - // the reader has checked out by the time they read the log. - const resolved = head.stdout.trim() - const pinned = await git(root, ['rev-parse', '--verify', '--quiet', `${baseline}^{commit}`]) - if (pinned.code !== 0) { - return { - ok: false, - baseline, - ref, - failure: 'unreachable', - message: repinInstruction(baseline, resolved, 'is not a commit in this repository at all') - } - } - const ancestor = await git(root, ['merge-base', '--is-ancestor', baseline, ref]) - if (ancestor.code === 0) { - return { ok: true, baseline, ref } - } - // Why only 1: git reserves higher codes for real errors, and treating one as "not an ancestor" - // would turn a broken repository into a repin instruction nobody can act on. - if (ancestor.code !== 1) { - throw new Error(`git merge-base --is-ancestor failed: ${ancestor.stderr.trim()}`) - } - return { - ok: false, - baseline, - ref, - failure: 'not-an-ancestor', - message: repinInstruction(baseline, resolved, 'is not an ancestor of this commit') - } + return readScenarios(resolve(root, PIN_MANIFEST)).baseline } /** Whether anything a reproduction reads from the candidate tree moved since `since`. */ @@ -284,18 +208,22 @@ async function main(argv: readonly string[]): Promise { const check = argv[0] const root = resolve(import.meta.dirname, '../..') const baseline = readPinnedBaseline(root) - if (check === 'ancestry') { + if (check === 'reachable') { const ref = argv.includes('--ref') ? argv[argv.indexOf('--ref') + 1] : 'HEAD' if (!ref) { throw new Error('--ref needs a commit') } - const verdict = await checkPinAncestry(root, baseline, ref) + const verdict = await checkPinReachable(root, baseline, ref) if (!verdict.ok) { process.stderr.write(`${verdict.message}\n`) process.exitCode = 1 return } - process.stdout.write(`Recording pin ${baseline} is an ancestor of ${ref}.\n`) + process.stdout.write( + verdict.pullRequest === null + ? `Recording pin ${baseline} is an ancestor of ${ref}.\n` + : `Recording pin ${baseline} is kept by refs/pull/${verdict.pullRequest}/head.\n` + ) return } if (check === 'reproduce') { @@ -313,6 +241,13 @@ async function main(argv: readonly string[]): Promise { return } } + // Also fetches a pin that only its pull request's head still holds, so the checkout can find it. + const verdict = await checkPinReachable(root, baseline, 'HEAD') + if (!verdict.ok) { + process.stderr.write(`${verdict.message}\n`) + process.exitCode = 1 + return + } if (!(await reproduceFromPin(root, baseline))) { process.stderr.write(`\n${REPRODUCTION_FAILURE}\n`) process.exitCode = 1 @@ -322,7 +257,7 @@ async function main(argv: readonly string[]): Promise { return } throw new Error( - 'Usage: rpc-recording-pin-guard.mts ancestry [--ref ]\n | reproduce [--if-changed-since ]' + 'Usage: rpc-recording-pin-guard.mts reachable [--ref ]\n | reproduce [--if-changed-since ]' ) } diff --git a/mobile/scripts/rpc-recording-pin-guard.test.ts b/mobile/scripts/rpc-recording-pin-guard.test.ts index e6154d51c2c8..616034d72b12 100644 --- a/mobile/scripts/rpc-recording-pin-guard.test.ts +++ b/mobile/scripts/rpc-recording-pin-guard.test.ts @@ -1,16 +1,21 @@ import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { dirname, join, resolve } from 'node:path' -import { afterAll, describe, expect, it } from 'vitest' +import { afterAll, afterEach, describe, expect, it, vi } from 'vitest' import { runProcess } from '../../src/shared/child-process/run-process' import { assertReproductionSuitesExist, - checkPinAncestry, corpusProvenanceChanged, removeScratchWorktree, - repinInstruction, REPRODUCTION_SUITES } from './rpc-recording-pin-guard.mts' +import { + checkPinReachable, + gitHubRepositoryFromRemote, + PIN_MANIFEST, + pullRequestsWithCommit, + repinInstruction +} from './rpc-recording-pin-reachability.mts' const scratch: string[] = [] async function git(cwd: string, ...args: string[]): Promise { @@ -54,6 +59,50 @@ async function seedProvenance(repository: string): Promise { return await commitAt(repository, RECORDER_FILE, 'recorder') } const MISSING_SHA = '0123456789abcdef0123456789abcdef01234567' +function pinManifest(baseline: string): string { + return JSON.stringify({ baseline, scenarios: [] }) +} +/** + * A behaviour-change branch that pinned its own commit, squash-merged onto main, with the host + * keeping the branch head at `refs/pull/7/head` the way GitHub does after the branch is gone. + */ +async function squashMergedPin(change: string, subject = `${change} (#7)`) { + const work = await throwawayRepository() + await commit(work, 'one') + await git(work, 'switch', '--quiet', '--create', 'behaviour-change') + const branchPin = await commit(work, change) + await commitAt(work, PIN_MANIFEST, pinManifest(branchPin)) + await git(work, 'switch', '--quiet', 'main') + await git(work, 'merge', '--quiet', '--squash', 'behaviour-change') + await git(work, 'commit', '--quiet', '--no-verify', '--message', subject) + const remote = join(work, '..', 'remote.git') + await git(work, 'init', '--quiet', '--bare', remote) + await git(work, 'push', '--quiet', remote, 'main', 'behaviour-change:refs/pull/7/head') + await git(work, 'branch', '--quiet', '-D', 'behaviour-change') + return { work, remote, branchPin } +} +async function cloneMain(remote: string): Promise { + const clone = join(remote, '..', `clone-${scratch.length}-${Date.now()}`) + await git( + join(remote, '..'), + 'clone', + '--quiet', + '--single-branch', + '--branch', + 'main', + remote, + clone + ) + await git(clone, 'config', 'user.email', 'pin-guard@example.invalid') + await git(clone, 'config', 'user.name', 'Pin Guard') + return clone +} +// Stand-ins for GitHub's "pull requests associated with this commit" answer. +const heldByPullRequest7 = async () => [7] +const heldByNoPullRequest = async () => [] +const unasked = async (): Promise => { + throw new Error('a pin in this history must not send the guard to GitHub') +} // File scope, not per-suite: a suite-local hook fires before the later suites have made theirs. afterAll(async () => { @@ -62,18 +111,18 @@ afterAll(async () => { } }) -describe('recording pin ancestry', () => { +describe('recording pin reachability', () => { it('passes when the pin is the commit itself', async () => { const repository = await throwawayRepository() const first = await commit(repository, 'one') - expect(await checkPinAncestry(repository, first, first)).toMatchObject({ ok: true }) + expect(await checkPinReachable(repository, first, first, unasked)).toMatchObject({ ok: true }) }) it('passes on ordinary drift: the tree has moved on, the pin is still reachable', async () => { const repository = await throwawayRepository() const pin = await commit(repository, 'one') const head = await commit(repository, 'two') - expect(await checkPinAncestry(repository, pin, head)).toMatchObject({ ok: true }) + expect(await checkPinReachable(repository, pin, head, unasked)).toMatchObject({ ok: true }) }) it('passes on a branch that pinned its own commit, judged against that branch', async () => { @@ -82,7 +131,9 @@ describe('recording pin ancestry', () => { await git(repository, 'switch', '--quiet', '--create', 'behaviour-change') const branchPin = await commit(repository, 'two') const branchHead = await commit(repository, 'three') - expect(await checkPinAncestry(repository, branchPin, branchHead)).toMatchObject({ ok: true }) + expect(await checkPinReachable(repository, branchPin, branchHead, unasked)).toMatchObject({ + ok: true + }) }) it('passes a branch cut before main repinned, judged against the merge preview', async () => { @@ -98,29 +149,115 @@ describe('recording pin ancestry', () => { await git(repository, 'merge', '--quiet', '--no-edit', 'main') const preview = await git(repository, 'rev-parse', 'HEAD') // The preview is the tree CI checks out and reads the pin from, so it is the tree to judge. - expect(await checkPinAncestry(repository, mainPin, preview)).toMatchObject({ ok: true }) + expect(await checkPinReachable(repository, mainPin, preview, unasked)).toMatchObject({ + ok: true + }) // The head sha would have failed this ordinary branch, and told the author to repin to it. - expect(await checkPinAncestry(repository, mainPin, branchHead)).toMatchObject({ + expect( + await checkPinReachable(repository, mainPin, branchHead, heldByNoPullRequest) + ).toMatchObject({ ok: false, failure: 'not-an-ancestor' }) }) - it('fails once that branch squash-merges and the pin leaves the history', async () => { + it('passes once that branch squash-merges, through the head its pull request keeps', async () => { + const { remote, branchPin } = await squashMergedPin('two') + // Only main: the branch is deleted, so the pin is nowhere in this clone until it is fetched. + const clone = await cloneMain(remote) + expect(await checkPinReachable(clone, branchPin, 'HEAD', heldByPullRequest7)).toMatchObject({ + ok: true, + pullRequest: 7 + }) + const drifted = await commit(clone, 'later product change on main') + expect(await checkPinReachable(clone, branchPin, drifted, heldByPullRequest7)).toMatchObject({ + ok: true, + pullRequest: 7 + }) + // The reproduction checks the pinned tree out next, which needs the fetched commit. + await git(clone, 'cat-file', '-e', `${branchPin}^{commit}`) + }) + + it('passes a branch opened after that squash, judged against its merge preview', async () => { + const { remote, branchPin } = await squashMergedPin('two') + const clone = await cloneMain(remote) + await git(clone, 'switch', '--quiet', '--create', 'later-branch') + await commitAt(clone, 'mobile/src/later.ts', 'later branch change') + await git(clone, 'switch', '--quiet', '--detach', 'main') + await commit(clone, 'main moved on') + await git(clone, 'merge', '--quiet', '--no-ff', '--no-edit', 'later-branch') + expect(await checkPinReachable(clone, branchPin, 'HEAD', heldByPullRequest7)).toMatchObject({ + ok: true, + pullRequest: 7 + }) + }) + + it('passes a squash whose edited title lost its (#n), since GitHub names the pull request', async () => { + const { remote, branchPin } = await squashMergedPin('two', 'two, title edited at merge') + const clone = await cloneMain(remote) + expect(await checkPinReachable(clone, branchPin, 'HEAD', heldByPullRequest7)).toMatchObject({ + ok: true, + pullRequest: 7 + }) + }) + + it('passes through the first associated pull request whose head holds the pin', async () => { + const { remote, branchPin, work } = await squashMergedPin('two') + await git(work, 'push', '--quiet', remote, 'main:refs/pull/9/head') + const clone = await cloneMain(remote) + expect(await checkPinReachable(clone, branchPin, 'HEAD', async () => [9, 7])).toMatchObject({ + ok: true, + pullRequest: 7 + }) + }) + + it('fails the merge preview of a branch whose rebase dropped the commit it pinned', async () => { + const { remote } = await squashMergedPin('two') + const clone = await cloneMain(remote) + await git(clone, 'switch', '--quiet', '--create', 'rebased') + const droppedPin = await commit(clone, 'three') + await commitAt(clone, PIN_MANIFEST, pinManifest(droppedPin)) + await git(clone, 'switch', '--quiet', 'main') + await commitAt(clone, 'mobile/src/moved.ts', 'main moved on') + // The rebase rewrites both commits; the manifest still names the one that is gone. + await git(clone, 'rebase', '--quiet', 'main', 'rebased') + await git(clone, 'switch', '--quiet', '--detach', 'main') + await git(clone, 'merge', '--quiet', '--no-ff', '--no-edit', 'rebased') + // Caught on the pull request: after the squash no head would hold the pin either. + const verdict = await checkPinReachable(clone, droppedPin, 'HEAD', heldByNoPullRequest) + expect(verdict).toMatchObject({ ok: false, failure: 'not-an-ancestor' }) + expect(verdict.ok ? '' : verdict.message).toContain('GitHub associates no pull request') + }) + + it("fails when the pull request's head no longer holds the pin", async () => { + const { remote, branchPin, work } = await squashMergedPin('two') + // A force-push after pinning: the pin is left in no ref the host keeps. + await git(work, 'push', '--quiet', '--force', remote, 'main:refs/pull/7/head') + await git(work, 'push', '--quiet', remote, `${branchPin}:refs/heads/stray`) + const clone = await cloneMain(remote) + await git(clone, 'fetch', '--quiet', 'origin', 'stray') + const verdict = await checkPinReachable(clone, branchPin, 'HEAD', heldByPullRequest7) + expect(verdict).toMatchObject({ ok: false, failure: 'not-an-ancestor' }) + expect(verdict.ok ? '' : verdict.message).toContain('refs/pull/7/head') + }) + + it('fails once that branch squash-merges if GitHub associates no pull request with it', async () => { const repository = await throwawayRepository() const base = await commit(repository, 'one') await git(repository, 'switch', '--quiet', '--create', 'behaviour-change') const branchPin = await commit(repository, 'two') await git(repository, 'switch', '--quiet', 'main') await git(repository, 'reset', '--quiet', '--hard', base) + await commitAt(repository, PIN_MANIFEST, pinManifest(branchPin)) const squashed = await commit(repository, 'two, squashed') - const verdict = await checkPinAncestry(repository, branchPin, squashed) + const verdict = await checkPinReachable(repository, branchPin, squashed, heldByNoPullRequest) expect(verdict).toMatchObject({ ok: false, failure: 'not-an-ancestor' }) expect(verdict.ok).toBe(false) if (verdict.ok) { return } expect(verdict.message).toContain(branchPin) + expect(verdict.message).toContain('GitHub associates no pull request') expect(verdict.message).toContain('scripts/rpc-recording.mts --record') expect(verdict.message).toContain('mobile/rpc-foundation/pilot-scenarios.json') }) @@ -128,11 +265,22 @@ describe('recording pin ancestry', () => { it('fails with the same instruction when the pin is no commit at all', async () => { const repository = await throwawayRepository() const head = await commit(repository, 'one') - const verdict = await checkPinAncestry(repository, MISSING_SHA, head) + const verdict = await checkPinReachable(repository, MISSING_SHA, head, heldByNoPullRequest) expect(verdict).toMatchObject({ ok: false, failure: 'unreachable' }) expect(verdict.ok ? '' : verdict.message).toContain('scripts/rpc-recording.mts --record') }) + it('lets a failed GitHub lookup propagate, never a pass or a repin instruction', async () => { + const { remote, branchPin } = await squashMergedPin('two') + const clone = await cloneMain(remote) + const broken = async (): Promise => { + throw new Error('GitHub answered 502') + } + await expect(checkPinReachable(clone, branchPin, 'HEAD', broken)).rejects.toThrow( + 'GitHub answered 502' + ) + }) + it('refuses to answer on a shallow clone instead of trusting grafted history', async () => { const repository = await throwawayRepository() const pin = await commit(repository, 'one') @@ -141,19 +289,74 @@ describe('recording pin ancestry', () => { const clone = join(repository, '..', 'shallow') await git(repository, 'clone', '--quiet', '--depth', '1', `file://${repository}`, clone) // The pin is real and reachable in the full repository; only the missing history hides it. - expect(await checkPinAncestry(repository, pin, head)).toMatchObject({ ok: true }) - const verdict = await checkPinAncestry(clone, pin, 'HEAD') + expect(await checkPinReachable(repository, pin, head, unasked)).toMatchObject({ ok: true }) + const verdict = await checkPinReachable(clone, pin, 'HEAD', unasked) expect(verdict).toMatchObject({ ok: false, failure: 'shallow' }) expect(verdict.ok ? '' : verdict.message).toContain('fetch-depth: 0') }) it('names the head and the pin in the instruction', () => { expect( - repinInstruction('a'.repeat(40), 'b'.repeat(40), 'is not an ancestor of this commit') + repinInstruction('a'.repeat(40), 'b'.repeat(40), 'is not a commit in this repository at all') ).toContain(`git switch -c repin-rpc-recording ${'b'.repeat(40)}`) }) }) +describe("GitHub's pull requests for a pinned commit", () => { + const pin = 'a'.repeat(40) + const answer = (status: number, body: unknown) => + vi.fn(async () => new Response(JSON.stringify(body), { status })) + afterEach(() => { + vi.unstubAllGlobals() + vi.unstubAllEnvs() + }) + + it('asks with the token when one is set and reads the pull request numbers', async () => { + vi.stubEnv('GITHUB_REPOSITORY', 'stablyai/orca') + vi.stubEnv('GITHUB_TOKEN', 'test-token') + const fetch = answer(200, [{ number: 22762 }, { number: 5 }]) + vi.stubGlobal('fetch', fetch) + expect(await pullRequestsWithCommit('/unused', pin)).toEqual([22762, 5]) + expect(fetch).toHaveBeenCalledWith( + `https://api.github.com/repos/stablyai/orca/commits/${pin}/pulls`, + expect.objectContaining({ + headers: { + Accept: 'application/vnd.github+json', + Authorization: 'Bearer test-token' + } + }) + ) + }) + + it('reads no pull request for a commit GitHub has never seen', async () => { + vi.stubEnv('GITHUB_REPOSITORY', 'stablyai/orca') + vi.stubGlobal('fetch', answer(422, { message: `No commit found for SHA: ${pin}` })) + expect(await pullRequestsWithCommit('/unused', pin)).toEqual([]) + }) + + it('names the rate limit when GitHub refuses a call made without a token', async () => { + vi.stubEnv('GITHUB_REPOSITORY', 'stablyai/orca') + vi.stubEnv('GITHUB_TOKEN', '') + vi.stubEnv('GH_TOKEN', '') + vi.stubGlobal('fetch', answer(403, { message: 'API rate limit exceeded' })) + await expect(pullRequestsWithCommit('/unused', pin)).rejects.toThrow( + /answered 403[\s\S]*API rate limit exceeded[\s\S]*set GITHUB_TOKEN or GH_TOKEN/ + ) + }) + + it('reads owner and repo from https and ssh remotes, and nothing from another host', () => { + expect(gitHubRepositoryFromRemote('https://github.com/stablyai/orca.git\n')).toBe( + 'stablyai/orca' + ) + expect(gitHubRepositoryFromRemote('https://github.com/stablyai/orca')).toBe('stablyai/orca') + expect(gitHubRepositoryFromRemote('git@github.com:stablyai/orca.git')).toBe('stablyai/orca') + expect(gitHubRepositoryFromRemote('ssh://git@github.com/stablyai/orca.git')).toBe( + 'stablyai/orca' + ) + expect(gitHubRepositoryFromRemote('/tmp/remote.git')).toBeNull() + }) +}) + describe('what a reproduction reads from the candidate tree', () => { it('skips the run when only product sources moved', async () => { const repository = await throwawayRepository() diff --git a/mobile/scripts/rpc-recording-pin-reachability.mts b/mobile/scripts/rpc-recording-pin-reachability.mts new file mode 100644 index 000000000000..c7ec31ccfb12 --- /dev/null +++ b/mobile/scripts/rpc-recording-pin-reachability.mts @@ -0,0 +1,204 @@ +/** + * Whether the RPC recording pin names a commit this repository keeps: one in this history, or one in + * the head of a pull request that GitHub associates with the pinned commit. + */ +import { runProcess } from '../../src/shared/child-process/run-process.ts' + +export const PIN_MANIFEST = 'mobile/rpc-foundation/pilot-scenarios.json' +const PIN_REMOTE = 'origin' +const PIN_FETCH_TIMEOUT_MS = 180_000 +const PULL_REQUEST_LOOKUP_TIMEOUT_MS = 30_000 + +export type PinReachabilityFailure = 'shallow' | 'unreachable' | 'not-an-ancestor' +export type PinReachabilityVerdict = + | { ok: true; baseline: string; ref: string; pullRequest: number | null } + | { ok: false; baseline: string; ref: string; failure: PinReachabilityFailure; message: string } +/** Only nominates pull requests; git's ancestry check decides, so a wrong answer can only fail. */ +export type PullRequestLookup = (root: string, commit: string) => Promise + +async function git(cwd: string, args: readonly string[], timeoutMs?: number) { + return await runProcess({ program: 'git', args: [...args], cwd, timeoutMs }) +} +function failureDetail(result: { stderr: string; timedOut: boolean }, timeoutMs: number): string { + return result.timedOut ? `timed out after ${timeoutMs / 1000}s` : result.stderr.trim() +} +export function repinInstruction(baseline: string, ref: string, cause: string): string { + return [ + `The RPC recording corpus is pinned to a commit that ${cause}.`, + '', + ` baseline ${baseline} (mobile/rpc-foundation/pilot-scenarios.json)`, + ` head ${ref}`, + '', + 'Every golden under mobile/rpc-foundation/goldens claims it was recorded from that tree, and', + '`--record` refuses on any other tree, so the corpus cannot be refreshed until the pin names a', + 'commit that is reachable from here. Repin and re-record, both in one commit:', + '', + ` git switch -c repin-rpc-recording ${ref}`, + ` # set "baseline" in mobile/rpc-foundation/pilot-scenarios.json to ${ref}`, + ' ORCA_BACKGROUND_LAUNCH=1 RPC_FOUNDATION_RECORD=1 \\', + ' pnpm --dir mobile exec tsx scripts/rpc-recording.mts --record', + '', + 'Re-record everything: the repin rewrites the `baseline` header of every golden, so a partial', + 'refresh leaves the corpus pinned to two different trees. See', + 'mobile/src/test-support/rpc-recording/README.md, "Recording a behaviour change".' + ].join('\n') +} +const SHALLOW_MESSAGE = [ + 'Cannot judge the recording pin: this is a shallow clone.', + '', + '`git merge-base --is-ancestor` answers from grafted history, so it would report a verdict this', + 'guard has no evidence for. Check out with `fetch-depth: 0`.' +].join('\n') + +async function isAncestor(root: string, commit: string, of: string): Promise { + const ancestor = await git(root, ['merge-base', '--is-ancestor', commit, of]) + // Why only 0 and 1: git reserves higher codes for real errors, and treating one as "not an + // ancestor" would turn a broken repository into a repin instruction nobody can act on. + if (ancestor.code !== 0 && ancestor.code !== 1) { + throw new Error(`git merge-base --is-ancestor failed: ${ancestor.stderr.trim()}`) + } + return ancestor.code === 0 +} + +/** `owner/repo` from a GitHub remote URL, https or ssh. */ +export function gitHubRepositoryFromRemote(url: string): string | null { + const match = /github\.com[:/]([^/\s]+)\/([^/\s]+?)(?:\.git)?\/?$/.exec(url.trim()) + return match ? `${match[1]}/${match[2]}` : null +} +async function gitHubRepository(root: string): Promise { + if (process.env.GITHUB_REPOSITORY) { + return process.env.GITHUB_REPOSITORY + } + const remote = await git(root, ['remote', 'get-url', PIN_REMOTE]) + const repository = remote.code === 0 ? gitHubRepositoryFromRemote(remote.stdout) : null + if (!repository) { + throw new Error( + `Cannot tell which GitHub repository ${PIN_REMOTE} is ` + + `(${remote.stdout.trim() || remote.stderr.trim()}); set GITHUB_REPOSITORY=/` + ) + } + return repository +} + +/** The pull requests GitHub associates with `commit`, whatever the squash title says. */ +export async function pullRequestsWithCommit(root: string, commit: string): Promise { + const url = `https://api.github.com/repos/${await gitHubRepository(root)}/commits/${commit}/pulls` + const token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN + const response = await fetch(url, { + headers: { + Accept: 'application/vnd.github+json', + ...(token ? { Authorization: `Bearer ${token}` } : {}) + }, + signal: AbortSignal.timeout(PULL_REQUEST_LOOKUP_TIMEOUT_MS) + }).catch((error: unknown) => { + // Node's fetch hides the network reason (DNS, TLS, reset) in `cause`. + const cause = error instanceof Error && error.cause ? ` (${String(error.cause)})` : '' + throw new Error( + `Could not ask GitHub which pull requests hold ${commit} (${url}): ${String(error)}${cause}` + ) + }) + const body = await response.text() + // GitHub's answer for a commit it has never seen, which no pull request can hold. + if (response.status === 422 && body.includes('No commit found')) { + return [] + } + if (!response.ok) { + const rateLimited = !token && (response.status === 403 || response.status === 429) + throw new Error( + `GitHub answered ${response.status} to ${url}: ${body.slice(0, 300)}` + + (rateLimited + ? '\nUnauthenticated GitHub API calls are rate-limited; set GITHUB_TOKEN or GH_TOKEN.' + : '') + ) + } + const pulls: unknown = JSON.parse(body) + if (!Array.isArray(pulls)) { + throw new Error( + `GitHub answered ${url} with something other than a list: ${body.slice(0, 300)}` + ) + } + return pulls.flatMap((pull) => (typeof pull?.number === 'number' ? [pull.number] : [])) +} + +/** Fetches a pull request's head into a ref of our own, so no other fetch can move it under us. */ +async function fetchPullRequestHead(root: string, pullRequest: number): Promise { + const local = `refs/rpc-recording-pin/pull/${pullRequest}` + const fetched = await git( + root, + ['fetch', '--quiet', '--no-tags', PIN_REMOTE, `+refs/pull/${pullRequest}/head:${local}`], + PIN_FETCH_TIMEOUT_MS + ) + if (fetched.code !== 0) { + const detail = failureDetail(fetched, PIN_FETCH_TIMEOUT_MS) + throw new Error( + `Could not fetch refs/pull/${pullRequest}/head from ${PIN_REMOTE}, the head of a pull ` + + `request GitHub associates with the recording pin: ${detail}` + ) + } + return local +} + +export async function checkPinReachable( + root: string, + baseline: string, + ref: string, + pullRequestsHolding: PullRequestLookup = pullRequestsWithCommit +): Promise { + const shallow = await git(root, ['rev-parse', '--is-shallow-repository']) + if (shallow.code !== 0) { + throw new Error(`Could not ask git whether the clone is shallow: ${shallow.stderr.trim()}`) + } + if (shallow.stdout.trim() !== 'false') { + return { ok: false, baseline, ref, failure: 'shallow', message: SHALLOW_MESSAGE } + } + const head = await git(root, ['rev-parse', '--verify', '--quiet', `${ref}^{commit}`]) + if (head.code !== 0) { + throw new Error(`Cannot resolve ${ref} to a commit in this repository`) + } + // Resolved, because the instruction below is a command to paste: `HEAD` in it moves with whatever + // the reader has checked out by the time they read the log. + const resolved = head.stdout.trim() + const present = async () => + (await git(root, ['rev-parse', '--verify', '--quiet', `${baseline}^{commit}`])).code === 0 + if ((await present()) && (await isAncestor(root, baseline, ref))) { + return { ok: true, baseline, ref, pullRequest: null } + } + // A squash drops the branch commit the pin names, and the branch may already be deleted, but + // GitHub keeps the pull request's head ref for good. + const pullRequests = await pullRequestsHolding(root, baseline) + for (const pullRequest of pullRequests) { + const pullRequestHead = await fetchPullRequestHead(root, pullRequest) + if ((await present()) && (await isAncestor(root, baseline, pullRequestHead))) { + return { ok: true, baseline, ref, pullRequest } + } + } + const pullRequestCause = + pullRequests.length === 0 + ? 'and GitHub associates no pull request with it' + : 'and no head of a pull request GitHub associates with it holds it ' + + `(${pullRequests.map((pullRequest) => `refs/pull/${pullRequest}/head`).join(', ')})` + if (!(await present())) { + return { + ok: false, + baseline, + ref, + failure: 'unreachable', + message: repinInstruction( + baseline, + resolved, + `is not a commit in this clone, ${pullRequestCause}` + ) + } + } + return { + ok: false, + baseline, + ref, + failure: 'not-an-ancestor', + message: repinInstruction( + baseline, + resolved, + `is not an ancestor of this commit, ${pullRequestCause}` + ) + } +} diff --git a/mobile/scripts/rpc-recording.mts b/mobile/scripts/rpc-recording.mts index 7ada953da091..c6034a9246e2 100644 --- a/mobile/scripts/rpc-recording.mts +++ b/mobile/scripts/rpc-recording.mts @@ -24,7 +24,15 @@ const baseline = await runProcess({ ], cwd: root }) -if (baseline.code !== 0) { +// A pin a squash left only in its pull request's head is a missing object, not product drift. +if (baseline.code !== 0 && baseline.code !== 1) { + throw new Error( + `Could not diff against the pinned baseline ${input.baseline}: ${baseline.stderr.trim()}\n` + + 'If your clone lacks that commit, fetch it with\n' + + ' pnpm --dir mobile exec tsx scripts/rpc-recording-pin-guard.mts reachable' + ) +} +if (baseline.code === 1) { throw new Error('Product sources or lockfile differ from the pinned main baseline') } // Why a second check: `git diff` only sees tracked paths, so an untracked module under the diff --git a/mobile/src/test-support/rpc-recording/README.md b/mobile/src/test-support/rpc-recording/README.md index 8f8bbc89fc6c..afe33f98bdab 100644 --- a/mobile/src/test-support/rpc-recording/README.md +++ b/mobile/src/test-support/rpc-recording/README.md @@ -529,9 +529,15 @@ a tree that does not produce them, which is the one claim this header exists to derived scenarios rather than the manifest, so a repin alone never moves it. 5. Commit the repin and the refresh together, and state the cause. -After a squash-merge the pinned sha is unreachable from main, so the next recording on main repins -to main's tip in a follow-up — the same two-step #20563 and #20895 used. A reviewer checking an -in-flight branch resolves the pin against the branch, where it is a real commit. +A squash-merge leaves the pinned sha out of main's history, and no follow-up repin is needed: the +pin guard asks GitHub which pull requests contain the pinned commit +(`GET /repos/{owner}/{repo}/commits/{sha}/pulls`), fetches each one's `refs/pull//head`, which +GitHub keeps after the branch is deleted, and passes only when git finds the pin in one of those +heads. The squash title plays no part, so editing it at merge time is safe. Run `pnpm --dir mobile +exec tsx scripts/rpc-recording-pin-guard.mts reachable` to fetch a pin your clone does not have +before checking it out. It works without a token, and sends `GITHUB_TOKEN` or `GH_TOKEN` when one +is set, which lifts GitHub's unauthenticated rate limit. A reviewer checking an in-flight branch +resolves the pin against the branch, where it is a real commit. Editing the recorder engine on a migration branch is the awkward case: `recorderSha256` moves, so every golden needs rewriting, but the product tree no longer matches `baseline`, and bumping From 50a8ef18e48a22076a3343ca65f4b40971ec84bf Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:22:22 -0700 Subject: [PATCH 64/90] fix(native-chat): keep a turn's bar on the prompt that opened it (#23573) A message sent while a structured turn runs appears in the transcript at once, so "the newest user message" is not the running turn's owner. The live "Working for" bar moved to the mid-turn message and counted from the earlier prompt's start, and a send queued behind the running turn counted its wait twice: once in the previous turn and again from its own send. Derive both from the host's turn records in one ordered pass: - The running turn's bar belongs to the user message its lifecycle row names (resolved exactly as settled timing resolves it). A message sent mid-turn gets no bar until its own turn opens; a send folded into the running turn never gets one. Surfaces fall back to the latest user message only when the host names no opener. - A turn counts from its send, but never before the previous turn in the journal ended (its recorded end, else its row's last host revision), capped at the turn's own start. The same origin feeds the live counter and the settled duration. Desktop and mobile share the derivation; no wire, host, or storage change. --- .../src/session/MobileNativeChatOverlay.tsx | 1 + mobile/src/session/MobileNativeChatView.tsx | 4 + .../mobile-native-chat-controller-contract.ts | 2 + .../use-mobile-native-chat-controller.ts | 3 + ...obile-native-chat-turn-disclosure.test.tsx | 62 +++ .../use-mobile-native-chat-turn-disclosure.ts | 24 +- .../use-mobile-native-chat-turn-status.ts | 14 +- ...use-mobile-structured-agent-turn-timing.ts | 28 +- .../native-chat/NativeChatMessageList.tsx | 19 +- ...iveChatMessageList.turn-indicator.test.tsx | 87 ++++ .../NativeChatStructuredSession.tsx | 1 + .../native-chat-message-rail-items.test.ts | 3 +- .../native-chat-rail-outline-parity.test.ts | 3 +- .../native-chat-transcript-slots.test.ts | 7 +- .../native-chat-transcript-slots.ts | 7 +- .../use-native-chat-message-rail.test.ts | 3 +- .../use-native-chat-turn-status.ts | 7 +- .../use-structured-agent-session.ts | 1 + .../use-structured-agent-turn-timing.ts | 28 +- src/shared/native-chat-turn-status.ts | 19 + ...structured-agent-session-turn-bars.test.ts | 401 ++++++++++++++++++ .../structured-agent-session-turn-timing.ts | 119 ++++-- 22 files changed, 754 insertions(+), 89 deletions(-) create mode 100644 src/shared/structured-agent-session-turn-bars.test.ts diff --git a/mobile/src/session/MobileNativeChatOverlay.tsx b/mobile/src/session/MobileNativeChatOverlay.tsx index 65f25e4ea240..31ce1e22550b 100644 --- a/mobile/src/session/MobileNativeChatOverlay.tsx +++ b/mobile/src/session/MobileNativeChatOverlay.tsx @@ -76,6 +76,7 @@ export function MobileNativeChatOverlay({ turnIndicator={controller.nativeChatTurnIndicator} workingStartedAt={controller.nativeChatWorkingStartedAt} settledTurns={controller.nativeChatSettledTurns} + activeTurnOpenedBy={controller.nativeChatActiveTurnOpenedBy} streaming={streaming} onStop={controller.handleNativeChatStop} ask={controller.nativeChatAsk} diff --git a/mobile/src/session/MobileNativeChatView.tsx b/mobile/src/session/MobileNativeChatView.tsx index 31ba0302065f..1184b126c554 100644 --- a/mobile/src/session/MobileNativeChatView.tsx +++ b/mobile/src/session/MobileNativeChatView.tsx @@ -66,6 +66,8 @@ type Props = { /** Structured lane: host-recorded turn timing feeding the per-turn status rows. */ workingStartedAt?: number | null settledTurns?: NativeChatSettledTurns | null + /** Structured lane: the user message the host says opened the running turn. */ + activeTurnOpenedBy?: string | null /** Interrupt the agent mid-turn (shown as a Stop button on the working bar). */ /** Interrupt a provider turn. */ onStop?: () => void @@ -151,6 +153,7 @@ export function MobileNativeChatView({ turnIndicator = null, workingStartedAt, settledTurns, + activeTurnOpenedBy = null, onStop, streaming, hasMore, @@ -270,6 +273,7 @@ export function MobileNativeChatView({ isWorking: agentWorking === true, workingStartedAt, settledTurns, + activeTurnOpenedBy, thinking: turnIndicator?.thinking === true, activityText: turnIndicator?.activityText ?? null, scopeKey: sendSurfaceId diff --git a/mobile/src/session/mobile-native-chat-controller-contract.ts b/mobile/src/session/mobile-native-chat-controller-contract.ts index 78c5ebeb1cfa..686dac407e77 100644 --- a/mobile/src/session/mobile-native-chat-controller-contract.ts +++ b/mobile/src/session/mobile-native-chat-controller-contract.ts @@ -37,6 +37,8 @@ export type MobileNativeChatController = { /** Structured lane: host-recorded turn timing for the per-turn status rows. */ nativeChatWorkingStartedAt: number | null nativeChatSettledTurns: NativeChatSettledTurns | null + /** Structured lane: the user message the host says opened the running turn. */ + nativeChatActiveTurnOpenedBy: string | null nativeChatCanStop: boolean nativeChatStreamingText?: string /** Agent mid-turn, regardless of whether chat is the visible view. */ diff --git a/mobile/src/session/use-mobile-native-chat-controller.ts b/mobile/src/session/use-mobile-native-chat-controller.ts index dfefcf476279..7a1fa7c468ec 100644 --- a/mobile/src/session/use-mobile-native-chat-controller.ts +++ b/mobile/src/session/use-mobile-native-chat-controller.ts @@ -288,6 +288,9 @@ export function useMobileNativeChatController(args: { nativeChatTurnIndicator: activeChatStructured ? structuredNativeChat.turnIndicator : null, nativeChatWorkingStartedAt: activeChatStructured ? structuredNativeChat.workingStartedAt : null, nativeChatSettledTurns: activeChatStructured ? structuredNativeChat.settledTurns : null, + nativeChatActiveTurnOpenedBy: activeChatStructured + ? structuredNativeChat.activeTurnOpenedBy + : null, nativeChatCanStop: activeChatStructured ? structuredNativeChat.turnId !== null : nativeChatAgentWorking, diff --git a/mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx b/mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx index 3546a568e732..1757a8ce65bd 100644 --- a/mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx +++ b/mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx @@ -20,12 +20,16 @@ function Harness({ enabled, isWorking = true, settledTurns, + workingStartedAt, + activeTurnOpenedBy, scopeKey = 'host\0worktree\0tab-a' }: { messages: readonly NativeChatMessage[] enabled: boolean isWorking?: boolean settledTurns?: NativeChatSettledTurns + workingStartedAt?: number | null + activeTurnOpenedBy?: string | null scopeKey?: string }): React.JSX.Element { const disclosure = useMobileNativeChatTurnDisclosure({ @@ -33,6 +37,8 @@ function Harness({ enabled, isWorking, settledTurns, + workingStartedAt, + activeTurnOpenedBy, scopeKey }) return createElement('result', { disclosure }) @@ -202,6 +208,62 @@ describe('useMobileNativeChatTurnDisclosure', () => { } }) + it('keeps the live bar under the prompt that opened the running turn, not a mid-turn send', () => { + vi.useFakeTimers() + try { + vi.setSystemTime(10_000) + const tool: NativeChatMessage = { + id: 'tool-a', + role: 'assistant', + blocks: [ + { type: 'tool-call', name: 'Bash', input: { command: 'sleep 15' }, state: 'running' } + ], + timestamp: null, + source: 'transcript' + } + const messages = [userMessage('A'), tool, userMessage('B')] + const rows = () => { + const disclosure = renderer!.root.findByType('result').props.disclosure + return messages.map((message, index) => disclosure.resolveRow(index, message)) + } + // B was sent while A's turn runs; the host still names A as the running turn's opener. + act(() => { + renderer = create( + createElement(Harness, { + messages, + enabled: true, + workingStartedAt: 5_000, + activeTurnOpenedBy: 'A' + }) + ) + }) + let [rowA, rowTool, rowB] = rows() + expect(rowA.turnStatus).toEqual({ startedAt: 5_000, thinking: false, workedSeconds: null }) + expect(rowB.turnStatus).toBeNull() + // Row liveness still follows the transcript's grouping under the newest prompt. + expect(rowTool.activeTurnIsWorking).toBe(false) + expect(rowB.activeTurnIsWorking).toBe(true) + + // B's own turn opens: A takes the host's settled duration, B counts from A's end. + act(() => { + renderer?.update( + createElement(Harness, { + messages, + enabled: true, + workingStartedAt: 22_000, + settledTurns: new Map([['A', { startedAt: 5_000, workedSeconds: 17 }]]), + activeTurnOpenedBy: 'B' + }) + ) + }) + ;[rowA, , rowB] = rows() + expect(rowA.turnStatus).toEqual({ startedAt: 5_000, thinking: false, workedSeconds: 17 }) + expect(rowB.turnStatus).toEqual({ startedAt: 22_000, thinking: false, workedSeconds: null }) + } finally { + vi.useRealTimers() + } + }) + it('keeps at most the latest 128 turns expanded', () => { vi.useFakeTimers() try { diff --git a/mobile/src/session/use-mobile-native-chat-turn-disclosure.ts b/mobile/src/session/use-mobile-native-chat-turn-disclosure.ts index 4e236d648bec..6cbb31c723a4 100644 --- a/mobile/src/session/use-mobile-native-chat-turn-disclosure.ts +++ b/mobile/src/session/use-mobile-native-chat-turn-disclosure.ts @@ -2,7 +2,6 @@ import { useCallback, useMemo, useState } from 'react' import type { NativeChatMessage } from '../../../src/shared/native-chat-types' import type { NativeChatSettledTurns } from '../../../src/shared/native-chat-turn-status' import { - MOBILE_UNANCHORED_TURN_KEY, useMobileNativeChatTurnStatus, type NativeChatTurnStatus } from './use-mobile-native-chat-turn-status' @@ -28,6 +27,7 @@ export function useMobileNativeChatTurnDisclosure({ isWorking, workingStartedAt, settledTurns, + activeTurnOpenedBy = null, thinking = false, activityText = null, scopeKey @@ -38,6 +38,8 @@ export function useMobileNativeChatTurnDisclosure({ workingStartedAt?: number | null /** Host-recorded durations; they outrank whatever this client observed. */ settledTurns?: NativeChatSettledTurns | null + /** The user message the host says opened the running turn; absent, the latest one. */ + activeTurnOpenedBy?: string | null /** Whether the turn is reasoning right now, derived from its journal content. */ thinking?: boolean /** What the provider says the live turn is doing; outranks the other labels. */ @@ -57,6 +59,7 @@ export function useMobileNativeChatTurnDisclosure({ isWorking, workingStartedAt, settledTurns, + activeTurnOpenedBy, thinking, scopeKey }) @@ -100,6 +103,8 @@ export function useMobileNativeChatTurnDisclosure({ }, [enabled, messages]) const { active, activeTurnKey, completedByTurn } = turnStatuses + // Liveness follows the transcript's own grouping (the latest prompt's rows), not the bar's owner. + const latestTurnKey = turnKeys.at(-1) const activeActivityText = enabled && isWorking ? (activityText ?? null) : null const resolveRow = useCallback( (index: number, message: NativeChatMessage): MobileNativeChatTurnRow => { @@ -120,14 +125,19 @@ export function useMobileNativeChatTurnDisclosure({ // writing a ref during render, which react-freeze can discard. turnKey: turnKey && turnStatus?.workedSeconds != null ? turnKey : undefined, // With no user boundary at all, the session's working state stays authoritative. - activeTurnIsWorking: - enabled && - isWorking && - (turnKey === activeTurnKey || - (turnKey === undefined && activeTurnKey === MOBILE_UNANCHORED_TURN_KEY)) + activeTurnIsWorking: enabled && isWorking && turnKey === latestTurnKey } }, - [turnKeys, enabled, activeTurnKey, active, completedByTurn, expandedTurnIds, isWorking] + [ + turnKeys, + enabled, + activeTurnKey, + latestTurnKey, + active, + completedByTurn, + expandedTurnIds, + isWorking + ] ) return { diff --git a/mobile/src/session/use-mobile-native-chat-turn-status.ts b/mobile/src/session/use-mobile-native-chat-turn-status.ts index f7cbb2dd8874..3dac27e1b252 100644 --- a/mobile/src/session/use-mobile-native-chat-turn-status.ts +++ b/mobile/src/session/use-mobile-native-chat-turn-status.ts @@ -1,7 +1,9 @@ import { useEffect, useMemo, useRef, useState } from 'react' import type { NativeChatMessage } from '../../../src/shared/native-chat-types' import { + NATIVE_CHAT_UNANCHORED_TURN_KEY, reduceNativeChatTurnTiming, + selectNativeChatActiveTurnKey, selectNativeChatTurnStatuses, type NativeChatSettledTurns, type NativeChatTurnStatus, @@ -10,7 +12,6 @@ import { export type { NativeChatTurnStatus } -export const MOBILE_UNANCHORED_TURN_KEY = '__unanchored__' const EMPTY_TURN_TIMING_BY_TURN: NativeChatTurnTimingByTurn = Object.freeze({}) type ScopedTurnTiming = { @@ -26,6 +27,7 @@ export function useMobileNativeChatTurnStatus({ isWorking, workingStartedAt, settledTurns, + activeTurnOpenedBy = null, thinking = false, scopeKey }: { @@ -35,6 +37,8 @@ export function useMobileNativeChatTurnStatus({ workingStartedAt?: number | null /** Host-recorded durations; they outrank whatever this client observed. */ settledTurns?: NativeChatSettledTurns | null + /** The user message the host says opened the running turn; absent, the latest one. */ + activeTurnOpenedBy?: string | null /** Whether the turn is reasoning right now, derived from its journal content. */ thinking?: boolean /** Host/worktree/tab identity. Timings never carry across chat surfaces. */ @@ -44,11 +48,9 @@ export function useMobileNativeChatTurnStatus({ completedByTurn: Readonly> activeTurnKey: string } { - const latestUserIndex = enabled - ? messages.findLastIndex((message) => message.role === 'user') - : -1 - const latestUserId = latestUserIndex !== -1 ? (messages[latestUserIndex]?.id ?? null) : null - const activeTurnKey = latestUserId ?? MOBILE_UNANCHORED_TURN_KEY + const activeTurnKey = enabled + ? selectNativeChatActiveTurnKey(messages, activeTurnOpenedBy) + : NATIVE_CHAT_UNANCHORED_TURN_KEY const [scopedTiming, setScopedTiming] = useState(() => ({ scopeKey, timingByTurn: {} diff --git a/mobile/src/session/use-mobile-structured-agent-turn-timing.ts b/mobile/src/session/use-mobile-structured-agent-turn-timing.ts index 811320510a29..3559f6925edd 100644 --- a/mobile/src/session/use-mobile-structured-agent-turn-timing.ts +++ b/mobile/src/session/use-mobile-structured-agent-turn-timing.ts @@ -5,18 +5,16 @@ import type { } from '../../../src/shared/agent-session-journal-types' import type { NativeChatSettledTurns } from '../../../src/shared/native-chat-turn-status' import type { StructuredAgentHostClock } from '../../../src/shared/structured-agent-session-reducer' -import { - selectStructuredAgentRunningTurnTiming, - selectStructuredAgentSettledTurns -} from '../../../src/shared/structured-agent-session-turn-timing' +import { selectStructuredAgentTurnBars } from '../../../src/shared/structured-agent-session-turn-timing' import { stepStructuredAgentTurnClock, type StructuredAgentTurnClockLatch } from '../../../src/shared/structured-agent-turn-clock-anchor' /** Host-recorded turn timing for the structured lane: settled durations straight - * off the journal, and a skew-free start for the live counter whose host-to-local - * conversion is latched once per turn. */ + * off the journal, the user message that owns the running turn's bar, and a + * skew-free start for the live counter whose host-to-local conversion is latched + * once per turn. */ export function useMobileStructuredAgentTurnTiming( { items, @@ -28,16 +26,16 @@ export function useMobileStructuredAgentTurnTiming( hostClock?: StructuredAgentHostClock | null }, turnId: string | null -): { settledTurns: NativeChatSettledTurns; workingStartedAt: number | null } { - const settledTurns = useMemo( - () => selectStructuredAgentSettledTurns(items, submissions), - [items, submissions] +): { + settledTurns: NativeChatSettledTurns + workingStartedAt: number | null + activeTurnOpenedBy: string | null +} { + const { settledTurns, runningTiming, activeTurnOpenedBy } = useMemo( + () => selectStructuredAgentTurnBars(items, submissions, turnId), + [items, submissions, turnId] ) const [latch, setLatch] = useState(null) - const runningTiming = useMemo( - () => (turnId === null ? null : selectStructuredAgentRunningTurnTiming(items, turnId)), - [items, turnId] - ) // Stamp during render (React's derive-from-props pattern) so the first paint of // a new turn already counts from the right instant. const step = stepStructuredAgentTurnClock({ @@ -50,5 +48,5 @@ export function useMobileStructuredAgentTurnTiming( if (step.latch !== latch) { setLatch(step.latch) } - return { settledTurns, workingStartedAt: step.workingStartedAt } + return { settledTurns, workingStartedAt: step.workingStartedAt, activeTurnOpenedBy } } diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx index d81bfffb52f1..d739e0b8d618 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx @@ -43,7 +43,10 @@ import { nativeChatReaderScrollInputHandlers } from './native-chat-reader-scroll import type { AgentJournalRenderItem } from '../../../../shared/agent-session-journal-types' import { isStructuredAgentSessionThinking } from '../../../../shared/structured-agent-session-live-turn' import { nativeChatSubagentLabels } from '../../../../shared/native-chat-subagent-attribution' -import type { NativeChatSettledTurns } from '../../../../shared/native-chat-turn-status' +import { + selectNativeChatActiveTurnKey, + type NativeChatSettledTurns +} from '../../../../shared/native-chat-turn-status' import { nativeChatTurnDiffs, type NativeChatDiffReveal, @@ -71,6 +74,7 @@ export function NativeChatMessageList({ allowFileUriLinks = false, workingStartedAt, settledTurns, + activeTurnOpenedBy, deliveryNotices, showTurnStatus = true, showLiveTurnActivity = true, @@ -90,6 +94,8 @@ export function NativeChatMessageList({ workingStartedAt?: number | null /** Host-recorded turn durations keyed by user message id (structured lane). */ settledTurns?: NativeChatSettledTurns + /** The user message the host says opened the running turn (structured lane). */ + activeTurnOpenedBy?: string | null onLinkClick?: CommentMarkdownLinkClickHandler allowFileUriLinks?: boolean deliveryNotices?: ReadonlyMap @@ -154,9 +160,7 @@ export function NativeChatMessageList({ const showTypingIndicator = showTurnStatus ? isWorking : shouldShowNativeChatTypingIndicator({ messages, isWorking }) - const latestUserIndex = messages.findLastIndex((message) => message.role === 'user') - const currentTurnKey = - latestUserIndex === -1 ? undefined : (messages[latestUserIndex]?.id ?? undefined) + const currentTurnKey = messages.findLast((message) => message.role === 'user')?.id ?? undefined // Resolve each row's turn boundary once. Prefix slice/findLast in the render // loop becomes quadratic for long transcripts. const turnKeys = useMemo(() => { @@ -181,9 +185,10 @@ export function NativeChatMessageList({ () => (journalItems ? isStructuredAgentSessionThinking(journalItems) : false), [journalItems] ) + const activeTurnKey = selectNativeChatActiveTurnKey(messages, activeTurnOpenedBy) const turnStatuses = useNativeChatTurnStatus({ messages, - latestUserIndex, + activeTurnKey, isWorking: showTurnStatus && isWorking, workingStartedAt: showTurnStatus ? workingStartedAt : null, settledTurns: showTurnStatus ? settledTurns : null, @@ -195,7 +200,7 @@ export function NativeChatMessageList({ buildNativeChatTranscriptSlots({ messages, turnKeys, - latestUserIndex, + activeTurnKey, currentTurnKey, receipts, turnStatuses, @@ -207,10 +212,10 @@ export function NativeChatMessageList({ subagentLabels }), [ + activeTurnKey, currentTurnKey, expandedTurnIds, isWorking, - latestUserIndex, lifecycleWorking, messages, receipts, diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx index b58c91fe31fe..8400b592e7d5 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx @@ -655,6 +655,93 @@ describe('NativeChatMessageList turn indicator', () => { expect(screen.getByText('Working for 0s')).toBeInTheDocument() }) + it('keeps the live bar under the prompt that opened the running turn, not a message sent mid-turn', () => { + const prompt = (id: string, text: string): NativeChatLiveSession['messages'][number] => ({ + id, + role: 'user', + blocks: [{ type: 'text', text }], + timestamp: 1, + source: 'transcript' + }) + const messages = [ + prompt('user-a', 'Run four sleeps'), + { + id: 'tool-a', + role: 'assistant' as const, + blocks: [ + { + type: 'tool-call' as const, + name: 'Bash', + input: { command: 'sleep 15' }, + state: 'running' as const + } + ], + timestamp: 2, + source: 'transcript' as const + }, + prompt('user-b', 'Also say banana') + ] + const list = (props: Partial>) => ( + + ) + // B was sent while A's turn runs: the host still names A as the running turn's opener. + const { rerender } = render( + list({ + workingStartedAt: Date.now() - 5000, + settledTurns: new Map(), + activeTurnOpenedBy: 'user-a' + }) + ) + const barA = screen.getByText('Working for 5s').closest('[data-native-chat-turn-status]') + expect(screen.getAllByText(/Working for/)).toHaveLength(1) + expect(screen.getByText('Run four sleeps').compareDocumentPosition(barA!)).toBe( + Node.DOCUMENT_POSITION_FOLLOWING + ) + expect(barA!.compareDocumentPosition(screen.getByText('Also say banana'))).toBe( + Node.DOCUMENT_POSITION_FOLLOWING + ) + + // B's own turn opens: A settles in place and B counts from A's end. + rerender( + list({ + workingStartedAt: Date.now() - 1000, + settledTurns: new Map([['user-a', { startedAt: 1, workedSeconds: 17 }]]), + activeTurnOpenedBy: 'user-b' + }) + ) + expect(screen.getByText('Worked for 17s').closest('[data-native-chat-turn-status]')).toBe(barA) + const barB = screen.getByText('Working for 1s').closest('[data-native-chat-turn-status]') + expect(screen.getByText('Also say banana').compareDocumentPosition(barB!)).toBe( + Node.DOCUMENT_POSITION_FOLLOWING + ) + + rerender( + list({ + isWorking: false, + session: { ...session, status: 'ready', messages }, + workingStartedAt: null, + settledTurns: new Map([ + ['user-a', { startedAt: 1, workedSeconds: 17 }], + ['user-b', { startedAt: 2, workedSeconds: 51 }] + ]), + activeTurnOpenedBy: null + }) + ) + expect(screen.getByText('Worked for 17s').closest('[data-native-chat-turn-status]')).toBe(barA) + expect( + screen + .getByText('Also say banana') + .compareDocumentPosition(screen.getByText('Worked for 51s')) + ).toBe(Node.DOCUMENT_POSITION_FOLLOWING) + expect(screen.queryByText(/Working for/)).toBeNull() + }) + it("uses the completed caret to expand that turn's tool details", () => { const startedAt = Date.now() - 3000 render( diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx index b66f1770d330..2de5591b779e 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx @@ -279,6 +279,7 @@ export function NativeChatStructuredSession( fontScale={fontScale.scale} workingStartedAt={controller.workingStartedAt} settledTurns={controller.settledTurns} + activeTurnOpenedBy={controller.activeTurnOpenedBy} showTurnStatus showLiveTurnActivity={prompt === null} turnActivity={controller.turnActivity} diff --git a/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts b/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts index 5e6fecefa2f9..3e760a787caf 100644 --- a/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts @@ -10,6 +10,7 @@ import { NATIVE_CHAT_RAIL_MAX_TICKS, type NativeChatRailItem } from './native-chat-message-rail-items' +import { selectNativeChatActiveTurnKey } from '../../../../shared/native-chat-turn-status' function text(id: string, body: string, role: NativeChatMessage['role'] = 'assistant') { return { @@ -42,7 +43,7 @@ function slotsOf(messages: NativeChatMessage[]) { return buildNativeChatTranscriptSlots({ messages, turnKeys, - latestUserIndex: messages.findLastIndex((message) => message.role === 'user'), + activeTurnKey: selectNativeChatActiveTurnKey(messages), currentTurnKey: undefined, receipts: new Map(), turnStatuses: { active: null, completedByTurn: {} }, diff --git a/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts b/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts index 385899ae91f8..5ee40345e1b1 100644 --- a/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts @@ -18,6 +18,7 @@ import { omitNativeChatThreadGoalRows } from './native-chat-thread-goal-rows' import { buildNativeChatTranscriptSlots } from './native-chat-transcript-slots' import type { NativeChatTurnDiff } from './native-chat-turn-diffs' import { projectStructuredAgentSessionMessages } from './structured-agent-session-message-projection' +import { selectNativeChatActiveTurnKey } from '../../../../shared/native-chat-turn-status' function row(sequence: number, body: AgentJournalItemBody, itemId = `item-${sequence}`) { return { itemId, revision: 1, sequence, observedAt: 1_000 + sequence, body } @@ -81,7 +82,7 @@ function loadedRailItems(items: AgentJournalRenderItem[], submissions: AgentJour const slots = buildNativeChatTranscriptSlots({ messages, turnKeys, - latestUserIndex: messages.findLastIndex((message) => message.role === 'user'), + activeTurnKey: selectNativeChatActiveTurnKey(messages), currentTurnKey: turn, receipts: new Map(), turnStatuses: { active: null, completedByTurn: {} }, diff --git a/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts b/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts index 6bc5a2d9b1d9..5f1fc09b3a14 100644 --- a/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it } from 'vitest' import type { NativeChatMessage } from '../../../../shared/native-chat-types' import { + selectNativeChatActiveTurnKey, selectNativeChatTurnStatuses, type NativeChatTurnStatus } from '../../../../shared/native-chat-turn-status' @@ -38,7 +39,7 @@ function build( return buildNativeChatTranscriptSlots({ messages, turnKeys, - latestUserIndex: messages.findLastIndex((message) => message.role === 'user'), + activeTurnKey: selectNativeChatActiveTurnKey(messages), currentTurnKey: undefined, receipts: new Map(), turnStatuses: NO_STATUSES, @@ -112,7 +113,7 @@ describe('transcript slots', () => { it('keeps a message whose only content is a turn status under it', () => { const status: NativeChatTurnStatus = { startedAt: 1, thinking: false, workedSeconds: 4 } const slots = build([text('u', '', 'user')], { - latestUserIndex: 0, + activeTurnKey: 'u', turnStatuses: { active: status, completedByTurn: {} } }) expect(slots).toHaveLength(1) @@ -142,7 +143,7 @@ describe('transcript slots', () => { it('puts the running turn bar under the prompt it answers', () => { const status: NativeChatTurnStatus = { startedAt: 1, thinking: false, workedSeconds: null } const slots = build([text('u', 'ask', 'user'), text('a', 'answer')], { - latestUserIndex: 0, + activeTurnKey: 'u', turnStatuses: { active: status, completedByTurn: {} }, isWorking: true }) diff --git a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts index cf2acedfc686..6e0dc5bff4bc 100644 --- a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts +++ b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts @@ -60,7 +60,8 @@ export type NativeChatTranscriptSlot = { export type NativeChatTranscriptSlotsInput = { messages: readonly NativeChatMessage[] turnKeys: readonly (string | undefined)[] - latestUserIndex: number + /** The user message whose bar carries the live turn's status. */ + activeTurnKey: string currentTurnKey: string | undefined receipts: ReadonlyMap turnStatuses: { @@ -84,7 +85,7 @@ export function buildNativeChatTranscriptSlots( const { messages, turnKeys, - latestUserIndex, + activeTurnKey, currentTurnKey, receipts, turnStatuses, @@ -151,7 +152,7 @@ export function buildNativeChatTranscriptSlots( const turnKey = turnKeys[index] const receipt = receipts.get(message.id) const candidateStatus = - index === latestUserIndex + message.role === 'user' && message.id === activeTurnKey ? turnStatuses.active : message.role === 'user' && turnKey ? turnStatuses.completedByTurn[turnKey] diff --git a/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts b/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts index cec8d63a9c70..b48025533f48 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts @@ -8,6 +8,7 @@ import type { NativeChatResolvedPrompt } from './native-chat-resolution-receipt' import type { NativeChatTurnDiff } from './native-chat-turn-diffs' import { buildNativeChatTranscriptSlots } from './native-chat-transcript-slots' import { useNativeChatMessageRail } from './use-native-chat-message-rail' +import { selectNativeChatActiveTurnKey } from '../../../../shared/native-chat-turn-status' function message(id: string, role: NativeChatMessage['role']): NativeChatMessage { return { @@ -31,7 +32,7 @@ function slotsOf(messages: NativeChatMessage[]) { return buildNativeChatTranscriptSlots({ messages, turnKeys, - latestUserIndex: messages.findLastIndex((entry) => entry.role === 'user'), + activeTurnKey: selectNativeChatActiveTurnKey(messages), currentTurnKey: undefined, receipts: new Map(), turnStatuses: { active: null, completedByTurn: {} }, diff --git a/src/renderer/src/components/native-chat/use-native-chat-turn-status.ts b/src/renderer/src/components/native-chat/use-native-chat-turn-status.ts index 82d98c77ec0d..95db05141d2b 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-turn-status.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-turn-status.ts @@ -12,14 +12,15 @@ export type { NativeChatTurnStatus } export function useNativeChatTurnStatus({ messages, - latestUserIndex, + activeTurnKey, isWorking, workingStartedAt, settledTurns, thinking = false }: { messages: readonly NativeChatMessage[] - latestUserIndex: number + /** The user message whose bar carries the live clock (`selectNativeChatActiveTurnKey`). */ + activeTurnKey: string isWorking: boolean workingStartedAt?: number | null /** Host-recorded durations; they outrank whatever this client observed. */ @@ -30,8 +31,6 @@ export function useNativeChatTurnStatus({ active: NativeChatTurnStatus | null completedByTurn: Readonly> } { - const latestUserId = latestUserIndex !== -1 ? (messages[latestUserIndex]?.id ?? null) : null - const activeTurnKey = latestUserId ?? '__unanchored__' const [timingByTurn, setTimingByTurn] = useState({}) useLayoutEffect(() => { diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session.ts b/src/renderer/src/components/native-chat/use-structured-agent-session.ts index 659bbafbbd94..d9ca4995b13b 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session.ts +++ b/src/renderer/src/components/native-chat/use-structured-agent-session.ts @@ -156,6 +156,7 @@ export function useStructuredAgentSession(args: { isWorking: transportState.isWorking, workingStartedAt: transportState.turnTiming.workingStartedAt, settledTurns: transportState.turnTiming.settledTurns, + activeTurnOpenedBy: transportState.turnTiming.activeTurnOpenedBy, turnActivity: transportState.turnActivity, backgroundTasks: transportState.backgroundTasks, turnId: transportState.turnId, diff --git a/src/renderer/src/components/native-chat/use-structured-agent-turn-timing.ts b/src/renderer/src/components/native-chat/use-structured-agent-turn-timing.ts index 5603c82b42f2..1c26fd9750c2 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-turn-timing.ts +++ b/src/renderer/src/components/native-chat/use-structured-agent-turn-timing.ts @@ -5,18 +5,16 @@ import type { } from '../../../../shared/agent-session-journal-types' import type { NativeChatSettledTurns } from '../../../../shared/native-chat-turn-status' import type { StructuredAgentHostClock } from '../../../../shared/structured-agent-session-reducer' -import { - selectStructuredAgentRunningTurnTiming, - selectStructuredAgentSettledTurns -} from '../../../../shared/structured-agent-session-turn-timing' +import { selectStructuredAgentTurnBars } from '../../../../shared/structured-agent-session-turn-timing' import { stepStructuredAgentTurnClock, type StructuredAgentTurnClockLatch } from '../../../../shared/structured-agent-turn-clock-anchor' /** Host-recorded turn timing for the structured lane: settled durations straight - * off the journal, and a skew-free start for the live counter whose host-to-local - * conversion is latched once per turn. */ + * off the journal, the user message that owns the running turn's bar, and a + * skew-free start for the live counter whose host-to-local conversion is latched + * once per turn. */ export function useStructuredAgentTurnTiming( { items, @@ -28,16 +26,16 @@ export function useStructuredAgentTurnTiming( hostClock?: StructuredAgentHostClock | null }, turnId: string | null -): { settledTurns: NativeChatSettledTurns; workingStartedAt: number | null } { - const settledTurns = useMemo( - () => selectStructuredAgentSettledTurns(items, submissions), - [items, submissions] +): { + settledTurns: NativeChatSettledTurns + workingStartedAt: number | null + activeTurnOpenedBy: string | null +} { + const { settledTurns, runningTiming, activeTurnOpenedBy } = useMemo( + () => selectStructuredAgentTurnBars(items, submissions, turnId), + [items, submissions, turnId] ) const [latch, setLatch] = useState(null) - const runningTiming = useMemo( - () => (turnId === null ? null : selectStructuredAgentRunningTurnTiming(items, turnId)), - [items, turnId] - ) // Stamp during render (React's derive-from-props pattern) so the first paint of // a new turn already counts from the right instant. const step = stepStructuredAgentTurnClock({ @@ -50,5 +48,5 @@ export function useStructuredAgentTurnTiming( if (step.latch !== latch) { setLatch(step.latch) } - return { settledTurns, workingStartedAt: step.workingStartedAt } + return { settledTurns, workingStartedAt: step.workingStartedAt, activeTurnOpenedBy } } diff --git a/src/shared/native-chat-turn-status.ts b/src/shared/native-chat-turn-status.ts index 1b0613bd7163..acbab30aabfd 100644 --- a/src/shared/native-chat-turn-status.ts +++ b/src/shared/native-chat-turn-status.ts @@ -4,6 +4,8 @@ // (used directly — mobile ships English only) so the two surfaces never drift. // Everything here is pure; each platform owns its own clock. +import type { NativeChatMessage } from './native-chat-types' + export const NATIVE_CHAT_TURN_STATUS_COPY = { thinking: 'Thinking', working: 'Working…', @@ -101,6 +103,23 @@ export type NativeChatTurnStatus = { export type NativeChatTurnTimingByTurn = Readonly> +/** The live turn's key when the transcript has no user message to hang it on. */ +export const NATIVE_CHAT_UNANCHORED_TURN_KEY = '__unanchored__' + +/** The user message whose bar carries the live clock: the one the host says opened + * the running turn — a message sent while it runs is not that one — else, when the + * host names none, the latest user message. */ +export function selectNativeChatActiveTurnKey( + messages: readonly NativeChatMessage[], + activeTurnOpenedBy?: string | null +): string { + return ( + activeTurnOpenedBy ?? + messages.findLast((message) => message.role === 'user')?.id ?? + NATIVE_CHAT_UNANCHORED_TURN_KEY + ) +} + /** The turn-timing state machine, lifted out of the React hook so desktop and * mobile stamp start/stop identically. Returns the same reference when nothing * changed so callers can bail out of a state update. */ diff --git a/src/shared/structured-agent-session-turn-bars.test.ts b/src/shared/structured-agent-session-turn-bars.test.ts new file mode 100644 index 000000000000..0f4732a3aac2 --- /dev/null +++ b/src/shared/structured-agent-session-turn-bars.test.ts @@ -0,0 +1,401 @@ +import { describe, expect, it } from 'vitest' +import type { + AgentJournalRenderItem, + AgentJournalSubmission, + AgentJournalTurnLifecycle +} from './agent-session-journal-types' +import type { NativeChatMessage } from './native-chat-types' +import { + reduceNativeChatTurnTiming, + selectNativeChatActiveTurnKey, + selectNativeChatTurnStatuses, + type NativeChatTurnTimingByTurn +} from './native-chat-turn-status' +import { + selectStructuredAgentSettledTurns, + selectStructuredAgentTurnBars, + structuredAgentTurnLocalStartedAt, + structuredAgentTurnOrigin +} from './structured-agent-session-turn-timing' + +// Host clock of a live Claude repro (journal rows 44-79): prompt A runs a ~60 s tool +// chain; 4 s later the user sends B, which Claude picks up by interrupting A's turn. +const T = 1_790_580_000_000 +const PRIOR = { requestedAt: 1_790_579_265_055, startedAt: 1_790_579_270_679 } +const PRIOR_END = 1_790_579_272_584 +const A = { sent: T + 74_595, started: T + 76_146, ended: T + 92_372 } +const B = { sent: T + 79_006, started: T + 92_372, ended: T + 144_349 } +const SESSION = 'claude:55368cfb' + +function user( + sequence: number, + clientMessageId: string, + observedAt: number +): AgentJournalRenderItem { + return { + itemId: `orca:${clientMessageId}`, + revision: 0, + sequence, + observedAt, + body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text: clientMessageId }] } + } +} + +function turn( + sequence: number, + observedAt: number, + record: AgentJournalTurnLifecycle +): AgentJournalRenderItem { + return { + itemId: `legacy:claude:55368cfb:turn-lifecycle%3A${record.turnId}`, + revision: 1, + sequence, + observedAt, + body: { kind: 'turn', ...record } + } +} + +function tool(sequence: number, observedAt: number): AgentJournalRenderItem { + return { + itemId: `orca:claude-tool%3A${sequence}`, + revision: 1, + sequence, + observedAt, + body: { kind: 'tool-call', name: 'Bash', input: { command: 'sleep 15' }, state: 'running' } + } +} + +function accepted(clientMessageId: string, providerItemId: string | null): AgentJournalSubmission { + return { + clientMessageId, + fence: 1, + payloadFingerprint: 'fp', + dispatchState: providerItemId ? 'accepted' : 'pending', + providerItemId, + reason: null, + submittedAt: 1, + resolvedAt: providerItemId ? 2 : null + } +} + +const priorTurn = turn(47, PRIOR_END + 153, { + turnId: '5901cefd', + state: 'completed', + ...PRIOR, + completedAt: PRIOR_END, + durationMs: 6_218, + userItemId: `${SESSION}:5901cefd` +}) +const turn1 = { turnId: '1020ab78', userItemId: `${SESSION}:1020ab78` } +const turn2 = { turnId: '6891a0bc', userItemId: `${SESSION}:6891a0bc` } +const history = [user(44, 'prior', PRIOR.requestedAt), priorTurn] +const priorSubmission = accepted('prior', `${SESSION}:5901cefd`) + +/** B sent while turn 1 still runs (rows 54-61). */ +const whileQueued = { + turnId: turn1.turnId, + items: [ + ...history, + user(54, 'A', A.sent), + turn(57, T + 77_224, { + ...turn1, + state: 'running', + startedAt: A.started, + requestedAt: A.sent + }), + tool(58, T + 77_223), + user(60, 'B', B.sent) + ], + submissions: [priorSubmission, accepted('A', turn1.userItemId), accepted('B', null)] +} + +/** Claude ended turn 1 to pick up B (rows 62-65). */ +const turn1Ended = turn(57, A.ended + 1, { + ...turn1, + state: 'interrupted', + startedAt: A.started, + requestedAt: A.sent, + completedAt: A.ended +}) +const whileB = { + turnId: turn2.turnId, + items: [ + ...history, + user(54, 'A', A.sent), + turn1Ended, + tool(58, T + 92_329), + user(60, 'B', B.sent), + turn(65, B.started, { ...turn2, state: 'running', startedAt: B.started, requestedAt: B.sent }) + ], + submissions: [priorSubmission, accepted('A', turn1.userItemId), accepted('B', turn2.userItemId)] +} + +/** Both settled (row 78). Claude's own duration for B counts from turn 1's start. */ +const settled = { + items: [ + ...whileB.items.slice(0, -1), + turn(65, B.ended + 1, { + ...turn2, + state: 'completed', + startedAt: B.started, + requestedAt: B.sent, + completedAt: B.ended, + durationMs: 69_595 + }) + ], + submissions: whileB.submissions +} + +function message(id: string, role: NativeChatMessage['role'] = 'user'): NativeChatMessage { + return { id, role, blocks: [{ type: 'text', text: id }], timestamp: null, source: 'transcript' } +} + +describe('a send queued behind a running Claude turn', () => { + it('leaves the live bar with the prompt that opened the running turn', () => { + const bars = selectStructuredAgentTurnBars( + whileQueued.items, + whileQueued.submissions, + whileQueued.turnId + ) + expect(bars.activeTurnOpenedBy).toBe('orca:A') + const transcript = [message('orca:prior'), message('orca:A'), message('orca:B')] + expect(selectNativeChatActiveTurnKey(transcript, bars.activeTurnOpenedBy)).toBe('orca:A') + // A was sent into an idle session: it counts from its own send, as before. + expect(bars.runningTiming).toEqual({ + state: 'running', + startedAt: A.started, + requestedAt: A.sent, + observedAt: T + 77_224 + }) + expect(bars.settledTurns.has('orca:B')).toBe(false) + }) + + it("moves the bar to B when its own turn opens, counting from A's end", () => { + const bars = selectStructuredAgentTurnBars(whileB.items, whileB.submissions, whileB.turnId) + expect(bars.activeTurnOpenedBy).toBe('orca:B') + expect(bars.settledTurns.get('orca:A')).toEqual({ startedAt: A.started, workedSeconds: 17 }) + expect(bars.runningTiming && structuredAgentTurnOrigin(bars.runningTiming)).toBe(A.ended) + // A client attaching 3 s into turn 2 counts 3 s, not the 13 s B waited behind turn 1. + expect(structuredAgentTurnLocalStartedAt(bars.runningTiming!, 50_000, B.started + 3_000)).toBe( + 47_000 + ) + }) + + it('settles from the same origin the live counter used, so the bars sum to wall time', () => { + const settledTurns = selectStructuredAgentSettledTurns(settled.items, settled.submissions) + expect(settledTurns.get('orca:A')).toEqual({ startedAt: A.started, workedSeconds: 17 }) + // Not 65 s from B's send, and not Claude's own 69.6 s, which counts from turn 1's start. + expect(settledTurns.get('orca:B')).toEqual({ startedAt: B.started, workedSeconds: 51 }) + // The turn before A never overlapped a send; its duration is unchanged. + expect(settledTurns.get('orca:prior')).toEqual({ startedAt: PRIOR.startedAt, workedSeconds: 7 }) + + const liveOriginB = structuredAgentTurnOrigin( + selectStructuredAgentTurnBars(whileB.items, whileB.submissions, whileB.turnId).runningTiming! + ) + expect(Math.floor((B.ended - liveOriginB) / 1000)).toBe(51) + expect(A.ended - A.sent + (B.ended - liveOriginB)).toBe(B.ended - A.sent) + expect(selectStructuredAgentTurnBars(settled.items, settled.submissions, null)).toMatchObject({ + activeTurnOpenedBy: null, + runningTiming: null + }) + }) + + it('shows one live bar under A while B waits, then A settled and B live', () => { + const transcript = [message('orca:A'), message('orca:tool', 'assistant'), message('orca:B')] + const validTurnKeys = new Set(['orca:A', 'orca:B']) + let timing: NativeChatTurnTimingByTurn = {} + const pass = ( + snapshot: { items: AgentJournalRenderItem[]; submissions: AgentJournalSubmission[] }, + turnId: string, + now: number + ) => { + const bars = selectStructuredAgentTurnBars(snapshot.items, snapshot.submissions, turnId) + const activeTurnKey = selectNativeChatActiveTurnKey(transcript, bars.activeTurnOpenedBy) + const workingStartedAt = structuredAgentTurnLocalStartedAt(bars.runningTiming!, now, now) + timing = reduceNativeChatTurnTiming(timing, { + activeTurnKey, + validTurnKeys, + isWorking: true, + workingStartedAt, + now + }) + return selectNativeChatTurnStatuses(timing, { + activeTurnKey, + isWorking: true, + workingStartedAt, + thinking: false, + settledByTurn: bars.settledTurns + }) + } + + const queued = pass(whileQueued, whileQueued.turnId, B.sent + 1_000) + expect(timing['orca:A']?.startedAt).toBe(A.sent) + expect(timing['orca:B']).toBeUndefined() + expect(queued.completedByTurn['orca:B']).toBeUndefined() + + const running = pass(whileB, whileB.turnId, B.started + 1_000) + expect(running.completedByTurn['orca:A']?.workedSeconds).toBe(17) + expect(running.active?.startedAt).toBe(A.ended) + }) +}) + +describe('a send Codex folds into the running turn', () => { + const key = 'codex:thread:t1:0' + const items: AgentJournalRenderItem[] = [ + { ...user(1, 'first', 1_000) }, + { + itemId: 'legacy:codex:s:turn-lifecycle%3At1', + revision: 1, + sequence: 2, + observedAt: 1_200, + body: { + kind: 'turn', + turnId: 't1', + state: 'running', + userItemId: key, + requestedAt: 1_000, + startedAt: 1_200 + } + }, + { ...user(3, 'second', 4_000) } + ] + const submissions = [accepted('first', key), accepted('second', key)] + const ended: AgentJournalRenderItem[] = [ + items[0]!, + { + ...items[1]!, + observedAt: 9_000, + body: { + kind: 'turn', + turnId: 't1', + state: 'completed', + userItemId: key, + requestedAt: 1_000, + startedAt: 1_200, + completedAt: 9_000 + } + }, + items[2]! + ] + const transcript = [message('orca:first'), message('orca:second')] + + it('keeps exactly one bar, under the opening prompt, live and settled', () => { + const live = selectStructuredAgentTurnBars(items, submissions, 't1') + expect(selectNativeChatActiveTurnKey(transcript, live.activeTurnOpenedBy)).toBe('orca:first') + expect(live.runningTiming && structuredAgentTurnOrigin(live.runningTiming)).toBe(1_000) + + let timing: NativeChatTurnTimingByTurn = {} + const validTurnKeys = new Set(['orca:first', 'orca:second']) + timing = reduceNativeChatTurnTiming(timing, { + activeTurnKey: 'orca:first', + validTurnKeys, + isWorking: true, + workingStartedAt: 1_000, + now: 4_500 + }) + const after = selectStructuredAgentTurnBars(ended, submissions, null) + // The turn is over: nothing names an owner, so the key falls back to the newest prompt, + // which never ran a turn of its own and so has nothing to settle. + const activeTurnKey = selectNativeChatActiveTurnKey(transcript, after.activeTurnOpenedBy) + expect(activeTurnKey).toBe('orca:second') + timing = reduceNativeChatTurnTiming(timing, { + activeTurnKey, + validTurnKeys, + isWorking: false, + workingStartedAt: null, + now: 9_500 + }) + const statuses = selectNativeChatTurnStatuses(timing, { + activeTurnKey, + isWorking: false, + thinking: false, + settledByTurn: after.settledTurns + }) + expect(statuses.active).toBeNull() + expect(Object.keys(statuses.completedByTurn)).toEqual(['orca:first']) + expect(statuses.completedByTurn['orca:first']?.workedSeconds).toBe(8) + }) +}) + +describe('turns whose host names no opener', () => { + it('falls back to the newest prompt for an older host row with no user key', () => { + const items = [ + user(1, 'u1', 1_000), + turn(2, 1_100, { turnId: 't1', state: 'running', startedAt: 1_100 }), + user(3, 'u2', 2_000) + ] + const bars = selectStructuredAgentTurnBars(items, [], 't1') + expect(bars.activeTurnOpenedBy).toBeNull() + expect(selectNativeChatActiveTurnKey([message('orca:u1'), message('orca:u2')], null)).toBe( + 'orca:u2' + ) + // Settled timing keeps its journal-order attribution. + expect([...selectStructuredAgentSettledTurns(items).keys()]).toEqual(['orca:u1']) + }) + + it('falls back for a turn the provider opened and keyed to itself', () => { + const self = 'legacy:claude:55368cfb:turn-lifecycle%3Aresumed' + const items = [ + user(1, 'u1', 1_000), + turn(2, 5_000, { + turnId: 'resumed', + state: 'running', + startedAt: 5_000, + userItemId: self + }) + ] + expect(selectStructuredAgentTurnBars(items, [], 'resumed').activeTurnOpenedBy).toBeNull() + }) + + it('names nothing for the unanchored transcript', () => { + expect(selectNativeChatActiveTurnKey([message('a', 'assistant')], null)).toBe('__unanchored__') + }) +}) + +describe('the previous turn has no recorded end', () => { + it('leaves an unverifiable turn null and a later send counting from itself', () => { + const items = [ + user(1, 'u1', 1_000), + turn(2, 3_000, { turnId: 't1', state: 'unverifiable', userItemId: 'orca:u1' }), + user(3, 'u2', 10_000), + turn(4, 12_000, { + turnId: 't2', + state: 'completed', + userItemId: 'orca:u2', + requestedAt: 10_000, + startedAt: 11_000, + completedAt: 20_000 + }) + ] + const settledTurns = selectStructuredAgentSettledTurns(items) + expect(settledTurns.get('orca:u1')).toBeNull() + expect(settledTurns.get('orca:u2')).toEqual({ startedAt: 11_000, workedSeconds: 10 }) + }) + + it("waits out the previous row's last host revision, never past its own start", () => { + const queued = (lastSeenAt: number) => + selectStructuredAgentTurnBars( + [ + user(1, 'u1', 1_000), + turn(2, lastSeenAt, { + turnId: 't1', + state: 'unverifiable', + userItemId: 'orca:u1', + startedAt: 1_000 + }), + user(3, 'u2', 2_000), + turn(4, 9_000, { + turnId: 't2', + state: 'running', + userItemId: 'orca:u2', + requestedAt: 2_000, + startedAt: 9_000 + }) + ], + [], + 't2' + ).runningTiming! + expect(structuredAgentTurnOrigin(queued(6_000))).toBe(6_000) + expect(structuredAgentTurnOrigin(queued(12_000))).toBe(9_000) + }) +}) diff --git a/src/shared/structured-agent-session-turn-timing.ts b/src/shared/structured-agent-session-turn-timing.ts index 3f480013886d..9d93639e1817 100644 --- a/src/shared/structured-agent-session-turn-timing.ts +++ b/src/shared/structured-agent-session-turn-timing.ts @@ -23,12 +23,18 @@ export type StructuredAgentTurnTiming = { completedAt?: number /** The provider's own measurement; used when exact host endpoints are unavailable. */ durationMs?: number + /** Host clock this turn's send stopped waiting behind the journal's previous + * turn; present only when the send was issued before that turn ended. */ + queuedUntil?: number /** Host clock when the lifecycle row was appended; with `startedAt` it gives * the host-side lag a client must subtract to anchor a live counter. */ observedAt: number } -function readTiming(item: AgentJournalRenderItem): StructuredAgentTurnTiming | null { +function readTiming( + item: AgentJournalRenderItem, + precedingTurnEndedAt: number | undefined +): StructuredAgentTurnTiming | null { const turn = readAgentJournalTurn(item.body) if (!turn) { return null @@ -49,26 +55,47 @@ function readTiming(item: AgentJournalRenderItem): StructuredAgentTurnTiming | n durationMs !== undefined && Number.isFinite(durationMs) && durationMs >= 0 ? durationMs : undefined + // A send queued behind the previous turn counts from that turn's end (recorded, else its row's + // last host revision), never past this turn's own start: the provider opens it only after. + const queuedUntil = + precedingTurnEndedAt === undefined ? undefined : Math.min(precedingTurnEndedAt, startedAt) return { state, startedAt, ...(requested !== undefined ? { requestedAt: requested } : {}), ...(end !== undefined ? { completedAt: end } : {}), ...(measured !== undefined ? { durationMs: measured } : {}), + ...(requested !== undefined && queuedUntil !== undefined && queuedUntil > requested + ? { queuedUntil } + : {}), observedAt: item.observedAt } } -/** Timing keyed by the user message that opened each turn. A row can name the - * submission directly or by a provider key that resolves through its alias. - * Rows from older hosts carry no key and fall back +/** One turn record, read in journal order. */ +type StructuredAgentJournalTurn = { + timing: StructuredAgentTurnTiming | null + /** The user message the host names as the turn's opener; null when it names + * none (an older host, or a turn the provider opened and keyed to itself). */ + openedBy: string | null +} + +type StructuredAgentJournalTurns = { + /** Timing keyed by the user message that opened each turn. */ + byUserItem: ReadonlyMap + byTurnId: ReadonlyMap +} + +/** Every turn record in one pass over the journal. A row can name its user + * message directly or by a provider key that resolves through its alias. + * Rows from older hosts carry no key and fall back, for timing only, * to the nearest user message before them in journal order — the submission * row is written ahead of dispatch, so it always precedes the provider's * turn-start. Untimed rows are skipped unless explicitly unverifiable (null). */ -export function selectStructuredAgentTurnTimings( +function readStructuredAgentJournalTurns( items: readonly AgentJournalRenderItem[], submissions: readonly AgentJournalSubmission[] = [] -): ReadonlyMap { +): StructuredAgentJournalTurns { const itemIds = new Set(items.map((item) => item.itemId)) const aliases = new Map() // Codex folds a send issued mid-turn into the running turn under the SAME provider @@ -78,26 +105,43 @@ export function selectStructuredAgentTurnTimings( aliases.set(submission.providerItemId, agentJournalSubmissionKey(submission.clientMessageId)) } } - const timings = new Map() + const byUserItem = new Map() + const byTurnId = new Map() let precedingUserItemId: string | null = null + let precedingTurnEndedAt: number | undefined for (const item of items) { if (item.body.kind === 'message' && item.body.role === 'user') { precedingUserItemId = item.itemId continue } const turn = readAgentJournalTurn(item.body) - const timing = readTiming(item) - if (!timing && turn?.state !== 'unverifiable') { + if (!turn) { continue } - const key = turn?.userItemId - const userItemId = - key === undefined ? precedingUserItemId : itemIds.has(key) ? key : (aliases.get(key) ?? null) + const timing = readTiming(item, precedingTurnEndedAt) + precedingTurnEndedAt = timing?.completedAt ?? item.observedAt + const key = turn.userItemId + const named = key === undefined ? null : itemIds.has(key) ? key : (aliases.get(key) ?? null) + byTurnId.set(turn.turnId, { + timing, + openedBy: named === item.itemId ? null : named + }) + if (!timing && turn.state !== 'unverifiable') { + continue + } + const userItemId = key === undefined ? precedingUserItemId : named if (userItemId !== null) { - timings.set(userItemId, timing) + byUserItem.set(userItemId, timing) } } - return timings + return { byUserItem, byTurnId } +} + +export function selectStructuredAgentTurnTimings( + items: readonly AgentJournalRenderItem[], + submissions: readonly AgentJournalSubmission[] = [] +): ReadonlyMap { + return readStructuredAgentJournalTurns(items, submissions).byUserItem } /** The live turn's lifecycle timing, or null when its row carries no host start @@ -106,20 +150,15 @@ export function selectStructuredAgentRunningTurnTiming( items: readonly AgentJournalRenderItem[], turnId: string ): StructuredAgentTurnTiming | null { - for (let index = items.length - 1; index >= 0; index -= 1) { - const item = items[index] - if (item && readAgentJournalTurn(item.body)?.turnId === turnId) { - return readTiming(item) - } - } - return null + return readStructuredAgentJournalTurns(items).byTurnId.get(turnId)?.timing ?? null } /** The single instant every reading of a turn's elapsed time counts from: the - * send that opened it when the host named one, the provider turn-open otherwise. + * send that opened it when the host named one — or, for a send queued behind the + * previous turn, that turn's end — and the provider turn-open otherwise. * One origin is what keeps the live counter and the settled duration agreeing. */ export function structuredAgentTurnOrigin(timing: StructuredAgentTurnTiming): number { - return timing.requestedAt ?? timing.startedAt + return timing.queuedUntil ?? timing.requestedAt ?? timing.startedAt } /** Whole seconds a settled turn ran, or null when the host never observed its end. */ @@ -129,9 +168,9 @@ export function completedStructuredAgentTurnSeconds( if (!timing || (timing.state !== 'completed' && timing.state !== 'interrupted')) { return null } - // Provider durations may begin at turn-open, so exact host endpoints preserve the live origin. + // Provider durations may begin before the live origin (turn-open, or a turn this send queued behind). if (timing.requestedAt !== undefined && timing.completedAt !== undefined) { - return Math.max(0, Math.floor((timing.completedAt - timing.requestedAt) / 1000)) + return Math.max(0, Math.floor((timing.completedAt - structuredAgentTurnOrigin(timing)) / 1000)) } if (timing.durationMs !== undefined) { return Math.floor(timing.durationMs / 1000) @@ -170,9 +209,16 @@ export function structuredAgentTurnLocalStartedAt( export function selectStructuredAgentSettledTurns( items: readonly AgentJournalRenderItem[], submissions: readonly AgentJournalSubmission[] = [] +): NativeChatSettledTurns { + return settledTurnsOf(readStructuredAgentJournalTurns(items, submissions), submissions) +} + +function settledTurnsOf( + turns: StructuredAgentJournalTurns, + submissions: readonly AgentJournalSubmission[] ): NativeChatSettledTurns { const settled = new Map() - for (const [userItemId, timing] of selectStructuredAgentTurnTimings(items, submissions)) { + for (const [userItemId, timing] of turns.byUserItem) { const workedSeconds = completedStructuredAgentTurnSeconds(timing) settled.set( userItemId, @@ -189,3 +235,24 @@ export function selectStructuredAgentSettledTurns( } return settled } + +/** Everything a chat surface reads off the journal for its turn bars, from one + * pass: settled durations, the running turn's timing, and the user message that + * owns its bar — which a message sent while the turn runs is not. */ +export function selectStructuredAgentTurnBars( + items: readonly AgentJournalRenderItem[], + submissions: readonly AgentJournalSubmission[], + turnId: string | null +): { + settledTurns: NativeChatSettledTurns + runningTiming: StructuredAgentTurnTiming | null + activeTurnOpenedBy: string | null +} { + const turns = readStructuredAgentJournalTurns(items, submissions) + const running = turnId === null ? undefined : turns.byTurnId.get(turnId) + return { + settledTurns: settledTurnsOf(turns, submissions), + runningTiming: running?.timing ?? null, + activeTurnOpenedBy: running?.openedBy ?? null + } +} From c30c8f9d7775fba6f897af5ee4b88dfda6f3056e Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:22:47 -0700 Subject: [PATCH 65/90] fix(native-chat): a message Claude folds into its running turn no longer splits the turn (#23621) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(native-chat): treat a folded mid-turn Claude replay as a receipt, not a turn boundary A message sent while a Claude turn runs is folded into the running turn by the CLI and replayed mid-turn with the client uuid. The replay-driven opener treated that replay as a new turn: the running turn was marked interrupted and the 'Worked for' bar split. The dispatch waiter now captures the open turn at write time (sentDuringTurnId, volatile); a replay that adopts the client uuid while that exact turn is still open settles delivery and opens no boundary. Plural result user_message_uuids settle each waiter under its own uuid; every other relation (miss, replaced turn, provider-resumed root, idle write, fresh replay uuid) keeps the opener path. Replay/turn resolution split out of the dispatch module to hold the line budget. * fix(native-chat): state the fold receipt's uuid-adoption limit as unmeasured The receipt admits only a replay that adopts the client uuid. The comment and test named a fresh replay uuid as "the CLI starting the queued send's own turn", but the measured miss case adopts the client uuid too, so adoption does not tell a fold from a later turn. Say what the rule actually is: the measured fold shape qualifies, and an unmeasured fresh-uuid replay keeps the opener path it always had. No behavior change. * fix(native-chat): decide Claude fold receipts from the provider's own request cycle Measured (p3 captures, CLI 2.1.280): the CLI folds any send that arrives while its request cycle runs — including one written before the first replay — and it announces every new cycle (sequential turn, queued turn, background wake, /compact) with a root system/init; each result names the sends its cycle ran in user_message_uuids. So the fold decision now reads provider state: an adopted replay while the open turn's cycle is still live (no root init since it opened) is a delivery receipt. The send-time bookkeeping (sentDuringTurnId) is removed; it missed the measured early-steer fold and guessed at what the provider states outright. A lost result is covered by the init staleness mark, and CLIs below the per-turn-init version floor (or with no reported version) keep today's opener path via an explicit gate on the init frame's claude_code_version. * fix(native-chat): read Claude fold membership from the cycle's own work A finished background task revises its row before the wake cycle's init, so the wake turn opened ahead of that init and was marked stale by it: a send folded into the wake still split the bar and interrupted the wake turn (captured p3-background-wake order). A send replayed after the current cycle's first root work (send echo or model output) is the fold; the cycle's first send is its opener. Init and every settle start a cycle with no work. * fix(native-chat): adopt the CLI version from any init frame, not only the startup proof Live sessions prove the session from a SessionStart hook frame that arrives BEFORE system/init, so startup facts read a frame with no claude_code_version and the fold receipt's version gate never passed: the real app still split the bar and marked the running turn interrupted while every fixture test — whose harness proves startup with the init frame itself — stayed green. The version is now adopted from whichever init frame carries it, at the same site that already adopts the per-turn model report, and the startup proof never clobbers a version a real init already reported. Pinned twice: a fixture run whose startup proof is the SessionStart hook frame, and a real-CLI fold test (skipped without a signed-in CLI) that fails on the unfixed branch at the interrupted assertion and passes with the fix. * test(native-chat): run the real-CLI fold test in the config dir it probed The connection strips an inherited CLAUDE_CONFIG_DIR and inherited auth vars, and with no launch env the pin compared against that same inherited value and emitted nothing, so the fold test always ran against ~/.claude whatever CLAUDE_CONFIG_DIR the availability probe checked. It also relied on the user's own SessionStart hooks for the live proof order and on their permission rules for the Bash steps; an isolated home hung at startup. The test now launches with the probed home and env auth, and pins a SessionStart hook and the sleep permission itself. * fix(native-chat): drop the CLI-version gate and prove the fold against full adapter captures The fold rule stands on frame-derived facts alone: an adopted client uuid (the capability check, read off the replay itself) while the open turn's cycle has done root work. The claude_code_version floor guarded only an unobserved triple fault — an adopting CLI without per-turn init AND a lost result — and its cost was a silent latch that already fired once live; all cliVersion plumbing is removed. Mid-turn auto-compaction was measured (forced via CLAUDE_CODE_AUTO_COMPACT_WINDOW): it emits status/compact_boundary and a synthetic continuation but NO root init, so the init cycle reset stays and the capture is pinned. The fake connection now defaults to the live startup shape (SessionStart hook proof; one init when the first command starts a cycle; capabilities on the initialize result), with init-at-startup an explicit unmeasured opt-in. Full frame streams recorded through Orca's own adapter against the real CLI are committed and replayed verbatim, asserting the provider's membership fact (each result's user_message_uuids) rather than design internals. * test(native-chat): drop the removed CLI-version gate from fold test comments Also reattaches the fake harness's initProof doc to initProof (it had landed on contextUsage, replacing that field's own doc) and renames a plural-result test whose title described a retired waiter it never creates. * test(native-chat): name the fold test's settings for their role * chore: take main's lockfile back after the merge * test(claude): route the real-CLI probe through the spawn chokepoint; give the slow-init test a live startup report The shared real-CLI availability probe moved out of a test file, so the child_process and CLI-runtime-pairing ratchets now scan it. It spawns through runProcessSync with the CLI paired to its own node, as the structured launch does. The provider-started test's CLI default now reaches startup the live way: get_settings reports it, since system/init only arrives with the first command. --- .../claude-adapter-capture-early-steer.jsonl | 68 ++ .../claude-adapter-capture-fold.jsonl | 65 ++ .../claude-adapter-capture-miss.jsonl | 85 +++ .../claude-adapter-capture-replay.test.ts | 233 +++++++ .../claude-can-use-tool-test-support.ts | 30 + ...captured-fold-steer-frames.test-fixture.ts | 275 ++++++++ ...-fold-steer-frame-builders.test-fixture.ts | 184 ++++++ .../claude/claude-fold-steer-receipt.test.ts | 622 ++++++++++++++++++ .../claude-journal-translator-contract.ts | 4 + src/main/claude/claude-open-turn.ts | 24 + ...aude-real-cli-availability-test-support.ts | 64 ++ .../claude/claude-replay-turn-resolution.ts | 221 +++++++ .../claude-structured-control-actions.test.ts | 1 + .../claude-structured-control-actions.ts | 6 +- ...aude-structured-dispatch-admission.test.ts | 8 +- .../claude-structured-dispatch-waiters.ts | 10 +- .../claude/claude-structured-dispatch.test.ts | 3 +- src/main/claude/claude-structured-dispatch.ts | 167 +---- ...claude-structured-effort-reporting.test.ts | 11 +- .../claude-structured-journal-translation.ts | 18 + ...aude-structured-model-confirmation.test.ts | 14 +- ...claude-structured-prompt-ownership.test.ts | 4 +- .../claude-structured-prompt-ownership.ts | 2 +- .../claude-structured-real-cli-fold.test.ts | 194 ++++++ .../claude/claude-structured-real-cli.test.ts | 40 +- .../claude-structured-session-acquisition.ts | 2 +- ...e-structured-session-adapter-turns.test.ts | 14 + .../claude-structured-session-adapter.test.ts | 10 +- ...claude-structured-session-recovery.test.ts | 2 +- .../claude/claude-structured-session-state.ts | 4 +- .../claude-structured-session-test-support.ts | 73 +- src/main/claude/claude-turn-ownership.test.ts | 2 + ...red-agent-session-provider-started.test.ts | 12 +- .../structured-mailbox-pointer-host.test.ts | 2 +- .../structured-session-pointer-delivery.ts | 3 +- ...structured-worker-group-addressing.test.ts | 2 +- .../structured-worker-group-addressing.ts | 4 +- 37 files changed, 2220 insertions(+), 263 deletions(-) create mode 100644 src/main/claude/__fixtures__/claude-adapter-capture-early-steer.jsonl create mode 100644 src/main/claude/__fixtures__/claude-adapter-capture-fold.jsonl create mode 100644 src/main/claude/__fixtures__/claude-adapter-capture-miss.jsonl create mode 100644 src/main/claude/claude-adapter-capture-replay.test.ts create mode 100644 src/main/claude/claude-can-use-tool-test-support.ts create mode 100644 src/main/claude/claude-captured-fold-steer-frames.test-fixture.ts create mode 100644 src/main/claude/claude-fold-steer-frame-builders.test-fixture.ts create mode 100644 src/main/claude/claude-fold-steer-receipt.test.ts create mode 100644 src/main/claude/claude-real-cli-availability-test-support.ts create mode 100644 src/main/claude/claude-replay-turn-resolution.ts create mode 100644 src/main/claude/claude-structured-real-cli-fold.test.ts diff --git a/src/main/claude/__fixtures__/claude-adapter-capture-early-steer.jsonl b/src/main/claude/__fixtures__/claude-adapter-capture-early-steer.jsonl new file mode 100644 index 000000000000..bff60192d740 --- /dev/null +++ b/src/main/claude/__fixtures__/claude-adapter-capture-early-steer.jsonl @@ -0,0 +1,68 @@ +{"at": 0, "kind": "meta", "scenario": "early-steer", "providerSessionId": "00000000-0000-4000-8000-00000000c1a0", "note": "Recorded through Orca adapter vs Claude CLI 2.1.280; scrubbed: session id, home/tmp paths."} +{"at": 219, "kind": "frame", "frame": {"type": "system", "subtype": "hook_started", "hook_id": "e13780eb-2f2b-45e5-a9fd-e7868ef6d9e2", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "308e42c2-3222-452b-bb5f-f8e41cf485a4", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 229, "kind": "frame", "frame": {"type": "system", "subtype": "hook_response", "hook_id": "e13780eb-2f2b-45e5-a9fd-e7868ef6d9e2", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "\n", "stdout": "\n", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "8c37d862-0ba3-4e14-a746-68a29d137384", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 242, "kind": "dispatch", "clientMessageId": "client-A", "sentUuid": "c64cdf14-1349-4be1-b0a4-5613890d57bd", "text": "Use the Bash tool to run `sleep 8` two separate times, one call at a time, waiting for each. Then reply exactly: FIRST DONE", "outcome": {"state": "admitted"}} +{"at": 244, "kind": "frame", "frame": {"type": "system", "subtype": "session_state_changed", "state": "running", "uuid": "052ca984-de90-4289-ac97-587d361f35dc", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 244, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "c64cdf14-1349-4be1-b0a4-5613890d57bd", "state": "queued", "uuid": "e32cf6db-6c39-49ad-87a6-ad8f392e00b1", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 244, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "c64cdf14-1349-4be1-b0a4-5613890d57bd", "state": "started", "uuid": "0c7a74e6-8f5e-43c4-9cf0-af6e3fac6e0f", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 259, "kind": "frame", "frame": {"type": "system", "subtype": "init", "cwd": "/tmp/scrubbed-cwd", "session_id": "00000000-0000-4000-8000-00000000c1a0", "tools": ["Task", "AskUserQuestion", "Bash", "CronCreate", "CronDelete", "CronList", "DesignSync", "Edit", "EnterPlanMode", "EnterWorktree", "ExitPlanMode", "ExitWorktree", "ListAgents", "NotebookEdit", "Read", "ReportFindings", "ScheduleWakeup", "SendMessage", "Skill", "TaskCreate", "TaskGet", "TaskList", "TaskStop", "TaskUpdate", "ToolSearch", "WebFetch", "WebSearch", "Workflow", "Write"], "mcp_servers": [], "model": "claude-opus-5-5[1m]", "permissionMode": "default", "slash_commands": ["deep-research", "design", "design-sync", "dataviz", "update-config", "verify", "debug", "code-review", "simplify", "batch", "fewer-permission-prompts", "doctor", "loop", "claude-api", "workflow-authoring", "run", "run-skill-generator", "agents", "auto-mode-setup", "autocompact", "clear", "color", "compact", "config", "output-style", "context", "effort", "fast", "heapdump", "init", "mcp", "model", "__remote-workflow", "workflow-launch-exec", "reload-plugins", "reload-skills", "rename", "security-review", "usage", "insights", "recap", "goal", "design-consent", "design-revoke", "list-agents", "team-onboarding"], "terminal_slash_commands": ["doctor", "color", "reload-plugins"], "apiKeySource": "none", "claude_code_version": "2.1.280", "output_style": "default", "agents": ["claude", "Explore", "general-purpose", "Plan", "statusline-setup"], "skills": ["deep-research", "design", "design-sync", "dataviz", "update-config", "verify", "debug", "code-review", "simplify", "batch", "fewer-permission-prompts", "doctor", "loop", "claude-api", "workflow-authoring", "run", "run-skill-generator"], "plugins": [{"name": "telemetry", "path": "builtin", "source": "telemetry@builtin"}], "capabilities": ["interrupt_receipt_v1", "interrupt_cancel_queued_v1", "msg_lifecycle_v1", "mcp_read_resource_v1", "mcp_tool_ui_meta_v1"], "analytics_disabled": false, "product_feedback_disabled": false, "uuid": "ff6bb8ec-afcb-4bb8-88a8-d75625377ab9", "memory_paths": {"auto": "/Users/user/scrubbed"}, "messaging_socket_path": "/tmp/scrubbed.sock", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required"}} +{"at": 261, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "9900a74e-78ff-48a6-b005-8b748a8f7a1d"}} +{"at": 492, "kind": "dispatch", "clientMessageId": "client-B", "sentUuid": "3a4cf7ae-5121-45d4-8c99-76625c847c4e", "text": "Also say the word banana at the end of your reply.", "outcome": {"state": "admitted"}} +{"at": 493, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "3a4cf7ae-5121-45d4-8c99-76625c847c4e", "state": "queued", "uuid": "2244a4b7-a832-418a-b6e9-be4657618f60", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 1342, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"type": "text", "text": "Use the Bash tool to run `sleep 8` two separate times, one call at a time, waiting for each. Then reply exactly: FIRST DONE"}]}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "c64cdf14-1349-4be1-b0a4-5613890d57bd", "timestamp": "2026-09-28T12:50:50.211Z", "isReplay": true}} +{"at": 1342, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsEi9RgiS61CeGuiyaP", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 5242, "cache_read_input_tokens": 11514, "cache_creation": {"ephemeral_5m_input_tokens": 5242, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "25b0f48f-8de3-4e58-a53f-76cedc10c4e8", "ttft_ms": 1075, "user_message_uuid": "c64cdf14-1349-4be1-b0a4-5613890d57bd", "user_message_uuids": ["c64cdf14-1349-4be1-b0a4-5613890d57bd"]}} +{"at": 1342, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "tool_use", "id": "toolu_01RL5fbYfvXaRva9PBe2C7Qn", "name": "Bash", "input": {}, "caller": {"type": "direct"}}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "54809bd1-bb5a-4fe7-9a04-1dc60e5a7163"}} +{"at": 1342, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "02a681bb-01c9-4dd3-b890-040e17bf4132"}} +{"at": 2307, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "{\"com"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "0a1147d0-c168-405a-a4e4-79ad5266d3c2"}} +{"at": 2307, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "mand\": \"s"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "1eabfcb6-b0c4-403a-9804-c55b013391ae"}} +{"at": 2307, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "lee"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "20f34e40-6392-4e4a-9991-ad35ad6b1aaa"}} +{"at": 2309, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "p 8\""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "ec8ed822-0e8f-46c1-b7a0-c8ab4467baa9"}} +{"at": 2330, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ", \"descri"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "87881476-c659-4e82-945d-be15eaa45501"}} +{"at": 2332, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ption\": \""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "e2502f3a-3cca-4741-9df5-dade6f4e4abb"}} +{"at": 2332, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "Sl"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "dc28f0f9-22f5-47fc-a374-1369c6fda079"}} +{"at": 2335, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "eep f"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "85345f83-b80d-4142-aa66-66b8640dca3b"}} +{"at": 2340, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "or 8 "}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "5ce61d4a-abd9-47bd-9c7b-e01a6d566387"}} +{"at": 2341, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "seconds\"}"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "21de6d37-199b-44d7-bfaa-4af1471a7235"}} +{"at": 2343, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsEi9RgiS61CeGuiyaP", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01RL5fbYfvXaRva9PBe2C7Qn", "name": "Bash", "input": {"command": "sleep 8", "description": "Sleep for 8 seconds"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 5242, "cache_read_input_tokens": 11514, "cache_creation": {"ephemeral_5m_input_tokens": 5242, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "3f3c0fff-9ca6-49f9-8b73-36e569af5a38", "timestamp": "2026-09-28T12:50:52.296Z", "request_id": "req_011CfVsEhBPEiAFbbAE18svX", "user_message_uuid": "c64cdf14-1349-4be1-b0a4-5613890d57bd", "user_message_uuids": ["c64cdf14-1349-4be1-b0a4-5613890d57bd"]}} +{"at": 2347, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "fa196eb6-011b-4fa7-831d-4ffe2582a3c7"}} +{"at": 2375, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "tool_use", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 5242, "cache_read_input_tokens": 11514, "output_tokens": 82, "output_tokens_details": {"thinking_tokens": 0}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "7b300bd2-eaa1-4cb7-a557-6908cbb6f2a6"}} +{"at": 2380, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "c1573618-e6fb-4f22-8939-e7959440f18a"}} +{"at": 5482, "kind": "frame", "frame": {"type": "system", "subtype": "task_started", "task_id": "bys65yjga", "tool_use_id": "toolu_01RL5fbYfvXaRva9PBe2C7Qn", "description": "Sleep for 8 seconds", "is_backgrounded": false, "task_type": "local_bash", "uuid": "6b741fb3-6edc-4c9e-a69a-81fc87ef1502", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 10493, "kind": "frame", "frame": {"type": "system", "subtype": "task_notification", "task_id": "bys65yjga", "tool_use_id": "toolu_01RL5fbYfvXaRva9PBe2C7Qn", "status": "completed", "output_file": "", "summary": "Sleep for 8 seconds", "uuid": "9b0edc57-cd0c-4f60-a72c-e359e1a7fabc", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 10496, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"tool_use_id": "toolu_01RL5fbYfvXaRva9PBe2C7Qn", "type": "tool_result", "content": "(Bash completed with no output)", "is_error": false}]}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "2f7a468f-55f1-4434-8f68-70a077f74f6e", "timestamp": "2026-09-28T12:51:00.450Z", "tool_use_result": {"stdout": "", "stderr": "", "interrupted": false, "isImage": false, "noOutputExpected": false}}} +{"at": 10499, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"type": "text", "text": "Also say the word banana at the end of your reply."}]}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "3a4cf7ae-5121-45d4-8c99-76625c847c4e", "timestamp": "2026-09-28T12:50:50.448Z", "isReplay": true}} +{"at": 10499, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "3a4cf7ae-5121-45d4-8c99-76625c847c4e", "state": "started", "uuid": "aca666d1-c3b3-451e-81d7-5aadfa246b42", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 10499, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "ee6f2da9-2514-4086-8bc4-1a5c01e5207b"}} +{"at": 11452, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsFTNDFHDiwBZc8cKWk", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 217, "cache_read_input_tokens": 16756, "cache_creation": {"ephemeral_5m_input_tokens": 217, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "571285ce-eda5-44b5-818c-db549ee9aef9", "ttft_ms": 949}} +{"at": 11452, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "tool_use", "id": "toolu_01HG7iwC2HgvoxndbuytmJCM", "name": "Bash", "input": {}, "caller": {"type": "direct"}}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "6d6d5ecd-0889-4592-b514-d72c0a964cc9"}} +{"at": 11453, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "58339280-14b3-4f61-bd2b-726418d4b324"}} +{"at": 11853, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "{\"comma"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "37c5f88b-3ef0-471c-89b1-a8dc6f3f61ad"}} +{"at": 11866, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "nd\": \"s"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "f31aa8f4-903d-4a7d-aeff-41c16f4b487d"}} +{"at": 11866, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "leep 8\""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "b1b59a9c-cec2-4398-9e8e-e49f16ad712d"}} +{"at": 11882, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ", \"desc"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "25d130db-a0f9-43d2-b639-6a9064f1e00d"}} +{"at": 11883, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ription"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "e0b776a6-7cb3-4512-bacc-07fc84a1737e"}} +{"at": 11883, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "\": \"Sle"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "54ec71a5-84ad-4f45-849f-cdbeae44d781"}} +{"at": 11883, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ep for "}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "667d1090-ceca-4c88-9864-447d6c95784e"}} +{"at": 11883, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "8 secon"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "2047e8e3-feb9-484d-8a1a-c19f0afebd59"}} +{"at": 11883, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ds\"}"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "7d4f9da1-d974-4acf-84a5-d1f22068beec"}} +{"at": 11884, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsFTNDFHDiwBZc8cKWk", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01HG7iwC2HgvoxndbuytmJCM", "name": "Bash", "input": {"command": "sleep 8", "description": "Sleep for 8 seconds"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 217, "cache_read_input_tokens": 16756, "cache_creation": {"ephemeral_5m_input_tokens": 217, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "6c4c5b57-e219-4c0d-a90f-26cbae8a33df", "timestamp": "2026-09-28T12:51:01.838Z", "request_id": "req_011CfVsFSwuBKQ87EU42vew5"}} +{"at": 11885, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "df9289e5-af2a-4b85-8dc8-47df67725383"}} +{"at": 11885, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "tool_use", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 217, "cache_read_input_tokens": 16756, "output_tokens": 82, "output_tokens_details": {"thinking_tokens": 0}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "7ac75599-4149-466f-ab0b-4d4ef74a9c86"}} +{"at": 11885, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "ea092344-1e27-4b3f-9145-e388a268a4a1"}} +{"at": 14890, "kind": "frame", "frame": {"type": "system", "subtype": "task_started", "task_id": "bu917pf4q", "tool_use_id": "toolu_01HG7iwC2HgvoxndbuytmJCM", "description": "Sleep for 8 seconds", "is_backgrounded": false, "task_type": "local_bash", "uuid": "408f8301-dbd6-43cb-8f09-7f7d5f4325da", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 19903, "kind": "frame", "frame": {"type": "system", "subtype": "task_notification", "task_id": "bu917pf4q", "tool_use_id": "toolu_01HG7iwC2HgvoxndbuytmJCM", "status": "completed", "output_file": "", "summary": "Sleep for 8 seconds", "uuid": "55ee40ae-c83e-40de-ae7c-fb0659950b39", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 19906, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"tool_use_id": "toolu_01HG7iwC2HgvoxndbuytmJCM", "type": "tool_result", "content": "(Bash completed with no output)", "is_error": false}]}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "ee783948-1a20-4797-b0ef-b191babd6a68", "timestamp": "2026-09-28T12:51:09.859Z", "tool_use_result": {"stdout": "", "stderr": "", "interrupted": false, "isImage": false, "noOutputExpected": false}}} +{"at": 19908, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "dec2fc2c-f27f-44c2-bbda-01b112f803d6"}} +{"at": 21540, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsGBuJTPMNVKzDFTw9k", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 121, "cache_read_input_tokens": 16973, "cache_creation": {"ephemeral_5m_input_tokens": 121, "ephemeral_1h_input_tokens": 0}, "output_tokens": 11, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "14cb8df8-de6e-43e8-a0be-46c883c88501", "ttft_ms": 1627}} +{"at": 21540, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "text", "text": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "f346ec9e-fe33-4c2e-a611-b2da26f43f53"}} +{"at": 21540, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": "FIRST DONE ban"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "6440a3c0-de10-4e9e-a898-7ef0ec79673c"}} +{"at": 21540, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": "ana"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "7096cb35-c640-4698-b755-8aad289d6cef"}} +{"at": 21556, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsGBuJTPMNVKzDFTw9k", "type": "message", "role": "assistant", "content": [{"type": "text", "text": "FIRST DONE banana"}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 121, "cache_read_input_tokens": 16973, "cache_creation": {"ephemeral_5m_input_tokens": 121, "ephemeral_1h_input_tokens": 0}, "output_tokens": 11, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "5c9408ee-fcd2-46e8-aca0-1e2e8563420c", "timestamp": "2026-09-28T12:51:11.495Z", "request_id": "req_011CfVsG9F4VXdbez6Yd6wis"}} +{"at": 21556, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "12aa2a40-1da6-45bc-bd9e-a1f999c144d2"}} +{"at": 21556, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "end_turn", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 121, "cache_read_input_tokens": 16973, "output_tokens": 11, "output_tokens_details": {"thinking_tokens": 0}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "fee3cade-9b96-4f0e-8657-b23a6c6f83ca"}} +{"at": 21557, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "b39aedff-1723-46d2-8fbf-d62b2fe8f2ac"}} +{"at": 21559, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "3a4cf7ae-5121-45d4-8c99-76625c847c4e", "state": "completed", "uuid": "5b6a0e7a-361d-42ae-983a-5ecc00d6ff8c", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 21562, "kind": "frame", "frame": {"duration_api_ms": 6682, "stop_reason": "end_turn", "session_id": "00000000-0000-4000-8000-00000000c1a0", "total_cost_usd": 0.045744599999999996, "usage": {"input_tokens": 6, "cache_creation_input_tokens": 5580, "cache_read_input_tokens": 45243, "output_tokens": 175, "output_tokens_details": {"thinking_tokens": 0}, "server_tool_use": {"web_search_requests": 0, "web_fetch_requests": 0}, "service_tier": "standard", "cache_creation": {"ephemeral_1h_input_tokens": 0, "ephemeral_5m_input_tokens": 5580}, "inference_geo": "not_available", "iterations": [], "speed": "standard"}, "modelUsage": {"claude-opus-5-5[1m]": {"inputTokens": 1219, "outputTokens": 196, "cacheReadInputTokens": 45243, "cacheCreationInputTokens": 5580, "webSearchRequests": 0, "costUSD": 0.045744599999999996, "contextWindow": 1000000, "maxOutputTokens": 128000, "thinkingTokens": 0, "canonicalModel": "claude-opus-5-5", "provider": "firstParty", "costBasis": "list"}}, "permission_denials": [], "terminal_reason": "completed", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required", "subagent_stats": {"spawned": 0, "requested": {"background": 0, "foreground": 0, "unset": 0}, "started_in_background": 0, "max_depth": 0, "spawned_by_subagents": 0, "completed": 0, "failed": 0, "killed": {"parent": 0, "user": 0, "system": 0}, "refused": {"depth_limit": 0, "concurrency_limit": 0, "budget": 0}, "by_type": {}}, "is_error": false, "num_turns": 3, "subtype": "success", "api_error_status": null, "result": "FIRST DONE banana", "ttft_ms": 2096, "type": "result", "duration_ms": 21314, "uuid": "02543cfd-4942-47f9-82d7-0bd79a2ed93d", "ttft_stream_ms": 1096, "time_to_request_ms": 21, "first_content_frame_ms": 1096, "user_message_uuid": "c64cdf14-1349-4be1-b0a4-5613890d57bd", "user_message_uuids": ["c64cdf14-1349-4be1-b0a4-5613890d57bd", "3a4cf7ae-5121-45d4-8c99-76625c847c4e"], "request_sent_wall_ms": 1790599850221, "queued_turn_count": 0, "result_index": 0}} +{"at": 21563, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "c64cdf14-1349-4be1-b0a4-5613890d57bd", "state": "completed", "uuid": "ef4b1bcb-e9cf-42f0-a0f9-b25a59a56efe", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 21563, "kind": "frame", "frame": {"type": "system", "subtype": "session_state_changed", "state": "idle", "uuid": "fce05c2c-6c43-4c7d-a347-ec3e378e3afc", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 24574, "kind": "end", "results": 1} diff --git a/src/main/claude/__fixtures__/claude-adapter-capture-fold.jsonl b/src/main/claude/__fixtures__/claude-adapter-capture-fold.jsonl new file mode 100644 index 000000000000..5bf4b2f863c8 --- /dev/null +++ b/src/main/claude/__fixtures__/claude-adapter-capture-fold.jsonl @@ -0,0 +1,65 @@ +{"at": 1, "kind": "meta", "scenario": "fold", "providerSessionId": "00000000-0000-4000-8000-00000000c1a0", "note": "Recorded through Orca adapter vs Claude CLI 2.1.280; scrubbed: session id, home/tmp paths."} +{"at": 242, "kind": "frame", "frame": {"type": "system", "subtype": "hook_started", "hook_id": "e8d2b9c8-d0d0-442f-9b86-580619257967", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "fedf8819-07f0-41f5-bc48-24a71fa9940d", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 254, "kind": "frame", "frame": {"type": "system", "subtype": "hook_response", "hook_id": "e8d2b9c8-d0d0-442f-9b86-580619257967", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "\n", "stdout": "\n", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "fed65947-fa85-4c2d-9bd6-1c01159922b4", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 269, "kind": "dispatch", "clientMessageId": "client-A", "sentUuid": "c1a5941b-1bd4-4729-8289-5a25b22ff5b2", "text": "Use the Bash tool to run `sleep 8` two separate times, one call at a time, waiting for each. Then reply exactly: FIRST DONE", "outcome": {"state": "admitted"}} +{"at": 272, "kind": "frame", "frame": {"type": "system", "subtype": "session_state_changed", "state": "running", "uuid": "c36c2f2e-5c24-426d-819b-ea5f89862dae", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 272, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "c1a5941b-1bd4-4729-8289-5a25b22ff5b2", "state": "queued", "uuid": "65530cf1-9a29-4668-9a9f-91616c315809", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 272, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "c1a5941b-1bd4-4729-8289-5a25b22ff5b2", "state": "started", "uuid": "69d4df37-8379-4fce-bbf7-2a3a6854fbf2", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 287, "kind": "frame", "frame": {"type": "system", "subtype": "init", "cwd": "/tmp/scrubbed-cwd", "session_id": "00000000-0000-4000-8000-00000000c1a0", "tools": ["Task", "AskUserQuestion", "Bash", "CronCreate", "CronDelete", "CronList", "DesignSync", "Edit", "EnterPlanMode", "EnterWorktree", "ExitPlanMode", "ExitWorktree", "ListAgents", "NotebookEdit", "Read", "ReportFindings", "ScheduleWakeup", "SendMessage", "Skill", "TaskCreate", "TaskGet", "TaskList", "TaskStop", "TaskUpdate", "ToolSearch", "WebFetch", "WebSearch", "Workflow", "Write"], "mcp_servers": [], "model": "claude-opus-5-5[1m]", "permissionMode": "default", "slash_commands": ["deep-research", "design", "design-sync", "dataviz", "update-config", "verify", "debug", "code-review", "simplify", "batch", "fewer-permission-prompts", "doctor", "loop", "claude-api", "workflow-authoring", "run", "run-skill-generator", "agents", "auto-mode-setup", "autocompact", "clear", "color", "compact", "config", "output-style", "context", "effort", "fast", "heapdump", "init", "mcp", "model", "__remote-workflow", "workflow-launch-exec", "reload-plugins", "reload-skills", "rename", "security-review", "usage", "insights", "recap", "goal", "design-consent", "design-revoke", "list-agents", "team-onboarding"], "terminal_slash_commands": ["doctor", "color", "reload-plugins"], "apiKeySource": "none", "claude_code_version": "2.1.280", "output_style": "default", "agents": ["claude", "Explore", "general-purpose", "Plan", "statusline-setup"], "skills": ["deep-research", "design", "design-sync", "dataviz", "update-config", "verify", "debug", "code-review", "simplify", "batch", "fewer-permission-prompts", "doctor", "loop", "claude-api", "workflow-authoring", "run", "run-skill-generator"], "plugins": [{"name": "telemetry", "path": "builtin", "source": "telemetry@builtin"}], "capabilities": ["interrupt_receipt_v1", "interrupt_cancel_queued_v1", "msg_lifecycle_v1", "mcp_read_resource_v1", "mcp_tool_ui_meta_v1"], "analytics_disabled": false, "product_feedback_disabled": false, "uuid": "facd6d73-8d9e-4886-a6ab-f0873938128e", "memory_paths": {"auto": "/Users/user/scrubbed"}, "messaging_socket_path": "/tmp/scrubbed.sock", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required"}} +{"at": 289, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "d34f89ba-f2ef-4cbf-99a5-7d4d85c8d02a"}} +{"at": 1527, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"type": "text", "text": "Use the Bash tool to run `sleep 8` two separate times, one call at a time, waiting for each. Then reply exactly: FIRST DONE"}]}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "c1a5941b-1bd4-4729-8289-5a25b22ff5b2", "timestamp": "2026-09-28T12:50:24.512Z", "isReplay": true}} +{"at": 1528, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsCqF1QKvUNMHjZNCWW", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 16754, "cache_read_input_tokens": 0, "cache_creation": {"ephemeral_5m_input_tokens": 16754, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "ac67ce6c-da49-4c1d-bf6a-70e2474ab35f", "ttft_ms": 1230, "user_message_uuid": "c1a5941b-1bd4-4729-8289-5a25b22ff5b2", "user_message_uuids": ["c1a5941b-1bd4-4729-8289-5a25b22ff5b2"]}} +{"at": 1528, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "tool_use", "id": "toolu_01GoyahVsaJSkqYZzb3ci9KQ", "name": "Bash", "input": {}, "caller": {"type": "direct"}}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "9e8e16c5-d002-4034-b955-3a8a00523ba4"}} +{"at": 1528, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "b21cf048-3dbe-4d71-9bb0-9c139be8fb12"}} +{"at": 2612, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "{\"comma"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "2aa7968c-7244-47f1-8e0c-e660514037ee"}} +{"at": 2613, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "nd\": \"s"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "588330dc-afca-4aa7-b90c-73df15fee7c0"}} +{"at": 2613, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "leep 8\""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "75c0ecc9-4a50-4d6f-9731-3fed7e81d265"}} +{"at": 2613, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ", \"desc"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "a773fa58-791c-414f-94f1-a4a04534bdd7"}} +{"at": 2613, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ription"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "9de26ee7-6320-467a-b226-83ec143378d7"}} +{"at": 2613, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "\": \"Sle"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "e3871642-e9b2-4e35-890e-d8d3a7a81e1e"}} +{"at": 2613, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ep 8 se"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "7c1891c7-d7b2-48df-a26e-a7265389c8c7"}} +{"at": 2613, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "conds\"}"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "9d9be75c-c078-4bda-8a3f-dea3967d5a06"}} +{"at": 2615, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsCqF1QKvUNMHjZNCWW", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01GoyahVsaJSkqYZzb3ci9KQ", "name": "Bash", "input": {"command": "sleep 8", "description": "Sleep 8 seconds"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 16754, "cache_read_input_tokens": 0, "cache_creation": {"ephemeral_5m_input_tokens": 16754, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "0788da30-2441-4b32-803e-9ff172725739", "timestamp": "2026-09-28T12:50:26.842Z", "request_id": "req_011CfVsCppDCm7ZivTRsAYEu", "user_message_uuid": "c1a5941b-1bd4-4729-8289-5a25b22ff5b2", "user_message_uuids": ["c1a5941b-1bd4-4729-8289-5a25b22ff5b2"]}} +{"at": 2619, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "40dac8c9-408f-4079-8d63-57e0f3b43ca1"}} +{"at": 2620, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "tool_use", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 16754, "cache_read_input_tokens": 0, "output_tokens": 81, "output_tokens_details": {"thinking_tokens": 0}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "6d1c0ce1-f7ad-463a-ab3d-f7745bce63f9"}} +{"at": 2621, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "b79333a8-7abc-4a32-a31f-249b5fea5f10"}} +{"at": 3640, "kind": "dispatch", "clientMessageId": "client-B", "sentUuid": "7ee6ab25-eafb-4869-85fd-97d058045906", "text": "Also say the word banana at the end of your reply.", "outcome": {"state": "admitted"}} +{"at": 3640, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "7ee6ab25-eafb-4869-85fd-97d058045906", "state": "queued", "uuid": "6395adb0-b318-4284-a298-7b3d89d6b7d7", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 5732, "kind": "frame", "frame": {"type": "system", "subtype": "task_started", "task_id": "beu0xkswp", "tool_use_id": "toolu_01GoyahVsaJSkqYZzb3ci9KQ", "description": "Sleep 8 seconds", "is_backgrounded": false, "task_type": "local_bash", "uuid": "a35b1b34-5810-47dd-bc2c-a38d19077a74", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 10740, "kind": "frame", "frame": {"type": "system", "subtype": "task_notification", "task_id": "beu0xkswp", "tool_use_id": "toolu_01GoyahVsaJSkqYZzb3ci9KQ", "status": "completed", "output_file": "", "summary": "Sleep 8 seconds", "uuid": "3f757c35-2f6c-4b21-bdf4-f8b523809abb", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 10743, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"tool_use_id": "toolu_01GoyahVsaJSkqYZzb3ci9KQ", "type": "tool_result", "content": "(Bash completed with no output)", "is_error": false}]}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "abbb0dbf-e102-4c66-ba3c-7808d634f675", "timestamp": "2026-09-28T12:50:34.971Z", "tool_use_result": {"stdout": "", "stderr": "", "interrupted": false, "isImage": false, "noOutputExpected": false}}} +{"at": 10744, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"type": "text", "text": "Also say the word banana at the end of your reply."}]}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "7ee6ab25-eafb-4869-85fd-97d058045906", "timestamp": "2026-09-28T12:50:27.869Z", "isReplay": true}} +{"at": 10745, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "7ee6ab25-eafb-4869-85fd-97d058045906", "state": "started", "uuid": "30f94896-494d-4002-a1ce-680620e03d54", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 10745, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "bf42e496-1f7f-4095-8d94-19390bd59e50"}} +{"at": 11584, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsDaaVReUJ6r3tdEQhr", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 216, "cache_read_input_tokens": 16754, "cache_creation": {"ephemeral_5m_input_tokens": 216, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "79159e21-d876-467f-abac-86bfe7bf2457", "ttft_ms": 836}} +{"at": 11584, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "tool_use", "id": "toolu_01MxJ1cYsSb1chARZ735hbRk", "name": "Bash", "input": {}, "caller": {"type": "direct"}}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "469a075b-ff35-42c8-b20e-fe4fd3ccf250"}} +{"at": 11585, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "1a0aeaf4-6b9e-441e-86ac-eac3c32204c4"}} +{"at": 12071, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "{\"comma"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "6bb65599-1e9a-40d6-a769-e2b119fee09a"}} +{"at": 12072, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "nd\": \"s"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "04387767-2ce4-42ec-b869-11406432effc"}} +{"at": 12072, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "leep 8\""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "ccc9d7c3-19a3-4691-a104-ae6b9c1b4dfa"}} +{"at": 12072, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ", \"desc"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "90f5078e-ff14-45a6-9377-257c4545bb5f"}} +{"at": 12072, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ription"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "8f04f554-0875-450a-bc0b-89cb339c864b"}} +{"at": 12072, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "\": \"Sle"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "6610a44a-019f-4136-a214-e0fc8e06d67f"}} +{"at": 12073, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ep 8 se"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "5caedf82-9c9e-4e13-ac26-d869ce84e863"}} +{"at": 12073, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "conds\"}"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "8151a90d-7bae-4805-b709-124001edee1d"}} +{"at": 12073, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsDaaVReUJ6r3tdEQhr", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01MxJ1cYsSb1chARZ735hbRk", "name": "Bash", "input": {"command": "sleep 8", "description": "Sleep 8 seconds"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 216, "cache_read_input_tokens": 16754, "cache_creation": {"ephemeral_5m_input_tokens": 216, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "6aaa7086-2892-4c73-a6b6-caef6cf1a2f5", "timestamp": "2026-09-28T12:50:36.299Z", "request_id": "req_011CfVsDa8gykAqKH3jsZE4P"}} +{"at": 12074, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "3a4aa6b1-647e-4228-94c5-decf6d567a2f"}} +{"at": 12074, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "tool_use", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 216, "cache_read_input_tokens": 16754, "output_tokens": 81, "output_tokens_details": {"thinking_tokens": 0}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "a09a8560-21b5-410c-9337-1abfb30caff1"}} +{"at": 12074, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "90522211-133a-4a50-8ae9-21bdef5590d1"}} +{"at": 15093, "kind": "frame", "frame": {"type": "system", "subtype": "task_started", "task_id": "btowzyjp1", "tool_use_id": "toolu_01MxJ1cYsSb1chARZ735hbRk", "description": "Sleep 8 seconds", "is_backgrounded": false, "task_type": "local_bash", "uuid": "c5aa424b-840a-43a2-9586-94feff2f1b97", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 20107, "kind": "frame", "frame": {"type": "system", "subtype": "task_notification", "task_id": "btowzyjp1", "tool_use_id": "toolu_01MxJ1cYsSb1chARZ735hbRk", "status": "completed", "output_file": "", "summary": "Sleep 8 seconds", "uuid": "9ad2b377-9339-4fe9-a2aa-ee9acdb41d08", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 20109, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"tool_use_id": "toolu_01MxJ1cYsSb1chARZ735hbRk", "type": "tool_result", "content": "(Bash completed with no output)", "is_error": false}]}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "e3b1fa1e-6a3d-4156-a1fe-2146aeff2b1e", "timestamp": "2026-09-28T12:50:44.337Z", "tool_use_result": {"stdout": "", "stderr": "", "interrupted": false, "isImage": false, "noOutputExpected": false}}} +{"at": 20110, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "990bcabe-2776-4b87-9ba9-788d3fff81cf"}} +{"at": 21105, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsEGxMrQeN7Y4miT6gp", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 120, "cache_read_input_tokens": 16970, "cache_creation": {"ephemeral_5m_input_tokens": 120, "ephemeral_1h_input_tokens": 0}, "output_tokens": 11, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "2d867ea9-894a-4dfa-a589-7a689402c6b2", "ttft_ms": 992}} +{"at": 21105, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "text", "text": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "ed2beb08-68a1-4159-953c-7a0b85729f4d"}} +{"at": 21106, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": "FIRST DONE ban"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "581dc001-4ef8-4f1b-a741-0534f316d810"}} +{"at": 21106, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": "ana"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "99a38535-8448-4953-b98e-f0740fc8e13a"}} +{"at": 21117, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsEGxMrQeN7Y4miT6gp", "type": "message", "role": "assistant", "content": [{"type": "text", "text": "FIRST DONE banana"}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 120, "cache_read_input_tokens": 16970, "cache_creation": {"ephemeral_5m_input_tokens": 120, "ephemeral_1h_input_tokens": 0}, "output_tokens": 11, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "64e7945b-f3a9-409b-a58d-923a9c4a1f6a", "timestamp": "2026-09-28T12:50:45.334Z", "request_id": "req_011CfVsEGYJNniXhLXGpV5vr"}} +{"at": 21117, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "68da798f-ddd8-4af5-b012-ce4a10811bda"}} +{"at": 21117, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "end_turn", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 120, "cache_read_input_tokens": 16970, "output_tokens": 11, "output_tokens_details": {"thinking_tokens": 0}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "29e16ff5-ab3b-4406-843f-049ee48650cd"}} +{"at": 21117, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "5b7d6bae-6827-48c9-8fab-e43e55949198"}} +{"at": 21119, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "7ee6ab25-eafb-4869-85fd-97d058045906", "state": "completed", "uuid": "0e958675-6553-46b7-9d98-5b667248666d", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 21120, "kind": "frame", "frame": {"duration_api_ms": 6661, "stop_reason": "end_turn", "session_id": "00000000-0000-4000-8000-00000000c1a0", "total_cost_usd": 0.10095080000000002, "usage": {"input_tokens": 6, "cache_creation_input_tokens": 17090, "cache_read_input_tokens": 33724, "output_tokens": 173, "output_tokens_details": {"thinking_tokens": 0}, "server_tool_use": {"web_search_requests": 0, "web_fetch_requests": 0}, "service_tier": "standard", "cache_creation": {"ephemeral_1h_input_tokens": 0, "ephemeral_5m_input_tokens": 17090}, "inference_geo": "not_available", "iterations": [], "speed": "standard"}, "modelUsage": {"claude-opus-5-5[1m]": {"inputTokens": 1219, "outputTokens": 194, "cacheReadInputTokens": 33724, "cacheCreationInputTokens": 17090, "webSearchRequests": 0, "costUSD": 0.10095080000000002, "contextWindow": 1000000, "maxOutputTokens": 128000, "thinkingTokens": 0, "canonicalModel": "claude-opus-5-5", "provider": "firstParty", "costBasis": "list"}}, "permission_denials": [], "terminal_reason": "completed", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required", "subagent_stats": {"spawned": 0, "requested": {"background": 0, "foreground": 0, "unset": 0}, "started_in_background": 0, "max_depth": 0, "spawned_by_subagents": 0, "completed": 0, "failed": 0, "killed": {"parent": 0, "user": 0, "system": 0}, "refused": {"depth_limit": 0, "concurrency_limit": 0, "budget": 0}, "by_type": {}}, "is_error": false, "num_turns": 3, "subtype": "success", "api_error_status": null, "result": "FIRST DONE banana", "ttft_ms": 2340, "type": "result", "duration_ms": 20846, "uuid": "408f97b8-b880-47f8-b778-f94e4e15cd92", "ttft_stream_ms": 1253, "time_to_request_ms": 24, "first_content_frame_ms": 1253, "user_message_uuid": "c1a5941b-1bd4-4729-8289-5a25b22ff5b2", "user_message_uuids": ["c1a5941b-1bd4-4729-8289-5a25b22ff5b2", "7ee6ab25-eafb-4869-85fd-97d058045906"], "request_sent_wall_ms": 1790599824526, "queued_turn_count": 0, "result_index": 0}} +{"at": 21121, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "c1a5941b-1bd4-4729-8289-5a25b22ff5b2", "state": "completed", "uuid": "3b91d2ee-409f-45f5-a7be-aa7a45fb6ac5", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 21121, "kind": "frame", "frame": {"type": "system", "subtype": "session_state_changed", "state": "idle", "uuid": "4de40f8a-4b6c-4333-b1e6-ff528d249af9", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 24243, "kind": "end", "results": 1} diff --git a/src/main/claude/__fixtures__/claude-adapter-capture-miss.jsonl b/src/main/claude/__fixtures__/claude-adapter-capture-miss.jsonl new file mode 100644 index 000000000000..211f6e0eb8dd --- /dev/null +++ b/src/main/claude/__fixtures__/claude-adapter-capture-miss.jsonl @@ -0,0 +1,85 @@ +{"at": 1, "kind": "meta", "scenario": "miss", "providerSessionId": "00000000-0000-4000-8000-00000000c1a0", "note": "Recorded through Orca adapter vs Claude CLI 2.1.280; scrubbed: session id, home/tmp paths."} +{"at": 228, "kind": "frame", "frame": {"type": "system", "subtype": "hook_started", "hook_id": "06af4bab-bef3-426b-96b7-733316a3b251", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "uuid": "9eb2ab97-dce5-430e-9db3-e7d9aa0e7f8d", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 239, "kind": "frame", "frame": {"type": "system", "subtype": "hook_response", "hook_id": "06af4bab-bef3-426b-96b7-733316a3b251", "hook_name": "SessionStart:startup", "hook_event": "SessionStart", "output": "\n", "stdout": "\n", "stderr": "", "exit_code": 0, "outcome": "success", "uuid": "e2266c8c-8e91-4893-9806-1286769a12fd", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 255, "kind": "dispatch", "clientMessageId": "client-A", "sentUuid": "712482eb-4c05-4f67-8888-a11843c2729f", "text": "Use the Bash tool to run `sleep 8` two separate times, one call at a time, waiting for each. Then reply exactly: FIRST DONE", "outcome": {"state": "admitted"}} +{"at": 257, "kind": "frame", "frame": {"type": "system", "subtype": "session_state_changed", "state": "running", "uuid": "a6e277fb-d7fc-418a-88f2-2d893feea0d0", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 257, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "712482eb-4c05-4f67-8888-a11843c2729f", "state": "queued", "uuid": "57d845c0-8945-4528-82a5-8fbe83381714", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 258, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "712482eb-4c05-4f67-8888-a11843c2729f", "state": "started", "uuid": "a2a8821a-7b4a-4332-95da-765eb95c2745", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 273, "kind": "frame", "frame": {"type": "system", "subtype": "init", "cwd": "/tmp/scrubbed-cwd", "session_id": "00000000-0000-4000-8000-00000000c1a0", "tools": ["Task", "AskUserQuestion", "Bash", "CronCreate", "CronDelete", "CronList", "DesignSync", "Edit", "EnterPlanMode", "EnterWorktree", "ExitPlanMode", "ExitWorktree", "ListAgents", "NotebookEdit", "Read", "ReportFindings", "ScheduleWakeup", "SendMessage", "Skill", "TaskCreate", "TaskGet", "TaskList", "TaskStop", "TaskUpdate", "ToolSearch", "WebFetch", "WebSearch", "Workflow", "Write"], "mcp_servers": [], "model": "claude-opus-5-5[1m]", "permissionMode": "default", "slash_commands": ["deep-research", "design", "design-sync", "dataviz", "update-config", "verify", "debug", "code-review", "simplify", "batch", "fewer-permission-prompts", "doctor", "loop", "claude-api", "workflow-authoring", "run", "run-skill-generator", "agents", "auto-mode-setup", "autocompact", "clear", "color", "compact", "config", "output-style", "context", "effort", "fast", "heapdump", "init", "mcp", "model", "__remote-workflow", "workflow-launch-exec", "reload-plugins", "reload-skills", "rename", "security-review", "usage", "insights", "recap", "goal", "design-consent", "design-revoke", "list-agents", "team-onboarding"], "terminal_slash_commands": ["doctor", "color", "reload-plugins"], "apiKeySource": "none", "claude_code_version": "2.1.280", "output_style": "default", "agents": ["claude", "Explore", "general-purpose", "Plan", "statusline-setup"], "skills": ["deep-research", "design", "design-sync", "dataviz", "update-config", "verify", "debug", "code-review", "simplify", "batch", "fewer-permission-prompts", "doctor", "loop", "claude-api", "workflow-authoring", "run", "run-skill-generator"], "plugins": [{"name": "telemetry", "path": "builtin", "source": "telemetry@builtin"}], "capabilities": ["interrupt_receipt_v1", "interrupt_cancel_queued_v1", "msg_lifecycle_v1", "mcp_read_resource_v1", "mcp_tool_ui_meta_v1"], "analytics_disabled": false, "product_feedback_disabled": false, "uuid": "ea0c12f1-7e48-4001-a577-5e4abb2e9c5f", "memory_paths": {"auto": "/Users/user/scrubbed"}, "messaging_socket_path": "/tmp/scrubbed.sock", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required"}} +{"at": 275, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "85ed497a-5e78-4ac6-aa9c-2ebe37063403"}} +{"at": 1303, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"type": "text", "text": "Use the Bash tool to run `sleep 8` two separate times, one call at a time, waiting for each. Then reply exactly: FIRST DONE"}]}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "712482eb-4c05-4f67-8888-a11843c2729f", "timestamp": "2026-09-28T12:51:16.373Z", "isReplay": true}} +{"at": 1303, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsGeUUTEuaYMdT2HtPQ", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 5244, "cache_read_input_tokens": 11514, "cache_creation": {"ephemeral_5m_input_tokens": 5244, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "61853b4b-5722-4b7b-94d8-15304f575d2c", "ttft_ms": 1022, "user_message_uuid": "712482eb-4c05-4f67-8888-a11843c2729f", "user_message_uuids": ["712482eb-4c05-4f67-8888-a11843c2729f"]}} +{"at": 1304, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "tool_use", "id": "toolu_016sNyp5R1LwYkaBUj9UKWYs", "name": "Bash", "input": {}, "caller": {"type": "direct"}}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "df0f12a2-35bb-424c-8f28-40e6fcc07960"}} +{"at": 1304, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "5bcd51ce-460b-4891-8978-332c44f66114"}} +{"at": 2559, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "{\"comma"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "9744edc1-59cc-4c22-959a-8bfba7abc2ef"}} +{"at": 2559, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "nd\": \"s"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "4b7645f6-f050-4271-91f0-544df1ff0931"}} +{"at": 2559, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "leep 8\""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "11acbd0f-fc8e-4642-8897-8815951dd4ee"}} +{"at": 2637, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ", \"desc"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "4d140c8b-47f3-44e4-aade-212f63e2b40a"}} +{"at": 2637, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ription"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "a51d0b53-c118-4de5-a848-aa4bdf7d86c7"}} +{"at": 2649, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "\": \"Sle"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "a128c776-0a6a-4923-952f-3633f4b91239"}} +{"at": 2649, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ep for "}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "ddce72e4-cbcc-45f1-966d-dd873f59d687"}} +{"at": 2650, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "8 secon"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "44392f6b-e3ac-4caa-8abe-ee1b99ba6783"}} +{"at": 2650, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ds\"}"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "a5bc170f-84ba-4ac7-b104-b36d95c69049"}} +{"at": 2652, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsGeUUTEuaYMdT2HtPQ", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_016sNyp5R1LwYkaBUj9UKWYs", "name": "Bash", "input": {"command": "sleep 8", "description": "Sleep for 8 seconds"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 5244, "cache_read_input_tokens": 11514, "cache_creation": {"ephemeral_5m_input_tokens": 5244, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "4a86f704-4cdc-4561-840d-dee6e913ebf9", "timestamp": "2026-09-28T12:51:18.753Z", "request_id": "req_011CfVsGe1gx1SqtHypyjG4P", "user_message_uuid": "712482eb-4c05-4f67-8888-a11843c2729f", "user_message_uuids": ["712482eb-4c05-4f67-8888-a11843c2729f"]}} +{"at": 2655, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "f79e14ed-a3e2-4ebf-88bb-a45ed5ee6a78"}} +{"at": 2657, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "tool_use", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 5244, "cache_read_input_tokens": 11514, "output_tokens": 82, "output_tokens_details": {"thinking_tokens": 0}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "6b586bec-0544-4cdb-9fc5-fadae3c7d6ed"}} +{"at": 2657, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "3c602652-b8a2-4b38-b54d-ecb1f99b1201"}} +{"at": 5768, "kind": "frame", "frame": {"type": "system", "subtype": "task_started", "task_id": "bnnik2zr1", "tool_use_id": "toolu_016sNyp5R1LwYkaBUj9UKWYs", "description": "Sleep for 8 seconds", "is_backgrounded": false, "task_type": "local_bash", "uuid": "5213fad9-0ff9-4f01-b934-7f7155ba396b", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 10782, "kind": "frame", "frame": {"type": "system", "subtype": "task_notification", "task_id": "bnnik2zr1", "tool_use_id": "toolu_016sNyp5R1LwYkaBUj9UKWYs", "status": "completed", "output_file": "", "summary": "Sleep for 8 seconds", "uuid": "f37669e5-c402-43ac-823f-1a7f9005a834", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 10785, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"tool_use_id": "toolu_016sNyp5R1LwYkaBUj9UKWYs", "type": "tool_result", "content": "(Bash completed with no output)", "is_error": false}]}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "12161028-12c4-470e-a82d-1f6f4ee64aba", "timestamp": "2026-09-28T12:51:26.887Z", "tool_use_result": {"stdout": "", "stderr": "", "interrupted": false, "isImage": false, "noOutputExpected": false}}} +{"at": 10787, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "e0454575-2f1d-47c0-b9f3-4ecadbaaa122"}} +{"at": 11596, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsHQJiVw1uJvCEPhMGa", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 121, "cache_read_input_tokens": 16758, "cache_creation": {"ephemeral_5m_input_tokens": 121, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "834585ab-8f03-423d-ae43-825a12b9f45e", "ttft_ms": 805}} +{"at": 11597, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "tool_use", "id": "toolu_01BiKvSfSEAwNM1DwshGhsT6", "name": "Bash", "input": {}, "caller": {"type": "direct"}}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "273975d6-06bf-4eff-87aa-dca1a6d39b5c"}} +{"at": 11597, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "2c9121cf-a472-476e-9626-05d4577ff349"}} +{"at": 11950, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "{\"comma"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "c2cb4769-ee86-4eda-9af7-f75a89493101"}} +{"at": 11950, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "nd\": \"s"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "8e70eae8-653c-40ad-8a12-f37068234009"}} +{"at": 11950, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "leep 8\""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "0135507b-0b6e-41fe-bd1c-17becb10430f"}} +{"at": 12026, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": ", \"desc"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "94802121-d71b-4781-856c-f40f78498ebe"}} +{"at": 12026, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ription"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "ec03999d-3810-405e-b36a-58d8d0f4e4ac"}} +{"at": 12026, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "\": \"Sle"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "2183a548-e1b7-48c5-a4d8-58ab6ae4acc9"}} +{"at": 12026, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ep for "}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "d8ffd37e-3d9d-46a4-b6e1-d52cb96a334d"}} +{"at": 12026, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "8 secon"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "2c51be8c-ef09-42eb-a07b-c9083d3e349c"}} +{"at": 12026, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "input_json_delta", "partial_json": "ds\"}"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "e4957303-3d3f-47b4-aaed-0ec6210e1e81"}} +{"at": 12027, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsHQJiVw1uJvCEPhMGa", "type": "message", "role": "assistant", "content": [{"type": "tool_use", "id": "toolu_01BiKvSfSEAwNM1DwshGhsT6", "name": "Bash", "input": {"command": "sleep 8", "description": "Sleep for 8 seconds"}, "caller": {"type": "direct"}}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 121, "cache_read_input_tokens": 16758, "cache_creation": {"ephemeral_5m_input_tokens": 121, "ephemeral_1h_input_tokens": 0}, "output_tokens": 16, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "03e0a7fa-a83c-4688-9504-8b7fa5c9f6ff", "timestamp": "2026-09-28T12:51:28.129Z", "request_id": "req_011CfVsHPsQjwKL4424e8EfN"}} +{"at": 12028, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "56ad793f-dcd0-4f9d-9dcc-49c2054d18c7"}} +{"at": 12036, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "tool_use", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 121, "cache_read_input_tokens": 16758, "output_tokens": 82, "output_tokens_details": {"thinking_tokens": 0}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "98e98f29-79a1-4db9-9cd4-c4fe810eca7e"}} +{"at": 12036, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "3629fbc7-6420-45ae-88be-cd9b779e721a"}} +{"at": 15034, "kind": "frame", "frame": {"type": "system", "subtype": "task_started", "task_id": "buewgpxis", "tool_use_id": "toolu_01BiKvSfSEAwNM1DwshGhsT6", "description": "Sleep for 8 seconds", "is_backgrounded": false, "task_type": "local_bash", "uuid": "fa9ac561-8bf7-4035-9aa8-221e4cd91dfb", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 20045, "kind": "frame", "frame": {"type": "system", "subtype": "task_notification", "task_id": "buewgpxis", "tool_use_id": "toolu_01BiKvSfSEAwNM1DwshGhsT6", "status": "completed", "output_file": "", "summary": "Sleep for 8 seconds", "uuid": "230550ea-a7f7-4171-9080-901cfdd0d571", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 20047, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"tool_use_id": "toolu_01BiKvSfSEAwNM1DwshGhsT6", "type": "tool_result", "content": "(Bash completed with no output)", "is_error": false}]}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "68545b22-4c1b-44df-a0ec-5876d2c19aee", "timestamp": "2026-09-28T12:51:36.149Z", "tool_use_result": {"stdout": "", "stderr": "", "interrupted": false, "isImage": false, "noOutputExpected": false}}} +{"at": 20048, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "e14bc8d3-a5bf-4d52-b841-9b5632247863"}} +{"at": 20123, "kind": "dispatch", "clientMessageId": "client-B", "sentUuid": "6f0204a5-a21a-47a4-9517-034cc4467b52", "text": "Also say the word banana at the end of your reply.", "outcome": {"state": "admitted"}} +{"at": 20124, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "6f0204a5-a21a-47a4-9517-034cc4467b52", "state": "queued", "uuid": "87c94a31-75e5-400a-9551-ca24c36b9be5", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 21070, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsJ6bNbeN2V5Wbst25o", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 17000, "cache_read_input_tokens": 0, "cache_creation": {"ephemeral_5m_input_tokens": 17000, "ephemeral_1h_input_tokens": 0}, "output_tokens": 9, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "02c04bc0-68be-4721-a24d-27e7fa4a93db", "ttft_ms": 1019}} +{"at": 21071, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "text", "text": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "c90f97b4-2cd4-482d-af20-cd921f5915ef"}} +{"at": 21071, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "text_delta", "text": "FIRST DONE"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "059a395d-c0a0-4a06-b483-240c3aece7ff"}} +{"at": 21082, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsJ6bNbeN2V5Wbst25o", "type": "message", "role": "assistant", "content": [{"type": "text", "text": "FIRST DONE"}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 17000, "cache_read_input_tokens": 0, "cache_creation": {"ephemeral_5m_input_tokens": 17000, "ephemeral_1h_input_tokens": 0}, "output_tokens": 9, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "fc532a8b-2d4d-4cb9-92a5-ea1c509a8019", "timestamp": "2026-09-28T12:51:37.173Z", "request_id": "req_011CfVsJ5eaEpxJgCRB1U4zr"}} +{"at": 21082, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "81e56773-385a-4016-a0ec-ce01d277b9d1"}} +{"at": 21082, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "end_turn", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 17000, "cache_read_input_tokens": 0, "output_tokens": 9, "output_tokens_details": {"thinking_tokens": 0}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "ea179db4-6487-4447-927e-ae75d31097a2"}} +{"at": 21082, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "6de38f87-568d-4573-960c-a6143bc8ecda"}} +{"at": 21085, "kind": "frame", "frame": {"duration_api_ms": 6803, "stop_reason": "end_turn", "session_id": "00000000-0000-4000-8000-00000000c1a0", "total_cost_usd": 0.1262354, "usage": {"input_tokens": 6, "cache_creation_input_tokens": 22365, "cache_read_input_tokens": 28272, "output_tokens": 173, "output_tokens_details": {"thinking_tokens": 0}, "server_tool_use": {"web_search_requests": 0, "web_fetch_requests": 0}, "service_tier": "standard", "cache_creation": {"ephemeral_1h_input_tokens": 0, "ephemeral_5m_input_tokens": 22365}, "inference_geo": "not_available", "iterations": [], "speed": "standard"}, "modelUsage": {"claude-opus-5-5[1m]": {"inputTokens": 1219, "outputTokens": 194, "cacheReadInputTokens": 28272, "cacheCreationInputTokens": 22365, "webSearchRequests": 0, "costUSD": 0.1262354, "contextWindow": 1000000, "maxOutputTokens": 128000, "thinkingTokens": 0, "canonicalModel": "claude-opus-5-5", "provider": "firstParty", "costBasis": "list"}}, "permission_denials": [], "terminal_reason": "completed", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required", "subagent_stats": {"spawned": 0, "requested": {"background": 0, "foreground": 0, "unset": 0}, "started_in_background": 0, "max_depth": 0, "spawned_by_subagents": 0, "completed": 0, "failed": 0, "killed": {"parent": 0, "user": 0, "system": 0}, "refused": {"depth_limit": 0, "concurrency_limit": 0, "budget": 0}, "by_type": {}}, "is_error": false, "num_turns": 3, "subtype": "success", "api_error_status": null, "result": "FIRST DONE", "ttft_ms": 2391, "type": "result", "duration_ms": 20825, "uuid": "b82a7983-d7ea-496d-9cb7-735f1ffb3cda", "ttft_stream_ms": 1043, "time_to_request_ms": 22, "first_content_frame_ms": 1044, "user_message_uuid": "712482eb-4c05-4f67-8888-a11843c2729f", "user_message_uuids": ["712482eb-4c05-4f67-8888-a11843c2729f"], "request_sent_wall_ms": 1790599876383, "queued_turn_count": 0, "result_index": 0}} +{"at": 21085, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "712482eb-4c05-4f67-8888-a11843c2729f", "state": "completed", "uuid": "acb703de-6b64-4496-b552-74ddb042d768", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 21085, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "6f0204a5-a21a-47a4-9517-034cc4467b52", "state": "started", "uuid": "77edaf35-52e5-42f1-a84a-f86dc68c96a4", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 21088, "kind": "frame", "frame": {"type": "system", "subtype": "init", "cwd": "/tmp/scrubbed-cwd", "session_id": "00000000-0000-4000-8000-00000000c1a0", "tools": ["Task", "AskUserQuestion", "Bash", "CronCreate", "CronDelete", "CronList", "DesignSync", "Edit", "EnterPlanMode", "EnterWorktree", "ExitPlanMode", "ExitWorktree", "ListAgents", "NotebookEdit", "Read", "ReportFindings", "ScheduleWakeup", "SendMessage", "Skill", "TaskCreate", "TaskGet", "TaskList", "TaskStop", "TaskUpdate", "ToolSearch", "WebFetch", "WebSearch", "Workflow", "Write"], "mcp_servers": [], "model": "claude-opus-5-5[1m]", "permissionMode": "default", "slash_commands": ["deep-research", "design", "design-sync", "dataviz", "update-config", "verify", "debug", "code-review", "simplify", "batch", "fewer-permission-prompts", "doctor", "loop", "claude-api", "workflow-authoring", "run", "run-skill-generator", "agents", "auto-mode-setup", "autocompact", "clear", "color", "compact", "config", "output-style", "context", "effort", "fast", "heapdump", "init", "mcp", "model", "__remote-workflow", "workflow-launch-exec", "reload-plugins", "reload-skills", "rename", "security-review", "usage", "insights", "recap", "goal", "design-consent", "design-revoke", "list-agents", "team-onboarding"], "terminal_slash_commands": ["doctor", "color", "reload-plugins"], "apiKeySource": "none", "claude_code_version": "2.1.280", "output_style": "default", "agents": ["claude", "Explore", "general-purpose", "Plan", "statusline-setup"], "skills": ["deep-research", "design", "design-sync", "dataviz", "update-config", "verify", "debug", "code-review", "simplify", "batch", "fewer-permission-prompts", "doctor", "loop", "claude-api", "workflow-authoring", "run", "run-skill-generator"], "plugins": [{"name": "telemetry", "path": "builtin", "source": "telemetry@builtin"}], "capabilities": ["interrupt_receipt_v1", "interrupt_cancel_queued_v1", "msg_lifecycle_v1", "mcp_read_resource_v1", "mcp_tool_ui_meta_v1"], "analytics_disabled": false, "product_feedback_disabled": false, "uuid": "f6af6108-710e-4208-8c3c-79b2a9fc14e4", "memory_paths": {"auto": "/Users/user/scrubbed"}, "messaging_socket_path": "/tmp/scrubbed.sock", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required"}} +{"at": 21088, "kind": "frame", "frame": {"type": "system", "subtype": "status", "status": "requesting", "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "7ff5bb60-79be-49cb-bd26-950fa9584ffe"}} +{"at": 22022, "kind": "frame", "frame": {"type": "user", "message": {"role": "user", "content": [{"type": "text", "text": "Also say the word banana at the end of your reply."}]}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "6f0204a5-a21a-47a4-9517-034cc4467b52", "timestamp": "2026-09-28T12:51:37.189Z", "isReplay": true}} +{"at": 22022, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_start", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsJAVHoszB7NSfdEtk4", "type": "message", "role": "assistant", "content": [], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 51, "cache_read_input_tokens": 17000, "cache_creation": {"ephemeral_5m_input_tokens": 51, "ephemeral_1h_input_tokens": 0}, "output_tokens": 7, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "30e634ea-7725-4e57-bba9-5b6ae1f44c1b", "ttft_ms": 927, "user_message_uuid": "6f0204a5-a21a-47a4-9517-034cc4467b52", "user_message_uuids": ["6f0204a5-a21a-47a4-9517-034cc4467b52"]}} +{"at": 22023, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 0, "content_block": {"type": "thinking", "thinking": "", "signature": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "8c52275c-f862-4c49-a1b5-4cb5dde934c8"}} +{"at": 22469, "kind": "frame", "frame": {"type": "system", "subtype": "thinking_tokens", "estimated_tokens": 50, "estimated_tokens_delta": 50, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "91410a95-652d-4e88-8661-19ef21e01a22", "user_message_uuid": "6f0204a5-a21a-47a4-9517-034cc4467b52"}} +{"at": 22469, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "thinking_delta", "thinking": "", "estimated_tokens": 50}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "ea150b67-dad7-4436-84c5-82d73a3ee3ac"}} +{"at": 23097, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "thinking_delta", "thinking": "", "estimated_tokens": null}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "dcf3a66c-0505-4b70-985f-d5d431de68c5"}} +{"at": 23097, "kind": "frame", "frame": {"type": "system", "subtype": "thinking_tokens", "estimated_tokens": 192, "estimated_tokens_delta": 142, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "411efdb6-1b14-40d5-b126-6251292c2898", "user_message_uuid": "6f0204a5-a21a-47a4-9517-034cc4467b52"}} +{"at": 23097, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 0, "delta": {"type": "signature_delta", "signature": "CAQS9wUKEAgSGAI4AUIIdGhpbmtpbmcSDB/yUaKTcw1uKvgE2xoM//KByDA4fixole7KIjDLAtdDHZ4gV5AjYQGHGc1vQ+EwvB7yHUpWkhn/fsoZ0XTaERvUz6ZoVYhDH7TV/3EqlAW89rxYwkeD/V2vxPnz1iDOQvnSOBk08h5h6cd7CUNMyyM5UU/VtJ84BJDllyBTZLw8RCS/tuodap4P8NmO7I6wK6ZQ8d0hTfpyHsr7J4UfnD9RXhy2x5YdTX11OI8sQ7hxj9HkzhEJpJwRSytLRpclM3ATKwIv/ApihNhfYtbKApQSeIOlFArXz17Xm3RYMs3WjRzL8NMPmV0d5sirOCJ1xtAf3vLSi7awlvG45tpmkW3xaEZsVczOBSNhLPdzwEuHQrAZqx+5WE/b5cC9A2jfW3HgOSdmlmp1z0vYhdbvfu+ALKLUFmAz49QY8YINKNXLbZMUxY5IEDHrRUNjQIY2tJvJWi1SMNNaAvRh1dVBwRDdCXRkWt1Yt8U3iQ2g0dZnfeEGCrIETtzGnRZ5nY0ekGcVrU8QQCCiibceC0dSOmbpNOnDGjxpu3PdoBBoxjZB/Ys1I2td+KDsGwWi0KygWOH7xoa11fsLHvoBu+d0RaTCH64uX6s3bLkajeeCpX0nEt0PR0GT69Jst6J4JwiDTDjjK4LF87Sxm4tSnTzymEYXhk2M5EtdkOUmD5yeI4Qf0liMutVlLWISHzDsAj/t1i7dQtr76wHzrq0/1qdf4OJlFH0qLEM98ekpLOsESLLGryp0UIRIrMaJtpk8e/o9+uHgCP2IwxxEFaWb6PUvNvuI00K/C3dxTD9JQQrNZRdadsnj74/TR2qePDAXzb8vhDSm2b8umySGmHCPrTjBdC0O6riijl1pKqdjRS9yzFVInnZ00zUHpmT9ojVT3dKennDIfdN4ShxGTh5be81hF1pfm9GDC7HJGpG+Eth3qS8JTRQhDx43J4DKNA4XQYQ7CHIxOLET/s8e+qGLnlGCJl6K0h4YAQ=="}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "3b70c219-37e8-485d-a00c-48e3680cc14e"}} +{"at": 23097, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsJAVHoszB7NSfdEtk4", "type": "message", "role": "assistant", "content": [{"type": "thinking", "thinking": "", "signature": "CAQS9wUKEAgSGAI4AUIIdGhpbmtpbmcSDB/yUaKTcw1uKvgE2xoM//KByDA4fixole7KIjDLAtdDHZ4gV5AjYQGHGc1vQ+EwvB7yHUpWkhn/fsoZ0XTaERvUz6ZoVYhDH7TV/3EqlAW89rxYwkeD/V2vxPnz1iDOQvnSOBk08h5h6cd7CUNMyyM5UU/VtJ84BJDllyBTZLw8RCS/tuodap4P8NmO7I6wK6ZQ8d0hTfpyHsr7J4UfnD9RXhy2x5YdTX11OI8sQ7hxj9HkzhEJpJwRSytLRpclM3ATKwIv/ApihNhfYtbKApQSeIOlFArXz17Xm3RYMs3WjRzL8NMPmV0d5sirOCJ1xtAf3vLSi7awlvG45tpmkW3xaEZsVczOBSNhLPdzwEuHQrAZqx+5WE/b5cC9A2jfW3HgOSdmlmp1z0vYhdbvfu+ALKLUFmAz49QY8YINKNXLbZMUxY5IEDHrRUNjQIY2tJvJWi1SMNNaAvRh1dVBwRDdCXRkWt1Yt8U3iQ2g0dZnfeEGCrIETtzGnRZ5nY0ekGcVrU8QQCCiibceC0dSOmbpNOnDGjxpu3PdoBBoxjZB/Ys1I2td+KDsGwWi0KygWOH7xoa11fsLHvoBu+d0RaTCH64uX6s3bLkajeeCpX0nEt0PR0GT69Jst6J4JwiDTDjjK4LF87Sxm4tSnTzymEYXhk2M5EtdkOUmD5yeI4Qf0liMutVlLWISHzDsAj/t1i7dQtr76wHzrq0/1qdf4OJlFH0qLEM98ekpLOsESLLGryp0UIRIrMaJtpk8e/o9+uHgCP2IwxxEFaWb6PUvNvuI00K/C3dxTD9JQQrNZRdadsnj74/TR2qePDAXzb8vhDSm2b8umySGmHCPrTjBdC0O6riijl1pKqdjRS9yzFVInnZ00zUHpmT9ojVT3dKennDIfdN4ShxGTh5be81hF1pfm9GDC7HJGpG+Eth3qS8JTRQhDx43J4DKNA4XQYQ7CHIxOLET/s8e+qGLnlGCJl6K0h4YAQ=="}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 51, "cache_read_input_tokens": 17000, "cache_creation": {"ephemeral_5m_input_tokens": 51, "ephemeral_1h_input_tokens": 0}, "output_tokens": 7, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "f59a0f60-bc42-4d2f-be93-2d89991bf482", "timestamp": "2026-09-28T12:51:39.200Z", "request_id": "req_011CfVsJA4Uy2C2Rx8uyY7H1", "user_message_uuid": "6f0204a5-a21a-47a4-9517-034cc4467b52", "user_message_uuids": ["6f0204a5-a21a-47a4-9517-034cc4467b52"]}} +{"at": 23097, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 0}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "0d8eff25-307b-4247-81e1-9a4575c7e07d"}} +{"at": 23097, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_start", "index": 1, "content_block": {"type": "text", "text": ""}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "7328034f-41e4-4823-9bde-8df483de1ce5"}} +{"at": 23098, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 1, "delta": {"type": "text_delta", "text": "FIRST DONE ban"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "e8f3de55-f311-4eac-baab-9db3fe5ec197"}} +{"at": 23098, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_delta", "index": 1, "delta": {"type": "text_delta", "text": "ana"}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "b293546a-d0c5-4cdd-9884-5b155b845e96"}} +{"at": 23098, "kind": "frame", "frame": {"type": "assistant", "message": {"model": "claude-opus-5-5", "id": "msg_011CfVsJAVHoszB7NSfdEtk4", "type": "message", "role": "assistant", "content": [{"type": "text", "text": "FIRST DONE banana"}], "container": null, "stop_reason": null, "stop_sequence": null, "stop_details": null, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 51, "cache_read_input_tokens": 17000, "cache_creation": {"ephemeral_5m_input_tokens": 51, "ephemeral_1h_input_tokens": 0}, "output_tokens": 7, "service_tier": "standard", "inference_geo": "not_available"}, "diagnostics": null, "context_management": null}, "parent_tool_use_id": null, "session_id": "00000000-0000-4000-8000-00000000c1a0", "uuid": "31583f02-16b9-418d-89b3-269afb1dc2c0", "timestamp": "2026-09-28T12:51:39.201Z", "request_id": "req_011CfVsJA4Uy2C2Rx8uyY7H1"}} +{"at": 23098, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "content_block_stop", "index": 1}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "f8047b07-9ca2-436f-a8e2-f05a17f14970"}} +{"at": 23105, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_delta", "delta": {"stop_reason": "end_turn", "stop_sequence": null, "stop_details": null, "container": null}, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 51, "cache_read_input_tokens": 17000, "output_tokens": 65, "output_tokens_details": {"thinking_tokens": 54}}, "context_management": {"applied_edits": []}}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "372ebe0e-8f36-4567-8563-4aff3e059a3f"}} +{"at": 23105, "kind": "frame", "frame": {"type": "stream_event", "event": {"type": "message_stop"}, "session_id": "00000000-0000-4000-8000-00000000c1a0", "parent_tool_use_id": null, "uuid": "b11714ab-fe3d-44fb-991d-c62ae8a60507"}} +{"at": 23107, "kind": "frame", "frame": {"duration_api_ms": 8819, "stop_reason": "end_turn", "session_id": "00000000-0000-4000-8000-00000000c1a0", "total_cost_usd": 0.1311984, "usage": {"input_tokens": 2, "cache_creation_input_tokens": 51, "cache_read_input_tokens": 17000, "output_tokens": 65, "output_tokens_details": {"thinking_tokens": 54}, "server_tool_use": {"web_search_requests": 0, "web_fetch_requests": 0}, "service_tier": "standard", "cache_creation": {"ephemeral_1h_input_tokens": 0, "ephemeral_5m_input_tokens": 51}, "inference_geo": "not_available", "iterations": [], "speed": "standard"}, "modelUsage": {"claude-opus-5-5[1m]": {"inputTokens": 1221, "outputTokens": 259, "cacheReadInputTokens": 45272, "cacheCreationInputTokens": 22416, "webSearchRequests": 0, "costUSD": 0.1311984, "contextWindow": 1000000, "maxOutputTokens": 128000, "thinkingTokens": 54, "canonicalModel": "claude-opus-5-5", "provider": "firstParty", "costBasis": "list"}}, "permission_denials": [], "terminal_reason": "completed", "fast_mode_state": "off", "fast_mode_disabled_reason": "sdk_opt_in_required", "subagent_stats": {"spawned": 0, "requested": {"background": 0, "foreground": 0, "unset": 0}, "started_in_background": 0, "max_depth": 0, "spawned_by_subagents": 0, "completed": 0, "failed": 0, "killed": {"parent": 0, "user": 0, "system": 0}, "refused": {"depth_limit": 0, "concurrency_limit": 0, "budget": 0}, "by_type": {}}, "is_error": false, "num_turns": 1, "subtype": "success", "api_error_status": null, "result": "FIRST DONE banana", "ttft_ms": 2012, "type": "result", "duration_ms": 2021, "uuid": "572df995-0b87-436c-9966-5f3740c22820", "ttft_stream_ms": 937, "time_to_request_ms": 10, "first_content_frame_ms": 937, "user_message_uuid": "6f0204a5-a21a-47a4-9517-034cc4467b52", "user_message_uuids": ["6f0204a5-a21a-47a4-9517-034cc4467b52"], "request_sent_wall_ms": 1790599897198, "queued_turn_count": 0, "result_index": 1}} +{"at": 23107, "kind": "frame", "frame": {"type": "command_lifecycle", "command_uuid": "6f0204a5-a21a-47a4-9517-034cc4467b52", "state": "completed", "uuid": "bd6b5dbd-002f-4d5e-8311-7d747745ea00", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 23108, "kind": "frame", "frame": {"type": "system", "subtype": "session_state_changed", "state": "idle", "uuid": "c7642956-8764-404f-8b89-8eac3a91cb1e", "session_id": "00000000-0000-4000-8000-00000000c1a0"}} +{"at": 26162, "kind": "end", "results": 2} diff --git a/src/main/claude/claude-adapter-capture-replay.test.ts b/src/main/claude/claude-adapter-capture-replay.test.ts new file mode 100644 index 000000000000..8e877a135a83 --- /dev/null +++ b/src/main/claude/claude-adapter-capture-replay.test.ts @@ -0,0 +1,233 @@ +// Verbatim replay of FULL captures recorded through Orca's own adapter against +// the real CLI (`__fixtures__/claude-adapter-capture-*.jsonl`): every frame the +// adapter saw — hook proof, per-cycle init, command_lifecycle, session-state, +// stream events — in the recorded order, with the recorded dispatch points. +// The oracle is the provider's own membership fact: each result's +// `user_message_uuids` must equal the sends that settled into the turn that +// result closed. Nothing here asserts design internals, so a rule change or a +// CLI drift that breaks membership fails these tests whatever the mechanism. + +import { readFileSync } from 'node:fs' +import { join } from 'node:path' +import { describe, expect, it, vi, type Mock } from 'vitest' +import type { + AgentJournalItemBody, + AgentJournalMessageItem +} from '../../shared/agent-session-journal-types' +import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' +import { readAgentJournalTurn } from '../../shared/agent-session-turn-record' +import { ClaudeStructuredSessionAdapter } from './claude-structured-session-adapter' +import type { + ClaudeLateDispatchOutcome, + ClaudeStructuredSessionAdapterDeps +} from './claude-structured-session-state' +import { + fakeClaude, + identityFor, + PROVIDER_SESSION_ID +} from './claude-structured-session-test-support' + +type CapturedEvent = + | { at: number; kind: 'meta'; providerSessionId: string } + | { at: number; kind: 'frame'; frame: Record } + | { at: number; kind: 'dispatch'; clientMessageId: string; sentUuid: string; text: string } + | { at: number; kind: 'end' } + +function isRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null && !Array.isArray(value) +} + +function decodeCapturedEvent(value: unknown): CapturedEvent { + if (!isRecord(value) || typeof value.at !== 'number' || typeof value.kind !== 'string') { + throw new Error('capture line is not a recorded event') + } + if (value.kind === 'meta' && typeof value.providerSessionId === 'string') { + return { at: value.at, kind: 'meta', providerSessionId: value.providerSessionId } + } + if (value.kind === 'frame' && isRecord(value.frame)) { + return { at: value.at, kind: 'frame', frame: value.frame } + } + if ( + value.kind === 'dispatch' && + typeof value.clientMessageId === 'string' && + typeof value.sentUuid === 'string' && + typeof value.text === 'string' + ) { + return { + at: value.at, + kind: 'dispatch', + clientMessageId: value.clientMessageId, + sentUuid: value.sentUuid, + text: value.text + } + } + if (value.kind === 'end') { + return { at: value.at, kind: 'end' } + } + throw new Error(`capture line has unknown kind: ${String(value.kind)}`) +} + +function loadCapture(name: string): CapturedEvent[] { + const path = join(__dirname, '__fixtures__', `claude-adapter-capture-${name}.jsonl`) + return readFileSync(path, 'utf8') + .trim() + .split('\n') + .map((line) => decodeCapturedEvent(JSON.parse(line))) +} + +type Replay = { + settled: Mock + /** Final revision per turn id, in first-open order. */ + finalTurns: Map>> + everInterrupted: boolean + /** Each result frame's `user_message_uuids`, mapped to live dispatch uuids. */ + resultMemberships: string[][] + /** clientMessageId -> provider uuid its delivery settled under. */ + settledUuids: Map + /** Live dispatch uuid -> turn id its send landed in (turn open at settlement). */ + liveUuidByClient: Map +} + +async function replayCapture(name: string): Promise { + const capture = loadCapture(name) + let nowMs = 1_700_000_200_000 + const finalTurns = new Map>>() + let everInterrupted = false + const sink: StructuredAgentSessionEventSink = { + appendItem: (_identity, body: AgentJournalItemBody) => { + const turn = readAgentJournalTurn(body) + if (turn) { + finalTurns.set(turn.turnId, turn) + everInterrupted ||= turn.state === 'interrupted' + } + }, + appendTombstone: () => {}, + publish: () => {} + } + const settled = vi.fn<(input: { sessionId: string } & ClaudeLateDispatchOutcome) => void>() + // The capture supplies every frame, startup proof included. + const claude = fakeClaude({ initProof: 'none', replayUuid: null }) + const deps: ClaudeStructuredSessionAdapterDeps = { + resolveLaunch: async () => ({ + pathToClaudeCodeExecutable: 'claude', + options: {}, + cwd: '/work/repo', + claudeConfigDir: '/accounts/claude', + providerSessionId: PROVIDER_SESSION_ID, + resumeLeafUuid: null, + resumesTranscript: false, + continuesChain: false + }), + openConnection: claude.openConnection, + readProcessStartTime: async () => 1, + now: () => nowMs, + persistHandle: async () => {}, + onDispatchSettledLate: settled + } + const adapter = new ClaudeStructuredSessionAdapter(deps) + await adapter.acquire({ identity: identityFor(), fence: 7, spawnToken: 'spawn-9', events: sink }) + + // Captured uuids -> the uuids the live dispatches mint during this replay. + const uuidMap = new Map() + const capturedSessionId = capture.flatMap((event) => + event.kind === 'meta' ? [event.providerSessionId] : [] + )[0] + const mapFrame = (frame: Record): Record => { + let text = JSON.stringify(frame) + for (const [captured, live] of uuidMap) { + text = text.replaceAll(captured, live) + } + if (capturedSessionId) { + text = text.replaceAll(capturedSessionId, PROVIDER_SESSION_ID) + } + const mapped: unknown = JSON.parse(text) + if (!isRecord(mapped)) { + throw new Error('mapped frame is not a record') + } + return mapped + } + const resultMemberships: string[][] = [] + let startedAwaited = false + for (const event of capture) { + nowMs = 1_700_000_200_000 + event.at + if (event.kind === 'dispatch') { + if (!startedAwaited) { + // The proof frames have been delivered by now; startup can settle. + await adapter.awaitStarted('session-1') + startedAwaited = true + } + const body: AgentJournalMessageItem = { + kind: 'message', + role: 'user', + blocks: [{ type: 'text', text: event.text }] + } + const before = new Set(uuidMap.values()) + const outcome = await adapter.dispatch({ + sessionId: 'session-1', + clientMessageId: event.clientMessageId, + body, + requestedAt: nowMs, + fence: 7 + }) + expect(outcome).toEqual({ state: 'admitted' }) + const sent = claude.connections[0]!.sent.at(-1)?.uuid + if (typeof sent !== 'string' || before.has(sent)) { + throw new Error('replay could not read the dispatched uuid') + } + uuidMap.set(event.sentUuid, sent) + } else if (event.kind === 'frame') { + const frame = mapFrame(event.frame) + if (frame.type === 'result') { + const members = Array.isArray(frame.user_message_uuids) ? frame.user_message_uuids : [] + resultMemberships.push(members.filter((m): m is string => typeof m === 'string')) + } + claude.connections[0]!.handlers.onMessage?.(frame) + } + } + const settledUuids = new Map() + for (const [outcome] of settled.mock.calls) { + if ('providerIdentity' in outcome && outcome.providerIdentity.provider === 'claude') { + settledUuids.set(outcome.clientMessageId, outcome.providerIdentity.uuid) + } + } + const liveUuidByClient = new Map() + for (const event of capture) { + if (event.kind === 'dispatch') { + liveUuidByClient.set(event.clientMessageId, uuidMap.get(event.sentUuid)!) + } + } + return { settled, finalTurns, everInterrupted, resultMemberships, settledUuids, liveUuidByClient } +} + +describe.each(['fold', 'early-steer', 'miss'])('adapter capture replay: %s', (name) => { + it('keeps turn membership equal to each result’s user_message_uuids', async () => { + const replay = await replayCapture(name) + + // One turn per result, each opened by that result's first member, and no + // turn ever marked interrupted (no capture interrupts one). + expect([...replay.finalTurns.keys()]).toEqual( + replay.resultMemberships.map((members) => members[0]) + ) + expect(replay.everInterrupted).toBe(false) + for (const turn of replay.finalTurns.values()) { + expect(turn.state).toBe('completed') + } + + // Every send settled accepted under a provider uuid named by exactly the + // result whose turn it belongs to — the provider's membership fact. + const allMembers = new Set(replay.resultMemberships.flat()) + for (const [clientMessageId, liveUuid] of replay.liveUuidByClient) { + expect(replay.settledUuids.get(clientMessageId)).toBe(liveUuid) + expect(allMembers.has(liveUuid)).toBe(true) + } + for (const [index, members] of replay.resultMemberships.entries()) { + for (const member of members) { + // A member of result i must not have opened any OTHER turn. + const owner = [...replay.finalTurns.keys()].indexOf(member) + if (owner !== -1) { + expect(owner).toBe(index) + } + } + } + }) +}) diff --git a/src/main/claude/claude-can-use-tool-test-support.ts b/src/main/claude/claude-can-use-tool-test-support.ts new file mode 100644 index 000000000000..cbf064a0933a --- /dev/null +++ b/src/main/claude/claude-can-use-tool-test-support.ts @@ -0,0 +1,30 @@ +// Invoking the fake connection's canUseTool permission callback, as the CLI would. + +import type { ClaudeStreamJsonConnectionHandlers } from './claude-stream-json-connection' +import type { FakeConnection } from './claude-structured-session-test-support' + +export function invokeCanUseTool( + connection: FakeConnection, + toolName: string, + requestId: string, + toolUseID: string, + extra: { + input?: Record + suggestions?: unknown[] + signal?: AbortSignal + } = {} +): { promise: Promise; settled: () => boolean } { + const options = { + requestId, + toolUseID, + signal: extra.signal ?? new AbortController().signal, + ...(extra.suggestions ? { suggestions: extra.suggestions } : {}) + } as unknown as Parameters>[2] + let done = false + const promise = Promise.resolve( + connection.handlers.canUseTool?.(toolName, extra.input ?? {}, options) + ).finally(() => { + done = true + }) + return { promise, settled: () => done } +} diff --git a/src/main/claude/claude-captured-fold-steer-frames.test-fixture.ts b/src/main/claude/claude-captured-fold-steer-frames.test-fixture.ts new file mode 100644 index 000000000000..8213b4bfa455 --- /dev/null +++ b/src/main/claude/claude-captured-fold-steer-frames.test-fixture.ts @@ -0,0 +1,275 @@ +// Claude CLI 2.1.280 stream-json captures of sends made while a turn is running +// (`--replay-user-messages`), cut to the frames and fields the dispatch/turn path +// reads. Ids, paths and prompts are replaced; the frame order and the relative +// clock (`at`, ms after the first send) are the captured ones. +// +// The captured shape under test: a mid-turn send the CLI folds into the running +// turn is replayed as a root user frame (`isReplay: true`, the client uuid) while +// that turn is still open, and the turn's ONE result names every folded send in +// `user_message_uuids`. A send the CLI runs later (miss) is replayed only when its +// own turn starts, after the first result. A cancelled mid-turn send is never +// replayed at all. + +import { + assistant, + assistantText, + assistantToolUse, + initFrame, + resultFrame, + sessionIdle, + taskFrame, + toolResult, + userReplay, + type CapturedFoldFrame, + type FoldCaptureIds +} from './claude-fold-steer-frame-builders.test-fixture' + +export type { CapturedFoldFrame, FoldCaptureIds } + +export const FIRST_PROMPT = 'Run the sleep command three times, then reply: FIRST DONE' +export const STEER_PROMPT = 'Also say the word banana at the end of your reply.' +export const SECOND_STEER_PROMPT = 'And also say the word mango at the very end.' + +/** p2-fold-fresh: first send at 12, steer at 3878; one result names both sends. */ +export const FOLD_FRESH_SEND_AT = { first: 12, steer: 3_878 } +export function foldFreshCapture({ sessionId, first, steer }: FoldCaptureIds): CapturedFoldFrame[] { + return [ + initFrame(222, sessionId), + userReplay(2_094, sessionId, first, FIRST_PROMPT), + assistantToolUse(2_676, sessionId, 'reply-tool-1', 'toolu_sleep_1', [first]), + toolResult(7_890, sessionId, 'tool-result-1', 'toolu_sleep_1'), + userReplay(7_892, sessionId, steer, STEER_PROMPT), + assistantToolUse(9_725, sessionId, 'reply-tool-2', 'toolu_sleep_2'), + toolResult(14_740, sessionId, 'tool-result-2', 'toolu_sleep_2'), + assistantText(23_039, sessionId, 'reply-text-1', 'FIRST DONE banana'), + resultFrame(23_048, sessionId, 'result-1', { + userMessageUuids: [first, steer], + durationMs: 22_845, + numTurns: 4 + }), + sessionIdle(23_049, sessionId) + ] +} + +/** p2-fold-resumed: the same fold on a `--resume` session; steer at 4458. */ +export const FOLD_RESUMED_SEND_AT = { first: 12, steer: 4_458 } +export function foldResumedCapture({ + sessionId, + first, + steer +}: FoldCaptureIds): CapturedFoldFrame[] { + return [ + initFrame(218, sessionId), + userReplay(2_057, sessionId, first, FIRST_PROMPT), + assistant( + 3_229, + sessionId, + 'reply-thinking-1', + [{ type: 'thinking', thinking: 'plan' }], + [first] + ), + assistantToolUse(3_258, sessionId, 'reply-tool-1', 'toolu_sleep_1'), + toolResult(8_464, sessionId, 'tool-result-1', 'toolu_sleep_1'), + userReplay(8_467, sessionId, steer, STEER_PROMPT), + assistantToolUse(10_318, sessionId, 'reply-tool-2', 'toolu_sleep_2'), + toolResult(15_373, sessionId, 'tool-result-2', 'toolu_sleep_2'), + assistantText(23_587, sessionId, 'reply-text-1', 'FIRST DONE banana'), + resultFrame(23_628, sessionId, 'result-1', { + userMessageUuids: [first, steer], + durationMs: 23_367, + numTurns: 4 + }), + sessionIdle(23_640, sessionId) + ] +} + +/** p2-two-steers: steers at 3630 and 5031, both replayed back to back mid-turn. */ +export const TWO_STEERS_SEND_AT = { first: 31, steer: 3_630, secondSteer: 5_031 } +export function twoSteersCapture({ + sessionId, + first, + steer, + secondSteer +}: Required): CapturedFoldFrame[] { + return [ + initFrame(351, sessionId), + userReplay(1_169, sessionId, first, FIRST_PROMPT), + assistantToolUse(2_412, sessionId, 'reply-tool-1', 'toolu_sleep_1', [first]), + toolResult(7_949, sessionId, 'tool-result-1', 'toolu_sleep_1'), + userReplay(7_963, sessionId, steer, STEER_PROMPT), + userReplay(7_967, sessionId, secondSteer, SECOND_STEER_PROMPT), + assistantToolUse(9_806, sessionId, 'reply-tool-2', 'toolu_sleep_2'), + toolResult(14_835, sessionId, 'tool-result-2', 'toolu_sleep_2'), + assistantText(22_210, sessionId, 'reply-text-1', 'FIRST DONE banana mango'), + resultFrame(22_317, sessionId, 'result-1', { + userMessageUuids: [first, steer, secondSteer], + durationMs: 21_859, + numTurns: 4 + }), + sessionIdle(22_341, sessionId) + ] +} + +/** p2-miss: the steer lands too late to fold — its replay trails the first + * result, and it runs as its own turn with its own result. */ +export const MISS_SEND_AT = { first: 30, steer: 23_384 } +export function missCapture({ sessionId, first, steer }: FoldCaptureIds): { + beforeSteerSend: CapturedFoldFrame[] + afterSteerSend: CapturedFoldFrame[] +} { + return { + beforeSteerSend: [ + initFrame(333, sessionId), + userReplay(2_118, sessionId, first, FIRST_PROMPT), + assistantToolUse(2_793, sessionId, 'reply-tool-1', 'toolu_sleep_1', [first]), + toolResult(8_258, sessionId, 'tool-result-1', 'toolu_sleep_1'), + assistantToolUse(11_019, sessionId, 'reply-tool-2', 'toolu_sleep_2'), + toolResult(15_961, sessionId, 'tool-result-2', 'toolu_sleep_2'), + assistantToolUse(18_362, sessionId, 'reply-tool-3', 'toolu_sleep_3'), + toolResult(23_375, sessionId, 'tool-result-3', 'toolu_sleep_3') + ], + afterSteerSend: [ + assistantText(25_550, sessionId, 'reply-text-1', 'FIRST DONE'), + resultFrame(25_556, sessionId, 'result-1', { + userMessageUuids: [first], + durationMs: 25_241, + numTurns: 4 + }), + initFrame(25_584, sessionId), + userReplay(28_703, sessionId, steer, STEER_PROMPT), + assistantText(29_239, sessionId, 'reply-text-2', 'banana'), + resultFrame(29_275, sessionId, 'result-2', { + userMessageUuids: [steer], + durationMs: 3_711, + numTurns: 1 + }), + sessionIdle(29_306, sessionId) + ] + } +} + +/** p2-cancel: the steer is cancelled while queued — no replay ever arrives, the + * interrupt injects a synthetic user text with NO `isReplay`, and the error + * result names only the first send. */ +export const CANCEL_SEND_AT = { first: 18, steer: 3_578 } +export function cancelCapture({ sessionId, first, steer: _steer }: FoldCaptureIds): { + beforeSteerSend: CapturedFoldFrame[] + afterInterrupt: CapturedFoldFrame[] +} { + return { + beforeSteerSend: [ + initFrame(354, sessionId), + userReplay(1_329, sessionId, first, FIRST_PROMPT), + assistantToolUse(2_366, sessionId, 'reply-tool-1', 'toolu_sleep_1', [first]) + ], + afterInterrupt: [ + toolResult( + 3_889, + sessionId, + 'tool-result-1', + 'toolu_sleep_1', + "The user doesn't want to proceed with this tool use.", + true + ), + { + at: 3_900, + frame: { + type: 'user', + session_id: sessionId, + parent_tool_use_id: null, + uuid: 'interrupt-notice-1', + message: { + role: 'user', + content: [{ type: 'text', text: '[Request interrupted by user for tool use]' }] + } + } + }, + resultFrame(3_926, sessionId, 'result-1', { + userMessageUuids: [first], + durationMs: 3_573, + numTurns: 3, + subtype: 'error_during_execution', + isError: true, + terminalReason: 'aborted_tools' + }), + sessionIdle(3_941, sessionId) + ] + } +} + +/** p3-early-steer: the steer is written BEFORE the first send's replay arrives + * (send at 312, first replay at 1208) and the CLI still folds it — one init, + * one turn, one result naming both sends. */ +export const EARLY_STEER_SEND_AT = { first: 11, steer: 312 } +export function earlySteerCapture({ + sessionId, + first, + steer +}: FoldCaptureIds): CapturedFoldFrame[] { + return [ + initFrame(205, sessionId), + userReplay(1_208, sessionId, first, FIRST_PROMPT), + assistantToolUse(2_190, sessionId, 'reply-tool-1', 'toolu_sleep_1', [first]), + toolResult(6_316, sessionId, 'tool-result-1', 'toolu_sleep_1'), + userReplay(6_318, sessionId, steer, STEER_PROMPT), + assistantText(7_336, sessionId, 'reply-text-1', 'FIRST DONE banana'), + resultFrame(7_340, sessionId, 'result-1', { + userMessageUuids: [first, steer], + durationMs: 7_155, + numTurns: 2 + }), + sessionIdle(7_341, sessionId) + ] +} + +/** p3-background-wake: after the turn's result, the finished background task + * wakes the CLI — a NEW cycle: its own init, output with no user replay, and a + * result that names no send at all (`user_message_uuids` absent). The task's + * completion frames arrive BEFORE the wake's init. */ +export function backgroundWakeCapture({ sessionId, first }: FoldCaptureIds): { + firstTurn: CapturedFoldFrame[] + wake: CapturedFoldFrame[] +} { + return { + firstTurn: [ + initFrame(252, sessionId), + userReplay(1_193, sessionId, first, FIRST_PROMPT), + assistantToolUse(2_372, sessionId, 'reply-tool-1', 'toolu_bg_1', [first]), + taskFrame(2_530, sessionId, 'task_started', { + task_id: 'task_bg_1', + tool_use_id: 'toolu_bg_1', + description: 'Sleep then print marker', + is_backgrounded: true, + task_type: 'local_bash' + }), + toolResult(2_532, sessionId, 'tool-result-1', 'toolu_bg_1'), + assistantText(3_403, sessionId, 'reply-text-1', 'STARTED'), + resultFrame(3_406, sessionId, 'result-1', { + userMessageUuids: [first], + durationMs: 3_177, + numTurns: 2 + }), + sessionIdle(3_407, sessionId) + ], + wake: [ + taskFrame(17_547, sessionId, 'task_updated', { + task_id: 'task_bg_1', + patch: { status: 'completed' } + }), + taskFrame(17_547, sessionId, 'task_notification', { + task_id: 'task_bg_1', + tool_use_id: 'toolu_bg_1', + status: 'completed', + summary: 'Background command completed (exit code 0)' + }), + initFrame(17_626, sessionId), + assistantText(19_721, sessionId, 'wake-text-1', 'The background command finished.'), + resultFrame(19_729, sessionId, 'result-2', { + userMessageUuids: [], + durationMs: 2_105, + numTurns: 1 + }), + sessionIdle(19_730, sessionId) + ] + } +} diff --git a/src/main/claude/claude-fold-steer-frame-builders.test-fixture.ts b/src/main/claude/claude-fold-steer-frame-builders.test-fixture.ts new file mode 100644 index 000000000000..efb5781bad81 --- /dev/null +++ b/src/main/claude/claude-fold-steer-frame-builders.test-fixture.ts @@ -0,0 +1,184 @@ +// The frame shapes the fold-steer captures are rebuilt from, keeping only the +// fields the dispatch/turn path reads. + +export type CapturedFoldFrame = { at: number; frame: Record } + +export type FoldCaptureIds = { + /** The provider session every frame names. */ + sessionId: string + /** Client uuid of the turn-opening send; the CLI adopts it on the replay. */ + first: string + /** Client uuid of the mid-turn send. */ + steer: string + /** Client uuid of the second mid-turn send (two-steers only). */ + secondSteer?: string +} + +export function userReplay( + at: number, + sessionId: string, + uuid: string, + text: string +): CapturedFoldFrame { + return { + at, + frame: { + type: 'user', + session_id: sessionId, + parent_tool_use_id: null, + uuid, + isReplay: true, + message: { role: 'user', content: [{ type: 'text', text }] } + } + } +} + +export function assistant( + at: number, + sessionId: string, + uuid: string, + content: unknown[], + userMessageUuids?: string[] +): CapturedFoldFrame { + return { + at, + frame: { + type: 'assistant', + session_id: sessionId, + parent_tool_use_id: null, + uuid, + message: { id: `msg-${uuid}`, role: 'assistant', content }, + // Only the reply that directly answers a send carries the correlation. + ...(userMessageUuids && userMessageUuids.length > 0 + ? { user_message_uuid: userMessageUuids[0], user_message_uuids: userMessageUuids } + : {}) + } + } +} + +export function assistantToolUse( + at: number, + sessionId: string, + uuid: string, + toolUseId: string, + userMessageUuids?: string[] +): CapturedFoldFrame { + return assistant( + at, + sessionId, + uuid, + [{ type: 'tool_use', id: toolUseId, name: 'Bash', input: { command: 'sleep 5' } }], + userMessageUuids + ) +} + +export function assistantText( + at: number, + sessionId: string, + uuid: string, + text: string, + userMessageUuids?: string[] +): CapturedFoldFrame { + return assistant(at, sessionId, uuid, [{ type: 'text', text }], userMessageUuids) +} + +export function toolResult( + at: number, + sessionId: string, + uuid: string, + toolUseId: string, + content = '(Bash completed with no output)', + isError = false +): CapturedFoldFrame { + return { + at, + frame: { + type: 'user', + session_id: sessionId, + parent_tool_use_id: null, + uuid, + message: { + role: 'user', + content: [{ type: 'tool_result', tool_use_id: toolUseId, content, is_error: isError }] + } + } + } +} + +export function resultFrame( + at: number, + sessionId: string, + uuid: string, + fields: { + userMessageUuids: string[] + durationMs: number + numTurns: number + subtype?: string + isError?: boolean + terminalReason?: string + } +): CapturedFoldFrame { + return { + at, + frame: { + type: 'result', + subtype: fields.subtype ?? 'success', + session_id: sessionId, + uuid, + is_error: fields.isError ?? false, + terminal_reason: fields.terminalReason ?? 'completed', + duration_ms: fields.durationMs, + num_turns: fields.numTurns, + result: 'FIRST DONE', + ...(fields.userMessageUuids.length > 0 + ? { + user_message_uuid: fields.userMessageUuids[0], + user_message_uuids: fields.userMessageUuids + } + : {}) + } + } +} + +export function sessionIdle(at: number, sessionId: string): CapturedFoldFrame { + return { + at, + frame: { + type: 'system', + subtype: 'session_state_changed', + state: 'idle', + session_id: sessionId, + uuid: `ssc-idle-${at}` + } + } +} + +/** Root `system/init`: the CLI starting a request cycle. Emitted at startup and + * again for every later cycle — sequential turn, queued turn, background wake, + * /compact (p3 captures). */ +export function initFrame(at: number, sessionId: string): CapturedFoldFrame { + return { + at, + frame: { + type: 'system', + subtype: 'init', + session_id: sessionId, + uuid: `init-${at}`, + model: 'claude-sonnet-5', + apiKeySource: 'none' + } + } +} + +/** A root background-task system frame (`task_started`, `task_updated`, ...). */ +export function taskFrame( + at: number, + sessionId: string, + subtype: string, + fields: Record +): CapturedFoldFrame { + return { + at, + frame: { type: 'system', subtype, session_id: sessionId, uuid: `${subtype}-${at}`, ...fields } + } +} diff --git a/src/main/claude/claude-fold-steer-receipt.test.ts b/src/main/claude/claude-fold-steer-receipt.test.ts new file mode 100644 index 000000000000..4726dc55d823 --- /dev/null +++ b/src/main/claude/claude-fold-steer-receipt.test.ts @@ -0,0 +1,622 @@ +// A send the CLI folds into the running request cycle: its adopted replay is a +// delivery receipt, never a new turn boundary. The provider's own cycle state +// decides — a root init announces each new cycle, and a result's +// `user_message_uuids` names every send the cycle ran. The measured miss, a +// lost result followed by a new cycle, and fresh replay uuids all keep the +// replay-driven opener path. Captured orders +// from Claude CLI 2.1.280 (`claude-captured-fold-steer-frames.test-fixture.ts`). + +import { describe, expect, it, vi, type Mock } from 'vitest' +import type { + AgentJournalItemBody, + AgentJournalItemIdentity, + AgentJournalMessageItem +} from '../../shared/agent-session-journal-types' +import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' +import { readAgentJournalTurn } from '../../shared/agent-session-turn-record' +import { ClaudeStructuredSessionAdapter } from './claude-structured-session-adapter' +import type { + ClaudeStructuredSessionAdapterDeps, + ClaudeStructuredSessionEvent +} from './claude-structured-session-state' +import type { ClaudeStructuredLaunch } from './claude-structured-launch-resolution' +import { + fakeClaude, + identityFor, + PROVIDER_SESSION_ID +} from './claude-structured-session-test-support' +import { + assistantText, + initFrame, + resultFrame, + userReplay, + type CapturedFoldFrame +} from './claude-fold-steer-frame-builders.test-fixture' +import { + backgroundWakeCapture, + cancelCapture, + CANCEL_SEND_AT, + earlySteerCapture, + EARLY_STEER_SEND_AT, + FIRST_PROMPT, + foldFreshCapture, + FOLD_FRESH_SEND_AT, + foldResumedCapture, + FOLD_RESUMED_SEND_AT, + missCapture, + MISS_SEND_AT, + SECOND_STEER_PROMPT, + STEER_PROMPT, + twoSteersCapture, + TWO_STEERS_SEND_AT +} from './claude-captured-fold-steer-frames.test-fixture' + +const T0 = 1_700_000_100_000 + +type Rig = { + adapter: ClaudeStructuredSessionAdapter + claude: ReturnType + events: ClaudeStructuredSessionEvent[] + settled: Mock + /** Every revision of every turn lifecycle row, in append order. */ + turns: () => NonNullable>[] + deliver: (captured: CapturedFoldFrame) => void + /** Dispatches at the captured send offset and returns the client uuid the CLI adopts. */ + dispatchAt: (at: number, clientMessageId: string, text: string) => Promise +} + +async function riggedAdapter( + launch: Partial = {}, + claudeOptions: Parameters[0] = {} +): Promise { + let nowMs = T0 + const appended: { identity: AgentJournalItemIdentity; body: AgentJournalItemBody }[] = [] + const sink: StructuredAgentSessionEventSink = { + appendItem: (identity, body) => appended.push({ identity, body }), + appendTombstone: () => {}, + publish: () => {} + } + const events: ClaudeStructuredSessionEvent[] = [] + const settled = vi.fn() + const claude = fakeClaude({ replayUuid: null, ...claudeOptions }) + const deps: ClaudeStructuredSessionAdapterDeps = { + resolveLaunch: async () => ({ + pathToClaudeCodeExecutable: 'claude', + options: {}, + cwd: '/work/repo', + claudeConfigDir: '/accounts/claude', + providerSessionId: PROVIDER_SESSION_ID, + resumeLeafUuid: null, + resumesTranscript: false, + continuesChain: false, + ...launch + }), + onEvent: (event) => events.push(event), + openConnection: claude.openConnection, + readProcessStartTime: async () => T0 - 1_000, + now: () => nowMs, + persistHandle: async () => {}, + onDispatchSettledLate: settled + } + const adapter = new ClaudeStructuredSessionAdapter(deps) + await adapter.acquire({ identity: identityFor(), fence: 7, spawnToken: 'spawn-9', events: sink }) + await adapter.awaitStarted('session-1') + return { + adapter, + claude, + events, + settled, + turns: () => + appended.flatMap((item) => { + const turn = readAgentJournalTurn(item.body) + return turn ? [turn] : [] + }), + deliver: (captured) => { + nowMs = T0 + captured.at + claude.connections[0]!.handlers.onMessage?.(captured.frame) + }, + dispatchAt: async (at, clientMessageId, text) => { + nowMs = T0 + at + const body: AgentJournalMessageItem = { + kind: 'message', + role: 'user', + blocks: [{ type: 'text', text }] + } + const outcome = await adapter.dispatch({ + sessionId: 'session-1', + clientMessageId, + body, + requestedAt: nowMs, + fence: 7 + }) + expect(outcome).toEqual({ state: 'admitted' }) + const sentUuid = claude.connections[0]!.sent.at(-1)?.uuid + if (typeof sentUuid !== 'string') { + throw new Error('the fake connection recorded no sent uuid') + } + return sentUuid + } + } +} + +function replayEventFor(events: ClaudeStructuredSessionEvent[], uuid: string) { + return events.find( + (event) => + event.type === 'message' && event.message.type === 'user' && event.message.uuid === uuid + ) +} + +describe('Claude fold receipt for a mid-turn send (captured orders)', () => { + it('fold-fresh: the folded steer settles as a receipt inside the one turn it was sent during', async () => { + const rig = await riggedAdapter() + const first = await rig.dispatchAt(FOLD_FRESH_SEND_AT.first, 'client-first', FIRST_PROMPT) + const framesFor = (steerUuid: string) => + foldFreshCapture({ sessionId: PROVIDER_SESSION_ID, first, steer: steerUuid }) + for (const captured of framesFor('pending')) { + if (captured.at < FOLD_FRESH_SEND_AT.steer) { + rig.deliver(captured) + } + } + const steer = await rig.dispatchAt(FOLD_FRESH_SEND_AT.steer, 'client-steer', STEER_PROMPT) + for (const captured of framesFor(steer)) { + if (captured.at > FOLD_FRESH_SEND_AT.steer) { + rig.deliver(captured) + } + } + + // ONE turn record for the whole run, never marked interrupted. + const turnIds = [...new Set(rig.turns().map((turn) => turn.turnId))] + expect(turnIds).toEqual([first]) + expect(rig.turns().every((turn) => turn.state !== 'interrupted')).toBe(true) + // The settled duration is the single turn's, spanning both sends' work. + expect(rig.turns().at(-1)).toMatchObject({ + turnId: first, + state: 'completed', + outcome: 'success', + startedAt: T0 + 2_094, + completedAt: T0 + 23_048, + durationMs: 22_845 + }) + // The steer's replay is a receipt: delivery settles under the steer's own + // provider identity, which is what attributes the user item inside the turn. + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-steer', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: steer } + }) + // And it opens no boundary: the replay event carries no startsTurn. + expect(replayEventFor(rig.events, steer)).not.toHaveProperty('startsTurn') + expect(replayEventFor(rig.events, first)).toMatchObject({ startsTurn: true }) + }) + + it('session-start proof: a hook-frame startup proof with init only at the first cycle still folds', async () => { + // Live sessions prove the session from a SessionStart hook frame BEFORE + // system/init arrives (measured against the real CLI); nothing about the + // fold may depend on fields of the startup proof frame. + const rig = await riggedAdapter({}, { initProof: 'session-start' }) + const first = await rig.dispatchAt(FOLD_FRESH_SEND_AT.first, 'client-first', FIRST_PROMPT) + const framesFor = (steerUuid: string) => + foldFreshCapture({ sessionId: PROVIDER_SESSION_ID, first, steer: steerUuid }) + for (const captured of framesFor('pending')) { + if (captured.at < FOLD_FRESH_SEND_AT.steer) { + rig.deliver(captured) + } + } + const steer = await rig.dispatchAt(FOLD_FRESH_SEND_AT.steer, 'client-steer', STEER_PROMPT) + for (const captured of framesFor(steer)) { + if (captured.at > FOLD_FRESH_SEND_AT.steer) { + rig.deliver(captured) + } + } + + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([first]) + expect(rig.turns().every((turn) => turn.state !== 'interrupted')).toBe(true) + expect(replayEventFor(rig.events, steer)).not.toHaveProperty('startsTurn') + }) + + it('fold-resumed: the receipt holds on a resumed provider session', async () => { + const rig = await riggedAdapter({ + resumeLeafUuid: 'leaf-1', + resumesTranscript: true, + continuesChain: true + }) + const first = await rig.dispatchAt(FOLD_RESUMED_SEND_AT.first, 'client-first', FIRST_PROMPT) + const framesFor = (steerUuid: string) => + foldResumedCapture({ sessionId: PROVIDER_SESSION_ID, first, steer: steerUuid }) + for (const captured of framesFor('pending')) { + if (captured.at < FOLD_RESUMED_SEND_AT.steer) { + rig.deliver(captured) + } + } + const steer = await rig.dispatchAt(FOLD_RESUMED_SEND_AT.steer, 'client-steer', STEER_PROMPT) + for (const captured of framesFor(steer)) { + if (captured.at > FOLD_RESUMED_SEND_AT.steer) { + rig.deliver(captured) + } + } + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-steer', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: steer } + }) + + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([first]) + expect(rig.turns().every((turn) => turn.state !== 'interrupted')).toBe(true) + expect(rig.turns().at(-1)).toMatchObject({ + turnId: first, + state: 'completed', + durationMs: 23_367 + }) + }) + + it('two-steers: both folded sends settle individually inside the one turn', async () => { + const rig = await riggedAdapter() + const first = await rig.dispatchAt(TWO_STEERS_SEND_AT.first, 'client-first', FIRST_PROMPT) + const framesFor = (steerUuid: string, secondSteerUuid: string) => + twoSteersCapture({ + sessionId: PROVIDER_SESSION_ID, + first, + steer: steerUuid, + secondSteer: secondSteerUuid + }) + for (const captured of framesFor('pending', 'pending-2')) { + if (captured.at < TWO_STEERS_SEND_AT.steer) { + rig.deliver(captured) + } + } + // Both steers go out mid-turn, before the next captured frame at 7949. + const steer = await rig.dispatchAt(TWO_STEERS_SEND_AT.steer, 'client-steer', STEER_PROMPT) + const secondSteer = await rig.dispatchAt( + TWO_STEERS_SEND_AT.secondSteer, + 'client-steer-2', + SECOND_STEER_PROMPT + ) + for (const captured of framesFor(steer, secondSteer)) { + if (captured.at > TWO_STEERS_SEND_AT.secondSteer) { + rig.deliver(captured) + } + } + + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([first]) + expect(rig.turns().every((turn) => turn.state !== 'interrupted')).toBe(true) + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-steer', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: steer } + }) + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-steer-2', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: secondSteer } + }) + }) + + it('early-steer: a steer written before the first replay arrives still folds into the one turn', async () => { + const rig = await riggedAdapter() + const first = await rig.dispatchAt(EARLY_STEER_SEND_AT.first, 'client-first', FIRST_PROMPT) + const framesFor = (steerUuid: string) => + earlySteerCapture({ sessionId: PROVIDER_SESSION_ID, first, steer: steerUuid }) + for (const captured of framesFor('pending')) { + if (captured.at < EARLY_STEER_SEND_AT.steer) { + rig.deliver(captured) + } + } + const steer = await rig.dispatchAt(EARLY_STEER_SEND_AT.steer, 'client-steer', STEER_PROMPT) + for (const captured of framesFor(steer)) { + if (captured.at > EARLY_STEER_SEND_AT.steer) { + rig.deliver(captured) + } + } + + // No turn was open when the steer was written, and it still folded. + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([first]) + expect(rig.turns().every((turn) => turn.state !== 'interrupted')).toBe(true) + expect(rig.turns().at(-1)).toMatchObject({ + turnId: first, + state: 'completed', + durationMs: 7_155 + }) + expect(replayEventFor(rig.events, steer)).not.toHaveProperty('startsTurn') + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-steer', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: steer } + }) + }) + + it('background-wake: the wake cycle opens from its output and its result settles no waiter', async () => { + const rig = await riggedAdapter() + const first = await rig.dispatchAt(13, 'client-first', FIRST_PROMPT) + const { firstTurn, wake } = backgroundWakeCapture({ + sessionId: PROVIDER_SESSION_ID, + first, + steer: 'unused' + }) + for (const captured of [...firstTurn, ...wake]) { + rig.deliver(captured) + } + + // The task's completion revises a live row ahead of the wake's init, and + // that provider output is what opens the wake turn. + const finalByTurn = new Map(rig.turns().map((turn) => [turn.turnId, turn])) + expect([...finalByTurn.keys()]).toEqual([first, 'task_updated-17547']) + expect(finalByTurn.get('task_updated-17547')).toMatchObject({ state: 'completed' }) + // The wake result names no send; only the first send ever settled. + expect(rig.settled).toHaveBeenCalledTimes(1) + }) + + it('background-wake: a steer replayed after the wake cycle began work folds into the wake turn', async () => { + const rig = await riggedAdapter() + const first = await rig.dispatchAt(13, 'client-first', FIRST_PROMPT) + const { firstTurn, wake } = backgroundWakeCapture({ + sessionId: PROVIDER_SESSION_ID, + first, + steer: 'pending' + }) + const wakeResult = wake.findIndex((captured) => captured.frame.type === 'result') + for (const captured of [...firstTurn, ...wake.slice(0, wakeResult)]) { + rig.deliver(captured) + } + // Captured order up to the wake's output; the steer's replay is placed + // mid-cycle, where the CLI replays a send it folded (p3-early-steer). + const steer = await rig.dispatchAt(19_725, 'client-steer', STEER_PROMPT) + rig.deliver(userReplay(19_726, PROVIDER_SESSION_ID, steer, STEER_PROMPT)) + for (const captured of wake.slice(wakeResult)) { + rig.deliver(captured) + } + + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([ + first, + 'task_updated-17547' + ]) + expect(rig.turns().every((turn) => turn.state !== 'interrupted')).toBe(true) + expect(replayEventFor(rig.events, steer)).not.toHaveProperty('startsTurn') + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-steer', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: steer } + }) + }) + + it('mid-turn auto-compaction emits no root init, so a steer after the boundary still folds', async () => { + // Measured (p4-autocompact, CLAUDE_CODE_AUTO_COMPACT_WINDOW forced): the + // boundary is `status compacting` + `compact_boundary` + a synthetic + // continuation user frame — and NO root init, so cycle work survives it. + const rig = await riggedAdapter() + const first = await rig.dispatchAt(14, 'client-first', FIRST_PROMPT) + rig.deliver(initFrame(234, PROVIDER_SESSION_ID)) + rig.deliver(userReplay(2_437, PROVIDER_SESSION_ID, first, FIRST_PROMPT)) + rig.deliver(assistantText(2_864, PROVIDER_SESSION_ID, 'reply-1', 'reading files')) + rig.deliver({ + at: 11_518, + frame: { + type: 'system', + subtype: 'status', + status: 'compacting', + session_id: PROVIDER_SESSION_ID, + uuid: 'status-compacting-1' + } + }) + rig.deliver({ + at: 26_584, + frame: { + type: 'system', + subtype: 'compact_boundary', + session_id: PROVIDER_SESSION_ID, + uuid: 'compact-boundary-1', + compact_metadata: { trigger: 'auto', pre_tokens: 69_960, post_tokens: 9_311 } + } + }) + rig.deliver({ + at: 26_585, + frame: { + type: 'user', + session_id: PROVIDER_SESSION_ID, + parent_tool_use_id: null, + uuid: 'continuation-1', + isSynthetic: true, + message: { + role: 'user', + content: [{ type: 'text', text: 'This session is being continued.' }] + } + } + }) + const steer = await rig.dispatchAt(26_987, 'client-steer', STEER_PROMPT) + rig.deliver(userReplay(34_601, PROVIDER_SESSION_ID, steer, STEER_PROMPT)) + rig.deliver(assistantText(37_824, PROVIDER_SESSION_ID, 'reply-2', 'FIRST DONE banana')) + rig.deliver( + resultFrame(37_828, PROVIDER_SESSION_ID, 'result-1', { + userMessageUuids: [first, steer], + durationMs: 37_616, + numTurns: 6 + }) + ) + + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([first]) + expect(rig.turns().every((turn) => turn.state !== 'interrupted')).toBe(true) + expect(replayEventFor(rig.events, steer)).not.toHaveProperty('startsTurn') + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-steer', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: steer } + }) + }) + + it('miss: a steer whose replay trails the result keeps the opener path and its own turn', async () => { + const rig = await riggedAdapter() + const first = await rig.dispatchAt(MISS_SEND_AT.first, 'client-first', FIRST_PROMPT) + const { beforeSteerSend } = missCapture({ + sessionId: PROVIDER_SESSION_ID, + first, + steer: 'pending' + }) + for (const captured of beforeSteerSend) { + rig.deliver(captured) + } + const steer = await rig.dispatchAt(MISS_SEND_AT.steer, 'client-steer', STEER_PROMPT) + for (const captured of missCapture({ sessionId: PROVIDER_SESSION_ID, first, steer }) + .afterSteerSend) { + rig.deliver(captured) + } + + // Two real turns: the first completed by its result — not interrupted — + // and the late steer's own turn opened by its replay. + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([first, steer]) + expect(rig.turns().every((turn) => turn.state !== 'interrupted')).toBe(true) + const finalByTurn = new Map(rig.turns().map((turn) => [turn.turnId, turn])) + expect(finalByTurn.get(first)).toMatchObject({ + state: 'completed', + completedAt: T0 + 25_556, + durationMs: 25_241 + }) + expect(finalByTurn.get(steer)).toMatchObject({ + state: 'completed', + startedAt: T0 + 28_703, + completedAt: T0 + 29_275, + durationMs: 3_711 + }) + expect(replayEventFor(rig.events, steer)).toMatchObject({ startsTurn: true }) + }) + + it('cancel: a cancelled steer settles nothing and the receipt path changes none of it', async () => { + const rig = await riggedAdapter() + const first = await rig.dispatchAt(CANCEL_SEND_AT.first, 'client-first', FIRST_PROMPT) + const { beforeSteerSend, afterInterrupt } = cancelCapture({ + sessionId: PROVIDER_SESSION_ID, + first, + steer: 'never-replayed' + }) + for (const captured of beforeSteerSend) { + rig.deliver(captured) + } + await rig.dispatchAt(CANCEL_SEND_AT.steer, 'client-steer', STEER_PROMPT) + for (const captured of afterInterrupt) { + rig.deliver(captured) + } + + // One turn, ended by the interrupt's error result exactly as before. + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([first]) + expect(rig.turns().at(-1)).toMatchObject({ + turnId: first, + state: 'interrupted', + outcome: 'cancellation' + }) + // The steer was never replayed and its result never named it: no settlement. + expect(rig.settled).not.toHaveBeenCalledWith( + expect.objectContaining({ clientMessageId: 'client-steer' }) + ) + // The interrupt's synthetic user text opens no turn either. + expect(replayEventFor(rig.events, 'interrupt-notice-1')).not.toHaveProperty('startsTurn') + }) +}) + +describe('Claude fold receipt boundaries (synthetic orders)', () => { + it('lost result: a root init starts a cycle with no work yet, so the next adopted replay is a boundary', async () => { + const rig = await riggedAdapter() + const uuidA = await rig.dispatchAt(10, 'client-a', 'first prompt') + rig.deliver(userReplay(1_000, PROVIDER_SESSION_ID, uuidA, 'first prompt')) + const uuidB = await rig.dispatchAt(1_500, 'client-b', STEER_PROMPT) + // A's result never arrives, but the CLI announces its next request cycle: + // the open turn stops folding, so B's replay opens its own turn. + rig.deliver(initFrame(2_000, PROVIDER_SESSION_ID)) + rig.deliver(userReplay(3_000, PROVIDER_SESSION_ID, uuidB, STEER_PROMPT)) + + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([uuidA, uuidB]) + expect(replayEventFor(rig.events, uuidB)).toMatchObject({ startsTurn: true }) + }) + + it('provider wake: an adopted replay during the live wake cycle folds into the wake turn', async () => { + // Cycle semantics: a wake is its own init-led cycle (p3-background-wake) and + // a replay the CLI emits mid-cycle was folded into that cycle (p3-early-steer). + const rig = await riggedAdapter() + const uuidA = await rig.dispatchAt(10, 'client-a', 'first prompt') + rig.deliver(userReplay(1_000, PROVIDER_SESSION_ID, uuidA, 'first prompt')) + rig.deliver( + resultFrame(2_000, PROVIDER_SESSION_ID, 'result-1', { + userMessageUuids: [uuidA], + durationMs: 1_990, + numTurns: 1 + }) + ) + const uuidB = await rig.dispatchAt(2_500, 'client-b', STEER_PROMPT) + rig.deliver(initFrame(3_000, PROVIDER_SESSION_ID)) + rig.deliver(assistantText(3_500, PROVIDER_SESSION_ID, 'provider-resumed-1', 'background done')) + rig.deliver(userReplay(4_000, PROVIDER_SESSION_ID, uuidB, STEER_PROMPT)) + + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([ + uuidA, + 'provider-resumed-1' + ]) + expect(replayEventFor(rig.events, uuidB)).not.toHaveProperty('startsTurn') + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-b', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: uuidB } + }) + }) + + it('a fresh replay uuid with user_message_uuid correlation keeps the opener path, not a fold receipt', async () => { + const rig = await riggedAdapter() + const uuidA = await rig.dispatchAt(10, 'client-a', 'first prompt') + rig.deliver(userReplay(1_000, PROVIDER_SESSION_ID, uuidA, 'first prompt')) + const uuidB = await rig.dispatchAt(1_500, 'client-b', STEER_PROMPT) + // A replay that did not adopt the client uuid is not the measured fold + // shape, so it keeps the opener path it had before the receipt existed. + const fresh = userReplay(2_000, PROVIDER_SESSION_ID, 'fresh-turn-2', STEER_PROMPT) + rig.deliver({ ...fresh, frame: { ...fresh.frame, user_message_uuid: uuidB } }) + + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([uuidA, 'fresh-turn-2']) + expect(replayEventFor(rig.events, 'fresh-turn-2')).toMatchObject({ startsTurn: true }) + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-b', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: 'fresh-turn-2' } + }) + }) + + it('plural result uuids: an unsettled folded waiter settles under its own uuid, never a shared result alias', async () => { + const rig = await riggedAdapter() + const uuidA = await rig.dispatchAt(10, 'client-a', 'first prompt') + rig.deliver(userReplay(1_000, PROVIDER_SESSION_ID, uuidA, 'first prompt')) + const uuidB = await rig.dispatchAt(1_500, 'client-b', STEER_PROMPT) + // B's replay never arrives; the folded turn's one result still names it. + rig.deliver( + resultFrame(5_000, PROVIDER_SESSION_ID, 'result-1', { + userMessageUuids: [uuidA, uuidB], + durationMs: 4_990, + numTurns: 2 + }) + ) + + expect(rig.settled).toHaveBeenCalledWith({ + sessionId: 'session-1', + clientMessageId: 'client-b', + providerIdentity: { provider: 'claude', sessionId: PROVIDER_SESSION_ID, uuid: uuidB } + }) + expect(rig.settled).not.toHaveBeenCalledWith( + expect.objectContaining({ providerIdentity: expect.objectContaining({ uuid: 'result-1' }) }) + ) + // The correlated result opened nothing and the one turn completed normally. + expect([...new Set(rig.turns().map((turn) => turn.turnId))]).toEqual([uuidA]) + expect(rig.turns().at(-1)).toMatchObject({ turnId: uuidA, state: 'completed' }) + }) + + it('plural result uuids: a result naming only settled sends does not claim an unnamed live waiter by queue order', async () => { + const rig = await riggedAdapter() + const uuidA = await rig.dispatchAt(10, 'client-a', 'first prompt') + rig.deliver(userReplay(1_000, PROVIDER_SESSION_ID, uuidA, 'first prompt')) + await rig.dispatchAt(1_500, 'client-b', STEER_PROMPT) + // A result that names only sends already settled must not fall back to + // queue order and claim B, the still-live waiter it did not name. + rig.deliver( + resultFrame(5_000, PROVIDER_SESSION_ID, 'result-1', { + userMessageUuids: [uuidA], + durationMs: 4_990, + numTurns: 1 + }) + ) + expect(rig.settled).not.toHaveBeenCalledWith( + expect.objectContaining({ clientMessageId: 'client-b' }) + ) + }) +}) diff --git a/src/main/claude/claude-journal-translator-contract.ts b/src/main/claude/claude-journal-translator-contract.ts index 7a7fc4291c7c..1ccf24e13939 100644 --- a/src/main/claude/claude-journal-translator-contract.ts +++ b/src/main/claude/claude-journal-translator-contract.ts @@ -13,6 +13,10 @@ export type ClaudeJournalTranslator = { /** The open turn's provider id — the same id its journal row carries, and the one * a client's Stop names. Sole owner: no reader keeps a copy to disagree with. */ readonly currentTurnId: string | null + /** True while a turn is open and the provider's current request cycle has + * done root work since its init — the state in which the CLI folds an + * arriving send into the turn. */ + readonly openTurnInLiveProviderCycle: boolean flush: () => void childToolOwner?: ClaudeChildToolQueries['childToolOwner'] childActivity?: ClaudeChildToolQueries['childActivity'] diff --git a/src/main/claude/claude-open-turn.ts b/src/main/claude/claude-open-turn.ts index 08a7916a97b5..8a9dc30cd5a0 100644 --- a/src/main/claude/claude-open-turn.ts +++ b/src/main/claude/claude-open-turn.ts @@ -30,6 +30,11 @@ export class ClaudeOpenTurn { * failed: nothing would ever close the turn it opened, and the row would read * working for the life of the session. Only an accepted send lifts it. */ private reopenSuppressed = false + /** Whether the provider's current request cycle has done root work — a send + * echo or model output — since its init. Output can open a turn ahead of its + * cycle's init (a background task finishing), so membership is read from the + * cycle's work, not from when the turn opened. */ + private cycleWorkObserved = false private readonly opener: ( frame: Record, source: ClaudeTurnSource | null, @@ -63,6 +68,23 @@ export class ClaudeOpenTurn { return this.current !== null } + /** Whether a turn is open inside a provider request cycle that has already + * done work — the state in which the CLI folds an arriving send into it. A + * cycle's first send is its opener, never a fold. */ + get openedInLiveProviderCycle(): boolean { + return this.current !== null && this.cycleWorkObserved + } + + /** A root init frame: the CLI is starting a new request cycle. */ + observeProviderCycleStart(): void { + this.cycleWorkObserved = false + } + + /** A root send echo or model output inside the current request cycle. */ + observeProviderCycleWork(): void { + this.cycleWorkObserved = true + } + /** Open a turn, ending whichever one was still open. A new turn starting is the * only end the previous one gets when its result never arrives; settling it * later would sweep THIS turn. */ @@ -91,6 +113,8 @@ export class ClaudeOpenTurn { /** End the open turn, if one is open, and clear the live activity line. The * context facts the end brings ride the same revision. */ settle(end: ClaudeTurnEnd, contextUsage?: AgentSessionContextUsage): void { + // Every settle is a provider cycle ending (result, idle, child exit). + this.cycleWorkObserved = false if (this.current) { this.publish(this.current, end, contextUsage) this.current = null diff --git a/src/main/claude/claude-real-cli-availability-test-support.ts b/src/main/claude/claude-real-cli-availability-test-support.ts new file mode 100644 index 000000000000..faa322c456b1 --- /dev/null +++ b/src/main/claude/claude-real-cli-availability-test-support.ts @@ -0,0 +1,64 @@ +// Whether a real, signed-in Claude CLI is present — the gate every real-CLI +// suite skips on. Probed once per test process. + +import { homedir } from 'node:os' +import { join } from 'node:path' +import { runProcessSync, type ProcessResult } from '../../shared/child-process/run-process' +import { withCliRuntimeOnPath } from '../../shared/node-cli-command-resolution' +import { CLAUDE_AUTH_ENV_VARS } from '../claude-accounts/environment' +import { resolveClaudeCommand } from '../codex-cli/command' + +export const realClaudeCommand = resolveClaudeCommand() + +// Why paired: the probe must run the CLI under the same node the structured launch gives it. +function probeRealClaude(args: string[]): ProcessResult | null { + try { + return runProcessSync({ + program: realClaudeCommand, + args, + env: withCliRuntimeOnPath(realClaudeCommand, process.env), + stdio: ['ignore', 'pipe', 'pipe'], + timeoutMs: 5_000 + }) + } catch { + return null + } +} + +export const realClaudeAvailable = probeRealClaude(['--version'])?.code === 0 + +/** The CLI's own account report — the only source of truth for where it writes that + * is not derived from Orca's own path expressions. */ +export const realClaudeAuthStatus = (() => { + if (!realClaudeAvailable) { + return null + } + const result = probeRealClaude(['auth', 'status', '--json']) + if (!result || result.code !== 0) { + return null + } + try { + return JSON.parse(result.stdout) as { loggedIn?: boolean; projectsDirectory?: string } + } catch { + return null + } +})() + +export const realClaudeAuthenticated = realClaudeAuthStatus?.loggedIn === true + +/** The config dir and env auth the availability probe above saw, for a real-CLI launch. + * The connection strips an inherited CLAUDE_CONFIG_DIR and inherited auth vars, so + * without these the child silently runs against ~/.claude whatever the probe checked. */ +export function realClaudeLaunchHome(): { claudeConfigDir: string; env: Record } { + const env: Record = {} + for (const key of CLAUDE_AUTH_ENV_VARS) { + const value = process.env[key] + if (value) { + env[key] = value + } + } + return { + claudeConfigDir: process.env.CLAUDE_CONFIG_DIR?.trim() || join(homedir(), '.claude'), + env + } +} diff --git a/src/main/claude/claude-replay-turn-resolution.ts b/src/main/claude/claude-replay-turn-resolution.ts new file mode 100644 index 000000000000..d34d0efc206c --- /dev/null +++ b/src/main/claude/claude-replay-turn-resolution.ts @@ -0,0 +1,221 @@ +// Which dispatch a provider frame settles, and whether it opens a turn. +// +// A replay or result is joined to its waiter by the client uuid Claude echoes. +// A send Claude FOLDS into the running request cycle is replayed mid-cycle with +// the client uuid adopted: once that cycle has done work, that replay is a +// delivery receipt and opens no boundary. + +import { forgetRetiredWaiter } from './claude-structured-dispatch-waiters' +import { + claudeHasReplayContent, + readClaudeMessageEnvelope +} from './claude-structured-item-translation' +import type { + ClaudeDispatchWaiter, + ClaudeLateDispatchOutcome, + ClaudeSession +} from './claude-structured-session-state' +import { readClaudeFrameString } from './claude-structured-init-proof' +import { claudeDispatchContentKey } from './claude-structured-dispatch-content' + +/** Settles a provider-proven late outcome; replay rows independently reconcile acceptance. */ +export type ClaudeLateDispatchSettlement = (input: ClaudeLateDispatchOutcome) => void + +export type ClaudeReplayTurnOrigin = { requestedAt: number | null } + +export function resolveClaudeReplayTurn( + session: ClaudeSession, + message: Record, + onSettledLate?: ClaudeLateDispatchSettlement +): ClaudeReplayTurnOrigin | null { + const envelope = readClaudeMessageEnvelope(message) + const isUserReplay = + envelope?.role === 'user' && + message.parent_tool_use_id === null && + claudeHasReplayContent(envelope) + const isCompletedCommand = message.type === 'result' + if ( + (!isUserReplay && !isCompletedCommand) || + readClaudeFrameString(message, 'session_id') !== session.providerSessionId + ) { + return null + } + const uuid = readClaudeFrameString(message, 'uuid') + if (!uuid) { + return null + } + + // Newer SDK frames carry the client uuid that caused a turn. A correlation + // value is authoritative: never fall back to queue order or content, since + // identical prompts may be in flight across a timeout boundary. + const userMessageUuid = readClaudeFrameString(message, 'user_message_uuid') + // A folded turn's result names every send it ran under `user_message_uuids`. + // Each member settles its own waiter under its own uuid — the result frame's + // uuid is never adopted as a shared alias for multiple submissions. + const resultUserMessageUuids = isCompletedCommand ? claudeResultUserMessageUuids(message) : [] + for (const member of resultUserMessageUuids) { + if (member === userMessageUuid) { + continue + } + const live = session.dispatchWaiters.find((candidate) => candidate.sentUuid === member) + if (live) { + settleWaiter(session, live, member, onSettledLate) + continue + } + const late = session.retiredDispatchWaiters.find((candidate) => candidate.sentUuid === member) + if (late) { + forgetRetiredWaiter(session, late) + recoverLateIdentity(session, late, member, false, onSettledLate) + } + } + if (userMessageUuid) { + const exact = session.dispatchWaiters.find( + (candidate) => candidate.sentUuid === userMessageUuid + ) + if (exact) { + const foldReceipt = isUserReplay && claudeReplayIsFoldReceipt(session, exact, uuid) + settleWaiter(session, exact, uuid, onSettledLate) + return isUserReplay && !foldReceipt ? { requestedAt: exact.requestedAt } : null + } + const retired = session.retiredDispatchWaiters.find( + (candidate) => candidate.sentUuid === userMessageUuid + ) + if (retired) { + forgetRetiredWaiter(session, retired) + recoverLateIdentity(session, retired, uuid, isUserReplay, onSettledLate) + return null + } + return null + } + if (resultUserMessageUuids.length > 0) { + // The plural list is this result's complete correlation; queue order must + // not join anyone it did not name. + return null + } + + const exact = session.dispatchWaiters.find((candidate) => candidate.sentUuid === uuid) + if (exact) { + const foldReceipt = isUserReplay && claudeReplayIsFoldReceipt(session, exact, uuid) + settleWaiter(session, exact, uuid, onSettledLate) + return isUserReplay && !foldReceipt ? { requestedAt: exact.requestedAt } : null + } + const retired = session.retiredDispatchWaiters.find((candidate) => candidate.sentUuid === uuid) + if (retired) { + forgetRetiredWaiter(session, retired) + recoverLateIdentity(session, retired, uuid, isUserReplay, onSettledLate) + return null + } + + if (isUserReplay) { + // Compatibility CLIs may mint a new replay uuid instead of echoing the + // client uuid. Content is an acceptable join only when it is the sole + // candidate on one side of the timeout boundary; with active and retired + // candidates present, identical prompts are intentionally left unknown. + const replayContentKey = claudeDispatchContentKey(envelope.content) + if (!session.replayContentFallbackBlocked && session.retiredDispatchWaiters.length === 0) { + const compatible = session.dispatchWaiters.filter( + (candidate) => candidate.replayContentKey === replayContentKey + ) + if (compatible.length === 1) { + const [candidate] = compatible + settleWaiter(session, candidate!, uuid, onSettledLate) + return { requestedAt: candidate!.requestedAt } + } + } else if (!session.replayContentFallbackBlocked && session.dispatchWaiters.length === 0) { + const lateCompatible = session.retiredDispatchWaiters.filter( + (candidate) => candidate.replayContentKey === replayContentKey + ) + if (lateCompatible.length === 1) { + const [candidate] = lateCompatible + forgetRetiredWaiter(session, candidate!) + recoverLateIdentity(session, candidate!, uuid, true, onSettledLate) + return null + } + } + return null + } + const current = session.dispatchWaiters[0] + if (isCompletedCommand && !current?.acceptsResult) { + return null + } + // A legacy result has no dispatch correlation. Any retired waiter makes queue order ambiguous, + // even when the retired dispatch was an ordinary turn rather than a slash command. + if (isCompletedCommand && session.retiredDispatchWaiters.length > 0) { + return null + } + // Once an eviction occurred, a fresh result uuid cannot be joined to a waiter by queue order. + if (isCompletedCommand && session.replayContentFallbackBlocked) { + return null + } + const waiter = uuid ? session.dispatchWaiters.shift() : undefined + if (waiter && uuid) { + settleWaiter(session, waiter, uuid, onSettledLate) + return isUserReplay ? { requestedAt: waiter.requestedAt } : null + } + return null +} + +/** The provider's own cycle state decides a fold: the CLI folds a send into the + * request cycle that is running when the send arrives, and it replays a folded + * send mid-cycle with the client uuid ADOPTED (measured: fold-fresh/-resumed, + * two-steers, early-steer). So an adopted replay after the running cycle has + * done work is a delivery receipt, not a turn boundary; a cycle's first send is + * its opener. Adoption is the capability check, read off the frame itself: a + * CLI that mints fresh replay uuids never qualifies. A new cycle announces + * itself with a root init (per-turn, measured), so a lost result cannot leave a + * stale turn swallowing the next turn's replay. */ +function claudeReplayIsFoldReceipt( + session: ClaudeSession, + waiter: ClaudeDispatchWaiter, + replayUuid: string +): boolean { + return replayUuid === waiter.sentUuid && session.translator?.openTurnInLiveProviderCycle === true +} + +function claudeResultUserMessageUuids(message: Record): string[] { + const uuids = message.user_message_uuids + return Array.isArray(uuids) + ? uuids.filter((member): member is string => typeof member === 'string' && member.length > 0) + : [] +} + +function settleWaiter( + session: ClaudeSession, + waiter: ClaudeDispatchWaiter, + uuid: string, + onSettledLate?: ClaudeLateDispatchSettlement +): void { + const index = session.dispatchWaiters.indexOf(waiter) + if (index !== -1) { + session.dispatchWaiters.splice(index, 1) + } + waiter.settledUuid = uuid + waiter.resolve(uuid) + // Dispatch returned on admission, so the replay is what settles delivery. + if (waiter.clientMessageId) { + onSettledLate?.({ + clientMessageId: waiter.clientMessageId, + providerIdentity: { provider: 'claude', sessionId: session.providerSessionId, uuid } + }) + } +} + +function recoverLateIdentity( + session: ClaudeSession, + waiter: ClaudeDispatchWaiter, + uuid: string, + isUserReplay: boolean, + onSettledLate?: ClaudeLateDispatchSettlement +): void { + if (!isUserReplay && !waiter.acceptsResult) { + return + } + // The provider acted on this dispatch, so the send it came from is delivered. + // A retired replay settles delivery only; it cannot reopen a turn. + if (waiter.clientMessageId) { + onSettledLate?.({ + clientMessageId: waiter.clientMessageId, + providerIdentity: { provider: 'claude', sessionId: session.providerSessionId, uuid } + }) + } +} diff --git a/src/main/claude/claude-structured-control-actions.test.ts b/src/main/claude/claude-structured-control-actions.test.ts index 3eaf496f75ad..7f197788b680 100644 --- a/src/main/claude/claude-structured-control-actions.test.ts +++ b/src/main/claude/claude-structured-control-actions.test.ts @@ -243,6 +243,7 @@ describe('answerClaudePrompt', () => { const resolvePrompt = vi.fn() session.translator = { handle: vi.fn(), + openTurnInLiveProviderCycle: false, journalPrompts: { cancel: vi.fn(() => ({ accepted: true as const })), resolve: resolvePrompt diff --git a/src/main/claude/claude-structured-control-actions.ts b/src/main/claude/claude-structured-control-actions.ts index 8c1a6462e9c7..8ec1aa2e9c41 100644 --- a/src/main/claude/claude-structured-control-actions.ts +++ b/src/main/claude/claude-structured-control-actions.ts @@ -1,10 +1,8 @@ import type { PermissionResult } from '@anthropic-ai/claude-agent-sdk' import type { ClaudePromptClaim } from './claude-structured-prompt-replies' import { ClaudeControlRequestError } from './claude-stream-json-connection' -import { - settleCancelledClaudeDispatchWaiters, - type ClaudeLateDispatchSettlement -} from './claude-structured-dispatch' +import { settleCancelledClaudeDispatchWaiters } from './claude-structured-dispatch' +import type { ClaudeLateDispatchSettlement } from './claude-replay-turn-resolution' import type { ClaudeSession } from './claude-structured-session-state' const INTERRUPT_CANCEL_QUEUED_CAPABILITY = 'interrupt_cancel_queued_v1' diff --git a/src/main/claude/claude-structured-dispatch-admission.test.ts b/src/main/claude/claude-structured-dispatch-admission.test.ts index 75553addd3c7..c4578ca38d8d 100644 --- a/src/main/claude/claude-structured-dispatch-admission.test.ts +++ b/src/main/claude/claude-structured-dispatch-admission.test.ts @@ -2,7 +2,8 @@ // completes, and nothing about elapsed time ever puts a message in doubt. import { describe, expect, it, vi } from 'vitest' -import { dispatchClaudeTurn, resolveClaudeReplayTurn } from './claude-structured-dispatch' +import { dispatchClaudeTurn } from './claude-structured-dispatch' +import { resolveClaudeReplayTurn } from './claude-replay-turn-resolution' import { childExited, sessionFor, @@ -61,8 +62,9 @@ describe('Claude structured dispatch admission', () => { true ) - // Queued while turn one is still running: Claude cannot echo it until that - // turn ends, so nothing about the wait is evidence of a delivery problem. + // Queued while turn one is still running: a fold is echoed mid-turn, a + // queued send only when its own turn starts — either way elapsed time is + // not evidence of a delivery problem. const queued = await dispatchClaudeTurn(session, { clientMessageId: 'client-2', body: userMessage([{ type: 'text', text: 'two' }]) diff --git a/src/main/claude/claude-structured-dispatch-waiters.ts b/src/main/claude/claude-structured-dispatch-waiters.ts index f3a3501ec8a6..92b6a5048b2f 100644 --- a/src/main/claude/claude-structured-dispatch-waiters.ts +++ b/src/main/claude/claude-structured-dispatch-waiters.ts @@ -10,11 +10,11 @@ export function forgetRetiredWaiter(session: ClaudeSession, waiter: ClaudeDispat } /** - * A waiter with no deadline. The echo Claude sends is emitted when the provider - * STARTS the turn, so a message queued behind a running turn cannot be echoed - * until that turn ends — an interval bounded only by the previous turn. Elapsed - * time is therefore not evidence about delivery, and nothing here expires. - * Waiters are retired by process facts instead: a failed write, or child exit. + * A waiter with no deadline. A mid-turn send Claude folds into the running turn + * is replayed mid-turn; one it runs later is replayed only when its own turn + * starts — an interval bounded only by the previous turn. Elapsed time is + * therefore not evidence about delivery, and nothing here expires. Waiters are + * retired by process facts instead: a failed write, or child exit. */ export function waitForReplay( session: ClaudeSession, diff --git a/src/main/claude/claude-structured-dispatch.test.ts b/src/main/claude/claude-structured-dispatch.test.ts index c540167de4c2..92ae0253711a 100644 --- a/src/main/claude/claude-structured-dispatch.test.ts +++ b/src/main/claude/claude-structured-dispatch.test.ts @@ -2,7 +2,8 @@ import { mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { describe, expect, it, vi } from 'vitest' -import { dispatchClaudeTurn, resolveClaudeReplayTurn } from './claude-structured-dispatch' +import { dispatchClaudeTurn } from './claude-structured-dispatch' +import { resolveClaudeReplayTurn } from './claude-replay-turn-resolution' import { ClaudeDispatchContentError, readClaudeImage } from './claude-structured-dispatch-content' import { claudeUnwrittenUserMessageError } from './claude-agent-sdk-user-message-queue' import type { ClaudeSession } from './claude-structured-session-state' diff --git a/src/main/claude/claude-structured-dispatch.ts b/src/main/claude/claude-structured-dispatch.ts index 220542fab91b..612f6391ced5 100644 --- a/src/main/claude/claude-structured-dispatch.ts +++ b/src/main/claude/claude-structured-dispatch.ts @@ -7,16 +7,8 @@ import { } from './claude-structured-dispatch-waiters' import type { AgentJournalMessageItem } from '../../shared/agent-session-journal-types' import type { AgentSessionDispatchOutcome } from '../native-chat/agent-session-wire/structured-agent-session-adapter' -import { - claudeHasReplayContent, - readClaudeMessageEnvelope -} from './claude-structured-item-translation' -import type { - ClaudeDispatchWaiter, - ClaudeLateDispatchOutcome, - ClaudeSession -} from './claude-structured-session-state' -import { readClaudeFrameString } from './claude-structured-init-proof' +import type { ClaudeSession } from './claude-structured-session-state' +import type { ClaudeLateDispatchSettlement } from './claude-replay-turn-resolution' import { claudeDispatchContentKey, claudeDispatchContentRejection, @@ -40,158 +32,6 @@ import { const MAX_ACTIVE_DISPATCH_WAITERS = 64 -/** Settles a provider-proven late outcome; replay rows independently reconcile acceptance. */ -export type ClaudeLateDispatchSettlement = (input: ClaudeLateDispatchOutcome) => void - -export type ClaudeReplayTurnOrigin = { requestedAt: number | null } - -export function resolveClaudeReplayTurn( - session: ClaudeSession, - message: Record, - onSettledLate?: ClaudeLateDispatchSettlement -): ClaudeReplayTurnOrigin | null { - const envelope = readClaudeMessageEnvelope(message) - const isUserReplay = - envelope?.role === 'user' && - message.parent_tool_use_id === null && - claudeHasReplayContent(envelope) - const isCompletedCommand = message.type === 'result' - if ( - (!isUserReplay && !isCompletedCommand) || - readClaudeFrameString(message, 'session_id') !== session.providerSessionId - ) { - return null - } - const uuid = readClaudeFrameString(message, 'uuid') - if (!uuid) { - return null - } - - // Newer SDK frames carry the client uuid that caused a turn. A correlation - // value is authoritative: never fall back to queue order or content, since - // identical prompts may be in flight across a timeout boundary. - const userMessageUuid = readClaudeFrameString(message, 'user_message_uuid') - if (userMessageUuid) { - const exact = session.dispatchWaiters.find( - (candidate) => candidate.sentUuid === userMessageUuid - ) - if (exact) { - settleWaiter(session, exact, uuid, onSettledLate) - return isUserReplay ? { requestedAt: exact.requestedAt } : null - } - const retired = session.retiredDispatchWaiters.find( - (candidate) => candidate.sentUuid === userMessageUuid - ) - if (retired) { - forgetRetiredWaiter(session, retired) - recoverLateIdentity(session, retired, uuid, isUserReplay, onSettledLate) - return null - } - return null - } - - const exact = session.dispatchWaiters.find((candidate) => candidate.sentUuid === uuid) - if (exact) { - settleWaiter(session, exact, uuid, onSettledLate) - return isUserReplay ? { requestedAt: exact.requestedAt } : null - } - const retired = session.retiredDispatchWaiters.find((candidate) => candidate.sentUuid === uuid) - if (retired) { - forgetRetiredWaiter(session, retired) - recoverLateIdentity(session, retired, uuid, isUserReplay, onSettledLate) - return null - } - - if (isUserReplay) { - // Compatibility CLIs may mint a new replay uuid instead of echoing the - // client uuid. Content is an acceptable join only when it is the sole - // candidate on one side of the timeout boundary; with active and retired - // candidates present, identical prompts are intentionally left unknown. - const replayContentKey = claudeDispatchContentKey(envelope.content) - if (!session.replayContentFallbackBlocked && session.retiredDispatchWaiters.length === 0) { - const compatible = session.dispatchWaiters.filter( - (candidate) => candidate.replayContentKey === replayContentKey - ) - if (compatible.length === 1) { - const [candidate] = compatible - settleWaiter(session, candidate!, uuid, onSettledLate) - return { requestedAt: candidate!.requestedAt } - } - } else if (!session.replayContentFallbackBlocked && session.dispatchWaiters.length === 0) { - const lateCompatible = session.retiredDispatchWaiters.filter( - (candidate) => candidate.replayContentKey === replayContentKey - ) - if (lateCompatible.length === 1) { - const [candidate] = lateCompatible - forgetRetiredWaiter(session, candidate!) - recoverLateIdentity(session, candidate!, uuid, true, onSettledLate) - return null - } - } - return null - } - const current = session.dispatchWaiters[0] - if (isCompletedCommand && !current?.acceptsResult) { - return null - } - // A legacy result has no dispatch correlation. Any retired waiter makes queue order ambiguous, - // even when the retired dispatch was an ordinary turn rather than a slash command. - if (isCompletedCommand && session.retiredDispatchWaiters.length > 0) { - return null - } - // Once an eviction occurred, a fresh result uuid cannot be joined to a waiter by queue order. - if (isCompletedCommand && session.replayContentFallbackBlocked) { - return null - } - const waiter = uuid ? session.dispatchWaiters.shift() : undefined - if (waiter && uuid) { - settleWaiter(session, waiter, uuid, onSettledLate) - return isUserReplay ? { requestedAt: waiter.requestedAt } : null - } - return null -} - -function settleWaiter( - session: ClaudeSession, - waiter: ClaudeDispatchWaiter, - uuid: string, - onSettledLate?: ClaudeLateDispatchSettlement -): void { - const index = session.dispatchWaiters.indexOf(waiter) - if (index !== -1) { - session.dispatchWaiters.splice(index, 1) - } - waiter.settledUuid = uuid - waiter.resolve(uuid) - // Dispatch returned on admission, so the replay is what settles delivery. - if (waiter.clientMessageId) { - onSettledLate?.({ - clientMessageId: waiter.clientMessageId, - providerIdentity: { provider: 'claude', sessionId: session.providerSessionId, uuid } - }) - } -} - -function recoverLateIdentity( - session: ClaudeSession, - waiter: ClaudeDispatchWaiter, - uuid: string, - isUserReplay: boolean, - onSettledLate?: ClaudeLateDispatchSettlement -): void { - if (!isUserReplay && !waiter.acceptsResult) { - return - } - // The provider acted on this dispatch, so the send it came from is delivered. - // A retired replay settles delivery only; it cannot reopen a turn. - if (waiter.clientMessageId) { - onSettledLate?.({ - clientMessageId: waiter.clientMessageId, - providerIdentity: { provider: 'claude', sessionId: session.providerSessionId, uuid } - }) - } -} - export function settleCancelledClaudeDispatchWaiters( session: ClaudeSession, cancelledUuids: readonly string[], @@ -327,6 +167,7 @@ export async function dispatchClaudeTurn( } // The write is the admission signal. Awaiting the echo here would block on the // turn already running, which is why the deadline this replaces kept declaring - // doubt about messages that were delivered. `settleWaiter` finishes the job. + // doubt about messages that were delivered. The replay resolution + // (`claude-replay-turn-resolution.ts`) finishes the job. return { state: 'admitted' } } diff --git a/src/main/claude/claude-structured-effort-reporting.test.ts b/src/main/claude/claude-structured-effort-reporting.test.ts index 7cf59ee555bc..2c319c86ee72 100644 --- a/src/main/claude/claude-structured-effort-reporting.test.ts +++ b/src/main/claude/claude-structured-effort-reporting.test.ts @@ -7,7 +7,7 @@ import { import { readClaudeSettingsEffort } from './claude-structured-session-options' import type { ClaudeSession } from './claude-structured-session-state' import type { ClaudeStructuredSessionEvent } from './claude-structured-session-adapter' -import { acquired, fakeClaude } from './claude-structured-session-test-support' +import { USER_MESSAGE, acquired, fakeClaude } from './claude-structured-session-test-support' /** Verbatim from Claude Code 2.1.258's get_settings response. */ const REAL_SETTINGS = { @@ -93,7 +93,14 @@ describe('Claude effort reporting', () => { it('keeps the init fixture free of an effort the real frame never sends', async () => { const events: ClaudeStructuredSessionEvent[] = [] - await acquired(fakeClaude(), {}, events) + const adapter = await acquired(fakeClaude(), {}, events) + // Live: init arrives when the first command starts a cycle, not at startup. + await adapter.dispatch({ + sessionId: 'session-1', + clientMessageId: 'seed-cycle', + body: USER_MESSAGE, + fence: 7 + }) const init = events.flatMap((event) => event.type === 'message' && event.message.subtype === 'init' ? [event.message] : [] ) diff --git a/src/main/claude/claude-structured-journal-translation.ts b/src/main/claude/claude-structured-journal-translation.ts index 16c054945a16..082b0024061f 100644 --- a/src/main/claude/claude-structured-journal-translation.ts +++ b/src/main/claude/claude-structured-journal-translation.ts @@ -184,6 +184,21 @@ export function createClaudeJournalTranslator( } if (event.type === 'message') { context.observe(event.message, event.observedAt ?? Date.now()) + // A root init is the CLI starting a new request cycle (measured per turn, + // per queued turn, per background wake, per /compact); a send replayed + // after that cycle's first root work was folded into it. Task frames are + // not cycle work: they arrive between cycles too. + if (isRootClaudeFrame(event.message)) { + if (event.message.type === 'system' && event.message.subtype === 'init') { + turn.observeProviderCycleStart() + } else if ( + event.startsTurn === true || + event.message.type === 'assistant' || + event.message.type === 'stream_event' + ) { + turn.observeProviderCycleWork() + } + } } if (event.type === 'message' && handleStream(event.message, event.observedAt ?? Date.now())) { return @@ -281,6 +296,9 @@ export function createClaudeJournalTranslator( get currentTurnId() { return turn.id }, + get openTurnInLiveProviderCycle() { + return turn.openedInLiveProviderCycle + }, flush: streamedText.flush, childToolOwner: childQueries.childToolOwner, childActivity: childQueries.childActivity, diff --git a/src/main/claude/claude-structured-model-confirmation.test.ts b/src/main/claude/claude-structured-model-confirmation.test.ts index 96d7e9daa391..f4034400cbfc 100644 --- a/src/main/claude/claude-structured-model-confirmation.test.ts +++ b/src/main/claude/claude-structured-model-confirmation.test.ts @@ -1,7 +1,12 @@ import { describe, expect, it } from 'vitest' import { setClaudeStructuredOption } from './claude-structured-options' import type { ClaudeSession } from './claude-structured-session-state' -import { PROVIDER_SESSION_ID, acquired, fakeClaude } from './claude-structured-session-test-support' +import { + PROVIDER_SESSION_ID, + USER_MESSAGE, + acquired, + fakeClaude +} from './claude-structured-session-test-support' /** Verbatim rows from Claude Code 2.1.258's list_models response. */ const CATALOG = [ @@ -147,6 +152,13 @@ describe('Claude model confirmation', () => { routes: { list_models: () => CATALOG } }) const adapter = await acquired(claude) + // The model is confirmed by a cycle's init frame, so start one. + await adapter.dispatch({ + sessionId: 'session-1', + clientMessageId: 'seed-cycle', + body: USER_MESSAGE, + fence: 7 + }) await adapter.setOption({ sessionId: 'session-1', key: 'effort', value: 'high', fence: 7 }) await expect(adapter.readOptions({ sessionId: 'session-1', fence: 7 })).resolves.toMatchObject({ diff --git a/src/main/claude/claude-structured-prompt-ownership.test.ts b/src/main/claude/claude-structured-prompt-ownership.test.ts index 3c290fa5184a..53d6f63623d9 100644 --- a/src/main/claude/claude-structured-prompt-ownership.test.ts +++ b/src/main/claude/claude-structured-prompt-ownership.test.ts @@ -17,9 +17,9 @@ import { acquired, adapterFor, fakeClaude, - identityFor, - invokeCanUseTool + identityFor } from './claude-structured-session-test-support' +import { invokeCanUseTool } from './claude-can-use-tool-test-support' function deferred(): { promise: Promise; resolve: () => void } { let resolve = (): void => {} diff --git a/src/main/claude/claude-structured-prompt-ownership.ts b/src/main/claude/claude-structured-prompt-ownership.ts index 864a99a0b770..e1c1aa371bf8 100644 --- a/src/main/claude/claude-structured-prompt-ownership.ts +++ b/src/main/claude/claude-structured-prompt-ownership.ts @@ -10,7 +10,7 @@ import { cancelClaudeTurn, supportsClaudeQueuedInterruptCancellation } from './claude-structured-control-actions' -import type { ClaudeLateDispatchSettlement } from './claude-structured-dispatch' +import type { ClaudeLateDispatchSettlement } from './claude-replay-turn-resolution' import { buildClaudePromptReply } from './claude-structured-prompt-replies' import type { ClaudeSession } from './claude-structured-session-state' import type { ClaudePendingPrompt } from './claude-prompt-registry' diff --git a/src/main/claude/claude-structured-real-cli-fold.test.ts b/src/main/claude/claude-structured-real-cli-fold.test.ts new file mode 100644 index 000000000000..5ce21d83f170 --- /dev/null +++ b/src/main/claude/claude-structured-real-cli-fold.test.ts @@ -0,0 +1,194 @@ +// The fold receipt against the real CLI: a message sent while a turn runs is +// folded by the CLI into the running turn, and Orca must keep ONE turn row — +// no interrupted marking, no second bar. Runs only where a signed-in Claude CLI +// exists, like the rest of the real-CLI suite. Live sessions prove the session +// from a SessionStart hook frame BEFORE system/init arrives, which is exactly +// the path the fixture harness cannot fake end to end. + +import { randomUUID } from 'node:crypto' +import { mkdtemp } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { describe, expect, it, vi } from 'vitest' +import type { + AgentJournalItemBody, + AgentSessionJournalIdentity +} from '../../shared/agent-session-journal-types' +import { readAgentJournalTurn } from '../../shared/agent-session-turn-record' +import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' +import { CLAUDE_STRUCTURED_BASE_OPTIONS } from './claude-structured-launch-resolution' +import { + ClaudeStructuredSessionAdapter, + type ClaudeStructuredSessionEvent +} from './claude-structured-session-adapter' +import { + realClaudeAuthenticated, + realClaudeAvailable, + realClaudeCommand, + realClaudeLaunchHome +} from './claude-real-cli-availability-test-support' + +const SESSION_ID = 'real-cli-fold' +// Pins the live proof order (SessionStart hook frame before system/init) and lets the +// Bash steps run unprompted, whatever the config dir under test configures. +const FOLD_SESSION_SETTINGS = JSON.stringify({ + hooks: { SessionStart: [{ hooks: [{ type: 'command', command: 'echo' }] }] }, + permissions: { allow: ['Bash(sleep:*)'] } +}) + +function identity(providerSessionId: string): AgentSessionJournalIdentity { + return { + sessionId: SESSION_ID, + workspaceId: 'real-cli-fold-workspace', + hostId: 'local', + agent: 'claude', + providerHandle: { kind: 'claude', sessionId: providerSessionId, leafUuid: null } + } +} + +async function until(check: () => boolean, timeoutMs: number): Promise { + const deadline = Date.now() + timeoutMs + while (Date.now() < deadline) { + if (check()) { + return true + } + await new Promise((resolve) => setTimeout(resolve, 200)) + } + return check() +} + +describe.skipIf(!realClaudeAvailable)('Claude structured real CLI fold', () => { + it.skipIf(!realClaudeAuthenticated)( + 'keeps one turn row when the CLI folds a mid-turn send', + async () => { + const providerSessionId = randomUUID() + const { claudeConfigDir, env } = realClaudeLaunchHome() + const cwd = await mkdtemp(join(tmpdir(), 'orca-real-fold-')) + const events: ClaudeStructuredSessionEvent[] = [] + const turnRows: NonNullable>[] = [] + const sink: StructuredAgentSessionEventSink = { + appendItem: (_identity, body: AgentJournalItemBody) => { + const turn = readAgentJournalTurn(body) + if (turn) { + turnRows.push(turn) + } + }, + appendTombstone: () => {}, + publish: () => {} + } + const settled = vi.fn() + const adapter = new ClaudeStructuredSessionAdapter({ + resolveLaunch: async () => ({ + pathToClaudeCodeExecutable: realClaudeCommand, + options: { + ...CLAUDE_STRUCTURED_BASE_OPTIONS, + extraArgs: { + ...CLAUDE_STRUCTURED_BASE_OPTIONS.extraArgs, + settings: FOLD_SESSION_SETTINGS + }, + sessionId: providerSessionId + }, + cwd, + env, + claudeConfigDir, + providerSessionId, + resumeLeafUuid: null, + resumesTranscript: false, + continuesChain: false + }), + onEvent: (event) => events.push(event), + onDispatchSettledLate: settled, + readProcessStartTime: async () => 1 + }) + try { + await adapter.acquire({ + identity: identity(providerSessionId), + fence: 1, + spawnToken: 'real-cli-fold', + events: sink + }) + await adapter.awaitStarted(SESSION_ID) + // Startup proved from the SessionStart hook frame, with no init yet. + expect( + events.some( + (event) => + event.type === 'message' && + event.message.type === 'system' && + event.message.subtype === 'init' + ) + ).toBe(false) + + await expect( + adapter.dispatch({ + sessionId: SESSION_ID, + clientMessageId: 'client-A', + body: { + kind: 'message', + role: 'user', + blocks: [ + { + type: 'text', + text: 'Use the Bash tool to run `sleep 8` two separate times, one call at a time, waiting for each. Then reply exactly: FIRST DONE' + } + ] + }, + requestedAt: Date.now(), + fence: 1 + }) + ).resolves.toEqual({ state: 'admitted' }) + + // Wait for A's replay to open the turn, then send B mid-turn: the first + // `sleep 8` guarantees the CLI is still inside A's request cycle. + expect( + await until( + () => events.some((event) => event.type === 'message' && event.startsTurn === true), + 30_000 + ) + ).toBe(true) + await new Promise((resolve) => setTimeout(resolve, 2_000)) + await expect( + adapter.dispatch({ + sessionId: SESSION_ID, + clientMessageId: 'client-B', + body: { + kind: 'message', + role: 'user', + blocks: [{ type: 'text', text: 'Also say the word banana at the end of your reply.' }] + }, + requestedAt: Date.now(), + fence: 1 + }) + ).resolves.toEqual({ state: 'admitted' }) + + const results = () => + events.flatMap((event) => + event.type === 'message' && event.message.type === 'result' ? [event.message] : [] + ) + expect(await until(() => results().length > 0, 90_000)).toBe(true) + + // The CLI folded: one result names both sends. (If this ever reports a + // lone send, the steer raced past the fold window — a miss, not a fold.) + const named = results().flatMap((message) => + Array.isArray(message.user_message_uuids) ? [message.user_message_uuids] : [] + ) + expect(named[0]).toHaveLength(2) + + // ONE turn for the whole run: never interrupted, and B settled accepted + // into it under its own adopted uuid. + expect(turnRows.every((turn) => turn.state !== 'interrupted')).toBe(true) + expect([...new Set(turnRows.map((turn) => turn.turnId))]).toHaveLength(1) + expect(turnRows.at(-1)).toMatchObject({ state: 'completed' }) + expect(settled).toHaveBeenCalledWith( + expect.objectContaining({ + sessionId: SESSION_ID, + clientMessageId: 'client-B', + providerIdentity: expect.objectContaining({ provider: 'claude' }) + }) + ) + } finally { + await adapter.closeAll() + } + }, + 150_000 + ) +}) diff --git a/src/main/claude/claude-structured-real-cli.test.ts b/src/main/claude/claude-structured-real-cli.test.ts index cfd4c8c33eab..20670147ca0d 100644 --- a/src/main/claude/claude-structured-real-cli.test.ts +++ b/src/main/claude/claude-structured-real-cli.test.ts @@ -1,50 +1,24 @@ -import { spawnSync } from 'node:child_process' import { randomUUID } from 'node:crypto' import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' import { homedir, tmpdir } from 'node:os' import { basename, join, relative } from 'node:path' import { describe, expect, it } from 'vitest' import type { AgentSessionJournalIdentity } from '../../shared/agent-session-journal-types' -import { resolveClaudeCommand } from '../codex-cli/command' import { resolveSessionFilePath } from '../native-chat/session-file-resolver' -import { getSpawnArgsForWindows } from '../win32-utils' import { CLAUDE_STRUCTURED_BASE_OPTIONS } from './claude-structured-launch-resolution' +import { + realClaudeAuthenticated, + realClaudeAuthStatus, + realClaudeAvailable, + realClaudeCommand +} from './claude-real-cli-availability-test-support' import { ClaudeStructuredSessionAdapter, type ClaudeStructuredSessionEvent } from './claude-structured-session-adapter' import type { ClaudeStructuredSessionAdapterDeps } from './claude-structured-session-state' -const command = resolveClaudeCommand() -const versionLaunch = getSpawnArgsForWindows(command, ['--version']) -const realClaudeAvailable = - spawnSync(versionLaunch.spawnCmd, versionLaunch.spawnArgs, { - stdio: 'ignore', - windowsHide: true, - timeout: 5_000 - }).status === 0 -const authStatusLaunch = getSpawnArgsForWindows(command, ['auth', 'status', '--json']) -/** The CLI's own account report — the only source of truth for where it writes that - * is not derived from Orca's own path expressions. */ -const realClaudeAuthStatus = (() => { - if (!realClaudeAvailable) { - return null - } - const result = spawnSync(authStatusLaunch.spawnCmd, authStatusLaunch.spawnArgs, { - encoding: 'utf8', - windowsHide: true, - timeout: 5_000 - }) - if (result.status !== 0) { - return null - } - try { - return JSON.parse(result.stdout) as { loggedIn?: boolean; projectsDirectory?: string } - } catch { - return null - } -})() -const realClaudeAuthenticated = realClaudeAuthStatus?.loggedIn === true +const command = realClaudeCommand function realAdapter( providerSessionId: string, diff --git a/src/main/claude/claude-structured-session-acquisition.ts b/src/main/claude/claude-structured-session-acquisition.ts index ac8d65ba107b..b5a7a5d30616 100644 --- a/src/main/claude/claude-structured-session-acquisition.ts +++ b/src/main/claude/claude-structured-session-acquisition.ts @@ -7,7 +7,7 @@ import { CLAUDE_AUTH_SWITCH_IN_PROGRESS_MESSAGE } from '../claude-accounts/envir import { isClaudeAuthSwitchInProgress } from '../claude-accounts/live-pty-gate' import { openClaudeStreamJsonConnection } from './claude-stream-json-connection' import { buildClaudePermissionCallbacks } from './claude-structured-inbound-control' -import { resolveClaudeReplayTurn } from './claude-structured-dispatch' +import { resolveClaudeReplayTurn } from './claude-replay-turn-resolution' import { readClaudeCapabilities, readClaudeFrameString, diff --git a/src/main/claude/claude-structured-session-adapter-turns.test.ts b/src/main/claude/claude-structured-session-adapter-turns.test.ts index c77d5ee0a911..d410861464a9 100644 --- a/src/main/claude/claude-structured-session-adapter-turns.test.ts +++ b/src/main/claude/claude-structured-session-adapter-turns.test.ts @@ -223,6 +223,13 @@ describe('ClaudeStructuredSessionAdapter turns and controls', () => { } }) const adapter = await acquired(claude) + // The model is reported by a cycle's init frame, so start one. + await adapter.dispatch({ + sessionId: 'session-1', + clientMessageId: 'seed-cycle', + body: USER_MESSAGE, + fence: 7 + }) await expect(adapter.readOptions({ sessionId: 'session-1', fence: 7 })).resolves.toEqual({ models: [ @@ -251,6 +258,13 @@ describe('ClaudeStructuredSessionAdapter turns and controls', () => { } }) const adapter = await acquired(claude) + // The custom model only reports on the first cycle's init frame. + await adapter.dispatch({ + sessionId: 'session-1', + clientMessageId: 'seed-cycle', + body: USER_MESSAGE, + fence: 7 + }) const result = await adapter.readOptions({ sessionId: 'session-1', fence: 7 }) expect(result.models.map((model) => model.id)).toEqual([ diff --git a/src/main/claude/claude-structured-session-adapter.test.ts b/src/main/claude/claude-structured-session-adapter.test.ts index 376cac9d52f1..ee14b6b525a8 100644 --- a/src/main/claude/claude-structured-session-adapter.test.ts +++ b/src/main/claude/claude-structured-session-adapter.test.ts @@ -18,12 +18,12 @@ import { adapterFor, fakeClaude, identityFor, - invokeCanUseTool, PROVIDER_SESSION_ID, tick, USER_MESSAGE, type FakeConnection } from './claude-structured-session-test-support' +import { invokeCanUseTool } from './claude-can-use-tool-test-support' describe('ClaudeStructuredSessionAdapter.acquire', () => { it('pins the account and proves init without treating the system-frame uuid as a chain leaf', async () => { @@ -62,7 +62,8 @@ describe('ClaudeStructuredSessionAdapter.acquire', () => { mintedAtFence: 7, observedAt: 1_700_000_000_500 }) - expect(events[0]).toMatchObject({ type: 'message', message: { subtype: 'init' } }) + // Live proof order: the SessionStart hook frame arrives before any init. + expect(events[0]).toMatchObject({ type: 'message', message: { subtype: 'hook_started' } }) }) it('restores persisted model and effort before publishing a reacquired session', async () => { @@ -344,7 +345,10 @@ describe('ClaudeStructuredSessionAdapter.acquire', () => { session_id: 'foreign-provider-session' }) await Promise.resolve() - expect(events.filter((event) => event.type === 'message')).toHaveLength(1) + // Startup hook proof + the first cycle's init are admitted; nothing foreign is. + expect( + events.flatMap((event) => (event.type === 'message' ? [event.message.subtype] : [])) + ).toEqual(['hook_started', 'hook_response', 'init']) expect(settled).not.toHaveBeenCalled() connection.handlers.onMessage?.({ diff --git a/src/main/claude/claude-structured-session-recovery.test.ts b/src/main/claude/claude-structured-session-recovery.test.ts index a5647caee846..71a7ac9ce319 100644 --- a/src/main/claude/claude-structured-session-recovery.test.ts +++ b/src/main/claude/claude-structured-session-recovery.test.ts @@ -9,10 +9,10 @@ import { adapterFor, fakeClaude, identityFor, - invokeCanUseTool, PROVIDER_SESSION_ID, tick } from './claude-structured-session-test-support' +import { invokeCanUseTool } from './claude-can-use-tool-test-support' describe('ClaudeStructuredSessionAdapter close and exit recovery', () => { it('shares concurrent close finalization and emits lifecycle once', async () => { diff --git a/src/main/claude/claude-structured-session-state.ts b/src/main/claude/claude-structured-session-state.ts index a0b0f3216793..6848d9a19437 100644 --- a/src/main/claude/claude-structured-session-state.ts +++ b/src/main/claude/claude-structured-session-state.ts @@ -42,7 +42,9 @@ export type ClaudeStructuredSessionEvent = type: 'message' sessionId: string message: Record - /** Present only when this replay acknowledged Orca's in-flight dispatch. */ + /** Present only when this replay acknowledged Orca's in-flight dispatch + * AND opens a turn; a replay folded into the running turn settles + * delivery without one. */ startsTurn?: true /** Submission instant of the dispatch this replay acknowledged; the origin * of the turn it opens. Absent when the host cannot name a send. */ diff --git a/src/main/claude/claude-structured-session-test-support.ts b/src/main/claude/claude-structured-session-test-support.ts index 51c7c1c8fff7..0380d5ac12fc 100644 --- a/src/main/claude/claude-structured-session-test-support.ts +++ b/src/main/claude/claude-structured-session-test-support.ts @@ -51,6 +51,9 @@ export function fakeClaude( initSessionId?: string initUuid?: string initModel?: string + /** 'session-start' (default) mirrors live: a SessionStart hook frame proves the + * session and system/init arrives only when the first command starts a cycle. + * 'init' emits init at startup — an UNMEASURED shape, opt-in only. */ initProof?: 'init' | 'session-start' | 'none' initAccount?: unknown initCommands?: unknown @@ -81,6 +84,22 @@ export function fakeClaude( return route ? route(params) : undefined } const openConnection: typeof openClaudeStreamJsonConnection = async (launch, handlers = {}) => { + let cycleInitEmitted = false + // Keys mirror the real system/init frame, which carries `model` but no + // effort of any kind: the current effort only comes back from get_settings. + // Never add a field the CLI does not send. + const emitCycleInit = (): void => { + cycleInitEmitted = true + handlers.onMessage?.({ + type: 'system', + subtype: 'init', + session_id: options.initSessionId ?? PROVIDER_SESSION_ID, + uuid: options.initUuid ?? 'init-uuid', + model: options.initModel ?? 'claude-sonnet-5', + apiKeySource: 'none', + ...(options.capabilities ? { capabilities: options.capabilities } : {}) + }) + } const connection: FakeConnection = { launch, handlers, @@ -102,7 +121,13 @@ export function fakeClaude( // The SDK rejects pending control requests once the transport ends. throw new Error('Query closed before response received') } - if (options.initProof === 'session-start') { + if (options.initProof === 'init') { + // UNMEASURED startup shape, kept only as an explicit opt-in: live + // sessions prove startup with a SessionStart hook frame instead. + emitCycleInit() + } else if (options.initProof !== 'none') { + // The live proof order (measured through Orca's adapter): SessionStart + // hook frames arrive first; system/init only when a cycle starts. handlers.onMessage?.({ type: 'system', subtype: 'hook_started', @@ -110,22 +135,19 @@ export function fakeClaude( session_id: options.initSessionId ?? PROVIDER_SESSION_ID, uuid: options.initUuid ?? 'init-uuid' }) - } else if (options.initProof !== 'none') { - // Keys mirror the real system/init frame, which carries `model` but no - // effort of any kind: the current effort only comes back from - // get_settings. Never add a field the CLI does not send. handlers.onMessage?.({ type: 'system', - subtype: 'init', + subtype: 'hook_response', + hook_name: 'SessionStart:startup', session_id: options.initSessionId ?? PROVIDER_SESSION_ID, - uuid: options.initUuid ?? 'init-uuid', - model: options.initModel ?? 'claude-sonnet-5', - apiKeySource: 'none', - ...(options.capabilities ? { capabilities: options.capabilities } : {}) + uuid: 'hook-response-uuid' }) } return { models: options.initModels ?? [{ value: 'claude-sonnet', displayName: 'Sonnet' }], + // Capabilities ride the initialize result, where startup facts read + // them regardless of when the first init frame arrives. + ...(options.capabilities ? { capabilities: options.capabilities } : {}), ...(options.initCommands === undefined ? {} : { commands: options.initCommands }), ...(options.initAccount === undefined ? {} : { account: options.initAccount }) } @@ -184,6 +206,11 @@ export function fakeClaude( await beforeDispatch() } connection.sent.push(message) + // Live: the first command starts a request cycle, whose init precedes + // the replay. Later cycles are the test's own frames. + if (message.type === 'user' && !cycleInitEmitted && options.initProof !== 'none') { + emitCycleInit() + } if (message.type === 'user' && options.replayUuid !== null) { const configuredReplayUuid = options.replayUuids ? options.replayUuids[replayIndex++] @@ -297,29 +324,3 @@ export function recordingJournalSink(): StructuredAgentSessionEventSink { export function tick(): Promise { return new Promise((resolve) => setImmediate(resolve)) } - -export function invokeCanUseTool( - connection: FakeConnection, - toolName: string, - requestId: string, - toolUseID: string, - extra: { - input?: Record - suggestions?: unknown[] - signal?: AbortSignal - } = {} -): { promise: Promise; settled: () => boolean } { - const options = { - requestId, - toolUseID, - signal: extra.signal ?? new AbortController().signal, - ...(extra.suggestions ? { suggestions: extra.suggestions } : {}) - } as unknown as Parameters>[2] - let done = false - const promise = Promise.resolve( - connection.handlers.canUseTool?.(toolName, extra.input ?? {}, options) - ).finally(() => { - done = true - }) - return { promise, settled: () => done } -} diff --git a/src/main/claude/claude-turn-ownership.test.ts b/src/main/claude/claude-turn-ownership.test.ts index 338a6937716d..81a84989aa44 100644 --- a/src/main/claude/claude-turn-ownership.test.ts +++ b/src/main/claude/claude-turn-ownership.test.ts @@ -96,6 +96,7 @@ function sessionHoldingTurn(turnId: string | null): ReturnType { session.dispatchSequence = 1 session.translator = { handle: vi.fn(), + openTurnInLiveProviderCycle: false, journalPrompts: { cancel: vi.fn(), resolve: vi.fn() }, currentTurnId: 'turn-1', flush: vi.fn(), diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-provider-started.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-provider-started.test.ts index 7c195a9a1243..b18369838698 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-provider-started.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-provider-started.test.ts @@ -37,7 +37,17 @@ beforeEach(async () => { resetHostTestOperationIds() lifecycle = [] statuses = [] - const claude = fakeClaude({ initDelayMs: INIT_DELAY_MS, initModel: 'claude-opus-9' }) + // A CLI whose own default is not the catalog's: startup reports it through get_settings, + // since system/init arrives only with the first command. + const claude = fakeClaude({ + initDelayMs: INIT_DELAY_MS, + initModel: 'claude-opus-9', + settings: { + applied: { model: 'claude-opus-9', effort: 'high', advisor: null, ultracode: false }, + effective: { model: 'claude-opus-9', effortLevel: 'high', env: {} }, + sources: {} + } + }) adapter = new ClaudeStructuredSessionAdapter({ resolveLaunch: async () => ({ pathToClaudeCodeExecutable: 'claude', diff --git a/src/main/runtime/orchestration/structured-mailbox-pointer-host.test.ts b/src/main/runtime/orchestration/structured-mailbox-pointer-host.test.ts index ba28ee431743..1588e110a1da 100644 --- a/src/main/runtime/orchestration/structured-mailbox-pointer-host.test.ts +++ b/src/main/runtime/orchestration/structured-mailbox-pointer-host.test.ts @@ -42,7 +42,7 @@ describe('structured mailbox pointer host', () => { // The defect this pins: a running turn is announced by ONE lifecycle item, and settlement // tombstones it rather than rewriting it. A long tool-calling turn pushes that item arbitrarily // far from the tail, so any page-sized read reports a busy worker as idle — and the pointer is - // then delivered mid-turn, which Codex coalesces into the running turn and Claude queues behind + // then delivered mid-turn, which Codex coalesces into the running turn and Claude folds into // it -- either way folded into work already in flight rather than read as a new instruction. const items = [runningTurn(), ...transcript(500)] hostRef.current = { journalSnapshot: () => ({ items }) } diff --git a/src/main/runtime/orchestration/structured-session-pointer-delivery.ts b/src/main/runtime/orchestration/structured-session-pointer-delivery.ts index 4071d17a0733..040bdd431907 100644 --- a/src/main/runtime/orchestration/structured-session-pointer-delivery.ts +++ b/src/main/runtime/orchestration/structured-session-pointer-delivery.ts @@ -68,7 +68,8 @@ export function structuredSessionGateFacts( * them. Neither refuses the frame: Codex COALESCES a mid-turn `turn/start` into * the running turn -- measured on codex-cli 0.147.0, 0.150.1 and 0.153.4, none * of which refuse it and none of which fire a second `turn/started` -- and - * Claude queues it behind the turn. Both therefore + * Claude folds it into the running turn (or runs it as the next turn when the + * turn ends first). Both therefore * fold the nudge into work already in flight, where it reads as part of the * running turn rather than a new instruction. Waiting for the turn to settle is * the one contract that holds for both, and it preserves orchestration's diff --git a/src/main/runtime/orchestration/structured-worker-group-addressing.test.ts b/src/main/runtime/orchestration/structured-worker-group-addressing.test.ts index 2f7b0a49eaf9..c553e8e39d14 100644 --- a/src/main/runtime/orchestration/structured-worker-group-addressing.test.ts +++ b/src/main/runtime/orchestration/structured-worker-group-addressing.test.ts @@ -164,7 +164,7 @@ describe('group addressing and structured workers', () => { // The same trap that already cost this branch once: settlement tombstones the lifecycle item // rather than rewriting it, so a long tool-calling turn pushes it arbitrarily far from the // tail and any page-sized read reports a BUSY worker as idle — then `@idle` broadcasts into a - // running turn, which Codex refuses outright and Claude queues behind. + // running turn, which Codex refuses outright and Claude folds into it. registerWorker() installHost({ items: [runningTurn(), ...transcript(500)] }) expect(await structuredWorkerAgentStatus(SESSION_ID)).toBe('working') diff --git a/src/main/runtime/orchestration/structured-worker-group-addressing.ts b/src/main/runtime/orchestration/structured-worker-group-addressing.ts index 4115f168552b..3a6161f81872 100644 --- a/src/main/runtime/orchestration/structured-worker-group-addressing.ts +++ b/src/main/runtime/orchestration/structured-worker-group-addressing.ts @@ -68,8 +68,8 @@ export function listAddressableStructuredWorkers( * A structured worker's agent status, in the vocabulary `@idle` already matches on. * * Null when the session cannot be read: unknown must not read as idle, or a broadcast to `@idle` - * would wake a worker mid-turn — which Codex coalesces into the running turn and Claude queues - * behind it. + * would wake a worker mid-turn — which Codex coalesces into the running turn and Claude folds + * into it. */ export async function structuredWorkerAgentStatus(sessionId: string): Promise { const facts = await readStructuredSessionGateFacts(sessionId) From c8af48d8a4159feaa4bc40e8773cf730f7ab0d3c Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:39:01 -0400 Subject: [PATCH 66/90] fix(runtime): settle a quiet Codex composer as ready on every version (#23765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(runtime): settle a quiet Codex composer as tui-idle on every version Codex 0.158 dropped `model:`/`directory:` from its startup header, which both Codex readiness rules require, so `worker-start --agent codex` timed out; an idle Codex pane after a turn also had no readiness signal once the header left the screen. Generalize the Muse tier-1b lane into a quiet-ready-screen lane: a Codex (or agent-unknown) pane whose live screen shows the empty composer placeholder, no `to interrupt)` status row, no header `loading`, and no dialog wording in its live window, settles once the stream has been quiet for the tui-idle quiescence window. Additive only: the tier-1 rules and the Muse rule are unchanged. Fixtures: codex 0.150.1-0.158.0 captures at 120x40, including chunk-timed turns. * refactor(runtime): anchor the Codex quiet lane to the empty composer line Move the Codex screen rules into codex-terminal-readiness.ts and the quiet-screen body beside isKnownReadyPromptBody. The composer rule now matches only the `› Ask Codex to do anything` line and drops its dialog markers: every Codex dialog replaces the composer, and an answer ending "Would you like to…?" above a live composer must not hold the lane forever. The quiet lane checks quiescence before reading the screen. Trim the redundant startup and untimed turn fixtures. * fix(runtime): read Codex's busy row above the composer and scope the lane to codex panes * fix(runtime): read only Codex's live status row above the composer --- .oxfmtrc.json | 3 +- .../serialize-grid-transcript-replay.test.ts | 5 + .../__fixtures__/codex-0-150-1-turn.meta.json | 16 + .../__fixtures__/codex-0-150-1-turn.txt | 18 + .../codex-0-155-1-timed-turn.meta.json | 14 + .../codex-0-155-1-timed-turn.timing.json | 1 + .../__fixtures__/codex-0-155-1-timed-turn.txt | 26 ++ .../codex-0-157-1-update-dialog.meta.json | 9 + .../codex-0-157-1-update-dialog.txt | 1 + .../codex-0-158-0-approval.meta.json | 18 + .../__fixtures__/codex-0-158-0-approval.txt | 1 + .../codex-0-158-0-timed-turn.meta.json | 15 + .../codex-0-158-0-timed-turn.timing.json | 1 + .../__fixtures__/codex-0-158-0-timed-turn.txt | 1 + .../codex-0-158-0-trustprompt.meta.json | 15 + .../codex-0-158-0-trustprompt.txt | 1 + .../agent-transcript-replay-test-harness.ts | 56 +++ ...codex-header-readiness-transcripts.test.ts | 65 +-- .../runtime/codex-quiet-ready-screen.test.ts | 372 ++++++++++++++++++ src/main/runtime/codex-terminal-readiness.ts | 63 +++ src/main/runtime/terminal-wait-detection.ts | 51 +-- src/main/runtime/tui-idle-evidence.test.ts | 44 +-- src/main/runtime/tui-idle-evidence.ts | 50 +-- 23 files changed, 726 insertions(+), 120 deletions(-) create mode 100644 src/main/runtime/__fixtures__/codex-0-150-1-turn.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0-150-1-turn.txt create mode 100644 src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.timing.json create mode 100644 src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.txt create mode 100644 src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.txt create mode 100644 src/main/runtime/__fixtures__/codex-0-158-0-approval.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0-158-0-approval.txt create mode 100644 src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.timing.json create mode 100644 src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.txt create mode 100644 src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.txt create mode 100644 src/main/runtime/agent-transcript-replay-test-harness.ts create mode 100644 src/main/runtime/codex-quiet-ready-screen.test.ts create mode 100644 src/main/runtime/codex-terminal-readiness.ts diff --git a/.oxfmtrc.json b/.oxfmtrc.json index 0a6625f6fe7e..19856d6ca841 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -8,6 +8,7 @@ "cloud/**", "resources/licenses/**", ".github/actions/cloud-sql-rollout-lease/**", - ".anti-slop-plugin/**" + ".anti-slop-plugin/**", + "src/main/runtime/__fixtures__/*.timing.json" ] } diff --git a/src/main/daemon/serialize-grid-transcript-replay.test.ts b/src/main/daemon/serialize-grid-transcript-replay.test.ts index dca03b69a058..298aaa681bf7 100644 --- a/src/main/daemon/serialize-grid-transcript-replay.test.ts +++ b/src/main/daemon/serialize-grid-transcript-replay.test.ts @@ -43,6 +43,11 @@ const KNOWN_PREEXISTING_I2_FAILURES: Record = { 'codex-0157-effort-override-embedded-warning': 4, 'codex-0157-no-daemon-effort-override': 16, 'codex-0157-plain-ready': 18, + // Same extra dim bit on the 0.157/0.158 header row (STA-8834 fixtures). + 'codex-0-157-1-update-dialog': 16, + 'codex-0-158-0-approval': 12, + 'codex-0-158-0-timed-turn': 20, + 'codex-0-158-0-trustprompt': 36, 'claude-dialog-trust-workspace-answered': 13, // DSH-TUI's whale intro paints whole rows of 24-bit background, and every one of this // transcript's divergences is the same shape: `visible-grid row=0`, a true-colour diff --git a/src/main/runtime/__fixtures__/codex-0-150-1-turn.meta.json b/src/main/runtime/__fixtures__/codex-0-150-1-turn.meta.json new file mode 100644 index 000000000000..21b39d7625b3 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-150-1-turn.meta.json @@ -0,0 +1,16 @@ +{ + "capturedAt": "2026-09-29T01:35:32.695Z", + "platform": "darwin", + "command": [ + "codex", + "-c", + "check_for_update_on_startup=false", + "--dangerously-bypass-approvals-and-sandbox", + "-m", + "gpt-5.6-sol" + ], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.150.1: launch, one short turn, settled idle after it. STA-8834.", + "exitCode": 0 +} diff --git a/src/main/runtime/__fixtures__/codex-0-150-1-turn.txt b/src/main/runtime/__fixtures__/codex-0-150-1-turn.txt new file mode 100644 index 000000000000..4d4c5dacccf0 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-150-1-turn.txt @@ -0,0 +1,18 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h╭───────────────────────────────────────╮│ >_ OpenAI Codex (v0.150.1) ││ ││ model: loading /model to change ││ directory: loading │╰───────────────────────────────────────╯  › Ask Codex to do anything  ? for shortcuts[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h╭──────────────────────────────────────────────────╮│ >_ OpenAI Codex (v0.150.1) ││ ││ model: loading /model to change ││ directory: ~/orca-lanes/sta8834/corpus/scratch ││ permissions: YOLO mode │╰──────────────────────────────────────────────────╯  › Ask Codex to do anything  ? for shortcuts[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;scratch[?2026h[0 q[?25h[?2026l[?2026hgpt-5.6-sol default · ~/orca-lanes/sta8834/corpus/scratch[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠋ scratch]0;⠙ scratch[?2026hMMMMMMMMM +╭────────────────────────────────────────────────────╮ +│ >_ OpenAI Codex (v0.150.1) │ +│ │ +│ model: gpt-5.6-sol medium /model to change │ +│ directory: ~/orca-lanes/sta8834/corpus/scratch │ +│ permissions: YOLO mode │ +╰────────────────────────────────────────────────────╯ + + Tip: Try the Desktop app. Run 'codex app' or visit https://chatgpt.com/codex?app-landing-page=true • Booting MCP server: node_repl (0s • esc to interrupt)  › Ask Codex to do anything  gpt-5.6-sol medium · ~/orca-lanes/sta8834/corpus/scratch[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;scratch[?2026h  › Ask Codex to do anything  gpt-5.6-sol medium · ~/orca-lanes/sta8834/corpus/scratch[0 q[?25h[?2026l[?2026hMM + +• You have 3 usage limit resets available. Run /usage to use one.[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hReply with the single wordOK.[0 q[?25h[?2026l[?2026hMMMM + + +› Reply with the single word OK. +Ask Codex to do anything[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠋ scratch[?2026h • Working (0s • esc to interrupt)  › Ask Codex to do anything  gpt-5.6-sol medium · ~/orca-lanes/sta8834/corpus/scratch[0 q[?25h[?2026l]0;⠙ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠹ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠸ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠼ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠴ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hW[0 q[?25h[?2026l]0;⠦ scratch[?2026h[0 q[?25h[?2026l[?2026hWo[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠧ scratch[?2026h•Wor[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠇ scratch[?2026h•Work[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h•Worki[0 q[?25h[?2026l]0;⠏ scratch[?2026h[0 q[?25h[?2026l[?2026hWorkin[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l]0;⠋ scratch[?2026hWorking[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h•Working1[0 q[?25h[?2026l]0;⠙ scratch[?2026h[0 q[?25h[?2026l[?2026hWorking[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l]0;⠹ scratch[?2026h[0 q[?25h[?2026l[?2026hWorking[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l]0;⠸ scratch[?2026horking[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l[?2026hrking[0 q[?25h[?2026l]0;⠼ scratch[?2026h[0 q[?25h[?2026l[?2026h•king[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠴ scratch[?2026hing[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠦ scratch[?2026hng[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠧ scratch[?2026hg[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠇ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠏ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠋ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠙ scratch[?2026h2[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠹ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠸ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠼ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠴ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hW[0 q[?25h[?2026l]0;⠦ scratch[?2026h[0 q[?25h[?2026l[?2026hWo[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠧ scratch[?2026h•Wor[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠇ scratch[?2026h•Work[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h•Worki[0 q[?25h[?2026l]0;⠏ scratch[?2026h[0 q[?25h[?2026l[?2026hWorkin[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l]0;⠋ scratch[?2026hWorking[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h•Working3[0 q[?25h[?2026l]0;⠙ scratch[?2026h[0 q[?25h[?2026l[?2026hWorking[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l]0;⠹ scratch[?2026h[0 q[?25h[?2026l[?2026hWorking[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l]0;⠸ scratch[?2026horking[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l[?2026hrking[0 q[?25h[?2026l]0;⠼ scratch[?2026h[0 q[?25h[?2026l[?2026h•king[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠴ scratch[?2026hing[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠦ scratch[?2026hng[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hg[0 q[?25h[?2026l]0;⠧ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠇ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠏ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠋ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠙ scratch[?2026h4[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠹ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠸ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠼ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠴ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hW[0 q[?25h[?2026l]0;⠦ scratch[?2026h[0 q[?25h[?2026l[?2026hWo[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠧ scratch[?2026h•Wor[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠇ scratch[?2026h•Work[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hWorki[0 q[?25h[?2026l]0;⠏ scratch[?2026h•[0 q[?25h[?2026l[?2026hWorkin[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l]0;⠋ scratch[?2026hWorking[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l]0;⠙ scratch[?2026hWorking5[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h•Working[0 q[?25h[?2026l]0;⠹ scratch[?2026h[0 q[?25h[?2026l[?2026hWorking[0 q[?25h[?2026l[?2026h•[0 q[?25h[?2026l]0;⠸ scratch[?2026horking[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h•rking[0 q[?25h[?2026l]0;⠼ scratch[?2026h[0 q[?25h[?2026l[?2026h•king[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠴ scratch[?2026h[0 q[?25h[?2026l[?2026h•ing[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠦ scratch[?2026hng[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hg[0 q[?25h[?2026l]0;⠧ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠇ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠏ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠋ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h6[0 q[?25h[?2026l]0;⠙ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠹ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠸ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠼ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠴ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hW[0 q[?25h[?2026l]0;⠦ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hWo[0 q[?25h[?2026l]0;⠧ scratch[?2026h•[0 q[?25h[?2026l[?2026hWor[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠇ scratch[?2026h•Work[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l[?2026hMM + +• OK  › Ask Codex to do anything  gpt-5.6-sol medium · ~/orca-lanes/sta8834/corpus/scratch[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;⠏ scratch[?2026h[0 q[?25h[?2026l[?2026h[0 q[?25h[?2026l]0;scratch[?2026h[0 q[?25h[?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.meta.json b/src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.meta.json new file mode 100644 index 000000000000..ca6db1a32546 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.meta.json @@ -0,0 +1,14 @@ +{ + "capturedAt": "2026-09-29T01:44:01.149Z", + "platform": "darwin", + "command": [ + "codex", + "-c", + "check_for_update_on_startup=false", + "--dangerously-bypass-approvals-and-sandbox" + ], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.155.1, default tui animations. One tool-using turn sent once the composer had been quiet 2.5s; cut 20s past the last busy frame, before exit. .timing.json holds each PTY chunk as [ms since spawn, UTF-16 length] and the prompt-submit time. STA-8834.", + "exitCode": 0 +} diff --git a/src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.timing.json b/src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.timing.json new file mode 100644 index 000000000000..8258e899ce04 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.timing.json @@ -0,0 +1 @@ +{"promptSentAtMs":4478.2,"chunks":[[63.6,8],[63.7,47],[164.3,17],[164.5,730],[164.6,8],[164.6,78],[164.8,78],[165.4,78],[171.5,78],[172.5,78],[174.7,17],[174.8,794],[174.9,132],[175.2,79],[175.7,79],[197.3,79],[197.5,79],[203.1,79],[205.8,71],[205.8,8],[206,71],[206.2,87],[636.8,79],[641.5,79],[642.3,12],[642.6,202],[642.8,71],[642.9,8],[671.8,79],[728.1,14],[749.8,31],[749.8,767],[749.9,506],[750.9,77],[792.1,12],[793.2,77],[995.7,72],[995.7,178],[1340.2,77],[3899.1,153],[4478.5,104],[4478.5,94],[4478.6,160],[4483.3,77],[4488.7,77],[4510.6,14],[4511.7,18],[4511.9,509],[4545.3,14],[4545.4,77],[4579.4,77],[4613,77],[4646.2,14],[4646.3,77],[4679.2,77],[4712.4,77],[4721.2,77],[4732.5,77],[4741.8,77],[4755.1,14],[4755.2,77],[4756.4,30],[4763.7,132],[4798.3,77],[4831.8,77],[4865.3,30],[4865.4,77],[4898,77],[4931.8,77],[4965.6,30],[4965.7,77],[4998.3,77],[5032,77],[5066.6,30],[5066.7,77],[5100.6,111],[5134.7,77],[5168.8,30],[5168.8,77],[5202.5,111],[5235.8,77],[5269.8,30],[5269.9,77],[5304,111],[5338,77],[5372.6,30],[5372.7,111],[5406.4,77],[5440.5,77],[5474.5,30],[5474.6,111],[5508.1,77],[5542.1,30],[5542.2,82],[5542.2,8],[5576.7,111],[5610.9,77],[5645.1,30],[5645.3,77],[5678.4,111],[5712.5,77],[5745.7,30],[5745.9,77],[5779,111],[5812.7,77],[5845.4,30],[5845.6,111],[5879.6,77],[5913.5,77],[5945.9,30],[5946,111],[5980.4,77],[6014.5,77],[6048.6,30],[6048.7,77],[6082,77],[6116.5,77],[6150.1,30],[6150.2,77],[6183.5,77],[6217.5,77],[6251.7,30],[6252.1,77],[6285.1,77],[6318.6,77],[6352.7,30],[6352.9,77],[6386.1,77],[6425.6,77],[6459.8,30],[6460,77],[6493.6,77],[6527.3,90],[6561.3,30],[6561.4,77],[6594.4,77],[6627.4,77],[6661,30],[6661.2,77],[6695,77],[6729.1,77],[6763.1,30],[6763.2,77],[6797.2,77],[6831.3,77],[6865.4,30],[6865.5,77],[6898.9,77],[6933.1,77],[6967.1,30],[6967.2,77],[7001.2,77],[7035.3,77],[7068.9,30],[7069,77],[7102.2,111],[7136.6,77],[7169.9,30],[7170.3,77],[7204.3,111],[7238.4,77],[7272.3,30],[7272.3,77],[7305.3,111],[7339,77],[7373,30],[7373.2,111],[7407.1,77],[7441.1,77],[7474.7,30],[7474.9,111],[7508.5,77],[7542.6,30],[7542.8,90],[7576.9,111],[7610,77],[7644.6,30],[7644.7,77],[7679,111],[7712.9,77],[7746.6,30],[7746.8,77],[7779.2,111],[7813,77],[7847,30],[7847.1,111],[7881.2,77],[7915.3,77],[7949.3,30],[7949.4,111],[7982.8,77],[8016.8,77],[8050.1,30],[8050.1,29],[8050.1,48],[8083.8,77],[8117.9,77],[8151.5,30],[8151.5,77],[8185.7,77],[8219.4,77],[8252.2,30],[8252.3,77],[8286.4,77],[8320.4,77],[8354.4,30],[8354.5,77],[8388,77],[8422,77],[8456,30],[8456,77],[8490.2,77],[8524.5,90],[8558.4,30],[8558.6,77],[8592.8,77],[8626.1,77],[8659.8,30],[8660.1,77],[8694.5,77],[8727.9,77],[8761.8,30],[8762,77],[8796.8,77],[8830.8,77],[8864.1,30],[8864.3,77],[8897.6,77],[8931.7,77],[8965.2,30],[8965.3,77],[8999.4,77],[9032.6,77],[9066.7,30],[9066.8,77],[9101.1,111],[9135.1,77],[9169,30],[9169.2,77],[9202.6,111],[9236.7,77],[9270.7,30],[9270.8,77],[9305,111],[9339.3,77],[9373.7,30],[9373.9,111],[9407.8,77],[9441,77],[9474.5,30],[9474.6,111],[9507,77],[9540.9,90],[9574.4,30],[9574.5,111],[9608.6,77],[9642.6,30],[9642.7,77],[9676.7,111],[9710.9,77],[9744.2,30],[9744.2,77],[9778.4,111],[9812.5,77],[9846.5,30],[9846.6,111],[9880.7,77],[9914.9,77],[9948.5,30],[9948.6,111],[9982.6,77],[10015.9,77],[10049.2,30],[10049.2,77],[10082.8,69],[10082.8,8],[10116.3,77],[10149.7,30],[10149.8,77],[10183.7,77],[10218.2,77],[10251,30],[10251.1,77],[10284.1,77],[10317.7,77],[10352.3,30],[10352.3,69],[10352.4,8],[10386.5,77],[10420.5,77],[10454.8,30],[10455.1,77],[10488.6,77],[10521.9,90],[10555.8,30],[10556.1,77],[10590.5,77],[10624.7,77],[10658.7,30],[10658.9,77],[10692.4,69],[10692.5,8],[10726.2,77],[10760.1,30],[10760.2,77],[10794.4,77],[10828.5,77],[10861.6,30],[10861.8,77],[10894.7,77],[10928.6,77],[10962.6,30],[10962.8,77],[10995.4,77],[11029.6,77],[11063.4,30],[11063.5,77],[11097.3,111],[11131.7,77],[11165,30],[11165.1,77],[11199.2,111],[11233.1,77],[11266.3,30],[11266.4,77],[11299.6,111],[11333.2,77],[11367.2,30],[11367.3,77],[11401.5,111],[11435.5,77],[11469.4,30],[11469.5,111],[11503.6,77],[11537.7,90],[11571.7,30],[11571.8,111],[11606,77],[11639.6,77],[11672.8,30],[11672.9,111],[11695.8,77],[11730.1,77],[11764.1,30],[11764.2,111],[11798.4,77],[11832.2,77],[11864.9,30],[11865,111],[11898.6,77],[11932.3,77],[11966.4,30],[11966.5,97],[11966.5,14],[12000.2,77],[12033.5,77],[12067.5,30],[12067.6,77],[12101.2,77],[12135.4,69],[12135.5,8],[12168.8,30],[12168.9,69],[12169,8],[12203.1,77],[12237.2,77],[12270.6,30],[12270.8,63],[12270.8,14],[12304.9,77],[12339.7,77],[12373.6,30],[12373.8,77],[12406.9,77],[12441.1,77],[12475.2,30],[12475.4,77],[12509.1,77],[12543.1,30],[12543.4,90],[12577.4,77],[12611.4,77],[12644.6,30],[12644.8,77],[12678.6,77],[12712.7,77],[12746.3,30],[12746.4,77],[12779.6,77],[12812.5,77],[12846.1,30],[12846.2,77],[12880.3,77],[12914.3,77],[12948.3,30],[12948.4,77],[12982.7,77],[13016.9,77],[13049.9,30],[13050.1,77],[13083.6,111],[13117.1,77],[13151.1,30],[13151.2,77],[13184.2,111],[13217.4,77],[13250.7,30],[13250.8,77],[13284.9,111],[13301.8,77],[13336.6,77],[13370.1,30],[13370.1,111],[13403.8,77],[13438.1,77],[13472,30],[13472.2,111],[13505.2,77],[13539.6,90],[13572.7,30],[13572.8,111],[13607.6,77],[13641.8,77],[13675.5,30],[13675.6,111],[13709.7,77],[13742.2,30],[13742.3,63],[13742.3,14],[13776.5,111],[13810.3,77],[13844.3,30],[13844.6,77],[13877.7,111],[13911.7,77],[13944.4,30],[13944.6,111],[13978,77],[14012.1,77],[14046.6,30],[14046.8,77],[14080.9,77],[14115,77],[14148.5,30],[14148.7,63],[14148.7,14],[14182.8,77],[14217,77],[14250.6,30],[14250.7,77],[14284.9,77],[14319,77],[14353.5,30],[14353.5,77],[14387.7,77],[14421.9,77],[14456,30],[14456.2,77],[14490.3,77],[14523.9,119],[14558.3,30],[14558.3,77],[14592.5,77],[14626.6,77],[14660,30],[14660,77],[14694.1,77],[14728,77],[14761.6,30],[14761.6,69],[14761.7,8],[14771.2,73],[14771.3,192],[14805.5,77],[14839.7,77],[14873.5,30],[14873.7,77],[14907.8,77],[14941.4,77],[14974,30],[14974.1,77],[15007.3,77],[15040.5,77],[15074.5,30],[15074.6,77],[15106.9,111],[15140.6,77],[15172.8,30],[15172.9,77],[15180,14],[15182.8,41],[15183,177],[15192.7,77],[15226.5,77],[15260.2,41],[15260.2,77],[15294.3,111],[15328.5,77],[15361.7,41],[15361.9,63],[15362,14],[15395.9,111],[15429.6,77],[15463.6,41],[15463.8,77],[15496.8,111],[15531.1,90],[15565,41],[15565.2,111],[15599.4,77],[15632.9,77],[15666.2,41],[15666.4,111],[15700.3,77],[15734.5,77],[15768.5,41],[15768.6,111],[15802.6,77],[15835.4,77],[15869.2,41],[15869.3,111],[15903.2,77],[15935.8,77],[15969.9,41],[15970,111],[16003.5,77],[16037.5,77],[16071.6,41],[16071.8,77],[16105.7,77],[16138.7,77],[16172.9,41],[16172.9,77],[16207,77],[16241.4,77],[16275.4,41],[16275.4,69],[16275.5,8],[16309.6,77],[16343.6,41],[16343.8,77],[16377.8,77],[16411.9,77],[16445.8,41],[16445.9,77],[16480.1,77],[16513.3,90],[16547.1,41],[16547.2,77],[16580.9,77],[16615.2,77],[16648.6,41],[16648.7,77],[16682,77],[16715.1,77],[16748.6,41],[16748.7,77],[16781.9,77],[16816.1,77],[16850.1,41],[16850.2,77],[16884.8,77],[16919,77],[16952.9,41],[16953,77],[16987.7,77],[17021.1,77],[17054.5,41],[17054.5,69],[17054.6,8],[17088.6,103],[17088.7,8],[17122.5,77],[17155.9,41],[17156,77],[17190.1,111],[17224.3,77],[17258.3,41],[17258.4,69],[17258.4,8],[17292.3,111],[17326.3,77],[17360.7,41],[17360.8,77],[17395.7,111],[17429.9,77],[17463.9,41],[17464.1,77],[17498,111],[17531.3,90],[17564.9,41],[17565.1,111],[17599.1,77],[17633.1,77],[17666.7,41],[17666.7,111],[17700.9,77],[17734.8,77],[17768.8,41],[17768.9,103],[17769,8],[17803,77],[17837.1,77],[17871.1,41],[17871.1,111],[17904.8,77],[17939,77],[17973.1,41],[17973.2,111],[18006.8,77],[18040.7,77],[18074.5,41],[18074.5,63],[18074.5,14],[18108.6,77],[18142,41],[18142.1,77],[18175.5,77],[18209.1,69],[18209.2,8],[18242.3,41],[18242.4,77],[18276.6,77],[18310.2,77],[18344.2,41],[18344.3,77],[18378.4,77],[18412.6,77],[18446.6,41],[18446.7,77],[18479.9,69],[18479.9,8],[18513.5,90],[18546.9,41],[18547,77],[18576.3,77],[18609.3,77],[18642.9,41],[18643,77],[18677.1,77],[18711.2,77],[18744.2,41],[18744.3,77],[18777.3,77],[18787.6,18],[18787.8,759],[18797.1,77],[18813.8,77],[18823.3,77],[18856.4,41],[18856.4,77],[18890.3,77],[18924.4,77],[18958.4,41],[18958.5,77],[18992.4,77],[19026.6,77],[19060.6,41],[19060.7,77],[19094.9,111],[19129,77],[19162.9,41],[19163,69],[19163,8],[19197.1,111],[19231.5,77],[19264.7,41],[19264.9,69],[19265,8],[19299.2,111],[19332.9,77],[19366.9,41],[19367.1,29],[19367.1,48],[19401.3,111],[19435.4,77],[19469.5,41],[19469.6,63],[19469.6,48],[19503.8,77],[19537,90],[19571,41],[19571.1,111],[19605.3,77],[19639.3,77],[19672.5,41],[19672.5,111],[19716,77],[19746.1,41],[19746.1,77],[19779.7,111],[19813.8,77],[19847.7,41],[19847.7,97],[19847.8,14],[19881.8,77],[19916,77],[19950.1,41],[19950.1,103],[19950.2,8],[19984.4,77],[20018.7,77],[20052.7,41],[20052.9,77],[20087.2,77],[20121.5,77],[20155.6,41],[20155.8,69],[20155.8,8],[20189,77],[20223.5,77],[20257.4,41],[20257.6,63],[20257.6,14],[20291.2,69],[20291.3,8],[20324.7,77],[20358.1,41],[20358.2,77],[20392.4,77],[20426.5,77],[20460.6,41],[20460.7,77],[20494.8,77],[20528.9,90],[20562.9,41],[20563,77],[20597.2,77],[20630.5,77],[20664.6,41],[20664.7,77],[20699.5,77],[20733.6,77],[20766.9,41],[20767,77],[20800.2,77],[20834.6,77],[20867.8,41],[20868,77],[20901.6,77],[20935.6,77],[20968.8,41],[20969,29],[20969.1,48],[21003.3,69],[21003.4,8],[21037.4,77],[21071.4,41],[21071.6,69],[21071.6,8],[21105.8,111],[21139.9,77],[21174,41],[21174.1,77],[21207.6,111],[21218.4,77],[21251.8,41],[21251.9,77],[21286.2,111],[21320.1,77],[21354.2,41],[21354.3,63],[21354.3,14],[21388.7,111],[21422.8,77],[21456.1,41],[21456.2,77],[21490.3,111],[21524.4,90],[21558.6,41],[21558.9,77],[21593.2,111],[21627.5,77],[21661.5,41],[21661.6,63],[21661.6,48],[21695.9,77],[21730,77],[21763.4,41],[21763.4,103],[21763.5,8],[21797.6,77],[21831.4,77],[21865.4,41],[21865.4,97],[21865.4,14],[21899.6,77],[21933.7,77],[21967.8,41],[21967.8,111],[22002,77],[22036.1,77],[22070.2,41],[22070.2,29],[22070.3,48],[22104.2,77],[22138.5,77],[22171.9,41],[22172.1,77],[22206.3,77],[22240.6,77],[22273.1,41],[22273.2,77],[22307.3,77],[22341.1,77],[22375,41],[22375.1,69],[22375.1,8],[22409.4,77],[22443.5,41],[22443.6,63],[22443.7,14],[22477.9,77],[22511.2,90],[22544.7,41],[22544.8,77],[22579,77],[22612.5,77],[22646.4,41],[22646.5,77],[22679.8,77],[22713.9,77],[22748.5,41],[22748.6,69],[22748.6,8],[22782.7,77],[22817,77],[22850.2,41],[22850.3,63],[22850.3,14],[22883.7,77],[22894.2,18],[22894.2,117],[22894.3,673],[22894.3,8],[22928.5,77],[22962,41],[22962,77],[22996.5,77],[23030.5,77],[23064.6,41],[23064.7,29],[23064.7,48],[23098.2,111],[23133,77],[23166.4,41],[23166.5,77],[23193.2,18],[23193.2,65],[23193.3,561],[23193.3,8],[23295.2,41],[23397.5,41],[23499.7,41],[23601.5,41],[23703.1,41],[23805.7,41],[23908.4,41],[24010.6,41],[24048,41],[24048.1,245],[24057.7,77],[24083.3,77],[24083.7,39],[24092.3,73],[24092.4,108],[24092.4,14]]} diff --git a/src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.txt b/src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.txt new file mode 100644 index 000000000000..6064224f724b --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-155-1-timed-turn.txt @@ -0,0 +1,26 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h╭───────────────────────────────────────╮│ >_ OpenAI Codex (v0.155.1) ││ ││ model: loading /model to change ││ directory: loading │╰───────────────────────────────────────╯  › Ask Codex to do anything  ? for shortcuts[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h╭──────────────────────────────────────────────────╮│ >_ OpenAI Codex (v0.155.1) ││ ││ model: loading /model to change ││ directory: ~/orca-lanes/sta8834/corpus/scratch ││ permissions: YOLO mode │╰──────────────────────────────────────────────────╯  › Ask Codex to do anything  ? for shortcuts[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l]0;scratch[?2026hgpt-6-sol default · ~/orca-lanes/sta8834/corpus/scratch[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l[?2026h[0 q╭[?25h[?2026l]0;⠋ scratch]0;⠙ scratch[?2026hMMMMMMMMM +╭──────────────────────────────────────────────────╮ +│ >_ OpenAI Codex (v0.155.1) │ +│ │ +│ model: gpt-6-sol medium /model to change │ +│ directory: ~/orca-lanes/sta8834/corpus/scratch │ +│ permissions: YOLO mode │ +╰──────────────────────────────────────────────────╯ + + Tip: New Use /fast to enable our fastest inference with increased plan usage.  › Ask Codex to do anything  gpt-6-sol medium · ~/orca-lanes/sta8834/corpus/scratch[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;scratch[?2026h[0 q [?25h[?2026l[?2026hMM + +• You have 3 usage limit resets available. Run /usage to use one.[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026hList the files here and summarizein2bullets.[0 q [?25h[?2026l[?2026hMMMM + + +› List the files here and summarize in 2 bullets. +Ask Codex to do anything[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ scratch[?2026h • Working (0s • esc to interrupt)  › Ask Codex to do anything  gpt-6-sol medium · ~/orca-lanes/sta8834/corpus/scratch[0 q [?25h[?2026l]0;⠏ scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ scratch[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h · renaming... ⠙[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h1[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h2[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h3[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h4[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h5[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h6[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h7[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h8[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h9[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ renaming... ⠦ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ renaming... ⠧ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ renaming... ⠇ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h10s • esc to interupt)[0 q [?25h[?2026l]0;⠏ renaming... ⠏ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ renaming... ⠋ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ renaming... ⠙ | scratch[?2026h[0 q [?25h[?2026l[?2026hMM + +• I’ll inspect the current directory and summarize what’s there in two bullets.[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ renaming... ⠹ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ renaming... ⠸ | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ renaming... ⠼ | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ renaming... ⠴ | scratch[?2026h[0 q [?25h[?2026l]0;⠴ scratch]0;⠴ List and summarize files | scratch[?2026h•List ad summarize files[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h1[0 q [?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h2[0 q [?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h3[0 q [?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h4[0 q [?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h • Explored └ List rg --files -g '*' -g '!*/.git/*' • Working (14s • esc to interrupt)  › Ask Codex to do anything  gpt-6-sol medium · ~/orca-lanes/sta8834/corpus/scratch · List and summarize files[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h5[0 q [?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h6[0 q [?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h7[0 q [?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h8[0 q [?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026hMMM + +• Explored + └ List rg --files -g '*' -g '!*/.git/*' • Working (18s • esc to interrupt)  › Ask Codex to do anything  gpt-6-sol medium · ~/orca-lanes/sta8834/corpus/scratch · List and summarize files[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026h•[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[0 q [?25h[?2026l[?2026hMM + +• - README.md and notes.txt are the two working files.  › Ask Codex to do anything  gpt-6-sol medium · ~/orca-lanes/sta8834/corpus/scratch · List and summarize files[0 q [?25h[?2026l]0;⠦ List and summarize files | scratch]0;⠧ List and summarize files | scratch]0;⠇ List and summarize files | scratch]0;⠏ List and summarize files | scratch]0;⠋ List and summarize files | scratch]0;⠙ List and summarize files | scratch]0;⠹ List and summarize files | scratch]0;⠸ List and summarize files | scratch]0;⠼ List and summarize files | scratch[?2026hM + - A .git/ directory is present, containing repository metadata and history.[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l[?2026h[0 q [?25h[?2026l]0;List and summarize files | scratch[?2026hMM + + done 9:43 PM[0 q [?25h[?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.meta.json b/src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.meta.json new file mode 100644 index 000000000000..f43deccb9669 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-29T01:41:43.328Z", + "platform": "darwin", + "command": ["codex", "--no-daemon", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.157.1: launch with the update check on; the update dialog owns the screen. STA-8834.", + "exitCode": 0 +} diff --git a/src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.txt b/src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.txt new file mode 100644 index 000000000000..4bd327737350 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-157-1-update-dialog.txt @@ -0,0 +1 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l╭───────────────────────────────────────╮│ >_ OpenAI Codex (v0.157.1) ││ ││ model: loading /model to change ││ directory: loading │╰───────────────────────────────────────╯›Ask Codex to do anything?forshortcuts[0 q╭[?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l───────────╮ │ │ loading /model to change │ ~/orca-lanes/sta8834/corpus/scratch ││ permissions: YOLO mode │╰──────────────────────────────────────────────────╯[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l  Updat available · 0.157.1→0.158.0 Releasenotes:]8;;https://github.com/openai/codex/releases/latesthttps://github.com/openai/codex/releases/latest]8;; › 1. Update now (runs `npm install -g @openai/codex`)  2. Skip 3. Skip until next versionenter continue · esc skip [?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0-158-0-approval.meta.json b/src/main/runtime/__fixtures__/codex-0-158-0-approval.meta.json new file mode 100644 index 000000000000..a333bd294738 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-158-0-approval.meta.json @@ -0,0 +1,18 @@ +{ + "capturedAt": "2026-09-29T01:43:13.919Z", + "platform": "darwin", + "command": [ + "codex", + "--no-daemon", + "-c", + "check_for_update_on_startup=false", + "-a", + "on-request", + "-s", + "read-only" + ], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.158.0: read-only sandbox with on-request approvals; a command approval dialog owns the screen at the end. STA-8834.", + "exitCode": 0 +} diff --git a/src/main/runtime/__fixtures__/codex-0-158-0-approval.txt b/src/main/runtime/__fixtures__/codex-0-158-0-approval.txt new file mode 100644 index 000000000000..925a5165fc5e --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-158-0-approval.txt @@ -0,0 +1 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l>_ OpenAI Codex (v0.158.0)loadingAll right. What have you got?⣀⣤⣤⣤⣀⣀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣤⣤⣤⣤⡀⢀⣾⣿⣿⠿⠋⠉⠉⢉⣭⣿⣿⣿⣿⣿⠿⣿⣿⣿⣿⣷⣄⣀⣾⣿⣿⠃⣀⣴⣾⣿⣿⡿⠟⠋⣀⡀⠈⠙⢿⣿⣿⣧⣀⣶⣿⣿⣿⣿⡇⢸⣿⣿⡿⠛⠉⢀⣠⣴⣿⣿⣿⣷⣦⣀⠈⢻⣿⣿⡇⣰⣿⣿⡿⢿⣿⣿⡇⢸⣿⣿⢀⣤⣶⣿⣿⣿⠟⠛⠻⣿⣿⣿⣿⣮⣿⣿⡷⢰⣿⣿⡟⠁⢸⣿⣿⡇⢸⣿⣿⣿⣿⠿⠿⣿⣿⣿⣦⣄⡀⠈⠛⠿⣿⣿⣿⣧⡀⣾⣿⣿⠃⢸⣿⣿⡇⢸⣿⣿⠋⠁⠈⠙⢻⣿⣿⣿⣶⣤⡀⠹⢿⣿⣷⡄⢸⣿⣿⣇⠸⣿⣿⣷⣦⣼⣿⣿⢸⣿⣿⠻⢿⣿⣿⡇⠘⣿⣿⣿⠈⢿⣿⣿⣦⡀⠈⠛⠿⣿⣿⣿⣿⣄⡀⢀⣠⣼⣿⣿⣿⣿⡇⣿⣿⣿⠇⢻⣿⣿⣿⣷⣦⣀⠈⠙⠻⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⣿⣿⡇⣠⣿⣿⣿⢸⣿⣿⡿⢿⣿⣿⣿⣦⣠⣴⣿⣿⣿⡿⠟⠋⢸⣿⣿⣿⣿⣷⣴⣿⣿⣿⠃⠘⣿⣿⣷⠈⠛⢿⣿⣿⣿⠿⠋⠉⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠻⣿⣿⣿⣤⣀⠈⠉⢀⣤⣶⣿⣿⣿⠿⠟⠁⣰⣿⣿⡟⠋⠁⠈⠿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⠟⠋⠁⣠⣼⣿⣿⡟⠙⠛⠛⠛⠻⠛⢿⣿⣿⣿⣿⣷⣾⣿⣿⣿⡿⠏⠈⠙⠛⠿⠿⠿⠿⠛⠉›Ask Codex to do anything?forshortcuts[0 q [?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l~/orca-lanes/sta8834/corpus/scratch[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;scratch[?2026h[?25lGPT-6-Sol default·~/orca-lanes/sta8834/corpus/scratch[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ scratch]0;⠙ scratch[?2026h[?25lmdim · ~/orca-lanes/sta834/corpus/scratch[?25h[?2026l[?2026h[?25h[?2026l]0;scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25lRun `touch approved.txt`.[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l› Run`touchapproved.txt`.Ask Codex to do anything?forshortcuts[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ scratch[?2026h[?25l•Working(0s • esc to interrupt)[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ scratch[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25l·⠙[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25l1[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25h[?2026l[?2026h[?25l2[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25l3[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25h[?2026l[?2026h[?25l4[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25h[?2026l[?2026h[?25l5[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25l6[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25h[?2026l[?2026h[?25l7[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l8[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25l9[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25l• I [?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l’ll[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25lcreate[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25l⠴[?25h[?2026l[?2026h[?25lthe[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25l⠦[?25h[?2026l[?2026h[?25lfile[?25h[?2026l[?2026h[?25linthecurrent[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25l⠧[?25h[?2026l[?2026h[?25lworkspace;[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25l⠇[?25h[?2026l[?2026h[?25lthis[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25lrequires[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25l⠋[?25h[?2026l[?2026h[?25lwrite[?25h[?2026l[?2026h[?25laccess[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25l⠙[?25h[?2026l[?2026h[?25lbeyond[?25h[?2026l[?2026h[?25lthe[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25l⠹[?25h[?2026l[?2026h[?25lread-only[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25lsandbox.[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25l⠼[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25l⠴[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25l⠦[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25l⠧[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25l⠇[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25l⠏[?25h[?2026l[?2026h[?25l•Working(11s • esc to interrupt)[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25l2[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25h[?2026l[?2026h[?25l3[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;[ . ] Action Required | ⠸ | scratch[?2026h[?25l•Runningtouch approved.txtWould you like to run the following command?Environment:localReason:May I create approved.txt in the current workspace as requested?$touch approved.txt › 1. Yes, proceed (y)  2. Yes, and don't ask againforcommandsthatstartwith`touchapproved.txt`(p)3.No,andtellCodexwhattododifferently(esc)Press enter to confirm or esc to cancel [?2026l]0;[ . ] Action Required | ⠼ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠴ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠦ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠧ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠇ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠏ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠋ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠙ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠹ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠸ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠼ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠴ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠦ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠧ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠇ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠏ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠋ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠙ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠹ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠸ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠼ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠴ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠦ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠧ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠇ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠏ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠋ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠙ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠹ | scratch]0;[ ! ] Action Required | ⠸ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠼ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠴ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠦ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠧ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠇ | scratch[?2026h[?2026l]0;[ ! ] Action Required | ⠏ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠋ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠙ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠹ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠸ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠼ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠴ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠦ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠧ | scratch[?2026h[?2026l]0;[ . ] Action Required | ⠇ | scratch[?2026h[?2026l]0;[ . ] Action Required | scratch]0;[ . ] Action Required | Create approved.txt | scratch[?2026h[?2026l]0;[ ! ] Action Required | Create approved.txt | scratch]0;[ . ] Action Required | Create approved.txt | scratch]0;[ ! ] Action Required | Create approved.txt | scratch]0;[ . ] Action Required | Create approved.txt | scratch]0;[ ! ] Action Required | Create approved.txt | scratch]0;[ . ] Action Required | Create approved.txt | scratch]0;[ ! ] Action Required | Create approved.txt | scratch]0;[ . ] Action Required | Create approved.txt | scratch]0;[ ! ] Action Required | Create approved.txt | scratch]0;[ . ] Action Required | Create approved.txt | scratch]0;[ ! ] Action Required | Create approved.txt | scratch]0;[ . ] Action Required | Create approved.txt | scratch]0;[ ! ] Action Required | Create approved.txt | scratch \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.meta.json b/src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.meta.json new file mode 100644 index 000000000000..2c3defda30a3 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.meta.json @@ -0,0 +1,15 @@ +{ + "capturedAt": "2026-09-29T01:46:36.717Z", + "platform": "darwin", + "command": [ + "codex", + "--no-daemon", + "-c", + "check_for_update_on_startup=false", + "--dangerously-bypass-approvals-and-sandbox" + ], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.158.0, default tui animations. One tool-using turn sent once the composer had been quiet 2.5s; cut 20s past the last busy frame, before exit. .timing.json holds each PTY chunk as [ms since spawn, UTF-16 length] and the prompt-submit time. STA-8834.", + "exitCode": 0 +} diff --git a/src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.timing.json b/src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.timing.json new file mode 100644 index 000000000000..02745d043e1d --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.timing.json @@ -0,0 +1 @@ +{"promptSentAtMs":7226.9,"chunks":[[70.2,28],[70.4,27],[321.3,80],[321.5,9],[324.7,14],[324.8,578],[325.8,494],[327,43],[329.1,43],[331.5,43],[333.5,43],[335.5,43],[340.4,216],[340.5,8],[342.3,43],[344,43],[346,43],[372.5,43],[374.1,43],[385.8,43],[1330.3,43],[1332.2,35],[1332.2,8],[1334.4,43],[1336.3,43],[1338.5,43],[1340.5,43],[2820.3,43],[2829.5,43],[2831.2,12],[2833.5,43],[2835.6,169],[2835.7,8],[2842.6,43],[2866,43],[2922.5,14],[2944.6,14],[2946.2,14],[2946.2,180],[2947.8,43],[2949.3,43],[3006.8,12],[3009.4,43],[3941,43],[4089.1,43],[6627.2,43],[6627.3,377],[6627.3,14],[6627.4,35],[6627.4,8],[6627.6,43],[6627.7,43],[6627.8,43],[6627.9,43],[6628,43],[6628.2,43],[6628.3,43],[6628.4,35],[6628.4,8],[6628.5,35],[6628.5,8],[6628.6,43],[6628.7,43],[6628.9,43],[6629,43],[6629.1,43],[6629.2,43],[6629.3,43],[6629.4,35],[6629.4,8],[6629.5,43],[6629.7,43],[6629.8,43],[6629.9,35],[6629.9,8],[6630,35],[6630,8],[6630.1,43],[6630.2,35],[6630.3,8],[6630.4,43],[6630.5,35],[6630.5,8],[6630.6,35],[6630.6,8],[6630.7,43],[6630.8,35],[6630.9,8],[6630.9,43],[6631.1,43],[6631.2,35],[6631.2,8],[6631.3,35],[6631.3,8],[6631.4,35],[6631.4,8],[6631.5,35],[6631.5,8],[6631.6,35],[6631.6,8],[6631.7,35],[6631.7,8],[6631.9,35],[6631.9,8],[6632,35],[6632,8],[6632.1,43],[6632.2,35],[6632.2,8],[6632.3,43],[6632.4,43],[6632.5,43],[6659.2,117],[6659.3,8],[7227.9,44],[7228.6,138],[7228.7,14],[7229,161],[7229.2,8],[7239.4,43],[7247.7,43],[7271.8,14],[7273,163],[7273.1,8],[7306.6,43],[7339.4,14],[7339.5,35],[7339.6,8],[7374.3,43],[7407.9,43],[7441.3,14],[7441.5,43],[7474.6,43],[7490.5,43],[7513.7,43],[7535.2,14],[7535.3,35],[7535.3,8],[7536.4,18],[7545.7,89],[7578.7,43],[7611.6,43],[7646,18],[7646.1,43],[7679.3,43],[7713.6,43],[7747,18],[7747.2,35],[7747.2,8],[7780,43],[7813.5,43],[7846.7,18],[7846.8,75],[7846.9,8],[7879.7,43],[7912.9,43],[7946.5,18],[7946.7,83],[7980.7,43],[8015.1,43],[8048.9,18],[8049.1,83],[8083.6,43],[8116.9,43],[8150.3,18],[8150.5,69],[8150.6,14],[8185.3,43],[8219.4,35],[8219.5,8],[8253.4,18],[8253.5,75],[8253.5,8],[8287.5,62],[8321.7,83],[8354.9,18],[8355,43],[8388.5,43],[8422.7,83],[8456.2,18],[8456.4,35],[8456.4,8],[8489.6,43],[8522.9,83],[8534.4,18],[8534.6,43],[8568.8,43],[8603.1,43],[8637.1,18],[8637.4,69],[8637.4,14],[8672.2,43],[8706.4,83],[8738.4,18],[8738.6,43],[8772.8,43],[8806.7,43],[8840,18],[8840.2,35],[8840.3,8],[8874.6,43],[8908,43],[8941.4,18],[8941.7,35],[8941.7,8],[8976.8,43],[9010.8,43],[9044.4,18],[9044.7,43],[9077.8,43],[9112.4,43],[9146.4,18],[9146.5,35],[9146.5,8],[9179.7,43],[9213.5,43],[9247,18],[9247.2,35],[9247.2,8],[9281.4,54],[9281.4,8],[9315.9,43],[9349.2,18],[9349.4,35],[9349.4,8],[9383.7,43],[9418,43],[9446.6,18],[9446.8,90],[9447,8],[9456.9,43],[9493.4,63],[9502.6,60],[9519.3,82],[9534.9,18],[9535.1,52],[9535.2,8],[9555.5,58],[9555.7,8],[9575.4,61],[9597.6,59],[9619.5,64],[9629.8,51],[9629.9,8],[9643,18],[9643.2,52],[9643.3,8],[9668.1,56],[9668.4,8],[9684.5,58],[9786.6,18],[9788.1,72],[9788.2,8],[9889.3,18],[9890.6,80],[9918.4,171],[9953.3,101],[9985.2,43],[10018.5,43],[10051.6,18],[10051.8,75],[10051.8,8],[10085.6,43],[10119.4,43],[10152.9,18],[10153.1,75],[10153.1,8],[10186.5,43],[10220.8,43],[10254.6,18],[10254.8,69],[10254.9,14],[10289.8,54],[10290,8],[10324.3,83],[10357.6,18],[10357.9,43],[10391.4,43],[10424,83],[10457.5,18],[10457.7,35],[10457.7,8],[10491,43],[10524.9,83],[10558.6,18],[10559,35],[10559.1,8],[10592.5,43],[10626.9,83],[10660.9,18],[10661.1,43],[10694.8,43],[10729.4,83],[10763.4,18],[10763.5,43],[10798.4,43],[10833.1,18],[10833.2,43],[10866.5,43],[10900.5,43],[10933.6,18],[10933.7,43],[10966.9,43],[11000.6,43],[11034.6,18],[11034.9,43],[11069.1,43],[11103,43],[11137.1,18],[11137.2,35],[11137.3,8],[11169.2,43],[11199,43],[11231.3,18],[11231.4,43],[11260.7,338],[11260.8,8],[11270.5,43],[11286.1,62],[11296.4,72],[11296.5,8],[11330.4,43],[11364.5,18],[11364.7,43],[11398.1,43],[11432.1,18],[11432.3,35],[11432.3,8],[11465.9,43],[11498.9,43],[11532.8,18],[11533,35],[11533,8],[11566.1,43],[11598.9,43],[11633,18],[11633.2,35],[11633.2,8],[11667.1,43],[11700.9,43],[11735,18],[11735.2,43],[11769.5,43],[11802.8,43],[11835.7,18],[11835.9,35],[11835.9,8],[11869.6,83],[11903.7,43],[11937.8,18],[11938.1,35],[11938.1,8],[11961.5,119],[11962.2,14],[11965.3,41],[11970.6,103],[12004.5,43],[12038.7,41],[12038.9,75],[12039,8],[12073.3,43],[12107.2,43],[12141,41],[12141.3,14],[12141.4,69],[12174.7,43],[12208.4,43],[12241.5,41],[12241.8,14],[12241.8,69],[12276.1,62],[12309.7,43],[12343.6,41],[12343.7,69],[12343.8,14],[12378,43],[12412.2,43],[12445.3,41],[12445.4,75],[12445.4,8],[12479.1,43],[12512.6,75],[12512.7,8],[12545.6,41],[12545.8,35],[12545.9,8],[12579.3,43],[12612.8,83],[12646.7,41],[12647,35],[12647,8],[12664.5,43],[12698.5,43],[12731.6,41],[12732,14],[12732,69],[12766.1,43],[12799.5,43],[12833.8,41],[12834.3,35],[12834.3,8],[12867.9,43],[12902.4,43],[12935.2,41],[12935.7,35],[12935.8,8],[12969.7,43],[13003.8,43],[13037.5,41],[13037.7,43],[13071.9,43],[13104.8,43],[13137.8,41],[13138,43],[13171.4,43],[13205.7,43],[13240.2,41],[13240.3,43],[13274.4,62],[13307.9,43],[13341.3,41],[13341.5,35],[13341.5,8],[13376.5,43],[13409.8,43],[13443.1,41],[13443.3,43],[13476.8,43],[13510.5,43],[13544.3,41],[13544.5,35],[13544.5,8],[13578.7,43],[13612.2,43],[13645.2,41],[13645.4,35],[13645.4,8],[13679.6,43],[13714.4,43],[13747.5,41],[13747.8,35],[13747.9,8],[13781.8,43],[13814.6,43],[13848,41],[13848.3,69],[13848.3,14],[13881.6,43],[13916.7,43],[13950.2,41],[13950.4,69],[13950.4,14],[13984.6,43],[14018.3,43],[14052.6,41],[14052.7,69],[14052.7,14],[14086.4,43],[14120.6,43],[14154.9,41],[14155,69],[14155,14],[14181.8,43],[14211.3,43],[14244.5,41],[14244.7,75],[14244.7,8],[14277.6,54],[14277.7,8],[14287.3,273],[14287.3,8],[14305.4,43],[14315.6,43],[14349.5,41],[14349.6,75],[14349.7,8],[14383.6,43],[14417.1,75],[14417.2,8],[14451.1,41],[14451.3,35],[14451.3,8],[14485.5,43],[14520.1,75],[14520.2,8],[14554.3,41],[14554.5,35],[14554.6,8],[14589.7,43],[14624.4,83],[14656.7,41],[14657,35],[14657,8],[14691.2,43],[14724.7,83],[14758.2,41],[14758.3,35],[14758.3,8],[14792.3,43],[14826.5,43],[14859.9,41],[14860,35],[14860,8],[14893.7,43],[14927.8,43],[14961.2,41],[14961.4,43],[14971.2,43],[14981.8,89],[14981.8,14],[14992.9,54],[14993,8],[15014.7,52],[15014.8,8],[15038.6,41],[15038.8,93],[15038.9,14],[15060.8,50],[15060.8,8],[15078.9,68],[15078.9,8],[15100.6,56],[15100.7,8],[15120.6,50],[15120.6,8],[15148.5,41],[15148.8,56],[15148.8,8],[15158.6,51],[15158.6,8],[15211.6,65],[15223,53],[15223.1,8],[15232,41],[15232.3,53],[15232.3,8],[15333.7,41],[15435.2,41],[15436.8,14],[15436.9,136],[15447.1,59],[15485.9,43],[15524.5,43],[15534.6,41],[15534.7,43],[15551,43],[15551.2,39],[15559.7,180]]} diff --git a/src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.txt b/src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.txt new file mode 100644 index 000000000000..f589f998bb8e --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-158-0-timed-turn.txt @@ -0,0 +1 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l>_ OpenAI Codex (v0.158.0)loadingShall we see where this goes?⣀⣤⣤⣤⣀⣀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣤⣤⣤⣤⡀⢀⣾⣿⣿⠿⠋⠉⠉⢉⣭⣿⣿⣿⣿⣿⠿⣿⣿⣿⣿⣷⣄⣀⣾⣿⣿⠃⣀⣴⣾⣿⣿⡿⠟⠋⣀⡀⠈⠙⢿⣿⣿⣧⣀⣶⣿⣿⣿⣿⡇⢸⣿⣿⡿⠛⠉⢀⣠⣴⣿⣿⣿⣷⣦⣀⠈⢻⣿⣿⡇⣰⣿⣿⡿⢿⣿⣿⡇⢸⣿⣿⢀⣤⣶⣿⣿⣿⠟⠛⠻⣿⣿⣿⣿⣮⣿⣿⡷⢰⣿⣿⡟⠁⢸⣿⣿⡇⢸⣿⣿⣿⣿⠿⠿⣿⣿⣿⣦⣄⡀⠈⠛⠿⣿⣿⣿⣧⡀⣾⣿⣿⠃⢸⣿⣿⡇⢸⣿⣿⠋⠁⠈⠙⢻⣿⣿⣿⣶⣤⡀⠹⢿⣿⣷⡄⢸⣿⣿⣇⠸⣿⣿⣷⣦⣼⣿⣿⢸⣿⣿⠻⢿⣿⣿⡇⠘⣿⣿⣿⠈⢿⣿⣿⣦⡀⠈⠛⠿⣿⣿⣿⣿⣄⡀⢀⣠⣼⣿⣿⣿⣿⡇⣿⣿⣿⠇⢻⣿⣿⣿⣷⣦⣀⠈⠙⠻⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⣿⣿⡇⣠⣿⣿⣿⢸⣿⣿⡿⢿⣿⣿⣿⣦⣠⣴⣿⣿⣿⡿⠟⠋⢸⣿⣿⣿⣿⣷⣴⣿⣿⣿⠃⠘⣿⣿⣷⠈⠛⢿⣿⣿⣿⠿⠋⠉⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠻⣿⣿⣿⣤⣀⠈⠉⢀⣤⣶⣿⣿⣿⠿⠟⠁⣰⣿⣿⡟⠋⠁⠈⠿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⠟⠋⠁⣠⣼⣿⣿⡟⠙⠛⠛⠛⠻⠛⢿⣿⣿⣿⣿⣷⣾⣿⣿⣿⡿⠏⠈⠙⠛⠿⠿⠿⠿⠛⠉›Ask Codex to do anything?forshortcuts[0 q [?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l~/orca-lanes/sta8834/corpus/scratch permissions: YOLO modeShall we see where this goes?[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;scratch[?2026h[?25h[?2026l[?2026h[?25lGPT-6-Sol default·~/orca-lanes/sta8834/corpus/scratch[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ scratch]0;⠙ scratch[?2026h[?25lmdim · ~/orca-lanes/sta834/corpus/scratch[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25lList the files here and summarizein2bullets.[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25lAsk Codex to do anything?forshortcuts[?25h[?2026l[?2026h[?25l› Listthefileshereandsummarizein2bullets.[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ scratch[?2026h[?25l•Working(0s • esc to interrupt)[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ scratch[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25l·⠧[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25l1[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25l2[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25l• I’ll [?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25linspect[?25h[?2026l[?2026h[?25lthe[?25h[?2026l[?2026h[?25ldirectorycontents[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25land[?25h[?2026l[?2026h[?25lsummarize[?25h[?2026l[?2026h[?25lwhat[?25h[?2026l[?2026h[?25l’s[?25h[?2026l[?2026h[?25lpresent[?25h[?2026l[?2026h[?25lin[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25ltwo[?25h[?2026l[?2026h[?25lbullets[?25h[?2026l[?2026h[?25l.[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25l⠏[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25l⠋[?25h[?2026l[?2026h[?25l•Working(2s • esc to interrupt)[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25l3[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ ⠹ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ ⠸ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ ⠼ | scratch[?2026h[?25h[?2026l[?2026h[?25l•Explored └ Listrg--files-g'*'-g'.*' + Show details [?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l4[?25h[?2026l[?2026h[?25l⠼[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ ⠴ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ ⠦ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ ⠧ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ ⠇ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ ⠏ | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ ⠋ | scratch[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ ⠙ | scratch[?2026h[?25h[?2026l[?2026h[?25l•⠙[?25h[?2026l]0;⠙ scratch]0;⠙ List and summarize files | scratch[?2026h[?25lList and summarize files[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25l5[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25l6[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25l7[?25h[?2026l[?2026h[?25l Read README.md,notes.txt + Show details [?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠴ List and summarize files | scratch[?2026h[?25l•[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠦ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠇ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l•[?25h[?2026l]0;⠏ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l• •` [?25h[?2026l[?2026h[?25lREADME[?25h[?2026l[?2026h[?25l.md[?25h[?2026l]0;⠹ List and summarize files | scratch[?2026h[?25lREADME.md[?25h[?2026l[?2026h[?25l—[?25h[?2026l[?2026h[?25lcontainsthe[?25h[?2026l[?2026h[?25lheading[?25h[?2026l[?2026h[?25l“[?25h[?2026l]0;⠸ List and summarize files | scratch[?2026h[?25lscratch[?25h[?2026l[?2026h[?25l.”[?25h[?2026l[?2026h[?25l•`[?25h[?2026l[?2026h[?25lnotes[?25h[?2026l]0;⠼ List and summarize files | scratch[?2026h[?25l.txt[?25h[?2026l]0;⠴ List and summarize files | scratch]0;⠦ List and summarize files | scratch[?2026h[?25lnotes.txt —containsthetext“hello[?25h[?2026l[?2026h[?25l.”[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠧ List and summarize files | scratch[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;List and summarize files | scratch[?2026h[?25l 9:46 PM [?25h[?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.meta.json b/src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.meta.json new file mode 100644 index 000000000000..a80d88f5af99 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.meta.json @@ -0,0 +1,15 @@ +{ + "capturedAt": "2026-09-29T01:32:55.701Z", + "platform": "darwin", + "command": [ + "codex", + "--no-daemon", + "-c", + "check_for_update_on_startup=false", + "--dangerously-bypass-approvals-and-sandbox" + ], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.158.0: launch in an untrusted folder; the recording ends on the unanswered trust dialog. STA-8834.", + "exitCode": 0 +} diff --git a/src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.txt b/src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.txt new file mode 100644 index 000000000000..fd002b0fe041 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0-158-0-trustprompt.txt @@ -0,0 +1 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l>_ OpenAI Codex (v0.158.0)loadingHello, world. Hello, you.⣀⣤⣤⣤⣀⣀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣤⣤⣤⣤⡀⢀⣾⣿⣿⠿⠋⠉⠉⢉⣭⣿⣿⣿⣿⣿⠿⣿⣿⣿⣿⣷⣄⣀⣾⣿⣿⠃⣀⣴⣾⣿⣿⡿⠟⠋⣀⡀⠈⠙⢿⣿⣿⣧⣀⣶⣿⣿⣿⣿⡇⢸⣿⣿⡿⠛⠉⢀⣠⣴⣿⣿⣿⣷⣦⣀⠈⢻⣿⣿⡇⣰⣿⣿⡿⢿⣿⣿⡇⢸⣿⣿⢀⣤⣶⣿⣿⣿⠟⠛⠻⣿⣿⣿⣿⣮⣿⣿⡷⢰⣿⣿⡟⠁⢸⣿⣿⡇⢸⣿⣿⣿⣿⠿⠿⣿⣿⣿⣦⣄⡀⠈⠛⠿⣿⣿⣿⣧⡀⣾⣿⣿⠃⢸⣿⣿⡇⢸⣿⣿⠋⠁⠈⠙⢻⣿⣿⣿⣶⣤⡀⠹⢿⣿⣷⡄⢸⣿⣿⣇⠸⣿⣿⣷⣦⣼⣿⣿⢸⣿⣿⠻⢿⣿⣿⡇⠘⣿⣿⣿⠈⢿⣿⣿⣦⡀⠈⠛⠿⣿⣿⣿⣿⣄⡀⢀⣠⣼⣿⣿⣿⣿⡇⣿⣿⣿⠇⢻⣿⣿⣿⣷⣦⣀⠈⠙⠻⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⣿⣿⡇⣠⣿⣿⣿⢸⣿⣿⡿⢿⣿⣿⣿⣦⣠⣴⣿⣿⣿⡿⠟⠋⢸⣿⣿⣿⣿⣷⣴⣿⣿⣿⠃⠘⣿⣿⣷⠈⠛⢿⣿⣿⣿⠿⠋⠉⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠻⣿⣿⣿⣤⣀⠈⠉⢀⣤⣶⣿⣿⣿⠿⠟⠁⣰⣿⣿⡟⠋⠁⠈⠿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⠟⠋⠁⣠⣼⣿⣿⡟⠙⠛⠛⠛⠻⠛⢿⣿⣿⣿⣿⣷⣾⣿⣿⣿⡿⠏⠈⠙⠛⠿⠿⠿⠿⠛⠉›Ask Codex to do anything?forshortcuts[0 q [?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l~/orca-lanes/sta8834/corpus/scratch permissions: YOLO modeHello, world. Hello, you.[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?1006l[?1015l[?1003l[?1002l[?1000l[?1007h[?2026h[?25l Folder access/Users/xxxxxx/orca-lanes/sta8834/corpus/scratch  Trustthisfolder?Codexcanread,edit,andrunfileshere,subjecttoyourpermissionsettings.Foldersettingscan run code automatically,evenwithoutamodelrequest.Continueonlyifyoutrustthesefiles.Yourtrustdecisionwillbesaved.› 1. Trust and continue 2.Quitenter continue · esc quit [?2026l \ No newline at end of file diff --git a/src/main/runtime/agent-transcript-replay-test-harness.ts b/src/main/runtime/agent-transcript-replay-test-harness.ts new file mode 100644 index 000000000000..5b57656ab4ac --- /dev/null +++ b/src/main/runtime/agent-transcript-replay-test-harness.ts @@ -0,0 +1,56 @@ +// Replays captured PTY bytes the way onPtyData does, for suites asserting a rule on every frame. +import { readFileSync } from 'node:fs' +import { join } from 'node:path' +import { HeadlessEmulator } from '../daemon/headless-emulator' +import { projectTerminalVisibleLines } from './orca-runtime-terminal-projection' +import { normalizeTerminalChunk } from './terminal-ansi-normalization' +import { appendNormalizedToTailBuffer } from './terminal-tail-buffer' +import { buildPreview } from './terminal-tail-state' +import { buildTerminalWaitText } from './terminal-wait-tail-state' + +const DEFAULT_CHUNK_CHARS = 64 + +export type TranscriptReplayFrame = { screenLines: string[]; waitText: string } + +export function readRuntimeFixture(name: string): string { + return readFileSync(join(__dirname, '__fixtures__', `${name}.txt`), 'utf8') +} + +/** A string is cut into fixed 64-char chunks; an array replays the recorded PTY chunks as-is. */ +export async function* replayTranscript( + data: string | readonly string[], + cols: number, + rows: number +): AsyncGenerator { + const chunks = typeof data === 'string' ? splitIntoChunks(data) : data + const emulator = new HeadlessEmulator({ cols, rows }) + let lines: string[] = [] + let partialLine = '' + let pendingAnsi = '' + let redrawCursor: ReturnType['redrawCursor'] = null + try { + for (const chunk of chunks) { + await emulator.write(chunk) + const normalized = normalizeTerminalChunk(chunk, pendingAnsi) + pendingAnsi = normalized.pendingAnsi + const tail = appendNormalizedToTailBuffer(lines, partialLine, normalized.text, redrawCursor) + lines = tail.lines + partialLine = tail.partialLine + redrawCursor = tail.redrawCursor + yield { + screenLines: projectTerminalVisibleLines(emulator).lines, + waitText: buildTerminalWaitText(lines, partialLine, buildPreview(lines, partialLine)) + } + } + } finally { + emulator.dispose() + } +} + +function splitIntoChunks(data: string): string[] { + const chunks: string[] = [] + for (let offset = 0; offset < data.length; offset += DEFAULT_CHUNK_CHARS) { + chunks.push(data.slice(offset, offset + DEFAULT_CHUNK_CHARS)) + } + return chunks +} diff --git a/src/main/runtime/codex-header-readiness-transcripts.test.ts b/src/main/runtime/codex-header-readiness-transcripts.test.ts index 6cb3c08179ff..0cfcf548017f 100644 --- a/src/main/runtime/codex-header-readiness-transcripts.test.ts +++ b/src/main/runtime/codex-header-readiness-transcripts.test.ts @@ -1,14 +1,11 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { describe, expect, it, vi } from 'vitest' -import { HeadlessEmulator } from '../daemon/headless-emulator' import { createTranscriptPane } from './agent-transcript-pane-test-harness' -import { projectTerminalVisibleLines } from './orca-runtime-terminal-projection' -import { normalizeTerminalChunk } from './terminal-ansi-normalization' -import { appendNormalizedToTailBuffer } from './terminal-tail-buffer' -import { buildPreview } from './terminal-tail-state' +import { + readRuntimeFixture, + replayTranscript, + type TranscriptReplayFrame +} from './agent-transcript-replay-test-harness' import { isKnownReadyPromptBody, isKnownReadyPromptPreview } from './terminal-wait-detection' -import { buildTerminalWaitText } from './terminal-wait-tail-state' vi.mock('electron', () => ({ BrowserWindow: { fromId: vi.fn(() => null) }, @@ -23,44 +20,14 @@ const EFFORT_OVERRIDE = 'codex-0157-effort-override-embedded-warning' const CONFIG_OVERRIDE = 'codex-0157-config-override-embedded-warning' const NO_DAEMON = 'codex-0157-no-daemon-effort-override' const ALL_FIXTURES = [PLAIN, EFFORT_OVERRIDE, CONFIG_OVERRIDE, NO_DAEMON] -const CHUNK_CHARS = 64 -function readFixture(name: string): string { - return readFileSync(join(__dirname, '__fixtures__', `${name}.txt`), 'utf8') -} - -type ReplayFrame = { screenLines: string[]; waitText: string } - -/** Feeds the bytes the way onPtyData does: one emulator grid, one line-folded wait text. */ -async function* replay(data: string, cols: number, rows: number): AsyncGenerator { - const emulator = new HeadlessEmulator({ cols, rows }) - let lines: string[] = [] - let partialLine = '' - let pendingAnsi = '' - let redrawCursor: ReturnType['redrawCursor'] = null - try { - for (let offset = 0; offset < data.length; offset += CHUNK_CHARS) { - const chunk = data.slice(offset, offset + CHUNK_CHARS) - await emulator.write(chunk) - const normalized = normalizeTerminalChunk(chunk, pendingAnsi) - pendingAnsi = normalized.pendingAnsi - const tail = appendNormalizedToTailBuffer(lines, partialLine, normalized.text, redrawCursor) - lines = tail.lines - partialLine = tail.partialLine - redrawCursor = tail.redrawCursor - yield { - screenLines: projectTerminalVisibleLines(emulator).lines, - waitText: buildTerminalWaitText(lines, partialLine, buildPreview(lines, partialLine)) - } - } - } finally { - emulator.dispose() - } -} - -async function finalFrame(name: string, cols: number, rows: number): Promise { - let last: ReplayFrame | null = null - for await (const frame of replay(readFixture(name), cols, rows)) { +async function finalFrame( + name: string, + cols: number, + rows: number +): Promise { + let last: TranscriptReplayFrame | null = null + for await (const frame of replayTranscript(readRuntimeFixture(name), cols, rows)) { last = frame } if (!last) { @@ -89,8 +56,8 @@ describe('Codex 0.157 header readiness from captured bytes', () => { '%s: the screen never adds readiness while loading, and is ready at the final screen', async (name) => { let sawLoadingHeader = false - let last: ReplayFrame | null = null - for await (const frame of replay(readFixture(name), 120, 40)) { + let last: TranscriptReplayFrame | null = null + for await (const frame of replayTranscript(readRuntimeFixture(name), 120, 40)) { if (screenShowsLoadingHeader(frame.screenLines)) { sawLoadingHeader = true expect(isKnownReadyPromptBody('', 'codex', () => frame.screenLines)).toBe(false) @@ -113,7 +80,7 @@ describe('Codex 0.157 header readiness from captured bytes', () => { [60, 5] ])('at %ix%i the screen never takes readiness away from the text rules', (cols, rows) => { it.each(ALL_FIXTURES)('%s', async (name) => { - for await (const frame of replay(readFixture(name), cols, rows)) { + for await (const frame of replayTranscript(readRuntimeFixture(name), cols, rows)) { if (isKnownReadyPromptPreview(frame.waitText)) { expect(isKnownReadyPromptBody(frame.waitText, 'codex', () => frame.screenLines)).toBe( true @@ -191,7 +158,7 @@ describe('Codex 0.157 header readiness from captured bytes', () => { paneTitle: 'Terminal', foregroundProcess: 'codex', launchAgent: 'codex', - data: readFixture(name), + data: readRuntimeFixture(name), size }) } diff --git a/src/main/runtime/codex-quiet-ready-screen.test.ts b/src/main/runtime/codex-quiet-ready-screen.test.ts new file mode 100644 index 000000000000..500523659055 --- /dev/null +++ b/src/main/runtime/codex-quiet-ready-screen.test.ts @@ -0,0 +1,372 @@ +import { readFileSync } from 'node:fs' +import { join } from 'node:path' +import { afterEach, describe, expect, it, vi } from 'vitest' +import type { TuiAgent } from '../../shared/tui-agent' +import { createTranscriptPane } from './agent-transcript-pane-test-harness' +import { + readRuntimeFixture, + replayTranscript, + type TranscriptReplayFrame +} from './agent-transcript-replay-test-harness' +import { isCodexComposerReadyScreen } from './codex-terminal-readiness' +import { + detectTerminalWaitBlockedReason, + isKnownReadyPromptBody, + isQuietReadyScreenBody +} from './terminal-wait-detection' +import { + evaluateTuiIdle, + hasQuietReadyScreen, + isTuiIdleReadyVerdict, + type TuiIdleEvaluationInput +} from './tui-idle-evidence' + +vi.mock('electron', () => ({ + BrowserWindow: { fromId: vi.fn(() => null) }, + webContents: { fromId: vi.fn(() => null) }, + ipcMain: { on: vi.fn(), removeListener: vi.fn() }, + app: { getPath: vi.fn(() => '/tmp') } +})) + +const QUIESCENCE_MS = 3000 + +// codex-cli recordings at 120x40 (see each .meta.json); STA-8834. Each launches, runs a turn, +// and ends idle; the timed ones also replay as plain strings here. 0.157 idles via STA-8628's. +const TIMED_FIXTURES = ['codex-0-155-1-timed-turn', 'codex-0-158-0-timed-turn'] +const SETTLED_IDLE_FIXTURES = ['codex-0-150-1-turn', ...TIMED_FIXTURES] +const DIALOG_FIXTURES = [ + 'codex-0-157-1-update-dialog', + 'codex-0-158-0-approval', + 'codex-0-158-0-trustprompt' +] +const STA_8628_FIXTURES = [ + 'codex-0157-plain-ready', + 'codex-0157-effort-override-embedded-warning', + 'codex-0157-config-override-embedded-warning', + 'codex-0157-no-daemon-effort-override' +] + +const BUSY_STATUS_RE = /to interrupt\)/ +const EMPTY_COMPOSER_RE = /^› ask codex to do anything\s*$/m +const HEADER_LOADING_RE = /(?:model|directory):\s+loading|^\s*loading\s*$/m +const DIALOG_RE = + /update available|do you trust|trust this folder|would you like to run|press enter to confirm|enter continue/ + +function screenOf(frame: TranscriptReplayFrame): string { + return frame.screenLines.join('\n').toLowerCase() +} + +async function collectFrames( + data: string | readonly string[], + cols = 120, + rows = 40 +): Promise { + const frames: TranscriptReplayFrame[] = [] + for await (const frame of replayTranscript(data, cols, rows)) { + frames.push(frame) + } + return frames +} + +describe('Codex composer ready screen, frame by frame', () => { + it.each([...SETTLED_IDLE_FIXTURES, ...DIALOG_FIXTURES])( + '%s: never ready while loading, mid-turn, or under a drawn dialog', + async (name) => { + const seen = { loading: 0, busy: 0, dialog: 0 } + for (const frame of await collectFrames(readRuntimeFixture(name))) { + const screen = screenOf(frame) + // Why only once the composer is gone: a half-drawn dialog keeps it for a few frames, + // which quiescence absorbs; a drawn dialog replaces it. + const kind = HEADER_LOADING_RE.test(screen) + ? 'loading' + : BUSY_STATUS_RE.test(screen) + ? 'busy' + : DIALOG_RE.test(screen) && !EMPTY_COMPOSER_RE.test(screen) + ? 'dialog' + : null + if (kind) { + seen[kind] += 1 + expect({ kind, ready: isCodexComposerReadyScreen(screenOf(frame)) }).toEqual({ + kind, + ready: false + }) + } + } + // Presence preconditions: each fixture exercises the states it was recorded for. + expect(seen.loading).toBeGreaterThan(0) + if (DIALOG_FIXTURES.includes(name)) { + expect(seen.dialog).toBeGreaterThan(0) + } else { + expect(seen.busy).toBeGreaterThan(0) + } + }, + 30_000 + ) + + it.each([...SETTLED_IDLE_FIXTURES, ...STA_8628_FIXTURES])( + '%s: ready on the final idle screen', + async (name) => { + const frames = await collectFrames(readRuntimeFixture(name)) + expect(isCodexComposerReadyScreen(screenOf(frames.at(-1)!))).toBe(true) + } + ) + + it.each(DIALOG_FIXTURES)('%s: not ready while the dialog owns the screen', async (name) => { + const frames = await collectFrames(readRuntimeFixture(name)) + expect(isCodexComposerReadyScreen(screenOf(frames.at(-1)!))).toBe(false) + }) + + it('is not ready without a live screen', () => { + expect(isQuietReadyScreenBody('', 'codex', () => null)).toBe(false) + }) + + it('reads the placeholder only as the composer line, not quoted mid-line', () => { + const quoted = ['$ grep placeholder notes.txt', 'the box says › Ask Codex to do anything', '$'] + expect(isQuietReadyScreenBody('', 'codex', () => quoted)).toBe(false) + }) + + it('reads the busy row only above the composer, not a status row quoted in the answer', () => { + const screenLines = [ + '>_ OpenAI Codex (v0.158.0)', + ' ~/repo', + '', + '› what does the status row look like mid-turn?', + '', + '• It reads like this:', + '', + ' • Working (0s • esc to interrupt)', + '', + ' The timer counts up until the turn ends, and the row', + ' disappears once the answer is complete.', + '', + '› Ask Codex to do anything', + '', + ' gpt-5.6-sol medium · ~/repo', + ' ? for shortcuts' + ] + expect(isQuietReadyScreenBody('', 'codex', () => screenLines)).toBe(true) + const composer = screenLines.indexOf('› Ask Codex to do anything') + const busy = [ + ...screenLines.slice(0, composer), + '• Working (3s • esc to interrupt)', + ' └ Tip: start a fresh idea with /new', + '', + ...screenLines.slice(composer) + ] + expect(isQuietReadyScreenBody('', 'codex', () => busy)).toBe(false) + }) + + it("reads 0.158's turn timestamp above the composer as the end of a quoted status row", () => { + // Live 0.158 screen after a worker answered with a status row verbatim (STA-8834). + const screenLines = [ + ' === TASK ===', + ' Reply with exactly this line and nothing else: • Working (0s • esc to interrupt) — then call worker_done.', + '• • Working (0s • esc to interrupt)', + '• Ran orca-dev orchestration send --from term_f496fcd2-a874-4fa6-a9bd-550a515ac928 --dispatch-capability dcap_PTgPpvf-B…', + ' └ Sent msg_ff7be3f25d7e', + ' + Show details', + '• • Working (0s • esc to interrupt)', + ' 11:15 PM', + '› Ask Codex to do anything', + ' GPT-6-Sol medium · ~/orca-lanes/sta8834/live3/scratch · Report task outcome', + ' ? for shortcuts' + ] + expect(isQuietReadyScreenBody('', 'codex', () => screenLines)).toBe(true) + }) + + it('settles a quiet composer under an answer asking "Would you like to proceed?"', () => { + const screenLines = [ + '>_ OpenAI Codex (v0.158.0)', + ' ~/repo', + '', + '› tidy the README', + '', + '• Done. Would you like to proceed with the changelog too?', + '', + '› Ask Codex to do anything', + '', + ' ? for shortcuts' + ] + const waitText = screenLines.join('\n') + const verdict = evaluateTuiIdle({ + record: { lastAgentStatus: null, lastOutputAt: 0, lastOscTitle: null }, + readTailBlockedReason: () => detectTerminalWaitBlockedReason(waitText), + readPositiveBodyEvidence: () => isKnownReadyPromptBody(waitText, 'codex', () => screenLines), + readQuietReadyBodyEvidence: () => + isQuietReadyScreenBody(waitText, 'codex', () => screenLines), + agent: 'codex', + firstPartyStatus: null, + quiescenceMs: QUIESCENCE_MS + }) + expect(verdict.kind).toBe('ready-strong') + }) +}) + +type Timing = { promptSentAtMs: number; chunks: [number, number][] } + +function readTimedFixture(name: string): { chunks: string[]; times: number[]; promptAt: number } { + const data = readRuntimeFixture(name) + const timing: Timing = JSON.parse( + readFileSync(join(__dirname, '__fixtures__', `${name}.timing.json`), 'utf8') + ) + const chunks: string[] = [] + let offset = 0 + for (const [, length] of timing.chunks) { + chunks.push(data.slice(offset, offset + length)) + offset += length + } + expect(offset).toBe(data.length) + return { chunks, times: timing.chunks.map(([at]) => at), promptAt: timing.promptSentAtMs } +} + +describe('the quiet lane over recorded chunk timing (default animations)', () => { + afterEach(() => { + vi.useRealTimers() + }) + + it.each(TIMED_FIXTURES)( + '%s: never settles mid-turn, and settles once the finished turn is quiet', + async (name) => { + const { chunks, times, promptAt } = readTimedFixture(name) + const frames = await collectFrames(chunks) + // Why after the replay: the emulator's write flush runs on real timers. + vi.useFakeTimers() + const lastBusy = frames.findLastIndex((frame) => BUSY_STATUS_RE.test(screenOf(frame))) + const firstTurnChunk = times.findIndex((at) => at >= promptAt) + expect(lastBusy).toBeGreaterThan(firstTurnChunk) + // The latest moment each frame stays on screen: just before the next chunk lands. + const settlesAt = (index: number, now: number): boolean => { + vi.setSystemTime(now) + return hasQuietReadyScreen( + { lastAgentStatus: null, lastOutputAt: times[index]!, lastOscTitle: null }, + 'codex', + () => + isQuietReadyScreenBody( + frames[index]!.waitText, + 'codex', + () => frames[index]!.screenLines + ), + QUIESCENCE_MS + ) + } + let readyBodyMidTurn = 0 + for (let index = firstTurnChunk; index <= lastBusy; index += 1) { + if (isCodexComposerReadyScreen(screenOf(frames[index]!))) { + readyBodyMidTurn += 1 + } + expect({ index, settles: settlesAt(index, times[index + 1]! - 1) }).toEqual({ + index, + settles: false + }) + } + // Presence precondition: the body alone does show mid-turn, so quiescence is load-bearing. + expect(readyBodyMidTurn).toBeGreaterThan(0) + const last = frames.length - 1 + // Why +1: the fake clock keeps whole milliseconds; the recorded times do not. + expect(settlesAt(last, times[last]! + QUIESCENCE_MS + 1)).toBe(true) + }, + 120_000 + ) +}) + +describe('never less ready than origin/main', () => { + const records = [ + { lastAgentStatus: null, lastOutputAt: 0, lastOscTitle: null }, + { lastAgentStatus: 'idle' as const, lastOutputAt: 0, lastOscTitle: 'codex' }, + { lastAgentStatus: 'working' as const, lastOutputAt: 0, lastOscTitle: '⠋ repo' } + ] + describe.each([ + [120, 40], + [80, 24] + ])('at %ix%i', (cols, rows) => { + it.each([...SETTLED_IDLE_FIXTURES, ...DIALOG_FIXTURES, ...STA_8628_FIXTURES])( + '%s', + async (name) => { + for (const frame of await collectFrames(readRuntimeFixture(name), cols, rows)) { + for (const agent of ['codex', null] as const) { + const base = { + readTailBlockedReason: () => detectTerminalWaitBlockedReason(frame.waitText), + readPositiveBodyEvidence: () => + isKnownReadyPromptBody(frame.waitText, agent, () => frame.screenLines), + agent, + firstPartyStatus: null, + quiescenceMs: QUIESCENCE_MS + } satisfies Omit + for (const record of records) { + const before = evaluateTuiIdle({ + ...base, + record, + // Why a withheld screen: that leaves exactly main's Muse lane, the only widening. + readQuietReadyBodyEvidence: () => + isQuietReadyScreenBody(frame.waitText, agent, () => null) + }) + const after = evaluateTuiIdle({ + ...base, + record, + readQuietReadyBodyEvidence: () => + isQuietReadyScreenBody(frame.waitText, agent, () => frame.screenLines) + }) + if (isTuiIdleReadyVerdict(before)) { + expect(isTuiIdleReadyVerdict(after)).toBe(true) + } + } + } + } + }, + 60_000 + ) + }) +}) + +describe('agent gate', () => { + const placeholderScreen = ['› Ask Codex to do anything', ' ? for shortcuts'] + + it("never reads another agent's screen, even one showing Codex's placeholder", () => { + const readScreenLines = vi.fn(() => placeholderScreen) + for (const agent of ['claude', 'muse', 'gemini'] as const) { + expect(isQuietReadyScreenBody('', agent, readScreenLines)).toBe(false) + } + expect(readScreenLines).not.toHaveBeenCalled() + expect(isQuietReadyScreenBody('', 'codex', readScreenLines)).toBe(true) + }) + + it('leaves an agent-unknown pane showing a cat-ed Codex transcript pending', () => { + const catted = ['$ cat session.log', '› Ask Codex to do anything', ' ? for shortcuts', '$ '] + const readScreenLines = vi.fn(() => catted) + expect(isQuietReadyScreenBody(catted.join('\n'), null, readScreenLines)).toBe(false) + expect(readScreenLines).not.toHaveBeenCalled() + expect(isQuietReadyScreenBody('', 'codex', readScreenLines)).toBe(true) + }) +}) + +describe('through the runtime', () => { + // Why 0.158 alone: its header carries no `model:`, so only this lane settles it. + const CODEX_0158 = 'codex-0-158-0-timed-turn' + async function pane(name: string, launchAgent: TuiAgent, size?: { cols: number; rows: number }) { + return createTranscriptPane({ + paneTitle: 'Terminal', + foregroundProcess: launchAgent, + launchAgent, + data: readRuntimeFixture(name), + size + }) + } + + // Why 8s: quiescence (3s) plus the 2s poll re-reading the grid. + it('codex 0.158: a tui-idle wait settles once the composer is quiet', async () => { + const { runtime, handle } = await pane(CODEX_0158, 'codex', { cols: 120, rows: 40 }) + await expect( + runtime.waitForTerminal(handle, { condition: 'tui-idle', timeoutMs: 8_000 }) + ).resolves.toMatchObject({ condition: 'tui-idle', satisfied: true }) + }, 15_000) + + it('keeps a Claude pane showing the same screen pending', async () => { + const { runtime, handle } = await pane(CODEX_0158, 'claude', { + cols: 120, + rows: 40 + }) + await expect( + runtime.waitForTerminal(handle, { condition: 'tui-idle', timeoutMs: 6_000 }) + ).rejects.toThrow(/timeout/) + }, 15_000) +}) diff --git a/src/main/runtime/codex-terminal-readiness.ts b/src/main/runtime/codex-terminal-readiness.ts new file mode 100644 index 000000000000..3b15c3359dfc --- /dev/null +++ b/src/main/runtime/codex-terminal-readiness.ts @@ -0,0 +1,63 @@ +// Why both shapes: 0.150-0.157 paint `model: loading` in a box, 0.158 a bare `loading` under the title. +const CODEX_HEADER_LOADING_RE = /(?:model|directory):\s+loading|^\s*loading\s*$/m +// Why a line cap: 0.158 draws no box, so nothing else ends its header before the chat. +const CODEX_HEADER_LINES = 6 +// Why the whole line: a pager, a `cat`ed transcript, or chat can quote the placeholder mid-line. +const CODEX_EMPTY_COMPOSER_RE = /^› ask codex to do anything\s*$/ +// Why not "working": reasoning summaries replace it, and a remapped key still ends this way. +const CODEX_BUSY_STATUS_MARKER = 'to interrupt)' +// Why only a tip: it is the one line Codex draws between its status row and the composer (120x40 corpus). +const CODEX_STATUS_TIP_PREFIX = '└ tip:' + +// Why the header only: chat below it can mention "OpenAI Codex" or `model: loading`. +function findCodexHeader(screen: string): { index: number; text: string } | null { + const index = screen.indexOf('openai codex') + if (index === -1) { + return null + } + const boxEnd = screen.indexOf('╰', index) + const text = screen + .slice(index, boxEnd === -1 ? undefined : boxEnd) + .split('\n', CODEX_HEADER_LINES) + .join('\n') + return { index, text } +} + +/** Tier 1: the 0.150-0.157 header, which only a grid reassembles (see isKnownReadyPromptBody). */ +export function findCodexScreenReadyPromptIndex(screen: string): number | null { + const header = findCodexHeader(screen) + return header !== null && + header.text.includes('model:') && + header.text.includes('directory:') && + !CODEX_HEADER_LOADING_RE.test(header.text) + ? header.index + : null +} + +/** + * Tier 1b, codex panes only: the empty composer with no busy status row just above it and no + * header load. Codex 0.158 dropped `model:`/`directory:`, and a long session scrolls the header + * away, so this is its only version-stable rest body. No dialog check: every Codex dialog + * replaces the composer, while an answer ending "Would you like to…?" must not block the lane. + * The mid-turn guard is the caller's quiescence, fed by the ~100 ms title spinner and status + * timer; `tui.animations=false` (set by a screen reader), `tui.effects.progress=false`, or a + * `tui.terminal_title` without activity/spinner removes it. + */ +export function isCodexComposerReadyScreen(screen: string): boolean { + const lines = screen.split('\n') + const composer = lines.findLastIndex((line) => CODEX_EMPTY_COMPOSER_RE.test(line)) + if (composer === -1 || hasBusyStatusRowAbove(lines, composer)) { + return false + } + const header = findCodexHeader(screen) + return header === null || !CODEX_HEADER_LOADING_RE.test(header.text) +} + +// Why only the row above the composer: a finished answer (or one above 0.158's timestamp) can quote it. +function hasBusyStatusRowAbove(lines: readonly string[], composer: number): boolean { + const above = lines.slice(0, composer).filter((line) => line.trim() !== '') + const row = above.at(-1)?.trimStart().startsWith(CODEX_STATUS_TIP_PREFIX) + ? above.at(-2) + : above.at(-1) + return row?.includes(CODEX_BUSY_STATUS_MARKER) ?? false +} diff --git a/src/main/runtime/terminal-wait-detection.ts b/src/main/runtime/terminal-wait-detection.ts index bb102a3e7b88..1540eef2d5f0 100644 --- a/src/main/runtime/terminal-wait-detection.ts +++ b/src/main/runtime/terminal-wait-detection.ts @@ -8,6 +8,10 @@ import { import type { RuntimeTerminalWaitBlockedReason } from '../../shared/runtime-types' import type { TuiAgent } from '../../shared/tui-agent' import { findAntigravityReadyPromptIndex } from './antigravity-terminal-readiness' +import { + findCodexScreenReadyPromptIndex, + isCodexComposerReadyScreen +} from './codex-terminal-readiness' import { startOfLastLines, startOfLastNonBlankLines } from './terminal-wait-tail-window' const EXPLICIT_IDLE_TITLE_RE = /(^|\s)(ready|idle|done)(\s|$|[.!?])/i @@ -72,12 +76,29 @@ export function isKnownReadyPromptBody( if (agent !== null && agent !== 'codex') { return false } - const screenLines = readScreenLines() - if (screenLines === null) { - return false + const screen = readScreen(readScreenLines) + return screen !== null && isReadyPromptUnblocked(screen, findCodexScreenReadyPromptIndex(screen)) +} + +/** + * Tier 1b body evidence: a ready screen from an agent with no title rest signal. Unlike tier 1 + * it only proves the TUI is up, so the ranking holds it to quiescence. + * Why codex panes only: a `cat`ed transcript or pager in an unknown pane can show the composer. + */ +export function isQuietReadyScreenBody( + waitText: string, + agent: TuiAgent | null, + readScreenLines: () => readonly string[] | null +): boolean { + if (agent === 'codex') { + const screen = readScreen(readScreenLines) + return screen !== null && isCodexComposerReadyScreen(screen) } - const screen = screenLines.join('\n').toLowerCase() - return isReadyPromptUnblocked(screen, findCodexScreenReadyPromptIndex(screen)) + return (agent === null || agent === 'muse') && isMuseReadyPromptPreview(waitText) +} + +function readScreen(readScreenLines: () => readonly string[] | null): string | null { + return readScreenLines()?.join('\n').toLowerCase() ?? null } function isReadyPromptUnblocked(normalized: string, readyIndex: number | null): boolean { @@ -88,8 +109,6 @@ function isReadyPromptUnblocked(normalized: string, readyIndex: number | null): return blockedSignal === null || blockedSignal.index <= readyIndex } -// Why separate from isKnownReadyPromptPreview: that one settles tier 1 immediately, while -// a Muse ready screen only proves the TUI is up — the ranking holds it to quiescence. export function isMuseReadyPromptPreview(preview: string): boolean { const normalized = preview.toLowerCase() return isReadyPromptUnblocked(normalized, findMuseReadyPromptIndex(normalized)) @@ -179,24 +198,6 @@ function findCodexReadyPromptIndex(normalized: string): number | null { return readySegment.includes('model:') && readySegment.includes('directory:') ? headerIndex : null } -const CODEX_HEADER_LOADING_RE = /(?:model|directory):\s+loading/ - -// Why the header box only: chat below it can mention "OpenAI Codex" or `model: loading`. -// Why `loading`: a header still loading is not ready; the screen must not add readiness early. -function findCodexScreenReadyPromptIndex(screen: string): number | null { - const headerIndex = screen.indexOf('openai codex') - if (headerIndex === -1) { - return null - } - const boxEnd = screen.indexOf('╰', headerIndex) - const header = screen.slice(headerIndex, boxEnd === -1 ? undefined : boxEnd) - return header.includes('model:') && - header.includes('directory:') && - !CODEX_HEADER_LOADING_RE.test(header) - ? headerIndex - : null -} - export const TERMINAL_WAIT_BLOCKED_SENTINEL_RE = /update available|choose working directory to|codex just got an upgrade|hooks need review|do you trust|trust this|trusted workspace|press enter to (?:confirm|continue|view|insert)|press t to trust|permission required|requires permission|allow once|allow always|run this command\?/i diff --git a/src/main/runtime/tui-idle-evidence.test.ts b/src/main/runtime/tui-idle-evidence.test.ts index de9e955099cd..ee8e908c61bd 100644 --- a/src/main/runtime/tui-idle-evidence.test.ts +++ b/src/main/runtime/tui-idle-evidence.test.ts @@ -7,8 +7,8 @@ import { isKnownReadyPromptBody } from './terminal-wait-detection' import { evaluateTuiIdle, hasFreshDoneFirstPartyStatus, + hasQuietReadyScreen, isTuiIdleReadyVerdict, - hasQuietMuseReadyPrompt, nameOnlyIdleNeedsCorroboration, type TuiIdleEvaluationInput, type TuiIdleEvidenceRecord @@ -30,7 +30,7 @@ function input(overrides: Partial = {}): TuiIdleEvaluati record: record(), readTailBlockedReason: () => null, readPositiveBodyEvidence: () => false, - readMuseReadyBodyEvidence: () => true, + readQuietReadyBodyEvidence: () => true, agent: 'muse', firstPartyStatus: null, quiescenceMs: QUIESCENCE_MS, @@ -38,39 +38,38 @@ function input(overrides: Partial = {}): TuiIdleEvaluati } } -describe('hasQuietMuseReadyPrompt', () => { +describe('hasQuietReadyScreen', () => { it('settles a Muse ready screen once the stream has gone quiet', () => { - expect(hasQuietMuseReadyPrompt(record(), 'muse', () => true, QUIESCENCE_MS)).toBe(true) + expect(hasQuietReadyScreen(record(), 'muse', () => true, QUIESCENCE_MS)).toBe(true) }) it('refuses while the pane is still streaming', () => { expect( - hasQuietMuseReadyPrompt( - record({ lastOutputAt: Date.now() }), - 'muse', - () => true, - QUIESCENCE_MS - ) + hasQuietReadyScreen(record({ lastOutputAt: Date.now() }), 'muse', () => true, QUIESCENCE_MS) ).toBe(false) }) it('refuses without an output clock, like the tier-3 lane', () => { expect( - hasQuietMuseReadyPrompt(record({ lastOutputAt: null }), 'muse', () => true, QUIESCENCE_MS) + hasQuietReadyScreen(record({ lastOutputAt: null }), 'muse', () => true, QUIESCENCE_MS) ).toBe(false) }) it('refuses without a ready screen', () => { - expect(hasQuietMuseReadyPrompt(record(), 'muse', () => false, QUIESCENCE_MS)).toBe(false) + expect(hasQuietReadyScreen(record(), 'muse', () => false, QUIESCENCE_MS)).toBe(false) }) it('covers adopted panes that carry no launch metadata', () => { - expect(hasQuietMuseReadyPrompt(record(), null, () => true, QUIESCENCE_MS)).toBe(true) - expect(hasQuietMuseReadyPrompt(record(), undefined, () => true, QUIESCENCE_MS)).toBe(true) + expect(hasQuietReadyScreen(record(), null, () => true, QUIESCENCE_MS)).toBe(true) + expect(hasQuietReadyScreen(record(), undefined, () => true, QUIESCENCE_MS)).toBe(true) }) - it('refuses another agent quoting Muse in its scrollback', () => { - expect(hasQuietMuseReadyPrompt(record(), 'codex', () => true, QUIESCENCE_MS)).toBe(false) + it('covers Codex, whose title carries no rest signal once idle', () => { + expect(hasQuietReadyScreen(record(), 'codex', () => true, QUIESCENCE_MS)).toBe(true) + }) + + it('refuses another agent quoting Muse or Codex in its scrollback', () => { + expect(hasQuietReadyScreen(record(), 'claude', () => true, QUIESCENCE_MS)).toBe(false) }) }) @@ -87,7 +86,7 @@ describe('evaluateTuiIdle muse lane', () => { }) describe('evaluateTuiIdle ranking', () => { - const noMuse = { readMuseReadyBodyEvidence: () => false } + const noMuse = { readQuietReadyBodyEvidence: () => false } it('ranks a blocking prompt in the tail above an explicit idle title', () => { const verdict = evaluateTuiIdle( @@ -201,13 +200,14 @@ describe('rest signal agrees with the lanes that can settle a wait', () => { screenRead = true return null }) - const museBody = hasQuietMuseReadyPrompt(record(), agent, () => true, QUIESCENCE_MS) - if (museBody) { - expect(signal).toBe('ready-body') + const quietScreenBody = hasQuietReadyScreen(record(), agent, () => true, QUIESCENCE_MS) + // Why not only ready-body: Codex keeps its stronger hook-driven title beside this lane. + if (quietScreenBody) { + expect(signal).not.toBe('none') } // Why a screen read also counts: Qoder's ready body is its composer, read by identity. if (signal === 'ready-body') { - expect(museBody || screenRead).toBe(true) + expect(quietScreenBody || screenRead).toBe(true) } if (signal !== 'none') { return @@ -241,7 +241,7 @@ describe('a DSH pane settles tui-idle on its own hook', () => { record: { lastAgentStatus: null, lastOutputAt: null, lastOscTitle: '\u2726 \u{1F40B} repo' }, rendererTitle: undefined, readPositiveBodyEvidence: () => false, - readMuseReadyBodyEvidence: () => false, + readQuietReadyBodyEvidence: () => false, readTailBlockedReason: () => null, agent: 'dsh' as const, firstPartyStatus: { state: 'done' as const, updatedAt: Date.now() }, diff --git a/src/main/runtime/tui-idle-evidence.ts b/src/main/runtime/tui-idle-evidence.ts index c9cd6675d384..cb7dc13714b2 100644 --- a/src/main/runtime/tui-idle-evidence.ts +++ b/src/main/runtime/tui-idle-evidence.ts @@ -14,7 +14,7 @@ import { detectExplicitIdleStatusFromTitle, detectTerminalWaitBlockedReason, isKnownReadyPromptBody, - isMuseReadyPromptPreview + isQuietReadyScreenBody } from './terminal-wait-detection' /** @@ -29,8 +29,8 @@ import { * 0. BLOCKED — the tail shows a prompt waiting on the user. * 1. STRONG READY — the agent states it is ready: an explicit idle marker in its own * title, or a known ready-prompt body. - * 1b. MUSE — Muse emits no title signal at all, so its ready-screen body stands in - * for the strong evidence, believed only once the stream has gone quiet. + * 1b. QUIET READY SCREEN — Muse and an idle Codex title no rest signal, so their + * ready-screen body stands in for the strong evidence, believed only once quiet. * 2. WORKING — a fresh first-party agent status (OSC 9999) saying working/blocked/ * waiting, or a working title. The agent's own account of itself outranks anything * inferred. @@ -187,8 +187,8 @@ export type TuiIdleEvaluationInput = { * (~11us and a multi-KB string on a full tail); the title check below usually answers * first, and then none of that has to happen at all. */ readPositiveBodyEvidence: () => boolean - /** Tier 1b body evidence: a Muse ready screen. Thunk for the same reason as above. */ - readMuseReadyBodyEvidence: () => boolean + /** Tier 1b body evidence: a Muse or Codex ready screen. Thunk for the same reason as above. */ + readQuietReadyBodyEvidence: () => boolean agent: TuiAgent | null | undefined firstPartyStatus: FirstPartyAgentStatus quiescenceMs: number @@ -207,34 +207,34 @@ const READY_STRONG: TuiIdleVerdict = { kind: 'ready-strong' } const READY_WEAK: TuiIdleVerdict = { kind: 'ready-weak' } const WORKING: TuiIdleVerdict = { kind: 'working' } +const QUIET_READY_SCREEN_AGENTS: ReadonlySet = new Set(['muse', 'codex']) + /** - * Tier 1b: a Muse ready screen in the body, believed only once the stream has gone quiet. + * Tier 1b: a ready screen in the body, believed only once the stream has gone quiet. * - * Muse is the one agent with no title signal at all — its OSC title is the bare cwd and - * never changes — so neither the explicit-idle nor the sustained-title lane can fire. - * The ready screen proves the TUI is up; the quiescence demand keeps a mid-turn - * streaming pane from satisfying, mirroring the codex tier-3 lane's - * positive-evidence-plus-quiet shape. Scoped to Muse and agent-unknown panes: another - * agent's scrollback quoting Muse must not settle its wait. + * Muse's OSC title is the bare cwd and never changes, and an idle Codex titles its pane with + * the cwd (plus a thread name) and no agent name, so neither the explicit-idle nor the + * sustained-title lane can fire. The ready screen proves the TUI is up; the quiescence + * demand keeps a mid-turn streaming pane from satisfying, mirroring the tier-3 lane's + * positive-evidence-plus-quiet shape. Scoped to those agents and agent-unknown panes (which + * read only Muse's screen): another agent's scrollback quoting them must not settle its wait. */ -export function hasQuietMuseReadyPrompt( +export function hasQuietReadyScreen( record: TuiIdleEvidenceRecord, agent: TuiAgent | null | undefined, readBodyEvidence: () => boolean, quiescenceMs: number ): boolean { - if (agent !== null && agent !== undefined && agent !== 'muse') { - return false - } - if (!readBodyEvidence()) { + if (agent && !QUIET_READY_SCREEN_AGENTS.has(agent)) { return false } // Why: same rule as the tier-3 lane — without an output clock there is no // corroboration available, so hold out instead of settling. - if (record.lastOutputAt === null) { + if (record.lastOutputAt === null || Date.now() - record.lastOutputAt < quiescenceMs) { return false } - return Date.now() - record.lastOutputAt >= quiescenceMs + // Why last: a streaming pane never pays for the screen projection. + return readBodyEvidence() } /** The one place the tiers are combined; every settle site branches only on the verdict. */ @@ -273,11 +273,13 @@ export function evaluateTuiIdle(input: TuiIdleEvaluationInput): TuiIdleVerdict { : { kind: 'pending', quietForeground: 'closed' } } // Why after the veto: a first-party working account outranks inferred body evidence. + // Why before the working title: Codex can leave a stale spinner title after a turn, and a + // live spinner emits output every ~100 ms, so a spinning pane is never quiet here. if ( - hasQuietMuseReadyPrompt( + hasQuietReadyScreen( input.record, input.agent, - input.readMuseReadyBodyEvidence, + input.readQuietReadyBodyEvidence, input.quiescenceMs ) ) { @@ -328,7 +330,8 @@ export function leafTuiIdleEvidence( rendererTitle: leaf.paneTitle ?? source.getTabTitle(leaf.tabId), readPositiveBodyEvidence: () => isKnownReadyPromptBody(waitText(), agent, () => source.readScreenLines(leaf.ptyId)), - readMuseReadyBodyEvidence: () => isMuseReadyPromptPreview(waitText()), + readQuietReadyBodyEvidence: () => + isQuietReadyScreenBody(waitText(), agent, () => source.readScreenLines(leaf.ptyId)), agent, firstPartyStatus: source.getFirstPartyAgentStatus(leaf.ptyId), quiescenceMs: source.quiescenceMs @@ -348,7 +351,8 @@ export function ptyTuiIdleEvidence( readPositiveBodyEvidence: () => (agent !== 'qoder' && source.getAdoptedPtyIdleStatus(pty) === 'idle') || isKnownReadyPromptBody(waitText(), agent, () => source.readScreenLines(pty.ptyId)), - readMuseReadyBodyEvidence: () => isMuseReadyPromptPreview(waitText()), + readQuietReadyBodyEvidence: () => + isQuietReadyScreenBody(waitText(), agent, () => source.readScreenLines(pty.ptyId)), agent, firstPartyStatus: source.getFirstPartyAgentStatus(pty.ptyId), quiescenceMs: source.quiescenceMs From 18bd9cb1f65c4c8d67719a9e1b171bdae1ac4505 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Mon, 28 Sep 2026 21:47:23 -0700 Subject: [PATCH 67/90] test(status-bar): cover re-probing a roomier level after the tightest level's fit moves (#23793) --- .../components/status-bar/status-bar-density.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/renderer/src/components/status-bar/status-bar-density.test.ts b/src/renderer/src/components/status-bar/status-bar-density.test.ts index 668f5c90a9e9..1ddcbaf35f08 100644 --- a/src/renderer/src/components/status-bar/status-bar-density.test.ts +++ b/src/renderer/src/components/status-bar/status-bar-density.test.ts @@ -70,6 +70,17 @@ describe('recordStatusBarDensityWidth', () => { ).toEqual([w(700), w(600), w(500), w(600, 430), undefined]) }) + it('re-probes a roomier collapsing level once the tightest level sees its fit move', () => { + // Level 3's stale fit (450) kept the bar at level 4; fewer urgent chips now let it fit. + const settled = [w(700), w(600), w(500), w(600, 450), w(500, 400)] + expect(pickStatusBarDensityLevel(settled, 420)).toBe(TIGHTEST) + const remeasured = recordStatusBarDensityWidth(settled, TIGHTEST, w(500, 380)) + expect(remeasured).toEqual([w(700), w(600), w(500), undefined, w(500, 380)]) + expect(pickStatusBarDensityLevel(remeasured, 420)).toBe(3) + const probed = recordStatusBarDensityWidth(remeasured, 3, w(600, 410)) + expect(pickStatusBarDensityLevel(probed, 420)).toBe(3) + }) + it('keeps other levels on a sub-pixel re-measure', () => { expect(recordStatusBarDensityWidth([w(700), w(600), w(500)], 1, w(600.5))).toEqual([ w(700), From 7445feaca88f5097d9c0a580c798dc2a718a7d54 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 22:07:04 -0700 Subject: [PATCH 68/90] fix(terminal): only diagnose disk exhaustion from capacity errors Merged after required checks passed. --- src/main/ipc/pty/ipc/spawn-commit-persist.ts | 7 ++- src/main/ipc/pty/runtime/spawn-commit.ts | 4 +- .../pty-spawn-replacement-durability.test.ts | 40 +++++++++++--- ...ofile-state-writer-capacity-errors.test.ts | 47 ++++++++++++++++ .../profile-state-writer-errors.ts | 3 +- .../terminal-pane/TerminalPaneSurface.tsx | 9 ++-- .../TerminalSessionStateSaveFailureDialog.tsx | 54 +++++++++++-------- .../use-terminal-pane-foundation.ts | 8 +-- .../use-terminal-pane-startup-actions.ts | 4 +- .../use-terminal-pane-title-state.ts | 4 +- .../src/i18n/en-runtime-required.json | 4 ++ src/renderer/src/i18n/locales/en.json | 7 +++ src/shared/storage-capacity-error.ts | 25 +++++++++ ...erminal-session-state-save-failure.test.ts | 44 +++++++++++++++ .../terminal-session-state-save-failure.ts | 14 +++-- 15 files changed, 226 insertions(+), 48 deletions(-) create mode 100644 src/main/persistence/profile-state/profile-state-writer-capacity-errors.test.ts create mode 100644 src/shared/storage-capacity-error.ts create mode 100644 src/shared/terminal-session-state-save-failure.test.ts diff --git a/src/main/ipc/pty/ipc/spawn-commit-persist.ts b/src/main/ipc/pty/ipc/spawn-commit-persist.ts index 3740e1489a05..46fd8e714bb3 100644 --- a/src/main/ipc/pty/ipc/spawn-commit-persist.ts +++ b/src/main/ipc/pty/ipc/spawn-commit-persist.ts @@ -32,7 +32,7 @@ export async function persistPtyIpcSpawnCommit(ctx: PtyIpcSpawnState): Promise

{ it.each( ['ipc', 'runtime'].flatMap((controller) => - ['save', 'shutdown'].map((replacementDuring) => ({ controller, replacementDuring })) + ['save', 'shutdown'].flatMap((replacementDuring) => + ['profile-state-writer-exit', 'ENOSPC'].map((code) => ({ + controller, + replacementDuring, + code + })) + ) ) )( - 'preserves a successor during $replacementDuring when the predecessor $controller save fails', - async ({ controller, replacementDuring }) => { + 'preserves a successor during $replacementDuring when the predecessor $controller save fails with $code', + async ({ controller, replacementDuring, code }) => { const { store, authority } = await fixture() const runtime = new OrcaRuntimeService(store) runtime.onPtySpawned(binding.ptyId, binding.incarnationId) @@ -70,10 +77,18 @@ it.each( commit = () => commitRuntimePtySpawn(ctx) } const gate = authority.pause() - const pending = expect(commit()).rejects.toThrow('ORCA_TERMINAL_SESSION_STATE_SAVE_FAILED') + const pending = commit().catch((error: unknown) => { + expect(error).toBeInstanceOf(Error) + if (!(error instanceof Error)) { + throw error + } + expect(error.message).toContain('ORCA_TERMINAL_SESSION_STATE_SAVE_FAILED') + expect(isTerminalSessionStorageCapacityFailure(error.message)).toBe(code === 'ENOSPC') + return 'rejected' + }) await gate.started.promise if (replacementDuring === 'shutdown') { - gate.finish.reject(new Error('disk full')) + gate.finish.reject(Object.assign(new Error('worker exited'), { code })) await shutdownStarted.promise } await runtime.onPtyExit(binding.ptyId, 0, binding.incarnationId, { providerExitObserved: true }) @@ -81,10 +96,10 @@ it.each( ptyIncarnationById.set(binding.ptyId, replacementIncarnation) ptyOwnership.set(binding.ptyId, 'successor-host') if (replacementDuring === 'save') { - gate.finish.reject(new Error('disk full')) + gate.finish.reject(Object.assign(new Error('worker exited'), { code })) } shutdownFinished.resolve() - await pending + expect(await pending).toBe('rejected') if (replacementDuring === 'save') { expect(shutdown).not.toHaveBeenCalled() } else { @@ -144,3 +159,14 @@ it.each(['ipc', 'runtime'])( }) } ) + +it('does not label an IPC binding ownership refusal as a storage failure', async () => { + const { store } = await fixture() + const runtime = new OrcaRuntimeService(store) + const deps = createPtySpawnCommitDependencies(runtime, store) + const ctx = createPtyIpcSpawnState(deps, { ...binding, cols: 80, rows: 24 }) + ctx.result = { id: binding.ptyId, incarnationId: binding.incarnationId } + ctx.validatedLeafId = binding.leafId + vi.spyOn(store, 'persistPtyBinding').mockResolvedValue(false) + await expect(commitPtyIpcSpawn(ctx)).rejects.toThrow('terminal_pane_owner_changed') +}) diff --git a/src/main/persistence/profile-state/profile-state-writer-capacity-errors.test.ts b/src/main/persistence/profile-state/profile-state-writer-capacity-errors.test.ts new file mode 100644 index 000000000000..f537af8833ca --- /dev/null +++ b/src/main/persistence/profile-state/profile-state-writer-capacity-errors.test.ts @@ -0,0 +1,47 @@ +import Database from '../../sqlite/sync-database' +import { expect, it } from 'vitest' +import { + decodeProfileStateWriterError, + encodeProfileStateWriterError +} from './profile-state-writer-errors' +import { + createTerminalSessionStateSaveFailureMessage, + isTerminalSessionStorageCapacityFailure +} from '../../../shared/terminal-session-state-save-failure' + +it.each(['ENOSPC', 'EDQUOT', 'SQLITE_FULL', 'EACCES', 'SQLITE_BUSY'])( + 'preserves capacity evidence across the writer boundary for %s', + (code) => { + const error = new Error('private path must not cross the worker boundary', { + cause: Object.assign(new Error('private details'), { code }) + }) + const encoded = encodeProfileStateWriterError(error) + expect(encoded.message).toBe('Profile state persistence failed') + const decoded = decodeProfileStateWriterError(JSON.parse(JSON.stringify(encoded))) + const capacity = ['ENOSPC', 'EDQUOT', 'SQLITE_FULL'].includes(code) + expect( + isTerminalSessionStorageCapacityFailure(createTerminalSessionStateSaveFailureMessage(decoded)) + ).toBe(capacity) + } +) + +it('classifies a real SQLite capacity failure after worker serialization', () => { + const db = new Database(':memory:') + try { + db.exec('PRAGMA page_size=512; CREATE TABLE writes(data BLOB); PRAGMA max_page_count=2') + let failure: unknown + try { + db.exec('INSERT INTO writes VALUES (zeroblob(4096))') + } catch (error) { + failure = error + } + expect(failure).toBeDefined() + const decoded = decodeProfileStateWriterError(encodeProfileStateWriterError(failure)) + expect( + isTerminalSessionStorageCapacityFailure(createTerminalSessionStateSaveFailureMessage(decoded)) + ).toBe(true) + db.exec("INSERT INTO writes VALUES ('small')") + } finally { + db.close() + } +}) diff --git a/src/main/persistence/profile-state/profile-state-writer-errors.ts b/src/main/persistence/profile-state/profile-state-writer-errors.ts index 28237862ce2a..afb30d520c87 100644 --- a/src/main/persistence/profile-state/profile-state-writer-errors.ts +++ b/src/main/persistence/profile-state/profile-state-writer-errors.ts @@ -1,3 +1,4 @@ +import { storageCapacityErrorCode } from '../../../shared/storage-capacity-error' import { ProfileStateDocumentCorruptionError, ProfileStateRevisionConflictError @@ -64,7 +65,7 @@ export function encodeProfileStateWriterError( return { code: error.code, message: error.message, outcome } } return { - code: 'profile-state-write-failed', + code: storageCapacityErrorCode(error) ?? 'profile-state-write-failed', message: 'Profile state persistence failed', outcome } diff --git a/src/renderer/src/components/terminal-pane/TerminalPaneSurface.tsx b/src/renderer/src/components/terminal-pane/TerminalPaneSurface.tsx index 0b5da641c955..7eda851e7e9e 100644 --- a/src/renderer/src/components/terminal-pane/TerminalPaneSurface.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalPaneSurface.tsx @@ -92,14 +92,14 @@ export function TerminalPaneSurface({ searchStateRef, searchInputRef, sessionRestoredBannerPaneIds, - sessionStateSaveFailureOpen, + sessionStateSaveFailureMessage, setAgentSessionContinuation, setAgentSessionFork, setContainerRef, setQuickCommandEditorOpen, setRenameValue, setSearchOpen, - setSessionStateSaveFailureOpen, + setSessionStateSaveFailureMessage, showSplitButton, showSshReconnectOverlay, splitTerminalPaneFromHeader, @@ -201,8 +201,9 @@ export function TerminalPaneSurface({ {isActive && ( setSessionStateSaveFailureOpen(false)} + open={sessionStateSaveFailureMessage !== null} + failureMessage={sessionStateSaveFailureMessage ?? ''} + onDismiss={() => setSessionStateSaveFailureMessage(null)} onOpenSpaceAnalyzer={openDiskSpaceAnalyzer} /> )} diff --git a/src/renderer/src/components/terminal-pane/TerminalSessionStateSaveFailureDialog.tsx b/src/renderer/src/components/terminal-pane/TerminalSessionStateSaveFailureDialog.tsx index 6ab425685a39..889fa69d7efb 100644 --- a/src/renderer/src/components/terminal-pane/TerminalSessionStateSaveFailureDialog.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalSessionStateSaveFailureDialog.tsx @@ -1,4 +1,4 @@ -import { HardDrive } from 'lucide-react' +import { AlertCircle } from 'lucide-react' import { Button } from '@/components/ui/button' import { Dialog, @@ -9,16 +9,20 @@ import { DialogTitle } from '@/components/ui/dialog' import { translate } from '@/i18n/i18n' +import { isTerminalSessionStorageCapacityFailure } from '../../../../shared/terminal-session-state-save-failure' export function TerminalSessionStateSaveFailureDialog({ open, + failureMessage, onDismiss, onOpenSpaceAnalyzer }: { open: boolean + failureMessage: string onDismiss: () => void onOpenSpaceAnalyzer: () => void }): React.JSX.Element { + const capacityFailure = isTerminalSessionStorageCapacityFailure(failureMessage) return (

- +
- {translate( - 'auto.components.terminal.pane.TerminalSessionStateSaveFailureDialog.678c780a2c', - 'Disk space is unavailable' - )} + {translate('terminal.sessionSaveFailure.title', 'Could not save terminal session')}
- {translate( - 'auto.components.terminal.pane.TerminalSessionStateSaveFailureDialog.e2fcf07c0d', - 'Orca could not save this terminal session because local storage is full or not writable. Open the disk space analyzer to find workspace storage you can clean up.' - )} + {capacityFailure + ? translate( + 'terminal.sessionSaveFailure.capacity', + 'The device saving this terminal reported full storage or an exceeded storage quota. Free space on that device, then try again.' + ) + : translate( + 'terminal.sessionSaveFailure.unknown', + 'Orca could not save the terminal state. Try again. If this continues, share the Orca logs with support so we can identify the cause.' + )} -
- {translate( - 'auto.components.terminal.pane.TerminalSessionStateSaveFailureDialog.38c282a2c4', - 'The analyzer opens directly from here. You can also open it later from the lower-left toolbox menu by choosing Space Analyzer.' - )} -
+ {capacityFailure && ( +
+ {translate( + 'auto.components.terminal.pane.TerminalSessionStateSaveFailureDialog.38c282a2c4', + 'The analyzer opens directly from here. You can also open it later from the lower-left toolbox menu by choosing Space Analyzer.' + )} +
+ )} - + {capacityFailure && ( + + )}
diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-foundation.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-foundation.ts index 7a0da0ec79ed..008925a06889 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-foundation.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-foundation.ts @@ -148,7 +148,9 @@ export function useTerminalPaneFoundation( const [ptyRecoveryStatesByPaneId, setPtyRecoveryStatesByPaneId] = useState< Record >({}) - const [sessionStateSaveFailureOpen, setSessionStateSaveFailureOpen] = useState(false) + const [sessionStateSaveFailureMessage, setSessionStateSaveFailureMessage] = useState< + string | null + >(null) const daemonActions = useDaemonActions() const { refreshMobileOverlays } = useMobileOverlayTicks({ managerRef, @@ -235,8 +237,8 @@ export function useTerminalPaneFoundation( setTerminalError, ptyRecoveryStatesByPaneId, setPtyRecoveryStatesByPaneId, - sessionStateSaveFailureOpen, - setSessionStateSaveFailureOpen, + sessionStateSaveFailureMessage, + setSessionStateSaveFailureMessage, daemonActions, refreshMobileOverlays } diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-startup-actions.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-startup-actions.ts index 5f59aa73e25e..deff696c93fb 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-startup-actions.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-startup-actions.ts @@ -46,7 +46,7 @@ export function useTerminalPaneStartupActions(controller: TerminalPaneStoreContr setQuickCommandEditorHostId, setQuickCommandEditorOpen, setSessionRestoredBannerPaneIds, - setSessionStateSaveFailureOpen, + setSessionStateSaveFailureMessage, setShouldMeasureHiddenStartup, setTerminalError, setTerminalErrorsByPaneId, @@ -114,7 +114,7 @@ export function useTerminalPaneStartupActions(controller: TerminalPaneStoreContr ) const openDiskSpaceAnalyzer = useCallback(() => { - setSessionStateSaveFailureOpen(false) + setSessionStateSaveFailureMessage(null) openSpacePage() void refreshWorkspaceSpace().catch((error: unknown) => { console.warn('Failed to refresh Space Analyzer after terminal session save failure:', error) diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-title-state.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-title-state.ts index 07db5bef38c1..5c0522c97f15 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-title-state.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-title-state.ts @@ -17,7 +17,7 @@ export function useTerminalPaneTitleState(controller: TerminalPaneFoundation) { managerRef, paneTransportsRef, setPtyRecoveryStatesByPaneId, - setSessionStateSaveFailureOpen, + setSessionStateSaveFailureMessage, setTerminalError, setTerminalErrorsByPaneId, sshReconnectOwnsTerminalErrorsRef @@ -89,7 +89,7 @@ export function useTerminalPaneTitleState(controller: TerminalPaneFoundation) { if (isTerminalSessionStateSaveFailure(message)) { setTerminalError(null) setTerminalErrorsByPaneId({}) - setSessionStateSaveFailureOpen(true) + setSessionStateSaveFailureMessage(message) return } const visibleMessage = sshReconnectOwnsTerminalErrorsRef.current diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index 8b971208580f..90fc6192a119 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -2480,6 +2480,10 @@ "TerminalRemoteRuntimeReconnectBanner": { "retryingBody": "Orca will retry for up to one minute. This terminal will resume if the connection returns." }, + "TerminalSessionStateSaveFailureDialog": { + "678c780a2c": "Disk space is unavailable", + "e2fcf07c0d": "Orca could not save this terminal session because local storage is full or not writable. Open the disk space analyzer to find workspace storage you can clean up." + }, "TerminalSshReconnectOverlay": { "connectButton": "Connect", "connectingButton": "Connecting..." diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index cbbba795d593..e44421a97324 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -18501,5 +18501,12 @@ }, "common": { "retry": "Retry" + }, + "terminal": { + "sessionSaveFailure": { + "title": "Could not save terminal session", + "capacity": "The device saving this terminal reported full storage or an exceeded storage quota. Free space on that device, then try again.", + "unknown": "Orca could not save the terminal state. Try again. If this continues, share the Orca logs with support so we can identify the cause." + } } } diff --git a/src/shared/storage-capacity-error.ts b/src/shared/storage-capacity-error.ts new file mode 100644 index 000000000000..63575e7fa1c4 --- /dev/null +++ b/src/shared/storage-capacity-error.ts @@ -0,0 +1,25 @@ +export function storageCapacityErrorCode( + error: unknown, + seen = new Set() +): 'ENOSPC' | 'EDQUOT' | 'SQLITE_FULL' | null { + if (typeof error !== 'object' || error === null || seen.has(error)) { + return null + } + seen.add(error) + // node:sqlite reports SQLITE_FULL through its numeric SQLite result code. + if ( + 'code' in error && + error.code === 'ERR_SQLITE_ERROR' && + 'errcode' in error && + error.errcode === 13 + ) { + return 'SQLITE_FULL' + } + if ( + 'code' in error && + (error.code === 'ENOSPC' || error.code === 'EDQUOT' || error.code === 'SQLITE_FULL') + ) { + return error.code + } + return 'cause' in error ? storageCapacityErrorCode(error.cause, seen) : null +} diff --git a/src/shared/terminal-session-state-save-failure.test.ts b/src/shared/terminal-session-state-save-failure.test.ts new file mode 100644 index 000000000000..aee76908a626 --- /dev/null +++ b/src/shared/terminal-session-state-save-failure.test.ts @@ -0,0 +1,44 @@ +import { describe, expect, it } from 'vitest' +import { + createTerminalSessionStateSaveFailureMessage, + isTerminalSessionStateSaveFailure, + isTerminalSessionStorageCapacityFailure +} from './terminal-session-state-save-failure' + +describe('terminal save failure classification', () => { + it.each(['ENOSPC', 'EDQUOT', 'SQLITE_FULL'])('recognizes %s through a wrapper', (code) => { + const message = createTerminalSessionStateSaveFailureMessage( + new Error('write failed', { cause: Object.assign(new Error('failure'), { code }) }) + ) + expect(isTerminalSessionStorageCapacityFailure(message)).toBe(true) + expect(isTerminalSessionStateSaveFailure(message)).toBe(true) + }) + + it.each(['EACCES', 'EPERM', 'EIO', 'SQLITE_BUSY', 'profile-state-writer-exit'])( + 'does not diagnose %s as exhausted storage', + (code) => { + const message = createTerminalSessionStateSaveFailureMessage({ code, message: 'disk full' }) + expect(isTerminalSessionStateSaveFailure(message)).toBe(true) + expect(isTerminalSessionStorageCapacityFailure(message)).toBe(false) + } + ) + + it('treats legacy and unknown host errors as unclassified', () => { + for (const message of [ + 'ORCA_TERMINAL_SESSION_STATE_SAVE_FAILED: local storage is unavailable.', + 'Failed to save terminal session state', + createTerminalSessionStateSaveFailureMessage(new Error('disk full')) + ]) { + expect(isTerminalSessionStateSaveFailure(message)).toBe(true) + expect(isTerminalSessionStorageCapacityFailure(message)).toBe(false) + } + }) + + it('handles cyclic causes', () => { + const error = new Error('cycle') + error.cause = error + expect( + isTerminalSessionStorageCapacityFailure(createTerminalSessionStateSaveFailureMessage(error)) + ).toBe(false) + }) +}) diff --git a/src/shared/terminal-session-state-save-failure.ts b/src/shared/terminal-session-state-save-failure.ts index 309a98b653aa..c286cd568bd1 100644 --- a/src/shared/terminal-session-state-save-failure.ts +++ b/src/shared/terminal-session-state-save-failure.ts @@ -1,10 +1,18 @@ +import { storageCapacityErrorCode } from './storage-capacity-error' + export const TERMINAL_SESSION_STATE_SAVE_FAILED_CODE = 'ORCA_TERMINAL_SESSION_STATE_SAVE_FAILED' export const TERMINAL_SESSION_STATE_SAVE_FAILED_MESSAGE = - 'Orca could not save this terminal session because local storage is unavailable.' + 'Orca could not save this terminal session.' +const CAPACITY_MARKER = '[storage-capacity-exhausted]' + +export function createTerminalSessionStateSaveFailureMessage(error?: unknown): string { + const capacity = storageCapacityErrorCode(error) ? ` ${CAPACITY_MARKER}` : '' + return `${TERMINAL_SESSION_STATE_SAVE_FAILED_CODE}: ${TERMINAL_SESSION_STATE_SAVE_FAILED_MESSAGE}${capacity}` +} -export function createTerminalSessionStateSaveFailureMessage(): string { - return `${TERMINAL_SESSION_STATE_SAVE_FAILED_CODE}: ${TERMINAL_SESSION_STATE_SAVE_FAILED_MESSAGE}` +export function isTerminalSessionStorageCapacityFailure(message: string): boolean { + return isTerminalSessionStateSaveFailure(message) && message.includes(CAPACITY_MARKER) } export function isTerminalSessionStateSaveFailure(message: string): boolean { From 2ea3fb1d46cc585c6d7e58a5e3089bb03d389088 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 22:13:35 -0700 Subject: [PATCH 69/90] perf(ci): take advisory unit-selection evidence off the gate (#23776) selection_evidence is continue-on-error on both the job and its comparison step, so it can never fail a PR -- it downloads the shard reports, compares selection against the full results and uploads a review artifact. But a caller's `needs: test` waits for every job in the called workflow, so living inside unit-tests.yml it held verify for ~36s after the last shard finished. It moves to its own reusable workflow called as a sibling, so it still runs on every PR and still uploads its artifact, but verify no longer waits for it. It is deliberately absent from verify's needs, and a contract test pins both that and its advisory status so it cannot drift back onto the critical path. Measured on a recent run: the shards finished, then selection_evidence ran 36s, then verify 3s. Only the last of those gates anything. --- .github/workflows/pr.yml | 8 ++++ .github/workflows/unit-selection-evidence.yml | 41 +++++++++++++++++++ .github/workflows/unit-tests.yml | 29 ------------- .../scripts/pr-workflow-parallelism.test.mjs | 16 ++++++++ 4 files changed, 65 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/unit-selection-evidence.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2a4065bff474..795beca131e1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -667,6 +667,14 @@ jobs: runner: ubuntu-24.04-arm shards: ${{ needs.unit_plan.outputs.shards }} + # Why a sibling and not part of the test workflow: it is advisory, so it must not delay the + # gate. Inside unit-tests.yml a caller's `needs: test` waited for it, holding verify ~36s + # after the last shard. Deliberately absent from verify's needs for the same reason. + unit_selection_evidence: + needs: [test] + if: ${{ !cancelled() && needs.test.result == 'success' }} + uses: ./.github/workflows/unit-selection-evidence.yml + # Why a separate job: the test needs a real Chrome, and the sharded `test` matrix # would pay for it on every shard to run one file in whichever shard it landed in. orcad_browser: diff --git a/.github/workflows/unit-selection-evidence.yml b/.github/workflows/unit-selection-evidence.yml new file mode 100644 index 000000000000..4ff46be84d0f --- /dev/null +++ b/.github/workflows/unit-selection-evidence.yml @@ -0,0 +1,41 @@ +name: Unit selection evidence + +# Why its own workflow: this job is advisory -- `continue-on-error` on both the job and its +# comparison step, so it can never fail a PR. But a caller's `needs: test` waits for every job in +# the called workflow, so while it lived in unit-tests.yml it held `verify` for ~36s after the +# last shard finished. Called as a sibling instead, it still runs on every PR and still uploads +# its review artifact; it just no longer sits on the critical path. +on: + workflow_call: + +permissions: + contents: read + +jobs: + selection_evidence: + if: ${{ !cancelled() }} + continue-on-error: true + runs-on: ubuntu-slim + steps: + - uses: actions/checkout@v6 + with: + sparse-checkout: config/scripts/ci-unit-selection-review.mjs + sparse-checkout-cone-mode: false + persist-credentials: false + - uses: actions/setup-node@v6 + with: + node-version: '24' + - uses: actions/download-artifact@v8 + with: + pattern: unit-shard-node-*-attempt-${{ github.run_attempt }} + path: unit-evidence/ + - name: Compare selection with full results + continue-on-error: true + run: node config/scripts/ci-unit-selection-review.mjs unit-evidence + - uses: actions/upload-artifact@v7 + if: always() + continue-on-error: true + with: + name: unit-selection-review-attempt-${{ github.run_attempt }} + path: unit-evidence/selection-review.json + retention-days: 30 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 0090387b75cf..abe9cf28a413 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -75,35 +75,6 @@ jobs: retention-days: 14 if-no-files-found: warn - selection_evidence: - needs: test - if: ${{ !cancelled() }} - continue-on-error: true - runs-on: ubuntu-slim - steps: - - uses: actions/checkout@v6 - with: - sparse-checkout: config/scripts/ci-unit-selection-review.mjs - sparse-checkout-cone-mode: false - persist-credentials: false - - uses: actions/setup-node@v6 - with: - node-version: '24' - - uses: actions/download-artifact@v8 - with: - pattern: unit-shard-node-*-attempt-${{ github.run_attempt }} - path: unit-evidence/ - - name: Compare selection with full results - continue-on-error: true - run: node config/scripts/ci-unit-selection-review.mjs unit-evidence - - uses: actions/upload-artifact@v7 - if: always() - continue-on-error: true - with: - name: unit-selection-review-attempt-${{ github.run_attempt }} - path: unit-evidence/selection-review.json - retention-days: 30 - relay_integration: name: relay integration node ${{ matrix.node }} strategy: diff --git a/config/scripts/pr-workflow-parallelism.test.mjs b/config/scripts/pr-workflow-parallelism.test.mjs index 6054f0261444..ffd3e1c9fc97 100644 --- a/config/scripts/pr-workflow-parallelism.test.mjs +++ b/config/scripts/pr-workflow-parallelism.test.mjs @@ -501,6 +501,22 @@ describe('PR workflow parallelism', () => { } }) + it('keeps advisory unit-selection evidence off the gate', () => { + // It is continue-on-error, so it can never fail a PR. Living inside unit-tests.yml made a + // caller's `needs: test` wait for it anyway, holding verify ~36s past the last shard. Pinned + // here so it cannot drift back onto the critical path. + const evidence = workflow.jobs.unit_selection_evidence + expect(evidence.uses).toBe('./.github/workflows/unit-selection-evidence.yml') + expect(evidence.needs).toEqual(['test']) + expect(workflow.jobs.verify.needs).not.toContain('unit_selection_evidence') + expect(unitTestWorkflow.jobs.selection_evidence).toBeUndefined() + const evidenceWorkflow = parse( + readFileSync('.github/workflows/unit-selection-evidence.yml', 'utf8') + ) + const job = evidenceWorkflow.jobs.selection_evidence + expect(job['continue-on-error']).toBe(true) + }) + it('keeps verify as the aggregate required check', () => { expect(workflow.jobs.verify.needs).toEqual([ 'code_paths', From f6324f242adb3eed6153f0714901b37541b08ea2 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 22:15:36 -0700 Subject: [PATCH 70/90] chore(ci): stop auto-filing community PRs onto the project board (#23796) Removes the Track Community PRs workflow. Community pull requests will no longer be added to project stablyai/13 automatically. --- .github/workflows/homebrew-bump.yml | 9 +- .github/workflows/track-community-prs.yaml | 120 --------------------- 2 files changed, 4 insertions(+), 125 deletions(-) delete mode 100644 .github/workflows/track-community-prs.yaml diff --git a/.github/workflows/homebrew-bump.yml b/.github/workflows/homebrew-bump.yml index 9b04d3205fc4..a5f9b352f6e1 100644 --- a/.github/workflows/homebrew-bump.yml +++ b/.github/workflows/homebrew-bump.yml @@ -132,11 +132,10 @@ jobs: print(src) PY - # Why: reuse the existing buf0-bot GitHub App (also used by - # track-community-prs.yaml) instead of minting a new PAT. The app is - # installed org-wide, so it has access to stablyai/homebrew-orca - # automatically. GITHUB_TOKEN cannot push cross-repo; a short-lived - # installation token can. + # Why: reuse the existing buf0-bot GitHub App instead of minting a new + # PAT. The app is installed org-wide, so it has access to + # stablyai/homebrew-orca automatically. GITHUB_TOKEN cannot push + # cross-repo; a short-lived installation token can. - name: Generate buf0-bot token id: app-token uses: actions/create-github-app-token@v3 diff --git a/.github/workflows/track-community-prs.yaml b/.github/workflows/track-community-prs.yaml deleted file mode 100644 index 7a588663fb20..000000000000 --- a/.github/workflows/track-community-prs.yaml +++ /dev/null @@ -1,120 +0,0 @@ -name: Track Community PRs - -on: - pull_request_target: - types: [opened, reopened, ready_for_review] - workflow_dispatch: - inputs: - pr_number: - description: 'PR number to backfill or retry' - required: true - type: number - -permissions: - contents: read - -jobs: - track-community-pr: - # API-only bookkeeping fits the free single-CPU container runner. - runs-on: ubuntu-slim - timeout-minutes: 5 - steps: - - name: Generate bufo-bot token - id: app-token - uses: actions/create-github-app-token@v3 - with: - app-id: 2590194 - private-key: ${{ secrets.BUFO_BOT_PRIVATE_KEY }} - owner: stablyai - - - name: Add PR to project - uses: actions/github-script@v8 - env: - PROJECT_OWNER: stablyai - PROJECT_NUMBER: '13' - INTERNAL_TEAM_SLUG: stably-eng - with: - github-token: ${{ steps.app-token.outputs.token }} - script: | - const projectOwner = process.env.PROJECT_OWNER; - const projectNumber = Number(process.env.PROJECT_NUMBER); - const internalTeamSlug = process.env.INTERNAL_TEAM_SLUG; - const owner = context.repo.owner; - const repo = context.repo.repo; - - const prNumber = context.eventName === 'workflow_dispatch' - ? Number(context.payload.inputs.pr_number) - : context.payload.pull_request.number; - - const { data: pr } = await github.rest.pulls.get({ - owner, - repo, - pull_number: prNumber, - }); - - const author = pr.user.login; - - const skippedAuthors = new Set([ - 'github-actions[bot]', - 'dependabot[bot]', - ]); - - if (skippedAuthors.has(author)) { - core.info(`Skipping bot PR author ${author}.`); - return; - } - - let isInternalAuthor = false; - try { - const membership = await github.rest.teams.getMembershipForUserInOrg({ - org: projectOwner, - team_slug: internalTeamSlug, - username: author, - }); - isInternalAuthor = membership.data.state === 'active'; - } catch (error) { - if (error.status !== 404) { - throw error; - } - } - - if (isInternalAuthor) { - core.info(`Skipping internal PR author ${author}.`); - return; - } - - const projectResult = await github.graphql( - ` - query($owner: String!, $number: Int!) { - organization(login: $owner) { - projectV2(number: $number) { - id - } - } - } - `, - { owner: projectOwner, number: projectNumber }, - ); - - const projectId = projectResult.organization.projectV2.id; - - await github.graphql( - ` - mutation($projectId: ID!, $contentId: ID!) { - addProjectV2ItemById(input: { - projectId: $projectId, - contentId: $contentId - }) { - item { - id - } - } - } - `, - { - projectId, - contentId: pr.node_id, - }, - ); - - core.info(`Added PR #${pr.number} (${pr.html_url}) to project ${projectOwner}/${projectNumber}.`); From ceffecf12a0e98d3fabc4c2a632df2da283d58f3 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 22:49:03 -0700 Subject: [PATCH 71/90] fix(setup): remove wait-for-setup helper text (#23799) --- .../new-workspace/NewWorkspaceComposerAdvancedSection.tsx | 8 +------- .../components/settings/RepositoryHookPolicySettings.tsx | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/renderer/src/components/new-workspace/NewWorkspaceComposerAdvancedSection.tsx b/src/renderer/src/components/new-workspace/NewWorkspaceComposerAdvancedSection.tsx index f7b18f6ebaaf..55deb82b95bc 100644 --- a/src/renderer/src/components/new-workspace/NewWorkspaceComposerAdvancedSection.tsx +++ b/src/renderer/src/components/new-workspace/NewWorkspaceComposerAdvancedSection.tsx @@ -272,7 +272,7 @@ export function NewWorkspaceComposerAdvancedSection({
@@ -282,12 +282,6 @@ export function NewWorkspaceComposerAdvancedSection({ 'Wait for setup to complete before starting agent' )} - - {translate( - 'auto.components.NewWorkspaceComposerCard.waitForSetupBeforeAgentHelp', - 'Turn this on when setup installs dependencies, MCP servers, or config files the agent needs during startup.' - )} -
-
+
{translate( 'auto.components.settings.RepositoryHooksSection.waitForSetupBeforeAgent', 'Wait for setup to complete before starting agent' )}
-

- {translate( - 'auto.components.settings.RepositoryHooksSection.waitForSetupBeforeAgentHelp', - 'Turn this on when setup installs dependencies, MCP servers, or config files the agent needs during startup.' - )} -

Date: Mon, 28 Sep 2026 23:14:41 -0700 Subject: [PATCH 72/90] fix(native-chat): drop the Codex error path #23682 removed (#23801) #23682 established that only `turn/completed` ends a Codex turn and deleted `codex-structured-journal-provider-verdicts.ts`, but the child-turn reader kept importing `readCodexProviderVerdict` and branching on its `turn-failed` verdict. The module is gone, so the import resolves to nothing: typecheck and static analysis fail on every pull request, which skips the whole unit matrix behind them, and the esbuild pass behind Bun profile scope detection throws, so every run falls back to all six platforms. A closed thread is now the only child-turn end without `turn/completed`, which is what #23682 intended: Codex follows a turn-ending `error` with a failed `turn/completed` for the same turn 0-32 ms later, and that completion carries the duration and receipt time the error does not. --- .../codex/codex-background-task-frames.ts | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/main/codex/codex-background-task-frames.ts b/src/main/codex/codex-background-task-frames.ts index 65f51846c247..bb3ee27b0fac 100644 --- a/src/main/codex/codex-background-task-frames.ts +++ b/src/main/codex/codex-background-task-frames.ts @@ -7,7 +7,6 @@ import { import { codexChildTurnState } from './codex-subagent-executions' import { readRecord } from './codex-item-field-readers' import { readCodexThreadItem } from './codex-structured-item-translation' -import { readCodexProviderVerdict } from './codex-structured-journal-provider-verdicts' import { readCodexTurnId } from './codex-structured-thread-facts' export type CodexBackgroundTaskFrame = @@ -29,12 +28,10 @@ export type CodexBackgroundTaskFrame = /** A child turn that ended with no `turn/completed`. No `turnId`: the one it is running. */ kind: 'turn-ended' threadId: string - turnId: string | null - state: CodexChildTurnEnding + turnId: null + state: Extract } -type CodexChildTurnEnding = Extract - export type CodexBackgroundTaskEvent = { method: string threadId: string @@ -42,19 +39,14 @@ export type CodexBackgroundTaskEvent = { } /** - * The two ways Codex ends a child's turn without `turn/completed`. An `error` it will not retry is - * that turn's own end: the verdict the transcript settles the same turn on. A closed thread ran - * its last turn, and Codex never said how it went. A `systemError` status is neither: Codex raises - * it for errors that leave the turn running too (a refused steer), and a turn one ends also - * carries the `error`. + * The one way Codex ends a child's turn without `turn/completed`: a closed thread ran its last + * turn and Codex never said how it went. A turn-ending `error` is not one — Codex follows it with + * a failed `turn/completed` for the same turn, which is that turn's end and carries the duration + * and receipt time the error does not. */ function readCodexChildTurnEnding( event: CodexBackgroundTaskEvent ): CodexBackgroundTaskFrame | null { - if (readCodexProviderVerdict(event.method, event.params) === 'turn-failed') { - const turnId = readCodexTurnId(event.params) - return { kind: 'turn-ended', threadId: event.threadId, turnId, state: 'failed' } - } return event.method === 'thread/closed' ? { kind: 'turn-ended', threadId: event.threadId, turnId: null, state: 'unverifiable' } : null From 2d358df8afdad61efa158b30dfc6308c35b8ab2d Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 23:27:55 -0700 Subject: [PATCH 73/90] fix(i18n): prune the wait-for-setup help copy #23799 removed (#23802) #23799 removed both `waitForSetupBeforeAgentHelp` call sites but left the entry in all six locale catalogs. The runtime-required generator treats an entry with no literal-default call site as one only the catalog can serve, so the two dead entries had to ship in the boot bundle for the catalog check to pass, and `verify:localization-catalogs` failed on every pull request until they did. Deleting them is the resolution rather than regenerating `en-runtime-required.json`: no call site can reach either string, so shipping them would add dead weight to the boot bundle to satisfy a check about what the bundle must contain. The sibling `waitForSetupBeforeAgent` heading keys stay; #23799 removed only the help paragraphs. --- src/renderer/src/i18n/locales/en.json | 4 +--- src/renderer/src/i18n/locales/es.json | 4 +--- src/renderer/src/i18n/locales/fr.json | 4 +--- src/renderer/src/i18n/locales/ja.json | 4 +--- src/renderer/src/i18n/locales/ko.json | 4 +--- src/renderer/src/i18n/locales/zh.json | 4 +--- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index e44421a97324..9351961c28ab 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -1728,7 +1728,6 @@ "notConnected": "Not connected", "notePasteTooLarge": "Paste is too large for the note field.", "waitForSetupBeforeAgent": "Wait for setup to complete before starting agent", - "waitForSetupBeforeAgentHelp": "Turn this on when setup installs dependencies, MCP servers, or config files the agent needs during startup.", "destroyDisabled": "destroy disabled", "destroyConfigured": "destroy configured", "noDestroyConfigured": "no destroy", @@ -8055,8 +8054,7 @@ "81057d5f71": "Saving...", "da37d6f10e": "Copy", "3149964b66": "Copied", - "waitForSetupBeforeAgent": "Wait for setup to complete before starting agent", - "waitForSetupBeforeAgentHelp": "Turn this on when setup installs dependencies, MCP servers, or config files the agent needs during startup." + "waitForSetupBeforeAgent": "Wait for setup to complete before starting agent" }, "RepositoryIconPicker": { "2b7d27b93c": "Use {{value0}} repo color", diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 3e2132d6011a..e0e77e574ec9 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -1379,7 +1379,6 @@ "reuseExistingBranchHint": "Haz checkout de la rama existente en lugar de crear una nueva a partir de ella.", "createMultiple": "Crear más", "waitForSetupBeforeAgent": "Esperar a que termine el setup antes de iniciar el agente", - "waitForSetupBeforeAgentHelp": "Activa esto cuando el setup instale dependencias, servidores MCP o archivos de configuración que el agente necesita al iniciar.", "destroyDisabled": "destroy deshabilitado", "destroyConfigured": "destroy configurado", "noDestroyConfigured": "sin destroy", @@ -6804,8 +6803,7 @@ "81057d5f71": "Guardando...", "da37d6f10e": "Copiar", "3149964b66": "Copiado", - "waitForSetupBeforeAgent": "Espera a que se complete la configuración antes de iniciar el agente", - "waitForSetupBeforeAgentHelp": "Activa esto cuando la configuración instale dependencias, servidores MCP o archivos de configuración que el agente necesite durante el inicio." + "waitForSetupBeforeAgent": "Espera a que se complete la configuración antes de iniciar el agente" }, "RepositoryIconPicker": { "2b7d27b93c": "Usar {{value0}} como color del repositorio", diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json index 53ceaf15c39e..9a0f0d437c93 100644 --- a/src/renderer/src/i18n/locales/fr.json +++ b/src/renderer/src/i18n/locales/fr.json @@ -1706,7 +1706,6 @@ "notConnected": "Non connecté", "notePasteTooLarge": "Le contenu collé est trop volumineux pour le champ de note.", "waitForSetupBeforeAgent": "Attendre la fin du setup avant de démarrer l'agent", - "waitForSetupBeforeAgentHelp": "Activez cette option quand le setup installe des dépendances, des serveurs MCP ou des fichiers de configuration dont l'agent a besoin au démarrage.", "destroyDisabled": "destroy désactivé", "destroyConfigured": "destroy configuré", "noDestroyConfigured": "pas de destroy", @@ -7991,8 +7990,7 @@ "81057d5f71": "Enregistrement...", "da37d6f10e": "Copier", "3149964b66": "Copied", - "waitForSetupBeforeAgent": "Attendre la fin du setup avant de démarrer l'agent", - "waitForSetupBeforeAgentHelp": "Activez cette option quand le setup installe des dépendances, des serveurs MCP ou des fichiers de configuration dont l'agent a besoin au démarrage." + "waitForSetupBeforeAgent": "Attendre la fin du setup avant de démarrer l'agent" }, "RepositoryIconPicker": { "2b7d27b93c": "Utiliser la couleur de dépôt {{value0}}", diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 1b55d87552ac..6ec0e9c65e7e 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -1603,7 +1603,6 @@ "reuseExistingBranchHint": "既存のブランチから新規ブランチを作成せず、そのブランチをチェックアウトします。", "createMultiple": "さらに作成", "waitForSetupBeforeAgent": "セットアップが完了するまで待ってから Agent を開始してください", - "waitForSetupBeforeAgentHelp": "セットアップによって、起動時に Agent に必要な依存関係、MCP サーバー、または構成ファイルがインストールされるときに、これをオンにします。", "destroyDisabled": "破壊は無効です", "destroyConfigured": "設定されたものを破棄する", "noDestroyConfigured": "破壊しない", @@ -7872,8 +7871,7 @@ "81057d5f71": "保存中…", "da37d6f10e": "コピー", "3149964b66": "コピーしました", - "waitForSetupBeforeAgent": "セットアップが完了するまで待ってから Agent を開始してください", - "waitForSetupBeforeAgentHelp": "セットアップによって、起動時に Agent に必要な依存関係、MCP サーバー、または構成ファイルがインストールされるときに、これをオンにします。" + "waitForSetupBeforeAgent": "セットアップが完了するまで待ってから Agent を開始してください" }, "RepositoryIconPicker": { "2b7d27b93c": "{{value0}} リポジトリカラーを使用する", diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index a5aca8c17b6b..e5d5cac60fcc 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -1603,7 +1603,6 @@ "reuseExistingBranchHint": "기존 브랜치에서 새 브랜치를 만들지 않고 해당 브랜치를 체크아웃합니다.", "createMultiple": "더 만들기", "waitForSetupBeforeAgent": "agent를 시작하기 전에 설정이 완료될 때까지 기다리세요.", - "waitForSetupBeforeAgentHelp": "설치 프로그램이 시작 중에 agent에 필요한 종속성, MCP 서버 또는 구성 파일을 설치할 때 이 기능을 켜십시오.", "destroyDisabled": "비활성화된 파괴", "destroyConfigured": "구성된 파괴", "noDestroyConfigured": "파괴하지 마세요", @@ -7835,8 +7834,7 @@ "81057d5f71": "저장 중...", "da37d6f10e": "복사", "3149964b66": "복사됨", - "waitForSetupBeforeAgent": "agent를 시작하기 전에 설정이 완료될 때까지 기다리세요.", - "waitForSetupBeforeAgentHelp": "설치 프로그램이 시작 중에 agent에 필요한 종속성, MCP 서버 또는 구성 파일을 설치할 때 이 기능을 켜십시오." + "waitForSetupBeforeAgent": "agent를 시작하기 전에 설정이 완료될 때까지 기다리세요." }, "RepositoryIconPicker": { "2b7d27b93c": "{{value0}} repo 색상 사용", diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 47fefd2f0e36..d8a7ebf4561f 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -1603,7 +1603,6 @@ "reuseExistingBranchHint": "检出已有分支,而不是从它创建新分支。", "createMultiple": "创建更多", "waitForSetupBeforeAgent": "等待设置完成后再启动智能体", - "waitForSetupBeforeAgentHelp": "如果设置会安装依赖、MCP 服务器或智能体启动时需要的配置文件,请开启此选项。", "destroyDisabled": "已禁用销毁", "destroyConfigured": "已配置销毁", "noDestroyConfigured": "未配置销毁", @@ -7835,8 +7834,7 @@ "81057d5f71": "保存中...", "da37d6f10e": "复制", "3149964b66": "已复制", - "waitForSetupBeforeAgent": "等待设置完成后再启动智能体", - "waitForSetupBeforeAgentHelp": "如果设置会安装依赖、MCP 服务器或智能体启动时需要的配置文件,请开启此选项。" + "waitForSetupBeforeAgent": "等待设置完成后再启动智能体" }, "RepositoryIconPicker": { "2b7d27b93c": "使用 {{value0}} 仓库颜色", From 25d9c57e3a4f172b66d3d1fd91db23993dbc2688 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Mon, 28 Sep 2026 23:42:01 -0700 Subject: [PATCH 74/90] fix(native-chat): keep a child turn settling on an error Codex will not retry (#23808) #23801 removed the child-path reading of Codex's turn-ending `error` along with the import of the module #23682 deleted. That was the wrong half to remove: the primary journal path can rely on Codex's failed `turn/completed` arriving within ~32 ms, which is what #23682 established, but a child turn has no such guarantee, and without the error as its end the child's lifecycle row latches on `working` for the life of the session. Three tests assert exactly that and could not run, because the unresolved import had been skipping the unit matrix since #23682 merged. The reading is restored inline against `readCodexErrorWillRetry`, itself restored to `codex-structured-thread-facts.ts`, rather than by reviving the deleted module: its `thread-stopped-running` arm lost its only consumer when #23682 rewrote the primary path, so restoring the file would re-add dead code. Also drops `pr-workflow-parallelism.test.mjs`'s read of `.github/workflows/track-community-prs.yaml`, which #23796 deleted while leaving the assertion behind. Same failure class, and it fails the same shard. --- .../scripts/pr-workflow-parallelism.test.mjs | 2 -- .../codex/codex-background-task-frames.ts | 24 +++++++++++++------ .../codex/codex-structured-thread-facts.ts | 8 +++++++ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/config/scripts/pr-workflow-parallelism.test.mjs b/config/scripts/pr-workflow-parallelism.test.mjs index ffd3e1c9fc97..dde93505193d 100644 --- a/config/scripts/pr-workflow-parallelism.test.mjs +++ b/config/scripts/pr-workflow-parallelism.test.mjs @@ -7,7 +7,6 @@ import { MOBILE_WEB_APP_DEPENDENCIES_REQUIRED_ENV } from './mobile-web-app-bundl const workflow = parse(readFileSync('.github/workflows/pr.yml', 'utf8')) const prTestLocWorkflow = parse(readFileSync('.github/workflows/pr-test-loc.yml', 'utf8')) -const trackingWorkflow = parse(readFileSync('.github/workflows/track-community-prs.yaml', 'utf8')) const releasePolicyWorkflow = parse(readFileSync('.github/workflows/release-policy.yml', 'utf8')) const issueLabelWorkflow = parse(readFileSync('.github/workflows/issue-os-labeler.yaml', 'utf8')) const unitTestWorkflow = parse(readFileSync('.github/workflows/unit-tests.yml', 'utf8')) @@ -55,7 +54,6 @@ describe('PR workflow parallelism', () => { expect(workflow.jobs.typecheck['runs-on']).toBe('ubuntu-24.04-arm') expect(workflow.jobs.verify['runs-on']).toBe('ubuntu-slim') expect(prTestLocWorkflow.jobs.loc['runs-on']).toBe('ubuntu-slim') - expect(trackingWorkflow.jobs['track-community-pr']['runs-on']).toBe('ubuntu-slim') expect(releasePolicyWorkflow.jobs.enforce['runs-on']).toBe('ubuntu-slim') expect(issueLabelWorkflow.jobs['apply-os-label']['runs-on']).toBe('ubuntu-slim') }) diff --git a/src/main/codex/codex-background-task-frames.ts b/src/main/codex/codex-background-task-frames.ts index bb3ee27b0fac..029cc7b50c77 100644 --- a/src/main/codex/codex-background-task-frames.ts +++ b/src/main/codex/codex-background-task-frames.ts @@ -7,7 +7,7 @@ import { import { codexChildTurnState } from './codex-subagent-executions' import { readRecord } from './codex-item-field-readers' import { readCodexThreadItem } from './codex-structured-item-translation' -import { readCodexTurnId } from './codex-structured-thread-facts' +import { readCodexErrorWillRetry, readCodexTurnId } from './codex-structured-thread-facts' export type CodexBackgroundTaskFrame = | { @@ -28,10 +28,12 @@ export type CodexBackgroundTaskFrame = /** A child turn that ended with no `turn/completed`. No `turnId`: the one it is running. */ kind: 'turn-ended' threadId: string - turnId: null - state: Extract + turnId: string | null + state: CodexChildTurnEnding } +type CodexChildTurnEnding = Extract + export type CodexBackgroundTaskEvent = { method: string threadId: string @@ -39,14 +41,22 @@ export type CodexBackgroundTaskEvent = { } /** - * The one way Codex ends a child's turn without `turn/completed`: a closed thread ran its last - * turn and Codex never said how it went. A turn-ending `error` is not one — Codex follows it with - * a failed `turn/completed` for the same turn, which is that turn's end and carries the duration - * and receipt time the error does not. + * The two ways Codex ends a child's turn without `turn/completed`. An `error` it will not retry is + * that turn's own end: for a child, `turn/completed` may never follow, and without this end the + * child's lifecycle row latches on `working` for the life of the session. A closed thread ran its + * last turn, and Codex never said how it went. + * + * #23682 dropped the equivalent reading from the primary journal path, where Codex's own failed + * `turn/completed` always follows within ~32 ms and carries the duration the error lacks. A child + * has no such guarantee, which is why this path still settles on the error. */ function readCodexChildTurnEnding( event: CodexBackgroundTaskEvent ): CodexBackgroundTaskFrame | null { + if (event.method === 'error' && !readCodexErrorWillRetry(event.params)) { + const turnId = readCodexTurnId(event.params) + return { kind: 'turn-ended', threadId: event.threadId, turnId, state: 'failed' } + } return event.method === 'thread/closed' ? { kind: 'turn-ended', threadId: event.threadId, turnId: null, state: 'unverifiable' } : null diff --git a/src/main/codex/codex-structured-thread-facts.ts b/src/main/codex/codex-structured-thread-facts.ts index f2a42e6d3dbf..aaf65f93ec6e 100644 --- a/src/main/codex/codex-structured-thread-facts.ts +++ b/src/main/codex/codex-structured-thread-facts.ts @@ -65,6 +65,14 @@ export function readCodexTurnDurationMs(payload: unknown): number | null { /** `thread/status/changed` carries a TAGGED status (`{status:{type}}`), never a * bare string. `idle` and `systemError` are the two arms that mean the thread * is not running; `active` and `notLoaded` are not. */ +/** + * Codex hardcodes `willRetry: false` on an `error` that affects turn status, and `true` on a + * stream error it is about to retry, which ends nothing. + */ +export function readCodexErrorWillRetry(payload: unknown): boolean { + return record(payload)?.willRetry === true +} + export function codexThreadStoppedRunning(payload: unknown): boolean { const type = record(record(payload)?.status)?.type return type === 'idle' || type === 'systemError' From 5560e534ff77657196eb3c0f44de59b998ad2c24 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2026 06:47:59 +0000 Subject: [PATCH 75/90] Update README downloads badge --- docs/assets/readme-downloads.svg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/assets/readme-downloads.svg b/docs/assets/readme-downloads.svg index 9fbda727d28f..af45e38a72cd 100644 --- a/docs/assets/readme-downloads.svg +++ b/docs/assets/readme-downloads.svg @@ -1,5 +1,5 @@ - - downloads: 82m + + downloads: 83m @@ -15,7 +15,7 @@ downloads downloads - 82m - 82m + 83m + 83m From f8f656ca191110d0aeb5e6183a70799fee78f120 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:13:33 -0700 Subject: [PATCH 76/90] perf(ci): spend fewer concurrency slots per pull request (#23810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A concurrency slot is charged per job, not per core, and the account's cap is the scarce resource: standard runner minutes are free and unlimited on a public repository. Two paths spent slots that bought nothing. The unit matrix ran eight fixed shards averaging 6.5 minutes each, 3384 job-slots a day and 68% of all slot demand, while the arm pool queued 10.5 minutes at p95 — the queue was the oversharding. Five shards run the same work in ~10.5 minutes each for three fewer slots per run. Bun profile persistence escalated to all six platforms on `config/`, `resources/` and `.github/` wholesale, which took 36.5% of the last 1100 commits through the full matrix where a platform-flavoured predicate takes 19%. A pull request now qualifies one platform unless the change is platform- flavoured, and the push to main re-qualifies all six, so an unescalated miss surfaces minutes after merge rather than at the next cron. Missing changed-file evidence and an unavailable dependency graph still fail closed to all six. --- .github/workflows/bun-profile-tests.yml | 24 +++++++++++- config/scripts/bun-profile-change-scope.mjs | 8 +--- .../scripts/bun-profile-change-scope.test.mjs | 7 ++++ config/scripts/bun-profile-qualification.mjs | 27 ++++++------- .../bun-profile-qualification.test.mjs | 39 ++++++++++++------- config/scripts/ci-unit-plan.mjs | 7 +++- config/scripts/ci-unit-plan.test.mjs | 3 +- config/scripts/ci-unit-selection.mjs | 10 ++++- config/scripts/ci-unit-selection.test.mjs | 18 ++++++++- docs/reference/ci-demand-rollout.md | 5 ++- 10 files changed, 105 insertions(+), 43 deletions(-) diff --git a/.github/workflows/bun-profile-tests.yml b/.github/workflows/bun-profile-tests.yml index 5fae18f2f84e..1a292292510c 100644 --- a/.github/workflows/bun-profile-tests.yml +++ b/.github/workflows/bun-profile-tests.yml @@ -17,6 +17,24 @@ on: - '.pnpmfile.cjs' - '.github/actions/install-node-dependencies/**' - '.github/workflows/bun-profile-tests.yml' + # The pull request qualifies one platform for an unflavoured change; this is where all six + # are re-qualified, so a platform break surfaces minutes after merge instead of next cron. + push: + branches: [main] + paths: + - 'src/**' + - 'config/**' + - 'native/**' + - 'tests/**' + - 'resources/**' + - 'package.json' + - 'pnpm-lock.yaml' + - 'pnpm-workspace.yaml' + - 'tsconfig.json' + - '.npmrc' + - '.pnpmfile.cjs' + - '.github/actions/install-node-dependencies/**' + - '.github/workflows/bun-profile-tests.yml' workflow_dispatch: schedule: - cron: '30 11 * * *' @@ -57,7 +75,11 @@ jobs: persistence: needs: changes # Missing/failed detection runs the full matrix; manual runs remain unconditional. - if: ${{ !cancelled() && needs.changes.outputs.should_run != 'false' }} + # A draft carries no platform verdict; readiness re-triggers this workflow. Spelled against + # the event name so the push and schedule paths do not rest on a null property comparison. + if: >- + ${{ !cancelled() && needs.changes.outputs.should_run != 'false' && + (github.event_name != 'pull_request' || github.event.pull_request.draft != true) }} strategy: fail-fast: false matrix: diff --git a/config/scripts/bun-profile-change-scope.mjs b/config/scripts/bun-profile-change-scope.mjs index 7b8b47b69aa4..dc464a5dc030 100644 --- a/config/scripts/bun-profile-change-scope.mjs +++ b/config/scripts/bun-profile-change-scope.mjs @@ -125,13 +125,7 @@ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) const changedFiles = readFileSync(process.argv[2], 'utf8').split('\0').filter(Boolean) const result = await classifyBunProfileChanges(changedFiles) console.log(result.reason) - let event = {} - try { - event = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8')) - } catch { - // Missing event evidence retains full qualification. - } - const policy = bunProfileQualification(changedFiles, result, event) + const policy = bunProfileQualification(changedFiles, result) const output = `should_run=${result.shouldRun}\nqualification=${policy.qualification}\nrunners=${JSON.stringify(policy.runners)}\n` if (process.env.GITHUB_OUTPUT) { appendFileSync(process.env.GITHUB_OUTPUT, output) diff --git a/config/scripts/bun-profile-change-scope.test.mjs b/config/scripts/bun-profile-change-scope.test.mjs index e813be936214..ef21fed5e344 100644 --- a/config/scripts/bun-profile-change-scope.test.mjs +++ b/config/scripts/bun-profile-change-scope.test.mjs @@ -143,6 +143,13 @@ it('keeps all ten platform jobs and runs them when detection is skipped or fails expect(detect.run).toContain('git diff --name-only --no-renames -z HEAD^1 HEAD') expect(workflow.on.pull_request.types).toContain('ready_for_review') expect(workflow.on.schedule).toHaveLength(1) + // A pull request may qualify one platform, so the merged commit must re-qualify all six. + expect(workflow.on.push.branches).toEqual(['main']) + expect(workflow.on.push.paths).toEqual(workflow.on.pull_request.paths) + // The push and schedule paths must not rest on a null property comparison. + expect(workflow.jobs.persistence.if).toContain( + "github.event_name != 'pull_request' || github.event.pull_request.draft != true" + ) expect(workflow.jobs.persistence.strategy.matrix.os).toContain('needs.changes.outputs.runners') for (const jobName of ['linux_glibc_floor', 'linux_musl']) { const job = workflow.jobs[jobName] diff --git a/config/scripts/bun-profile-qualification.mjs b/config/scripts/bun-profile-qualification.mjs index 799f459ff852..dafd137f95e2 100644 --- a/config/scripts/bun-profile-qualification.mjs +++ b/config/scripts/bun-profile-qualification.mjs @@ -7,34 +7,35 @@ export const BUN_PERSISTENCE_RUNNERS = [ 'windows-11-arm' ] -const QUALIFICATION_PREFIXES = [ - 'config/', +// Only surfaces whose behaviour actually differs per platform. Escalating on `config/`, +// `resources/` and `.github/` wholesale took 36.5% of the last 1100 commits through all six +// platforms where a platform-flavoured predicate takes 19%. +const PLATFORM_PREFIXES = [ 'native/', - 'resources/', - '.github/', + 'config/patches/', + '.github/actions/install-node-dependencies/', 'src/main/persistence/', 'src/main/sqlite/', 'src/main/orcad/', 'src/main/providers/', 'src/main/daemon/', 'src/main/ssh/', + 'src/main/wsl/', 'src/relay/', 'src/shared/child-process/' ] -export function bunProfileQualification(changedFiles, scope, event = {}) { - const sensitive = changedFiles.some( +export function bunProfileQualification(changedFiles, scope) { + const platformSpecific = changedFiles.some( (file) => + // A root manifest can move a native dependency on every platform at once. !file.includes('/') || - QUALIFICATION_PREFIXES.some((prefix) => file.startsWith(prefix)) || + PLATFORM_PREFIXES.some((prefix) => file.startsWith(prefix)) || /(?:^|[/.-])(?:windows|win32|wsl|macos|darwin|linux|posix|bun)(?:[/.-]|$)/i.test(file) ) - // Only a proven unrelated platform change in a draft may defer qualification. - const full = - event.pull_request?.draft !== true || - changedFiles.length === 0 || - scope.graphUnavailable === true || - sensitive + // A pull request qualifies one platform unless the change is platform-flavoured; the push to + // main re-qualifies all six, so an unescalated miss surfaces minutes after merge, not a day. + const full = changedFiles.length === 0 || scope.graphUnavailable === true || platformSpecific return { qualification: full, runners: full ? BUN_PERSISTENCE_RUNNERS : ['ubuntu-22.04'] diff --git a/config/scripts/bun-profile-qualification.test.mjs b/config/scripts/bun-profile-qualification.test.mjs index 9ebc5e437e1f..520cd76fb213 100644 --- a/config/scripts/bun-profile-qualification.test.mjs +++ b/config/scripts/bun-profile-qualification.test.mjs @@ -1,22 +1,32 @@ import { expect, it } from 'vitest' import { BUN_PERSISTENCE_RUNNERS, bunProfileQualification } from './bun-profile-qualification.mjs' -const draft = { pull_request: { draft: true } } const scope = { shouldRun: true } -it('defers only platform qualification for ordinary draft runtime changes', () => { - expect( - bunProfileQualification(['src/main/runtime/rpc/methods/example.ts'], scope, draft) - ).toEqual({ +it('qualifies one platform for a change no platform can alter', () => { + expect(bunProfileQualification(['src/main/runtime/rpc/methods/example.ts'], scope)).toEqual({ qualification: false, runners: ['ubuntu-22.04'] }) }) +it.each([ + 'src/renderer/src/components/TabStrip.tsx', + 'config/vitest.config.ts', + 'config/scripts/ci-unit-plan.mjs', + 'resources/icons/tray.png', + '.github/workflows/pr.yml', + 'docs/reference/agent-status-store.md' +])('keeps one platform for unflavoured input %s', (file) => { + expect(bunProfileQualification([file], scope).runners).toEqual(['ubuntu-22.04']) +}) + it.each([ 'package.json', + 'pnpm-lock.yaml', 'native/windows-registry/src/addon.cc', - 'config/vitest.config.ts', + 'config/patches/node-pty.patch', + '.github/actions/install-node-dependencies/action.yml', 'src/main/ssh/ssh-provider.ts', 'src/main/providers/local-pty-provider.ts', 'src/shared/child-process/run-process.ts', @@ -28,20 +38,19 @@ it.each([ 'src/main/daemon/entry.ts', 'src/relay/index.ts', 'src/main/wsl/runner.ts' -])('retains all platforms for sensitive input %s', (file) => { - expect(bunProfileQualification([file], scope, draft)).toEqual({ +])('retains all platforms for platform-flavoured input %s', (file) => { + expect(bunProfileQualification([file], scope)).toEqual({ qualification: true, runners: BUN_PERSISTENCE_RUNNERS }) }) -it('qualifies every ready commit, scheduled/manual runs and incomplete evidence', () => { - const paths = ['src/main/runtime/rpc/methods/example.ts'] - for (const event of [{}, { pull_request: { draft: false } }]) { - expect(bunProfileQualification(paths, scope, event).qualification).toBe(true) - } - expect(bunProfileQualification([], scope, draft).qualification).toBe(true) +it('fails closed to every platform when the evidence is incomplete', () => { + expect(bunProfileQualification([], scope).qualification).toBe(true) expect( - bunProfileQualification(paths, { ...scope, graphUnavailable: true }, draft).qualification + bunProfileQualification(['src/main/runtime/rpc/methods/example.ts'], { + ...scope, + graphUnavailable: true + }).qualification ).toBe(true) }) diff --git a/config/scripts/ci-unit-plan.mjs b/config/scripts/ci-unit-plan.mjs index 28eed60f8e89..db7a13070d01 100644 --- a/config/scripts/ci-unit-plan.mjs +++ b/config/scripts/ci-unit-plan.mjs @@ -3,7 +3,7 @@ import { pathToFileURL } from 'node:url' import { runProcessSync } from './script-child-process.mjs' import { collectUnitDependencyGraph } from './ci-unit-dependency-graph.mjs' import { discoverUnitFiles } from './ci-unit-files.mjs' -import { planUnitSelection } from './ci-unit-selection.mjs' +import { FULL_SHARD_COUNT, planUnitSelection } from './ci-unit-selection.mjs' import { readTimingBaseline, writeAssignment } from './ci-shard-assignment.mjs' export function prepareUnitPlan(env = process.env) { @@ -39,7 +39,10 @@ export function prepareUnitPlan(env = process.env) { files, candidateFiles: files, executionFiles: files, - shards: Array.from({ length: 8 }, (_, index) => ({ index: index + 1, count: 8 })) + shards: Array.from({ length: FULL_SHARD_COUNT }, (_, index) => ({ + index: index + 1, + count: FULL_SHARD_COUNT + })) } } writeAssignment('ci-shards/unit-selection.json', plan) diff --git a/config/scripts/ci-unit-plan.test.mjs b/config/scripts/ci-unit-plan.test.mjs index 1711582b64f8..eda7903ae1de 100644 --- a/config/scripts/ci-unit-plan.test.mjs +++ b/config/scripts/ci-unit-plan.test.mjs @@ -4,6 +4,7 @@ import { join } from 'node:path' import { fileURLToPath } from 'node:url' import { expect, it } from 'vitest' import { runProcessSync } from './script-child-process.mjs' +import { FULL_SHARD_COUNT } from './ci-unit-selection.mjs' it.each([true, false])( 'plans from a real Git diff, with parent evidence available: %s', @@ -70,7 +71,7 @@ it.each([true, false])( ? 'Transitive imports plus indirect-input consumers' : 'Error: Changed paths unavailable' ) - expect(plan.shards).toHaveLength(withParent ? 1 : 8) + expect(plan.shards).toHaveLength(withParent ? 1 : FULL_SHARD_COUNT) } finally { rmSync(root, { recursive: true, force: true }) } diff --git a/config/scripts/ci-unit-selection.mjs b/config/scripts/ci-unit-selection.mjs index 70894dde0a16..841bad422e70 100644 --- a/config/scripts/ci-unit-selection.mjs +++ b/config/scripts/ci-unit-selection.mjs @@ -27,14 +27,20 @@ export function selectUnitFiles(files, changed, graph) { } } +// A concurrency slot is charged per job, not per core, so eight 6.5-minute shards cost eight of +// the account's slots and made the unit matrix 68% of daily slot demand. Against the checked-in +// baseline, five shards each carry 24.7 test-minutes over four workers plus ~2.6 minutes of fixed +// setup, so ~8.8 minutes -- less than the 10.5-minute p95 queue the oversharding was causing. +export const FULL_SHARD_COUNT = 5 + export function planUnitSelection({ files, changed, graph, timings, event, mode = 'shadow' }) { const candidate = selectUnitFiles(files, changed, graph) const selected = mode === 'selected' && event?.pull_request?.draft === true && !candidate.full const executionFiles = selected ? candidate.files : files const totalMs = balanceFiles(executionFiles, 1, timings).shards[0].durationMs const count = selected - ? Math.max(1, Math.min(8, Math.ceil(totalMs / 900_000), executionFiles.length)) - : 8 + ? Math.max(1, Math.min(FULL_SHARD_COUNT, Math.ceil(totalMs / 900_000), executionFiles.length)) + : FULL_SHARD_COUNT return { version: 1, mode: selected ? 'selected' : 'shadow', diff --git a/config/scripts/ci-unit-selection.test.mjs b/config/scripts/ci-unit-selection.test.mjs index 37338cbfc6de..69370a675f6e 100644 --- a/config/scripts/ci-unit-selection.test.mjs +++ b/config/scripts/ci-unit-selection.test.mjs @@ -1,6 +1,11 @@ import { describe, expect, it } from 'vitest' import { buildUnitDependencyGraph } from './ci-unit-dependency-graph.mjs' -import { auditUnitSelection, planUnitSelection, selectUnitFiles } from './ci-unit-selection.mjs' +import { + FULL_SHARD_COUNT, + auditUnitSelection, + planUnitSelection, + selectUnitFiles +} from './ci-unit-selection.mjs' const sources = new Map( Object.entries({ @@ -79,6 +84,17 @@ describe('conservative unit selection', () => { expect(selected.shards).toEqual([{ index: 1, count: 1 }]) }) + it('spends five concurrency slots on a full run', () => { + const plan = planUnitSelection({ files, changed: ['src/leaf.ts'], graph, timings: {} }) + expect(plan.shards).toEqual( + Array.from({ length: FULL_SHARD_COUNT }, (_, index) => ({ + index: index + 1, + count: FULL_SHARD_COUNT + })) + ) + expect(FULL_SHARD_COUNT).toBe(5) + }) + it('records failures that would have been missed while shadow runs remain full', () => { const plan = planUnitSelection({ files, changed: ['src/leaf.ts'], graph, timings: {} }) expect( diff --git a/docs/reference/ci-demand-rollout.md b/docs/reference/ci-demand-rollout.md index 8219a3401cb7..081d276c4bfc 100644 --- a/docs/reference/ci-demand-rollout.md +++ b/docs/reference/ci-demand-rollout.md @@ -45,7 +45,10 @@ suite. A shard verifies the plan's source SHA and complete discovery list before using it. Missing/stale artifacts fall back to full coverage, even if that means running the suite on fewer shards. -The initial policy is **shadow**, with all eight shards retained. The first +The initial policy is **shadow**, with every shard retained. A full run spends +`FULL_SHARD_COUNT` (five) concurrency slots: the account is charged a slot per job +rather than per core, so eight 6.5-minute shards made this matrix 68% of daily slot +demand while the arm pool queued 10.5 minutes at p95. The first local inventory matched Vitest exactly (9,950 files at validation); representative source changes retained roughly 88% of files because of indirect input readers. That is evidence for conservative coverage, not evidence of the analysis's From 33f661b745ca1e138ed0421e7f6696bc5112306c Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:31:51 -0700 Subject: [PATCH 77/90] fix(native-chat): an empty workspace opens the default agent as a chat when chat is the default view (#23693) * fix(native-chat): an empty workspace opens the default agent as a chat when chat is the default view With "open agent tabs in chat" on, clicking a workspace with no tabs still seeded a bare shell. The seeding path now opens the user's default agent through the shared launch funnel when that launch routes to a chat, and keeps the shell otherwise. A Blank Terminal pick at create time is now passed to activation as agent: null so it still gets a shell. * fix(native-chat): only a deliberate workspace open starts the default agent chat Round-1 review of the empty-workspace default chat: activation treated any call with no agent and no caller surface as user navigation, so CLI/phone creates, fallbacks after a failed agent launch, fork fallbacks, and the move to a neighbour after a delete all opened an agent chat nobody picked. - Opt in instead: activation options gain navigationIntent: 'user-open', set only by user navigation (sidebar row, keyboard cycling, Cmd+J, the workspace digit shortcut, back/forward, open-parent, jump-to-workspace, and the open-attached-workspace / space-manager actions). Every other activation keeps today's shell, so the Blank Terminal pass-through in the create flow is no longer needed and is reverted. - The Electron gated reseed now waits (bounded, 5 s) for the workspace host's agent list when it has not loaded, holding a per-workspace claim that the passive seed and other reseeds respect, then re-checks the active workspace, host, and emptiness. Host resolution reuses the detection target key, so an unresolved owner stays unknown. - Tests cover the gated path for worktrees and folders, non-opted activations, history navigation, the detection wait and its failure, and the passive seed deferring to the claim. * fix(native-chat): a reopen during the agent-list wait seeds for the latest open Round-2 review of the empty-workspace default chat: while a user open waited for the host's agent list, a second activation of the same workspace was dropped. Opening A from the sidebar, moving to B, then pressing Back to A during the wait left A active with no chat and no shell: the wait reseeded with the first open's host id, which no longer matched, and the passive seed had already marked A handled. - The pending wait now stores the latest activation's intent; a later activation (user open or plain) replaces it, and the wait seeds with it. - The passive seed no longer marks a workspace handled while a wait owns it, so leaving mid-wait and returning seeds a shell instead of nothing. - The wait and the open share one check, so a Blank Terminal default (or chat not being the default view) no longer waits up to 5 s before its shell. --- .../components/WorktreeJumpPalette.test.tsx | 3 + .../activity/activity-thread-actions.test.ts | 1 + .../editor/CheckRunDetailsPanel.copy.test.tsx | 1 + .../components/editor/IpynbRendering.test.tsx | 5 +- ...nPreview.link-routing.interaction.test.tsx | 5 +- ...rkdownPreview.toc-visibility-gate.test.tsx | 5 +- .../open-dialog/github-item-dialog.tsx | 4 +- .../pull-request-page/page/surface.tsx | 4 +- ...rktreeContextMenu.delete-shortcut.test.tsx | 1 + .../sleep-worktree-activation-race.test.ts | 2 + .../use-worktree-context-menu-commands.ts | 2 +- .../navigation/use-keyboard.focus.test.tsx | 5 +- .../use-keyboard.host-identity.test.tsx | 6 +- .../worktree-list/navigation/use-keyboard.ts | 8 +- ...rtsStatusSegment.render-stability.test.tsx | 1 + .../ResourceUsageStatusSegment.rows.test.tsx | 1 + ...pace-space-manager-source-boundary.test.ts | 2 +- .../workspace-space-manager-table.tsx | 6 +- ...k-page-workspace-composer-boundary.test.ts | 2 +- ...nitial-terminal-structured-launch.test.tsx | 36 ++ .../use-task-page-workspace-actions.ts | 4 +- .../use-terminal-watcher-effects.ts | 6 + ...worktree-jump-palette-selection-actions.ts | 8 +- .../workspace-shortcut-ipc-bridge.ts | 9 +- .../useIpcEvents-cmd-j-digit-chord.test.ts | 5 +- ...agent-launch-caller-profile-census.test.ts | 3 +- ...ent-launch-caller-profiles-test-harness.ts | 15 + ...agent-launch-routing-caller-census.test.ts | 1 + ...empty-workspace-default-agent-chat.test.ts | 154 ++++++++ .../lib/empty-workspace-default-agent-chat.ts | 113 ++++++ .../empty-workspace-default-surface-claims.ts | 29 ++ .../src/lib/launch-agent-in-new-tab.ts | 4 + .../lib/linear-issue-workspace-open.test.ts | 2 + .../src/lib/linear-issue-workspace-open.ts | 16 +- .../lib/sidebar-worktree-activation.test.ts | 7 +- .../src/lib/sidebar-worktree-activation.ts | 12 +- ...tree-activation-default-agent-chat.test.ts | 362 ++++++++++++++++++ .../worktree-activation-gated-empty-reseed.ts | 50 ++- .../worktree-activation-nav-registration.ts | 5 +- .../lib/worktree-activation-store-contract.ts | 3 + .../worktree-activation-surface-selection.ts | 13 + src/renderer/src/lib/worktree-activation.ts | 39 +- .../lib/worktree-initial-terminal-seeding.ts | 26 +- .../src/lib/worktree-jump-navigation.test.ts | 11 +- .../src/lib/worktree-jump-navigation.ts | 1 + 45 files changed, 918 insertions(+), 80 deletions(-) create mode 100644 src/renderer/src/lib/empty-workspace-default-agent-chat.test.ts create mode 100644 src/renderer/src/lib/empty-workspace-default-agent-chat.ts create mode 100644 src/renderer/src/lib/empty-workspace-default-surface-claims.ts create mode 100644 src/renderer/src/lib/worktree-activation-default-agent-chat.test.ts diff --git a/src/renderer/src/components/WorktreeJumpPalette.test.tsx b/src/renderer/src/components/WorktreeJumpPalette.test.tsx index 0881dd10d783..cfe5de958320 100644 --- a/src/renderer/src/components/WorktreeJumpPalette.test.tsx +++ b/src/renderer/src/components/WorktreeJumpPalette.test.tsx @@ -421,6 +421,7 @@ describe('WorktreeJumpPalette', () => { // The first row names ITS OWN host — the wrong-host open is gone. await act(async () => fireEvent.click(rows[0]!)) expect(activateAndRevealWorktree).toHaveBeenLastCalledWith('shared', { + navigationIntent: 'user-open', executionHostId: 'local' }) }) @@ -443,6 +444,7 @@ describe('WorktreeJumpPalette', () => { await act(async () => fireEvent.click(rows[1]!)) expect(activateAndRevealWorktree).toHaveBeenLastCalledWith('shared', { + navigationIntent: 'user-open', executionHostId: 'ssh:box' }) }) @@ -487,6 +489,7 @@ describe('WorktreeJumpPalette', () => { await act(async () => fireEvent.click(hubARow!)) expect(activateAndRevealWorktree).toHaveBeenLastCalledWith('shared-runtime', { + navigationIntent: 'user-open', executionHostId: 'runtime:hub-a' }) }) diff --git a/src/renderer/src/components/activity/activity-thread-actions.test.ts b/src/renderer/src/components/activity/activity-thread-actions.test.ts index f9baff7d60dd..ce546f036970 100644 --- a/src/renderer/src/components/activity/activity-thread-actions.test.ts +++ b/src/renderer/src/components/activity/activity-thread-actions.test.ts @@ -258,6 +258,7 @@ describe('activity thread host routing', () => { expect(acknowledgeAgents).toHaveBeenCalledWith([thread.paneKey]) expect(mocks.activateAndRevealWorkspace).toHaveBeenCalledWith(thread.worktree.id, { + navigationIntent: 'user-open', executionHostId: REMOTE_HOST }) }) diff --git a/src/renderer/src/components/editor/CheckRunDetailsPanel.copy.test.tsx b/src/renderer/src/components/editor/CheckRunDetailsPanel.copy.test.tsx index 23bc3d51c593..826b63ef4af7 100644 --- a/src/renderer/src/components/editor/CheckRunDetailsPanel.copy.test.tsx +++ b/src/renderer/src/components/editor/CheckRunDetailsPanel.copy.test.tsx @@ -9,6 +9,7 @@ import { CheckRunDetailsPanel } from './CheckRunDetailsPanel' const writeClipboardText = vi.fn<(text: string) => Promise>() vi.mock('@/i18n/i18n', () => ({ + i18n: { language: 'en' }, translate: (_key: string, fallback: string) => fallback })) diff --git a/src/renderer/src/components/editor/IpynbRendering.test.tsx b/src/renderer/src/components/editor/IpynbRendering.test.tsx index 2086e6b1878b..593104e23005 100644 --- a/src/renderer/src/components/editor/IpynbRendering.test.tsx +++ b/src/renderer/src/components/editor/IpynbRendering.test.tsx @@ -7,7 +7,10 @@ import { IpynbRunPrompt } from './IpynbCellToolbar' import { TooltipProvider } from '@/components/ui/tooltip' import type { IpynbCell, IpynbOutput } from './ipynb-parse' -vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string) => fallback })) +vi.mock('@/i18n/i18n', () => ({ + i18n: { language: 'en' }, + translate: (_key: string, fallback: string) => fallback +})) vi.mock('./use-document-dark-theme', () => ({ useDocumentDarkTheme: () => true })) vi.mock('@/lib/monaco-setup', () => ({ monaco: {} })) vi.mock('./MonacoCodeExcerpt', () => ({ diff --git a/src/renderer/src/components/editor/MarkdownPreview.link-routing.interaction.test.tsx b/src/renderer/src/components/editor/MarkdownPreview.link-routing.interaction.test.tsx index 9be38fdb1d23..e244a50865a3 100644 --- a/src/renderer/src/components/editor/MarkdownPreview.link-routing.interaction.test.tsx +++ b/src/renderer/src/components/editor/MarkdownPreview.link-routing.interaction.test.tsx @@ -71,7 +71,10 @@ vi.mock('@/lib/connection-context', () => ({ vi.mock('@/lib/connection-owner-resolution', () => ({ createConnectionIdForFileSelector: () => () => connectionOwner.value })) -vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string) => fallback })) +vi.mock('@/i18n/i18n', () => ({ + i18n: { language: 'en' }, + translate: (_key: string, fallback: string) => fallback +})) vi.mock('./useLocalImageSrc', () => ({ useLocalImageSrc: (src?: string) => src })) vi.mock('./MermaidBlock', () => ({ default: () => null })) vi.mock('./CodeBlockCopyButton', () => ({ diff --git a/src/renderer/src/components/editor/MarkdownPreview.toc-visibility-gate.test.tsx b/src/renderer/src/components/editor/MarkdownPreview.toc-visibility-gate.test.tsx index 23f66fa9ee52..645d1f556d60 100644 --- a/src/renderer/src/components/editor/MarkdownPreview.toc-visibility-gate.test.tsx +++ b/src/renderer/src/components/editor/MarkdownPreview.toc-visibility-gate.test.tsx @@ -55,7 +55,10 @@ vi.mock('@/lib/connection-context', () => ({ getConnectionIdForFile: () => null vi.mock('@/lib/connection-owner-resolution', () => ({ createConnectionIdForFileSelector: () => () => null })) -vi.mock('@/i18n/i18n', () => ({ translate: (_key: string, fallback: string) => fallback })) +vi.mock('@/i18n/i18n', () => ({ + i18n: { language: 'en' }, + translate: (_key: string, fallback: string) => fallback +})) vi.mock('./useLocalImageSrc', () => ({ useLocalImageSrc: (src?: string) => src })) vi.mock('./MermaidBlock', () => ({ default: () => null })) vi.mock('./CodeBlockCopyButton', () => ({ diff --git a/src/renderer/src/components/github-item-dialog/open-dialog/github-item-dialog.tsx b/src/renderer/src/components/github-item-dialog/open-dialog/github-item-dialog.tsx index 71e580a21d51..f07fe236c70d 100644 --- a/src/renderer/src/components/github-item-dialog/open-dialog/github-item-dialog.tsx +++ b/src/renderer/src/components/github-item-dialog/open-dialog/github-item-dialog.tsx @@ -58,7 +58,9 @@ export default function GitHubItemDialog({ return } - const result = activateAndRevealWorktree(currentAttached.id) + const result = activateAndRevealWorktree(currentAttached.id, { + navigationIntent: 'user-open' + }) if (result === false) { toast.error( translate( diff --git a/src/renderer/src/components/pull-request-page/page/surface.tsx b/src/renderer/src/components/pull-request-page/page/surface.tsx index a299a0caa875..ffa5f401e2b9 100644 --- a/src/renderer/src/components/pull-request-page/page/surface.tsx +++ b/src/renderer/src/components/pull-request-page/page/surface.tsx @@ -132,7 +132,9 @@ export default function PullRequestPage({ return } - const result = activateAndRevealWorktree(currentAttached.id) + const result = activateAndRevealWorktree(currentAttached.id, { + navigationIntent: 'user-open' + }) if (result === false) { toast.error( translate( diff --git a/src/renderer/src/components/sidebar/WorktreeContextMenu.delete-shortcut.test.tsx b/src/renderer/src/components/sidebar/WorktreeContextMenu.delete-shortcut.test.tsx index c6664b14e2cb..8bdac0ca1437 100644 --- a/src/renderer/src/components/sidebar/WorktreeContextMenu.delete-shortcut.test.tsx +++ b/src/renderer/src/components/sidebar/WorktreeContextMenu.delete-shortcut.test.tsx @@ -79,6 +79,7 @@ vi.mock('lucide-react', async () => ) vi.mock('@/i18n/i18n', () => ({ + i18n: { language: 'en' }, translate: (_key: string, fallback: string) => fallback })) diff --git a/src/renderer/src/components/sidebar/sleep-worktree-activation-race.test.ts b/src/renderer/src/components/sidebar/sleep-worktree-activation-race.test.ts index bf7eb3c758eb..5f3b588f93c2 100644 --- a/src/renderer/src/components/sidebar/sleep-worktree-activation-race.test.ts +++ b/src/renderer/src/components/sidebar/sleep-worktree-activation-race.test.ts @@ -88,6 +88,7 @@ describe('sleep flow vs slept-workspace activation', () => { expect(mocks.resumeWorkspace).toHaveBeenCalledWith({ workspaceId: 'wt-parent' }) expect(mocks.activateAndRevealWorktree).toHaveBeenCalledTimes(1) expect(mocks.activateAndRevealWorktree).toHaveBeenCalledWith('wt-parent', { + navigationIntent: 'user-open', revealInSidebar: false }) @@ -102,6 +103,7 @@ describe('sleep flow vs slept-workspace activation', () => { await activateWorktreeFromSidebar('wt-parent') expect(mocks.activateAndRevealWorktree).toHaveBeenCalledWith('wt-parent', { + navigationIntent: 'user-open', revealInSidebar: false }) expect(mocks.toastError).toHaveBeenCalledWith( diff --git a/src/renderer/src/components/sidebar/use-worktree-context-menu-commands.ts b/src/renderer/src/components/sidebar/use-worktree-context-menu-commands.ts index ebef4544b231..30920343680f 100644 --- a/src/renderer/src/components/sidebar/use-worktree-context-menu-commands.ts +++ b/src/renderer/src/components/sidebar/use-worktree-context-menu-commands.ts @@ -164,7 +164,7 @@ export function useWorktreeContextMenuCommands(args: { }, [args]) const handleOpenParent = useCallback(() => { if (args.validParentWorktreeId) { - activateAndRevealWorktree(args.validParentWorktreeId) + activateAndRevealWorktree(args.validParentWorktreeId, { navigationIntent: 'user-open' }) } }, [args.validParentWorktreeId]) return { diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.focus.test.tsx b/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.focus.test.tsx index 53783410ef4b..c09637354f21 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.focus.test.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.focus.test.tsx @@ -146,7 +146,10 @@ describe('workspace list focus ownership', () => { expect(document.activeElement).toBe(list) press('ArrowUp') expect(activate.mock.calls.map(([id]) => id)).toEqual(['b', 'c', 'b']) - expect(activate).toHaveBeenLastCalledWith('b', { executionHostId: 'ssh:fixture' }) + expect(activate).toHaveBeenLastCalledWith('b', { + navigationIntent: 'user-open', + executionHostId: 'ssh:fixture' + }) expect(terminal.focus).not.toHaveBeenCalled() }) diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.host-identity.test.tsx b/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.host-identity.test.tsx index efac59a9c078..4944d69340ac 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.host-identity.test.tsx +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.host-identity.test.tsx @@ -101,7 +101,7 @@ describe('worktree keyboard cycling with a resolved active host', () => { press('down') - expect(activateAndRevealWorktree).toHaveBeenCalledWith('c', {}) + expect(activateAndRevealWorktree).toHaveBeenCalledWith('c', { navigationIntent: 'user-open' }) }) it('steps to the previous row when the active host resolved to local', () => { @@ -109,7 +109,7 @@ describe('worktree keyboard cycling with a resolved active host', () => { press('up') - expect(activateAndRevealWorktree).toHaveBeenCalledWith('a', {}) + expect(activateAndRevealWorktree).toHaveBeenCalledWith('a', { navigationIntent: 'user-open' }) }) it('still steps normally when the active host is unqualified', () => { @@ -117,6 +117,6 @@ describe('worktree keyboard cycling with a resolved active host', () => { press('down') - expect(activateAndRevealWorktree).toHaveBeenCalledWith('c', {}) + expect(activateAndRevealWorktree).toHaveBeenCalledWith('c', { navigationIntent: 'user-open' }) }) }) diff --git a/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.ts b/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.ts index cff03054692b..612bd82b505c 100644 --- a/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.ts +++ b/src/renderer/src/components/sidebar/worktree-list/navigation/use-keyboard.ts @@ -89,10 +89,10 @@ export function useWorktreeListKeyboardNavigation(args: { } // Why: keyboard cycling is real navigation; route through the activation helper that records history. - activateAndRevealWorktree( - nextWorktree.id, - nextWorktree.hostId ? { executionHostId: nextWorktree.hostId } : {} - ) + activateAndRevealWorktree(nextWorktree.id, { + navigationIntent: 'user-open', + ...(nextWorktree.hostId ? { executionHostId: nextWorktree.hostId } : {}) + }) const rowIndex = findPreferredRenderRowIndexForWorktreeIdentity( renderRows, diff --git a/src/renderer/src/components/status-bar/PortsStatusSegment.render-stability.test.tsx b/src/renderer/src/components/status-bar/PortsStatusSegment.render-stability.test.tsx index d6d4ad951840..3f518db6751b 100644 --- a/src/renderer/src/components/status-bar/PortsStatusSegment.render-stability.test.tsx +++ b/src/renderer/src/components/status-bar/PortsStatusSegment.render-stability.test.tsx @@ -30,6 +30,7 @@ vi.mock('@/lib/react-error-boundary-reporting', () => ({ })) vi.mock('@/i18n/i18n', () => ({ + i18n: { language: 'en' }, translate: (_key: string, fallback: string, options?: Record) => options ? fallback.replace(/{{(\w+)}}/g, (_match, name: string) => String(options[name] ?? '')) diff --git a/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.rows.test.tsx b/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.rows.test.tsx index 783202de0cb7..580c7f02f13b 100644 --- a/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.rows.test.tsx +++ b/src/renderer/src/components/status-bar/ResourceUsageStatusSegment.rows.test.tsx @@ -23,6 +23,7 @@ vi.mock('@/components/ui/tooltip', () => ({ })) vi.mock('@/i18n/i18n', () => ({ + i18n: { language: 'en' }, translate: (_key: string, fallback: string, values?: Record) => values ? Object.entries(values).reduce( diff --git a/src/renderer/src/components/status-bar/workspace-space-manager-source-boundary.test.ts b/src/renderer/src/components/status-bar/workspace-space-manager-source-boundary.test.ts index 5c8c19757831..3bf7a94c1ddd 100644 --- a/src/renderer/src/components/status-bar/workspace-space-manager-source-boundary.test.ts +++ b/src/renderer/src/components/status-bar/workspace-space-manager-source-boundary.test.ts @@ -74,6 +74,6 @@ describe('workspace space manager source boundaries', () => { expect(controller).toContain( 'removeWorktree(\n { id: worktree.worktreeId, executionHostId: worktree.executionHostId ?? null },\n true,\n { allowUnverifiedPtyStop: true }\n )' ) - expect(table).toContain('activateAndRevealWorktree(worktree.worktreeId)') + expect(table).toContain('activateAndRevealWorktree(worktree.worktreeId, {') }) }) diff --git a/src/renderer/src/components/status-bar/workspace-space-manager-table.tsx b/src/renderer/src/components/status-bar/workspace-space-manager-table.tsx index d4a146555391..8b0ec305124c 100644 --- a/src/renderer/src/components/status-bar/workspace-space-manager-table.tsx +++ b/src/renderer/src/components/status-bar/workspace-space-manager-table.tsx @@ -140,7 +140,11 @@ export function WorkspaceSpaceManagerTable({ deleteState={getDeleteStateForWorktree(worktree)} onToggleSelected={() => toggleSelection(worktree)} onInspect={() => setInspectedWorktreeId(identity)} - onOpenWorkspace={() => activateAndRevealWorktree(worktree.worktreeId)} + onOpenWorkspace={() => + activateAndRevealWorktree(worktree.worktreeId, { + navigationIntent: 'user-open' + }) + } onDelete={() => deleteWorktrees([worktree])} onForceDelete={() => forceDeleteWorktree(worktree)} /> diff --git a/src/renderer/src/components/task-page-workspace-composer-boundary.test.ts b/src/renderer/src/components/task-page-workspace-composer-boundary.test.ts index a16128eee760..4eedb629f2aa 100644 --- a/src/renderer/src/components/task-page-workspace-composer-boundary.test.ts +++ b/src/renderer/src/components/task-page-workspace-composer-boundary.test.ts @@ -110,7 +110,7 @@ describe('TaskPage workspace creation source boundaries', () => { expect(section).toContain('findGithubWorkItemWorkspaceAttachment(') expect(section).toContain('if (!currentAttached)') expect(section).toContain('handleUseWorkItem(item)') - expect(section).toContain('activateAndRevealWorktree(currentAttached.id)') + expect(section).toContain('activateAndRevealWorktree(currentAttached.id, {') }) it('uses the shared composer handler from GitHub detail and start-new actions', () => { diff --git a/src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx b/src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx index 734cef0f7956..ef45ae6cb3ec 100644 --- a/src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx +++ b/src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx @@ -3,6 +3,10 @@ import { act, StrictMode } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, describe, expect, it, vi } from 'vitest' import { useTerminalWatcherEffects } from '../use-terminal-watcher-effects' +import { + claimEmptyWorkspaceDefaultSurface, + releaseEmptyWorkspaceDefaultSurface +} from '@/lib/empty-workspace-default-surface-claims' const mocks = vi.hoisted(() => { const storeTabsByWorktree: Record = {} @@ -45,6 +49,8 @@ vi.mock('../terminal-pane/terminal-parked-tab-watchers', () => ({ disposeAllParkedTerminalWatchers: vi.fn() })) +const PENDING_INTENT = { callerProvidesSurface: false, seedUserDefaultSurface: true } + Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true }) let root: Root | undefined afterEach(async () => { @@ -202,6 +208,36 @@ describe('passive terminal seeding retries until a decision applies', () => { expect(mocks.createTab).toHaveBeenCalledTimes(1) }) + it('leaves the seed to an activation reseed awaiting agent detection', async () => { + const finishGate = deferredGate() + root = createRoot(document.createElement('div')) + await act(async () => root?.render()) + claimEmptyWorkspaceDefaultSurface('wt-1', PENDING_INTENT) + try { + await finishGate('empty') + expect(mocks.createTab).not.toHaveBeenCalled() + } finally { + releaseEmptyWorkspaceDefaultSurface('wt-1') + } + }) + + // Why: that reseed bails once the user leaves, so a workspace left mid-wait must seed on return. + it('seeds on return to a workspace left while a reseed awaited agent detection', async () => { + mocks.gate.mockResolvedValue('empty') + claimEmptyWorkspaceDefaultSurface('wt-1', PENDING_INTENT) + root = createRoot(document.createElement('div')) + try { + await act(async () => root?.render()) + expect(mocks.createTab).not.toHaveBeenCalled() + } finally { + releaseEmptyWorkspaceDefaultSurface('wt-1') + } + + await act(async () => root?.render()) + await act(async () => root?.render()) + expect(mocks.createTab).toHaveBeenCalledTimes(1) + }) + it('seeds after leaving and returning to a blocked workspace', async () => { mocks.gate.mockResolvedValue('blocked') root = createRoot(document.createElement('div')) diff --git a/src/renderer/src/components/use-task-page-workspace-actions.ts b/src/renderer/src/components/use-task-page-workspace-actions.ts index 2a88981b6756..5e2cb6f2aab5 100644 --- a/src/renderer/src/components/use-task-page-workspace-actions.ts +++ b/src/renderer/src/components/use-task-page-workspace-actions.ts @@ -60,7 +60,9 @@ export function useTaskPageWorkspaceActions(model: TaskPageSearchActionsModel) { handleUseWorkItem(item) return } - const result = activateAndRevealWorktree(currentAttached.id) + const result = activateAndRevealWorktree(currentAttached.id, { + navigationIntent: 'user-open' + }) if (result === false) { toast.error( item.type === 'pr' diff --git a/src/renderer/src/components/use-terminal-watcher-effects.ts b/src/renderer/src/components/use-terminal-watcher-effects.ts index f91c06bd7d7c..39764c873457 100644 --- a/src/renderer/src/components/use-terminal-watcher-effects.ts +++ b/src/renderer/src/components/use-terminal-watcher-effects.ts @@ -14,6 +14,7 @@ import { isTerminalWorkspaceEmptiedOnPurpose } from '../../../shared/closed-term import { gateWorktreeAgentActivation } from '@/lib/worktree-agent-activation-gate' import { createWorkspaceTerminalHostAuthoritySelector } from '@/lib/workspace-terminal-host-authority' import { getStructuredAgentLaunchStatus } from '@/lib/structured-agent-session-launch' +import { isEmptyWorkspaceDefaultSurfacePending } from '@/lib/empty-workspace-default-surface-claims' import { AGENT_SESSION_PROVIDER_HANDLE_PROVIDERS } from '../../../shared/agent-session-provider-handle' import type { TerminalColdActivationController } from './terminal-cold-activation' import { selectParkedEquivalentMountTabIds } from './terminal/startup-terminal-tab-hold' @@ -223,6 +224,11 @@ export function useTerminalWatcherEffects(controller: TerminalWatcherController) ) { return } + // A reseed awaiting agent detection owns the surface. Left unmarked: that reseed bails if the + // user leaves during the wait, so a later return must seed here. + if (outcome === 'empty' && isEmptyWorkspaceDefaultSurfacePending(activeWorktreeId)) { + return + } // Why mark only once a decision applies: a cancelled or blocked check must stay retryable, // and a rerun shares the gate's in-flight promise instead of repeating its work. startupActivationGateWorktreeIdsRef.current.add(activeWorktreeId) diff --git a/src/renderer/src/components/use-worktree-jump-palette-selection-actions.ts b/src/renderer/src/components/use-worktree-jump-palette-selection-actions.ts index e0da6c158fef..822a23f9e622 100644 --- a/src/renderer/src/components/use-worktree-jump-palette-selection-actions.ts +++ b/src/renderer/src/components/use-worktree-jump-palette-selection-actions.ts @@ -65,10 +65,10 @@ export function useWorktreeJumpPaletteSelectionActions({ ) return } - const activation = activateAndRevealWorktree( - worktree.id, - executionHostId ? { executionHostId } : {} - ) + const activation = activateAndRevealWorktree(worktree.id, { + navigationIntent: 'user-open', + ...(executionHostId ? { executionHostId } : {}) + }) recordFeatureInteraction('cmd-j-workspace-open') skipRestoreFocusRef.current = true closeModal() diff --git a/src/renderer/src/hooks/ipc-events/workspace-shortcut-ipc-bridge.ts b/src/renderer/src/hooks/ipc-events/workspace-shortcut-ipc-bridge.ts index 9e78916fef3d..496f885ebbb5 100644 --- a/src/renderer/src/hooks/ipc-events/workspace-shortcut-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/workspace-shortcut-ipc-bridge.ts @@ -93,11 +93,10 @@ export function registerWorkspaceShortcutIpcBridge(unsubs: (() => void)[]): void const visibleTargets = getVisibleWorktreeShortcutTargets() const target = visibleTargets[index] if (target) { - if (target.executionHostId) { - activateAndRevealWorkspace(target.id, { executionHostId: target.executionHostId }) - } else { - activateAndRevealWorkspace(target.id) - } + activateAndRevealWorkspace(target.id, { + navigationIntent: 'user-open', + ...(target.executionHostId ? { executionHostId: target.executionHostId } : {}) + }) } }) ) diff --git a/src/renderer/src/hooks/useIpcEvents-cmd-j-digit-chord.test.ts b/src/renderer/src/hooks/useIpcEvents-cmd-j-digit-chord.test.ts index a0ff1ea24dc9..ae61b9adcb9a 100644 --- a/src/renderer/src/hooks/useIpcEvents-cmd-j-digit-chord.test.ts +++ b/src/renderer/src/hooks/useIpcEvents-cmd-j-digit-chord.test.ts @@ -52,7 +52,9 @@ describe('useIpcEvents digit-chord routing while Cmd+J is open', () => { expect(rowJumps).toEqual([]) // Why assert the activation and not just the silent bus: a premature return would also emit nothing. - expect(harness.activateAndRevealWorkspace).toHaveBeenCalledWith('wt-c') + expect(harness.activateAndRevealWorkspace).toHaveBeenCalledWith('wt-c', { + navigationIntent: 'user-open' + }) }) it('routes duplicate ids at different positions to their rendered hosts', async () => { @@ -67,6 +69,7 @@ describe('useIpcEvents digit-chord routing while Cmd+J is open', () => { harness.jumpToWorktreeIndex(1) expect(harness.activateAndRevealWorkspace).toHaveBeenCalledWith('repo::path', { + navigationIntent: 'user-open', executionHostId: 'ssh:box' }) }) diff --git a/src/renderer/src/lib/agent-launch-caller-profile-census.test.ts b/src/renderer/src/lib/agent-launch-caller-profile-census.test.ts index 5a3dadedf83c..0b168e66ef4b 100644 --- a/src/renderer/src/lib/agent-launch-caller-profile-census.test.ts +++ b/src/renderer/src/lib/agent-launch-caller-profile-census.test.ts @@ -33,7 +33,7 @@ describe('agent launch caller profiles', () => { const ids = AGENT_LAUNCH_CALLER_PROFILES.map((profile) => profile.id) expect(new Set(ids).size).toBe(ids.length) - expect(ids.length).toBe(12) + expect(ids.length).toBe(13) }) it.each(AGENT_LAUNCH_CALLER_PROFILES.map((profile) => [profile.id, profile] as const))( @@ -70,6 +70,7 @@ describe('agent launch caller profiles', () => { // Why: this is the coupling a move to an async launch RPC threatens most directly — these // call sites cannot tolerate a tab id that only exists after the launch settles. expect(readers.sort()).toEqual([ + 'empty-workspace-default-chat', 'fix-checks', 'floating-default-agent', 'quick-command', diff --git a/src/renderer/src/lib/agent-launch-caller-profiles-test-harness.ts b/src/renderer/src/lib/agent-launch-caller-profiles-test-harness.ts index 39d7c77a13f0..5aaa913044fa 100644 --- a/src/renderer/src/lib/agent-launch-caller-profiles-test-harness.ts +++ b/src/renderer/src/lib/agent-launch-caller-profiles-test-harness.ts @@ -58,6 +58,21 @@ export const AGENT_LAUNCH_CALLER_PROFILES: readonly AgentLaunchCallerProfile[] = passesOnPromptDelivered: false, readsBack: ['null-only'] }, + { + id: 'empty-workspace-default-chat', + caller: 'src/renderer/src/lib/empty-workspace-default-agent-chat.ts', + sourceMarkers: ["launchSource: 'unknown'", 'pendingActivationSpawn: true'], + args: { + agent: 'codex', + worktreeId: 'wt-1', + launchSource: 'unknown', + pendingActivationSpawn: true + }, + passesBeforeSurfaceOpen: false, + passesLaunchPlan: true, + passesOnPromptDelivered: false, + readsBack: ['surface-tab-id'] + }, { id: 'floating-default-agent', caller: 'src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx', diff --git a/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts b/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts index 3e91c5c8ec0c..2c9524c99957 100644 --- a/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts +++ b/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts @@ -18,6 +18,7 @@ const LAUNCH_AGENT_IN_NEW_TAB_CALLERS = [ 'src/renderer/src/components/tab-bar/use-tab-bar-create-menu-controller.ts', 'src/renderer/src/components/terminal-pane/terminal-agent-session-fork.ts', 'src/renderer/src/components/use-terminal-create-actions.ts', + 'src/renderer/src/lib/empty-workspace-default-agent-chat.ts', 'src/renderer/src/lib/fix-checks-agent-launch.ts', 'src/renderer/src/lib/launch-agent-session-continuation.ts', 'src/renderer/src/lib/run-quick-command-in-new-tab.ts' diff --git a/src/renderer/src/lib/empty-workspace-default-agent-chat.test.ts b/src/renderer/src/lib/empty-workspace-default-agent-chat.test.ts new file mode 100644 index 000000000000..e3ad93eb3db4 --- /dev/null +++ b/src/renderer/src/lib/empty-workspace-default-agent-chat.test.ts @@ -0,0 +1,154 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import type { GlobalSettings } from '../../../shared/global-settings-types' +import { getDefaultSettings } from '../../../shared/constants' +import { useAppStore } from '@/store' +import { + emptyWorkspaceDefaultChatAwaitsDetection, + loadEmptyWorkspaceDefaultChatDetection, + openDefaultAgentChatInEmptyWorkspace +} from './empty-workspace-default-agent-chat' + +const mocks = vi.hoisted(() => ({ + launchAgentInNewTab: vi.fn(), + planAgentSessionLaunch: vi.fn(), + detectionTargetKey: vi.fn<() => string | undefined>() +})) + +vi.mock('@/lib/launch-agent-in-new-tab', () => ({ + launchAgentInNewTab: mocks.launchAgentInNewTab +})) +vi.mock('@/lib/agent-session-launch-plan', () => ({ + planAgentSessionLaunch: mocks.planAgentSessionLaunch +})) +vi.mock('@/hooks/useAgentDetectionTarget', async (importOriginal) => ({ + ...(await importOriginal>()), + getAgentDetectionTargetKeyForWorktree: mocks.detectionTargetKey +})) + +const initialAppStoreState = useAppStore.getState() + +function seedSettings(settings: Partial): void { + useAppStore.setState({ + detectedAgentIds: ['claude', 'codex'], + settings: { + ...getDefaultSettings('/tmp'), + experimentalNativeChat: true, + openAgentTabsInChatByDefault: true, + defaultTuiAgent: 'codex', + disabledTuiAgents: [], + ...settings + } + }) +} + +beforeEach(() => { + mocks.detectionTargetKey.mockReturnValue('local') + mocks.planAgentSessionLaunch.mockReturnValue({ route: 'structured-native-chat' }) + mocks.launchAgentInNewTab.mockReturnValue({ + surface: { kind: 'local-agent-session', tabId: 'chat-tab', sessionId: 's-1' } + }) +}) + +afterEach(() => { + vi.useRealTimers() + vi.clearAllMocks() + useAppStore.setState(initialAppStoreState, true) +}) + +describe('openDefaultAgentChatInEmptyWorkspace', () => { + it('launches the default agent as a chat', () => { + seedSettings({}) + + expect(openDefaultAgentChatInEmptyWorkspace('wt-1')).toEqual({ primaryTabId: 'chat-tab' }) + expect(mocks.launchAgentInNewTab).toHaveBeenCalledWith( + expect.objectContaining({ agent: 'codex', worktreeId: 'wt-1', pendingActivationSpawn: true }) + ) + }) + + it('does nothing unless new agent tabs open as chat', () => { + seedSettings({ openAgentTabsInChatByDefault: false }) + + expect(openDefaultAgentChatInEmptyWorkspace('wt-1')).toBeNull() + expect(mocks.launchAgentInNewTab).not.toHaveBeenCalled() + }) + + it('respects a Blank Terminal default agent', () => { + seedSettings({ defaultTuiAgent: 'blank' }) + + expect(openDefaultAgentChatInEmptyWorkspace('wt-1')).toBeNull() + expect(mocks.launchAgentInNewTab).not.toHaveBeenCalled() + }) + + it('does not start an agent that could only open as a terminal here', () => { + seedSettings({}) + mocks.planAgentSessionLaunch.mockReturnValue({ route: 'terminal-tui' }) + + expect(openDefaultAgentChatInEmptyWorkspace('wt-1')).toBeNull() + expect(mocks.launchAgentInNewTab).not.toHaveBeenCalled() + }) + + it('reads the agents detected on the workspace SSH host', () => { + seedSettings({}) + mocks.detectionTargetKey.mockReturnValue('ssh:conn-1') + useAppStore.setState({ remoteDetectedAgentIds: { 'conn-1': ['claude'] } }) + + openDefaultAgentChatInEmptyWorkspace('wt-1') + + expect(mocks.launchAgentInNewTab).toHaveBeenCalledWith( + expect.objectContaining({ agent: 'claude' }) + ) + }) + + it('treats a workspace whose host is unresolved as unknown', () => { + seedSettings({}) + mocks.detectionTargetKey.mockReturnValue(undefined) + + expect(emptyWorkspaceDefaultChatAwaitsDetection('wt-1')).toBe(false) + expect(openDefaultAgentChatInEmptyWorkspace('wt-1')).toBeNull() + expect(mocks.launchAgentInNewTab).not.toHaveBeenCalled() + }) +}) + +describe('agent detection for the default chat', () => { + it('waits only while chat is the default and the host list has not loaded', () => { + seedSettings({}) + mocks.detectionTargetKey.mockReturnValue('ssh:conn-1') + useAppStore.setState({ remoteDetectedAgentIds: {} }) + expect(emptyWorkspaceDefaultChatAwaitsDetection('wt-1')).toBe(true) + + useAppStore.setState({ remoteDetectedAgentIds: { 'conn-1': [] } }) + expect(emptyWorkspaceDefaultChatAwaitsDetection('wt-1')).toBe(false) + + seedSettings({ openAgentTabsInChatByDefault: false }) + useAppStore.setState({ remoteDetectedAgentIds: {} }) + expect(emptyWorkspaceDefaultChatAwaitsDetection('wt-1')).toBe(false) + }) + + // Why: Blank Terminal opens a shell whatever the host has, so waiting only delays that shell. + it('does not wait when the default agent is Blank Terminal', () => { + seedSettings({ defaultTuiAgent: 'blank' }) + mocks.detectionTargetKey.mockReturnValue('ssh:conn-1') + useAppStore.setState({ remoteDetectedAgentIds: {} }) + + expect(emptyWorkspaceDefaultChatAwaitsDetection('wt-1')).toBe(false) + }) + + it('probes the workspace host and gives up after a bounded wait', async () => { + vi.useFakeTimers() + seedSettings({}) + mocks.detectionTargetKey.mockReturnValue('ssh:conn-1') + const ensureRemoteDetectedAgents = vi.fn(() => new Promise(() => {})) + useAppStore.setState({ ensureRemoteDetectedAgents }) + let settled = false + + void loadEmptyWorkspaceDefaultChatDetection('wt-1').then(() => { + settled = true + }) + await vi.advanceTimersByTimeAsync(4_999) + expect(settled).toBe(false) + await vi.advanceTimersByTimeAsync(1) + + expect(ensureRemoteDetectedAgents).toHaveBeenCalledWith('conn-1') + expect(settled).toBe(true) + }) +}) diff --git a/src/renderer/src/lib/empty-workspace-default-agent-chat.ts b/src/renderer/src/lib/empty-workspace-default-agent-chat.ts new file mode 100644 index 000000000000..84156f99927e --- /dev/null +++ b/src/renderer/src/lib/empty-workspace-default-agent-chat.ts @@ -0,0 +1,113 @@ +import { agentTabsDefaultToNativeChat } from '../../../shared/structured-native-chat-launch-route' +import { pickTuiAgent } from '../../../shared/tui-agent-selection' +import type { TuiAgent } from '../../../shared/tui-agent' +import { withTimeout } from '../../../shared/promise-timeout-fallback' +import { useAppStore } from '@/store' +import type { AppState } from '@/store/types' +import { + getAgentDetectionTargetKeyForWorktree, + parseAgentDetectionTargetKey +} from '@/hooks/useAgentDetectionTarget' +import type { AgentDetectionTarget } from '@/hooks/useDetectedAgents' +import { workspaceKindForWorktreeId } from '@/lib/agent-launch-route-input' +import { planAgentSessionLaunch } from '@/lib/agent-session-launch-plan' +import { launchAgentInNewTab } from '@/lib/launch-agent-in-new-tab' + +// Why bounded: detection only decides chat vs shell, so a slow host must not hold the workspace empty. +const DEFAULT_CHAT_DETECTION_TIMEOUT_MS = 5_000 + +/** + * The host whose agent list picks the default chat; undefined when the workspace opens a shell + * whatever that list says. Shared by the wait and the open so they cannot drift. + */ +function defaultChatDetectionTarget( + state: AppState, + worktreeId: string +): AgentDetectionTarget | undefined { + // Why: a 'blank' default means the user wants workspaces to open without an agent. + if ( + !agentTabsDefaultToNativeChat(state.settings) || + state.settings?.defaultTuiAgent === 'blank' + ) { + return undefined + } + // Why: an unresolved owner is an unknown host, not the local machine. + return parseAgentDetectionTargetKey(getAgentDetectionTargetKeyForWorktree(state, worktreeId)) +} + +/** Same host lists the tab bar reads; null means that host's detection has not loaded. */ +function readDetectedAgents(state: AppState, target: AgentDetectionTarget): TuiAgent[] | null { + if (target.kind === 'ssh') { + return state.remoteDetectedAgentIds[target.connectionId] ?? null + } + if (target.kind === 'runtime') { + return state.runtimeDetectedAgentIds[target.environmentId] ?? null + } + return target.contextKey + ? (state.localDetectedAgentIdsByContext[target.contextKey] ?? null) + : state.detectedAgentIds +} + +/** True when the default chat could open here but the workspace host's agent list has not loaded. */ +export function emptyWorkspaceDefaultChatAwaitsDetection(worktreeId: string): boolean { + const state = useAppStore.getState() + const target = defaultChatDetectionTarget(state, worktreeId) + return target !== undefined && readDetectedAgents(state, target) === null +} + +/** Loads the workspace host's agent list; resolves on success, failure, or timeout. */ +export async function loadEmptyWorkspaceDefaultChatDetection(worktreeId: string): Promise { + const state = useAppStore.getState() + const target = defaultChatDetectionTarget(state, worktreeId) + if (!target) { + return + } + const detection = + target.kind === 'ssh' + ? state.ensureRemoteDetectedAgents(target.connectionId) + : target.kind === 'runtime' + ? state.ensureRuntimeDetectedAgents(target.environmentId) + : state.ensureDetectedAgents(target.worktreeId) + await withTimeout(detection, DEFAULT_CHAT_DETECTION_TIMEOUT_MS, []) +} + +/** + * When the user's new agent tabs open as chat, an empty workspace opens their default agent as a + * chat instead of a bare shell. Null means nothing opened and the caller seeds the shell. + */ +export function openDefaultAgentChatInEmptyWorkspace( + worktreeId: string +): { primaryTabId: string | null } | null { + const state = useAppStore.getState() + const target = defaultChatDetectionTarget(state, worktreeId) + if (!target) { + return null + } + const agent = pickTuiAgent( + state.settings?.defaultTuiAgent, + readDetectedAgents(state, target) ?? [], + state.settings?.disabledTuiAgents + ) + if (!agent) { + return null + } + const agentSessionLaunchPlan = planAgentSessionLaunch(state, { + agent, + workspace: { kind: workspaceKindForWorktreeId(worktreeId), worktreeId } + }) + // Why: an agent that can only open as a TUI here would replace the shell with a process nobody asked for. + if (agentSessionLaunchPlan.route === 'terminal-tui') { + return null + } + const result = launchAgentInNewTab({ + agent, + worktreeId, + launchSource: 'unknown', + agentSessionLaunchPlan, + pendingActivationSpawn: true + }) + if (!result) { + return null + } + return { primaryTabId: result.surface.kind === 'host-published' ? null : result.surface.tabId } +} diff --git a/src/renderer/src/lib/empty-workspace-default-surface-claims.ts b/src/renderer/src/lib/empty-workspace-default-surface-claims.ts new file mode 100644 index 000000000000..61a989e6bfc0 --- /dev/null +++ b/src/renderer/src/lib/empty-workspace-default-surface-claims.ts @@ -0,0 +1,29 @@ +import type { GatedEmptyWorkspaceReseedIntent } from './worktree-initial-terminal-seeding' + +// Why: while a gated reseed waits on agent detection, it owns the workspace's first surface; +// any other seeder landing in that wait would put a shell beside the chat it is about to open. +// Why the intent: the wait seeds for the latest activation, so a later one must not be dropped. +const pendingIntentByWorkspace = new Map() + +/** Records this activation's intent; false when a wait already pending now carries it instead. */ +export function claimEmptyWorkspaceDefaultSurface( + workspaceKey: string, + intent: GatedEmptyWorkspaceReseedIntent +): boolean { + const alreadyPending = pendingIntentByWorkspace.has(workspaceKey) + pendingIntentByWorkspace.set(workspaceKey, intent) + return !alreadyPending +} + +/** Ends the wait and returns the latest activation's intent. */ +export function releaseEmptyWorkspaceDefaultSurface( + workspaceKey: string +): GatedEmptyWorkspaceReseedIntent | undefined { + const intent = pendingIntentByWorkspace.get(workspaceKey) + pendingIntentByWorkspace.delete(workspaceKey) + return intent +} + +export function isEmptyWorkspaceDefaultSurfacePending(workspaceKey: string): boolean { + return pendingIntentByWorkspace.has(workspaceKey) +} diff --git a/src/renderer/src/lib/launch-agent-in-new-tab.ts b/src/renderer/src/lib/launch-agent-in-new-tab.ts index f4923c79b5e1..ce28d3c8ad18 100644 --- a/src/renderer/src/lib/launch-agent-in-new-tab.ts +++ b/src/renderer/src/lib/launch-agent-in-new-tab.ts @@ -60,6 +60,8 @@ export type LaunchAgentInNewTabArgs = { onPromptDeliveryUnconfirmed?: () => void /** Keeps a preflighted route authoritative across workspace creation. */ agentSessionLaunchPlan?: AgentSessionLaunchPlan + /** The launch seeds a workspace being opened, so its PTY spawn must not reshuffle Recent. */ + pendingActivationSpawn?: boolean /** Lets a workspace reveal itself before the selected surface opens. */ beforeSurfaceOpen?: ( surface: @@ -114,6 +116,7 @@ function launchAgentInNewTabInternal(args: LaunchAgentInNewTabArgs): LaunchAgent onPromptDelivered, onPromptDeliveryUnconfirmed, agentSessionLaunchPlan, + pendingActivationSpawn, beforeSurfaceOpen } = args const store = useAppStore.getState() @@ -245,6 +248,7 @@ function launchAgentInNewTabInternal(args: LaunchAgentInNewTabArgs): LaunchAgent const tab = store.createTab(worktreeId, groupId, undefined, { launchAgent: agent, quickCommandLabel, + ...(pendingActivationSpawn ? { pendingActivationSpawn: true } : {}), ...initialViewModeProps }) seedNativeChatAppliedSessionOptions(tab.id, agent, startupPlan.sessionOptions) diff --git a/src/renderer/src/lib/linear-issue-workspace-open.test.ts b/src/renderer/src/lib/linear-issue-workspace-open.test.ts index 86a72ab4df9d..e455c52308ab 100644 --- a/src/renderer/src/lib/linear-issue-workspace-open.test.ts +++ b/src/renderer/src/lib/linear-issue-workspace-open.test.ts @@ -87,6 +87,7 @@ describe('openLinearIssueWorkspaceOrStart', () => { expect(openLinearIssueWorkspaceOrStart({ identifier: 'ENG-1' }, vi.fn())).toBe('opened') expect(mocks.activateAndRevealWorktree).toHaveBeenCalledWith('worktree-1', { + navigationIntent: 'user-open', executionHostId: 'ssh:builder' }) }) @@ -97,6 +98,7 @@ describe('openLinearIssueWorkspaceOrStart', () => { expect(openLinearIssueWorkspaceOrStart({ identifier: 'ENG-1' }, startWorkspace)).toBe('opened') expect(mocks.activateAndRevealFolderWorkspace).toHaveBeenCalledWith('folder-1', { + navigationIntent: 'user-open', executionHostId: 'local' }) expect(startWorkspace).not.toHaveBeenCalled() diff --git a/src/renderer/src/lib/linear-issue-workspace-open.ts b/src/renderer/src/lib/linear-issue-workspace-open.ts index 4b838176f444..63d2944c180c 100644 --- a/src/renderer/src/lib/linear-issue-workspace-open.ts +++ b/src/renderer/src/lib/linear-issue-workspace-open.ts @@ -35,14 +35,14 @@ export function openLinearIssueWorkspaceOrStart( const workspaceScope = parseWorkspaceKey(attached.id) const activation = workspaceScope?.type === 'folder' - ? activateAndRevealFolderWorkspace( - workspaceScope.folderWorkspaceId, - attached.hostId ? { executionHostId: attached.hostId } : undefined - ) - : activateAndRevealWorktree( - attached.id, - attached.hostId ? { executionHostId: attached.hostId } : {} - ) + ? activateAndRevealFolderWorkspace(workspaceScope.folderWorkspaceId, { + navigationIntent: 'user-open', + ...(attached.hostId ? { executionHostId: attached.hostId } : {}) + }) + : activateAndRevealWorktree(attached.id, { + navigationIntent: 'user-open', + ...(attached.hostId ? { executionHostId: attached.hostId } : {}) + }) if (activation === false) { toast.error( translate( diff --git a/src/renderer/src/lib/sidebar-worktree-activation.test.ts b/src/renderer/src/lib/sidebar-worktree-activation.test.ts index a33f91565a25..a12ca8affa81 100644 --- a/src/renderer/src/lib/sidebar-worktree-activation.test.ts +++ b/src/renderer/src/lib/sidebar-worktree-activation.test.ts @@ -26,6 +26,7 @@ describe('sidebar worktree activation', () => { await activateWorktreeFromSidebar('wt-live') expect(mocks.activateAndRevealWorktree).toHaveBeenCalledWith('wt-live', { + navigationIntent: 'user-open', revealInSidebar: false }) expect(mocks.activateAndRevealFolderWorkspace).not.toHaveBeenCalled() @@ -38,6 +39,7 @@ describe('sidebar worktree activation', () => { // sidebar click itself must switch app state immediately. expect(mocks.activateAndRevealWorktree).toHaveBeenCalledTimes(1) expect(mocks.activateAndRevealWorktree).toHaveBeenCalledWith('wt-slept', { + navigationIntent: 'user-open', revealInSidebar: false }) }) @@ -57,6 +59,7 @@ describe('sidebar worktree activation', () => { const activation = activateWorktreeFromSidebar('wt-vm') expect(mocks.activateAndRevealWorktree).toHaveBeenCalledWith('wt-vm', { + navigationIntent: 'user-open', revealInSidebar: false }) expect(resumeWorkspace).toHaveBeenCalledWith({ workspaceId: 'wt-vm' }) @@ -68,7 +71,9 @@ describe('sidebar worktree activation', () => { it('routes folder workspace activation through the guarded folder path', async () => { await activateWorktreeFromSidebar('folder:folder-workspace-1') - expect(mocks.activateAndRevealFolderWorkspace).toHaveBeenCalledWith('folder-workspace-1') + expect(mocks.activateAndRevealFolderWorkspace).toHaveBeenCalledWith('folder-workspace-1', { + navigationIntent: 'user-open' + }) expect(mocks.activateAndRevealWorktree).not.toHaveBeenCalled() }) }) diff --git a/src/renderer/src/lib/sidebar-worktree-activation.ts b/src/renderer/src/lib/sidebar-worktree-activation.ts index dd4eec3f0df6..01bb94ad11b8 100644 --- a/src/renderer/src/lib/sidebar-worktree-activation.ts +++ b/src/renderer/src/lib/sidebar-worktree-activation.ts @@ -13,17 +13,15 @@ export async function activateWorktreeFromSidebar( ): Promise { const workspaceScope = parseWorkspaceKey(worktreeId) if (workspaceScope?.type === 'folder') { - if (executionHostId) { - activateAndRevealFolderWorkspace(workspaceScope.folderWorkspaceId, { - executionHostId - }) - } else { - activateAndRevealFolderWorkspace(workspaceScope.folderWorkspaceId) - } + activateAndRevealFolderWorkspace(workspaceScope.folderWorkspaceId, { + navigationIntent: 'user-open', + ...(executionHostId ? { executionHostId } : {}) + }) return } // Keep navigation independent from an optional runtime wake IPC. activateAndRevealWorktree(worktreeId, { + navigationIntent: 'user-open', revealInSidebar: false, ...(executionHostId ? { executionHostId } : {}) }) diff --git a/src/renderer/src/lib/worktree-activation-default-agent-chat.test.ts b/src/renderer/src/lib/worktree-activation-default-agent-chat.test.ts new file mode 100644 index 000000000000..ae956cabd216 --- /dev/null +++ b/src/renderer/src/lib/worktree-activation-default-agent-chat.test.ts @@ -0,0 +1,362 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { useAppStore } from '@/store' +import { activateAndRevealFolderWorkspace, activateAndRevealWorktree } from './worktree-activation' +import * as activationGate from './worktree-agent-activation-gate' +import { + ensureWorktreeHasInitialTerminal, + reseedGatedEmptyWorkspace +} from './worktree-initial-terminal-seeding' +import { + isEmptyWorkspaceDefaultSurfacePending, + releaseEmptyWorkspaceDefaultSurface +} from './empty-workspace-default-surface-claims' +import { folderWorkspaceKey } from '../../../shared/workspace-scope' +import { + makeCreatedAgentWorktree as makeWorktree, + seedEmptyActivatableWorktree +} from '@/lib/worktree-activation-created-agent-test-state' +import { + createMockStore, + registerWorktreeActivationReset +} from './worktree-activation-test-harness' + +const defaultChat = vi.hoisted(() => ({ + open: vi.fn(), + awaitsDetection: vi.fn(), + loadDetection: vi.fn() +})) + +vi.mock('@/lib/empty-workspace-default-agent-chat', () => ({ + openDefaultAgentChatInEmptyWorkspace: defaultChat.open, + emptyWorkspaceDefaultChatAwaitsDetection: defaultChat.awaitsDetection, + loadEmptyWorkspaceDefaultChatDetection: defaultChat.loadDetection +})) + +const USER_OPEN = { navigationIntent: 'user-open' } as const +const FOLDER_ID = 'folder-1' +const FOLDER_KEY = folderWorkspaceKey(FOLDER_ID) +const initialAppStoreState = useAppStore.getState() + +registerWorktreeActivationReset() + +beforeEach(() => { + defaultChat.open.mockReset() + defaultChat.awaitsDetection.mockReset().mockReturnValue(false) + defaultChat.loadDetection.mockReset().mockResolvedValue(undefined) +}) + +afterEach(() => { + vi.unstubAllGlobals() + vi.restoreAllMocks() + releaseEmptyWorkspaceDefaultSurface(makeWorktree().id) + releaseEmptyWorkspaceDefaultSurface(FOLDER_KEY) + useAppStore.setState(initialAppStoreState, true) +}) + +/** Electron exposes the PTY inventory, so an empty workspace is seeded by the gated reseed. */ +function useElectronActivationGate(): ReturnType { + vi.stubGlobal('window', { api: { runtime: { call: vi.fn() }, pty: { listSessions: vi.fn() } } }) + return vi.spyOn(activationGate, 'gateWorktreeAgentActivation').mockResolvedValue('empty') +} + +function seedEmptyFolderWorkspace(): void { + useAppStore.setState({ + folderWorkspaces: [ + { + id: FOLDER_ID, + projectGroupId: 'group-1', + name: 'notes', + folderPath: '/local/notes', + executionHostId: 'local', + linkedTask: null, + comment: '', + isArchived: false, + isUnread: false, + isPinned: false, + sortOrder: 0 + } + ], + activeView: 'terminal', + tabsByWorktree: {}, + unifiedTabsByWorktree: {}, + groupsByWorktree: {}, + getFreshFolderWorkspacePathStatus: () => ({ exists: true }), + markWorktreeVisited: vi.fn(), + recordWorktreeVisit: vi.fn(), + revealWorktreeInSidebar: vi.fn() + } as unknown as Partial>) +} + +function tabCount(workspaceKey: string): number { + return (useAppStore.getState().tabsByWorktree[workspaceKey] ?? []).length +} + +async function flushPromises(): Promise { + await new Promise((resolve) => setTimeout(resolve, 0)) +} + +// Why: with chat as the default view, clicking an empty workspace used to open a bare shell the +// user then had to turn into a chat by hand. +describe('empty workspace seeding with a default agent chat', () => { + it('opens the default agent chat instead of a shell', () => { + defaultChat.open.mockReturnValue({ primaryTabId: 'chat-tab' }) + const createTab = vi.fn(() => ({ id: 'shell-tab' })) + const store = createMockStore({ createTab }) + + const primaryTabId = ensureWorktreeHasInitialTerminal( + store, + 'wt-1', + undefined, + undefined, + undefined, + undefined, + { seedUserDefaultSurface: true } + ) + + expect(defaultChat.open).toHaveBeenCalledWith('wt-1') + expect(primaryTabId).toBe('chat-tab') + expect(createTab).not.toHaveBeenCalled() + }) + + it('falls back to a shell when no chat can open', () => { + defaultChat.open.mockReturnValue(null) + const createTab = vi.fn(() => ({ id: 'shell-tab' })) + const store = createMockStore({ createTab }) + + const primaryTabId = ensureWorktreeHasInitialTerminal( + store, + 'wt-1', + undefined, + undefined, + undefined, + undefined, + { seedUserDefaultSurface: true } + ) + + expect(primaryTabId).toBe('shell-tab') + expect(createTab).toHaveBeenCalledTimes(1) + }) + + it('keeps the shell for seeds that did not ask for the default surface', () => { + const store = createMockStore({ createTab: vi.fn(() => ({ id: 'shell-tab' })) }) + + ensureWorktreeHasInitialTerminal(store, 'wt-1') + ensureWorktreeHasInitialTerminal(store, 'wt-2', undefined, undefined, undefined, undefined, { + seedUserDefaultSurface: true, + activateCreatedTabs: false + }) + + expect(defaultChat.open).not.toHaveBeenCalled() + }) + + it('a user open of an empty workspace asks for the default surface', () => { + defaultChat.open.mockReturnValue({ primaryTabId: null }) + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + + activateAndRevealWorktree(worktree.id, { ...USER_OPEN, notifyHostRuntime: false }) + + expect(defaultChat.open).toHaveBeenCalledWith(worktree.id) + }) + + it('back/forward navigation asks for the default surface', () => { + defaultChat.open.mockReturnValue({ primaryTabId: null }) + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + useAppStore.setState({ + worktreeNavHistory: [worktree.id, 'repo-1::/elsewhere'], + worktreeNavHistoryIndex: 1 + }) + + useAppStore.getState().goBackWorktree() + + expect(defaultChat.open).toHaveBeenCalledWith(worktree.id) + }) + + // Why: CLI/phone creates, fallbacks after a failed agent launch, and the move after a delete + // activate with no intent; none of them may start an agent nobody picked. + it.each([ + ['no navigation intent', {}], + ['a Blank Terminal pick', { ...USER_OPEN, agent: null }] + ])('keeps the shell for %s', (_label, selection) => { + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + + activateAndRevealWorktree(worktree.id, { ...selection, notifyHostRuntime: false }) + + expect(defaultChat.open).not.toHaveBeenCalled() + expect(tabCount(worktree.id)).toBe(1) + }) +}) + +describe('the gated reseed that seeds an empty workspace in Electron', () => { + it('opens the default agent chat for a user open', async () => { + defaultChat.open.mockReturnValue({ primaryTabId: null }) + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + const gate = useElectronActivationGate() + + const result = activateAndRevealWorktree(worktree.id, { + ...USER_OPEN, + notifyHostRuntime: false + }) + expect(result === false ? 'failed' : result.primaryTabId).toBeNull() + await gate.mock.results[0]?.value + + expect(defaultChat.open).toHaveBeenCalledWith(worktree.id) + expect(tabCount(worktree.id)).toBe(0) + }) + + it('seeds a shell for an activation without a user open', async () => { + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + const gate = useElectronActivationGate() + + activateAndRevealWorktree(worktree.id, { notifyHostRuntime: false }) + await gate.mock.results[0]?.value + + expect(defaultChat.open).not.toHaveBeenCalled() + expect(tabCount(worktree.id)).toBe(1) + }) + + it('opens the default agent chat for a user-opened folder workspace', async () => { + defaultChat.open.mockReturnValue({ primaryTabId: null }) + seedEmptyFolderWorkspace() + const gate = useElectronActivationGate() + + activateAndRevealFolderWorkspace(FOLDER_ID, { ...USER_OPEN, executionHostId: 'local' }) + await gate.mock.results[0]?.value + + expect(defaultChat.open).toHaveBeenCalledWith(FOLDER_KEY) + expect(tabCount(FOLDER_KEY)).toBe(0) + }) + + it('waits for the host agent list and lets no other reseed seed a shell meanwhile', async () => { + defaultChat.open.mockReturnValue({ primaryTabId: null }) + defaultChat.awaitsDetection.mockReturnValue(true) + let finishDetection!: () => void + defaultChat.loadDetection.mockReturnValue( + new Promise((resolve) => { + finishDetection = resolve + }) + ) + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + const gate = useElectronActivationGate() + + activateAndRevealWorktree(worktree.id, { ...USER_OPEN, notifyHostRuntime: false }) + await gate.mock.results[0]?.value + + expect(defaultChat.loadDetection).toHaveBeenCalledWith(worktree.id) + expect(isEmptyWorkspaceDefaultSurfacePending(worktree.id)).toBe(true) + reseedGatedEmptyWorkspace(worktree.id, { + callerProvidesSurface: false, + seedUserDefaultSurface: false + }) + expect(tabCount(worktree.id)).toBe(0) + expect(defaultChat.open).not.toHaveBeenCalled() + + finishDetection() + await flushPromises() + + expect(isEmptyWorkspaceDefaultSurfacePending(worktree.id)).toBe(false) + expect(defaultChat.open).toHaveBeenCalledTimes(1) + expect(tabCount(worktree.id)).toBe(0) + }) + + // Why: the wait used to keep the first activation's intent, so returning to the workspace through + // history (no host id) failed the first intent's host check and left it with no surface at all. + it('seeds for the latest activation when the workspace is reopened during the wait', async () => { + defaultChat.open.mockReturnValue({ primaryTabId: null }) + defaultChat.awaitsDetection.mockReturnValue(true) + let finishDetection!: () => void + defaultChat.loadDetection.mockReturnValue( + new Promise((resolve) => { + finishDetection = resolve + }) + ) + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + const gate = useElectronActivationGate() + + activateAndRevealWorktree(worktree.id, { + ...USER_OPEN, + executionHostId: 'local', + notifyHostRuntime: false + }) + await gate.mock.results[0]?.value + useAppStore.setState({ activeWorktreeId: 'repo-1::/elsewhere' }) + activateAndRevealWorktree(worktree.id, { ...USER_OPEN, notifyHostRuntime: false }) + await gate.mock.results[1]?.value + expect(useAppStore.getState().activeWorkspaceExecutionHostId).toBeNull() + finishDetection() + await flushPromises() + + expect(defaultChat.loadDetection).toHaveBeenCalledTimes(1) + expect(isEmptyWorkspaceDefaultSurfacePending(worktree.id)).toBe(false) + expect(defaultChat.open).toHaveBeenCalledTimes(1) + }) + + it('seeds a shell when a plain activation follows the user open during the wait', async () => { + defaultChat.awaitsDetection.mockReturnValue(true) + let finishDetection!: () => void + defaultChat.loadDetection.mockReturnValue( + new Promise((resolve) => { + finishDetection = resolve + }) + ) + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + const gate = useElectronActivationGate() + + activateAndRevealWorktree(worktree.id, { ...USER_OPEN, notifyHostRuntime: false }) + await gate.mock.results[0]?.value + activateAndRevealWorktree(worktree.id, { notifyHostRuntime: false }) + await gate.mock.results[1]?.value + expect(tabCount(worktree.id)).toBe(0) + finishDetection() + await flushPromises() + + expect(defaultChat.open).not.toHaveBeenCalled() + expect(tabCount(worktree.id)).toBe(1) + }) + + it('re-checks the active workspace after the wait', async () => { + defaultChat.awaitsDetection.mockReturnValue(true) + let finishDetection!: () => void + defaultChat.loadDetection.mockReturnValue( + new Promise((resolve) => { + finishDetection = resolve + }) + ) + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + const gate = useElectronActivationGate() + + activateAndRevealWorktree(worktree.id, { ...USER_OPEN, notifyHostRuntime: false }) + await gate.mock.results[0]?.value + useAppStore.setState({ activeWorktreeId: 'repo-1::/elsewhere' }) + finishDetection() + await flushPromises() + + expect(isEmptyWorkspaceDefaultSurfacePending(worktree.id)).toBe(false) + expect(defaultChat.open).not.toHaveBeenCalled() + expect(tabCount(worktree.id)).toBe(0) + }) + + it('seeds the shell when detection fails', async () => { + defaultChat.open.mockReturnValue(null) + defaultChat.awaitsDetection.mockReturnValue(true) + defaultChat.loadDetection.mockRejectedValue(new Error('ssh probe failed')) + const worktree = makeWorktree() + seedEmptyActivatableWorktree(worktree) + const gate = useElectronActivationGate() + + activateAndRevealWorktree(worktree.id, { ...USER_OPEN, notifyHostRuntime: false }) + await gate.mock.results[0]?.value + await flushPromises() + + expect(isEmptyWorkspaceDefaultSurfacePending(worktree.id)).toBe(false) + expect(tabCount(worktree.id)).toBe(1) + }) +}) diff --git a/src/renderer/src/lib/worktree-activation-gated-empty-reseed.ts b/src/renderer/src/lib/worktree-activation-gated-empty-reseed.ts index bb597d10e6ea..2ab11bb14522 100644 --- a/src/renderer/src/lib/worktree-activation-gated-empty-reseed.ts +++ b/src/renderer/src/lib/worktree-activation-gated-empty-reseed.ts @@ -1,14 +1,20 @@ -import type { ExecutionHostId } from '../../../shared/execution-host' import { gateWorktreeAgentActivation, type WorktreeAgentActivationOutcome } from './worktree-agent-activation-gate' -import { reseedGatedEmptyWorkspace } from './worktree-initial-terminal-seeding' - -type GatedEmptyWorkspaceReseedIntent = { - callerProvidesSurface: boolean - executionHostId?: ExecutionHostId -} +import { + reseedGatedEmptyWorkspace, + type GatedEmptyWorkspaceReseedIntent +} from './worktree-initial-terminal-seeding' +import { + emptyWorkspaceDefaultChatAwaitsDetection, + loadEmptyWorkspaceDefaultChatDetection +} from './empty-workspace-default-agent-chat' +import { + claimEmptyWorkspaceDefaultSurface, + isEmptyWorkspaceDefaultSurfacePending, + releaseEmptyWorkspaceDefaultSurface +} from './empty-workspace-default-surface-claims' const latestReseedIntentByGate = new WeakMap< Promise, @@ -17,22 +23,36 @@ const latestReseedIntentByGate = new WeakMap< export function gateAndReseedEmptyWorkspace( workspaceKey: string, - callerProvidesSurface: boolean, - executionHostId?: ExecutionHostId + intent: GatedEmptyWorkspaceReseedIntent ): void { const gate = gateWorktreeAgentActivation(workspaceKey) - const intent: GatedEmptyWorkspaceReseedIntent = { - callerProvidesSurface, - ...(executionHostId ? { executionHostId } : {}) - } latestReseedIntentByGate.set(gate, intent) void gate.then((outcome) => { if (latestReseedIntentByGate.get(gate) !== intent) { return } latestReseedIntentByGate.delete(gate) - if (outcome === 'empty') { - reseedGatedEmptyWorkspace(workspaceKey, intent.callerProvidesSurface, intent.executionHostId) + if (outcome !== 'empty') { + return + } + const awaitsDetection = + intent.seedUserDefaultSurface && emptyWorkspaceDefaultChatAwaitsDetection(workspaceKey) + if (!awaitsDetection && !isEmptyWorkspaceDefaultSurfacePending(workspaceKey)) { + reseedGatedEmptyWorkspace(workspaceKey, intent) + return + } + // Why: the default agent depends on the host's list; seeding before it loads locks in a shell. + // A wait already pending takes this later intent instead, so the latest activation wins. + if (!claimEmptyWorkspaceDefaultSurface(workspaceKey, intent)) { + return + } + const settle = (): void => { + const latestIntent = releaseEmptyWorkspaceDefaultSurface(workspaceKey) + // Re-checks the active workspace, host, and emptiness the wait may have changed. + if (latestIntent) { + reseedGatedEmptyWorkspace(workspaceKey, latestIntent) + } } + void loadEmptyWorkspaceDefaultChatDetection(workspaceKey).then(settle, settle) }) } diff --git a/src/renderer/src/lib/worktree-activation-nav-registration.ts b/src/renderer/src/lib/worktree-activation-nav-registration.ts index 11a0af533292..46ab7f30c632 100644 --- a/src/renderer/src/lib/worktree-activation-nav-registration.ts +++ b/src/renderer/src/lib/worktree-activation-nav-registration.ts @@ -4,13 +4,14 @@ import { } from '@/store/slices/worktree-nav-history' import type { WorktreeNavHistoryViewEntry } from '@/store/slices/worktree-nav-history' -type ActivateFn = (worktreeId: string) => unknown +type ActivateFn = (worktreeId: string, opts: { navigationIntent: 'user-open' }) => unknown type ViewActivateFn = (entry: WorktreeNavHistoryViewEntry) => void export function registerWorktreeActivation( activate: ActivateFn, activateView: ViewActivateFn ): void { - setWorktreeNavActivator(activate) + // Why: back/forward is the user reopening a workspace they chose, like a sidebar click. + setWorktreeNavActivator((worktreeId) => activate(worktreeId, { navigationIntent: 'user-open' })) setWorktreeNavViewActivator(activateView) } diff --git a/src/renderer/src/lib/worktree-activation-store-contract.ts b/src/renderer/src/lib/worktree-activation-store-contract.ts index 3608c9def1c1..66de89e85e35 100644 --- a/src/renderer/src/lib/worktree-activation-store-contract.ts +++ b/src/renderer/src/lib/worktree-activation-store-contract.ts @@ -77,4 +77,7 @@ export type InitialTerminalOptions = { * Setup/issue work still runs, but work that needs no host terminal must not seed a shell * beside the chat the caller is about to create. */ callerProvidesSurface?: boolean + /** The user deliberately opened this workspace with no surface choice, so it may open their + * default agent chat instead of a bare shell. */ + seedUserDefaultSurface?: boolean } diff --git a/src/renderer/src/lib/worktree-activation-surface-selection.ts b/src/renderer/src/lib/worktree-activation-surface-selection.ts index 4385994ff94d..9b78a23cd09a 100644 --- a/src/renderer/src/lib/worktree-activation-surface-selection.ts +++ b/src/renderer/src/lib/worktree-activation-surface-selection.ts @@ -13,6 +13,8 @@ export type WorktreeActivationSurfaceSelection = { agent?: TuiAgent | null /** A navigation caller is about to open its own editor, diff, or other non-terminal surface. */ providesInitialSurface?: boolean + /** Set only where the user deliberately opened this existing workspace; absent keeps the shell seed. */ + navigationIntent?: 'user-open' } export type WorktreeActivationOptions = WorktreeActivationSurfaceSelection & { @@ -38,3 +40,14 @@ export function activationProvidesInitialSurface( ): boolean { return selection?.providesInitialSurface === true || selection?.agent != null } + +/** A deliberate user open with no surface choice: an empty workspace gets the user's default surface. */ +export function activationSeedsUserDefaultSurface( + selection?: WorktreeActivationSurfaceSelection +): boolean { + return ( + selection?.navigationIntent === 'user-open' && + selection.agent === undefined && + selection.providesInitialSurface !== true + ) +} diff --git a/src/renderer/src/lib/worktree-activation.ts b/src/renderer/src/lib/worktree-activation.ts index f2e2ac8f85a9..f63b1189097d 100644 --- a/src/renderer/src/lib/worktree-activation.ts +++ b/src/renderer/src/lib/worktree-activation.ts @@ -28,6 +28,7 @@ import { ensureWebRuntimeWorktreeTerminalAfterWake } from '@/lib/web-runtime-wor import { applyWorktreeNavViewEntry } from '@/lib/worktree-nav-view-history-replay' import { activationProvidesInitialSurface, + activationSeedsUserDefaultSurface, type WorktreeActivationOptions, type WorktreeActivationSurfaceSelection } from './worktree-activation-surface-selection' @@ -47,7 +48,8 @@ export type ActivateAndRevealResult = { function ensureFolderWorkspaceInitialTerminal( folderWorkspace: FolderWorkspace, startup?: WorktreeStartupPayload, - providesInitialSurface?: boolean + providesInitialSurface?: boolean, + seedUserDefaultSurface?: boolean ): string | null { if (providesInitialSurface === true && startup === undefined) { return null @@ -61,7 +63,10 @@ function ensureFolderWorkspaceInitialTerminal( undefined, undefined, undefined, - { reseedEmptiedWorkspace: providesInitialSurface !== true } + { + reseedEmptiedWorkspace: providesInitialSurface !== true, + ...(seedUserDefaultSurface ? { seedUserDefaultSurface: true } : {}) + } ) return primaryTabId } @@ -128,6 +133,7 @@ export function activateAndRevealFolderWorkspace( const workspaceKey = folderWorkspaceKey(folderWorkspaceId) const providesInitialSurface = activationProvidesInitialSurface(opts) + const seedUserDefaultSurface = activationSeedsUserDefaultSurface(opts) state.markWorktreeVisited(workspaceKey) if (!state.isNavigatingHistory) { state.recordWorktreeVisit(workspaceKey) @@ -144,15 +150,20 @@ export function activateAndRevealFolderWorkspace( resumeSleepingAgentSessionsForWorktree(workspaceKey) } if (shouldGateAgentActivation) { - gateAndReseedEmptyWorkspace( - workspaceKey, - opts?.providesInitialSurface === true, - opts?.executionHostId - ) + gateAndReseedEmptyWorkspace(workspaceKey, { + callerProvidesSurface: opts?.providesInitialSurface === true, + seedUserDefaultSurface, + ...(opts?.executionHostId ? { executionHostId: opts.executionHostId } : {}) + }) } const primaryTabId = shouldGateAgentActivation ? null - : ensureFolderWorkspaceInitialTerminal(folderWorkspace, opts?.startup, providesInitialSurface) + : ensureFolderWorkspaceInitialTerminal( + folderWorkspace, + opts?.startup, + providesInitialSurface, + seedUserDefaultSurface + ) if (opts?.revealInSidebar !== false) { state.revealWorktreeInSidebar( @@ -185,6 +196,7 @@ export function activateAndRevealWorktree( opts?.startup || opts?.setup || opts?.defaultTabs || opts?.issueCommand ) const providesInitialSurface = activationProvidesInitialSurface(opts) + const seedUserDefaultSurface = activationSeedsUserDefaultSurface(opts) // Why: a plain reselect should still reveal the sidebar row but must not restamp focus recency or wake persistence. const isPlainAlreadyActiveTerminal = !hasActivationWork && @@ -243,11 +255,11 @@ export function activateAndRevealWorktree( resumeSleepingAgentSessionsForWorktree(worktreeId) } if (shouldGateAgentActivation) { - gateAndReseedEmptyWorkspace( - worktreeId, - opts?.providesInitialSurface === true, - opts?.executionHostId - ) + gateAndReseedEmptyWorkspace(worktreeId, { + callerProvidesSurface: opts?.providesInitialSurface === true, + seedUserDefaultSurface, + ...(opts?.executionHostId ? { executionHostId: opts.executionHostId } : {}) + }) } // 4. Ensure a focusable surface exists for externally-created worktrees @@ -266,6 +278,7 @@ export function activateAndRevealWorktree( ...(opts?.backendStartupTerminalSpawned ? { backendStartupTerminalSpawned: true } : {}), ...(opts?.createNewTerminalForStartup ? { createNewTerminalForStartup: true } : {}), ...(providesInitialSurface ? { callerProvidesSurface: true } : {}), + ...(seedUserDefaultSurface ? { seedUserDefaultSurface: true } : {}), reseedEmptiedWorkspace: !providesInitialSurface } ) diff --git a/src/renderer/src/lib/worktree-initial-terminal-seeding.ts b/src/renderer/src/lib/worktree-initial-terminal-seeding.ts index b0a6296b30e8..feb01ef0b9b5 100644 --- a/src/renderer/src/lib/worktree-initial-terminal-seeding.ts +++ b/src/renderer/src/lib/worktree-initial-terminal-seeding.ts @@ -29,6 +29,8 @@ import { type IssueCommandLaunch } from '@/lib/worktree-setup-issue-command-queue' import { applyDefaultTerminalTabs } from '@/lib/worktree-default-terminal-tabs' +import { openDefaultAgentChatInEmptyWorkspace } from '@/lib/empty-workspace-default-agent-chat' +import { isEmptyWorkspaceDefaultSurfacePending } from '@/lib/empty-workspace-default-surface-claims' function getSetupRunnerCommandPlatformForLaunch(setup: WorktreeSetupLaunch): 'windows' | 'posix' { return getSetupRunnerCommandPlatformForPath( @@ -37,15 +39,22 @@ function getSetupRunnerCommandPlatformForLaunch(setup: WorktreeSetupLaunch): 'wi ) } +export type GatedEmptyWorkspaceReseedIntent = { + callerProvidesSurface: boolean + seedUserDefaultSurface: boolean + executionHostId?: ExecutionHostId +} + /** Re-seed after an empty gate unless its activation owns the surface or no longer owns the host. */ export function reseedGatedEmptyWorkspace( workspaceKey: string, - callerProvidesSurface: boolean, - executionHostId?: ExecutionHostId + intent: GatedEmptyWorkspaceReseedIntent ): void { + const { callerProvidesSurface, seedUserDefaultSurface, executionHostId } = intent const state = useAppStore.getState() if ( callerProvidesSurface === true || + isEmptyWorkspaceDefaultSurfacePending(workspaceKey) || state.activeWorktreeId !== workspaceKey || (executionHostId !== undefined && state.activeWorkspaceExecutionHostId !== executionHostId) ) { @@ -59,7 +68,8 @@ export function reseedGatedEmptyWorkspace( undefined, undefined, { - reseedEmptiedWorkspace: true + reseedEmptiedWorkspace: true, + ...(seedUserDefaultSurface ? { seedUserDefaultSurface: true } : {}) } ) } @@ -216,6 +226,16 @@ export function ensureWorktreeHasInitialTerminal( if (templatedTabId) { return templatedTabId } + if ( + opts?.seedUserDefaultSurface === true && + !hasExplicitLaunchWork && + opts.activateCreatedTabs !== false + ) { + const defaultChat = openDefaultAgentChatInEmptyWorkspace(worktreeId) + if (defaultChat) { + return defaultChat.primaryTabId + } + } // Why: tag this activation-created tab so its PTY spawn doesn't count as activity and reshuffle the Recent sort. // Why: stamp the seeded agent before hooks arrive so native chat and provider chrome can resolve it immediately. diff --git a/src/renderer/src/lib/worktree-jump-navigation.test.ts b/src/renderer/src/lib/worktree-jump-navigation.test.ts index 4c76316556c9..af8072ac9c46 100644 --- a/src/renderer/src/lib/worktree-jump-navigation.test.ts +++ b/src/renderer/src/lib/worktree-jump-navigation.test.ts @@ -57,7 +57,9 @@ describe('worktree jump navigation', () => { expect(mocks.worktreePassesSidebarFilters).not.toHaveBeenCalled() expect(mocks.warning).not.toHaveBeenCalled() - expect(mocks.activateAndRevealWorkspace).toHaveBeenCalledWith('repo::/deleted', {}) + expect(mocks.activateAndRevealWorkspace).toHaveBeenCalledWith('repo::/deleted', { + navigationIntent: 'user-open' + }) }) it('switches the left sidebar to Spaces and warns when filters hide the target', () => { @@ -67,6 +69,7 @@ describe('worktree jump navigation', () => { expect(state.setSidebarBody).toHaveBeenCalledWith('workspaces') expect(mocks.activateAndRevealWorkspace).toHaveBeenCalledWith('repo::/target', { + navigationIntent: 'user-open', revealInSidebar: false, clearSidebarFilters: false }) @@ -98,7 +101,9 @@ describe('worktree jump navigation', () => { expect(jumpToWorktreeFromSidebar('wt-collapsed')).toBe(true) - expect(mocks.activateAndRevealWorkspace).toHaveBeenCalledWith('wt-collapsed', {}) + expect(mocks.activateAndRevealWorkspace).toHaveBeenCalledWith('wt-collapsed', { + navigationIntent: 'user-open' + }) expect(mocks.warning).not.toHaveBeenCalled() }) @@ -121,6 +126,7 @@ describe('worktree jump navigation', () => { expect(jumpToWorktreeFromSidebar('repo::/target', { executionHostId: 'ssh:beta' })).toBe(true) expect(mocks.activateAndRevealWorkspace).toHaveBeenCalledWith('repo::/target', { + navigationIntent: 'user-open', revealInSidebar: false, clearSidebarFilters: false, executionHostId: 'ssh:beta' @@ -134,6 +140,7 @@ describe('worktree jump navigation', () => { expect(jumpToWorktreeFromSidebar('folder:folder-1', { executionHostId: 'local' })).toBe(true) expect(mocks.activateAndRevealWorkspace).toHaveBeenCalledWith('folder:folder-1', { + navigationIntent: 'user-open', executionHostId: 'local' }) // Folder workspaces never get the filter-hidden treatment. diff --git a/src/renderer/src/lib/worktree-jump-navigation.ts b/src/renderer/src/lib/worktree-jump-navigation.ts index bfc0d6dd9364..38721b3337bc 100644 --- a/src/renderer/src/lib/worktree-jump-navigation.ts +++ b/src/renderer/src/lib/worktree-jump-navigation.ts @@ -60,6 +60,7 @@ export function jumpToWorktreeFromSidebar( // Why the workspace dispatcher: it owns the folder-vs-worktree split and the folder path-status gate. const activated = activateAndRevealWorkspace(worktreeId, { + navigationIntent: 'user-open', ...(hiddenBeforeActivation ? { revealInSidebar: false, clearSidebarFilters: false } : {}), ...(options?.executionHostId ? { executionHostId: options.executionHostId } : {}) }) From f4829f03639f1c1b681bd585d108caac1f579248 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:34:29 -0700 Subject: [PATCH 78/90] fix(renderer): stop the modal toast rule from freezing large diffs (#23721) * fix(renderer): stop the modal toast rule from freezing large diffs The rule that lifts toasts above a dialog or sheet backdrop matched body:has( anywhere). Chromium re-evaluates a descendant :has() on body for DOM changes anywhere in the page, so with large Monaco diffs open every editor mutation re-scanned the document and the renderer stopped responding. Dialog and sheet overlays portal straight into body, so matching them as direct children keeps the same behaviour while only changes to body's own children can affect the rule. * fix(renderer): raise modal toasts through a body variable, not a descendant :has() The child-combinator form still ran a whole-page walk after unrelated DOM changes (about 3x cheaper than the original, but still proportional to page size). Setting a custom property from a :has() on body alone takes the rule off that path; only opening or closing a backdrop restyles. * test(renderer): fail the toaster layering guard when the child combinator is dropped The guard only rejected a :has() inside the toaster's selector. Dropping the `>` from the body :has() (or removing the lift rule) still passed, and the unscoped form re-runs on every data-slot element change anywhere in the page, the same freeze the PR fixes. Assert the exact child-only rule shape. --- src/renderer/src/assets/main.css | 10 ++++++---- .../native-chat/native-chat-stop-layering.test.ts | 9 ++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css index 7f555bf724d4..2d999cc48dba 100644 --- a/src/renderer/src/assets/main.css +++ b/src/renderer/src/assets/main.css @@ -409,12 +409,14 @@ [data-sonner-toaster] { font-family: var(--font-sans); - z-index: 40 !important; + z-index: var(--toaster-z-index, 40) !important; } -/* Keep errors above standard modal backdrops at the existing popover tier. */ -body:has([data-slot='dialog-overlay'], [data-slot='sheet-overlay']) [data-sonner-toaster] { - z-index: 60 !important; +/* Keep errors above standard modal backdrops at the existing popover tier. + Why: overlays portal straight into body, and `>` plus a :has() on body alone (not in the toaster's + selector) keeps unrelated DOM changes from rescanning the page; the old form froze large diffs. */ +body:has(> [data-slot='dialog-overlay'], > [data-slot='sheet-overlay']) { + --toaster-z-index: 60; } [data-sonner-toaster] [data-sonner-toast][data-styled='true'] { diff --git a/src/renderer/src/components/native-chat/native-chat-stop-layering.test.ts b/src/renderer/src/components/native-chat/native-chat-stop-layering.test.ts index 26b4009caaa8..4a1f7a7863e3 100644 --- a/src/renderer/src/components/native-chat/native-chat-stop-layering.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-stop-layering.test.ts @@ -16,7 +16,14 @@ describe('native chat layering', () => { expect(source(path)).toContain('\s*\[data-slot='dialog-overlay'\],\s*>\s*\[data-slot='sheet-overlay'\]\)\s*\{\s*--toaster-z-index:\s*60;/ + ) + expect(css).not.toMatch(/:has\([^{]*\)\s+\[data-sonner-toaster\]/) }) it('publishes working state from both structured and bridge chat roots', () => { From b8a7dafafc95945bf389dbba1f01fdc9adb92ee9 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:36:07 -0700 Subject: [PATCH 79/90] fix(codex): guard the daemon socket in the home a resumed Codex pane launches in (#23724) --- .../codex-session-resume-daemon-guard.test.ts | 145 ++++++++++++++++++ .../startup/codex-session-resume-launch.ts | 5 + 2 files changed, 150 insertions(+) create mode 100644 src/main/startup/codex-session-resume-daemon-guard.test.ts diff --git a/src/main/startup/codex-session-resume-daemon-guard.test.ts b/src/main/startup/codex-session-resume-daemon-guard.test.ts new file mode 100644 index 000000000000..aecaadcf8b6c --- /dev/null +++ b/src/main/startup/codex-session-resume-daemon-guard.test.ts @@ -0,0 +1,145 @@ +import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import type { VerifiedCodexResumeSource } from '../codex/codex-session-resume-preparation' +import { + CODEX_DAEMON_OVERRIDE_MARKER, + codexDaemonSocketPathExceedsLimit +} from '../codex/codex-daemon-socket-path-guard' + +const mocks = vi.hoisted(() => ({ + hooksEnabled: false, + systemHomePath: '', + sharedHomePath: '', + installForLaunchPrep: vi.fn(), + refreshRuntimeUserHooksForLaunchPrep: vi.fn(), + ensureRealHomeCodexHookState: vi.fn(async () => {}), + prepareCodexSessionResume: vi.fn(), + prepareLegacySharedCodexSessionResume: vi.fn() +})) + +vi.mock('electron', () => ({ app: { getPath: vi.fn(() => '/tmp/orca-user-data') } })) +vi.mock('../agent-trust-presets', () => ({ markCodexProjectTrusted: async () => {} })) +vi.mock('../codex/hook-service', () => ({ + codexHookService: { + installForLaunchPrep: mocks.installForLaunchPrep, + refreshRuntimeUserHooksForLaunchPrep: mocks.refreshRuntimeUserHooksForLaunchPrep + } +})) +vi.mock('../codex/codex-real-home-hook-install', () => ({ + ensureRealHomeCodexHookState: mocks.ensureRealHomeCodexHookState +})) +vi.mock('../agent-hooks/managed-agent-hook-controls', () => ({ + isAgentStatusHooksEnabled: () => mocks.hooksEnabled +})) +vi.mock('../codex/codex-home-paths', async (importOriginal) => ({ + ...(await importOriginal()), + getSystemCodexHomePath: () => mocks.systemHomePath, + getOrcaManagedCodexHomePath: () => mocks.sharedHomePath +})) +vi.mock('../codex/codex-session-resume-preparation', () => ({ + prepareCodexSessionResume: mocks.prepareCodexSessionResume +})) +vi.mock('../codex/codex-legacy-session-resume', () => ({ + prepareLegacySharedCodexSessionResume: mocks.prepareLegacySharedCodexSessionResume +})) +vi.mock('./main-process-state', () => ({ + mainProcessState: { + codexRuntimeHome: { + isHostSystemDefaultRealHome: () => false, + getHostCodexHomePathsForSessionDiscovery: () => [], + resolveSelectedHostAccountCodexHomePathForResume: () => null + }, + store: { getSettings: () => ({}) } + } +})) + +import { prepareCodexSessionResumeForLaunch } from './codex-session-resume-launch' + +// Why: long enough that the daemon socket overflows sun_path on every host OS. +const LONG_SEGMENT = 'a'.repeat(60) + +describe('Codex session resume daemon socket guard', () => { + let root: string + let accountHome: string + let warn: ReturnType + + beforeEach(() => { + vi.clearAllMocks() + root = mkdtempSync(join(tmpdir(), 'orca-resume-guard-')) + accountHome = join(root, 'codex-accounts', LONG_SEGMENT, 'home') + mocks.systemHomePath = join(root, 'system', LONG_SEGMENT, '.codex') + mocks.sharedHomePath = join(root, 'codex-runtime-home', 'home') + for (const home of [accountHome, mocks.systemHomePath, mocks.sharedHomePath]) { + mkdirSync(home, { recursive: true }) + } + mocks.hooksEnabled = false + mocks.prepareLegacySharedCodexSessionResume.mockResolvedValue({ useRealCodexHome: false }) + mocks.prepareCodexSessionResume.mockImplementation( + async (args: { + resolveVerifiedResumeHome: (source: VerifiedCodexResumeSource) => Promise + }) => ({ + outcome: 'resume' as const, + codexHomePath: await args.resolveVerifiedResumeHome({ + homePath: accountHome, + transcriptPath: join(accountHome, 'sessions', 'abc.jsonl') + }) + }) + ) + warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + }) + + afterEach(() => { + warn.mockRestore() + rmSync(root, { recursive: true, force: true }) + }) + + function resume(): ReturnType { + return prepareCodexSessionResumeForLaunch({ + providerSession: { key: 'session_id', id: 'abc' }, + target: { runtime: 'host' }, + workspacePath: join(root, 'workspace') + }) + } + + it('guards the resumed account home when hook repair fails before mirroring config', async () => { + expect(codexDaemonSocketPathExceedsLimit(accountHome)).toBe(true) + writeFileSync(join(accountHome, 'config.toml'), 'model = "gpt-5"\n', 'utf-8') + mocks.hooksEnabled = true + mocks.installForLaunchPrep.mockRejectedValue(new Error('Could not parse Codex hooks.json')) + + const preparation = await resume() + + expect(preparation).toMatchObject({ outcome: 'resume', codexHomePath: accountHome }) + const config = readFileSync(join(accountHome, 'config.toml'), 'utf-8') + expect(config).toContain('model = "gpt-5"') + expect(config).toContain(`daemon_auto_start = false ${CODEX_DAEMON_OVERRIDE_MARKER}`) + }) + + it('guards the resumed account home when hooks are off and the refresh returns early', async () => { + mocks.refreshRuntimeUserHooksForLaunchPrep.mockResolvedValue({ + agent: 'codex', + state: 'error', + detail: 'Could not read system Codex hooks.json' + }) + + await resume() + + expect(mocks.refreshRuntimeUserHooksForLaunchPrep).toHaveBeenCalledWith(accountHome) + expect(readFileSync(join(accountHome, 'config.toml'), 'utf-8')).toContain( + `daemon_auto_start = false ${CODEX_DAEMON_OVERRIDE_MARKER}` + ) + }) + + it('never writes the guard into the real Codex home a migrated resume runs in', async () => { + expect(codexDaemonSocketPathExceedsLimit(mocks.systemHomePath)).toBe(true) + mocks.prepareLegacySharedCodexSessionResume.mockResolvedValue({ useRealCodexHome: true }) + + const preparation = await resume() + + expect(preparation).toMatchObject({ codexHomePath: mocks.systemHomePath }) + expect(mocks.ensureRealHomeCodexHookState).toHaveBeenCalledTimes(1) + expect(existsSync(join(mocks.systemHomePath, 'config.toml'))).toBe(false) + }) +}) diff --git a/src/main/startup/codex-session-resume-launch.ts b/src/main/startup/codex-session-resume-launch.ts index 0c5e4598de13..1ce7f8c3a15d 100644 --- a/src/main/startup/codex-session-resume-launch.ts +++ b/src/main/startup/codex-session-resume-launch.ts @@ -7,6 +7,7 @@ import { prepareLegacySharedCodexSessionResume } from '../codex/codex-legacy-ses import { ManagedCodexHomeTemporarilyUnavailableError } from '../codex-accounts/host-codex-managed-home-ownership' import { codexHookService } from '../codex/hook-service' import { ensureRealHomeCodexHookState } from '../codex/codex-real-home-hook-install' +import { ensureCodexDaemonSocketGuard } from '../codex/codex-config-mirror' import { isAgentStatusHooksEnabled } from '../agent-hooks/managed-agent-hook-controls' import { markCodexProjectTrusted } from '../agent-trust-presets' import { awaitAgentTrustWriteWithinDeadline } from '../agent-trust-write-deadline' @@ -111,6 +112,10 @@ export async function prepareCodexSessionResumeForLaunch(args: { // Why: hook repair is best-effort; session provenance must still win over the currently selected home. console.warn('[codex-hook-service] failed to prepare automatic resume home:', error) } + if (!isSystemHome) { + // Why: this pins the resumed pane's CODEX_HOME, and hook repair above can skip or fail before its config mirror applies the daemon guard. + ensureCodexDaemonSocketGuard(resumeHome) + } return resumeHome } }) From b7e3bbf3d1302254d00ff0fcd9b072a34bddc617 Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Tue, 29 Sep 2026 07:41:51 +0000 Subject: [PATCH 80/90] fix(browser): restore hover after leaving a mobile viewport preset (#22846) Turning touch emulation off sent maxTouchPoints: 0, which Chromium rejects (it only accepts 1-16, even when disabling). Touch emulation stayed on, so pages kept reporting no hover and a coarse pointer, and the desktop user agent was never restored. Omit maxTouchPoints when disabling so Chromium restores the original value. --- .../browser-manager-viewport-override.test.ts | 3 +- .../browser-manager-viewport-test-fixtures.ts | 18 ++- ...owser-manager-viewport-touch-reset.test.ts | 109 ++++++++++++++++++ src/main/browser/browser-manager-viewport.ts | 12 +- 4 files changed, 135 insertions(+), 7 deletions(-) create mode 100644 src/main/browser/browser-manager-viewport-touch-reset.test.ts diff --git a/src/main/browser/browser-manager-viewport-override.test.ts b/src/main/browser/browser-manager-viewport-override.test.ts index a8a4f3bacd4e..03dd699aa0c0 100644 --- a/src/main/browser/browser-manager-viewport-override.test.ts +++ b/src/main/browser/browser-manager-viewport-override.test.ts @@ -840,8 +840,7 @@ describe('browserManager', () => { expect(debuggerSendCommand).toHaveBeenCalledWith('Emulation.clearDeviceMetricsOverride', {}) expect(debuggerSendCommand).toHaveBeenCalledWith('Emulation.setTouchEmulationEnabled', { - enabled: false, - maxTouchPoints: 0 + enabled: false }) // Nothing overrode the identity, so there is nothing to clear. expect(lastUserAgentOverride(debuggerSendCommand)).toBeUndefined() diff --git a/src/main/browser/browser-manager-viewport-test-fixtures.ts b/src/main/browser/browser-manager-viewport-test-fixtures.ts index 4d6437cf5d95..959e958491c7 100644 --- a/src/main/browser/browser-manager-viewport-test-fixtures.ts +++ b/src/main/browser/browser-manager-viewport-test-fixtures.ts @@ -14,6 +14,22 @@ export async function flushViewportOps(): Promise { } } +// Why: mirrors Chromium, which rejects an out-of-range maxTouchPoints even when disabling touch. +async function rejectInvalidTouchPoints( + method: string, + params?: { maxTouchPoints?: number } +): Promise { + const points = params?.maxTouchPoints + if ( + method === 'Emulation.setTouchEmulationEnabled' && + points !== undefined && + (points < 1 || points > 16) + ) { + throw new Error('Touch points must be between 1 and 16') + } + return undefined +} + export type ViewportGuestHandle = { guest: Record debuggerSendCommand: ReturnType @@ -35,7 +51,7 @@ export function createViewportGuestFactory( mocks: BrowserManagerMocks & { processUserAgent?: string } ): (id: number, url?: string) => ViewportGuestHandle { return function makeGuest(id: number, url = 'https://example.com/'): ViewportGuestHandle { - const debuggerSendCommand = vi.fn().mockResolvedValue(undefined) + const debuggerSendCommand = vi.fn(rejectInvalidTouchPoints) const debuggerIsAttached = vi.fn(() => true) const debuggerAttach = vi.fn() let currentUa = mocks.processUserAgent ?? GUEST_ELECTRON_UA diff --git a/src/main/browser/browser-manager-viewport-touch-reset.test.ts b/src/main/browser/browser-manager-viewport-touch-reset.test.ts new file mode 100644 index 000000000000..ebebd7dad7dd --- /dev/null +++ b/src/main/browser/browser-manager-viewport-touch-reset.test.ts @@ -0,0 +1,109 @@ +import { beforeEach, describe, expect, it, vi } from 'vitest' + +const mocks = vi.hoisted(() => ({ + appGetPathMock: vi.fn(() => '/downloads'), + shellOpenExternalMock: vi.fn(), + browserWindowFromWebContentsMock: vi.fn(), + menuBuildFromTemplateMock: vi.fn(), + guestOffMock: vi.fn(), + guestOnMock: vi.fn(), + guestSetBackgroundThrottlingMock: vi.fn(), + guestSetWindowOpenHandlerMock: vi.fn(), + guestOpenDevToolsMock: vi.fn(), + webContentsFromIdMock: vi.fn(), + screenGetCursorScreenPointMock: vi.fn(() => ({ x: 0, y: 0 })), + openPopupWithOriginBarMock: vi.fn() +})) + +vi.mock('electron', () => ({ + app: { getPath: mocks.appGetPathMock }, + BrowserWindow: { fromWebContents: mocks.browserWindowFromWebContentsMock }, + clipboard: { writeText: vi.fn() }, + shell: { openExternal: mocks.shellOpenExternalMock }, + Menu: { buildFromTemplate: mocks.menuBuildFromTemplateMock }, + screen: { getCursorScreenPoint: mocks.screenGetCursorScreenPointMock }, + webContents: { fromId: mocks.webContentsFromIdMock } +})) +vi.mock('./popup-origin-bar-window', () => ({ + openPopupWithOriginBar: mocks.openPopupWithOriginBarMock +})) +vi.mock('./browser-process-user-agent', () => ({ + getBrowserProcessUserAgentIdentity: () => ({ mode: 'clean', userAgent: GUEST_CLEAN_UA }) +})) + +import { browserManager } from './browser-manager' +import { + rendererWebContentsId, + resetBrowserManagerMocks, + resetBrowserManagerState +} from './browser-manager-test-harness' +import { + createViewportGuestFactory, + flushViewportOps, + GUEST_CLEAN_UA, + type ViewportGuestHandle +} from './browser-manager-viewport-test-fixtures' + +const makeGuest = createViewportGuestFactory(mocks) +const MOBILE = { width: 375, height: 667, deviceScaleFactor: 2, mobile: true } as const +const LAPTOP = { width: 1024, height: 768, deviceScaleFactor: 1, mobile: false } as const + +function registerGuest(id: number, browserPageId: string): ViewportGuestHandle { + const handle = makeGuest(id) + mocks.webContentsFromIdMock.mockReturnValue(handle.guest) + // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the viewport fixture implements every WebContents member these paths touch. + browserManager.attachGuestPolicies(handle.guest as never) + browserManager.registerGuest({ browserPageId, webContentsId: id, rendererWebContentsId }) + return handle +} + +function userAgentWrites( + debuggerSendCommand: ViewportGuestHandle['debuggerSendCommand'] +): string[] { + return debuggerSendCommand.mock.calls.flatMap(([method, params]) => + method === 'Emulation.setUserAgentOverride' && typeof params?.userAgent === 'string' + ? [params.userAgent] + : [] + ) +} + +function startNavigation(url: string): void { + const didStartNavigation = mocks.guestOnMock.mock.calls.findLast( + ([event]) => event === 'did-start-navigation' + )?.[1] + expect(didStartNavigation).toBeTypeOf('function') + didStartNavigation(null, url, false, true) +} + +// Regression for #22749: leaving a mobile preset must actually turn touch emulation off, or the +// guest keeps (hover: none) / coarse pointer and loses every hover style. +describe('browserManager viewport touch reset', () => { + beforeEach(() => { + resetBrowserManagerMocks(mocks) + resetBrowserManagerState() + }) + + it.each([ + ['a desktop preset', LAPTOP], + ['no preset', null] + ])('disables touch emulation when switching from mobile to %s', async (_label, next) => { + const { debuggerSendCommand } = registerGuest(52001, 'tab-touch-reset') + await expect(browserManager.setViewportOverride('tab-touch-reset', MOBILE)).resolves.toBe(true) + debuggerSendCommand.mockClear() + + await expect(browserManager.setViewportOverride('tab-touch-reset', next)).resolves.toBe(true) + + expect(debuggerSendCommand).toHaveBeenCalledWith('Emulation.setTouchEmulationEnabled', { + enabled: false + }) + const writes = userAgentWrites(debuggerSendCommand) + expect(writes.length).toBeGreaterThan(0) + expect(writes.at(-1)).not.toContain('iPhone') + + // A later navigation must not re-install the mobile UA behind the switch. + debuggerSendCommand.mockClear() + startNavigation('https://example.com/next') + await flushViewportOps() + expect(userAgentWrites(debuggerSendCommand).some((ua) => ua.includes('iPhone'))).toBe(false) + }) +}) diff --git a/src/main/browser/browser-manager-viewport.ts b/src/main/browser/browser-manager-viewport.ts index b85e6d0424fb..addd6dc82edf 100644 --- a/src/main/browser/browser-manager-viewport.ts +++ b/src/main/browser/browser-manager-viewport.ts @@ -7,6 +7,10 @@ import { import type { BrowserViewportOverride } from '../../shared/browser-workspace-types' import { BrowserManagerDownloadLifecycle } from './browser-manager-download-lifecycle' +// Why no maxTouchPoints: Chromium rejects values outside 1..16 even when disabling, which left +// touch emulation (and no-hover media features) on after leaving a mobile preset (#22749). +const TOUCH_EMULATION_DISABLED = { enabled: false } as const + export abstract class BrowserManagerViewport extends BrowserManagerDownloadLifecycle { // Why: guests are isolated from Orca's preload bridge, so main owns the devtools escape hatch after a tab→guest lookup. async openDevTools(browserTabId: string): Promise { @@ -158,10 +162,10 @@ export abstract class BrowserManagerViewport extends BrowserManagerDownloadLifec : dbg.sendCommand('Emulation.clearDeviceMetricsOverride', {}) ) const touchApplied = await this.runViewportEmulationStep(browserTabId, 'touch emulation', () => - dbg.sendCommand('Emulation.setTouchEmulationEnabled', { - enabled: override?.mobile ?? false, - maxTouchPoints: override?.mobile ? 5 : 0 - }) + dbg.sendCommand( + 'Emulation.setTouchEmulationEnabled', + override?.mobile ? { enabled: true, maxTouchPoints: 5 } : TOUCH_EMULATION_DISABLED + ) ) if (this.webContentsIdByTabId.get(browserTabId) !== webContentsId) { return false From 357a2fed08339dccd87ec01fd4559f503adde9d4 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:55:45 -0700 Subject: [PATCH 81/90] fix(native-chat): group chat rows by the turn that produced them (#23671) * fix(native-chat): keep a turn's bar on the prompt that opened it A message sent while a structured turn runs appears in the transcript at once, so "the newest user message" is not the running turn's owner. The live "Working for" bar moved to the mid-turn message and counted from the earlier prompt's start, and a send queued behind the running turn counted its wait twice: once in the previous turn and again from its own send. Derive both from the host's turn records in one ordered pass: - The running turn's bar belongs to the user message its lifecycle row names (resolved exactly as settled timing resolves it). A message sent mid-turn gets no bar until its own turn opens; a send folded into the running turn never gets one. Surfaces fall back to the latest user message only when the host names no opener. - A turn counts from its send, but never before the previous turn in the journal ended (its recorded end, else its row's last host revision), capped at the turn's own start. The same origin feeds the live counter and the settled duration. Desktop and mobile share the derivation; no wire, host, or storage change. * feat(native-chat): derive each transcript row's owning turn from the journal Rows between a turn record and the next belong to that record's turn, so a message the provider folds into a running turn no longer captures the rows produced after it. A turn whose opener the host cannot name in the loaded window anchors to its own record instead of a bystander prompt, and shared nativeChatRowTurnKeys keeps positional preceding-user grouping for anything the host does not attribute (older hosts stay pixel-identical). * fix(native-chat): fold and time transcript rows by their owning turn on desktop A settled turn's bar now folds every row the turn produced, including rows after a mid-turn send; the steered bubble stays visible and carries no bar. A provider-opened turn renders its bar above its first row instead of borrowing the newest prompt, and row liveness follows the owning turn rather than the newest user message, so a running turn's rows stay live while a send waits. * fix(mobile): group phone transcript rows and bars by their owning turn Same shared derivation as desktop: the opener's bar owns every row of its turn across a mid-turn send, a steered bubble never grows a bar, a provider-opened turn's bar sits above its first row, and a running turn's tool rows stay live while a newer message waits behind it. * fix(mobile): declare the turn ownership map on the chat controller contract * fix(native-chat): one diff rollup per turn, and no wake-turn clock on a later prompt A turn's rows are no longer contiguous once rows are grouped by owning turn: a prompt sent before the running turn's last row lands among its rows. The diff rollup was drawn at every run boundary, so such a turn showed its rollup twice and the later prompt's rollup appeared under its bubble. It now renders once, under the turn's last row. On the phone, a turn keyed to its own record is not a user message, so when it ended its clock was treated as a replaced optimistic echo and handed to the newest prompt - a message sent during a wake turn got a bar with the wake turn's duration. Host-attributed turn keys now count as live turn keys. * fix(native-chat): keep a Codex turn's bar on its send until the echo lands Codex reports turn/started before it runs hooks and prewarm and before it echoes the send, so for that gap the turn names a provider key no alias resolves yet. Anchoring it to its own record left the running turn with no bar at all; treat the send still in flight ahead of the record as its opener. * fix(codex): restore each turn's record ahead of that turn's items Rows are grouped by the nearest turn record before them in journal order, which holds on the live path because a turn's record is written when the turn opens. Full-history restore (the fallback for Codex app-servers that reject excludeTurns) wrote each turn's items first and its record after, so every restored turn's rows were credited to the previous turn and turn 1's answer folded away. The restore now appends the record before the turn's items. The record itself is unchanged: same identity, state, outcome, opener key, endpoints and duration, one append each. The restore-order test now expects the record first, because that order is what keeps grouping correct; its old order was incidental, not a contract any reader relied on. Readers that key turns by id or opener key, or that scan for the newest record (all restored records are settled), read the same result in either order. Journals already imported in the old order stay as written; no migration. --- .../src/session/MobileNativeChatMessage.tsx | 24 +-- .../src/session/MobileNativeChatOverlay.tsx | 1 + mobile/src/session/MobileNativeChatView.tsx | 6 +- .../mobile-native-chat-controller-contract.ts | 2 + .../use-mobile-native-chat-controller.ts | 1 + ...obile-native-chat-turn-disclosure.test.tsx | 147 +++++++++++++++++- .../use-mobile-native-chat-turn-disclosure.ts | 74 +++++---- .../use-mobile-native-chat-turn-status.ts | 9 +- ...use-mobile-structured-agent-turn-timing.ts | 13 +- ...ured-journal-restore-turn-grouping.test.ts | 98 ++++++++++++ ...-structured-journal-translation-restore.ts | 20 +-- ...journal-translation-turn-lifecycle.test.ts | 3 +- .../native-chat/NativeChatMessageList.tsx | 25 ++- .../NativeChatMessageList.turn-fold.test.tsx | 38 +++++ .../NativeChatStructuredSession.tsx | 1 + .../native-chat/NativeChatTranscriptRow.tsx | 23 +-- .../native-chat-message-rail-items.test.ts | 1 - .../native-chat-rail-outline-parity.test.ts | 1 - .../native-chat-transcript-slots.test.ts | 108 ++++++++++++- .../native-chat-transcript-slots.ts | 43 ++++- .../use-native-chat-message-rail.test.ts | 1 - .../use-structured-agent-session.ts | 1 + .../use-structured-agent-turn-timing.ts | 13 +- src/shared/native-chat-turn-grouping.test.ts | 76 +++++++++ src/shared/native-chat-turn-grouping.ts | 49 ++++++ ...structured-agent-session-turn-bars.test.ts | 135 +++++++++++++++- ...ructured-agent-session-turn-timing.test.ts | 8 +- .../structured-agent-session-turn-timing.ts | 96 ++++++++++-- 28 files changed, 910 insertions(+), 107 deletions(-) create mode 100644 src/main/codex/codex-structured-journal-restore-turn-grouping.test.ts create mode 100644 src/shared/native-chat-turn-grouping.test.ts create mode 100644 src/shared/native-chat-turn-grouping.ts diff --git a/mobile/src/session/MobileNativeChatMessage.tsx b/mobile/src/session/MobileNativeChatMessage.tsx index 08feb9bc7ceb..a2f14196e362 100644 --- a/mobile/src/session/MobileNativeChatMessage.tsx +++ b/mobile/src/session/MobileNativeChatMessage.tsx @@ -73,6 +73,7 @@ function MobileNativeChatMessageImpl({ fontScale = 1, onOpenFile, turnStatus, + turnStatusAbove = false, turnExpanded, turnKey, onToggleTurn, @@ -85,8 +86,10 @@ function MobileNativeChatMessageImpl({ /** Multiplies all chat text sizes for pinch-to-zoom (1 = no change). */ fontScale?: number onOpenFile?: (relativePath: string) => void - /** This settled turn's status row, rendered under its user message. */ + /** This turn's status row, rendered under its opening user message. */ turnStatus?: NativeChatTurnStatus | null + /** Render the status above the row: its turn has no user bubble of its own. */ + turnStatusAbove?: boolean /** Whether the turn caret has disclosed this turn's activity. */ turnExpanded?: boolean /** Set only when this row's turn has settled and can disclose its activity. */ @@ -127,8 +130,18 @@ function MobileNativeChatMessageImpl({ ? null : (subagentLabel ?? NATIVE_CHAT_SUBAGENT_ATTRIBUTION_COPY.unnamed) + const statusRow = turnStatus ? ( + onToggleTurn(turnKey) : undefined} + /> + ) : null return ( <> + {/* A turn with no user bubble carries its bar above its first row. */} + {turnStatusAbove ? statusRow : null} - {turnStatus ? ( - onToggleTurn(turnKey) : undefined} - /> - ) : null} + {turnStatusAbove ? null : statusRow} ) } diff --git a/mobile/src/session/MobileNativeChatOverlay.tsx b/mobile/src/session/MobileNativeChatOverlay.tsx index 31ce1e22550b..00598e6a9678 100644 --- a/mobile/src/session/MobileNativeChatOverlay.tsx +++ b/mobile/src/session/MobileNativeChatOverlay.tsx @@ -77,6 +77,7 @@ export function MobileNativeChatOverlay({ workingStartedAt={controller.nativeChatWorkingStartedAt} settledTurns={controller.nativeChatSettledTurns} activeTurnOpenedBy={controller.nativeChatActiveTurnOpenedBy} + turnKeysByItemId={controller.nativeChatTurnKeysByItemId} streaming={streaming} onStop={controller.handleNativeChatStop} ask={controller.nativeChatAsk} diff --git a/mobile/src/session/MobileNativeChatView.tsx b/mobile/src/session/MobileNativeChatView.tsx index 1184b126c554..d0a6c39cba63 100644 --- a/mobile/src/session/MobileNativeChatView.tsx +++ b/mobile/src/session/MobileNativeChatView.tsx @@ -66,8 +66,10 @@ type Props = { /** Structured lane: host-recorded turn timing feeding the per-turn status rows. */ workingStartedAt?: number | null settledTurns?: NativeChatSettledTurns | null - /** Structured lane: the user message the host says opened the running turn. */ + /** Structured lane: the key the host says anchors the running turn's bar. */ activeTurnOpenedBy?: string | null + /** Structured lane: host-attributed turn ownership per journal item id. */ + turnKeysByItemId?: ReadonlyMap | null /** Interrupt the agent mid-turn (shown as a Stop button on the working bar). */ /** Interrupt a provider turn. */ onStop?: () => void @@ -154,6 +156,7 @@ export function MobileNativeChatView({ workingStartedAt, settledTurns, activeTurnOpenedBy = null, + turnKeysByItemId = null, onStop, streaming, hasMore, @@ -274,6 +277,7 @@ export function MobileNativeChatView({ workingStartedAt, settledTurns, activeTurnOpenedBy, + turnKeysByItemId, thinking: turnIndicator?.thinking === true, activityText: turnIndicator?.activityText ?? null, scopeKey: sendSurfaceId diff --git a/mobile/src/session/mobile-native-chat-controller-contract.ts b/mobile/src/session/mobile-native-chat-controller-contract.ts index 686dac407e77..30bf33d7d512 100644 --- a/mobile/src/session/mobile-native-chat-controller-contract.ts +++ b/mobile/src/session/mobile-native-chat-controller-contract.ts @@ -39,6 +39,8 @@ export type MobileNativeChatController = { nativeChatSettledTurns: NativeChatSettledTurns | null /** Structured lane: the user message the host says opened the running turn. */ nativeChatActiveTurnOpenedBy: string | null + /** Structured lane: the turn that owns each journal item's row. */ + nativeChatTurnKeysByItemId: ReadonlyMap | null nativeChatCanStop: boolean nativeChatStreamingText?: string /** Agent mid-turn, regardless of whether chat is the visible view. */ diff --git a/mobile/src/session/use-mobile-native-chat-controller.ts b/mobile/src/session/use-mobile-native-chat-controller.ts index 7a1fa7c468ec..c14c3e1251c0 100644 --- a/mobile/src/session/use-mobile-native-chat-controller.ts +++ b/mobile/src/session/use-mobile-native-chat-controller.ts @@ -291,6 +291,7 @@ export function useMobileNativeChatController(args: { nativeChatActiveTurnOpenedBy: activeChatStructured ? structuredNativeChat.activeTurnOpenedBy : null, + nativeChatTurnKeysByItemId: activeChatStructured ? structuredNativeChat.turnKeysByItemId : null, nativeChatCanStop: activeChatStructured ? structuredNativeChat.turnId !== null : nativeChatAgentWorking, diff --git a/mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx b/mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx index 1757a8ce65bd..ed0b22dfc1fc 100644 --- a/mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx +++ b/mobile/src/session/use-mobile-native-chat-turn-disclosure.test.tsx @@ -22,6 +22,7 @@ function Harness({ settledTurns, workingStartedAt, activeTurnOpenedBy, + turnKeysByItemId, scopeKey = 'host\0worktree\0tab-a' }: { messages: readonly NativeChatMessage[] @@ -30,6 +31,7 @@ function Harness({ settledTurns?: NativeChatSettledTurns workingStartedAt?: number | null activeTurnOpenedBy?: string | null + turnKeysByItemId?: ReadonlyMap | null scopeKey?: string }): React.JSX.Element { const disclosure = useMobileNativeChatTurnDisclosure({ @@ -39,6 +41,7 @@ function Harness({ settledTurns, workingStartedAt, activeTurnOpenedBy, + turnKeysByItemId, scopeKey }) return createElement('result', { disclosure }) @@ -240,9 +243,9 @@ describe('useMobileNativeChatTurnDisclosure', () => { let [rowA, rowTool, rowB] = rows() expect(rowA.turnStatus).toEqual({ startedAt: 5_000, thinking: false, workedSeconds: null }) expect(rowB.turnStatus).toBeNull() - // Row liveness still follows the transcript's grouping under the newest prompt. - expect(rowTool.activeTurnIsWorking).toBe(false) - expect(rowB.activeTurnIsWorking).toBe(true) + // Liveness follows the owning turn: A's tool row stays live while B waits. + expect(rowTool.activeTurnIsWorking).toBe(true) + expect(rowB.activeTurnIsWorking).toBe(false) // B's own turn opens: A takes the host's settled duration, B counts from A's end. act(() => { @@ -264,6 +267,144 @@ describe('useMobileNativeChatTurnDisclosure', () => { } }) + it("keeps a running turn's rows live across a mid-turn send the host folded in", () => { + vi.useFakeTimers() + try { + vi.setSystemTime(10_000) + const tool = (id: string): NativeChatMessage => ({ + id, + role: 'assistant', + blocks: [ + { type: 'tool-call', name: 'Bash', input: { command: 'sleep 15' }, state: 'running' } + ], + timestamp: null, + source: 'transcript' + }) + // The #23621 shape: B lands mid-turn and the tool rows after it are still A's. + const messages = [userMessage('A'), tool('t1'), userMessage('B'), tool('t2')] + const owned = new Map([ + ['A', 'A'], + ['t1', 'A'], + ['B', 'A'], + ['t2', 'A'] + ]) + act(() => { + renderer = create( + createElement(Harness, { + messages, + enabled: true, + workingStartedAt: 5_000, + activeTurnOpenedBy: 'A', + turnKeysByItemId: owned + }) + ) + }) + const disclosure = renderer!.root.findByType('result').props.disclosure + const [rowA, rowT1, rowB, rowT2] = messages.map((message, index) => + disclosure.resolveRow(index, message) + ) + expect(rowA.turnStatus).toEqual({ startedAt: 5_000, thinking: false, workedSeconds: null }) + // The steered bubble shares A's turn but never carries a bar of its own. + expect(rowB.turnStatus).toBeNull() + expect(rowT1.activeTurnIsWorking).toBe(true) + expect(rowT2.activeTurnIsWorking).toBe(true) + } finally { + vi.useRealTimers() + } + }) + + it("anchors a provider-opened turn's bar above its first row", () => { + vi.useFakeTimers() + try { + vi.setSystemTime(10_000) + const woke: NativeChatMessage = { + id: 'woke', + role: 'assistant', + blocks: [{ type: 'text', text: 'Woke up.' }], + timestamp: null, + source: 'transcript' + } + const messages = [userMessage('u1'), woke] + act(() => { + renderer = create( + createElement(Harness, { + messages, + enabled: true, + isWorking: false, + settledTurns: new Map([['wake', { startedAt: 5_000, workedSeconds: 9 }]]), + turnKeysByItemId: new Map([ + ['u1', 'u1'], + ['woke', 'wake'] + ]) + }) + ) + }) + const disclosure = renderer!.root.findByType('result').props.disclosure + const [rowU1, rowWoke] = messages.map((message, index) => + disclosure.resolveRow(index, message) + ) + expect(rowU1.turnStatus).toBeNull() + expect(rowWoke.turnStatus).toEqual({ startedAt: 5_000, thinking: false, workedSeconds: 9 }) + expect(rowWoke.turnStatusAbove).toBe(true) + } finally { + vi.useRealTimers() + } + }) + + it("never hands a provider-opened turn's clock to a message sent during it", () => { + vi.useFakeTimers() + try { + vi.setSystemTime(10_000) + const row = (id: string): NativeChatMessage => ({ + id, + role: 'assistant', + blocks: [{ type: 'text', text: id }], + timestamp: null, + source: 'transcript' + }) + // A wake turn runs; B is sent during it and folded in, so B opened nothing. + const messages = [row('w1'), userMessage('B'), row('w2')] + const owned = new Map([ + ['w1', 'wake'], + ['B', 'wake'], + ['w2', 'wake'] + ]) + act(() => { + renderer = create( + createElement(Harness, { + messages, + enabled: true, + workingStartedAt: 5_000, + activeTurnOpenedBy: 'wake', + turnKeysByItemId: owned, + settledTurns: new Map([['wake', null]]) + }) + ) + }) + // The wake turn settles: the host no longer names a running turn. + vi.setSystemTime(20_000) + act(() => { + renderer!.update( + createElement(Harness, { + messages, + enabled: true, + isWorking: false, + workingStartedAt: null, + activeTurnOpenedBy: null, + turnKeysByItemId: owned, + settledTurns: new Map([['wake', { startedAt: 5_000, workedSeconds: 15 }]]) + }) + ) + }) + const disclosure = renderer!.root.findByType('result').props.disclosure + const [rowW1, rowB] = messages.map((message, index) => disclosure.resolveRow(index, message)) + expect(rowW1.turnStatus).toEqual({ startedAt: 5_000, thinking: false, workedSeconds: 15 }) + expect(rowB.turnStatus).toBeNull() + } finally { + vi.useRealTimers() + } + }) + it('keeps at most the latest 128 turns expanded', () => { vi.useFakeTimers() try { diff --git a/mobile/src/session/use-mobile-native-chat-turn-disclosure.ts b/mobile/src/session/use-mobile-native-chat-turn-disclosure.ts index 6cbb31c723a4..cc61ba63d89e 100644 --- a/mobile/src/session/use-mobile-native-chat-turn-disclosure.ts +++ b/mobile/src/session/use-mobile-native-chat-turn-disclosure.ts @@ -1,6 +1,11 @@ import { useCallback, useMemo, useState } from 'react' import type { NativeChatMessage } from '../../../src/shared/native-chat-types' +import { NATIVE_CHAT_UNANCHORED_TURN_KEY } from '../../../src/shared/native-chat-turn-status' import type { NativeChatSettledTurns } from '../../../src/shared/native-chat-turn-status' +import { + nativeChatRowTurnKeys, + nativeChatSelfAnchoredTurnRows +} from '../../../src/shared/native-chat-turn-grouping' import { useMobileNativeChatTurnStatus, type NativeChatTurnStatus @@ -8,10 +13,13 @@ import { const EMPTY_TURN_IDS: ReadonlySet = new Set() const EMPTY_TURN_KEYS: readonly undefined[] = [] +const EMPTY_TURN_ANCHORS: ReadonlyMap = new Map() const MAX_EXPANDED_TURNS = 128 export type MobileNativeChatTurnRow = { turnStatus: NativeChatTurnStatus | null + /** The bar renders above the row: its turn has no user bubble of its own. */ + turnStatusAbove?: boolean turnExpanded: boolean /** Set only on a settled turn — the one row that has activity to disclose. */ turnKey?: string @@ -28,6 +36,7 @@ export function useMobileNativeChatTurnDisclosure({ workingStartedAt, settledTurns, activeTurnOpenedBy = null, + turnKeysByItemId = null, thinking = false, activityText = null, scopeKey @@ -38,8 +47,11 @@ export function useMobileNativeChatTurnDisclosure({ workingStartedAt?: number | null /** Host-recorded durations; they outrank whatever this client observed. */ settledTurns?: NativeChatSettledTurns | null - /** The user message the host says opened the running turn; absent, the latest one. */ + /** The key the host says anchors the running turn's bar; absent, the latest user message. */ activeTurnOpenedBy?: string | null + /** Host-attributed turn ownership per journal item id; unnamed rows keep + * positional preceding-user grouping. */ + turnKeysByItemId?: ReadonlyMap | null /** Whether the turn is reasoning right now, derived from its journal content. */ thinking?: boolean /** What the provider says the live turn is doing; outranks the other labels. */ @@ -60,6 +72,7 @@ export function useMobileNativeChatTurnDisclosure({ workingStartedAt, settledTurns, activeTurnOpenedBy, + turnKeysByItemId, thinking, scopeKey }) @@ -87,52 +100,61 @@ export function useMobileNativeChatTurnDisclosure({ }, [scopeKey] ) - // Resolve each row's turn boundary once — a findLast per row is quadratic on a + // Resolve each row's owning turn once — a findLast per row is quadratic on a // long transcript. - const turnKeys = useMemo(() => { - if (!enabled) { - return EMPTY_TURN_KEYS - } - let turnKey: string | undefined - return messages.map((message) => { - if (message.role === 'user') { - turnKey = message.id - } - return turnKey - }) - }, [enabled, messages]) + const turnKeys = useMemo( + () => (enabled ? nativeChatRowTurnKeys(messages, turnKeysByItemId) : EMPTY_TURN_KEYS), + [enabled, messages, turnKeysByItemId] + ) + // A turn with no user bubble (provider-opened) anchors its bar at its first row. + const selfAnchors = useMemo( + () => (enabled ? nativeChatSelfAnchoredTurnRows(messages, turnKeys) : EMPTY_TURN_ANCHORS), + [enabled, messages, turnKeys] + ) const { active, activeTurnKey, completedByTurn } = turnStatuses - // Liveness follows the transcript's own grouping (the latest prompt's rows), not the bar's owner. - const latestTurnKey = turnKeys.at(-1) const activeActivityText = enabled && isWorking ? (activityText ?? null) : null const resolveRow = useCallback( (index: number, message: NativeChatMessage): MobileNativeChatTurnRow => { const turnKey = turnKeys[index] - // The live turn's bar carries its running clock; it settles in place. - const turnStatus = - !enabled || message.role !== 'user' || !turnKey - ? null - : turnKey === activeTurnKey - ? active - : (completedByTurn[turnKey] ?? null) + const anchorsTurnHere = turnKey !== undefined && selfAnchors.get(turnKey) === index + // The live turn's bar carries its running clock; it settles in place. Only + // the bubble that opened a turn carries its bar: a message the provider + // folded into a running turn shares the turn's key but not its bar. + const turnStatus = !enabled + ? null + : message.role === 'user' && message.id === activeTurnKey + ? active + : message.role === 'user' && turnKey === message.id + ? (completedByTurn[turnKey] ?? null) + : anchorsTurnHere + ? turnKey === activeTurnKey + ? (active ?? completedByTurn[turnKey] ?? null) + : (completedByTurn[turnKey] ?? null) + : null return { turnStatus, + ...(anchorsTurnHere && turnStatus !== null ? { turnStatusAbove: true } : {}), turnExpanded: turnKey ? expandedTurnIds.has(turnKey) : false, // Why: the key travels and the row calls one stable handler with it. A // closure per row would be a new identity every render of a streaming // transcript, defeating the row's memo; caching one per turn would mean // writing a ref during render, which react-freeze can discard. turnKey: turnKey && turnStatus?.workedSeconds != null ? turnKey : undefined, - // With no user boundary at all, the session's working state stays authoritative. - activeTurnIsWorking: enabled && isWorking && turnKey === latestTurnKey + // Liveness is the owning turn's, not the newest prompt's: a running turn's + // rows stay live while a newer message waits behind it. + activeTurnIsWorking: + enabled && + isWorking && + (turnKey === activeTurnKey || + (turnKey === undefined && activeTurnKey === NATIVE_CHAT_UNANCHORED_TURN_KEY)) } }, [ turnKeys, + selfAnchors, enabled, activeTurnKey, - latestTurnKey, active, completedByTurn, expandedTurnIds, diff --git a/mobile/src/session/use-mobile-native-chat-turn-status.ts b/mobile/src/session/use-mobile-native-chat-turn-status.ts index 3dac27e1b252..62f6ada8d5e0 100644 --- a/mobile/src/session/use-mobile-native-chat-turn-status.ts +++ b/mobile/src/session/use-mobile-native-chat-turn-status.ts @@ -28,6 +28,7 @@ export function useMobileNativeChatTurnStatus({ workingStartedAt, settledTurns, activeTurnOpenedBy = null, + turnKeysByItemId = null, thinking = false, scopeKey }: { @@ -39,6 +40,9 @@ export function useMobileNativeChatTurnStatus({ settledTurns?: NativeChatSettledTurns | null /** The user message the host says opened the running turn; absent, the latest one. */ activeTurnOpenedBy?: string | null + /** Host-attributed turn ownership; a turn keyed to its own record is still in + * the transcript, so its clock is not an echo to hand to the next prompt. */ + turnKeysByItemId?: ReadonlyMap | null /** Whether the turn is reasoning right now, derived from its journal content. */ thinking?: boolean /** Host/worktree/tab identity. Timings never carry across chat surfaces. */ @@ -72,6 +76,9 @@ export function useMobileNativeChatTurnStatus({ const validTurnKeys = new Set( messages.filter((message) => message.role === 'user').map((message) => message.id) ) + for (const turnKey of turnKeysByItemId?.values() ?? []) { + validTurnKeys.add(turnKey) + } const previousActiveTurnKey = previousActiveTurn.current?.scopeKey === scopeKey ? previousActiveTurn.current.turnKey @@ -92,7 +99,7 @@ export function useMobileNativeChatTurnStatus({ ? current : { scopeKey, timingByTurn: nextTiming } }) - }, [activeTurnKey, enabled, isWorking, messages, scopeKey, workingStartedAt]) + }, [activeTurnKey, enabled, isWorking, messages, scopeKey, turnKeysByItemId, workingStartedAt]) // Why: the selection rebuilds its status objects on every call, and a streaming // turn re-renders ~20x/s. Without this, every settled turn's row gets fresh diff --git a/mobile/src/session/use-mobile-structured-agent-turn-timing.ts b/mobile/src/session/use-mobile-structured-agent-turn-timing.ts index 3559f6925edd..9181856cc0dd 100644 --- a/mobile/src/session/use-mobile-structured-agent-turn-timing.ts +++ b/mobile/src/session/use-mobile-structured-agent-turn-timing.ts @@ -12,7 +12,8 @@ import { } from '../../../src/shared/structured-agent-turn-clock-anchor' /** Host-recorded turn timing for the structured lane: settled durations straight - * off the journal, the user message that owns the running turn's bar, and a + * off the journal, the transcript key that owns the running turn's bar, each + * row's owning turn, and a * skew-free start for the live counter whose host-to-local conversion is latched * once per turn. */ export function useMobileStructuredAgentTurnTiming( @@ -30,8 +31,9 @@ export function useMobileStructuredAgentTurnTiming( settledTurns: NativeChatSettledTurns workingStartedAt: number | null activeTurnOpenedBy: string | null + turnKeysByItemId: ReadonlyMap } { - const { settledTurns, runningTiming, activeTurnOpenedBy } = useMemo( + const { settledTurns, runningTiming, activeTurnOpenedBy, turnKeysByItemId } = useMemo( () => selectStructuredAgentTurnBars(items, submissions, turnId), [items, submissions, turnId] ) @@ -48,5 +50,10 @@ export function useMobileStructuredAgentTurnTiming( if (step.latch !== latch) { setLatch(step.latch) } - return { settledTurns, workingStartedAt: step.workingStartedAt, activeTurnOpenedBy } + return { + settledTurns, + workingStartedAt: step.workingStartedAt, + activeTurnOpenedBy, + turnKeysByItemId + } } diff --git a/src/main/codex/codex-structured-journal-restore-turn-grouping.test.ts b/src/main/codex/codex-structured-journal-restore-turn-grouping.test.ts new file mode 100644 index 000000000000..8ce2591f57c3 --- /dev/null +++ b/src/main/codex/codex-structured-journal-restore-turn-grouping.test.ts @@ -0,0 +1,98 @@ +import { describe, expect, it } from 'vitest' +import type { AgentJournalRenderItem } from '../../shared/agent-session-journal-types' +import { agentJournalItemKey } from '../../shared/agent-session-journal-item-key' +import { nativeChatTurnFold } from '../../shared/native-chat-turn-fold' +import { nativeChatRowTurnKeys } from '../../shared/native-chat-turn-grouping' +import type { NativeChatMessage } from '../../shared/native-chat-types' +import { projectStructuredItemToNativeChat } from '../../shared/structured-agent-session-projection' +import { selectStructuredAgentTurnBars } from '../../shared/structured-agent-session-turn-timing' +import { createCodexJournalTranslator } from './codex-structured-journal-translation' + +const THREAD_ID = 'thread-abc' + +function historicalTurn(index: number): Record { + const id = `turn-${index}` + return { + id, + status: 'completed', + startedAt: 1_700_000_000 + index * 100, + completedAt: 1_700_000_050 + index * 100, + items: [ + { + type: 'userMessage', + id: `user-${index}`, + content: [{ type: 'text', text: `ask ${index}` }] + }, + { type: 'agentMessage', id: `interim-${index}`, text: `looking ${index}` }, + { type: 'agentMessage', id: `answer-${index}`, text: `answer ${index}` } + ] + } +} + +/** What the journal hands a reader after a restore: rows in append order. */ +function restoredJournal(turnCount: number): AgentJournalRenderItem[] { + const items: AgentJournalRenderItem[] = [] + const translator = createCodexJournalTranslator({ + sink: { + appendItem: (identity, body) => { + const sequence = items.length + 1 + items.push({ + itemId: agentJournalItemKey(identity), + revision: 1, + body, + sequence, + observedAt: sequence + }) + }, + appendTombstone: () => {}, + publish: () => {} + }, + sessionId: 'session-1', + primaryThreadId: () => THREAD_ID + }) + const turns = Array.from({ length: turnCount }, (_, index) => historicalTurn(index + 1)) + expect(translator.restoreThread(THREAD_ID, { turns })).toEqual({ accepted: true }) + return items +} + +describe('grouping a Codex thread restored from full history', () => { + it('keeps each turn with its own rows and folds each to its own answer', () => { + const items = restoredJournal(3) + const bars = selectStructuredAgentTurnBars(items, [], null) + const messages = items + .map(projectStructuredItemToNativeChat) + .filter((message): message is NativeChatMessage => message !== null) + const turnKeys = nativeChatRowTurnKeys(messages, bars.turnKeysByItemId) + const opener = (index: number): string => `codex:${THREAD_ID}:turn-${index}:0` + + expect(messages.map((message, index) => [message.role, turnKeys[index]])).toEqual([ + ['user', opener(1)], + ['assistant', opener(1)], + ['assistant', opener(1)], + ['user', opener(2)], + ['assistant', opener(2)], + ['assistant', opener(2)], + ['user', opener(3)], + ['assistant', opener(3)], + ['assistant', opener(3)] + ]) + expect([...bars.settledTurns.keys()]).toEqual([opener(1), opener(2), opener(3)]) + + const { foldedRows } = nativeChatTurnFold({ + rows: messages.map((message, index) => ({ + turnKey: turnKeys[index], + role: message.role, + rendersProse: true, + outlivesTurn: false + })), + settledTurnKeys: new Set(bars.settledTurns.keys()), + expandedTurnKeys: new Set() + }) + const visible = messages.filter((_, index) => !foldedRows.has(index)) + expect(visible.map((message) => message.blocks)).toEqual( + ['ask 1', 'answer 1', 'ask 2', 'answer 2', 'ask 3', 'answer 3'].map((text) => [ + { type: 'text', text } + ]) + ) + }) +}) diff --git a/src/main/codex/codex-structured-journal-translation-restore.ts b/src/main/codex/codex-structured-journal-translation-restore.ts index 7005c10a43b8..5dc68d6f764d 100644 --- a/src/main/codex/codex-structured-journal-translation-restore.ts +++ b/src/main/codex/codex-structured-journal-translation-restore.ts @@ -59,6 +59,17 @@ export function restoreCodexJournalThread(input: { if (!turnId) { continue } + // Ahead of the turn's items, as the live path writes it: readers credit every + // row to the nearest turn record before it. + const lifecycle = input.restoreTurnLifecycle + ? historicalTurnLifecycle(input.threadId, turn) + : null + if (lifecycle) { + const admission = input.restoreTurnLifecycle?.(lifecycle) ?? { accepted: true } + if (!admission.accepted) { + return admission + } + } input.currentTurnIds.set(input.threadId, new Set([turnId])) for (const item of Array.isArray(turn.items) ? turn.items : []) { const admission = input.handleItem({ @@ -72,15 +83,6 @@ export function restoreCodexJournalThread(input: { } input.currentTurnIds.delete(input.threadId) input.ordinals.forgetTurn(input.threadId, turnId) - const lifecycle = input.restoreTurnLifecycle - ? historicalTurnLifecycle(input.threadId, turn) - : null - if (lifecycle) { - const admission = input.restoreTurnLifecycle?.(lifecycle) ?? { accepted: true } - if (!admission.accepted) { - return admission - } - } } input.flush() return { accepted: true } diff --git a/src/main/codex/codex-structured-journal-translation-turn-lifecycle.test.ts b/src/main/codex/codex-structured-journal-translation-turn-lifecycle.test.ts index 62aa5f828a12..6fb589caf4e0 100644 --- a/src/main/codex/codex-structured-journal-translation-turn-lifecycle.test.ts +++ b/src/main/codex/codex-structured-journal-translation-turn-lifecycle.test.ts @@ -533,8 +533,8 @@ describe('codex turn lifecycle rows', () => { }) ).toEqual({ accepted: true }) + // Each record precedes its turn's items, the order the live path writes. expect(tap.rows).toEqual([ - expect.objectContaining({ body: expect.objectContaining({ kind: 'message' }) }), { key: 'legacy:codex:session-1:turn-lifecycle%3Aturn-done', body: { @@ -548,6 +548,7 @@ describe('codex turn lifecycle rows', () => { durationMs: 41_900 } }, + expect.objectContaining({ body: expect.objectContaining({ kind: 'message' }) }), { key: 'legacy:codex:session-1:turn-lifecycle%3Aturn-cut', body: { diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx index d739e0b8d618..ee697732671f 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx @@ -47,6 +47,7 @@ import { selectNativeChatActiveTurnKey, type NativeChatSettledTurns } from '../../../../shared/native-chat-turn-status' +import { nativeChatRowTurnKeys } from '../../../../shared/native-chat-turn-grouping' import { nativeChatTurnDiffs, type NativeChatDiffReveal, @@ -75,6 +76,7 @@ export function NativeChatMessageList({ workingStartedAt, settledTurns, activeTurnOpenedBy, + turnKeysByItemId = null, deliveryNotices, showTurnStatus = true, showLiveTurnActivity = true, @@ -94,8 +96,11 @@ export function NativeChatMessageList({ workingStartedAt?: number | null /** Host-recorded turn durations keyed by user message id (structured lane). */ settledTurns?: NativeChatSettledTurns - /** The user message the host says opened the running turn (structured lane). */ + /** The key the host says anchors the running turn's bar (structured lane). */ activeTurnOpenedBy?: string | null + /** Host-attributed turn ownership per journal item id (structured lane). + * Rows it does not name keep positional preceding-user grouping. */ + turnKeysByItemId?: ReadonlyMap | null onLinkClick?: CommentMarkdownLinkClickHandler allowFileUriLinks?: boolean deliveryNotices?: ReadonlyMap @@ -160,18 +165,12 @@ export function NativeChatMessageList({ const showTypingIndicator = showTurnStatus ? isWorking : shouldShowNativeChatTypingIndicator({ messages, isWorking }) - const currentTurnKey = messages.findLast((message) => message.role === 'user')?.id ?? undefined - // Resolve each row's turn boundary once. Prefix slice/findLast in the render + // Resolve each row's owning turn once. Prefix slice/findLast in the render // loop becomes quadratic for long transcripts. - const turnKeys = useMemo(() => { - let currentTurnKey: string | undefined - return messages.map((message) => { - if (message.role === 'user') { - currentTurnKey = message.id - } - return currentTurnKey - }) - }, [messages]) + const turnKeys = useMemo( + () => nativeChatRowTurnKeys(messages, showTurnStatus ? turnKeysByItemId : null), + [messages, showTurnStatus, turnKeysByItemId] + ) const turnDiffs = useMemo( () => journalItems @@ -201,7 +200,6 @@ export function NativeChatMessageList({ messages, turnKeys, activeTurnKey, - currentTurnKey, receipts, turnStatuses, turnDiffs, @@ -213,7 +211,6 @@ export function NativeChatMessageList({ }), [ activeTurnKey, - currentTurnKey, expandedTurnIds, isWorking, lifecycleWorking, diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.turn-fold.test.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.turn-fold.test.tsx index b80d963bb252..635eef94c35d 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.turn-fold.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.turn-fold.test.tsx @@ -140,6 +140,44 @@ describe('NativeChatMessageList settled turn fold', () => { expect(screen.queryByRole('button', { name: 'Toggle turn details' })).toBeNull() }) + // The #23621 shape: the host folded a mid-turn send into the running turn, so + // the rows after it are still the opener's. One bar under the opener folds + // them all; the steered bubble stays visible and never grows a bar or group. + it("folds the rows after a mid-turn send behind the opener's bar", () => { + const startedAt = Date.now() - 3000 + const base = session(startedAt) + const steer: (typeof base.messages)[number] = { + id: 'mid-b', + role: 'user', + blocks: [{ type: 'text', text: 'Also check the tests.' }], + timestamp: startedAt + 2, + source: 'transcript' + } + const messages = [...base.messages.slice(0, 3), steer, ...base.messages.slice(3)] + const turnKeysByItemId = new Map(messages.map((message) => [message.id, 'user-1'])) + render( + + ) + + expect(screen.getByText('Also check the tests.')).toBeInTheDocument() + expect(screen.queryByText(NARRATION)).toBeNull() + expect(screen.queryByText(MORE_NARRATION)).toBeNull() + const toggles = screen.getAllByRole('button', { name: 'Toggle turn details' }) + expect(toggles).toHaveLength(1) + + fireEvent.click(toggles[0]!) + expect(screen.getByText(NARRATION)).toBeInTheDocument() + expect(screen.getByText(MORE_NARRATION)).toBeInTheDocument() + }) + // The answer is the LAST prose the agent produced. A turn whose final output // is a tool run still answers with the prose before it. it('keeps the last prose row when the turn ends on tool activity', () => { diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx index 2de5591b779e..26f04ae2e3ce 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx @@ -280,6 +280,7 @@ export function NativeChatStructuredSession( workingStartedAt={controller.workingStartedAt} settledTurns={controller.settledTurns} activeTurnOpenedBy={controller.activeTurnOpenedBy} + turnKeysByItemId={controller.turnKeysByItemId} showTurnStatus showLiveTurnActivity={prompt === null} turnActivity={controller.turnActivity} diff --git a/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx b/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx index e5313d24d873..54499e3dc31b 100644 --- a/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx @@ -43,8 +43,20 @@ export const NativeChatTranscriptRow = memo(function NativeChatTranscriptRow({ const { message, turnKey, status, receipt, turnDiff } = slot const predecessors = context.taskListPredecessors.get(message.id) const expanded = turnKey ? context.expandedTurnIds.has(turnKey) : undefined + const statusRow = status ? ( + context.onToggleExpandedTurn(turnKey) : undefined + } + /> + ) : null return (
+ {/* A turn with no user bubble carries its bar above its first row. */} + {slot.statusAbove ? statusRow : null} {receipt ? ( ) : ( @@ -68,16 +80,7 @@ export const NativeChatTranscriptRow = memo(function NativeChatTranscriptRow({ runtimeContext={context.runtimeContext} /> )} - {status ? ( - context.onToggleExpandedTurn(turnKey) : undefined - } - /> - ) : null} + {slot.statusAbove ? null : statusRow} {turnDiff ? ( ) : null} diff --git a/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts b/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts index 3e760a787caf..fa4995b4755f 100644 --- a/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts @@ -44,7 +44,6 @@ function slotsOf(messages: NativeChatMessage[]) { messages, turnKeys, activeTurnKey: selectNativeChatActiveTurnKey(messages), - currentTurnKey: undefined, receipts: new Map(), turnStatuses: { active: null, completedByTurn: {} }, turnDiffs: new Map(), diff --git a/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts b/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts index 5ee40345e1b1..ba8e6fa8f21f 100644 --- a/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts @@ -83,7 +83,6 @@ function loadedRailItems(items: AgentJournalRenderItem[], submissions: AgentJour messages, turnKeys, activeTurnKey: selectNativeChatActiveTurnKey(messages), - currentTurnKey: turn, receipts: new Map(), turnStatuses: { active: null, completedByTurn: {} }, turnDiffs: new Map(), diff --git a/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts b/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts index 5f1fc09b3a14..21e48166e9c8 100644 --- a/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts @@ -40,7 +40,6 @@ function build( messages, turnKeys, activeTurnKey: selectNativeChatActiveTurnKey(messages), - currentTurnKey: undefined, receipts: new Map(), turnStatuses: NO_STATUSES, turnDiffs: new Map(), @@ -208,6 +207,113 @@ describe('a send the host rejected', () => { }) }) +// Rows belong to the turn the host says owns them, not to the nearest preceding +// user bubble. The owned turn keys reshape the fold, the bar and liveness. +describe('turn-owned grouping', () => { + const settled: NativeChatTurnStatus = { startedAt: 1, thinking: false, workedSeconds: 70 } + // The #23621 shape: B lands mid-turn, three tool calls follow, one turn. + const midTurn = [ + text('A', 'go', 'user'), + toolRun('t1'), + text('B', 'and also this', 'user'), + toolRun('t2'), + toolRun('t3'), + toolRun('t4'), + text('answer', 'Done.') + ] + const ownedKeys = midTurn.map(() => 'A') + + it("folds every row of a settled turn behind its opener's bar, across a mid-turn send", () => { + const slots = build(midTurn, { + turnKeys: ownedKeys, + turnStatuses: { active: null, completedByTurn: { A: settled } } + }) + // All four tool rows fold; the steered bubble stays visible with no bar of its own. + expect(slots.map((slot) => [slot.message.id, slot.status ?? null])).toEqual([ + ['A', settled], + ['B', null], + ['answer', null] + ]) + expect(slots[0]?.turnFolds).toBe(true) + }) + + it('returns every row of the turn when the reader opens it', () => { + const slots = build(midTurn, { + turnKeys: ownedKeys, + turnStatuses: { active: null, completedByTurn: { A: settled } }, + expandedTurnKeys: new Set(['A']) + }) + expect(slots.map((slot) => slot.message.id)).toEqual([ + 'A', + 't1', + 'B', + 't2', + 't3', + 't4', + 'answer' + ]) + }) + + it("anchors a provider-opened turn's bar above its first row", () => { + const messages = [text('u1', 'earlier', 'user'), toolRun('w1'), text('done', 'Woke up.')] + const slots = build(messages, { + turnKeys: ['u1', 'wake', 'wake'], + activeTurnKey: 'wake', + turnStatuses: { active: settled, completedByTurn: {} }, + isWorking: true + }) + expect(slots.map((slot) => [slot.message.id, slot.status ?? null, slot.statusAbove])).toEqual([ + ['u1', null, false], + ['w1', settled, true], + ['done', null, false] + ]) + }) + + it("rolls a turn's diff up once, under its last row, when another prompt lands among its rows", () => { + // B opens its own turn but was sent before A's last row was written. + const messages = [ + text('A', 'go', 'user'), + toolRun('t1'), + text('B', 'next', 'user'), + text('a-answer', 'Done with A.'), + toolRun('b1') + ] + const diff = (added: number): NativeChatTurnDiff => ({ + files: [], + added, + removed: 0, + truncated: false + }) + const slots = build(messages, { + turnKeys: ['A', 'A', 'B', 'A', 'B'], + turnDiffs: new Map([ + ['A', diff(1)], + ['B', diff(2)] + ]) + }) + expect( + slots.filter((slot) => slot.turnDiff).map((slot) => [slot.message.id, slot.turnDiff?.added]) + ).toEqual([ + ['a-answer', 1], + ['b1', 2] + ]) + }) + + it("keeps a running turn's rows live while a newer message waits behind it", () => { + const messages = [text('A', 'go', 'user'), toolRun('t1'), text('C', 'next up', 'user')] + const slots = build(messages, { + turnKeys: ['A', 'A', 'C'], + activeTurnKey: 'A', + isWorking: true + }) + expect(slots.map((slot) => [slot.message.id, slot.activeTurnIsWorking])).toEqual([ + ['A', true], + ['t1', true], + ['C', false] + ]) + }) +}) + describe("a subagent's rows speak as that subagent", () => { const settled: NativeChatTurnStatus = { startedAt: 1, thinking: false, workedSeconds: 5 } const roster: NativeChatMessage = { diff --git a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts index 6e0dc5bff4bc..1b20671ce245 100644 --- a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts +++ b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts @@ -15,7 +15,11 @@ import { } from '../../../../shared/native-chat-types' import { agentJournalItemSubagentId } from '../../../../shared/agent-session-journal-producer' import { nativeChatSubagentLabel } from '../../../../shared/native-chat-subagent-attribution' -import type { NativeChatTurnStatus } from '../../../../shared/native-chat-turn-status' +import { + NATIVE_CHAT_UNANCHORED_TURN_KEY, + type NativeChatTurnStatus +} from '../../../../shared/native-chat-turn-status' +import { nativeChatSelfAnchoredTurnRows } from '../../../../shared/native-chat-turn-grouping' import { nativeChatTurnFold, type NativeChatTurnFoldRow @@ -44,6 +48,9 @@ export type NativeChatTranscriptSlot = { receipt: NativeChatResolvedPrompt | undefined /** Turn timing shown under this row, already filtered to "should render". */ status: NativeChatTurnStatus | undefined + /** The bar renders above the row: this turn has no user bubble of its own + * (provider-opened), so its bar sits at the turn's position instead. */ + statusAbove?: boolean /** This row is behind its turn's folded status row: it draws no prose and no * tool activity, only work that outlives the turn. */ folded: boolean @@ -60,9 +67,8 @@ export type NativeChatTranscriptSlot = { export type NativeChatTranscriptSlotsInput = { messages: readonly NativeChatMessage[] turnKeys: readonly (string | undefined)[] - /** The user message whose bar carries the live turn's status. */ + /** The transcript key whose bar carries the live turn's status. */ activeTurnKey: string - currentTurnKey: string | undefined receipts: ReadonlyMap turnStatuses: { active: NativeChatTurnStatus | null @@ -86,7 +92,6 @@ export function buildNativeChatTranscriptSlots( messages, turnKeys, activeTurnKey, - currentTurnKey, receipts, turnStatuses, turnDiffs, @@ -147,19 +152,37 @@ export function buildNativeChatTranscriptSlots( settledTurnKeys, expandedTurnKeys }) + // A turn with no user bubble (provider-opened) anchors its bar at its first row. + const selfAnchors = nativeChatSelfAnchoredTurnRows(messages, turnKeys) + // A turn's rows need not be contiguous (another turn's prompt can land among + // them), so its rollup goes under its last row, not every run boundary. + const lastRowByTurn = new Map() + turnKeys.forEach((turnKey, index) => { + if (turnKey !== undefined) { + lastRowByTurn.set(turnKey, index) + } + }) const slots: NativeChatTranscriptSlot[] = [] for (const [index, message] of messages.entries()) { const turnKey = turnKeys[index] const receipt = receipts.get(message.id) + const anchorsTurnHere = turnKey !== undefined && selfAnchors.get(turnKey) === index + // Only the bubble that opened a turn carries its bar: a message the provider + // folded into a running turn shares the turn's key but not its bar. const candidateStatus = message.role === 'user' && message.id === activeTurnKey ? turnStatuses.active - : message.role === 'user' && turnKey + : message.role === 'user' && turnKey === message.id ? turnStatuses.completedByTurn[turnKey] - : undefined + : anchorsTurnHere + ? turnKey === activeTurnKey + ? (turnStatuses.active ?? turnStatuses.completedByTurn[turnKey]) + : turnStatuses.completedByTurn[turnKey] + : undefined // The live turn's bar carries its running clock; it settles in place. const status = showTurnStatus ? (candidateStatus ?? undefined) : undefined - const turnDiff = turnKey && turnKeys[index + 1] !== turnKey ? turnDiffs.get(turnKey) : undefined + const turnDiff = + turnKey && lastRowByTurn.get(turnKey) === index ? turnDiffs.get(turnKey) : undefined const folded = foldedRows.has(index) // Skipping a folded row entirely is what keeps windowing honest: a counted // index the row declines to draw reserves estimated height for nothing and @@ -173,12 +196,16 @@ export function buildNativeChatTranscriptSlots( slots.push({ message, turnKey, + // Liveness is the owning turn's, not the newest prompt's: a running turn's + // rows stay live while a newer message waits behind it. activeTurnIsWorking: - (currentTurnKey ? turnKey === currentTurnKey : turnKey === undefined) && + (turnKey === activeTurnKey || + (turnKey === undefined && activeTurnKey === NATIVE_CHAT_UNANCHORED_TURN_KEY)) && (isWorking || lifecycleWorking), trailingRun: trailingRunIndexes.has(index), receipt, status: status ?? undefined, + statusAbove: anchorsTurnHere && status !== undefined, folded, turnFolds: turnKey !== undefined && foldableTurnKeys.has(turnKey), turnDiff, diff --git a/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts b/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts index b48025533f48..cbbd819ce223 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts @@ -33,7 +33,6 @@ function slotsOf(messages: NativeChatMessage[]) { messages, turnKeys, activeTurnKey: selectNativeChatActiveTurnKey(messages), - currentTurnKey: undefined, receipts: new Map(), turnStatuses: { active: null, completedByTurn: {} }, turnDiffs: new Map(), diff --git a/src/renderer/src/components/native-chat/use-structured-agent-session.ts b/src/renderer/src/components/native-chat/use-structured-agent-session.ts index d9ca4995b13b..620844881f91 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-session.ts +++ b/src/renderer/src/components/native-chat/use-structured-agent-session.ts @@ -157,6 +157,7 @@ export function useStructuredAgentSession(args: { workingStartedAt: transportState.turnTiming.workingStartedAt, settledTurns: transportState.turnTiming.settledTurns, activeTurnOpenedBy: transportState.turnTiming.activeTurnOpenedBy, + turnKeysByItemId: transportState.turnTiming.turnKeysByItemId, turnActivity: transportState.turnActivity, backgroundTasks: transportState.backgroundTasks, turnId: transportState.turnId, diff --git a/src/renderer/src/components/native-chat/use-structured-agent-turn-timing.ts b/src/renderer/src/components/native-chat/use-structured-agent-turn-timing.ts index 1c26fd9750c2..dd6b16628248 100644 --- a/src/renderer/src/components/native-chat/use-structured-agent-turn-timing.ts +++ b/src/renderer/src/components/native-chat/use-structured-agent-turn-timing.ts @@ -12,7 +12,8 @@ import { } from '../../../../shared/structured-agent-turn-clock-anchor' /** Host-recorded turn timing for the structured lane: settled durations straight - * off the journal, the user message that owns the running turn's bar, and a + * off the journal, the transcript key that owns the running turn's bar, each + * row's owning turn, and a * skew-free start for the live counter whose host-to-local conversion is latched * once per turn. */ export function useStructuredAgentTurnTiming( @@ -30,8 +31,9 @@ export function useStructuredAgentTurnTiming( settledTurns: NativeChatSettledTurns workingStartedAt: number | null activeTurnOpenedBy: string | null + turnKeysByItemId: ReadonlyMap } { - const { settledTurns, runningTiming, activeTurnOpenedBy } = useMemo( + const { settledTurns, runningTiming, activeTurnOpenedBy, turnKeysByItemId } = useMemo( () => selectStructuredAgentTurnBars(items, submissions, turnId), [items, submissions, turnId] ) @@ -48,5 +50,10 @@ export function useStructuredAgentTurnTiming( if (step.latch !== latch) { setLatch(step.latch) } - return { settledTurns, workingStartedAt: step.workingStartedAt, activeTurnOpenedBy } + return { + settledTurns, + workingStartedAt: step.workingStartedAt, + activeTurnOpenedBy, + turnKeysByItemId + } } diff --git a/src/shared/native-chat-turn-grouping.test.ts b/src/shared/native-chat-turn-grouping.test.ts new file mode 100644 index 000000000000..5c6425dd7ed4 --- /dev/null +++ b/src/shared/native-chat-turn-grouping.test.ts @@ -0,0 +1,76 @@ +import { describe, expect, it } from 'vitest' +import type { NativeChatMessage } from './native-chat-types' +import { nativeChatRowTurnKeys, nativeChatSelfAnchoredTurnRows } from './native-chat-turn-grouping' + +function message(id: string, role: NativeChatMessage['role'] = 'assistant'): NativeChatMessage { + return { id, role, blocks: [{ type: 'text', text: id }], timestamp: null, source: 'transcript' } +} + +describe('nativeChatRowTurnKeys', () => { + it('keeps rows after a mid-turn send with the turn that produced them', () => { + // The #23621 shape: B lands mid-turn, three tool rows follow, all one turn. + const messages = [ + message('A', 'user'), + message('t1'), + message('B', 'user'), + message('t2'), + message('t3'), + message('t4') + ] + const owned = new Map([ + ['A', 'A'], + ['t1', 'A'], + ['B', 'A'], + ['t2', 'A'], + ['t3', 'A'], + ['t4', 'A'] + ]) + expect(nativeChatRowTurnKeys(messages, owned)).toEqual(['A', 'A', 'A', 'A', 'A', 'A']) + }) + + it('lets an unmapped user row key itself and unmapped rows inherit it', () => { + // C is an optimistic echo the journal has not admitted yet: positional rules. + const messages = [message('A', 'user'), message('t1'), message('C', 'user'), message('t2')] + const owned = new Map([ + ['A', 'A'], + ['t1', 'A'] + ]) + expect(nativeChatRowTurnKeys(messages, owned)).toEqual(['A', 'A', 'C', 'C']) + }) + + it('reproduces preceding-user grouping exactly when the host attributes nothing', () => { + const messages = [ + message('lead'), + message('A', 'user'), + message('t1'), + message('B', 'user'), + message('t2') + ] + const positional = [undefined, 'A', 'A', 'B', 'B'] + expect(nativeChatRowTurnKeys(messages, null)).toEqual(positional) + expect(nativeChatRowTurnKeys(messages, new Map())).toEqual(positional) + }) + + it('keys a provider-opened turn to a record no message carries', () => { + const messages = [message('A', 'user'), message('t1'), message('t2')] + const owned = new Map([ + ['A', 'A'], + ['t1', 'wake-turn'], + ['t2', 'wake-turn'] + ]) + expect(nativeChatRowTurnKeys(messages, owned)).toEqual(['A', 'wake-turn', 'wake-turn']) + }) +}) + +describe('nativeChatSelfAnchoredTurnRows', () => { + it('anchors a turn with no user bubble at its first rendered row', () => { + const messages = [message('A', 'user'), message('t1'), message('t2'), message('t3')] + const turnKeys = ['A', 'A', 'wake-turn', 'wake-turn'] + expect(nativeChatSelfAnchoredTurnRows(messages, turnKeys)).toEqual(new Map([['wake-turn', 2]])) + }) + + it('never anchors a turn whose key is a rendered message', () => { + const messages = [message('A', 'user'), message('t1')] + expect(nativeChatSelfAnchoredTurnRows(messages, ['A', 'A']).size).toBe(0) + }) +}) diff --git a/src/shared/native-chat-turn-grouping.ts b/src/shared/native-chat-turn-grouping.ts new file mode 100644 index 000000000000..7c181352db5e --- /dev/null +++ b/src/shared/native-chat-turn-grouping.ts @@ -0,0 +1,49 @@ +// Which turn each transcript row belongs to, and where a turn with no user +// bubble anchors its bar. Shared because desktop and mobile both group rows and +// place bars from these keys, and a row grouped differently on each surface is +// the same bug twice. + +import type { NativeChatMessage } from './native-chat-types' + +/** + * Resolve each row's turn key. The host's attribution (`turnKeysByItemId`, from + * `selectStructuredAgentTurnBars`) wins, so rows after a mid-turn send stay with + * the turn that produced them. Rows it cannot name keep positional grouping — + * an unmapped user row keys itself, anything else inherits the previous row's + * key — which on a host without turn attribution is exactly today's + * preceding-user-message grouping. + */ +export function nativeChatRowTurnKeys( + messages: readonly NativeChatMessage[], + turnKeysByItemId?: ReadonlyMap | null +): (string | undefined)[] { + let currentTurnKey: string | undefined + return messages.map((message) => { + const owned = turnKeysByItemId?.get(message.id) + if (owned !== undefined) { + currentTurnKey = owned + return owned + } + if (message.role === 'user') { + currentTurnKey = message.id + } + return currentTurnKey + }) +} + +/** For each turn key with no message of its own — a turn the provider opened, or + * whose opener is outside the loaded window — the row index that anchors its + * bar: the turn's first rendered row, matching the turn's own position. */ +export function nativeChatSelfAnchoredTurnRows( + messages: readonly NativeChatMessage[], + turnKeys: readonly (string | undefined)[] +): ReadonlyMap { + const messageIds = new Set(messages.map((message) => message.id)) + const anchors = new Map() + turnKeys.forEach((turnKey, index) => { + if (turnKey !== undefined && !messageIds.has(turnKey) && !anchors.has(turnKey)) { + anchors.set(turnKey, index) + } + }) + return anchors +} diff --git a/src/shared/structured-agent-session-turn-bars.test.ts b/src/shared/structured-agent-session-turn-bars.test.ts index 0f4732a3aac2..219939d00e69 100644 --- a/src/shared/structured-agent-session-turn-bars.test.ts +++ b/src/shared/structured-agent-session-turn-bars.test.ts @@ -333,7 +333,7 @@ describe('turns whose host names no opener', () => { expect([...selectStructuredAgentSettledTurns(items).keys()]).toEqual(['orca:u1']) }) - it('falls back for a turn the provider opened and keyed to itself', () => { + it('anchors a turn the provider opened to its own record, never a bystander prompt', () => { const self = 'legacy:claude:55368cfb:turn-lifecycle%3Aresumed' const items = [ user(1, 'u1', 1_000), @@ -344,7 +344,37 @@ describe('turns whose host names no opener', () => { userItemId: self }) ] - expect(selectStructuredAgentTurnBars(items, [], 'resumed').activeTurnOpenedBy).toBeNull() + expect(selectStructuredAgentTurnBars(items, [], 'resumed').activeTurnOpenedBy).toBe(self) + }) + + it('keeps the running bar on the send Codex opened a turn for before it echoes it', () => { + // Codex reports turn/started before hooks and prewarm run, so the turn names its + // provider key while the send that opened it is still pending (no alias yet). + const key = 'codex:thread:t2:0' + const items: AgentJournalRenderItem[] = [ + user(1, 'first', 1_000), + turn(2, 1_100, { + turnId: 't1', + state: 'completed', + userItemId: 'orca:first', + startedAt: 1_100, + completedAt: 2_000 + }), + tool(3, 1_500), + user(4, 'second', 3_000), + turn(5, 3_100, { turnId: 't2', state: 'running', startedAt: 3_100, userItemId: key }) + ] + const submissions = [accepted('first', 'claude:first'), accepted('second', null)] + const bars = selectStructuredAgentTurnBars(items, submissions, 't2') + expect(bars.activeTurnOpenedBy).toBe('orca:second') + expect(bars.turnKeysByItemId.get('orca:second')).toBe('orca:second') + // A turn with no send in flight still anchors to its own record. + const selfOpened = selectStructuredAgentTurnBars( + items, + [accepted('first', 'claude:first'), accepted('second', 'claude:second')], + 't2' + ) + expect(selfOpened.activeTurnOpenedBy).toBe('legacy:claude:55368cfb:turn-lifecycle%3At2') }) it('names nothing for the unanchored transcript', () => { @@ -399,3 +429,104 @@ describe('the previous turn has no recorded end', () => { expect(structuredAgentTurnOrigin(queued(12_000))).toBe(9_000) }) }) + +describe('which turn owns each transcript row', () => { + const keysOf = (snapshot: { + turnId: string | null + items: AgentJournalRenderItem[] + submissions: AgentJournalSubmission[] + }) => + selectStructuredAgentTurnBars(snapshot.items, snapshot.submissions, snapshot.turnId) + .turnKeysByItemId + + it('keeps the rows Claude produces after a mid-turn send with the turn that ran them', () => { + // The #23621 shape: B lands mid-turn and three tool calls follow, one turn. + const midTurn = { + turnId: turn1.turnId, + items: [ + user(54, 'A', A.sent), + turn(57, T + 77_224, { + ...turn1, + state: 'running', + startedAt: A.started, + requestedAt: A.sent + }), + tool(58, T + 77_300), + user(60, 'B', B.sent), + tool(61, T + 80_100), + tool(62, T + 80_200), + tool(63, T + 80_300) + ], + submissions: [accepted('A', turn1.userItemId), accepted('B', null)] + } + const keys = keysOf(midTurn) + expect(keys.get('orca:A')).toBe('orca:A') + expect(keys.get('orca:B')).toBe('orca:A') + for (const sequence of [58, 61, 62, 63]) { + expect(keys.get(`orca:claude-tool%3A${sequence}`)).toBe('orca:A') + } + }) + + it('leaves a fresh tail send unowned until the turn proves it continued past it', () => { + // B is the newest row: nothing after it says the running turn absorbed it. + expect(keysOf(whileQueued).has('orca:B')).toBe(false) + // B's own turn opened: B is an opener and keys itself. + expect(keysOf(whileB).get('orca:B')).toBe('orca:B') + expect(keysOf(whileB).get(`orca:claude-tool%3A58`)).toBe('orca:A') + }) + + it('folds a Codex-coalesced send into the turn its provider key names', () => { + const key = 'codex:thread:t1:0' + const items: AgentJournalRenderItem[] = [ + user(1, 'first', 1_000), + { + itemId: 'legacy:codex:s:turn-lifecycle%3At1', + revision: 1, + sequence: 2, + observedAt: 1_200, + body: { + kind: 'turn', + turnId: 't1', + state: 'running', + userItemId: key, + requestedAt: 1_000, + startedAt: 1_200 + } + }, + user(3, 'second', 4_000), + tool(4, 5_000) + ] + const submissions = [accepted('first', key), accepted('second', key)] + const keys = keysOf({ turnId: 't1', items, submissions }) + expect(keys.get('orca:first')).toBe('orca:first') + expect(keys.get('orca:second')).toBe('orca:first') + expect(keys.get('orca:claude-tool%3A4')).toBe('orca:first') + }) + + it('keys a provider-opened turn and its rows to the turn record itself', () => { + const self = 'legacy:claude:55368cfb:turn-lifecycle%3Aresumed' + const items = [ + user(1, 'u1', 1_000), + turn(2, 5_000, { + turnId: 'resumed', + state: 'running', + startedAt: 5_000, + userItemId: self + }), + tool(3, 6_000) + ] + const keys = keysOf({ turnId: 'resumed', items, submissions: [] }) + // u1 predates the wake turn and never opened one: positional grouping keeps it. + expect(keys.has('orca:u1')).toBe(false) + expect(keys.get('orca:claude-tool%3A3')).toBe(self) + }) + + it('attributes nothing for an older host that names no opener', () => { + const items = [ + user(1, 'u1', 1_000), + turn(2, 1_100, { turnId: 't1', state: 'running', startedAt: 1_100 }), + tool(3, 1_200) + ] + expect(keysOf({ turnId: 't1', items, submissions: [] }).size).toBe(0) + }) +}) diff --git a/src/shared/structured-agent-session-turn-timing.test.ts b/src/shared/structured-agent-session-turn-timing.test.ts index ba9af94258ff..1cf2d32db919 100644 --- a/src/shared/structured-agent-session-turn-timing.test.ts +++ b/src/shared/structured-agent-session-turn-timing.test.ts @@ -226,7 +226,7 @@ describe('explicit user-item attribution', () => { expect([...selectStructuredAgentTurnTimings(items).keys()]).toEqual(['claude:s:u1']) }) - it('attributes nothing when a keyed row names a user item nobody journaled', () => { + it('anchors to the record itself when a keyed row names a user item nobody journaled', () => { const items = [ user('orca:first'), lifecycle('auto', { @@ -236,7 +236,11 @@ describe('explicit user-item attribution', () => { completedAt: 2_000 }) ] - expect(selectStructuredAgentTurnTimings(items).size).toBe(0) + // Never the preceding prompt, which did not open this turn; the record's own + // key gives the turn a bar at its own position instead. + expect([...selectStructuredAgentTurnTimings(items).keys()]).toEqual([ + 'legacy:codex:s:turn-lifecycle%3Aauto' + ]) }) it('falls back to journal order only for rows without a key (older hosts)', () => { diff --git a/src/shared/structured-agent-session-turn-timing.ts b/src/shared/structured-agent-session-turn-timing.ts index 9d93639e1817..e760796618c0 100644 --- a/src/shared/structured-agent-session-turn-timing.ts +++ b/src/shared/structured-agent-session-turn-timing.ts @@ -75,9 +75,12 @@ function readTiming( /** One turn record, read in journal order. */ type StructuredAgentJournalTurn = { timing: StructuredAgentTurnTiming | null - /** The user message the host names as the turn's opener; null when it names - * none (an older host, or a turn the provider opened and keyed to itself). */ - openedBy: string | null + /** The transcript key that anchors this turn's bar and owns its rows: the + * opener user item when the host names one it can resolve (or the send still + * in flight ahead of the record), else the turn record's own item (a turn the + * provider opened, or an opener outside the loaded window). Null only for an + * older host that names nothing. */ + key: string | null } type StructuredAgentJournalTurns = { @@ -105,13 +108,24 @@ function readStructuredAgentJournalTurns( aliases.set(submission.providerItemId, agentJournalSubmissionKey(submission.clientMessageId)) } } + // Sends not yet matched to a provider item. Codex reports a turn open before it + // echoes the send, so for that gap the turn names a key no alias resolves yet. + const inFlight = new Set( + submissions + .filter((submission) => submission.dispatchState === 'pending' && !submission.providerItemId) + .map((submission) => agentJournalSubmissionKey(submission.clientMessageId)) + ) const byUserItem = new Map() const byTurnId = new Map() let precedingUserItemId: string | null = null + let inFlightSinceLastTurn: string | null = null let precedingTurnEndedAt: number | undefined for (const item of items) { if (item.body.kind === 'message' && item.body.role === 'user') { precedingUserItemId = item.itemId + if (inFlightSinceLastTurn === null && inFlight.has(item.itemId)) { + inFlightSinceLastTurn = item.itemId + } continue } const turn = readAgentJournalTurn(item.body) @@ -122,14 +136,16 @@ function readStructuredAgentJournalTurns( precedingTurnEndedAt = timing?.completedAt ?? item.observedAt const key = turn.userItemId const named = key === undefined ? null : itemIds.has(key) ? key : (aliases.get(key) ?? null) - byTurnId.set(turn.turnId, { - timing, - openedBy: named === item.itemId ? null : named - }) + // An unresolved opener is the send still in flight ahead of this record; with none, + // it is outside the window, and the turn anchors to its own record like a + // provider-opened one — never to a preceding prompt that did not open it. + const turnKey = key === undefined ? null : (named ?? inFlightSinceLastTurn ?? item.itemId) + inFlightSinceLastTurn = null + byTurnId.set(turn.turnId, { timing, key: turnKey }) if (!timing && turn.state !== 'unverifiable') { continue } - const userItemId = key === undefined ? precedingUserItemId : named + const userItemId = key === undefined ? precedingUserItemId : turnKey if (userItemId !== null) { byUserItem.set(userItemId, timing) } @@ -137,6 +153,58 @@ function readStructuredAgentJournalTurns( return { byUserItem, byTurnId } } +/** + * Which turn owns each journal item, as the transcript groups rows: every item + * between a turn record and the next belongs to that record's turn (the record + * is appended when the turn opens and revised in place, and an opener's user + * item is written ahead of dispatch, so journal order is turn order). A user + * item that opened any turn — even a later one it queued for — keys itself; one + * the provider folded into a running turn (a steer) takes that turn's key, but + * only once the turn produces more rows after it, so a fresh tail send is not + * pulled into the turn it is merely waiting behind. Items before the first turn + * record stay absent, and the surface keeps its positional grouping for them. + */ +function turnKeysByItemIdOf( + items: readonly AgentJournalRenderItem[], + byTurnId: ReadonlyMap +): ReadonlyMap { + const openers = new Set() + for (const turn of byTurnId.values()) { + if (turn.key !== null) { + openers.add(turn.key) + } + } + const keys = new Map() + let currentKey: string | null = null + // User items folded into the current turn, held until a later row proves the + // turn continued past them. + let pendingUserItemIds: string[] = [] + for (const item of items) { + const turn = readAgentJournalTurn(item.body) + if (turn) { + currentKey = byTurnId.get(turn.turnId)?.key ?? null + pendingUserItemIds = [] + continue + } + if (item.body.kind === 'message' && item.body.role === 'user') { + if (openers.has(item.itemId)) { + keys.set(item.itemId, item.itemId) + } else if (currentKey !== null) { + pendingUserItemIds.push(item.itemId) + } + continue + } + if (currentKey !== null) { + for (const userItemId of pendingUserItemIds) { + keys.set(userItemId, currentKey) + } + pendingUserItemIds = [] + keys.set(item.itemId, currentKey) + } + } + return keys +} + export function selectStructuredAgentTurnTimings( items: readonly AgentJournalRenderItem[], submissions: readonly AgentJournalSubmission[] = [] @@ -237,8 +305,9 @@ function settledTurnsOf( } /** Everything a chat surface reads off the journal for its turn bars, from one - * pass: settled durations, the running turn's timing, and the user message that - * owns its bar — which a message sent while the turn runs is not. */ + * pass: settled durations, the running turn's timing, the item that anchors its + * bar — which a message sent while the turn runs is not — and which turn owns + * each row of the transcript. */ export function selectStructuredAgentTurnBars( items: readonly AgentJournalRenderItem[], submissions: readonly AgentJournalSubmission[], @@ -246,13 +315,18 @@ export function selectStructuredAgentTurnBars( ): { settledTurns: NativeChatSettledTurns runningTiming: StructuredAgentTurnTiming | null + /** The transcript key the running turn's bar anchors to: its opening user + * message, or the turn record itself when the provider opened the turn. + * Null on an older host, where the newest user message stays the anchor. */ activeTurnOpenedBy: string | null + turnKeysByItemId: ReadonlyMap } { const turns = readStructuredAgentJournalTurns(items, submissions) const running = turnId === null ? undefined : turns.byTurnId.get(turnId) return { settledTurns: settledTurnsOf(turns, submissions), runningTiming: running?.timing ?? null, - activeTurnOpenedBy: running?.openedBy ?? null + activeTurnOpenedBy: running?.key ?? null, + turnKeysByItemId: turnKeysByItemIdOf(items, turns.byTurnId) } } From bd133058a933af1ed80a42f84c05ef1cb7592936 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:57:55 -0700 Subject: [PATCH 82/90] refactor(sidebar): one subagent row for CLI and structured children, shared with the chat strip (#22565) * test(sidebar): pin today's subagent rows and chat strip rows from legacy shapes Captured on the unmodified renderer: the compact and full sidebar child rows built from a legacy subagents snapshot, and the expanded chat strip built from a legacy background-task roster. A host that sends only these shapes must keep rendering exactly these rows. * refactor(sidebar): one subagent row for CLI and structured children, shared with the chat strip A child row's dot, name and detail are now decided once, by a shared row model (src/shared/agent-child-row-model.ts), and rendered by one piece (AgentChildRowContent) that both the sidebar's child rows and the chat strip use. The model reads the host's child views when a session publishes them and today's legacy shapes otherwise (the subagents snapshot for the sidebar, the task roster for the strip), so old hosts and CLI panes render exactly as before. From views it keeps what the legacy path lost: a finished subagent whose shell still runs reads monitoring through the shared child fold, a settled child reads by its outcome, the tool it runs shows as the CLI row shows it, and each row keeps its own clock. In the strip, work a child owns renders nested beneath it. * i18n: add the child row's Ended and ended-ago strings to every catalog * test(sidebar): a child reads the same in the sidebar and the chat strip A row-model table for every display state, and a parity table that renders the same child views through the compact sidebar row and the chat strip and asserts both show the same dot, name and detail. Covers a finished subagent whose shell still runs (monitoring on both, no stale tool text), sibling rows with their own clocks, a settled row timed from when it ended, and owned shells nested under their owner in the strip. The strip's view input is named childViews so it cannot be mistaken for React children. * fix(sidebar): keep the child display derivation loadable in the renderer The row model imported deriveAgentChildDisplayState from the view module, whose owner resolution reaches status subjects and, through them, agent-hook-relay's node:crypto. The renderer cannot evaluate that chunk, so the app booted blank (the renderer node-builtin boundary test fails on the previous commit). The display derivation (agentChildWorkOwnedLiveness, deriveAgentChildDisplayState, AgentChildDisplayState) now lives in agent-status-child-work-display.ts, which imports only the fold, liveness and the one-pass grouping both modules share (grouped-by.ts); the view module keeps the host-side projection. * fix(sidebar): the strip reads its parent's verdict, and the full row says Ended Review fixes: - The strip's view path took no freshness input, so once views are wired the same lost child would read unverifiable in the sidebar and working in the strip. agentChildRowContextForParent builds the one context a parent row gives its children; the sidebar uses it, and buildBackgroundTaskGroupsFromViews / the strip's new optional childRowContext prop accept it (absent: claims stand as reported, as before). - The full sidebar row showed no word for a child that ended with no outcome; its message line now reads the row model's (the message, or Ended). An unlabeled child falls back to its display state there too. - The summary order now includes failed, so a failed row is never dropped from the counts. - Parity now covers the full row for every state, a live parked child, an unlabeled child, and a lost or stale parent on both surfaces. * refactor(agent-status): the subagent snapshot, its normalization and equality get their own module agent-status-types.ts crossed the file-size limit once the row gained child views beside the main agent fact. The subagent snapshot shape, its admission normalization and the array equality move into agent-status-subagent-snapshot.ts (re-exported, so importers are unchanged); the three field caps it shares with the row move to the field normalization. * refactor(sidebar): one legacy builder family, one reader clock, frozen settled rows - The chat strip's task-roster rows are built in the shared row model beside the other two builders, with one placeholder set and the one detail rule. The module header states when each legacy builder is deleted. - A child's "No update" duration reads the parent's reader clock (receipt time for a mirrored parent); a view child's own stamp is moved onto that clock. The full sidebar row reads the same value as the compact row. - The failed->blocked / interrupted->idle collapse has one owner, shared by the sidebar row state and the strip header. - A settled strip row shows its run frozen at settledAt instead of a growing "ended N ago", so a strip of only finished work never wakes the 1 Hz tick. * test(sidebar): the sidebar row state and the strip header share one lifecycle word * test(sidebar): a child running a shell in its turn shows its Bash line with the shell nested beneath it While a child's turn runs its shell, the host records the shell both as the child's operation and as a live command the child owns. The strip shows the child working its Bash line with the shell row nested beneath it, the header counts only the agent, and the sidebar shows the child alone with the same text. * test(sidebar): re-pin the legacy chat strip golden to main's scoped goal-dock selector Main's #23725 rewrote the strip's goal-dock variants from `group-has-[...]/tasks:` to an ancestor-scoped `[[data-native-chat-background-tasks]:has(+[data-native-chat-thread-goal])_&]:` selector. The merged head renders byte-identically to main for this fixture; only the golden was captured before that change. --- .../codex/codex-child-work-evidence.test.ts | 6 +- ...dex-structured-child-work-producer.test.ts | 6 +- .../src/components/AgentChildRowContent.tsx | 58 ++ .../agent-child-row-parity.test.tsx | 631 ++++++++++++++++++ .../src/components/agent-child-row-text.ts | 69 ++ .../dashboard/DashboardAgentRow.tsx | 36 +- .../dashboard/agent-finished-timestamp.ts | 8 +- .../components/dashboard/useDashboardData.ts | 3 + .../NativeChatBackgroundTasksStatus.test.tsx | 44 ++ .../NativeChatBackgroundTasksStatus.tsx | 164 +++-- .../background-task-header-content.ts | 4 +- .../background-task-roster.test.ts | 20 +- .../native-chat/background-task-roster.ts | 133 ++-- ...nt-child-row-fallback-pixels.test.tsx.snap | 46 ++ ...ubagent-child-row-fallback-pixels.test.tsx | 237 +++++++ .../worktree-card-agent-summary.test.ts | 30 +- .../sidebar/worktree-card-agent-summary.ts | 7 +- .../worktree-card-compact-agent-row.tsx | 77 ++- .../sidebar/worktree-subagent-child-rows.ts | 136 ++-- src/renderer/src/i18n/locales/en.json | 3 + src/renderer/src/i18n/locales/es.json | 3 + src/renderer/src/i18n/locales/fr.json | 3 + src/renderer/src/i18n/locales/ja.json | 3 + src/renderer/src/i18n/locales/ko.json | 3 + src/renderer/src/i18n/locales/zh.json | 3 + src/renderer/src/lib/agent-row-dot-state.ts | 21 +- src/shared/agent-child-row-model.test.ts | 384 +++++++++++ src/shared/agent-child-row-model.ts | 376 +++++++++++ src/shared/agent-status-child-work-display.ts | 114 ++++ .../agent-status-child-work-view.test.ts | 4 +- src/shared/agent-status-child-work-view.ts | 99 +-- .../agent-status-field-normalization.ts | 7 +- src/shared/agent-status-subagent-snapshot.ts | 108 +++ src/shared/agent-status-types.ts | 130 +--- src/shared/grouped-by.ts | 14 + 35 files changed, 2542 insertions(+), 448 deletions(-) create mode 100644 src/renderer/src/components/AgentChildRowContent.tsx create mode 100644 src/renderer/src/components/agent-child-row-parity.test.tsx create mode 100644 src/renderer/src/components/agent-child-row-text.ts create mode 100644 src/renderer/src/components/sidebar/__snapshots__/subagent-child-row-fallback-pixels.test.tsx.snap create mode 100644 src/renderer/src/components/sidebar/subagent-child-row-fallback-pixels.test.tsx create mode 100644 src/shared/agent-child-row-model.test.ts create mode 100644 src/shared/agent-child-row-model.ts create mode 100644 src/shared/agent-status-child-work-display.ts create mode 100644 src/shared/agent-status-subagent-snapshot.ts create mode 100644 src/shared/grouped-by.ts diff --git a/src/main/codex/codex-child-work-evidence.test.ts b/src/main/codex/codex-child-work-evidence.test.ts index 0f3605bee228..9013b07a6745 100644 --- a/src/main/codex/codex-child-work-evidence.test.ts +++ b/src/main/codex/codex-child-work-evidence.test.ts @@ -5,9 +5,9 @@ import type { AgentChildWorkEvidence } from '../../shared/agent-status-child-wor import { reconcileAgentChildWorkEvidence } from '../../shared/agent-status-child-work-reconciliation' import { agentChildWorkOwnedLiveness, - deriveAgentChildDisplayState, - projectAgentChildWorkViews -} from '../../shared/agent-status-child-work-view' + deriveAgentChildDisplayState +} from '../../shared/agent-status-child-work-display' +import { projectAgentChildWorkViews } from '../../shared/agent-status-child-work-view' import { createAgentStatusStore } from '../../shared/agent-status-store' import { makeStructuredAgentStatusSubject } from '../../shared/agent-status-subject' import type { CodexBackgroundTaskEvent } from './codex-background-task-frames' diff --git a/src/main/codex/codex-structured-child-work-producer.test.ts b/src/main/codex/codex-structured-child-work-producer.test.ts index 44d4463a30d7..fc011d48bb9e 100644 --- a/src/main/codex/codex-structured-child-work-producer.test.ts +++ b/src/main/codex/codex-structured-child-work-producer.test.ts @@ -12,9 +12,9 @@ import { agentChildWorkLiveness } from '../../shared/agent-status-child-work-liv import { reconcileAgentChildWorkEvidence } from '../../shared/agent-status-child-work-reconciliation' import { agentChildWorkOwnedLiveness, - deriveAgentChildDisplayState, - projectAgentChildWorkViews -} from '../../shared/agent-status-child-work-view' + deriveAgentChildDisplayState +} from '../../shared/agent-status-child-work-display' +import { projectAgentChildWorkViews } from '../../shared/agent-status-child-work-view' import { createAgentStatusStore } from '../../shared/agent-status-store' import { agentJournalLinkageFields } from '../../shared/agent-session-journal-producer' import type { diff --git a/src/renderer/src/components/AgentChildRowContent.tsx b/src/renderer/src/components/AgentChildRowContent.tsx new file mode 100644 index 000000000000..717b8438a0b8 --- /dev/null +++ b/src/renderer/src/components/AgentChildRowContent.tsx @@ -0,0 +1,58 @@ +import React from 'react' +import type { AgentChildRowModel } from '../../../shared/agent-child-row-model' +import { AgentStateDot } from '@/components/AgentStateDot' +import type { StateIndicatorTooltipSide } from '@/components/StateIndicatorTooltip' +import { agentChildRowText } from './agent-child-row-text' + +type AgentChildRowContentProps = { + row: AgentChildRowModel + now: number + /** Surface tone for the name and the detail; the words themselves are the row's. */ + leadClassName: string + trailClassName: string + separator: string + /** Overrides the dot's hover label; null suppresses it for an existing tooltip. */ + dotTitle?: string | null + tooltipSide?: StateIndicatorTooltipSide + /** Name the whole line on hover, for surfaces that truncate it tightly. */ + lineTitle?: boolean +} + +/** + * A child row's state dot, name and detail: the one piece the sidebar's child rows and the chat + * strip's rows both render, so the same child reads the same on both. + */ +export const AgentChildRowContent = React.memo(function AgentChildRowContent({ + row, + now, + leadClassName, + trailClassName, + separator, + dotTitle, + tooltipSide, + lineTitle = false +}: AgentChildRowContentProps): React.JSX.Element { + const { lead, trail } = agentChildRowText(row, now) + return ( + <> + + + {lead} + {trail ? ( + + {separator} + {trail} + + ) : null} + + + ) +}) diff --git a/src/renderer/src/components/agent-child-row-parity.test.tsx b/src/renderer/src/components/agent-child-row-parity.test.tsx new file mode 100644 index 000000000000..c8e3b4bd1900 --- /dev/null +++ b/src/renderer/src/components/agent-child-row-parity.test.tsx @@ -0,0 +1,631 @@ +/** @vitest-environment happy-dom */ +import { renderToStaticMarkup } from 'react-dom/server' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { + agentChildRowContextForParent, + type AgentChildRowContext +} from '../../../shared/agent-child-row-model' +import type { AgentSessionBackgroundTask } from '../../../shared/agent-session-wire' +import type { AgentChildWorkView } from '../../../shared/agent-status-child-work-view' +import type { AgentStatusEntry } from '../../../shared/agent-status-types' +import type { TerminalTab } from '../../../shared/terminal-tab-types' +import DashboardAgentRow from '@/components/dashboard/DashboardAgentRow' +import { NativeChatBackgroundTasksStatus } from '@/components/native-chat/NativeChatBackgroundTasksStatus' +import { buildBackgroundTaskGroupsFromViews } from '@/components/native-chat/background-task-roster' +import { CompactAgentRow } from '@/components/sidebar/worktree-card-compact-agent-row' +import { buildSubagentChildRows } from '@/components/sidebar/worktree-subagent-child-rows' +import { TooltipProvider } from '@/components/ui/tooltip' + +vi.mock('@/components/dashboard/use-agent-row-conversation-name', () => ({ + useAgentRowConversationName: () => null +})) + +vi.mock('@/components/sidebar/CacheTimer', () => ({ + default: () => null, + usePromptCacheCountdownForPane: () => null +})) + +const NOW = 1_000_000 +const MINUTE = 60_000 + +beforeEach(() => { + vi.useFakeTimers() + vi.setSystemTime(NOW) +}) + +afterEach(() => { + vi.useRealTimers() +}) + +const tab: TerminalTab = { + id: 'parent-tab', + ptyId: null, + worktreeId: 'wt-1', + title: 'Parent', + customTitle: null, + color: null, + sortOrder: 0, + createdAt: 1 +} + +function view(id: string, overrides: Partial = {}): AgentChildWorkView { + return { + id, + providerId: `task-${id}`, + kind: 'agent', + description: 'Audit the parser', + agentType: 'general-purpose', + state: 'working', + membership: 'live', + firstObservedAt: NOW - 5 * MINUTE, + observedAt: NOW - 2 * MINUTE, + stoppable: true, + invocation: { invocationId: `spawn-${id}`, generation: 1 }, + ...overrides + } +} + +function settled( + outcome: NonNullable, + overrides: Partial = {} +): AgentChildWorkView { + return view('child', { + state: 'done', + membership: 'settled', + outcome, + settledAt: NOW - 3 * MINUTE, + ...overrides + }) +} + +const OWNED_SHELL = view('shell', { + kind: 'command', + description: 'npm run dev', + agentType: undefined, + state: 'monitoring', + parentChildWorkId: 'child' +}) + +function parentWith(children: AgentChildWorkView[], updatedAt = NOW): AgentStatusEntry { + return { + paneKey: 'parent-tab:leaf-1', + tabId: tab.id, + worktreeId: tab.worktreeId, + state: 'done', + prompt: 'parent prompt', + updatedAt, + stateStartedAt: NOW - 20 * MINUTE, + stateHistory: [], + children + } +} + +type RenderedRow = { dot: string; lead: string; trail: string } + +function readRow(root: Element, separator: string): RenderedRow { + const text = root.querySelector('span.truncate') + const [lead, trail] = [...(text?.children ?? [])].map((span) => span.textContent ?? '') + return { + dot: root.querySelector('[aria-label]')?.getAttribute('aria-label') ?? '', + lead: lead ?? '', + trail: trail?.startsWith(separator) ? trail.slice(separator.length) : (trail ?? '') + } +} + +function mount(markup: string): HTMLElement { + const container = document.createElement('div') + container.innerHTML = markup + return container +} + +function sidebarRows(parent: AgentStatusEntry, parentIsFresh = true): RenderedRow[] { + return buildSubagentChildRows({ parentEntry: parent, tab, parentIsFresh }).map((agent) => + readRow( + mount( + renderToStaticMarkup( + + {}} /> + + ) + ), + ' - ' + ) + ) +} + +function stripRows( + children: AgentChildWorkView[] | undefined, + childRowContext?: AgentChildRowContext, + tasks: AgentSessionBackgroundTask[] = [] +): RenderedRow[] { + const root = mount( + renderToStaticMarkup( + {}} + onStop={() => {}} + /> + ) + ) + return [...root.querySelectorAll('li')] + .filter((row) => row.querySelector(':scope > span.truncate')) + .map((row) => readRow(row, ' · ')) +} + +/** The full sidebar row: every dot label it carries, and its whole text. */ +function fullRow(parent: AgentStatusEntry): { labels: string[]; text: string } { + const [agent] = buildSubagentChildRows({ parentEntry: parent, tab, parentIsFresh: true }) + const root = mount( + renderToStaticMarkup( + + {}} + onDismiss={() => {}} + stateDotSize="sm" + hideExpand + /> + + ) + ) + return { + labels: [...root.querySelectorAll('[aria-label]')].map( + (element) => element.getAttribute('aria-label') ?? '' + ), + text: root.textContent ?? '' + } +} + +const SCENARIOS: [string, AgentChildWorkView[], RenderedRow][] = [ + [ + 'working, no known operation', + [view('child')], + { dot: 'Working', lead: 'Audit the parser', trail: 'general-purpose' } + ], + [ + 'working with a tool', + [ + view('child', { + operation: { toolName: 'Read', input: 'src/parser.ts', basis: 'open', observedAt: NOW } + }) + ], + { dot: 'Working', lead: 'Audit the parser', trail: 'Read: src/parser.ts' } + ], + [ + 'running a shell in the foreground', + [ + view('child', { + operation: { toolName: 'Bash', input: 'npm test', basis: 'open', observedAt: NOW } + }) + ], + { dot: 'Working', lead: 'Audit the parser', trail: 'Bash: npm test' } + ], + [ + 'finished, while a shell it launched still runs', + [settled('succeeded', { lastMessage: 'All green' }), OWNED_SHELL], + { + dot: 'Monitoring background tasks', + lead: 'Monitoring background tasks', + trail: 'Audit the parser' + } + ], + [ + 'waiting on an approval', + [ + view('child', { + state: 'waiting', + operation: { toolName: 'Edit', input: 'src/parser.ts', basis: 'open', observedAt: NOW } + }) + ], + { dot: 'Waiting for input', lead: 'Audit the parser', trail: 'Edit: src/parser.ts' } + ], + [ + 'blocked', + [view('child', { state: 'blocked', lastMessage: 'Rate limited, retrying' })], + { dot: 'Blocked', lead: 'Audit the parser', trail: 'Rate limited, retrying' } + ], + [ + 'finished', + [settled('succeeded', { lastMessage: 'Found 3 call sites' })], + { dot: 'Done', lead: 'Audit the parser', trail: 'Found 3 call sites' } + ], + [ + 'failed', + [settled('failed', { lastMessage: 'Exit code 1' })], + { dot: 'Failed', lead: 'Audit the parser', trail: 'Exit code 1' } + ], + [ + 'cancelled', + [settled('cancelled')], + { dot: 'Interrupted', lead: 'Audit the parser', trail: 'general-purpose' } + ], + [ + 'ended, outcome unknown', + [settled('unknown')], + { dot: 'Idle', lead: 'Audit the parser', trail: 'Ended' } + ], + [ + 'unverifiable', + [view('child', { state: 'unverifiable' })], + { dot: 'No recent update', lead: 'Audit the parser', trail: 'No update in 2m' } + ], + [ + 'parked, still live', + [view('child', { state: 'idle' })], + { dot: 'Idle', lead: 'Audit the parser', trail: 'general-purpose' } + ] +] + +/** What the full sidebar row, the CLI row's own layout, shows of the same detail. */ +const FULL_ROW_DETAIL: Record = { + 'working, no known operation': { shows: [] }, + 'working with a tool': { shows: ['Read', 'src/parser.ts'] }, + 'running a shell in the foreground': { shows: ['Bash', 'npm test'] }, + 'finished, while a shell it launched still runs': { shows: [], hides: ['All green'] }, + 'waiting on an approval': { shows: ['Edit', 'src/parser.ts'] }, + blocked: { shows: ['Rate limited, retrying'] }, + finished: { shows: ['Found 3 call sites'] }, + failed: { shows: ['Exit code 1'] }, + cancelled: { shows: [] }, + 'ended, outcome unknown': { shows: ['Ended'] }, + unverifiable: { shows: ['No update in 2m'] }, + 'parked, still live': { shows: [] } +} + +describe('a child reads the same in the sidebar and the chat strip', () => { + it.each(SCENARIOS)('%s', (name, children, expected) => { + const [sidebar] = sidebarRows(parentWith(children)) + const [strip] = stripRows(children) + expect(sidebar).toEqual(expected) + expect(strip).toEqual(expected) + const full = fullRow(parentWith(children)) + expect(full.labels).toContain(expected.dot) + expect(full.text).toContain(expected.lead === expected.dot ? expected.trail : expected.lead) + for (const text of FULL_ROW_DETAIL[name].shows) { + expect(full.text).toContain(text) + } + for (const text of FULL_ROW_DETAIL[name].hides ?? []) { + expect(full.text).not.toContain(text) + } + }) + + it('names an unlabeled child by the same state on every surface', () => { + const children = [ + settled('failed', { description: undefined, agentType: undefined, lastMessage: 'Exit 2' }) + ] + const [sidebar] = sidebarRows(parentWith(children)) + const [strip] = stripRows(children) + expect(sidebar.lead).toBe('Failed') + expect(strip.lead).toBe('Failed') + expect(fullRow(parentWith(children)).text).toContain('Failed') + }) + + it('shows the monitoring icon on the full sidebar row too', () => { + const [agent] = buildSubagentChildRows({ + parentEntry: parentWith([settled('succeeded'), OWNED_SHELL]), + tab, + parentIsFresh: true + }) + const root = mount( + renderToStaticMarkup( + + {}} + onDismiss={() => {}} + stateDotSize="sm" + hideExpand + /> + + ) + ) + expect(root.querySelector('[aria-label]')?.getAttribute('aria-label')).toBe( + 'Monitoring background tasks' + ) + // The finished child's last tool line is stale; neither row names it. + expect(root.textContent).not.toContain('Bash') + }) + + it('never shows a monitoring child tool text on either surface', () => { + const children = [ + settled('succeeded', { lastMessage: 'Bash: npm test finished' }), + { ...OWNED_SHELL, description: 'tail -f server.log' } + ] + const [sidebar] = sidebarRows(parentWith(children)) + const [strip] = stripRows(children) + for (const row of [sidebar, strip]) { + expect(row.dot).toBe('Monitoring background tasks') + expect(`${row.lead} ${row.trail}`).not.toContain('npm test') + } + }) +}) + +describe('a child running a shell in its turn', () => { + // The host records the running shell both as the child's operation and as a live command it owns. + const children = [ + view('child', { + operation: { toolName: 'Bash', input: 'npm run dev', basis: 'open', observedAt: NOW } + }), + { + ...OWNED_SHELL, + state: 'working' as const, + stoppable: false, + firstObservedAt: NOW - MINUTE + } + ] + const childRow: RenderedRow = { + dot: 'Working', + lead: 'Audit the parser', + trail: 'Bash: npm run dev' + } + + it('reads as the child working its shell, with the shell nested beneath it in the strip', () => { + const groups = buildBackgroundTaskGroupsFromViews(children) + expect(groups.map((group) => group.kind)).toEqual(['agent']) + expect(groups[0].tasks.map((entry) => entry.row.owned.map((owned) => owned.id))).toEqual([ + ['shell'] + ]) + expect(stripRows(children)).toEqual([ + childRow, + { dot: 'Working', lead: 'npm run dev', trail: '' } + ]) + }) + + it('shows the sidebar only the child, saying what the strip says of it', () => { + expect(sidebarRows(parentWith(children))).toEqual([childRow]) + }) +}) + +describe('one child reads the same from every shape a host publishes', () => { + it('names and details it identically from views, the subagents snapshot and the task roster', () => { + // A placeholder description falls through to the child's real label on every path. + const children = [view('child', { description: 'task', agentType: 'Explore' })] + const snapshotParent: AgentStatusEntry = { + ...parentWith([]), + children: undefined, + subagents: [ + { + id: 'child', + state: 'working', + startedAt: NOW - 5 * MINUTE, + description: 'task', + agentType: 'Explore' + } + ] + } + const roster: AgentSessionBackgroundTask[] = [ + { id: 'child', kind: 'agent', description: 'task', name: 'Explore', state: 'working' } + ] + const expected: RenderedRow = { dot: 'Working', lead: 'Explore', trail: '' } + expect(sidebarRows(parentWith(children))).toEqual([expected]) + expect(sidebarRows(snapshotParent)).toEqual([expected]) + expect(stripRows(children)).toEqual([expected]) + expect(stripRows(undefined, undefined, roster)).toEqual([expected]) + }) +}) + +describe('a mirrored parent and its children read one silence', () => { + const SKEW = 20 * MINUTE + // The host's clock runs 20 minutes ahead; this machine received its last word 3 minutes ago. + function mirroredParent(overrides: Partial): AgentStatusEntry { + return { + ...parentWith([]), + state: 'working', + updatedAt: NOW - 3 * MINUTE + SKEW, + mirroredEvidenceReceivedAt: NOW - 3 * MINUTE, + ...overrides + } + } + + it('times a snapshot child on the receipt clock the parent decays on', () => { + const parent = mirroredParent({ + children: undefined, + subagents: [ + { id: 'child', state: 'working', startedAt: NOW - 9 * MINUTE, description: 'Audit' } + ] + }) + expect(sidebarRows(parent, false)[0].trail).toBe('No update in 3m') + }) + + it('times a view child by its own host-clock age, never across machines', () => { + const children = [view('child', { observedAt: NOW - 5 * MINUTE + SKEW })] + const parent = mirroredParent({ children }) + expect(sidebarRows(parent, false)[0].trail).toBe('No update in 5m') + expect(stripRows(children, agentChildRowContextForParent(parent, false))[0].trail).toBe( + 'No update in 5m' + ) + const [agent] = buildSubagentChildRows({ parentEntry: parent, tab, parentIsFresh: false }) + const full = mount( + renderToStaticMarkup( + + {}} + onDismiss={() => {}} + stateDotSize="sm" + hideExpand + /> + + ) + ) + expect(full.textContent).toContain('No update in 5m') + }) +}) + +describe('a lost or stale parent reads the same on both surfaces', () => { + const children = [ + view('child', { + operation: { toolName: 'Bash', input: 'npm test', basis: 'open', observedAt: NOW } + }) + ] + const lost: RenderedRow = { + dot: 'No recent update', + lead: 'Audit the parser', + trail: 'No update in 2m' + } + + it('when the transport to the host is lost', () => { + const parent = { ...parentWith(children), subagentObservation: 'unverifiable' as const } + const [sidebar] = sidebarRows(parent) + const [strip] = stripRows(children, agentChildRowContextForParent(parent, true)) + expect(sidebar).toEqual(lost) + expect(strip).toEqual(lost) + }) + + it('when the parent row has gone stale', () => { + const parent = parentWith([settled('succeeded'), OWNED_SHELL], NOW - 40 * MINUTE) + const [sidebar] = sidebarRows(parent, false) + const [strip] = stripRows(parent.children ?? [], agentChildRowContextForParent(parent, false)) + const stale = { dot: 'No recent update', lead: 'Audit the parser', trail: 'No update in 2m' } + expect(sidebar).toEqual(stale) + expect(strip).toEqual(stale) + }) + + it('without a context the strip reports what the host last said', () => { + expect(stripRows(children)[0].dot).toBe('Working') + }) +}) + +describe('sibling child rows keep their own clocks', () => { + it('reads each sibling from its own evidence, not the parent clock', () => { + const parent = parentWith( + [ + view('busy', { description: 'Busy child', observedAt: NOW - 30_000 }), + view('quiet', { + description: 'Quiet child', + firstObservedAt: NOW - 15 * MINUTE, + observedAt: NOW - 10 * MINUTE + }) + ], + NOW - 40 * MINUTE + ) + const rows = buildSubagentChildRows({ parentEntry: parent, tab, parentIsFresh: false }) + expect(rows.map((row) => row.entry.evidenceObservedAt)).toEqual([ + NOW - 30_000, + NOW - 10 * MINUTE + ]) + expect(rows.map((row) => row.startedAt)).toEqual([NOW - 5 * MINUTE, NOW - 15 * MINUTE]) + expect(sidebarRows(parent, false).map((row) => row.trail)).toEqual([ + 'No update in 0m', + 'No update in 10m' + ]) + }) + + it('times a settled child from when it ended in the sidebar, and freezes its run in the strip', () => { + const [agent] = buildSubagentChildRows({ + parentEntry: parentWith([settled('succeeded')]), + tab, + parentIsFresh: true + }) + const text = mount( + renderToStaticMarkup( + + {}} /> + + ) + ).textContent + expect(text?.endsWith('3m')).toBe(true) + const strip = mount( + renderToStaticMarkup( + {}} + onStop={() => {}} + /> + ) + ) + // Ran from 5m ago until it settled 3m ago; a finished row never ticks. + expect(strip.querySelector('li')?.textContent).toMatch(/2m 0s$/) + }) +}) + +describe('the chat strip from views', () => { + it('nests a child-owned shell under its owner and stops by the provider id', () => { + const children = [ + view('child', { description: 'Dev server owner' }), + view('shell', { + kind: 'command', + description: 'npm run dev', + agentType: undefined, + state: 'monitoring', + parentChildWorkId: 'child' + }), + view('main-shell', { + kind: 'command', + description: 'tail -f log', + agentType: undefined, + state: 'monitoring' + }) + ] + const root = mount( + renderToStaticMarkup( + {}} + onStop={() => {}} + /> + ) + ) + const groups = [...root.querySelectorAll('ul[aria-label]')].map((list) => + list.getAttribute('aria-label') + ) + expect(groups).toEqual(['Agents', 'Shell']) + const nested = root.querySelector('ul[aria-label="Agents"] ul') + expect(nested?.textContent).toContain('npm run dev') + expect(root.querySelector('ul[aria-label="Shell"]')?.textContent).not.toContain('npm run dev') + const stopShell = root.querySelector('button[aria-label="Stop npm run dev"]') + expect(stopShell?.hasAttribute('disabled')).toBe(true) + }) +}) + +describe('one lifecycle word for a child, on the sidebar row and the strip header', () => { + it.each<[string, AgentChildWorkView[], string, string]>([ + ['failed', [settled('failed')], 'blocked', 'blocked'], + ['cancelled', [settled('cancelled')], 'idle', 'idle'], + ['ended, outcome unknown', [settled('unknown')], 'idle', 'idle'], + ['finished', [settled('succeeded')], 'done', 'done'], + ['monitoring its own shell', [settled('succeeded'), OWNED_SHELL], 'working', 'monitoring'], + ['waiting', [view('child', { state: 'waiting' })], 'waiting', 'waiting'] + ])('%s', (_name, children, sidebarState, headerState) => { + const [sidebar] = buildSubagentChildRows({ + parentEntry: parentWith(children), + tab, + parentIsFresh: true + }) + const [group] = buildBackgroundTaskGroupsFromViews(children) + // A CLI row carries monitoring as `working` plus its working mode; every other word is shared. + expect(sidebar.state).toBe(sidebarState) + expect(group.tasks[0].state).toBe(headerState) + }) +}) diff --git a/src/renderer/src/components/agent-child-row-text.ts b/src/renderer/src/components/agent-child-row-text.ts new file mode 100644 index 000000000000..96ef7d1d5c72 --- /dev/null +++ b/src/renderer/src/components/agent-child-row-text.ts @@ -0,0 +1,69 @@ +import type { AgentChildRowModel } from '../../../shared/agent-child-row-model' +import { formatAgentTypeLabel } from '../../../shared/agent-type-label' +import { agentStateLabel } from '@/components/AgentStateDot' +import { backgroundTaskStateReason } from '@/components/native-chat/background-task-roster' +import { translate } from '@/i18n/i18n' +import { agentNoUpdateLabel } from '@/lib/agent-row-decay-state' +import { formatAgentToolPreview } from '@/lib/agent-row-tool-preview' + +export type AgentChildRowText = { + /** Leads the line; kept when the row truncates. */ + lead: string + /** Follows the separator; '' when there is nothing more to say. */ + trail: string +} + +/** How long this child has been silent, on the reader's clock the model measured it on. */ +export function agentChildRowNoUpdateLabel(row: AgentChildRowModel, now: number): string { + return agentNoUpdateLabel({ updatedAt: row.recencyAt }, now) +} + +/** The words for a row's detail, reusing the phrasing a CLI agent row uses for the same fact. */ +export function agentChildRowDetailText(row: AgentChildRowModel, now: number): string { + const detail = row.detail + if (!detail) { + return '' + } + switch (detail.kind) { + case 'operation': + return formatAgentToolPreview( + { toolName: detail.toolName, toolInput: detail.input }, + 'working' + ) + case 'monitoring': + return agentStateLabel('monitoring') + case 'message': + return detail.text + case 'ended': + return translate('components.agentChildRow.ended', 'Ended') + case 'no-update': + return agentChildRowNoUpdateLabel(row, now) + case 'role': + return formatAgentTypeLabel(detail.agentType) + case 'reason': + return backgroundTaskStateReason(detail.state) ?? '' + } +} + +/** The line beneath a full-width row: what the child said, or that it ended; '' otherwise. */ +export function agentChildRowMessageLine(row: AgentChildRowModel): string { + if (row.detail?.kind === 'message') { + return row.detail.text + } + return row.detail?.kind === 'ended' ? translate('components.agentChildRow.ended', 'Ended') : '' +} + +/** The row's name, or its state when the child reported none. */ +export function agentChildRowName(row: AgentChildRowModel): string { + return row.name.trim() || agentStateLabel(row.displayState) +} + +export function agentChildRowText(row: AgentChildRowModel, now: number): AgentChildRowText { + const name = agentChildRowName(row) + const detail = agentChildRowDetailText(row, now) + // Why: a monitoring row leads with its state so truncation keeps passive distinct from active. + if (row.displayState === 'monitoring' && detail) { + return { lead: detail, trail: detail === name ? '' : name } + } + return { lead: name, trail: detail } +} diff --git a/src/renderer/src/components/dashboard/DashboardAgentRow.tsx b/src/renderer/src/components/dashboard/DashboardAgentRow.tsx index 1b64ec6af836..426fe8b57aac 100644 --- a/src/renderer/src/components/dashboard/DashboardAgentRow.tsx +++ b/src/renderer/src/components/dashboard/DashboardAgentRow.tsx @@ -9,12 +9,16 @@ import { DashboardAgentRowTrailingControls } from './DashboardAgentRowTrailingCo import { DashboardAgentRowToolStep } from './DashboardAgentRowToolStep' import { showsAgentToolPreview } from '@/lib/agent-row-tool-preview' import { agentNoUpdateLabel, formatCompactDuration } from '@/lib/agent-row-decay-state' -import { agentRowDotState as asDotState } from '@/lib/agent-row-dot-state' +import { agentRowDisplayDotState, agentRowDotState as asDotState } from '@/lib/agent-row-dot-state' import { agentVerdictDisplayMark } from '../../../../shared/agent-main-agent-verdict' import type { DashboardAgentRow as DashboardAgentRowData } from './useDashboardData' import { getAgentRowPrimaryText } from '@/lib/agent-row-primary-text' import { useAgentRowConversationName } from './use-agent-row-conversation-name' import { lastEnteredDoneAt } from './agent-finished-timestamp' +import { + agentChildRowMessageLine, + agentChildRowNoUpdateLabel +} from '@/components/agent-child-row-text' function formatTimeAgo(ts: number, now: number): string { const delta = now - ts @@ -24,6 +28,13 @@ function formatTimeAgo(ts: number, now: number): string { return `${formatCompactDuration(delta)} ago` } +// A child row's silence is the model's, on the clock its compact row and the strip read. +function rowNoUpdateLabel(agent: DashboardAgentRowData, now: number): string { + return agent.childRow + ? agentChildRowNoUpdateLabel(agent.childRow, now) + : agentNoUpdateLabel(agent.entry, now) +} + function stateDotTooltipLabel( agent: DashboardAgentRowData, dotState: AgentDotState, @@ -34,9 +45,7 @@ function stateDotTooltipLabel( } // Why: report the observation, not a verdict on the agent — the elapsed gap is what // lets the user apply context Orca has no way to know (a long build, a slow download). - return dotState === 'unverifiable' - ? agentNoUpdateLabel(agent.entry, now) - : agentStateLabel(dotState) + return dotState === 'unverifiable' ? rowNoUpdateLabel(agent, now) : agentStateLabel(dotState) } type Props = { @@ -127,7 +136,11 @@ const DashboardAgentRow = React.memo(function DashboardAgentRow({ const conversationName = useAgentRowConversationName(agent) const prompt = conversationName ?? getAgentRowPrimaryText(agent.entry) // Why: prompt is '' when unknown, so fall back to the state label to keep the row labeled. - const displayLabel = prompt || agentStateLabel(asDotState(agent.state, agent.entry.workingMode)) + const displayLabel = + prompt || + agentStateLabel( + agent.childRow?.displayState ?? asDotState(agent.state, agent.entry.workingMode) + ) const model = agent.entry.model?.trim() ?? '' const isMonitoring = agent.state === 'working' && agent.entry.workingMode === 'monitoring' const isWorking = agent.state === 'working' && !isMonitoring @@ -137,9 +150,11 @@ const DashboardAgentRow = React.memo(function DashboardAgentRow({ const showsTool = showsAgentToolPreview(agent.state) && !isMonitoring const toolName = showsTool ? (agent.entry.toolName?.trim() ?? '') : '' const toolInput = showsTool ? (agent.entry.toolInput?.trim() ?? '') : '' - const lastAssistantMessage = agent.entry.lastAssistantMessage?.trim() ?? '' - const verdictDotState = agentVerdictDisplayMark(agent.entry) - const isInterrupted = verdictDotState === 'interrupted' + // Why: a child row's message line is the model's, so a child that ended without an outcome says so. + const lastAssistantMessage = agent.childRow + ? agentChildRowMessageLine(agent.childRow) + : (agent.entry.lastAssistantMessage?.trim() ?? '') + const isInterrupted = agentVerdictDisplayMark(agent.entry) === 'interrupted' const lineage = agent.lineage const isLineageChild = lineage?.depth === 1 const lineageChildCount = lineage?.childCount ?? 0 @@ -152,12 +167,11 @@ const DashboardAgentRow = React.memo(function DashboardAgentRow({ : [formatAgentTypeLabel(agent.agentType), model].filter(Boolean).join(' · ') // Why: a stop or a failure is a terminal outcome, so surface it in the leading state dot; a // failure does so even while subagents still run. - const dotState: AgentDotState = - verdictDotState ?? asDotState(agent.state, agent.entry.workingMode) + const dotState: AgentDotState = agentRowDisplayDotState(agent) const dotTooltipLabel = stateDotTooltipLabel(agent, dotState, now) // Why: the elapsed gap is the whole content of an `unverifiable` row, so it rides the // row's own timestamp slot rather than hiding in a hover tooltip. - const noUpdateLabel = dotState === 'unverifiable' ? agentNoUpdateLabel(agent.entry, now) : null + const noUpdateLabel = dotState === 'unverifiable' ? rowNoUpdateLabel(agent, now) : null // Why: always show the chevron so the row's right edge doesn't flicker as content grows/shrinks. diff --git a/src/renderer/src/components/dashboard/agent-finished-timestamp.ts b/src/renderer/src/components/dashboard/agent-finished-timestamp.ts index 28d7a2572bbb..d176ae0a879b 100644 --- a/src/renderer/src/components/dashboard/agent-finished-timestamp.ts +++ b/src/renderer/src/components/dashboard/agent-finished-timestamp.ts @@ -12,11 +12,11 @@ import type { DashboardAgentRow } from './useDashboardData' * agent reads "N since it finished", an active one falls through to its start. */ export function lastEnteredDoneAt( - agent: Pick + agent: Pick ): number | null { - // Why: a subagent's synthetic entry may say done while its row is idle or unverifiable. - if (agent.rowSource === 'subagent' && agent.state !== 'done') { - return null + // Why: a subagent has no turns; it ended when its host settled it, if it has. + if (agent.rowSource === 'subagent') { + return agent.childRow?.settledAt ?? null } const entry = agent.entry // Why: same primitive Smart Sort ranks on, so the displayed age and Done eligibility share a clock. diff --git a/src/renderer/src/components/dashboard/useDashboardData.ts b/src/renderer/src/components/dashboard/useDashboardData.ts index 02d4010edcdf..7ca391ef2346 100644 --- a/src/renderer/src/components/dashboard/useDashboardData.ts +++ b/src/renderer/src/components/dashboard/useDashboardData.ts @@ -1,6 +1,7 @@ import type { AgentStatusEntry, AgentType } from '../../../../shared/agent-status-types' import type { AgentRowState } from '@/lib/agent-row-decay-state' import type { TerminalTab } from '../../../../shared/terminal-tab-types' +import type { AgentChildRowModel } from '../../../../shared/agent-child-row-model' export type DashboardAgentRow = { /** Row identity. For 'subagent' rows this is a synthetic key (the child has @@ -18,6 +19,8 @@ export type DashboardAgentRow = { * stateHistory entry, falling back to updatedAt when no history exists yet. * Used to sort agents by when they started. */ startedAt: number + /** Subagent rows only: what the row shows, decided once for every surface. */ + childRow?: AgentChildRowModel lineage?: { depth: 0 | 1 parentPaneKey?: string diff --git a/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsx b/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsx index 365be31cc476..e37bfa0f9dad 100644 --- a/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.test.tsx @@ -335,3 +335,47 @@ it('stops elapsed renders in a hidden pane and catches up on reveal', () => { unmount() expect(vi.getTimerCount()).toBe(0) }) + +it('lets the 1 Hz tick sleep while every row has settled, with each run frozen', () => { + vi.useFakeTimers() + vi.setSystemTime(1_000_000) + const committed = vi.fn() + const finished = (id: string, firstObservedAt: number, settledAt: number) => ({ + id, + providerId: `task-${id}`, + kind: 'agent' as const, + description: `child ${id}`, + state: 'done' as const, + membership: 'settled' as const, + outcome: 'succeeded' as const, + firstObservedAt, + observedAt: settledAt, + settledAt, + stoppable: false, + invocation: { invocationId: `spawn-${id}`, generation: 1 } + }) + render( + + {}} + isVisible + tasks={[]} + settledTasks={[]} + childViews={[finished('a', 400_000, 520_000), finished('b', 700_000, 760_000)]} + indicatorActive + supportsTaskStop + supportsStopAll + stoppingTaskIds={new Set()} + stoppingAll={false} + onStop={() => {}} + /> + + ) + const rows = screen.getAllByRole('listitem').map((row) => row.textContent) + expect(rows).toEqual(['child a · Agent2m 0s', 'child b · Agent1m 0s']) + committed.mockClear() + act(() => vi.advanceTimersByTime(5_000)) + expect(committed).not.toHaveBeenCalled() + expect(vi.getTimerCount()).toBe(0) +}) diff --git a/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx b/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx index de9ba8c655c0..a0ff61a78c85 100644 --- a/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx +++ b/src/renderer/src/components/native-chat/NativeChatBackgroundTasksStatus.tsx @@ -1,18 +1,25 @@ import { useEffect, useId, useMemo, useRef, useState } from 'react' import { Activity, Bot, ChevronDown, CircleHelp, SquareTerminal, Workflow } from 'lucide-react' import type { AgentSessionBackgroundTask } from '../../../../shared/agent-session-wire' -import { AgentStateDot } from '@/components/AgentStateDot' +import type { + AgentChildRowContext, + AgentChildRowModel +} from '../../../../shared/agent-child-row-model' +import type { AgentChildWorkView } from '../../../../shared/agent-status-child-work-view' +import { AgentChildRowContent } from '@/components/AgentChildRowContent' +import { agentChildRowName } from '@/components/agent-child-row-text' import { Button } from '@/components/ui/button' import { useNow } from '@/hooks/use-now' import { translate } from '@/i18n/i18n' import { backgroundTasksHeaderContent } from './background-task-header-content' import { - backgroundTaskElapsedLabel, backgroundTaskGroupLabel, - backgroundTaskStateReason, + backgroundTaskRowElapsedLabel, + backgroundTaskRowTicks, buildBackgroundTaskGroups, + buildBackgroundTaskGroupsFromViews, formatBackgroundTaskTokens, - type BackgroundRosterTask + type BackgroundTaskGroup } from './background-task-roster' /** Below this strip width (border-box, live root font size) the header drops @@ -64,78 +71,95 @@ function kindIconTone(kind: AgentSessionBackgroundTask['kind'], dimmed: boolean) return dimmed ? `${tone}/40` : tone } -/** Absent means stoppable: a host predating the field published only rows its - * stop could act on, so reading absence as "not stoppable" would hide a - * working control. Only an explicit `false` withholds the button — Claude - * marks its in-turn foreground rows that way, and a Stop on one of those - * resolves to an empty target list and silently reports nothing cancelled. */ -function backgroundTaskStoppable(task: AgentSessionBackgroundTask): boolean { - return task.stoppable !== false -} - function BackgroundTaskRow(props: { - entry: BackgroundRosterTask + row: AgentChildRowModel now: number supportsTaskStop: boolean - stopping: boolean + stoppingTaskIds: ReadonlySet onStop: (taskId: string) => void }): React.JSX.Element { - const { entry, now } = props - const Icon = KIND_ICONS[entry.task.kind] - // Every attention state states its reason on the row, the same ones the collapsed - // header names; `unverifiable` ("no contact") must never be silently dropped. - const reason = backgroundTaskStateReason(entry.state) - // Settled rows keep their final usage but no elapsed — a still-growing clock - // on finished work would lie. + const { row, now } = props + const Icon = KIND_ICONS[row.kind] const meta = [ - entry.task.totalTokens !== undefined - ? formatBackgroundTaskTokens(entry.task.totalTokens) - : null, - entry.settled ? null : backgroundTaskElapsedLabel(entry.task, now) + row.totalTokens !== undefined ? formatBackgroundTaskTokens(row.totalTokens) : null, + backgroundTaskRowElapsedLabel(row, now) ] .filter((part): part is string => part !== null) .join(' · ') + // Only an explicit `false` withholds the button: a Stop on a row the host cannot target + // resolves to an empty list and silently reports nothing cancelled. + const stopId = + !row.settled && props.supportsTaskStop && row.canStop ? (row.providerId ?? null) : null return ( -
  • -
  • +
  • + {row.owned.length > 0 ? ( + // Work a child owns (its shell, a nested agent) reads beneath it, not in its kind's group. +
  • +
      + {row.owned.map((owned) => ( + + ))} +
    +
  • ) : null} - + ) } +function rowsTick(rows: readonly AgentChildRowModel[]): boolean { + return rows.some((row) => backgroundTaskRowTicks(row) || rowsTick(row.owned)) +} + export function NativeChatBackgroundTasksStatus(props: { tasks: readonly AgentSessionBackgroundTask[] settledTasks: readonly AgentSessionBackgroundTask[] + /** The host's child views, when it publishes them; rows then read these instead of the tasks. */ + childViews?: readonly AgentChildWorkView[] + /** The session's parent-row context for those views, the one its sidebar rows read; without + * it every live claim stands as reported. */ + childRowContext?: AgentChildRowContext supportsTaskStop: boolean /** False when the provider exposes no honest stop at all; the fallback * control is hidden rather than offering a button that cannot act. */ @@ -160,16 +184,18 @@ export function NativeChatBackgroundTasksStatus(props: { const stripRef = useRef(null) const narrow = useNarrowStrip(stripRef) // The 1 Hz elapsed tick must not re-group, re-sort and re-translate the whole roster. - const groups = useMemo( - () => buildBackgroundTaskGroups(props.tasks, props.settledTasks), - [props.tasks, props.settledTasks] + const groups: BackgroundTaskGroup[] = useMemo( + () => + props.childViews !== undefined + ? buildBackgroundTaskGroupsFromViews(props.childViews, props.childRowContext) + : buildBackgroundTaskGroups(props.tasks, props.settledTasks), + [props.childViews, props.childRowContext, props.tasks, props.settledTasks] ) const singleLiveCommand = groups.length === 1 && groups[0].kind === 'command' && groups[0].tasks.length === 1 - const hasElapsed = groups.some((group) => - group.tasks.some((entry) => !entry.settled && (entry.task.startedAt ?? 0) > 0) - ) - const now = useNow(1_000, props.isVisible && hasElapsed && (expanded || singleLiveCommand)) + // Settled rows are frozen, so a strip of only finished work never wakes the 1 Hz tick. + const ticks = groups.some((group) => rowsTick(group.tasks.map((entry) => entry.row))) + const now = useNow(1_000, props.isVisible && ticks && (expanded || singleLiveCommand)) const header = backgroundTasksHeaderContent(groups, { narrow, now }) const headerText = `${header.segments.map((segment) => segment.text).join(' · ')}${header.detail ? `${header.segments.length > 0 ? ' — ' : ''}${header.detail}` : ''}` return ( @@ -250,11 +276,11 @@ export function NativeChatBackgroundTasksStatus(props: { > {group.tasks.map((entry) => ( ))} diff --git a/src/renderer/src/components/native-chat/background-task-header-content.ts b/src/renderer/src/components/native-chat/background-task-header-content.ts index 0ec1c765e1f8..acbd97cb5431 100644 --- a/src/renderer/src/components/native-chat/background-task-header-content.ts +++ b/src/renderer/src/components/native-chat/background-task-header-content.ts @@ -166,8 +166,8 @@ export function backgroundTasksHeaderContent( : kindCountLabel(group.kind, 1) // A still-growing clock on finished work would lie, exactly as on the row. const elapsed = - group.kind === 'command' && !entry.settled - ? backgroundTaskElapsedLabel(entry.task, options.now) + group.kind === 'command' && !entry.row.settled + ? backgroundTaskElapsedLabel(entry.row.firstObservedAt, options.now) : null return { segments: [{ text: subject, kind: group.kind }], diff --git a/src/renderer/src/components/native-chat/background-task-roster.test.ts b/src/renderer/src/components/native-chat/background-task-roster.test.ts index eb2232056a7b..f4159632c692 100644 --- a/src/renderer/src/components/native-chat/background-task-roster.test.ts +++ b/src/renderer/src/components/native-chat/background-task-roster.test.ts @@ -172,8 +172,8 @@ describe('buildBackgroundTaskGroups', () => { [agent('settled', { state: 'done', startedAt: 0 })] ) expect(built.map((group) => group.kind)).toEqual(['agent', 'monitor']) - expect(built[0].tasks.map((entry) => entry.task.id)).toEqual(['settled', 'early', 'late']) - expect(built[0].tasks[0].settled).toBe(true) + expect(built[0].tasks.map((entry) => entry.row.id)).toEqual(['settled', 'early', 'late']) + expect(built[0].tasks[0].row.settled).toBe(true) }) it('defaults the state slot so a stateless row still reads as work', () => { @@ -234,9 +234,19 @@ describe('resumed tasks from mixed-version hosts', () => { [live, ...shells], [settled, agent('sibling', { state: 'done' })] ) - expect( - groups.flatMap((group) => group.tasks).filter((entry) => entry.task.id === live.id) - ).toEqual([{ task: live, settled: false, state: 'working', name: 'Background agent' }]) + const owners = groups + .flatMap((group) => group.tasks) + .filter((entry) => entry.row.id === live.id) + expect(owners).toHaveLength(1) + expect(owners[0]).toMatchObject({ + row: { + settled: false, + displayState: 'working', + name: 'Background agent', + totalTokens: 20000 + }, + state: 'working' + }) expect(backgroundTasksHeaderContent(groups, { narrow: false, now: NOW }).segments).toEqual([ { text: '2 agents', kind: 'agent' }, { text: '4 shells', kind: 'command' } diff --git a/src/renderer/src/components/native-chat/background-task-roster.ts b/src/renderer/src/components/native-chat/background-task-roster.ts index 4b1c290e9444..7b62bb1f57c8 100644 --- a/src/renderer/src/components/native-chat/background-task-roster.ts +++ b/src/renderer/src/components/native-chat/background-task-roster.ts @@ -6,6 +6,15 @@ import type { AgentSessionBackgroundTask, AgentSessionBackgroundTaskRunState } from '../../../../shared/agent-session-wire' +import { + buildAgentChildRowModels, + buildLegacyTaskRowModels, + usableAgentChildLabel, + type AgentChildRowContext, + type AgentChildRowModel +} from '../../../../shared/agent-child-row-model' +import { agentChildRunStateFor } from '../../../../shared/agent-status-child-work-display' +import type { AgentChildWorkView } from '../../../../shared/agent-status-child-work-view' import { formatNativeChatDuration } from '../../../../shared/native-chat-turn-status' import { translate } from '@/i18n/i18n' @@ -13,10 +22,10 @@ type TaskKind = AgentSessionBackgroundTask['kind'] type RunState = AgentSessionBackgroundTaskRunState export type BackgroundRosterTask = { - task: AgentSessionBackgroundTask - settled: boolean + /** What the row shows, decided by the same model the sidebar's child rows use. */ + row: AgentChildRowModel + /** The row's display state in the header's vocabulary. */ state: RunState - name: string } export type BackgroundTaskGroup = { kind: TaskKind; tasks: BackgroundRosterTask[] } @@ -24,17 +33,6 @@ export type BackgroundTaskGroup = { kind: TaskKind; tasks: BackgroundRosterTask[ /** Fixed presentation order; groups render only when non-empty. */ const KIND_ORDER: readonly TaskKind[] = ['agent', 'command', 'monitor', 'workflow', 'unknown'] -/** Provider strings that carry no identity; a row falls through to its kind label. */ -const PLACEHOLDER_NAMES = new Set(['unknown', 'untitled', 'task', 'subagent']) - -function usableTaskText(value: string | undefined): string | null { - const trimmed = value?.trim() - if (!trimmed || PLACEHOLDER_NAMES.has(trimmed.toLowerCase())) { - return null - } - return trimmed -} - export function backgroundTaskKindLabel(kind: TaskKind): string { switch (kind) { case 'agent': @@ -50,56 +48,63 @@ export function backgroundTaskKindLabel(kind: TaskKind): string { } } -/** Display name: description → name → kind label. Empty-after-trim and - * placeholder values fall through, so a row always renders something. */ +/** The transcript row's name: description → name → kind label. Empty-after-trim and + * placeholder values fall through, so the row always renders something. */ export function resolveBackgroundTaskName(task: AgentSessionBackgroundTask): string { return ( - usableTaskText(task.description) ?? - usableTaskText(task.name) ?? + usableAgentChildLabel(task.description) ?? + usableAgentChildLabel(task.name) ?? backgroundTaskKindLabel(task.kind) ) } -function effectiveState(task: AgentSessionBackgroundTask, settled: boolean): RunState { - if (task.state) { - return task.state - } - if (settled) { - return 'done' - } - return task.kind === 'monitor' ? 'monitoring' : 'working' +/** Stable-sort first-seen then id, so a live update never reshuffles surviving rows. */ +function groupRosterEntries(entries: BackgroundRosterTask[]): BackgroundTaskGroup[] { + entries.sort((left, right) => { + const startDelta = left.row.firstObservedAt - right.row.firstObservedAt + return startDelta !== 0 ? startDelta : left.row.id < right.row.id ? -1 : 1 + }) + return KIND_ORDER.map((kind) => ({ + kind, + tasks: entries.filter((entry) => entry.row.kind === kind) + })).filter((group) => group.tasks.length > 0) } -/** Merge live and settled tasks into kind groups, stable-sorted first-seen - * (startedAt) then id, so a live update never reshuffles surviving rows. */ +function rosterEntries(rows: readonly AgentChildRowModel[]): BackgroundTaskGroup[] { + return groupRosterEntries( + rows.map((row) => ({ row, state: agentChildRunStateFor(row.displayState) })) + ) +} + +/** Kind groups from a host that publishes only the task roster, live and settled merged. */ export function buildBackgroundTaskGroups( tasks: readonly AgentSessionBackgroundTask[], settledTasks: readonly AgentSessionBackgroundTask[] ): BackgroundTaskGroup[] { - // Older hosts can retain a previous turn beside its resumed live task. - const owners = new Map() - for (const [roster, settled] of [ - [settledTasks, true], - [tasks, false] - ] as const) { - for (const task of roster) { - owners.set(task.id, { - task, - settled, - state: effectiveState(task, settled), - name: resolveBackgroundTaskName(task) - }) - } - } - const entries = [...owners.values()] - entries.sort((left, right) => { - const startDelta = (left.task.startedAt ?? 0) - (right.task.startedAt ?? 0) - return startDelta !== 0 ? startDelta : left.task.id < right.task.id ? -1 : 1 - }) - return KIND_ORDER.map((kind) => ({ - kind, - tasks: entries.filter((entry) => entry.task.kind === kind) - })).filter((group) => group.tasks.length > 0) + // An old host's unlabeled row keeps the kind label it always showed; a view row reads its state. + return rosterEntries( + buildLegacyTaskRowModels(tasks, settledTasks).map((row) => + row.name ? row : { ...row, name: backgroundTaskKindLabel(row.kind) } + ) + ) +} + +// Until a caller passes the session's parent-row context, every live claim stands as reported. +const REPORTED_ROW_CONTEXT: AgentChildRowContext = { + parentEvidenceFresh: true, + transportObservation: 'live', + parentObservedAt: 0, + hostClockOffsetMs: 0 +} + +/** Kind groups from the host's child views: the main agent's work at the top, each child's own + * work nested beneath it rather than counted again in its kind's group. Pass the context the + * sidebar builds for the same parent (`agentChildRowContextForParent`) so both read one verdict. */ +export function buildBackgroundTaskGroupsFromViews( + views: readonly AgentChildWorkView[], + context: AgentChildRowContext = REPORTED_ROW_CONTEXT +): BackgroundTaskGroup[] { + return rosterEntries(buildAgentChildRowModels(views, context)) } export function backgroundTaskStateWord(state: RunState): string { @@ -155,14 +160,26 @@ export function formatBackgroundTaskTokens(totalTokens: number): string { : `${tokenScaleText(Math.round(totalTokens / 100_000) / 10)}m` } -export function backgroundTaskElapsedLabel( - task: AgentSessionBackgroundTask, - now: number -): string | null { - if (task.startedAt === undefined || task.startedAt <= 0) { +export function backgroundTaskElapsedLabel(startedAt: number, now: number): string | null { + if (startedAt <= 0) { return null } - return formatNativeChatDuration((now - task.startedAt) / 1000) + return formatNativeChatDuration((now - startedAt) / 1000) +} + +/** Whether a row's elapsed time moves: only live work's does. */ +export function backgroundTaskRowTicks(row: AgentChildRowModel): boolean { + return !row.settled && row.firstObservedAt > 0 +} + +/** A live row's clock runs; a settled row's stops where it settled, so finished work never ticks. */ +export function backgroundTaskRowElapsedLabel(row: AgentChildRowModel, now: number): string | null { + if (!row.settled) { + return backgroundTaskElapsedLabel(row.firstObservedAt, now) + } + return row.settledAt !== undefined + ? backgroundTaskElapsedLabel(row.firstObservedAt, row.settledAt) + : null } export function backgroundTaskGroupLabel(kind: TaskKind): string { diff --git a/src/renderer/src/components/sidebar/__snapshots__/subagent-child-row-fallback-pixels.test.tsx.snap b/src/renderer/src/components/sidebar/__snapshots__/subagent-child-row-fallback-pixels.test.tsx.snap new file mode 100644 index 000000000000..d1c70a5fee23 --- /dev/null +++ b/src/renderer/src/components/sidebar/__snapshots__/subagent-child-row-fallback-pixels.test.tsx.snap @@ -0,0 +1,46 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`chat strip rows from a legacy background-task roster > render exactly as before 1`] = `"

    Agents

    • Failed child · failed
    • Background agent · no contact
    • Cancelled child
    • Approve edits · needs approval
    • Summarize logs900
    • Review the parser18.2k · 10m 0s
    • Explore · failed8m 20s
    • Old host child6m 40s

    Shell

    • npm run dev11m 40s

    Monitors

    • tail -f server.log
    "`; + +exports[`chat strip rows from a legacy background-task roster > render exactly as before 2`] = `"

    Agents

    • Failed child · failed
    • Background agent · no contact
    • Cancelled child
    • Approve edits · needs approval
    • Summarize logs900
    • Review the parser18.2k · 10m 0s
    • Explore · failed8m 20s
    • Old host child6m 40s

    Shell

    • npm run dev11m 40s

    Monitors

    • tail -f server.log
    "`; + +exports[`sidebar child rows from a legacy subagents snapshot > render a stale parent and a lost transport exactly as before 1`] = ` +[ + "
    Review the parser - No update in 5mclaude-sonnet10m
    ", + "
    Explore - No update in 5m8m
    ", + "
    No recent update - No update in 5m16m
    ", + "
    Approve edits - No update in 5m6m
    ", + "
    Review the parser - No update in 5mclaude-sonnet10m
    ", +] +`; + +exports[`sidebar child rows from a legacy subagents snapshot > render the compact rows exactly as before 1`] = ` +[ + "
    Review the parser - general-purposeclaude-sonnet10m
    ", + "
    Explore8m
    ", + "
    Working - Agent16m
    ", + "
    Approve edits - Agent6m
    ", + "
    Rate limited - Agent6m
    ", + "
    Teammate - writer6m
    ", + "
    Lost child - No update in 5m6m
    ", +] +`; + +exports[`sidebar child rows from a legacy subagents snapshot > render the full rows exactly as before 1`] = ` +[ + "
    Review the parserclaude-sonnet
    ", + "
    Explore
    ", + "
    Working
    ", + "
    Approve edits
    ", + "
    Rate limited
    ", + "
    Teammate
    ", + "
    Lost child
    ", +] +`; + +exports[`sidebar child rows from a legacy subagents snapshot > render the full rows exactly as before 2`] = ` +[ + "
    Review the parserclaude-sonnet
    ", + "
    Explore
    ", +] +`; diff --git a/src/renderer/src/components/sidebar/subagent-child-row-fallback-pixels.test.tsx b/src/renderer/src/components/sidebar/subagent-child-row-fallback-pixels.test.tsx new file mode 100644 index 000000000000..0be9f5ae5469 --- /dev/null +++ b/src/renderer/src/components/sidebar/subagent-child-row-fallback-pixels.test.tsx @@ -0,0 +1,237 @@ +/** @vitest-environment happy-dom */ +import { renderToStaticMarkup } from 'react-dom/server' +import { describe, expect, it, vi } from 'vitest' +import type { AgentSessionBackgroundTask } from '../../../../shared/agent-session-wire' +import type { AgentStatusEntry, AgentSubagentSnapshot } from '../../../../shared/agent-status-types' +import type { TerminalTab } from '../../../../shared/terminal-tab-types' +import DashboardAgentRow from '@/components/dashboard/DashboardAgentRow' +import { NativeChatBackgroundTasksStatus } from '@/components/native-chat/NativeChatBackgroundTasksStatus' +import { TooltipProvider } from '@/components/ui/tooltip' +import { CompactAgentRow } from './worktree-card-compact-agent-row' +import { buildSubagentChildRows } from './worktree-subagent-child-rows' + +vi.mock('@/components/dashboard/use-agent-row-conversation-name', () => ({ + useAgentRowConversationName: () => null +})) + +vi.mock('./CacheTimer', () => ({ + default: () => null, + usePromptCacheCountdownForPane: () => null +})) + +// Captured on the unmodified renderer: a host that sends only today's legacy shapes (an old host, +// or any CLI pane) must keep rendering exactly these rows. + +const NOW = 1_000_000 + +const tab: TerminalTab = { + id: 'parent-tab', + ptyId: null, + worktreeId: 'wt-1', + title: 'Parent', + customTitle: null, + color: null, + sortOrder: 0, + createdAt: 1 +} + +function parentWith( + subagents: AgentSubagentSnapshot[], + overrides: Partial = {} +): AgentStatusEntry { + return { + paneKey: 'parent-tab:leaf-1', + tabId: tab.id, + worktreeId: tab.worktreeId, + state: 'working', + prompt: 'parent prompt', + updatedAt: 700_000, + stateStartedAt: 10, + stateHistory: [], + subagents, + ...overrides + } +} + +const SUBAGENTS: AgentSubagentSnapshot[] = [ + { + id: 'described', + state: 'working', + startedAt: 400_000, + agentType: 'general-purpose', + model: 'claude-sonnet', + description: 'Review the parser' + }, + { id: 'typed-only', state: 'working', startedAt: 500_000, agentType: 'Explore' }, + { id: 'anonymous', state: 'working', startedAt: 0 }, + { id: 'asking', state: 'waiting', startedAt: 600_000, description: 'Approve edits' }, + { id: 'stuck', state: 'blocked', startedAt: 610_000, description: 'Rate limited' }, + { id: 'parked', state: 'idle', startedAt: 620_000, description: 'Teammate', agentType: 'writer' }, + { id: 'quiet', state: 'unverifiable', startedAt: 630_000, description: 'Lost child' } +] + +function normalize(markup: string): string { + return markup.replaceAll('', '') +} + +function compactMarkup(parent: AgentStatusEntry, parentIsFresh: boolean): string[] { + return buildSubagentChildRows({ parentEntry: parent, tab, parentIsFresh }).map((agent) => + normalize( + renderToStaticMarkup( + + {}} /> + + ) + ) + ) +} + +function fullMarkup(parent: AgentStatusEntry, parentIsFresh: boolean): string[] { + return buildSubagentChildRows({ parentEntry: parent, tab, parentIsFresh }).map((agent) => + normalize( + renderToStaticMarkup( + + {}} + onDismiss={() => {}} + stateDotSize="sm" + hideExpand + hideLineageConnectors + /> + + ) + ) + ) +} + +function textOf(markup: string): string { + const container = document.createElement('div') + container.innerHTML = markup + return container.textContent ?? '' +} + +describe('sidebar child rows from a legacy subagents snapshot', () => { + it('render the compact rows exactly as before', () => { + const rows = compactMarkup(parentWith(SUBAGENTS), true) + expect(rows.map(textOf)).toEqual([ + 'Review the parser - general-purposeclaude-sonnet10m', + 'Explore8m', + 'Working - Agent16m', + 'Approve edits - Agent6m', + 'Rate limited - Agent6m', + 'Teammate - writer6m', + 'Lost child - No update in 5m6m' + ]) + expect(rows).toMatchSnapshot() + }) + + it('render a stale parent and a lost transport exactly as before', () => { + const stale = compactMarkup(parentWith(SUBAGENTS.slice(0, 4)), false) + const lost = compactMarkup( + parentWith(SUBAGENTS.slice(0, 1), { subagentObservation: 'unverifiable' }), + true + ) + expect([...stale, ...lost].map(textOf)).toEqual([ + 'Review the parser - No update in 5mclaude-sonnet10m', + 'Explore - No update in 5m8m', + 'No recent update - No update in 5m16m', + 'Approve edits - No update in 5m6m', + 'Review the parser - No update in 5mclaude-sonnet10m' + ]) + expect([...stale, ...lost]).toMatchSnapshot() + }) + + it('render the full rows exactly as before', () => { + expect(fullMarkup(parentWith(SUBAGENTS), true)).toMatchSnapshot() + expect(fullMarkup(parentWith(SUBAGENTS.slice(0, 2)), false)).toMatchSnapshot() + }) +}) + +const TASKS: AgentSessionBackgroundTask[] = [ + { + id: 'agent-working', + kind: 'agent', + description: 'Review the parser', + name: 'general-purpose', + state: 'working', + startedAt: 400_000, + totalTokens: 18_200 + }, + { id: 'agent-waiting', kind: 'agent', description: 'Approve edits', state: 'waiting' }, + { id: 'agent-blocked', kind: 'agent', name: 'Explore', state: 'blocked', startedAt: 500_000 }, + { id: 'agent-quiet', kind: 'agent', description: 'subagent', state: 'unverifiable' }, + { id: 'agent-stateless', kind: 'agent', description: 'Old host child', startedAt: 600_000 }, + { + id: 'command-1', + kind: 'command', + description: 'npm run dev', + startedAt: 300_000, + stoppable: false + }, + { id: 'monitor-1', kind: 'monitor', description: 'tail -f server.log' } +] + +const SETTLED_TASKS: AgentSessionBackgroundTask[] = [ + { + id: 'agent-done', + kind: 'agent', + description: 'Summarize logs', + state: 'done', + startedAt: 100_000, + totalTokens: 900 + }, + { id: 'agent-stopped', kind: 'agent', description: 'Cancelled child', state: 'idle' }, + { id: 'agent-failed', kind: 'agent', description: 'Failed child', state: 'blocked' } +] + +function stripMarkup(supportsTaskStop: boolean): string { + vi.useFakeTimers() + vi.setSystemTime(NOW) + try { + return normalize( + renderToStaticMarkup( + + {}} + onStop={() => {}} + /> + + ) + ) + } finally { + vi.useRealTimers() + } +} + +describe('chat strip rows from a legacy background-task roster', () => { + it('render exactly as before', () => { + const markup = stripMarkup(true) + const container = document.createElement('div') + container.innerHTML = markup + expect([...container.querySelectorAll('li')].map((row) => row.textContent)).toEqual([ + 'Failed child · failed', + 'Background agent · no contactStop', + 'Cancelled child', + 'Approve edits · needs approvalStop', + 'Summarize logs900', + 'Review the parser18.2k · 10m 0sStop', + 'Explore · failed8m 20sStop', + 'Old host child6m 40sStop', + 'npm run dev11m 40s', + 'tail -f server.logStop' + ]) + expect(markup).toMatchSnapshot() + expect(stripMarkup(false)).toMatchSnapshot() + }) +}) diff --git a/src/renderer/src/components/sidebar/worktree-card-agent-summary.test.ts b/src/renderer/src/components/sidebar/worktree-card-agent-summary.test.ts index 7f1215c980a5..62a7d54c6d57 100644 --- a/src/renderer/src/components/sidebar/worktree-card-agent-summary.test.ts +++ b/src/renderer/src/components/sidebar/worktree-card-agent-summary.test.ts @@ -4,7 +4,11 @@ import { describe, expect, it, vi } from 'vitest' import { TooltipProvider } from '@/components/ui/tooltip' import type { DashboardAgentRow as DashboardAgentRowData } from '@/components/dashboard/useDashboardData' import { CompactAgentRow, getCompactAgentSecondary } from './worktree-card-compact-agent-row' -import { getAgentDotState, summarizeAgents } from './worktree-card-agent-summary' +import { + buildSummaryAgentGroups, + getAgentDotState, + summarizeAgents +} from './worktree-card-agent-summary' import { buildSubagentChildRows } from './worktree-subagent-child-rows' function monitoringAgent(): DashboardAgentRowData { @@ -46,6 +50,30 @@ function renderCompactAgentRow(props: React.ComponentProps { + it('keeps a failed child in the groups and the counts', () => { + const failed: DashboardAgentRowData = { + ...monitoringAgent(), + paneKey: 'tab-1:leaf-1\u0000subagent:child', + rowSource: 'subagent', + state: 'blocked', + childRow: { + id: 'child', + kind: 'agent', + displayState: 'failed', + name: 'Fuzz the tokenizer', + detail: null, + firstObservedAt: 1, + recencyAt: 1, + canStop: false, + settled: true, + owned: [] + } + } + expect(getAgentDotState(failed)).toBe('failed') + expect(buildSummaryAgentGroups([failed]).map((group) => group.state)).toEqual(['failed']) + expect(summarizeAgents([failed], 'Agent')).toBe('Agent failed') + }) + it('presents passive working as monitoring', () => { const agent = monitoringAgent() diff --git a/src/renderer/src/components/sidebar/worktree-card-agent-summary.ts b/src/renderer/src/components/sidebar/worktree-card-agent-summary.ts index 4ce3f1ad4176..76fe81307e90 100644 --- a/src/renderer/src/components/sidebar/worktree-card-agent-summary.ts +++ b/src/renderer/src/components/sidebar/worktree-card-agent-summary.ts @@ -1,8 +1,7 @@ import type { AgentDotState } from '@/components/AgentStateDot' import type { DashboardAgentRow as DashboardAgentRowData } from '@/components/dashboard/useDashboardData' import { formatAgentTypeLabel } from '@/lib/agent-status' -import { agentRowDotState } from '@/lib/agent-row-dot-state' -import { agentVerdictDisplayMark } from '../../../../shared/agent-main-agent-verdict' +import { agentRowDisplayDotState } from '@/lib/agent-row-dot-state' export type SummaryAgentGroup = { state: AgentDotState @@ -24,9 +23,7 @@ const SUMMARY_STATE_ORDER: AgentDotState[] = [ ] export function getAgentDotState(agent: DashboardAgentRowData): AgentDotState { - return ( - agentVerdictDisplayMark(agent.entry) ?? agentRowDotState(agent.state, agent.entry.workingMode) - ) + return agentRowDisplayDotState(agent) } export function formatSummaryStateLabel(state: AgentDotState): string { diff --git a/src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx b/src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx index 094cd2e7db9d..7ee488341852 100644 --- a/src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx +++ b/src/renderer/src/components/sidebar/worktree-card-compact-agent-row.tsx @@ -1,6 +1,7 @@ import React, { useCallback, useEffect, useRef } from 'react' import { DashboardAgentChildDisclosure } from '@/components/dashboard/DashboardAgentChildDisclosure' import { AgentStateDot, agentStateLabel } from '@/components/AgentStateDot' +import { AgentChildRowContent } from '@/components/AgentChildRowContent' import type { DashboardAgentRow as DashboardAgentRowData } from '@/components/dashboard/useDashboardData' import { AgentIcon } from '@/lib/agent-catalog' import { agentTypeToIconAgent, formatAgentTypeLabel } from '@/lib/agent-status' @@ -183,41 +184,55 @@ export const CompactAgentRow = React.memo(function CompactAgentRow({ ) : null + // Why: the selected-row fill is strong enough to wash out the dimmed prompt/secondary text, so + // lift the lead toward full foreground when focused; an unvisited row stays bold either way. + const leadClassName = cn( + isUnvisited ? 'font-semibold text-foreground' : 'font-normal text-muted-foreground/90', + isFocusedPane && !isUnvisited && 'text-foreground' + ) + const rowBody = ( <> - {/* Why: the row's actionable disabled reason must win on every hit area. */} - - {!hideIcon && ( - - - - )} - - {/* Why: the selected-row fill is strong enough to wash out the dimmed - prompt/secondary text, so lift both toward full foreground when focused. */} - + ) : ( + <> + {/* Why: the row's actionable disabled reason must win on every hit area. */} + + {!hideIcon && ( + + + )} - > - {leadingText} - - {trailingText && ( - - {' '} - - {trailingText} + + {leadingText} + {trailingText && ( + + {' '} + - {trailingText} + + )} - )} - + + )} {model && ( 0 ? row.firstObservedAt : parentEntry.stateStartedAt + const paneKey = subagentRowKey(parentEntry.paneKey, row.id) + const detail = row.detail + // The same fields a CLI agent row carries, so every reader of a CLI row reads a child the same way. + const entry: AgentStatusEntry = { + state: state === 'idle' || state === 'unverifiable' ? 'done' : state, + ...(row.displayState === 'monitoring' ? { workingMode: 'monitoring' as const } : {}), + prompt: row.name, + // The parent's delivery clock; the child's own evidence clock rides `evidenceObservedAt`. + updatedAt: parentEntry.updatedAt, + ...(row.observedAt !== undefined ? { evidenceObservedAt: row.observedAt } : {}), + stateStartedAt: startedAt, + agentType: row.agentType, + model: row.model, + ...(detail?.kind === 'operation' + ? { + toolName: detail.toolName, + ...(detail.input !== undefined ? { toolInput: detail.input } : {}) + } + : {}), + ...(detail?.kind === 'message' ? { lastAssistantMessage: detail.text } : {}), + paneKey, + worktreeId: parentEntry.worktreeId, + tabId: parentEntry.tabId, + stateHistory: [], + orchestration: { + taskId: `subagent:${row.id}`, + dispatchId: `subagent:${row.id}`, + displayName: row.name || undefined, + parentPaneKey: parentEntry.paneKey + } + } + return { + paneKey, + entry, + tab, + agentType: row.agentType ?? 'unknown', + rowSource: 'subagent', + state, + activationPaneKey: parentEntry.paneKey, + startedAt, + childRow: row + } +} + /** - * Derive indented child rows for the live in-process subagents/teammates a - * pane's agent has spawned (entry.subagents, reported via agent hooks). These - * children have no PTY or tab of their own: the rows reuse the parent's tab, - * activate the parent's pane, and link into the existing lineage tree through - * `orchestration.parentPaneKey`. + * Derive indented child rows for the subagents/teammates a pane's agent has + * spawned. These children have no PTY or tab of their own: the rows reuse the + * parent's tab, activate the parent's pane, and link into the existing lineage + * tree through `orchestration.parentPaneKey`. The host's child views win; a host + * that sends only the legacy `subagents` snapshot (an old host, any CLI pane) + * is read as before. */ export function buildSubagentChildRows(args: { parentEntry: AgentStatusEntry @@ -25,48 +95,14 @@ export function buildSubagentChildRows(args: { * states are equally unverifiable. */ parentIsFresh: boolean }): DashboardAgentRow[] { - const subagents = args.parentEntry.subagents - if (!subagents || subagents.length === 0) { - return [] - } - return subagents.map((subagent) => { - const freshness = resolveAgentChildWorkFreshness({ - state: subagent.state, - membership: 'live', - parentEvidenceFresh: args.parentIsFresh, - transportObservation: args.parentEntry.subagentObservation ?? 'live' - }) - const state = freshness === 'done' ? 'idle' : freshness === 'monitoring' ? 'working' : freshness - const activeState = state !== 'idle' && state !== 'unverifiable' ? state : undefined - const startedAt = subagent.startedAt > 0 ? subagent.startedAt : args.parentEntry.stateStartedAt - const paneKey = subagentRowKey(args.parentEntry.paneKey, subagent.id) - const entry: AgentStatusEntry = { - state: activeState ?? 'done', - prompt: subagent.description ?? subagent.agentType ?? '', - updatedAt: args.parentEntry.updatedAt, - stateStartedAt: startedAt, - agentType: subagent.agentType, - model: subagent.model, - paneKey, - worktreeId: args.parentEntry.worktreeId, - tabId: args.parentEntry.tabId, - stateHistory: [], - orchestration: { - taskId: `subagent:${subagent.id}`, - dispatchId: `subagent:${subagent.id}`, - displayName: subagent.description, - parentPaneKey: args.parentEntry.paneKey - } - } - return { - paneKey, - entry, - tab: args.tab, - agentType: subagent.agentType ?? 'unknown', - rowSource: 'subagent' as const, - state, - activationPaneKey: args.parentEntry.paneKey, - startedAt - } - }) + const { parentEntry } = args + const context = agentChildRowContextForParent(parentEntry, args.parentIsFresh) + const rows = + parentEntry.children !== undefined + ? buildAgentChildRowModels(parentEntry.children, context) + : buildLegacyAgentChildRowModels(parentEntry.subagents ?? [], context) + // Shells and monitors show through their owner's dot; the sidebar lists agents. + return flattenAgentChildRowModels(rows) + .filter((row) => row.kind === 'agent') + .map((row) => childDashboardRow(row, parentEntry, args.tab)) } diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 9351961c28ab..5db365466e6a 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -18197,6 +18197,9 @@ } } } + }, + "agentChildRow": { + "ended": "Ended" } }, "dashboardPopout": { diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index e0e77e574ec9..79070fc23f5d 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -15171,6 +15171,9 @@ "copySessionIdSuccess": "ID de sesión copiado", "copySessionIdError": "No se pudo copiar el ID de sesión" } + }, + "agentChildRow": { + "ended": "Finalizado" } }, "dashboardPopout": { diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json index 9a0f0d437c93..04e9bb284ab6 100644 --- a/src/renderer/src/i18n/locales/fr.json +++ b/src/renderer/src/i18n/locales/fr.json @@ -18169,6 +18169,9 @@ } } } + }, + "agentChildRow": { + "ended": "Terminé" } }, "dashboardPopout": { diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 6ec0e9c65e7e..90f55805342d 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -18070,6 +18070,9 @@ } } } + }, + "agentChildRow": { + "ended": "終了" } }, "dashboardPopout": { diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index e5d5cac60fcc..dd0dbdfa8a76 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -18070,6 +18070,9 @@ } } } + }, + "agentChildRow": { + "ended": "종료됨" } }, "dashboardPopout": { diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index d8a7ebf4561f..1514dd25697c 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -18070,6 +18070,9 @@ } } } + }, + "agentChildRow": { + "ended": "已结束" } }, "dashboardPopout": { diff --git a/src/renderer/src/lib/agent-row-dot-state.ts b/src/renderer/src/lib/agent-row-dot-state.ts index 79c0d7c198c5..bf2b7b1e5320 100644 --- a/src/renderer/src/lib/agent-row-dot-state.ts +++ b/src/renderer/src/lib/agent-row-dot-state.ts @@ -1,5 +1,7 @@ import type { AgentDotState } from '@/components/AgentStateDot' -import type { AgentWorkingMode } from '../../../shared/agent-status-types' +import type { AgentChildRowModel } from '../../../shared/agent-child-row-model' +import { agentVerdictDisplayMark } from '../../../shared/agent-main-agent-verdict' +import type { AgentStatusEntry, AgentWorkingMode } from '../../../shared/agent-status-types' import type { AgentRowState } from './agent-row-decay-state' /** @@ -22,3 +24,20 @@ export function agentRowDotState( } return 'idle' } + +/** + * The dot an agent row renders: a child row's own, else the main agent's verdict (a stop or a + * failure, which a failure shows even while subagents still run), else its state. + */ +export function agentRowDisplayDotState(agent: { + state: AgentRowState + entry: Pick + childRow?: Pick +}): AgentDotState { + if (agent.childRow) { + return agent.childRow.displayState + } + return ( + agentVerdictDisplayMark(agent.entry) ?? agentRowDotState(agent.state, agent.entry.workingMode) + ) +} diff --git a/src/shared/agent-child-row-model.test.ts b/src/shared/agent-child-row-model.test.ts new file mode 100644 index 000000000000..a99ef0a71520 --- /dev/null +++ b/src/shared/agent-child-row-model.test.ts @@ -0,0 +1,384 @@ +import { describe, expect, it } from 'vitest' +import { + agentChildRowContextForParent, + buildAgentChildRowModels, + buildLegacyAgentChildRowModels, + buildLegacyTaskRowModels, + flattenAgentChildRowModels, + type AgentChildRowContext, + type AgentChildRowModel +} from './agent-child-row-model' +import type { AgentChildWorkView } from './agent-status-child-work-view' + +const FRESH: AgentChildRowContext = { + parentEvidenceFresh: true, + transportObservation: 'live', + parentObservedAt: 900, + hostClockOffsetMs: 0 +} +const STALE: AgentChildRowContext = { ...FRESH, parentEvidenceFresh: false } +const LOST: AgentChildRowContext = { ...FRESH, transportObservation: 'unverifiable' } + +function view(id: string, overrides: Partial = {}): AgentChildWorkView { + return { + id, + providerId: `task-${id}`, + kind: 'agent', + description: `child ${id}`, + agentType: 'general-purpose', + state: 'working', + membership: 'live', + firstObservedAt: 100, + observedAt: 500, + stoppable: true, + invocation: { invocationId: `spawn-${id}`, generation: 1 }, + ...overrides + } +} + +function settled( + id: string, + outcome: NonNullable, + overrides: Partial = {} +): AgentChildWorkView { + return view(id, { + state: 'done', + membership: 'settled', + outcome, + settledAt: 450, + ...overrides + }) +} + +function shell(id: string, owner: string, overrides: Partial = {}) { + return view(id, { + kind: 'command', + description: 'npm run dev', + agentType: undefined, + state: 'monitoring', + parentChildWorkId: owner, + ...overrides + }) +} + +function only(views: AgentChildWorkView[], context = FRESH): AgentChildRowModel { + const [row] = buildAgentChildRowModels(views, context) + return row +} + +describe('buildAgentChildRowModels: the display vocabulary', () => { + it.each<[string, AgentChildWorkView[], Pick]>([ + [ + 'working with no known operation names its role', + [view('a')], + { displayState: 'working', detail: { kind: 'role', agentType: 'general-purpose' } } + ], + [ + 'working with a foreground tool names the tool the way a CLI row does', + [view('a', { operation: { toolName: 'Read', basis: 'open', observedAt: 400 } })], + { displayState: 'working', detail: { kind: 'operation', toolName: 'Read' } } + ], + [ + 'a foreground shell reads as working with its command', + [ + view('a', { + operation: { toolName: 'Bash', input: 'npm test', basis: 'open', observedAt: 400 } + }) + ], + { + displayState: 'working', + detail: { kind: 'operation', toolName: 'Bash', input: 'npm test' } + } + ], + [ + 'an idle child whose own shell runs reads monitoring', + [view('a', { state: 'idle' }), shell('s', 'a')], + { displayState: 'monitoring', detail: { kind: 'monitoring' } } + ], + [ + 'a finished child whose own shell runs reads monitoring', + [settled('a', 'succeeded', { lastMessage: 'All green' }), shell('s', 'a')], + { displayState: 'monitoring', detail: { kind: 'monitoring' } } + ], + [ + 'waiting names the tool the approval is for', + [ + view('a', { + state: 'waiting', + operation: { toolName: 'Edit', input: 'src/a.ts', basis: 'open', observedAt: 400 } + }) + ], + { + displayState: 'waiting', + detail: { kind: 'operation', toolName: 'Edit', input: 'src/a.ts' } + } + ], + [ + 'blocked says why', + [view('a', { state: 'blocked', lastMessage: 'Rate limited' })], + { displayState: 'blocked', detail: { kind: 'message', text: 'Rate limited' } } + ], + [ + 'succeeded reads done with its last message', + [settled('a', 'succeeded', { lastMessage: 'Found 3 call sites' })], + { displayState: 'done', detail: { kind: 'message', text: 'Found 3 call sites' } } + ], + [ + 'failed reads failed with its error', + [settled('a', 'failed', { lastMessage: 'Exit code 1' })], + { displayState: 'failed', detail: { kind: 'message', text: 'Exit code 1' } } + ], + [ + 'cancelled reads interrupted and adds no message', + [settled('a', 'cancelled', { lastMessage: 'half a thought' })], + { displayState: 'interrupted', detail: { kind: 'role', agentType: 'general-purpose' } } + ], + [ + 'an ending the lane cannot classify is neutral and says Ended', + [settled('a', 'unknown')], + { displayState: 'idle', detail: { kind: 'ended' } } + ], + [ + 'a parked live child names its role', + [view('a', { state: 'idle' })], + { displayState: 'idle', detail: { kind: 'role', agentType: 'general-purpose' } } + ], + [ + 'a host-reported unverifiable child reports its silence', + [view('a', { state: 'unverifiable' })], + { displayState: 'unverifiable', detail: { kind: 'no-update' } } + ] + ])('%s', (_name, views, expected) => { + expect(only(views)).toMatchObject(expected) + }) + + it('suppresses the tool line while monitoring, even when a stale operation arrives', () => { + const row = only([ + view('a', { + state: 'idle', + operation: { toolName: 'Bash', input: 'npm test', basis: 'reported', observedAt: 400 } + }), + shell('s', 'a') + ]) + expect(row.displayState).toBe('monitoring') + expect(row.detail).toEqual({ kind: 'monitoring' }) + }) + + it('makes every live claim unverifiable under a stale parent or a lost transport', () => { + for (const context of [STALE, LOST]) { + expect(only([view('a')], context)).toMatchObject({ + displayState: 'unverifiable', + detail: { kind: 'no-update' } + }) + // A finished child's monitoring is a claim about live work; its outcome is history. + expect(only([settled('a', 'succeeded'), shell('s', 'a')], context).displayState).toBe( + 'unverifiable' + ) + expect(only([settled('a', 'failed')], context).displayState).toBe('failed') + expect(only([view('a', { state: 'idle' })], context).displayState).toBe('idle') + } + }) + + it('gives sibling rows their own clocks, never the parent one', () => { + const [busy, quiet] = buildAgentChildRowModels( + [view('busy', { observedAt: 880 }), view('quiet', { firstObservedAt: 200, observedAt: 300 })], + STALE + ) + expect([busy.recencyAt, quiet.recencyAt]).toEqual([880, 300]) + expect([busy.observedAt, quiet.observedAt]).toEqual([880, 300]) + expect([busy.firstObservedAt, quiet.firstObservedAt]).toEqual([100, 200]) + }) + + it('nests owned work under its owner and keeps host order', () => { + const rows = buildAgentChildRowModels( + [ + view('a'), + shell('s', 'a', { state: 'working' }), + view('b'), + view('grandchild', { parentChildWorkId: 'a' }) + ], + FRESH + ) + expect(rows.map((row) => row.id)).toEqual(['a', 'b']) + expect(rows[0].owned.map((row) => row.id)).toEqual(['s', 'grandchild']) + expect(flattenAgentChildRowModels(rows).map((row) => row.id)).toEqual([ + 'a', + 's', + 'grandchild', + 'b' + ]) + // A shell names itself; only an agent's own tool line can go stale. + expect(rows[0].owned[0]).toMatchObject({ displayState: 'working', detail: null }) + }) + + it('names a row by its label and omits a role that restates it', () => { + expect( + only([view('a', { description: ' ', name: 'subagent', agentType: 'Explore' })]) + ).toMatchObject({ name: 'Explore', detail: null }) + expect(only([view('a', { description: undefined, agentType: undefined })])).toMatchObject({ + name: '', + detail: { kind: 'role', agentType: 'unknown' } + }) + }) + + it('offers a stop only for a live row the host can target', () => { + expect(only([view('a')]).canStop).toBe(true) + expect(only([view('a', { providerId: undefined })]).canStop).toBe(false) + expect(only([view('a', { stoppable: false })]).canStop).toBe(false) + expect(only([settled('a', 'succeeded')]).canStop).toBe(false) + }) +}) + +describe('buildLegacyAgentChildRowModels', () => { + it('reads a legacy snapshot as before: no clock of its own, no outcome, no operation', () => { + const rows = buildLegacyAgentChildRowModels( + [ + { id: 'w', state: 'working', startedAt: 10, description: 'Review', agentType: 'Explore' }, + { id: 'i', state: 'idle', startedAt: 20, agentType: 'writer' }, + { id: 'u', state: 'unverifiable', startedAt: 30 } + ], + FRESH + ) + expect(rows).toEqual([ + expect.objectContaining({ + id: 'w', + providerId: 'w', + displayState: 'working', + name: 'Review', + detail: { kind: 'role', agentType: 'Explore' }, + firstObservedAt: 10, + recencyAt: 900, + settled: false, + canStop: false + }), + expect.objectContaining({ id: 'i', displayState: 'idle', name: 'writer', detail: null }), + expect.objectContaining({ + id: 'u', + displayState: 'unverifiable', + detail: { kind: 'no-update' } + }) + ]) + expect(rows.every((row) => row.observedAt === undefined)).toBe(true) + }) + + it('decays live legacy states under a stale parent, as before', () => { + const rows = buildLegacyAgentChildRowModels( + [ + { id: 'w', state: 'working', startedAt: 10 }, + { id: 'q', state: 'waiting', startedAt: 10 }, + { id: 'i', state: 'idle', startedAt: 10 } + ], + STALE + ) + expect(rows.map((row) => row.displayState)).toEqual(['unverifiable', 'unverifiable', 'idle']) + }) +}) + +describe('buildLegacyTaskRowModels', () => { + it('keeps the state the host decided and says only its reason', () => { + const rows = buildLegacyTaskRowModels( + [ + { id: 'w', kind: 'agent', description: 'Review', state: 'working', startedAt: 10 }, + { id: 'q', kind: 'agent', description: 'Approve', state: 'waiting' }, + { id: 'u', kind: 'agent', description: 'Lost', state: 'unverifiable' }, + { id: 'm', kind: 'monitor', description: 'tail -f log' }, + { id: 'c', kind: 'command', description: 'npm test', stoppable: false } + ], + [{ id: 'd', kind: 'agent', description: 'Done', totalTokens: 900 }] + ) + expect(rows.map((row) => [row.id, row.displayState, row.detail])).toEqual([ + ['d', 'done', null], + ['w', 'working', null], + ['q', 'waiting', { kind: 'reason', state: 'waiting' }], + ['u', 'unverifiable', { kind: 'reason', state: 'unverifiable' }], + ['m', 'monitoring', null], + ['c', 'working', null] + ]) + expect(rows.map((row) => row.canStop)).toEqual([true, true, true, true, true, false]) + expect(rows[0]).toMatchObject({ settled: true, totalTokens: 900 }) + }) + + it('lets a resumed live task replace its retained settled row', () => { + const rows = buildLegacyTaskRowModels( + [{ id: 'r', kind: 'agent', state: 'working' }], + [{ id: 'r', kind: 'agent', state: 'done' }] + ) + expect(rows).toHaveLength(1) + expect(rows[0]).toMatchObject({ settled: false, displayState: 'working' }) + }) +}) + +describe('one label rule for every shape a host publishes', () => { + it.each(['task', ' Subagent ', 'unknown', ' '])( + 'skips the placeholder %j on all three', + (label) => { + const [fromView] = buildAgentChildRowModels( + [view('a', { description: label, agentType: 'Explore' })], + FRESH + ) + const [fromSnapshot] = buildLegacyAgentChildRowModels( + [{ id: 'a', state: 'working', startedAt: 10, description: label, agentType: 'Explore' }], + FRESH + ) + const [fromRoster] = buildLegacyTaskRowModels( + [{ id: 'a', kind: 'agent', state: 'working', description: label, name: 'Explore' }], + [] + ) + expect([fromView.name, fromSnapshot.name, fromRoster.name]).toEqual([ + 'Explore', + 'Explore', + 'Explore' + ]) + } + ) + + it('leaves a row with no usable label unnamed on all three', () => { + const [fromSnapshot] = buildLegacyAgentChildRowModels( + [{ id: 'a', state: 'working', startedAt: 10, description: 'task' }], + FRESH + ) + const [fromRoster] = buildLegacyTaskRowModels( + [{ id: 'a', kind: 'agent', state: 'working', description: 'task' }], + [] + ) + expect([only([view('a', { description: 'task', agentType: undefined })]).name]).toEqual(['']) + expect([fromSnapshot.name, fromRoster.name]).toEqual(['', '']) + }) +}) + +describe('agentChildRowContextForParent: the reader clock', () => { + const MIRRORED_PARENT = { + // The host's clock runs 20 minutes ahead of this machine's. + updatedAt: 1_200_000 + 20 * 60_000, + evidenceObservedAt: 1_190_000 + 20 * 60_000, + mirroredEvidenceReceivedAt: 1_190_000 + } + + it("measures a mirrored parent on this machine's receipt clock, never the host's", () => { + const context = agentChildRowContextForParent(MIRRORED_PARENT, false) + expect(context).toMatchObject({ parentObservedAt: 1_190_000, hostClockOffsetMs: -20 * 60_000 }) + const [legacy] = buildLegacyAgentChildRowModels( + [{ id: 'a', state: 'working', startedAt: 10 }], + context + ) + expect(legacy.recencyAt).toBe(1_190_000) + // A view's own host stamp moves onto the reader clock; its host-clock age is kept. + const [child] = buildAgentChildRowModels( + [view('a', { observedAt: 1_100_000 + 20 * 60_000 })], + context + ) + expect(child.recencyAt).toBe(1_100_000) + expect(child.observedAt).toBe(1_100_000 + 20 * 60_000) + }) + + it('leaves a parent observed on this machine on its own clock', () => { + expect( + agentChildRowContextForParent({ updatedAt: 500, evidenceObservedAt: 400 }, true) + ).toEqual({ + parentEvidenceFresh: true, + transportObservation: 'live', + parentObservedAt: 400, + hostClockOffsetMs: 0 + }) + }) +}) diff --git a/src/shared/agent-child-row-model.ts b/src/shared/agent-child-row-model.ts new file mode 100644 index 000000000000..8e1cf606eea1 --- /dev/null +++ b/src/shared/agent-child-row-model.ts @@ -0,0 +1,376 @@ +/** + * One row model for every surface that lists child work (the sidebar's child rows and the chat + * strip), with one builder per shape a host may publish. All three name a row with one label rule + * (`usableAgentChildLabel`) and decide what it says with one detail rule (`agentChildRowDetail`): + * - `buildAgentChildRowModels`: the host's child views (`children`), the source of record. + * - `buildLegacyAgentChildRowModels`: the `subagents` snapshot. + * - `buildLegacyTaskRowModels`: the session feed's `tasks` / `settledTasks` roster. + * + * The two legacy builders exist only for hosts that publish no views, and each is deleted, not + * migrated, when its last publisher is gone: the snapshot builder once CLI panes publish + * `children` and no supported paired host predates that; the roster builder once no supported + * paired host predates child views on the session feed. + */ +import type { AgentSessionBackgroundTask } from './agent-session-background-task-wire' +import type { AgentChildWorkKind } from './agent-status-child-work' +import { resolveAgentChildWorkFreshness } from './agent-status-child-work-freshness' +import { + agentChildWorkOwnedLiveness, + deriveAgentChildDisplayState, + type AgentChildDisplayState +} from './agent-status-child-work-display' +import type { AgentChildWorkView } from './agent-status-child-work-view' +import { + agentStatusAuthorityObservedAt, + agentStatusEvidenceObservedAt +} from './agent-status-freshness' +import type { AgentStatusEntry, AgentSubagentSnapshot } from './agent-status-types' + +/** What a child row says beside its name. Surfaces format it; they never decide it. */ +export type AgentChildRowDetail = + /** The tool the child is running now, as `tool: input` — the line a CLI agent row shows. */ + | { kind: 'operation'; toolName: string; input?: string } + /** Its own work is over and only work it owns still runs; the tool line is stale. */ + | { kind: 'monitoring' } + | { kind: 'message'; text: string } + /** Settled, and the lane cannot say how. */ + | { kind: 'ended' } + /** How long since the last evidence for this child (see `recencyAt`). */ + | { kind: 'no-update' } + /** The child's role, when nothing more specific is known. */ + | { kind: 'role'; agentType: string } + /** A host that publishes only a run state: that state's reason word. */ + | { kind: 'reason'; state: 'waiting' | 'blocked' | 'unverifiable' } + +/** One child row, for every surface that lists child work (sidebar and chat strip). */ +export type AgentChildRowModel = { + /** Row identity: the host's child id, or the provider id an old host names it by. */ + id: string + /** The id a targeted stop names; absent when the host holds none. */ + providerId?: string + kind: AgentChildWorkKind + displayState: AgentChildDisplayState + /** '' when the child reported no label; a surface then names the row by its state. */ + name: string + agentType?: string + model?: string + detail: AgentChildRowDetail | null + /** When the child was first seen: the elapsed anchor. */ + firstObservedAt: number + /** Last evidence for THIS child. Absent from a host that reports none. */ + observedAt?: number + /** The reader-clock time a "no update" reading measures from: the child's own evidence, else + * its parent's. */ + recencyAt: number + settledAt?: number + totalTokens?: number + canStop: boolean + settled: boolean + /** Work this child owns (a nested agent, a shell it launched), in host order. */ + owned: AgentChildRowModel[] +} + +export type AgentChildRowContext = { + /** A stale parent makes every live claim beneath it unverifiable. */ + parentEvidenceFresh: boolean + transportObservation: 'live' | 'unverifiable' + /** The parent's last evidence on the READER's clock (its receipt time when mirrored from another + * host): recency for a child whose host reports no clock of its own. */ + parentObservedAt: number + /** Reader clock minus the host's, at that evidence; 0 for a parent observed on this machine. Moves + * a child's host-stamped clock onto the reader's, so no age subtracts across two machines. */ + hostClockOffsetMs: number +} + +/** The context a parent row gives its children. Every surface that lists one parent's children + * builds it here, from the same parent row, so a lost child reads the same everywhere. */ +export function agentChildRowContextForParent( + parent: Pick< + AgentStatusEntry, + 'updatedAt' | 'evidenceObservedAt' | 'mirroredEvidenceReceivedAt' | 'subagentObservation' + >, + parentEvidenceFresh: boolean +): AgentChildRowContext { + // The parent row decays on this same clock, so a child's silence reads the same as its parent's. + const parentObservedAt = agentStatusEvidenceObservedAt(parent) + return { + parentEvidenceFresh, + transportObservation: parent.subagentObservation ?? 'live', + parentObservedAt, + hostClockOffsetMs: parentObservedAt - agentStatusAuthorityObservedAt(parent) + } +} + +/** Provider strings that carry no identity; the next label wins. */ +const PLACEHOLDER_LABELS = new Set(['unknown', 'untitled', 'task', 'subagent']) + +/** A provider label that names the child, or undefined for an empty or placeholder one. */ +export function usableAgentChildLabel(value: string | undefined): string | undefined { + const trimmed = value?.trim() + return trimmed && !PLACEHOLDER_LABELS.has(trimmed.toLowerCase()) ? trimmed : undefined +} + +// A live claim beneath a parent Orca no longer hears from asserts nothing; settled history stands. +function withFreshness( + displayState: AgentChildDisplayState, + context: AgentChildRowContext +): AgentChildDisplayState { + if ( + displayState === 'done' || + displayState === 'failed' || + displayState === 'interrupted' || + displayState === 'idle' + ) { + return displayState + } + return resolveAgentChildWorkFreshness({ + state: displayState, + membership: 'live', + parentEvidenceFresh: context.parentEvidenceFresh, + transportObservation: context.transportObservation + }) +} + +type AgentChildRowDetailSource = { + /** `run-state`: the host reported only the child's run state (the legacy task roster). */ + evidence: 'child' | 'run-state' + kind: AgentChildWorkKind + name: string + agentType?: string + operation?: { toolName: string; input?: string } + lastMessage?: string + settled: boolean +} + +// A role that restates the name adds nothing. +function roleDetail(source: AgentChildRowDetailSource): AgentChildRowDetail | null { + if (source.kind !== 'agent') { + return null + } + const agentType = source.agentType ?? 'unknown' + return source.name.trim() === agentType.trim() ? null : { kind: 'role', agentType } +} + +function messageOrRole(source: AgentChildRowDetailSource): AgentChildRowDetail | null { + const text = source.lastMessage?.trim() + return text ? { kind: 'message', text } : roleDetail(source) +} + +/** The one rule for what a child row says, in the order a CLI agent row decides it. */ +function agentChildRowDetail( + source: AgentChildRowDetailSource, + displayState: AgentChildDisplayState +): AgentChildRowDetail | null { + if (source.evidence === 'run-state') { + return displayState === 'waiting' || + displayState === 'blocked' || + displayState === 'unverifiable' + ? { kind: 'reason', state: displayState } + : null + } + switch (displayState) { + case 'unverifiable': + return { kind: 'no-update' } + case 'monitoring': + // A shell or monitor names itself; only an agent's own tool line goes stale. + return source.kind === 'agent' ? { kind: 'monitoring' } : null + case 'working': + case 'waiting': + return source.operation + ? { + kind: 'operation', + toolName: source.operation.toolName, + ...(source.operation.input !== undefined ? { input: source.operation.input } : {}) + } + : messageOrRole(source) + case 'blocked': + case 'done': + case 'failed': + return messageOrRole(source) + case 'interrupted': + return roleDetail(source) + case 'idle': + return source.settled ? { kind: 'ended' } : roleDetail(source) + } +} + +function viewName(view: AgentChildWorkView): string { + return ( + usableAgentChildLabel(view.description) ?? + usableAgentChildLabel(view.name) ?? + usableAgentChildLabel(view.agentType) ?? + '' + ) +} + +function rowFromView( + view: AgentChildWorkView, + views: readonly AgentChildWorkView[], + ownedByOwner: ReadonlyMap, + context: AgentChildRowContext, + path: ReadonlySet +): AgentChildRowModel { + const displayState = withFreshness( + deriveAgentChildDisplayState(view, agentChildWorkOwnedLiveness(views, view.id)), + context + ) + const settled = view.membership === 'settled' + const name = viewName(view) + const nextPath = new Set(path).add(view.id) + return { + id: view.id, + ...(view.providerId !== undefined ? { providerId: view.providerId } : {}), + kind: view.kind, + displayState, + name, + ...(view.agentType !== undefined ? { agentType: view.agentType } : {}), + ...(view.model !== undefined ? { model: view.model } : {}), + detail: agentChildRowDetail( + { + evidence: 'child', + kind: view.kind, + name, + agentType: view.agentType, + operation: view.operation, + lastMessage: view.lastMessage, + settled + }, + displayState + ), + firstObservedAt: view.firstObservedAt, + observedAt: view.observedAt, + recencyAt: view.observedAt + context.hostClockOffsetMs, + ...(view.settledAt !== undefined ? { settledAt: view.settledAt } : {}), + ...(view.totalTokens !== undefined ? { totalTokens: view.totalTokens } : {}), + canStop: !settled && view.stoppable && view.providerId !== undefined, + settled, + owned: (ownedByOwner.get(view.id) ?? []) + .filter((owned) => !nextPath.has(owned.id)) + .map((owned) => rowFromView(owned, views, ownedByOwner, context, nextPath)) + } +} + +/** + * Child rows from the host's views: the main agent's children at the top, and everything a child + * owns nested beneath it. Display state comes from the shared child fold, so a finished subagent + * whose shell still runs reads `monitoring` exactly as a CLI agent does. + */ +export function buildAgentChildRowModels( + views: readonly AgentChildWorkView[], + context: AgentChildRowContext +): AgentChildRowModel[] { + const ownedByOwner = new Map() + for (const view of views) { + if (view.parentChildWorkId !== undefined) { + ownedByOwner.set(view.parentChildWorkId, [ + ...(ownedByOwner.get(view.parentChildWorkId) ?? []), + view + ]) + } + } + return views + .filter((view) => view.parentChildWorkId === undefined) + .map((view) => rowFromView(view, views, ownedByOwner, context, new Set())) +} + +/** + * Child rows from a host that sends only the legacy `subagents` snapshot (an old host, or any CLI + * pane): live agents with a lifecycle state and a spawn time, and no clock of their own. + */ +export function buildLegacyAgentChildRowModels( + subagents: readonly AgentSubagentSnapshot[], + context: AgentChildRowContext +): AgentChildRowModel[] { + return subagents.map((subagent) => { + const displayState = withFreshness( + deriveAgentChildDisplayState({ state: subagent.state, membership: 'live' }, null), + context + ) + const name = + usableAgentChildLabel(subagent.description) ?? usableAgentChildLabel(subagent.agentType) ?? '' + return { + id: subagent.id, + providerId: subagent.id, + kind: 'agent', + displayState, + name, + ...(subagent.agentType !== undefined ? { agentType: subagent.agentType } : {}), + ...(subagent.model !== undefined ? { model: subagent.model } : {}), + detail: agentChildRowDetail( + { evidence: 'child', kind: 'agent', name, agentType: subagent.agentType, settled: false }, + displayState + ), + firstObservedAt: subagent.startedAt, + recencyAt: context.parentObservedAt, + canStop: false, + settled: false, + owned: [] + } + }) +} + +function legacyTaskDisplayState( + task: AgentSessionBackgroundTask, + settled: boolean +): AgentChildDisplayState { + if (task.state) { + return task.state + } + if (settled) { + return 'done' + } + return task.kind === 'monitor' ? 'monitoring' : 'working' +} + +// The host decided each row's state; the row keeps it. +function legacyTaskRow(task: AgentSessionBackgroundTask, settled: boolean): AgentChildRowModel { + const displayState = legacyTaskDisplayState(task, settled) + const name = usableAgentChildLabel(task.description) ?? usableAgentChildLabel(task.name) ?? '' + const startedAt = task.startedAt ?? 0 + return { + id: task.id, + providerId: task.id, + kind: task.kind, + displayState, + name, + detail: agentChildRowDetail( + { evidence: 'run-state', kind: task.kind, name, settled }, + displayState + ), + firstObservedAt: startedAt, + recencyAt: startedAt, + ...(task.totalTokens !== undefined ? { totalTokens: task.totalTokens } : {}), + // Absent means stoppable: a host predating the field published only rows its stop could act on. + canStop: task.stoppable !== false, + settled, + owned: [] + } +} + +/** + * Rows from a host that publishes only the session feed's task roster (a host predating child + * views): flat, each with the run state the host decided and no clock beyond its start. + */ +export function buildLegacyTaskRowModels( + tasks: readonly AgentSessionBackgroundTask[], + settledTasks: readonly AgentSessionBackgroundTask[] +): AgentChildRowModel[] { + // Older hosts can retain a previous turn beside its resumed live task; the live row wins. + const rows = new Map() + for (const [roster, settled] of [ + [settledTasks, true], + [tasks, false] + ] as const) { + for (const task of roster) { + rows.set(task.id, legacyTaskRow(task, settled)) + } + } + return [...rows.values()] +} + +/** Every row of a tree, owners before what they own. */ +export function flattenAgentChildRowModels( + rows: readonly AgentChildRowModel[] +): AgentChildRowModel[] { + return rows.flatMap((row) => [row, ...flattenAgentChildRowModels(row.owned)]) +} diff --git a/src/shared/agent-status-child-work-display.ts b/src/shared/agent-status-child-work-display.ts new file mode 100644 index 000000000000..c83957199f99 --- /dev/null +++ b/src/shared/agent-status-child-work-display.ts @@ -0,0 +1,114 @@ +import { foldAgentLeadStatus } from './agent-lead-status-fold' +import type { AgentSessionBackgroundTaskRunState } from './agent-session-background-task-wire' +import type { AgentChildWorkId, AgentChildWorkOutcome } from './agent-status-child-work' +import { + agentChildWorkLiveness, + type AgentChildWorkLiveness +} from './agent-status-child-work-liveness' +import type { AgentChildWorkView } from './agent-status-child-work-view' +import type { AgentStatusState } from './agent-status-types' +import { groupedBy } from './grouped-by' + +// What a surface derives from child views. Kept apart from the projection, which resolves owners +// against status subjects and so reaches host-only code: every surface, renderer included, loads +// this module. + +type AgentChildWorkOwnershipView = Pick< + AgentChildWorkView, + 'id' | 'kind' | 'state' | 'membership' | 'parentChildWorkId' +> + +/** Liveness of all live work beneath a child, at any depth — the same input a parent row folds. */ +export function agentChildWorkOwnedLiveness( + views: readonly AgentChildWorkOwnershipView[], + ownerId: AgentChildWorkId +): AgentChildWorkLiveness { + const owned = groupedBy(views, (view) => view.parentChildWorkId) + const seen = new Set([ownerId]) + const frontier = [ownerId] + const liveDescendants: AgentChildWorkOwnershipView[] = [] + for (let owner = frontier.pop(); owner !== undefined; owner = frontier.pop()) { + for (const view of owned.get(owner) ?? []) { + if (!seen.has(view.id)) { + seen.add(view.id) + frontier.push(view.id) + if (view.membership === 'live') { + liveDescendants.push(view) + } + } + } + } + return agentChildWorkLiveness(liveDescendants) +} + +/** The dot a child row renders; every value is an `AgentStateDot` state. */ +export type AgentChildDisplayState = + | 'working' + | 'monitoring' + | 'waiting' + | 'blocked' + | 'done' + | 'failed' + | 'interrupted' + | 'idle' + | 'unverifiable' + +const SETTLED_DISPLAY_STATE: Record = { + succeeded: 'done', + failed: 'failed', + cancelled: 'interrupted', + // Neutral: an ending the lane cannot classify asserts nothing. + unknown: 'idle' +} + +/** + * A child's display state, through the same fold that decides a parent row's: work that is idle + * or finished enters it as `done`, so a live shell the child owns reads `monitoring` exactly as it + * would under a CLI agent. `unverifiable` is a freshness verdict and bypasses the fold. + */ +export function deriveAgentChildDisplayState( + view: Pick, + ownedLiveness: AgentChildWorkLiveness +): AgentChildDisplayState { + if (view.state === 'unverifiable') { + return 'unverifiable' + } + // Stored only by a shell or a monitor, and neither owns work. + if (view.state === 'monitoring') { + return 'monitoring' + } + const leadState: AgentStatusState = + view.membership === 'settled' || view.state === 'done' || view.state === 'idle' + ? 'done' + : view.state + // A child's cancel never hides the work it left running. + const foldInput = { leadState, childWorkLiveness: ownedLiveness, interrupted: false } + const folded = foldAgentLeadStatus(foldInput) + if (folded.stateName !== 'done') { + return folded.workingMode ?? folded.stateName + } + return view.membership === 'live' ? 'idle' : SETTLED_DISPLAY_STATE[view.outcome ?? 'unknown'] +} + +/** + * A display state in the run-state words a host publishes and every older reader already speaks: + * a failure reads as `blocked`, a cancel as `idle`. The row's own dot keeps the real outcome. + */ +export function agentChildRunStateFor( + displayState: AgentChildDisplayState +): AgentSessionBackgroundTaskRunState { + switch (displayState) { + case 'failed': + return 'blocked' + case 'interrupted': + return 'idle' + case 'working': + case 'monitoring': + case 'waiting': + case 'blocked': + case 'done': + case 'idle': + case 'unverifiable': + return displayState + } +} diff --git a/src/shared/agent-status-child-work-view.test.ts b/src/shared/agent-status-child-work-view.test.ts index 9c79a5451835..da0de4e752cd 100644 --- a/src/shared/agent-status-child-work-view.test.ts +++ b/src/shared/agent-status-child-work-view.test.ts @@ -15,7 +15,9 @@ import { } from './agent-status-child-work-projection' import { agentChildWorkOwnedLiveness, - deriveAgentChildDisplayState, + deriveAgentChildDisplayState +} from './agent-status-child-work-display' +import { projectAgentChildWorkViews, type AgentChildWorkView, type AgentChildWorkViewAlias diff --git a/src/shared/agent-status-child-work-view.ts b/src/shared/agent-status-child-work-view.ts index 8c70f6a3fea9..bfcbcfc11d5a 100644 --- a/src/shared/agent-status-child-work-view.ts +++ b/src/shared/agent-status-child-work-view.ts @@ -1,4 +1,3 @@ -import { foldAgentLeadStatus } from './agent-lead-status-fold' import { AGENT_CHILD_WORK_ALIAS_KINDS, type AgentChildWorkAliasInput, @@ -15,12 +14,8 @@ import { type AgentChildWorkOutcome, type AgentChildWorkState } from './agent-status-child-work' -import { - agentChildWorkLiveness, - type AgentChildWorkLiveness -} from './agent-status-child-work-liveness' import { agentStatusSubjectsEqual } from './agent-status-subject' -import type { AgentStatusState } from './agent-status-types' +import { groupedBy } from './grouped-by' /** What a surface reads about one child: a read-only projection of the host's record. * Host bookkeeping (residency, invocation history, provenance, aliases) never travels. A view @@ -83,21 +78,6 @@ function providerIdFor( return undefined } -// Not `Map.groupBy`: the relay runs this core on Node 18, which lacks it. -function groupedBy(items: readonly T[], keyOf: (item: T) => K): Map { - const groups = new Map() - for (const item of items) { - const key = keyOf(item) - const group = groups.get(key) - if (group) { - group.push(item) - } else { - groups.set(key, [item]) - } - } - return groups -} - function isOnOwnershipCycle( start: AgentChildWorkInput, byId: ReadonlyMap @@ -161,80 +141,3 @@ export function projectAgentChildWorkViews( } }) } - -type AgentChildWorkOwnershipView = Pick< - AgentChildWorkView, - 'id' | 'kind' | 'state' | 'membership' | 'parentChildWorkId' -> - -/** Liveness of all live work beneath a child, at any depth — the same input a parent row folds. */ -export function agentChildWorkOwnedLiveness( - views: readonly AgentChildWorkOwnershipView[], - ownerId: AgentChildWorkId -): AgentChildWorkLiveness { - const owned = groupedBy(views, (view) => view.parentChildWorkId) - const seen = new Set([ownerId]) - const frontier = [ownerId] - const liveDescendants: AgentChildWorkOwnershipView[] = [] - for (let owner = frontier.pop(); owner !== undefined; owner = frontier.pop()) { - for (const view of owned.get(owner) ?? []) { - if (!seen.has(view.id)) { - seen.add(view.id) - frontier.push(view.id) - if (view.membership === 'live') { - liveDescendants.push(view) - } - } - } - } - return agentChildWorkLiveness(liveDescendants) -} - -/** The dot a child row renders; every value is an `AgentStateDot` state. */ -export type AgentChildDisplayState = - | 'working' - | 'monitoring' - | 'waiting' - | 'blocked' - | 'done' - | 'failed' - | 'interrupted' - | 'idle' - | 'unverifiable' - -const SETTLED_DISPLAY_STATE: Record = { - succeeded: 'done', - failed: 'failed', - cancelled: 'interrupted', - // Neutral: an ending the lane cannot classify asserts nothing. - unknown: 'idle' -} - -/** - * A child's display state, through the same fold that decides a parent row's: work that is idle - * or finished enters it as `done`, so a live shell the child owns reads `monitoring` exactly as it - * would under a CLI agent. `unverifiable` is a freshness verdict and bypasses the fold. - */ -export function deriveAgentChildDisplayState( - view: Pick, - ownedLiveness: AgentChildWorkLiveness -): AgentChildDisplayState { - if (view.state === 'unverifiable') { - return 'unverifiable' - } - // Stored only by a shell or a monitor, and neither owns work. - if (view.state === 'monitoring') { - return 'monitoring' - } - const leadState: AgentStatusState = - view.membership === 'settled' || view.state === 'done' || view.state === 'idle' - ? 'done' - : view.state - // A child's cancel never hides the work it left running. - const foldInput = { leadState, childWorkLiveness: ownedLiveness, interrupted: false } - const folded = foldAgentLeadStatus(foldInput) - if (folded.stateName !== 'done') { - return folded.workingMode ?? folded.stateName - } - return view.membership === 'live' ? 'idle' : SETTLED_DISPLAY_STATE[view.outcome ?? 'unknown'] -} diff --git a/src/shared/agent-status-field-normalization.ts b/src/shared/agent-status-field-normalization.ts index 25d6b6413d4e..4fb741b5ec16 100644 --- a/src/shared/agent-status-field-normalization.ts +++ b/src/shared/agent-status-field-normalization.ts @@ -2,12 +2,17 @@ // String normalizers shared by every agent-status payload field: trim/fold to // a single line for previews, preserve structure for multiline bodies, and // truncate without splitting surrogate pairs. Extracted from -// agent-status-types.ts, which owns the payload shapes and per-field caps. +// agent-status-types.ts, which owns the payload shapes and the caps no other module applies. import { compactDispatchPromptForStatus } from './orca-dispatch-status-prompt' /** Maximum character length for the prompt field. Truncated on parse. */ export const AGENT_STATUS_MAX_FIELD_LENGTH = 200 +/** Maximum character length for the toolInput preview. */ +export const AGENT_STATUS_TOOL_INPUT_MAX_LENGTH = 160 +/** Maximum character length for the agentType label. Truncated on parse. */ +export const AGENT_TYPE_MAX_LENGTH = 40 +export const AGENT_MODEL_MAX_LENGTH = 120 const SINGLE_LINE_FIELD_SCAN_OVERHEAD = 64 const SINGLE_LINE_FIELD_SCAN_MULTIPLIER = 8 diff --git a/src/shared/agent-status-subagent-snapshot.ts b/src/shared/agent-status-subagent-snapshot.ts new file mode 100644 index 000000000000..b5a9f5af8fa4 --- /dev/null +++ b/src/shared/agent-status-subagent-snapshot.ts @@ -0,0 +1,108 @@ +// A pane's in-process subagents as the hook lane publishes them on a status row: the snapshot +// shape, its normalization at every admission point, and the equality stores reuse arrays by. + +import { + AGENT_MODEL_MAX_LENGTH, + AGENT_STATUS_TOOL_INPUT_MAX_LENGTH, + AGENT_TYPE_MAX_LENGTH, + normalizeOptionalField +} from './agent-status-field-normalization' + +export type AgentSubagentState = 'working' | 'blocked' | 'waiting' | 'idle' | 'unverifiable' + +/** A live in-process child of the pane's provider session. Rendered as an + * indented child row with no PTY of its own. */ +export type AgentSubagentSnapshot = { + /** Provider-assigned lifecycle id. */ + id: string + agentType?: string + /** Provider model used by this child, when exposed by its lifecycle event. */ + model?: string + description?: string + state: AgentSubagentState + /** Timestamp (ms) when this subagent was first observed. */ + startedAt: number +} + +/** Maximum subagent child rows carried per status entry. Bounds per-pane cache + * and IPC fanout against a runaway spawner. */ +export const AGENT_STATUS_MAX_SUBAGENTS = 32 +const AGENT_SUBAGENT_ID_MAX_LENGTH = 64 + +function normalizeSubagentSnapshot(value: unknown): AgentSubagentSnapshot | null { + if (typeof value !== 'object' || value === null) { + return null + } + const obj = value as Record + if (typeof obj.id !== 'string') { + return null + } + const id = obj.id.trim() + if (id.length === 0 || id.length > AGENT_SUBAGENT_ID_MAX_LENGTH) { + return null + } + if ( + obj.state !== 'working' && + obj.state !== 'blocked' && + obj.state !== 'waiting' && + obj.state !== 'idle' && + obj.state !== 'unverifiable' + ) { + return null + } + return { + id, + state: obj.state, + startedAt: + typeof obj.startedAt === 'number' && Number.isFinite(obj.startedAt) ? obj.startedAt : 0, + agentType: normalizeOptionalField(obj.agentType, AGENT_TYPE_MAX_LENGTH), + model: normalizeOptionalField(obj.model, AGENT_MODEL_MAX_LENGTH), + description: normalizeOptionalField(obj.description, AGENT_STATUS_TOOL_INPUT_MAX_LENGTH) + } +} + +export function normalizeAgentSubagentsField(value: unknown): AgentSubagentSnapshot[] | undefined { + if (!Array.isArray(value) || value.length === 0) { + return undefined + } + const normalized: AgentSubagentSnapshot[] = [] + for (const item of value) { + const snapshot = normalizeSubagentSnapshot(item) + if (snapshot) { + normalized.push(snapshot) + if (normalized.length >= AGENT_STATUS_MAX_SUBAGENTS) { + break + } + } + } + return normalized.length > 0 ? normalized : undefined +} + +/** Structural equality for subagent lists so stores can reuse the previous + * array reference (and skip fanout) when nothing actually changed. */ +export function agentSubagentsEqual( + a: AgentSubagentSnapshot[] | undefined, + b: AgentSubagentSnapshot[] | undefined +): boolean { + if (a === b) { + return true + } + if (!a || !b || a.length !== b.length) { + return !a && !b + } + for (let i = 0; i < a.length; i++) { + const x = a[i] + const y = b[i] + if ( + x.id !== y.id || + x.state !== y.state || + x.startedAt !== y.startedAt || + x.agentType !== y.agentType || + x.model !== y.model || + x.description !== y.description + ) { + return false + } + } + return true +} diff --git a/src/shared/agent-status-types.ts b/src/shared/agent-status-types.ts index 0150ef2b7fdc..acc7e4f42554 100644 --- a/src/shared/agent-status-types.ts +++ b/src/shared/agent-status-types.ts @@ -8,8 +8,12 @@ import type { AgentStateHistoryEntry } from './agent-state-history' import { isAgentJournalTurnOutcome } from './agent-turn-outcome' import type { OrchestrationFleetAttention } from './orchestration-fleet-attention' import type { AgentStatusRowFacets } from './agent-status-observation' +import type { AgentChildWorkView } from './agent-status-child-work-view' import type { TuiAgent } from './tui-agent' import { + AGENT_MODEL_MAX_LENGTH, + AGENT_STATUS_TOOL_INPUT_MAX_LENGTH, + AGENT_TYPE_MAX_LENGTH, normalizeInteractivePromptField, normalizeOptionalField, normalizeOptionalMultilineField, @@ -18,7 +22,23 @@ import { } from './agent-status-field-normalization' import { assertJsonTextStructureWithinLimits } from './json-text-structure-limit' -export { AGENT_STATUS_MAX_FIELD_LENGTH } from './agent-status-field-normalization' +import { + normalizeAgentSubagentsField, + type AgentSubagentSnapshot +} from './agent-status-subagent-snapshot' + +export { + AGENT_MODEL_MAX_LENGTH, + AGENT_STATUS_MAX_FIELD_LENGTH, + AGENT_STATUS_TOOL_INPUT_MAX_LENGTH, + AGENT_TYPE_MAX_LENGTH +} from './agent-status-field-normalization' +export { + AGENT_STATUS_MAX_SUBAGENTS, + agentSubagentsEqual, + type AgentSubagentSnapshot, + type AgentSubagentState +} from './agent-status-subagent-snapshot' export type { AgentStatusCacheIdentity, AgentStatusClearIpcPayload, @@ -53,22 +73,6 @@ export type AgentStatusOrchestrationContext = { attention?: OrchestrationFleetAttention } -export type AgentSubagentState = 'working' | 'blocked' | 'waiting' | 'idle' | 'unverifiable' - -/** A live in-process child of the pane's provider session. Rendered as an - * indented child row with no PTY of its own. */ -export type AgentSubagentSnapshot = { - /** Provider-assigned lifecycle id. */ - id: string - agentType?: string - /** Provider model used by this child, when exposed by its lifecycle event. */ - model?: string - description?: string - state: AgentSubagentState - /** Timestamp (ms) when this subagent was first observed. */ - startedAt: number -} - export type AgentStatusEntry = { /** Renderer-local status-feed confirmation for children; absent on hook rows. */ subagentObservation?: 'live' | 'unverifiable' @@ -142,6 +146,9 @@ export type AgentStatusEntry = { /** The main agent's own state; absent from old hosts and from writers that carry no main agent fact * (OSC, launch seeds), where readers fall back to `state`. */ mainAgent?: AgentMainAgentStatus + /** The host's child-work views for this session, when it publishes them; child rows then read + * these instead of `subagents`. Absent from older hosts. */ + children?: AgentChildWorkView[] /** Provider-owned conversation/session id captured from hook payloads. * Used only for exact CLI resume; Orca terminal ids are not agent-session ids. */ providerSession?: AgentProviderSessionMetadata @@ -237,8 +244,6 @@ export function pickParsedAgentStatusPayload( */ /** Maximum character length for the toolName field. */ export const AGENT_STATUS_TOOL_NAME_MAX_LENGTH = 60 -/** Maximum character length for the toolInput preview. */ -export const AGENT_STATUS_TOOL_INPUT_MAX_LENGTH = 160 /** Maximum character length for the lastAssistantMessage preview. * Why: 8 KB fits a multi-paragraph summary while bounding per-pane cache against a buggy/malicious agent spamming huge strings. */ export const AGENT_STATUS_ASSISTANT_MESSAGE_MAX_LENGTH = 8000 @@ -260,67 +265,11 @@ const VALID_STATES: ReadonlySet = new Set(AGENT_STATUS_STATES) export function isAgentStatusState(value: unknown): value is AgentStatusState { return typeof value === 'string' && VALID_STATES.has(value) } -/** Maximum character length for the agentType label. Truncated on parse. */ -export const AGENT_TYPE_MAX_LENGTH = 40 -export const AGENT_MODEL_MAX_LENGTH = 120 -/** Maximum subagent child rows carried per status entry. Bounds per-pane cache - * and IPC fanout against a runaway spawner. */ -export const AGENT_STATUS_MAX_SUBAGENTS = 32 export const AGENT_STATUS_JSON_STRUCTURE_LIMITS = { structuralTokens: 4096, nestingDepth: 16 } as const -const AGENT_SUBAGENT_ID_MAX_LENGTH = 64 - -function normalizeSubagentSnapshot(value: unknown): AgentSubagentSnapshot | null { - if (typeof value !== 'object' || value === null) { - return null - } - const obj = value as Record - if (typeof obj.id !== 'string') { - return null - } - const id = obj.id.trim() - if (id.length === 0 || id.length > AGENT_SUBAGENT_ID_MAX_LENGTH) { - return null - } - if ( - obj.state !== 'working' && - obj.state !== 'blocked' && - obj.state !== 'waiting' && - obj.state !== 'idle' && - obj.state !== 'unverifiable' - ) { - return null - } - return { - id, - state: obj.state, - startedAt: - typeof obj.startedAt === 'number' && Number.isFinite(obj.startedAt) ? obj.startedAt : 0, - agentType: normalizeOptionalField(obj.agentType, AGENT_TYPE_MAX_LENGTH), - model: normalizeOptionalField(obj.model, AGENT_MODEL_MAX_LENGTH), - description: normalizeOptionalField(obj.description, AGENT_STATUS_TOOL_INPUT_MAX_LENGTH) - } -} - -function normalizeSubagentsField(value: unknown): AgentSubagentSnapshot[] | undefined { - if (!Array.isArray(value) || value.length === 0) { - return undefined - } - const normalized: AgentSubagentSnapshot[] = [] - for (const item of value) { - const snapshot = normalizeSubagentSnapshot(item) - if (snapshot) { - normalized.push(snapshot) - if (normalized.length >= AGENT_STATUS_MAX_SUBAGENTS) { - break - } - } - } - return normalized.length > 0 ? normalized : undefined -} /** A malformed `mainAgent` drops the FIELD, never the row: the combined `state` is still valid * evidence, and readers fall back to it exactly as they do for a host that predates the field. */ @@ -344,35 +293,6 @@ export function normalizeMainAgentStatusField(value: unknown): AgentMainAgentSta } } -/** Structural equality for subagent lists so stores can reuse the previous - * array reference (and skip fanout) when nothing actually changed. */ -export function agentSubagentsEqual( - a: AgentSubagentSnapshot[] | undefined, - b: AgentSubagentSnapshot[] | undefined -): boolean { - if (a === b) { - return true - } - if (!a || !b || a.length !== b.length) { - return !a && !b - } - for (let i = 0; i < a.length; i++) { - const x = a[i] - const y = b[i] - if ( - x.id !== y.id || - x.state !== y.state || - x.startedAt !== y.startedAt || - x.agentType !== y.agentType || - x.model !== y.model || - x.description !== y.description - ) { - return false - } - } - return true -} - /** * Normalize and validate an already-parsed agent status object. Shared by the * JSON string entry point (`parseAgentStatusPayload`) and the object entry @@ -420,7 +340,7 @@ function normalizeAgentStatusObject(parsed: unknown): ParsedAgentStatusPayload | interrupted: obj.interrupted === true && state === 'done' ? true : undefined, sessionBoundary: obj.sessionBoundary === true && state === 'done' ? true : undefined, turnCompletedAt: normalizeTurnCompletedAtField(obj.turnCompletedAt, state), - subagents: normalizeSubagentsField(obj.subagents), + subagents: normalizeAgentSubagentsField(obj.subagents), mainAgent: normalizeMainAgentStatusField(obj.mainAgent) } } diff --git a/src/shared/grouped-by.ts b/src/shared/grouped-by.ts new file mode 100644 index 000000000000..0797dca96201 --- /dev/null +++ b/src/shared/grouped-by.ts @@ -0,0 +1,14 @@ +// Not `Map.groupBy`: the relay runs this core on Node 18, which lacks it. +export function groupedBy(items: readonly T[], keyOf: (item: T) => K): Map { + const groups = new Map() + for (const item of items) { + const key = keyOf(item) + const group = groups.get(key) + if (group) { + group.push(item) + } else { + groups.set(key, [item]) + } + } + return groups +} From b6c2de9f9277c49370644eed37169dc65b3e6279 Mon Sep 17 00:00:00 2001 From: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com> Date: Tue, 29 Sep 2026 08:09:11 +0000 Subject: [PATCH 83/90] fix(codex): index a new account home before bridging history into it (#22971) * fix(codex): index a new account home before bridging history into it Codex indexes every rollout present when it first creates its state DB, and the TUI gives up after 30s, so large histories broke a new account's launch. Fixes #20669 * test(codex): keep the account migration test from starting the real Codex binary Selecting an account starts the history bridge, which spawned codex app-server on the fixture homes and raced the test's temp-dir cleanup. * fix(codex): index a new account's most recent bridged history first Indexing a large history takes minutes, and Codex's /resume hides unindexed threads once a directory has any indexed one, so recent conversations stayed missing until the heal reached them in directory-listing order. * test(codex): cover the history bridge's quit, no-history and failed-link guards Drop the stop check before creating the state DB: it ran in the same tick as the check at bridge start, so it could never observe a quit. * test(codex): make the account heal tests fail closed instead of reaching a real codex Fake invocations now point at a nonexistent binary and a throwaway CODEX_HOME, and cover per-home failure memory and a session that fails during quit. --------- Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> --- ...home-service-per-account-migration.test.ts | 14 + .../codex-account-session-bridge.test.ts | 306 ++++++++++++++++-- .../codex/codex-account-session-bridge.ts | 128 +++++++- .../codex-account-session-index-heal.test.ts | 306 ++++++++++++++++++ .../codex/codex-account-session-index-heal.ts | 122 +++++++ .../codex-index-heal-binary-contract.test.ts | 42 ++- .../codex/codex-session-index-heal-state.ts | 18 +- .../codex/codex-session-index-heal.test.ts | 33 ++ src/main/codex/codex-session-index-heal.ts | 174 +++++----- src/main/codex/codex-state-db-test-fixture.ts | 14 + src/main/codex/codex-state-db.test.ts | 42 ++- src/main/codex/codex-state-db.ts | 37 ++- src/main/startup/main-process-quit.ts | 2 + 13 files changed, 1113 insertions(+), 125 deletions(-) create mode 100644 src/main/codex/codex-account-session-index-heal.test.ts create mode 100644 src/main/codex/codex-account-session-index-heal.ts create mode 100644 src/main/codex/codex-state-db-test-fixture.ts diff --git a/src/main/codex-accounts/runtime-home-service-per-account-migration.test.ts b/src/main/codex-accounts/runtime-home-service-per-account-migration.test.ts index 53736a11bebe..4a7ad01e1b55 100644 --- a/src/main/codex-accounts/runtime-home-service-per-account-migration.test.ts +++ b/src/main/codex-accounts/runtime-home-service-per-account-migration.test.ts @@ -6,6 +6,7 @@ import type { GlobalSettings } from '../../shared/global-settings-types' import type { CodexManagedAccount } from '../../shared/managed-account-types' import type * as NodeOs from 'node:os' import { readHookTrustEntries } from '../codex/config-toml-trust' +import { writeCodexStateDbBackfillStatus } from '../codex/codex-state-db-test-fixture' const testState = { userData: '', home: '' } const previousEnv: Record = {} @@ -15,6 +16,17 @@ vi.mock('node:os', async () => { const actual = await vi.importActual('node:os') return { ...actual, homedir: () => testState.home } }) +// Why: selecting an account starts the history bridge, which would otherwise +// spawn the real `codex app-server` on these fixture homes. +vi.mock('../codex/codex-account-session-index-heal', () => ({ + createCodexAccountStateDb: async () => false, + healCodexAccountSessionIndex: async () => ({ + outcome: 'up-to-date', + healedThreads: 0, + missingThreads: 0, + failedThreads: 0 + }) +})) beforeEach(() => { vi.resetModules() @@ -212,6 +224,8 @@ describe('CodexRuntimeHomeService per-account takeover composition', () => { const siblingRollout = join('2026', '07', '21', 'rollout-2026-07-21T10-00-00-bbbb.jsonl') writeRollout(systemHome(), systemRollout, '{"session":"real-home"}\n') writeRollout(accountOne.managedHomePath, siblingRollout, '{"session":"account-one"}\n') + // Why: history is linked only once Codex has indexed the new home (#20669). + writeCodexStateDbBackfillStatus(accountTwo.managedHomePath, 'complete') const { settings, store } = createStore([accountOne, accountTwo], accountOne.id) const { CodexRuntimeHomeService } = await import('./runtime-home-service') const bridge = await import('../codex/codex-account-session-bridge') diff --git a/src/main/codex/codex-account-session-bridge.test.ts b/src/main/codex/codex-account-session-bridge.test.ts index 7cebd37c1f44..3befa0134731 100644 --- a/src/main/codex/codex-account-session-bridge.test.ts +++ b/src/main/codex/codex-account-session-bridge.test.ts @@ -1,14 +1,31 @@ -import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { mkdirSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { + existsSync, + mkdirSync, + mkdtempSync, + readFileSync, + rmSync, + statSync, + writeFileSync +} from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { _internals, bridgeCodexSessionsIntoAccountHome, - startCodexAccountSessionBridgeInBackground + startCodexAccountSessionBridgeInBackground, + stopCodexAccountSessionBridges } from './codex-account-session-bridge' +import { writeCodexStateDbBackfillStatus } from './codex-state-db-test-fixture' +import SyncDatabase from '../sqlite/sync-database' let workspaceRoot: string +const healIndexStub = vi.fn(async () => ({ + outcome: 'up-to-date' as const, + healedThreads: 0, + missingThreads: 0, + failedThreads: 0 +})) function writeRollout(homePath: string, relativePath: string, contents: string): string { const filePath = join(homePath, 'sessions', relativePath) @@ -21,12 +38,25 @@ function rolloutPath(homePath: string, relativePath: string): string { return join(homePath, 'sessions', relativePath) } -const ROLLOUT_A = join('2026', '07', '20', 'rollout-2026-07-20T10-00-00-aaaa.jsonl') -const ROLLOUT_B = join('2026', '07', '21', 'rollout-2026-07-21T10-00-00-bbbb.jsonl') +const THREAD_A = '019a0000-0000-7000-8000-00000000000a' +const THREAD_B = '019a0000-0000-7000-8000-00000000000b' +const ROLLOUT_A = join( + '2026', + '07', + '20', + 'rollout-2026-07-20T10-00-00-019a0000-0000-7000-8000-00000000000a.jsonl' +) +const ROLLOUT_B = join( + '2026', + '07', + '21', + 'rollout-2026-07-21T10-00-00-019a0000-0000-7000-8000-00000000000b.jsonl' +) beforeEach(() => { workspaceRoot = mkdtempSync(join(tmpdir(), 'codex-account-session-bridge-')) _internals.resetBackgroundBridgeTasks() + healIndexStub.mockClear() }) afterEach(() => { @@ -47,7 +77,14 @@ describe('bridgeCodexSessionsIntoAccountHome', () => { options: { batchSize: 1, yieldMs: 0 } }) - expect(summary).toEqual({ scannedFiles: 2, linkedFiles: 2 }) + expect(summary).toEqual({ + scannedFiles: 2, + linkedFiles: 2, + bridgedThreads: new Map([ + [THREAD_A, '2026-07-20T10-00-00'], + [THREAD_B, '2026-07-21T10-00-00'] + ]) + }) expect(readFileSync(rolloutPath(targetHome, ROLLOUT_A), 'utf-8')).toBe('system session\n') expect(readFileSync(rolloutPath(targetHome, ROLLOUT_B), 'utf-8')).toBe('account a session\n') }) @@ -97,7 +134,11 @@ describe('bridgeCodexSessionsIntoAccountHome', () => { sourceCodexHomePaths: [systemHome] }) - expect(second).toEqual({ scannedFiles: 1, linkedFiles: 0 }) + expect(second).toEqual({ + scannedFiles: 1, + linkedFiles: 0, + bridgedThreads: new Map([[THREAD_A, '2026-07-20T10-00-00']]) + }) }) it('never links a home into itself or scans a duplicate source twice', async () => { @@ -109,7 +150,27 @@ describe('bridgeCodexSessionsIntoAccountHome', () => { sourceCodexHomePaths: [targetHome, targetHome] }) - expect(summary).toEqual({ scannedFiles: 0, linkedFiles: 0 }) + expect(summary).toEqual({ scannedFiles: 0, linkedFiles: 0, bridgedThreads: new Map() }) + }) + + it('does not hand a rollout it failed to link to the index heal', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + writeRollout(systemHome, ROLLOUT_B, 'session\n') + // A file where the target's day directory belongs makes that one link fail. + mkdirSync(join(targetHome, 'sessions', '2026', '07'), { recursive: true }) + writeFileSync(join(targetHome, 'sessions', '2026', '07', '20'), 'not a directory') + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + + const summary = await bridgeCodexSessionsIntoAccountHome({ + targetCodexHomePath: targetHome, + sourceCodexHomePaths: [systemHome] + }) + + warn.mockRestore() + expect(summary.linkedFiles).toBe(1) + expect(summary.bridgedThreads).toEqual(new Map([[THREAD_B, '2026-07-21T10-00-00']])) }) it('skips a source home that has no sessions tree', async () => { @@ -119,24 +180,35 @@ describe('bridgeCodexSessionsIntoAccountHome', () => { sourceCodexHomePaths: [join(workspaceRoot, 'missing')] }) - expect(summary).toEqual({ scannedFiles: 0, linkedFiles: 0 }) + expect(summary).toEqual({ scannedFiles: 0, linkedFiles: 0, bridgedThreads: new Map() }) }) }) +type BridgeDependencies = NonNullable< + Parameters[1] +> + +// Why: the real steps spawn `codex app-server`; their behavior is covered separately. +function startBridge( + targetCodexHomePath: string, + sourceCodexHomePaths: string[], + dependencies: BridgeDependencies = {} +): Promise { + return startCodexAccountSessionBridgeInBackground( + { targetCodexHomePath, sourceCodexHomePaths }, + { createStateDb: async () => false, healIndex: healIndexStub, ...dependencies } + ) +} + describe('startCodexAccountSessionBridgeInBackground', () => { it('shares one in-flight task per target home', () => { const systemHome = join(workspaceRoot, 'system') const targetHome = join(workspaceRoot, 'account') writeRollout(systemHome, ROLLOUT_A, 'session\n') + writeCodexStateDbBackfillStatus(targetHome, 'complete') - const first = startCodexAccountSessionBridgeInBackground({ - targetCodexHomePath: targetHome, - sourceCodexHomePaths: [systemHome] - }) - const second = startCodexAccountSessionBridgeInBackground({ - targetCodexHomePath: targetHome, - sourceCodexHomePaths: [systemHome] - }) + const first = startBridge(targetHome, [systemHome]) + const second = startBridge(targetHome, [systemHome]) expect(second).toBe(first) return first @@ -147,19 +219,203 @@ describe('startCodexAccountSessionBridgeInBackground', () => { const firstTarget = join(workspaceRoot, 'account-a') const secondTarget = join(workspaceRoot, 'account-b') writeRollout(systemHome, ROLLOUT_A, 'session\n') + writeCodexStateDbBackfillStatus(firstTarget, 'complete') + writeCodexStateDbBackfillStatus(secondTarget, 'complete') await Promise.all([ - startCodexAccountSessionBridgeInBackground({ - targetCodexHomePath: firstTarget, - sourceCodexHomePaths: [systemHome] - }), - startCodexAccountSessionBridgeInBackground({ - targetCodexHomePath: secondTarget, - sourceCodexHomePaths: [systemHome] - }) + startBridge(firstTarget, [systemHome]), + startBridge(secondTarget, [systemHome]) ]) expect(readFileSync(rolloutPath(firstTarget, ROLLOUT_A), 'utf-8')).toBe('session\n') expect(readFileSync(rolloutPath(secondTarget, ROLLOUT_A), 'utf-8')).toBe('session\n') }) + + // #20669: rollouts present when Codex first creates its state DB force a + // blocking backfill that times out the first TUI launch. + it('lets Codex index a new home before linking history into it', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + const createStateDb = vi.fn(async (home: string) => { + expect(existsSync(rolloutPath(home, ROLLOUT_A))).toBe(false) + writeCodexStateDbBackfillStatus(home, 'complete') + return true + }) + + await startBridge(targetHome, [systemHome], { createStateDb }) + + expect(createStateDb).toHaveBeenCalledWith(targetHome) + expect(readFileSync(rolloutPath(targetHome, ROLLOUT_A), 'utf-8')).toBe('session\n') + }) + + // Why: an older Codex keeps no state DB, and `sqlite_home` keeps it outside + // the home; either way every launch must keep linking new history. + it('keeps linking new history on later launches when no state DB lives in the home', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + writeRollout(systemHome, ROLLOUT_A, 'first\n') + const createStateDb = vi.fn(async () => true) + + await startBridge(targetHome, [systemHome], { createStateDb }) + writeRollout(systemHome, ROLLOUT_B, 'second\n') + await startBridge(targetHome, [systemHome], { createStateDb }) + + expect(readFileSync(rolloutPath(targetHome, ROLLOUT_A), 'utf-8')).toBe('first\n') + expect(readFileSync(rolloutPath(targetHome, ROLLOUT_B), 'utf-8')).toBe('second\n') + // Only the empty home needed Codex to run first. + expect(createStateDb).toHaveBeenCalledTimes(1) + }) + + it('does not start Codex on an empty home when no source has history', async () => { + const createStateDb = vi.fn(async () => true) + + await startBridge(join(workspaceRoot, 'account'), [join(workspaceRoot, 'system')], { + createStateDb + }) + + expect(createStateDb).not.toHaveBeenCalled() + }) + + it('does not link history when Codex could not create the state DB', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + + await startBridge(targetHome, [systemHome], { createStateDb: async () => false }) + + expect(existsSync(rolloutPath(targetHome, ROLLOUT_A))).toBe(false) + expect(healIndexStub).not.toHaveBeenCalled() + }) + + it('bridges compressed-only history into a new home and indexes it', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + const compressed = `${ROLLOUT_A}.zst` + writeRollout(systemHome, compressed, 'compressed\n') + const createStateDb = vi.fn(async (home: string) => { + writeCodexStateDbBackfillStatus(home, 'complete') + return true + }) + + await startBridge(targetHome, [systemHome], { createStateDb }) + + expect(readFileSync(rolloutPath(targetHome, compressed), 'utf-8')).toBe('compressed\n') + expect(healIndexStub).toHaveBeenCalledWith( + targetHome, + new Map([[THREAD_A, '2026-07-20T10-00-00']]), + { + shouldStop: expect.any(Function) + } + ) + }) + + it('skips linking into a state DB that predates backfill tracking', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + mkdirSync(targetHome, { recursive: true }) + new SyncDatabase(join(targetHome, 'state_5.sqlite')).close() + + await startBridge(targetHome, [systemHome]) + + expect(existsSync(rolloutPath(targetHome, ROLLOUT_A))).toBe(false) + }) + + it('skips linking while Codex is still indexing the home', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + writeCodexStateDbBackfillStatus(targetHome, 'running') + + await startBridge(targetHome, [systemHome]) + + expect(existsSync(rolloutPath(targetHome, ROLLOUT_A))).toBe(false) + expect(healIndexStub).not.toHaveBeenCalled() + }) + + it('reports why it skips a home whose state DB cannot be read', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + mkdirSync(targetHome, { recursive: true }) + writeFileSync(join(targetHome, 'state_5.sqlite'), 'not a sqlite database') + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + + await startBridge(targetHome, [systemHome]) + + expect(existsSync(rolloutPath(targetHome, ROLLOUT_A))).toBe(false) + expect(warn).toHaveBeenCalledWith( + expect.stringContaining('Codex state DB is unreadable'), + expect.any(String) + ) + warn.mockRestore() + }) + + it('indexes the bridged threads once linking finishes', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + writeCodexStateDbBackfillStatus(targetHome, 'complete') + + await startBridge(targetHome, [systemHome]) + + expect(healIndexStub).toHaveBeenCalledWith( + targetHome, + new Map([[THREAD_A, '2026-07-20T10-00-00']]), + { + shouldStop: expect.any(Function) + } + ) + }) + + it('links nothing when the app quits while Codex creates the state DB', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + + await startBridge(targetHome, [systemHome], { + createStateDb: async (home) => { + writeCodexStateDbBackfillStatus(home, 'complete') + stopCodexAccountSessionBridges() + return true + } + }) + + expect(existsSync(rolloutPath(targetHome, ROLLOUT_A))).toBe(false) + expect(healIndexStub).not.toHaveBeenCalled() + }) + + it('does not start Codex on a new home after the app quits', async () => { + const systemHome = join(workspaceRoot, 'system') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + const createStateDb = vi.fn(async () => true) + stopCodexAccountSessionBridges() + + await startBridge(join(workspaceRoot, 'account'), [systemHome], { createStateDb }) + + expect(createStateDb).not.toHaveBeenCalled() + }) + + it('stops indexing and starts no new bridge once the app quits', async () => { + const systemHome = join(workspaceRoot, 'system') + const targetHome = join(workspaceRoot, 'account') + const laterTarget = join(workspaceRoot, 'later-account') + writeRollout(systemHome, ROLLOUT_A, 'session\n') + writeCodexStateDbBackfillStatus(targetHome, 'complete') + writeCodexStateDbBackfillStatus(laterTarget, 'complete') + let shouldStop: (() => boolean) | undefined + + await startBridge(targetHome, [systemHome], { + healIndex: async (_home, _threads, options) => { + shouldStop = options?.shouldStop + stopCodexAccountSessionBridges() + return { outcome: 'stopped', healedThreads: 0, missingThreads: 0, failedThreads: 0 } + } + }) + await startBridge(laterTarget, [systemHome]) + + expect(shouldStop?.()).toBe(true) + expect(existsSync(rolloutPath(laterTarget, ROLLOUT_A))).toBe(false) + }) }) diff --git a/src/main/codex/codex-account-session-bridge.ts b/src/main/codex/codex-account-session-bridge.ts index 72096103aa14..bb6110a8651e 100644 --- a/src/main/codex/codex-account-session-bridge.ts +++ b/src/main/codex/codex-account-session-bridge.ts @@ -3,7 +3,17 @@ import { dirname, join, relative } from 'node:path' import { normalizeRuntimePathForComparison } from '../../shared/cross-platform-path' import { listCodexSessionRolloutFilesIncrementally } from './codex-session-file-listing' import type { CodexSessionBridgeIncrementalOptions } from './codex-session-file-listing' +import { + createCodexAccountStateDb, + healCodexAccountSessionIndex +} from './codex-account-session-index-heal' +import { parseCodexRolloutThreadId } from './codex-session-index-heal-state' import { linkCodexSessionFile } from './codex-session-link' +import { + countCodexSessionFilesUpTo, + findNewestCodexStateDbPath, + readCodexStateDbBackfillStatus +} from './codex-state-db' /** * Bridges Codex history between Orca-managed Codex homes. @@ -19,24 +29,99 @@ import { linkCodexSessionFile } from './codex-session-link' export type CodexAccountSessionBridgeSummary = { scannedFiles: number linkedFiles: number + /** Thread id -> rollout timestamp for every rollout present in the target home via this bridge. */ + bridgedThreads: Map } const backgroundBridgeTasksByTargetHome = new Map>() +let stopping = false + +type BackgroundBridgeDependencies = { + createStateDb: typeof createCodexAccountStateDb + healIndex: typeof healCodexAccountSessionIndex +} + +const defaultBackgroundBridgeDependencies: BackgroundBridgeDependencies = { + createStateDb: createCodexAccountStateDb, + healIndex: healCodexAccountSessionIndex +} + +/** + * Why: Codex indexes every rollout present when it first creates a home's state + * DB, and the TUI gives up waiting after 30s. Linking history into a fresh home + * first turns its first launch into a minutes-long backfill (#20669), so an + * empty home gets its state DB before any history; the heal indexes it afterwards. + */ +async function isReadyForBridgedHistory( + targetCodexHomePath: string, + sourceCodexHomePaths: readonly string[], + dependencies: BackgroundBridgeDependencies +): Promise { + if ( + !findNewestCodexStateDbPath(targetCodexHomePath) && + !hasSessionRollouts(targetCodexHomePath) + ) { + if ( + !sourceCodexHomePaths.some(hasSessionRollouts) || + !(await dependencies.createStateDb(targetCodexHomePath)) + ) { + return false + } + } + const status = readCodexStateDbBackfillStatus(targetCodexHomePath) + if (status.kind === 'unreadable') { + // Why: contention clears by the next launch; corruption would skip every launch, so surface it. + console.warn( + '[codex-account-session-bridge] Skipping history bridge; Codex state DB is unreadable:', + status.error + ) + return false + } + // Why: no DB in a home that has history means Codex keeps it elsewhere + // (`sqlite_home`) or keeps none, so linking cannot stall a launch here. + // `not-tracked` is a pre-backfill schema that Codex migrates to `pending`. + return status.kind === 'complete' || status.kind === 'missing' +} + +function hasSessionRollouts(codexHomePath: string): boolean { + return countCodexSessionFilesUpTo(join(codexHomePath, 'sessions'), 1) > 0 +} /** * Starts one background bridge per target home, sharing in-flight work. */ -export function startCodexAccountSessionBridgeInBackground(args: { - targetCodexHomePath: string - sourceCodexHomePaths: readonly string[] - options?: CodexSessionBridgeIncrementalOptions -}): Promise { +export function startCodexAccountSessionBridgeInBackground( + args: { + targetCodexHomePath: string + sourceCodexHomePaths: readonly string[] + options?: CodexSessionBridgeIncrementalOptions + }, + dependenciesOverride: Partial = {} +): Promise { + if (stopping) { + return Promise.resolve() + } const key = normalizeRuntimePathForComparison(args.targetCodexHomePath) const inFlight = backgroundBridgeTasksByTargetHome.get(key) if (inFlight) { return inFlight } - const task = bridgeCodexSessionsIntoAccountHome(args) + const dependencies = { ...defaultBackgroundBridgeDependencies, ...dependenciesOverride } + const task = isReadyForBridgedHistory( + args.targetCodexHomePath, + args.sourceCodexHomePaths, + dependencies + ) + .then(async (ready) => { + // Why: skip rather than feed a running backfill; the next launch retries. + if (!ready || stopping) { + return + } + const summary = await bridgeCodexSessionsIntoAccountHome(args) + await dependencies.healIndex(args.targetCodexHomePath, summary.bridgedThreads, { + shouldStop: () => stopping + }) + }) .catch((error: unknown) => { console.warn('[codex-account-session-bridge] Background session bridge failed:', error) }) @@ -50,6 +135,11 @@ export function startCodexAccountSessionBridgeInBackground(args: { return task } +/** Stops background bridges at quit; links and index reads made so far are kept. */ +export function stopCodexAccountSessionBridges(): void { + stopping = true +} + /** * Mirrors every source home's rollouts into the target home's sessions tree. */ @@ -58,7 +148,11 @@ export async function bridgeCodexSessionsIntoAccountHome(args: { sourceCodexHomePaths: readonly string[] options?: CodexSessionBridgeIncrementalOptions }): Promise { - const summary: CodexAccountSessionBridgeSummary = { scannedFiles: 0, linkedFiles: 0 } + const summary: CodexAccountSessionBridgeSummary = { + scannedFiles: 0, + linkedFiles: 0, + bridgedThreads: new Map() + } const targetSessionsRoot = join(args.targetCodexHomePath, 'sessions') for (const sourceHomePath of dedupeSourceHomes( args.sourceCodexHomePaths, @@ -73,9 +167,18 @@ export async function bridgeCodexSessionsIntoAccountHome(args: { args.options ?? {} )) { summary.scannedFiles += 1 - if (bridgeRolloutIntoAccountHome(sourceSessionsRoot, targetSessionsRoot, sourceFilePath)) { + const result = bridgeRolloutIntoAccountHome( + sourceSessionsRoot, + targetSessionsRoot, + sourceFilePath + ) + if (result === 'linked') { summary.linkedFiles += 1 } + const rollout = parseCodexRolloutThreadId(sourceFilePath) + if (result !== 'failed' && rollout) { + summary.bridgedThreads.set(rollout.threadId, rollout.rolloutStamp) + } } } return summary @@ -88,20 +191,20 @@ function bridgeRolloutIntoAccountHome( sourceSessionsRoot: string, targetSessionsRoot: string, sourceFilePath: string -): boolean { +): 'linked' | 'existing' | 'failed' { const targetFilePath = join(targetSessionsRoot, relative(sourceSessionsRoot, sourceFilePath)) // Why: rollout names carry the session UUID, so an existing target path is the // same conversation already bridged (often the same inode) — never a conflict. if (existsSync(targetFilePath)) { - return false + return 'existing' } try { mkdirSync(dirname(targetFilePath), { recursive: true }) } catch (error) { console.warn('[codex-account-session-bridge] Failed to create session directory:', error) - return false + return 'failed' } - return linkCodexSessionFile(sourceFilePath, targetFilePath) + return linkCodexSessionFile(sourceFilePath, targetFilePath) ? 'linked' : 'failed' } /** @@ -127,5 +230,6 @@ function dedupeSourceHomes( export const _internals = { resetBackgroundBridgeTasks: (): void => { backgroundBridgeTasksByTargetHome.clear() + stopping = false } } diff --git a/src/main/codex/codex-account-session-index-heal.test.ts b/src/main/codex/codex-account-session-index-heal.test.ts new file mode 100644 index 000000000000..fbb5fae404ce --- /dev/null +++ b/src/main/codex/codex-account-session-index-heal.test.ts @@ -0,0 +1,306 @@ +import { beforeEach, describe, expect, it, vi } from 'vitest' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { + _internals, + createCodexAccountStateDb, + healCodexAccountSessionIndex +} from './codex-account-session-index-heal' +import { + CodexAppServerUnsupportedError, + type CodexAppServerInvocation, + type CodexAppServerRpc +} from './codex-app-server-session' + +const HOME = '/codex-accounts/account-1/home' + +// Why: fails closed if a regression bypasses the fake session — never the real codex or ~/.codex. +function buildInvocation(): CodexAppServerInvocation { + return { + command: '/nonexistent/orca-test-codex', + args: ['app-server'], + cliPath: null, + env: { CODEX_HOME: join(tmpdir(), 'orca-test-nonexistent-codex-home') }, + timeoutMs: 1_000 + } +} + +/** Runs the heal body against a fake app-server that answers thread/read. */ +function fakeAppServer(onRead: (threadId: string) => void = () => {}) { + const readThreadIds: string[] = [] + const runSession = vi.fn( + async ( + _invocation: CodexAppServerInvocation, + body: (rpc: CodexAppServerRpc) => Promise + ): Promise => { + await body({ + request: async (method, params) => { + expect(method).toBe('thread/read') + const threadId = String(params?.threadId) + readThreadIds.push(threadId) + onRead(threadId) + return {} + }, + notify: () => {} + }) + } + ) + return { runSession, readThreadIds } +} + +/** Bridged threads keyed by id, all from the same rollout timestamp. */ +function bridged(...threadIds: string[]): Map { + return new Map(threadIds.map((threadId) => [threadId, '2026-07-20T10-00-00'])) +} + +beforeEach(() => { + _internals.resetFailedThreads() +}) + +describe('healCodexAccountSessionIndex', () => { + it('reads only bridged threads missing from the Codex index', async () => { + const { runSession, readThreadIds } = fakeAppServer() + + const summary = await healCodexAccountSessionIndex(HOME, bridged('a', 'b', 'c'), { + readIndexedThreadIds: () => new Set(['b']), + buildInvocation, + runSession + }) + + expect(readThreadIds.sort()).toEqual(['a', 'c']) + expect(summary).toEqual({ + outcome: 'completed', + healedThreads: 2, + missingThreads: 0, + failedThreads: 0 + }) + }) + + it('reads the most recent bridged rollouts first', async () => { + const { runSession, readThreadIds } = fakeAppServer() + + await healCodexAccountSessionIndex( + HOME, + new Map([ + ['middle', '2026-08-01T09-00-00'], + ['oldest', '2025-12-31T23-59-59'], + ['newest', '2026-09-28T01-46-16'] + ]), + { readIndexedThreadIds: () => new Set(), buildInvocation, runSession, readConcurrency: 1 } + ) + + expect(readThreadIds).toEqual(['newest', 'middle', 'oldest']) + }) + + it('does not start Codex when every bridged thread is already indexed', async () => { + const { runSession } = fakeAppServer() + + const summary = await healCodexAccountSessionIndex(HOME, bridged('a'), { + readIndexedThreadIds: () => new Set(['a']), + buildInvocation, + runSession + }) + + expect(summary.outcome).toBe('up-to-date') + expect(runSession).not.toHaveBeenCalled() + }) + + it('does not start Codex when its index cannot be read', async () => { + const { runSession } = fakeAppServer() + + const summary = await healCodexAccountSessionIndex(HOME, bridged('a'), { + readIndexedThreadIds: () => null, + buildInvocation, + runSession + }) + + expect(summary.outcome).toBe('no-index') + expect(runSession).not.toHaveBeenCalled() + }) + + it('does not start Codex once the app is quitting', async () => { + const { runSession } = fakeAppServer() + + const summary = await healCodexAccountSessionIndex(HOME, bridged('a'), { + readIndexedThreadIds: () => new Set(), + buildInvocation, + runSession, + shouldStop: () => true + }) + + expect(summary.outcome).toBe('stopped') + expect(runSession).not.toHaveBeenCalled() + }) + + it('stops retrying a thread Codex refuses to index until Orca restarts', async () => { + const { runSession, readThreadIds } = fakeAppServer((threadId) => { + if (threadId === 'broken') { + throw new Error('codex app-server thread/read failed: invalid rollout') + } + }) + const dependencies = { + readIndexedThreadIds: () => new Set(), + buildInvocation, + runSession + } + + const first = await healCodexAccountSessionIndex(HOME, bridged('broken'), dependencies) + const second = await healCodexAccountSessionIndex(HOME, bridged('broken'), dependencies) + + expect(first).toEqual({ + outcome: 'completed', + healedThreads: 0, + missingThreads: 0, + failedThreads: 1 + }) + expect(second.outcome).toBe('up-to-date') + expect(readThreadIds).toEqual(['broken']) + }) + + it('remembers a refused thread only for the home that refused it', async () => { + const { runSession, readThreadIds } = fakeAppServer((threadId) => { + if (readThreadIds.length === 1) { + throw new Error(`codex app-server thread/read failed: invalid rollout ${threadId}`) + } + }) + const dependencies = { + readIndexedThreadIds: () => new Set(), + buildInvocation, + runSession + } + + await healCodexAccountSessionIndex(HOME, bridged('shared'), dependencies) + const other = await healCodexAccountSessionIndex( + '/codex-accounts/account-2/home', + bridged('shared'), + dependencies + ) + + expect(other.healedThreads).toBe(1) + expect(readThreadIds).toEqual(['shared', 'shared']) + }) + + it('counts a rollout Codex cannot find as missing and does not reread it', async () => { + const { runSession, readThreadIds } = fakeAppServer(() => { + throw new Error('codex app-server thread/read failed: no rollout found for thread id gone') + }) + const options = { readIndexedThreadIds: () => new Set(), buildInvocation, runSession } + + const first = await healCodexAccountSessionIndex(HOME, bridged('gone'), options) + const second = await healCodexAccountSessionIndex(HOME, bridged('gone'), options) + + expect(first).toEqual({ + outcome: 'completed', + healedThreads: 0, + missingThreads: 1, + failedThreads: 0 + }) + expect(second.outcome).toBe('up-to-date') + expect(readThreadIds).toEqual(['gone']) + }) + + it('retries a thread on the next pass when the app-server session fails', async () => { + const failing = vi.fn(async () => { + throw new Error('codex app-server exited before responding') + }) + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + const readIndexedThreadIds = (): Set => new Set() + + const first = await healCodexAccountSessionIndex(HOME, bridged('a'), { + readIndexedThreadIds, + buildInvocation, + runSession: failing + }) + const { runSession, readThreadIds } = fakeAppServer() + const second = await healCodexAccountSessionIndex(HOME, bridged('a'), { + readIndexedThreadIds, + buildInvocation, + runSession + }) + + expect(first.outcome).toBe('aborted') + expect(second.outcome).toBe('completed') + expect(readThreadIds).toEqual(['a']) + warn.mockRestore() + }) + + it('reports a session that fails during quit as stopped, not unsupported', async () => { + let stopping = false + const summary = await healCodexAccountSessionIndex(HOME, bridged('a'), { + readIndexedThreadIds: () => new Set(), + buildInvocation, + runSession: async () => { + stopping = true + throw new CodexAppServerUnsupportedError('app-server killed during quit') + }, + shouldStop: () => stopping + }) + + expect(summary.outcome).toBe('stopped') + }) + + it('aborts rather than writing off a thread while a live Codex holds the database', async () => { + const { runSession } = fakeAppServer(() => { + throw new Error('codex app-server thread/read failed: database is locked') + }) + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + + const summary = await healCodexAccountSessionIndex(HOME, bridged('a'), { + readIndexedThreadIds: () => new Set(), + buildInvocation, + runSession + }) + + expect(summary).toEqual({ + outcome: 'aborted', + healedThreads: 0, + missingThreads: 0, + failedThreads: 0 + }) + warn.mockRestore() + }) +}) + +describe('createCodexAccountStateDb', () => { + it('starts Codex on the home without sending any request', async () => { + const { runSession, readThreadIds } = fakeAppServer() + const invocations: string[] = [] + + const created = await createCodexAccountStateDb(HOME, { + buildInvocation: (home, timeoutMs) => { + invocations.push(home) + return { ...buildInvocation(), timeoutMs } + }, + runSession + }) + + expect(created).toBe(true) + expect(invocations).toEqual([HOME]) + expect(readThreadIds).toEqual([]) + }) + + it('treats a Codex without app-server as having no state DB to stall', async () => { + const created = await createCodexAccountStateDb(HOME, { + buildInvocation, + runSession: async () => { + throw new CodexAppServerUnsupportedError('unknown subcommand app-server') + } + }) + + expect(created).toBe(true) + }) + + it('reports failure when Codex could not start', async () => { + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + + const created = await createCodexAccountStateDb(HOME, { + buildInvocation, + runSession: async () => { + throw new Error('spawn codex ENOENT') + } + }) + + expect(created).toBe(false) + warn.mockRestore() + }) +}) diff --git a/src/main/codex/codex-account-session-index-heal.ts b/src/main/codex/codex-account-session-index-heal.ts new file mode 100644 index 000000000000..1af87e34407c --- /dev/null +++ b/src/main/codex/codex-account-session-index-heal.ts @@ -0,0 +1,122 @@ +import { normalizeRuntimePathForComparison } from '../../shared/cross-platform-path' +import { + isCodexAppServerUnsupportedError, + runCodexAppServerSession +} from './codex-app-server-session' +import { + buildNativeHealInvocation, + readCodexThreadsForIndexHeal, + type CodexSessionIndexHealOptions, + type CodexThreadReadPassOutcome +} from './codex-session-index-heal' +import { readIndexedCodexThreadIds } from './codex-state-db' + +// Why: Codex indexes a home's rollouts only once, when it first creates the +// state DB, and the /resume picker's "All" view lists only indexed threads. +// History bridged in afterwards needs `thread/read`, Codex's lazy-indexing +// path, to become visible there (#20669). + +export type CodexAccountSessionIndexHealSummary = { + outcome: CodexThreadReadPassOutcome | 'up-to-date' | 'no-index' + healedThreads: number + missingThreads: number + failedThreads: number +} + +export type CodexAccountSessionIndexHealOptions = CodexSessionIndexHealOptions & { + readIndexedThreadIds?: (codexHomePath: string) => Set | null +} + +// Why: app-server finishes state DB startup before it answers `initialize`, +// which takes ~100ms on an empty home. +const STATE_DB_CREATE_TIMEOUT_MS = 15_000 + +// Why: a just-linked rollout Codex refuses or cannot find fails the same way on +// every read; skip it until Orca restarts instead of respawning app-server each launch. +const failedThreadIdsByHome = new Map>() + +/** + * Starts Codex once on an empty home so it creates and indexes its state DB + * before any history is bridged in. False when Codex could not start. + */ +export async function createCodexAccountStateDb( + codexHomePath: string, + options: Pick = {} +): Promise { + const buildInvocation = options.buildInvocation ?? buildNativeHealInvocation + const runSession = options.runSession ?? runCodexAppServerSession + try { + await runSession(buildInvocation(codexHomePath, STATE_DB_CREATE_TIMEOUT_MS), async () => {}) + return true + } catch (error) { + // Why: a Codex without app-server predates the state DB, so linking cannot stall it. + if (isCodexAppServerUnsupportedError(error)) { + return true + } + console.warn('[codex-account-session-index-heal] Failed to create Codex state DB:', error) + return false + } +} + +/** + * Indexes the bridged threads Codex has not indexed yet, newest rollout first. + * Diffing against the state DB on every pass makes an interrupted heal resume + * on the next launch. + */ +export async function healCodexAccountSessionIndex( + codexHomePath: string, + bridgedThreads: ReadonlyMap, + options: CodexAccountSessionIndexHealOptions = {} +): Promise { + const summary: CodexAccountSessionIndexHealSummary = { + outcome: 'up-to-date', + healedThreads: 0, + missingThreads: 0, + failedThreads: 0 + } + if (bridgedThreads.size === 0) { + return summary + } + // Why: with no DB in the home, Codex keeps none (older CLI) or uses a + // `sqlite_home` shared by every Orca home, which already indexes these threads. + const indexed = (options.readIndexedThreadIds ?? readIndexedCodexThreadIds)(codexHomePath) + if (!indexed) { + return { ...summary, outcome: 'no-index' } + } + const homeKey = normalizeRuntimePathForComparison(codexHomePath) + const failed = failedThreadIdsByHome.get(homeKey) ?? new Set() + failedThreadIdsByHome.set(homeKey, failed) + // Why: a large history takes minutes to index, and /resume hides unindexed + // threads once a directory has any indexed one, so recent work goes first. + const pending = [...bridgedThreads] + .filter(([threadId]) => !indexed.has(threadId) && !failed.has(threadId)) + .sort(([, left], [, right]) => (left < right ? 1 : left > right ? -1 : 0)) + .map(([threadId]) => ({ threadId })) + if (pending.length === 0) { + return summary + } + summary.outcome = await readCodexThreadsForIndexHeal( + codexHomePath, + pending, + ({ threadId }, outcome) => { + if (outcome === 'healed') { + summary.healedThreads += 1 + return + } + failed.add(threadId) + if (outcome === 'missing') { + summary.missingThreads += 1 + } else { + summary.failedThreads += 1 + } + }, + options + ) + return summary +} + +export const _internals = { + resetFailedThreads: (): void => { + failedThreadIdsByHome.clear() + } +} diff --git a/src/main/codex/codex-index-heal-binary-contract.test.ts b/src/main/codex/codex-index-heal-binary-contract.test.ts index 5580fc02d1d9..8954f618a6ad 100644 --- a/src/main/codex/codex-index-heal-binary-contract.test.ts +++ b/src/main/codex/codex-index-heal-binary-contract.test.ts @@ -3,10 +3,12 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { promisify } from 'node:util' +import { zstdCompressSync } from 'node:zlib' import { afterEach, beforeAll, describe, expect, it } from 'vitest' +import { CODEX_SHORT_LIVED_PROBE_APP_SERVER_ARGS } from '../codex-cli/codex-read-only-app-server-args' import SyncDatabase from '../sqlite/sync-database' import { runCodexAppServerSession, type CodexAppServerRpc } from './codex-app-server-session' -import { findNewestCodexStateDbPath } from './codex-state-db' +import { findNewestCodexStateDbPath, readCodexStateDbBackfillStatus } from './codex-state-db' // Why this file exists: every other index-heal test drives a stub app-server and // asserts "healed" as "the `thread/read` call did not error". That pins Orca's half @@ -17,7 +19,7 @@ import { findNewestCodexStateDbPath } from './codex-state-db' // real-binary backstop, built to the same shape as the Git binary compatibility // contract in src/shared/git-binary-compatibility.test.ts. // -// Keep it narrow. It pins the four arms that ablation established Orca relies on, +// Keep it narrow. It pins the arms that ablation established Orca relies on, // and deliberately asserts nothing else about the app-server, so an unrelated Codex // release does not redden it into being disabled. @@ -83,11 +85,18 @@ describeCodexContract( mkdirSync(join(home, 'sessions'), { recursive: true }) // An app-server session over an empty sessions tree is what stamps the backfill complete. await runAppServerSession(home, async () => undefined) + // Why: the account bridge links history only after this no-request session stamps it. + expect(readCodexStateDbBackfillStatus(home).kind).toBe('complete') expect(readThreadRows(home)).toEqual([]) return home } - function writeRollout(home: string, threadId: string, stamp: string): void { + function writeRollout( + home: string, + threadId: string, + stamp: string, + options: { compressed?: boolean } = {} + ): void { const dayDir = join(home, 'sessions', '2026', '08', '29') mkdirSync(dayDir, { recursive: true }) const meta = { @@ -112,10 +121,13 @@ describeCodexContract( type: 'event_msg', payload: { type: 'user_message', message: 'index-heal contract fixture' } } - writeFileSync( - join(dayDir, `rollout-${stamp}-${threadId}.jsonl`), - `${JSON.stringify(meta)}\n${JSON.stringify(userMessage)}\n` - ) + const contents = `${JSON.stringify(meta)}\n${JSON.stringify(userMessage)}\n` + const fileName = `rollout-${stamp}-${threadId}.jsonl` + if (options.compressed) { + writeFileSync(join(dayDir, `${fileName}.zst`), zstdCompressSync(contents)) + } else { + writeFileSync(join(dayDir, fileName), contents) + } } // Why reuse runCodexAppServerSession rather than a local JSON-RPC client: it is the @@ -128,7 +140,8 @@ describeCodexContract( return runCodexAppServerSession( { command: binary!, - args: ['app-server'], + // Why: the heal and account state-DB creation launch with these exact args. + args: [...CODEX_SHORT_LIVED_PROBE_APP_SERVER_ARGS], cliPath: binary!, env: { CODEX_HOME: home }, timeoutMs: SESSION_TIMEOUT_MS @@ -171,6 +184,19 @@ describeCodexContract( expect(readThreadRows(home)).toEqual([{ id: threadId, archived: 0 }]) }) + // Why: the account bridge links `.jsonl.zst` history and heals it with the same read. + it('indexes a compressed-only rollout on read', async () => { + const home = await createBackfilledCodexHome() + const threadId = '01a04f62-715e-7830-9371-50db585caa74' + writeRollout(home, threadId, '2026-08-29T17-00-00', { compressed: true }) + + await runAppServerSession(home, async (rpc) => { + await rpc.request('thread/read', { threadId }) + }) + + expect(readThreadRows(home)).toEqual([{ id: threadId, archived: 0 }]) + }) + it('leaves an already-indexed thread as a single row', async () => { const home = await createBackfilledCodexHome() const threadId = '01a04f62-715e-7830-9371-50db585caa72' diff --git a/src/main/codex/codex-session-index-heal-state.ts b/src/main/codex/codex-session-index-heal-state.ts index 0a5fd0499c18..ab62b77669dd 100644 --- a/src/main/codex/codex-session-index-heal-state.ts +++ b/src/main/codex/codex-session-index-heal-state.ts @@ -22,7 +22,7 @@ const HEAL_UNSUPPORTED_RETRY_INTERVAL_MS = 24 * 60 * 60 * 1000 const HEAL_FAILED_THREAD_RETRY_INTERVAL_MS = 24 * 60 * 60 * 1000 const CODEX_ROLLOUT_THREAD_ID_PATTERN = - /^rollout-(.+)-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i + /^rollout-(.+)-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl(?:\.zst)?$/i export type CodexSessionIndexHealPaths = { auditLogPath: string @@ -70,11 +70,11 @@ export async function collectPendingHealThreads( if (!isPathInsideOrEqual(paths.systemSessionsRoot, line.target)) { continue } - const match = CODEX_ROLLOUT_THREAD_ID_PATTERN.exec(lastPathSegment(line.target)) - if (!match) { + const rollout = parseCodexRolloutThreadId(line.target) + if (!rollout) { continue } - const threadId = match[2].toLowerCase() + const { threadId } = rollout const auditRecordId = typeof line.recordId === 'string' ? line.recordId : null if ( auditRecordId @@ -88,13 +88,21 @@ export async function collectPendingHealThreads( pendingByThreadId.delete(threadId) continue } - pendingByThreadId.set(threadId, { threadId, rolloutStamp: match[1], auditRecordId }) + pendingByThreadId.set(threadId, { threadId, rolloutStamp: rollout.rolloutStamp, auditRecordId }) } return [...pendingByThreadId.values()].sort((left, right) => left.rolloutStamp < right.rolloutStamp ? 1 : left.rolloutStamp > right.rolloutStamp ? -1 : 0 ) } +/** Thread id (lower-cased) and timestamp segment encoded in a rollout file name. */ +export function parseCodexRolloutThreadId( + filePath: string +): { threadId: string; rolloutStamp: string } | null { + const match = CODEX_ROLLOUT_THREAD_ID_PATTERN.exec(lastPathSegment(filePath)) + return match ? { threadId: match[2].toLowerCase(), rolloutStamp: match[1] } : null +} + function lastPathSegment(filePath: string): string { return filePath.split(/[\\/]/).at(-1) ?? '' } diff --git a/src/main/codex/codex-session-index-heal.test.ts b/src/main/codex/codex-session-index-heal.test.ts index 20051fe1058e..1be3d047207e 100644 --- a/src/main/codex/codex-session-index-heal.test.ts +++ b/src/main/codex/codex-session-index-heal.test.ts @@ -10,10 +10,12 @@ import { } from 'node:fs' import { tmpdir } from 'node:os' import { dirname, join } from 'node:path' +import { CODEX_SHORT_LIVED_PROBE_APP_SERVER_ARGS } from '../codex-cli/codex-read-only-app-server-args' import type { CodexAppServerInvocation } from './codex-app-server-session' import { createCodexSessionBackfillAuditWriter } from './codex-session-backfill-audit' import { CODEX_SESSION_INDEX_HEAL_VERSION } from './codex-session-index-heal-state' import { + buildNativeHealInvocation, runCodexSessionIndexHeal, type CodexSessionIndexHealPaths } from './codex-session-index-heal' @@ -340,6 +342,7 @@ describe('runCodexSessionIndexHeal', () => { const marker = JSON.parse(readFileSync(rig.paths.healMarkerPath, 'utf-8')) as { retryableFailureAt: number } + expect(marker.retryableFailureAt).toEqual(expect.any(Number)) marker.retryableFailureAt = 0 writeFileSync(rig.paths.healMarkerPath, `${JSON.stringify(marker)}\n`, 'utf-8') const retried = await runCodexSessionIndexHeal(rig.paths, { @@ -490,6 +493,25 @@ describe('runCodexSessionIndexHeal', () => { expect(resumed.healedThreads + summary.healedThreads).toBe(4) }) + it('writes no completion marker when stop flips inside the last batch', async () => { + const rig = createHealRig({ + auditedThreads: [ + { stamp: '2026-07-02T10-00-00', id: threadId('2') }, + { stamp: '2026-07-01T10-00-00', id: threadId('1') } + ] + }) + + const summary = await runCodexSessionIndexHeal(rig.paths, { + buildInvocation: rig.buildInvocation, + readConcurrency: 1, + interBatchDelayMs: 0, + shouldStop: () => rig.readLog().threadIds.length > 0 + }) + + expect(summary).toMatchObject({ outcome: 'stopped', healedThreads: 1 }) + expect(existsSync(rig.paths.healMarkerPath)).toBe(false) + }) + it('does not spawn another server when stop flips during the inter-batch delay', async () => { const rig = createHealRig({ auditedThreads: [ @@ -777,3 +799,14 @@ describe('runCodexSessionIndexHeal', () => { warnSpy.mockRestore() }) }) + +describe('buildNativeHealInvocation', () => { + it('starts a read-only, plugin-free app-server pinned to the given home', () => { + const invocation = buildNativeHealInvocation('/codex-home', 1_000) + + for (const arg of CODEX_SHORT_LIVED_PROBE_APP_SERVER_ARGS) { + expect(invocation.args).toContain(arg) + } + expect(invocation.env).toEqual({ CODEX_HOME: '/codex-home' }) + }) +}) diff --git a/src/main/codex/codex-session-index-heal.ts b/src/main/codex/codex-session-index-heal.ts index 12747312646c..364263f2f471 100644 --- a/src/main/codex/codex-session-index-heal.ts +++ b/src/main/codex/codex-session-index-heal.ts @@ -1,6 +1,7 @@ import { dirname, join } from 'node:path' import { resolveCodexCommand } from '../codex-cli/command' import { isTransientSqliteContention } from '../sqlite/sqlite-read-failure' +import { CODEX_SHORT_LIVED_PROBE_APP_SERVER_ARGS } from '../codex-cli/codex-read-only-app-server-args' import { getSpawnArgsForWindows } from '../win32-utils' import { getCodexSessionBackfillStateDirPath } from './codex-home-paths' import { resolveCodexSessionBackfillPaths } from './codex-session-backfill' @@ -17,7 +18,8 @@ import { import { isCodexAppServerUnsupportedError, runCodexAppServerSession, - type CodexAppServerInvocation + type CodexAppServerInvocation, + type CodexAppServerRpc } from './codex-app-server-session' export type { CodexSessionIndexHealPaths } from './codex-session-index-heal-state' @@ -49,12 +51,20 @@ export type CodexSessionIndexHealSummary = { export type CodexSessionIndexHealOptions = { /** Polled between reads and batches; true stops promptly, progress is kept. */ shouldStop?: () => boolean - buildInvocation?: (systemCodexHomePath: string, timeoutMs: number) => CodexAppServerInvocation + buildInvocation?: (codexHomePath: string, timeoutMs: number) => CodexAppServerInvocation + runSession?: ( + invocation: CodexAppServerInvocation, + body: (rpc: CodexAppServerRpc) => Promise + ) => Promise readsPerServerSession?: number readConcurrency?: number interBatchDelayMs?: number } +export type CodexThreadReadOutcome = HealLedgerOutcome + +export type CodexThreadReadPassOutcome = 'completed' | 'stopped' | 'unsupported' | 'aborted' + let backgroundHealTask: Promise | null = null export function resolveCodexSessionIndexHealPaths( @@ -132,8 +142,54 @@ export async function runCodexSessionIndexHeal( return summary } - const systemCodexHomePath = dirname(paths.systemSessionsRoot) + const shouldStop = options.shouldStop ?? ((): boolean => false) + const outcome = await readCodexThreadsForIndexHeal( + dirname(paths.systemSessionsRoot), + pending, + (thread, readOutcome) => { + if (readOutcome === 'healed') { + summary.healedThreads += 1 + } else if (readOutcome === 'missing') { + // The backfilled rollout was deleted after the audit was written. + summary.missingThreads += 1 + } else { + summary.failedThreads += 1 + } + recordHealOutcome(paths, thread, readOutcome) + }, + options + ) + if (outcome === 'unsupported') { + // Why: no retry churn on old CLIs — remember unsupported and re-probe + // after the retry interval or a version bump; nothing is marked healed. + writeHealMarker(paths, auditBytes, summary, { unsupportedAt: Date.now() }) + } + if (outcome !== 'completed' || shouldStop()) { + summary.outcome = outcome === 'completed' ? 'stopped' : outcome + return summary + } + writeHealMarker( + paths, + auditBytes, + summary, + summary.failedThreads > 0 ? { retryableFailureAt: Date.now() } : undefined + ) + return summary +} + +/** + * Drives `thread/read` over `threads` in bounded app-server batches, reporting + * each settled read. Transport failures and sqlite contention abort the pass + * without reporting, so the caller's next pass retries those threads. + */ +export async function readCodexThreadsForIndexHeal( + codexHomePath: string, + threads: readonly T[], + onOutcome: (thread: T, outcome: CodexThreadReadOutcome) => void, + options: CodexSessionIndexHealOptions = {} +): Promise { const buildInvocation = options.buildInvocation ?? buildNativeHealInvocation + const runSession = options.runSession ?? runCodexAppServerSession const readsPerServerSession = resolveHealWorkLimit( options.readsPerServerSession, HEAL_READS_PER_SERVER_SESSION @@ -142,80 +198,55 @@ export async function runCodexSessionIndexHeal( const interBatchDelayMs = options.interBatchDelayMs ?? HEAL_INTER_BATCH_DELAY_MS const shouldStop = options.shouldStop ?? ((): boolean => false) - for (let offset = 0; offset < pending.length; offset += readsPerServerSession) { + for (let offset = 0; offset < threads.length; offset += readsPerServerSession) { if (shouldStop()) { - summary.outcome = 'stopped' - return summary + return 'stopped' } if (offset > 0 && interBatchDelayMs > 0) { await new Promise((resolve) => setTimeout(resolve, interBatchDelayMs)) if (shouldStop()) { - // Why: opt-out can happen during the throttle delay; do not spawn a - // real-home app-server after the lane has been disabled. - summary.outcome = 'stopped' - return summary + // Why: opt-out can happen during the throttle delay; do not spawn an + // app-server after the lane has been disabled. + return 'stopped' } } - const batch = pending.slice(offset, offset + readsPerServerSession) + const batch = threads.slice(offset, offset + readsPerServerSession) const timeoutMs = HEAL_BATCH_TIMEOUT_BASE_MS + HEAL_BATCH_TIMEOUT_PER_READ_MS * batch.length try { - await runCodexAppServerSession( - buildInvocation(systemCodexHomePath, timeoutMs), - async (rpc) => { - let nextIndex = 0 - const worker = async (): Promise => { - while (nextIndex < batch.length && !shouldStop()) { - const thread = batch[nextIndex] - nextIndex += 1 - await healOneThread(rpc, thread, paths, summary) - } + await runSession(buildInvocation(codexHomePath, timeoutMs), async (rpc) => { + let nextIndex = 0 + const worker = async (): Promise => { + while (nextIndex < batch.length && !shouldStop()) { + const thread = batch[nextIndex] + nextIndex += 1 + onOutcome(thread, await readOneThread(rpc, thread.threadId)) } - await Promise.all(Array.from({ length: readConcurrency }, () => worker())) } - ) + await Promise.all(Array.from({ length: readConcurrency }, () => worker())) + }) } catch (error) { + if (shouldStop()) { + return 'stopped' + } if (isCodexAppServerUnsupportedError(error)) { - if (shouldStop()) { - summary.outcome = 'stopped' - return summary - } - // Why: no retry churn on old CLIs — remember unsupported and re-probe - // after the retry interval or a version bump; nothing is marked healed. - writeHealMarker(paths, auditBytes, summary, { unsupportedAt: Date.now() }) - summary.outcome = 'unsupported' - return summary + return 'unsupported' } // Transport failure (timeout, early exit, spawn error): unprocessed ids - // were never appended to the ledger, so the next pass resumes them. + // were never reported, so the next pass resumes them. console.warn('[codex-session-index-heal] Heal batch aborted:', error) - summary.outcome = 'aborted' - return summary + return 'aborted' } } - - if (shouldStop()) { - summary.outcome = 'stopped' - return summary - } - writeHealMarker( - paths, - auditBytes, - summary, - summary.failedThreads > 0 ? { retryableFailureAt: Date.now() } : undefined - ) - return summary + return 'completed' } -async function healOneThread( - rpc: { request: (method: string, params?: Record) => Promise }, - thread: PendingHealThread, - paths: CodexSessionIndexHealPaths, - summary: CodexSessionIndexHealSummary -): Promise { +async function readOneThread( + rpc: CodexAppServerRpc, + threadId: string +): Promise { try { - await rpc.request('thread/read', { threadId: thread.threadId }) - summary.healedThreads += 1 - recordHealOutcome(paths, thread, 'healed') + await rpc.request('thread/read', { threadId }) + return 'healed' } catch (error) { if (isCodexAppServerUnsupportedError(error)) { throw error @@ -223,22 +254,18 @@ async function healOneThread( const message = error instanceof Error ? error.message : String(error) if (!message.startsWith('codex app-server thread/read failed')) { // Not an RPC-level response: the server died or timed out. Abort the - // batch without recording, so the id is retried on the next pass. + // batch without reporting, so the id is retried on the next pass. throw error } if (/no rollout found/i.test(message)) { - // The backfilled rollout was deleted after the audit was written. - summary.missingThreads += 1 - recordHealOutcome(paths, thread, 'missing') - return + return 'missing' } if (isTransientSqliteContention(message)) { - // Why: an active Codex process can briefly own sqlite; leave the id off - // the ledger and abort this pass so a later startup resumes it. + // Why: an active Codex process can briefly own sqlite; leave the id + // unreported and abort this pass so a later startup resumes it. throw error } - summary.failedThreads += 1 - recordHealOutcome(paths, thread, 'failed') + return 'failed' } } @@ -259,20 +286,23 @@ function resolveHealWorkLimit(value: number | undefined, maximum: number): numbe return Math.min(Math.floor(value), maximum) } -function buildNativeHealInvocation( - systemCodexHomePath: string, +export function buildNativeHealInvocation( + codexHomePath: string, timeoutMs: number ): CodexAppServerInvocation { const command = resolveCodexCommand() - const { spawnCmd, spawnArgs } = getSpawnArgsForWindows(command, ['app-server']) + // Why: each session is torn down after one batch, so plugin startup could + // leave marketplace clones running; indexing needs neither plugins nor tools. + const { spawnCmd, spawnArgs } = getSpawnArgsForWindows(command, [ + ...CODEX_SHORT_LIVED_PROBE_APP_SERVER_ARGS + ]) return { command: spawnCmd, args: spawnArgs, cliPath: command, - // Why: pin the real home explicitly — nested Orca launches can inherit a - // managed CODEX_HOME from the daemon environment, which would index the - // wrong sqlite DB. - env: { CODEX_HOME: systemCodexHomePath }, + // Why: pin the home explicitly — nested Orca launches can inherit a managed + // CODEX_HOME from the daemon environment, which would index the wrong sqlite DB. + env: { CODEX_HOME: codexHomePath }, timeoutMs } } diff --git a/src/main/codex/codex-state-db-test-fixture.ts b/src/main/codex/codex-state-db-test-fixture.ts new file mode 100644 index 000000000000..e84f0328c3b2 --- /dev/null +++ b/src/main/codex/codex-state-db-test-fixture.ts @@ -0,0 +1,14 @@ +import { mkdirSync } from 'node:fs' +import { join } from 'node:path' +import SyncDatabase from '../sqlite/sync-database' + +/** Writes a Codex state DB whose startup backfill reports `status`. */ +export function writeCodexStateDbBackfillStatus(codexHomePath: string, status: string): void { + mkdirSync(codexHomePath, { recursive: true }) + const db = new SyncDatabase(join(codexHomePath, 'state_5.sqlite')) + db.exec( + 'CREATE TABLE backfill_state (id INTEGER PRIMARY KEY, status TEXT NOT NULL); ' + + `INSERT INTO backfill_state (id, status) VALUES (1, '${status}')` + ) + db.close() +} diff --git a/src/main/codex/codex-state-db.test.ts b/src/main/codex/codex-state-db.test.ts index 7cf0ac88ac5f..a89a556b807c 100644 --- a/src/main/codex/codex-state-db.test.ts +++ b/src/main/codex/codex-state-db.test.ts @@ -1,12 +1,13 @@ import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { afterEach, describe, expect, it } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' import SyncDatabase from '../sqlite/sync-database' import { findNewestCodexStateDbPath, isCodexStateDbBackfillPending, - readCodexStateDbBackfillStatus + readCodexStateDbBackfillStatus, + readIndexedCodexThreadIds } from './codex-state-db' const temporaryHomes: string[] = [] @@ -67,6 +68,19 @@ describe('Codex state DB backfill status', () => { expect(isCodexStateDbBackfillPending(home)).toBe(true) }) + it('counts compressed rollouts, which Codex also backfills', async () => { + const home = await createHome() + const sessions = join(home, 'sessions', '2026', '08', '04') + await mkdir(sessions, { recursive: true }) + await Promise.all( + Array.from({ length: 100 }, (_, index) => + writeFile(join(sessions, `rollout-${index}.jsonl.zst`), '') + ) + ) + + expect(isCodexStateDbBackfillPending(home)).toBe(true) + }) + it('does not call a complete backfill pending', async () => { const home = await createHome() createBackfillDb(home, 5, 'complete') @@ -74,3 +88,27 @@ describe('Codex state DB backfill status', () => { expect(isCodexStateDbBackfillPending(home)).toBe(false) }) }) + +describe('readIndexedCodexThreadIds', () => { + it('returns lower-cased thread ids from the newest state DB', async () => { + const home = await createHome() + const path = createBackfillDb(home, 5, 'complete') + const db = new SyncDatabase(path) + db.exec( + "CREATE TABLE threads (id TEXT PRIMARY KEY); INSERT INTO threads (id) VALUES ('ABC'), ('def')" + ) + db.close() + + expect(readIndexedCodexThreadIds(home)).toEqual(new Set(['abc', 'def'])) + }) + + it('returns null when there is no state DB or no threads table', async () => { + const home = await createHome() + expect(readIndexedCodexThreadIds(home)).toBeNull() + + createBackfillDb(home, 5, 'complete') + const warn = vi.spyOn(console, 'warn').mockImplementation(() => {}) + expect(readIndexedCodexThreadIds(home)).toBeNull() + warn.mockRestore() + }) +}) diff --git a/src/main/codex/codex-state-db.ts b/src/main/codex/codex-state-db.ts index e2b437aea3aa..ae8ff3eb0460 100644 --- a/src/main/codex/codex-state-db.ts +++ b/src/main/codex/codex-state-db.ts @@ -71,6 +71,37 @@ export function readCodexStateDbBackfillStatus(codexHomePath: string): CodexStat } } +/** + * Lower-cased thread ids already in Codex's state DB, or null when the DB is + * missing or unreadable. Read-only; never creates or mutates Codex's database. + */ +export function readIndexedCodexThreadIds(codexHomePath: string): Set | null { + const stateDbPath = findNewestCodexStateDbPath(codexHomePath) + if (!stateDbPath) { + return null + } + let db: SyncDatabase | null = null + try { + db = new SyncDatabase(stateDbPath, { readonly: true, fileMustExist: true }) + const ids = new Set() + for (const row of db.prepare('SELECT id FROM threads').all()) { + if (typeof row.id === 'string') { + ids.add(row.id.toLowerCase()) + } + } + return ids + } catch (error) { + console.warn('[codex-state-db] Failed to read indexed Codex threads:', error) + return null + } finally { + try { + db?.close() + } catch { + // A close failure cannot change the read-only result already collected. + } + } +} + export function countCodexSessionFilesUpTo(sessionsRoot: string, limit: number): number { let count = 0 const pendingDirectories = [sessionsRoot] @@ -85,7 +116,11 @@ export function countCodexSessionFilesUpTo(sessionsRoot: string, limit: number): for (const entry of entries) { if (entry.isDirectory()) { pendingDirectories.push(join(directory, entry.name)) - } else if (entry.isFile() && entry.name.endsWith('.jsonl')) { + } else if ( + entry.isFile() && + // Why: Codex's startup backfill parses compressed rollouts too. + (entry.name.endsWith('.jsonl') || entry.name.endsWith('.jsonl.zst')) + ) { count += 1 if (count >= limit) { break diff --git a/src/main/startup/main-process-quit.ts b/src/main/startup/main-process-quit.ts index ad4548db7bd4..f104a3ec3439 100644 --- a/src/main/startup/main-process-quit.ts +++ b/src/main/startup/main-process-quit.ts @@ -15,6 +15,7 @@ import { clearRuntimeMetadataIfOwned } from '../runtime/runtime-metadata' import { shutdownPairedRuntimeBrowserClientHosts } from '../browser/paired-runtime-browser-client-host-runtime' import { browserManager } from '../browser/browser-manager' import { stopCodexStateDbBackfillRecoveries } from '../codex/codex-state-db-backfill-recovery' +import { stopCodexAccountSessionBridges } from '../codex/codex-account-session-bridge' import { awaitPackedRefsLockRelease } from '../git/local-repo-ref-maintenance' import { settleTeardownWithinDeadline, settleWithinMs } from '../quit-teardown-deadline' import { quitTeardownStartGate } from '../quit-teardown-start-gate' @@ -134,6 +135,7 @@ function installWillQuitHandler(): void { state.pluginMarketplaceInstaller = null const pluginHostShutdown = state.pluginService?.dispose() ?? Promise.resolve() const codexBackfillRecoveryShutdown = stopCodexStateDbBackfillRecoveries() + stopCodexAccountSessionBridges() // Why before the stop: teardown stamps each working session's resume marker with why the app // went away, and an update install is a restart the user never chose. setStructuredAgentSessionTeardownTrigger(updateQuitInProgress ? 'update' : 'quit') From bb91e39eb961e2c63a839037f988d7c925ac5023 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 29 Sep 2026 01:14:28 -0700 Subject: [PATCH 84/90] test(native-chat): main's Codex child tests expect a turn to end on its own turn/completed (#23783) * fix(native-chat): a Codex child's turn ends on its own turn/completed #22553 ended a child thread's turn on an `error` Codex will not retry, reading the verdict module #23682 deleted when it made turn/completed the only end of a Codex turn. The two landed minutes apart with no textual conflict, so main no longer typechecks. Codex runs every thread's events, spawned children included, through the same per-thread handler: a turn-ending error is recorded as the turn's last error and the turn then completes as failed. So a child's failed turn/completed is its end, as on the primary thread, and a closed thread stays the one child ending with no completion. * refactor(native-chat): a closed Codex child thread is its own frame With a child's turn now ending only on its own turn/completed, the turn-ended frame carried a fixed turnId (null) and state (unverifiable), and endTurn took parameters nothing passed. Name the one remaining case: a thread-closed frame, and closeThread ending the running turn as unverifiable. Drop a test step that no longer exercised anything. --- .../codex/codex-background-task-frames.ts | 32 ++++------ .../codex/codex-background-task-tracker.ts | 4 +- .../codex/codex-child-work-evidence.test.ts | 58 +++++++++---------- ...dex-structured-child-work-producer.test.ts | 7 ++- .../codex/codex-structured-thread-facts.ts | 8 --- src/main/codex/codex-subagent-executions.ts | 15 ++--- 6 files changed, 49 insertions(+), 75 deletions(-) diff --git a/src/main/codex/codex-background-task-frames.ts b/src/main/codex/codex-background-task-frames.ts index 029cc7b50c77..f01863956b6c 100644 --- a/src/main/codex/codex-background-task-frames.ts +++ b/src/main/codex/codex-background-task-frames.ts @@ -7,7 +7,7 @@ import { import { codexChildTurnState } from './codex-subagent-executions' import { readRecord } from './codex-item-field-readers' import { readCodexThreadItem } from './codex-structured-item-translation' -import { readCodexErrorWillRetry, readCodexTurnId } from './codex-structured-thread-facts' +import { readCodexTurnId } from './codex-structured-thread-facts' export type CodexBackgroundTaskFrame = | { @@ -25,15 +25,11 @@ export type CodexBackgroundTaskFrame = state: NativeChatSubagentState } | { - /** A child turn that ended with no `turn/completed`. No `turnId`: the one it is running. */ - kind: 'turn-ended' + /** A child thread that closed: it ran its last turn, and Codex never said how it went. */ + kind: 'thread-closed' threadId: string - turnId: string | null - state: CodexChildTurnEnding } -type CodexChildTurnEnding = Extract - export type CodexBackgroundTaskEvent = { method: string threadId: string @@ -41,24 +37,16 @@ export type CodexBackgroundTaskEvent = { } /** - * The two ways Codex ends a child's turn without `turn/completed`. An `error` it will not retry is - * that turn's own end: for a child, `turn/completed` may never follow, and without this end the - * child's lifecycle row latches on `working` for the life of the session. A closed thread ran its - * last turn, and Codex never said how it went. - * - * #23682 dropped the equivalent reading from the primary journal path, where Codex's own failed - * `turn/completed` always follows within ~32 ms and carries the duration the error lacks. A child - * has no such guarantee, which is why this path still settles on the error. + * The one way Codex ends a child's turn without `turn/completed`: a closed thread ran its last + * turn and Codex never said how it went. A turn-ending `error` is not one — Codex follows it with + * a failed `turn/completed` for the same turn, which is that turn's end and carries the duration + * and receipt time the error does not. */ -function readCodexChildTurnEnding( +function readCodexChildThreadClosed( event: CodexBackgroundTaskEvent ): CodexBackgroundTaskFrame | null { - if (event.method === 'error' && !readCodexErrorWillRetry(event.params)) { - const turnId = readCodexTurnId(event.params) - return { kind: 'turn-ended', threadId: event.threadId, turnId, state: 'failed' } - } return event.method === 'thread/closed' - ? { kind: 'turn-ended', threadId: event.threadId, turnId: null, state: 'unverifiable' } + ? { kind: 'thread-closed', threadId: event.threadId } : null } @@ -67,7 +55,7 @@ export function readCodexBackgroundTaskFrame( primaryThreadId: string ): CodexBackgroundTaskFrame | null { // The session's own turn ends through the journal's turn boundaries, never here. - const ending = event.threadId === primaryThreadId ? null : readCodexChildTurnEnding(event) + const ending = event.threadId === primaryThreadId ? null : readCodexChildThreadClosed(event) if (ending) { return ending } diff --git a/src/main/codex/codex-background-task-tracker.ts b/src/main/codex/codex-background-task-tracker.ts index 351b35e6b84a..6429a84d4fda 100644 --- a/src/main/codex/codex-background-task-tracker.ts +++ b/src/main/codex/codex-background-task-tracker.ts @@ -80,8 +80,8 @@ export class CodexBackgroundTaskTracker { frame.parentTurnId, frame.spawnerThreadId ) - } else if (frame?.kind === 'turn-ended') { - this.executions.endTurn(frame.threadId, frame.turnId, frame.state) + } else if (frame?.kind === 'thread-closed') { + this.executions.closeThread(frame.threadId) } else if (frame && frame.threadId !== this.primaryThreadId) { this.executions.observeTurn(frame.threadId, frame.turnId, frame.state) } diff --git a/src/main/codex/codex-child-work-evidence.test.ts b/src/main/codex/codex-child-work-evidence.test.ts index 9013b07a6745..5b1b1bc29b4f 100644 --- a/src/main/codex/codex-child-work-evidence.test.ts +++ b/src/main/codex/codex-child-work-evidence.test.ts @@ -159,18 +159,10 @@ describe('Codex child-work evidence', () => { expect(tracker.state).toBeNull() }) - const childError = ( - turnId: string | undefined, - willRetry: boolean - ): CodexBackgroundTaskEvent => ({ + const childError = (turnId: string, willRetry: boolean): CodexBackgroundTaskEvent => ({ method: 'error', threadId: CHILD, - params: { - threadId: CHILD, - ...(turnId ? { turnId } : {}), - willRetry, - error: { message: 'boom' } - } + params: { threadId: CHILD, turnId, willRetry, error: { message: 'boom' } } }) const childClosed: CodexBackgroundTaskEvent = { method: 'thread/closed', @@ -178,25 +170,30 @@ describe('Codex child-work evidence', () => { params: { threadId: CHILD } } - it.each([ - ['an error naming its turn that Codex will not retry', childError('c1', false), 'failed'], - ['an error naming no turn that Codex will not retry', childError(undefined, false), 'failed'], - ['its thread closing', childClosed, 'unknown'] - ])( - 'settles a working child whose turn ended with no turn/completed, by %s, in the strip and the record together', - (_label, ending, outcome) => { - const { send, tracker, records } = runningChild() - expect(tracker.state?.tasks).toHaveLength(1) - send(ending) - expect(records()).toEqual([ - expect.objectContaining({ membership: 'settled', state: 'done', outcome }) - ]) - expect(tracker.state).toBeNull() - // The first ending a turn gets stands. - send(turn('turn/completed', CHILD, 'c1', 'completed')) - expect(records()).toEqual([expect.objectContaining({ outcome })]) - } - ) + it('keeps a child working through an error Codex will not retry, and settles it on the failed turn/completed that follows', () => { + const { send, tracker, records } = runningChild() + send(childError('c1', false)) + expect(records()).toEqual([expect.objectContaining({ membership: 'live' })]) + expect(tracker.state?.tasks).toHaveLength(1) + send(turn('turn/completed', CHILD, 'c1', 'failed')) + expect(records()).toEqual([ + expect.objectContaining({ membership: 'settled', state: 'done', outcome: 'failed' }) + ]) + expect(tracker.state).toBeNull() + }) + + it('settles a working child whose thread closed with no turn/completed, in the strip and the record together', () => { + const { send, tracker, records } = runningChild() + expect(tracker.state?.tasks).toHaveLength(1) + send(childClosed) + expect(records()).toEqual([ + expect.objectContaining({ membership: 'settled', state: 'done', outcome: 'unknown' }) + ]) + expect(tracker.state).toBeNull() + // The first ending a turn gets stands. + send(turn('turn/completed', CHILD, 'c1', 'completed')) + expect(records()).toEqual([expect.objectContaining({ outcome: 'unknown' })]) + }) it('keeps a child working through a retried error and a systemError status: its turn runs on', () => { const { send, tracker, records } = runningChild() @@ -207,9 +204,6 @@ describe('Codex child-work evidence', () => { }) expect(records()).toEqual([expect.objectContaining({ membership: 'live', state: 'working' })]) expect(tracker.state?.tasks).toHaveLength(1) - // A fatal error naming a turn the child already finished ends nothing. - send(turn('turn/completed', CHILD, 'c1'), childError('c1', false)) - expect(records()).toEqual([expect.objectContaining({ outcome: 'succeeded' })]) }) it('never settles a child on its PARENT turn ending: children outlive the turn', () => { diff --git a/src/main/codex/codex-structured-child-work-producer.test.ts b/src/main/codex/codex-structured-child-work-producer.test.ts index fc011d48bb9e..611b7f75b57f 100644 --- a/src/main/codex/codex-structured-child-work-producer.test.ts +++ b/src/main/codex/codex-structured-child-work-producer.test.ts @@ -332,13 +332,18 @@ describe('Codex structured child-work producer', () => { { frame: turn('turn/started', TESTER, 't1'), lead: 'working' }, { frame: spawned(LINTER, 'lint', 'p2'), lead: 'working' }, { frame: turn('turn/started', LINTER, 'l1'), lead: 'working' }, - // Codex ends this child's turn with an error it will not retry, and no turn/completed. + // Codex ends this child's turn with an error it will not retry, then a failed completion. { frame: { method: 'error', params: { threadId: LINTER, turnId: 'l1', willRetry: false, error: { message: 'boom' } } }, lead: 'working', + check: () => expect(byDescription('lint')).toMatchObject({ membership: 'live' }) + }, + { + frame: turn('turn/completed', LINTER, 'l1', 'failed'), + lead: 'working', check: () => expect(byDescription('lint')).toMatchObject({ membership: 'settled', outcome: 'failed' }) }, diff --git a/src/main/codex/codex-structured-thread-facts.ts b/src/main/codex/codex-structured-thread-facts.ts index aaf65f93ec6e..f2a42e6d3dbf 100644 --- a/src/main/codex/codex-structured-thread-facts.ts +++ b/src/main/codex/codex-structured-thread-facts.ts @@ -65,14 +65,6 @@ export function readCodexTurnDurationMs(payload: unknown): number | null { /** `thread/status/changed` carries a TAGGED status (`{status:{type}}`), never a * bare string. `idle` and `systemError` are the two arms that mean the thread * is not running; `active` and `notLoaded` are not. */ -/** - * Codex hardcodes `willRetry: false` on an `error` that affects turn status, and `true` on a - * stream error it is about to retry, which ends nothing. - */ -export function readCodexErrorWillRetry(payload: unknown): boolean { - return record(payload)?.willRetry === true -} - export function codexThreadStoppedRunning(payload: unknown): boolean { const type = record(record(payload)?.status)?.type return type === 'idle' || type === 'systemError' diff --git a/src/main/codex/codex-subagent-executions.ts b/src/main/codex/codex-subagent-executions.ts index 939d1b903317..87d9327c70c0 100644 --- a/src/main/codex/codex-subagent-executions.ts +++ b/src/main/codex/codex-subagent-executions.ts @@ -94,17 +94,12 @@ export class CodexSubagentExecutions { return { child, execution } } - /** A child turn that ended with no `turn/completed`. With no turn named, the one the child is - * running ended; a child running none has nothing to end. The first ending a turn gets stands. */ - endTurn( - agentThreadId: string, - turnId: string | null, - state: Exclude - ): void { + /** The child's thread closed with no `turn/completed`: the turn it was running ended, and how + * it went is unknown. A child running none has nothing to end. */ + closeThread(agentThreadId: string): void { const current = this.children.get(agentThreadId)?.execution - const ended = turnId ?? (current?.state === 'working' ? current.turnId : null) - if (current && ended !== null) { - this.observeTurn(agentThreadId, ended, state) + if (current?.state === 'working') { + this.observeTurn(agentThreadId, current.turnId, 'unverifiable') } } From 36c473ea1ad30b68a7f09035bf7eeb74e8ff438d Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 29 Sep 2026 01:16:20 -0700 Subject: [PATCH 85/90] fix(runtime): wait out Codex 0.157's startup screen, and stop at Codex's startup dialogs, before typing a worker brief (#23745) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(runtime): wait for Codex's live chat before typing a worker brief Codex 0.157 draws a provisional startup screen (header reads model: loading) and discards typed input while it starts its shared daemon behind it; a fresh Codex home makes that window seconds long, so worker-start pasted briefs that were truncated or never submitted. Codex 0.158 dropped the header labels Orca matched, so worker-start stopped seeing Codex as ready at all. Readiness now requires Codex's live chat on both layouts: the provisional header vetoes a text match unless the live status row is already painted, and 0.158's greeting layout counts once that status row appears. Codex 0.158's model announcement dialog is reported as a blocked prompt instead of receiving the brief. * fix(runtime): recognise Codex's provisional screen from the text copy and the screen probe Live worker-start on a fresh Codex 0.157 home still typed during the daemon start: Codex leaves its alternate screen for that window, so the live screen showed no header and the screen-based veto never fired. The text copy keeps the provisional header until the live chat paints its status row, so the veto now reads it there. The tui-idle visible-screen probe used the bare text rule on the rendered screen; it now goes through the same body rule. * test(daemon): register the new Codex captures' known serializer divergences The serialize round-trip replay picks up every fixture under runtime/__fixtures__, and the three new Codex 0.157/0.158 captures showed 48/9/8 "new-fail" checkpoints against an expected 0, turning CI red. They are the existing live-pen colour leak on restored cells, the same class as the other Codex and DSH entries; this branch changes no serializer code. * fix(runtime): keep Qoder off the Codex screen probe change; drop an unbacked row filter - The tui-idle visible-screen probe now classified Qoder panes with isQoderComposerReady, which skips the working veto evaluateTuiIdle applies first. Qoder paints its composer mid-turn, so an adopted Qoder pane whose hooks said "working" settled the wait immediately. Only Codex and unknown panes take the body rule there; every other agent keeps its old verdict. - The live status-row check skipped rows containing "waiting for startup", a string Codex 0.157/0.158's TUI never prints. The line-folded text copy keeps a whole screen on one line, so the filter could only ever veto the real status row. It is now a bounded includes() with no split. - Lowercase the wait text once in isKnownReadyPromptBody. - Restore the per-frame "screen never takes a settled header away" check, guarded on the provisional veto, instead of checking the final frame only. * fix(runtime): stop reporting Codex 0.158's model announcement once it is answered The announcement's choices stay in the text copy after the user answers it, and the existing dismissal check needed the model:/directory: labels that 0.158's header lacks, so tui-idle waits and the agent-status query kept reporting codex-model-migration-prompt over a live chat. Codex repaints its whole screen, header included, when a startup dialog closes, so the header after the dialog now marks it answered. Also corrects the live-chat marker comments: the middle dot also comes from the daemon session's agents hint row and the warnings notice, not only the status row. * docs(runtime): note that Codex startup dialogs also draw the live-footer dot * fix(runtime): recognise Codex 0.157/0.158 startup dialogs by the rows they really print Codex 0.157 and 0.158 no longer print `Press enter to continue/confirm` on their startup dialogs; they print key rows instead (`enter continue · esc skip`, `enter confirm · esc skip`, `enter/esc continue · ctrl+c quit`). The update, hooks-review and model-migration matchers still required the old wording, so none of these dialogs was reported as blocked. On 0.157 the dialog's `·` also satisfied the live-footer check, so a tui-idle wait read the update dialog as ready and worker-start would type the brief into it, where Enter picks "Update now" (npm install -g, Codex exits). On 0.158 the wait timed out instead of reporting blocked. The matchers now accept the old wording or the new row, tolerating the spaces the line-folded text copy drops around `·`. Each one matches from the dialog's first `·` (for the update dialog that is its title row, `Update available · 0.157.0 → …`), so the dialog is blocked from the same character that would otherwise make the provisional header read as live. The retired-model notice without choices has a catalog-supplied heading (`GPT-5.4 is no longer available`), so it is matched by its own key row. No new blocked-reason value. The startup-dialog matchers move to startup-dialog-blocked-signals.ts to keep terminal-wait-detection.ts under the line limit. Backed by six real captures (update available, hooks review, retired model without choices, each on 0.157.0 and 0.158.0), replayed frame by frame and through a tui-idle wait; the serializer round-trip replay registers their existing live-pen colour divergences. * fix(runtime): keep reporting Codex's retired-model notice after a relaunch in the same pane The retired-model notice is matched by its key row alone, and the matcher took the first `enter/esc continue ·` in the live window while every other startup-dialog matcher takes the last. Quitting Codex from the notice and relaunching it in the same pane leaves the old copy ahead of the new launch's header, so the header read as having dismissed the new notice: 0.157 then read ready and a worker brief would be typed into the dialog. Take the last key row, and replay each captured dialog quit-and-relaunched to pin all six. * fix(runtime): match Codex startup dialogs by the rows the text copy keeps intact Codex 0.157+ paints each startup dialog over its startup screen by cell diff, so Orca's line-folded text copy can drop letters and spaces from a heading: #23765's 0.157.1 capture reads `Updat available`. The update matcher needed `update available`, so on that capture tier 1 read the dialog's own `·` as the live chat's footer and a tui-idle wait settled ready on the update dialog, whose Enter picks "Update now". Match each dialog from its first `·` by rows Codex prints as fixed literals: `available · ` and `enter continue · esc skip` (update), `enter confirm ·` (hooks review), `enter/esc continue|confirm ·` (model notices, which also covers 0.158's new-model announcement, so its choice-text matcher goes). Legacy `Press enter to …` wording still matches. Add the new rows to the blocked-signal prefilter, and replay #23765's 0.157.1 update capture in the dialog suite. * fix(runtime): don't name Codex's mid-session pickers a hooks review Codex's rate-limit reset popup (and its other pickers) end their key row with `enter confirm · esc back`, which the hooks-review row matched now that it no longer needs the heading. Exclude `esc back` instead of requiring `esc skip`, so a half-painted hooks-review row still blocks. --- .../serialize-grid-transcript-replay.test.ts | 11 + ...x-0157-fresh-home-daemon-install.meta.json | 9 + .../codex-0157-fresh-home-daemon-install.txt | 2 + .../codex-0157-hooks-review-dialog.meta.json | 9 + .../codex-0157-hooks-review-dialog.txt | 2 + .../codex-0157-model-retired-dialog.meta.json | 9 + .../codex-0157-model-retired-dialog.txt | 2 + ...dex-0157-update-available-dialog.meta.json | 9 + .../codex-0157-update-available-dialog.txt | 2 + .../codex-0158-fresh-home-greeting.meta.json | 9 + .../codex-0158-fresh-home-greeting.txt | 1 + .../codex-0158-hooks-review-dialog.meta.json | 9 + .../codex-0158-hooks-review-dialog.txt | 1 + ...x-0158-model-announcement-dialog.meta.json | 9 + .../codex-0158-model-announcement-dialog.txt | 1 + .../codex-0158-model-retired-dialog.meta.json | 9 + .../codex-0158-model-retired-dialog.txt | 1 + ...dex-0158-update-available-dialog.meta.json | 9 + .../codex-0158-update-available-dialog.txt | 1 + ...codex-header-readiness-transcripts.test.ts | 102 ++++++++- .../codex-startup-dialog-transcripts.test.ts | 198 ++++++++++++++++++ src/main/runtime/codex-terminal-readiness.ts | 21 ++ ...ntime-start-tui-idle-visible-read-probe.ts | 4 +- .../runtime/startup-dialog-blocked-signals.ts | 76 +++++++ src/main/runtime/terminal-wait-detection.ts | 45 ++-- 25 files changed, 521 insertions(+), 30 deletions(-) create mode 100644 src/main/runtime/__fixtures__/codex-0157-fresh-home-daemon-install.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0157-fresh-home-daemon-install.txt create mode 100644 src/main/runtime/__fixtures__/codex-0157-hooks-review-dialog.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0157-hooks-review-dialog.txt create mode 100644 src/main/runtime/__fixtures__/codex-0157-model-retired-dialog.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0157-model-retired-dialog.txt create mode 100644 src/main/runtime/__fixtures__/codex-0157-update-available-dialog.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0157-update-available-dialog.txt create mode 100644 src/main/runtime/__fixtures__/codex-0158-fresh-home-greeting.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0158-fresh-home-greeting.txt create mode 100644 src/main/runtime/__fixtures__/codex-0158-hooks-review-dialog.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0158-hooks-review-dialog.txt create mode 100644 src/main/runtime/__fixtures__/codex-0158-model-announcement-dialog.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0158-model-announcement-dialog.txt create mode 100644 src/main/runtime/__fixtures__/codex-0158-model-retired-dialog.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0158-model-retired-dialog.txt create mode 100644 src/main/runtime/__fixtures__/codex-0158-update-available-dialog.meta.json create mode 100644 src/main/runtime/__fixtures__/codex-0158-update-available-dialog.txt create mode 100644 src/main/runtime/codex-startup-dialog-transcripts.test.ts create mode 100644 src/main/runtime/startup-dialog-blocked-signals.ts diff --git a/src/main/daemon/serialize-grid-transcript-replay.test.ts b/src/main/daemon/serialize-grid-transcript-replay.test.ts index 298aaa681bf7..cbe9b5db2c0d 100644 --- a/src/main/daemon/serialize-grid-transcript-replay.test.ts +++ b/src/main/daemon/serialize-grid-transcript-replay.test.ts @@ -43,6 +43,17 @@ const KNOWN_PREEXISTING_I2_FAILURES: Record = { 'codex-0157-effort-override-embedded-warning': 4, 'codex-0157-no-daemon-effort-override': 16, 'codex-0157-plain-ready': 18, + // Fresh-home 0.157/0.158 captures: the live pen's true-colour fg/bg leaks onto restored cells. + 'codex-0157-fresh-home-daemon-install': 48, + 'codex-0158-fresh-home-greeting': 9, + 'codex-0158-model-announcement-dialog': 8, + // Codex 0.157/0.158 startup-dialog captures: the same live-pen true-colour leak onto restored cells. + 'codex-0157-update-available-dialog': 26, + 'codex-0158-update-available-dialog': 8, + 'codex-0157-hooks-review-dialog': 24, + 'codex-0158-hooks-review-dialog': 8, + 'codex-0157-model-retired-dialog': 22, + 'codex-0158-model-retired-dialog': 6, // Same extra dim bit on the 0.157/0.158 header row (STA-8834 fixtures). 'codex-0-157-1-update-dialog': 16, 'codex-0-158-0-approval': 12, diff --git a/src/main/runtime/__fixtures__/codex-0157-fresh-home-daemon-install.meta.json b/src/main/runtime/__fixtures__/codex-0157-fresh-home-daemon-install.meta.json new file mode 100644 index 000000000000..04203db4fbe7 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0157-fresh-home-daemon-install.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-28T21:45:00.000Z", + "platform": "darwin", + "command": ["codex", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.157.0, plain launch (no -m/-c) on a fresh CODEX_HOME. The provisional screen reads `model: loading` while Codex installs and starts its shared daemon (`Installing daemon from CLI version 0.157.0`); 0.157 discards typed input during that start. The live header fills in at the end. Cut 6 s after spawn. Home-directory user name redacted by hand, same length.", + "exitCode": null +} diff --git a/src/main/runtime/__fixtures__/codex-0157-fresh-home-daemon-install.txt b/src/main/runtime/__fixtures__/codex-0157-fresh-home-daemon-install.txt new file mode 100644 index 000000000000..a6aa2c9af2c6 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0157-fresh-home-daemon-install.txt @@ -0,0 +1,2 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l╭───────────────────────────────────────╮│ >_ OpenAI Codex (v0.157.0) ││ ││ model: loading /model to change ││ directory: loading │╰───────────────────────────────────────╯ › Ask Codex to do anything ? for shortcuts[0 q╭[?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l─────────────╮ │ │ loading /model to change │ /Users/user1/cr/rounds/x157fresh/repo ││ permissions: YOLO mode │╰────────────────────────────────────────────────────╯[?25h[?2026l[?2026h[?25h[?2026l[?1006l[?1015l[?1003l[?1002l[?1000l[<1u[?1007l[?1049l[<1u[>4;0m[?2004l[?1004l[0 q[?25hInstalling daemon from CLI version 0.157.0 into /Users/user1/cr/rounds/x157fresh/home/.codex/packages/app-server-daemon... +[?2004h[>4;0m[>7u[?1004h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l╭────────────────────────────────────────────────────╮│ >_ OpenAI Codex (v0.157.0) ││ ││ model: loading /model to change ││ directory: /Users/user1/cr/rounds/x157fresh/repo ││ permissions: YOLO mode │╰────────────────────────────────────────────────────╯ › Ask Codex to do anything ? for shortcuts[0 q╭[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;repo[?2026h[?25h[?2026l[?2026h[?25lTip: Visit the ]8;;https://community.openai.com/c/codex/37Codex community forum]8;; (]8;;https://community.openai.com/c/codex/37https://community.openai.com/c/codex/37]8;;).GPT-6-Astra default · /Users/user1/cr/rounds/x157fresh/repo←agens · ? for shortcuts[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ repo]0;repo[?2026h[?25lGPT-6-Astra /model to change⠈⢀⠁⠂⠄⠈⠁⠈⠁⠈⢀⠠⠄⠠⢀⠠⡀⠠⠁⢀⠁[?25h[?2026l[?2026h[?25l⠄[?25h[?2026l[?2026h[?25l⠄[?25h[?2026l[?2026h[?25l⠈⢀⠁⠐⠂⠄⠈⠁⠈⠁⠈⢀⠠⠄⠠⢀⠠⠄⡀⠈⠠⠁⢀⠁[?25h[?2026l[?2026h[?25l⠈⢀⠁⠐⠂⠄⠈⠁⠈⠁⠈⢀⠠⠄⠠⢀⠠⠄⡀⠈⠠⠁⢀[?25h[?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0157-hooks-review-dialog.meta.json b/src/main/runtime/__fixtures__/codex-0157-hooks-review-dialog.meta.json new file mode 100644 index 000000000000..ebc2a471a20f --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0157-hooks-review-dialog.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-29T03:30:27.000Z", + "platform": "darwin", + "command": ["codex", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.157.0, plain launch on a fresh CODEX_HOME with a hooks.json of 8 command hooks that were never trusted. Over the provisional screen Codex paints `Hooks need review`, `1. Review hooks` / `2. Trust all and continue` / `3. Continue without trusting (hooks won't run)` and the key row `enter confirm · esc skip`, where older builds wrote `Press enter to confirm`. No key was sent (only automatic terminal-query replies). Cut 6 s after spawn. Home-directory user name redacted by hand, same length.", + "exitCode": null +} diff --git a/src/main/runtime/__fixtures__/codex-0157-hooks-review-dialog.txt b/src/main/runtime/__fixtures__/codex-0157-hooks-review-dialog.txt new file mode 100644 index 000000000000..14b1ad743e14 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0157-hooks-review-dialog.txt @@ -0,0 +1,2 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l╭───────────────────────────────────────╮│ >_ OpenAI Codex (v0.157.0) ││ ││ model: loading /model to change ││ directory: loading │╰───────────────────────────────────────╯ › Ask Codex to do anything ? for shortcuts[0 q╭[?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l───────────╮ │ │ loading /model to change │ /Users/user1/cr/rounds/dlg-h57/repo ││ permissions: YOLO mode │╰──────────────────────────────────────────────────╯[?25h[?2026l[?1006l[?1015l[?1003l[?1002l[?1000l[<1u[?1007l[?1049l[<1u[>4;0m[?2004l[?1004l[0 q[?25hInstalling daemon from CLI version 0.157.0 into /Users/user1/cr/rounds/dlg-h57/home/.codex/packages/app-server-daemon... +[?2004h[>4;0m[>7u[?1004h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l╭──────────────────────────────────────────────────╮│ >_ OpenAI Codex (v0.157.0) ││ ││ model: loading /model to change ││ directory: /Users/user1/cr/rounds/dlg-h57/repo ││ permissions: YOLO mode │╰──────────────────────────────────────────────────╯ › Ask Codex to do anything ? for shortcuts[0 q╭[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l  Hooks need review 8 hooks are new or changed. Hooks can run outside the sandbox after you trust them.  › 1. Review hooks  2. Trust all and continue 3. Continue without trusting (hooks won't run) enter confirm · esc skip    [?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0157-model-retired-dialog.meta.json b/src/main/runtime/__fixtures__/codex-0157-model-retired-dialog.meta.json new file mode 100644 index 000000000000..0e97bbe47154 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0157-model-retired-dialog.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-29T03:31:06.000Z", + "platform": "darwin", + "command": ["codex", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.157.0, plain launch on a fresh CODEX_HOME whose config.toml sets model = \"gpt-5.4-mini\", a model missing from 0.157's catalog, so Codex shows its retired-model notice without choices: `GPT-5.4 Mini is no longer available`, `Switch to GPT-6 Luna to continue.` and the key row `enter/esc continue · ctrl+c quit`. Enter or Esc switches the model; the heading comes from the model catalog, not the older `Codex just got an upgrade` wording. No key was sent (only automatic terminal-query replies). Cut 6 s after spawn. Home-directory user name redacted by hand, same length.", + "exitCode": null +} diff --git a/src/main/runtime/__fixtures__/codex-0157-model-retired-dialog.txt b/src/main/runtime/__fixtures__/codex-0157-model-retired-dialog.txt new file mode 100644 index 000000000000..776b261a2d60 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0157-model-retired-dialog.txt @@ -0,0 +1,2 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l╭───────────────────────────────────────╮│ >_ OpenAI Codex (v0.157.0) ││ ││ model: loading /model to change ││ directory: loading │╰───────────────────────────────────────╯ › Ask Codex to do anything ? for shortcuts[0 q╭[?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l───────────╮ │ │ loading /model to change │ /Users/user1/cr/rounds/dlg-m57/repo ││ permissions: YOLO mode │╰──────────────────────────────────────────────────╯[?25h[?2026l[?1006l[?1015l[?1003l[?1002l[?1000l[<1u[?1007l[?1049l[<1u[>4;0m[?2004l[?1004l[0 q[?25hInstalling daemon from CLI version 0.157.0 into /Users/user1/cr/rounds/dlg-m57/home/.codex/packages/app-server-daemon... +[?2004h[>4;0m[>7u[?1004h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l╭──────────────────────────────────────────────────╮│ >_ OpenAI Codex (v0.157.0) ││ ││ model: loading /model to change ││ directory: /Users/user1/cr/rounds/dlg-m57/repo ││ permissions: YOLO mode │╰──────────────────────────────────────────────────╯ › Ask Codex to do anything ? for shortcuts[0 q╭[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l  GPT-5.4 Mini is no longer available  Codex now uses GPT-6 Luna in place of GPT-5.4 Mini. Switch to GPT-6 Luna to continue. enter/esc continue · ctrl+c quit     [?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0157-update-available-dialog.meta.json b/src/main/runtime/__fixtures__/codex-0157-update-available-dialog.meta.json new file mode 100644 index 000000000000..a81301d2215f --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0157-update-available-dialog.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-29T03:29:52.000Z", + "platform": "darwin", + "command": ["codex", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.157.0, plain launch on a fresh CODEX_HOME whose config.toml sets check_for_update_on_startup = true, with a version.json cache naming 0.159.0 checked moments earlier (so no network check) and CODEX_MANAGED_BY_NPM=1 so Codex offers an update command. Over the provisional screen Codex paints `Update available · 0.157.0 → 0.159.0`, `1. Update now (runs `npm install -g @openai/codex`)` / `2. Skip` / `3. Skip until next version` and the key row `enter continue · esc skip`, where older builds wrote `Press enter to continue`. Enter picks Update now. No key was sent (only automatic terminal-query replies). Cut 6 s after spawn. Home-directory user name redacted by hand, same length.", + "exitCode": null +} diff --git a/src/main/runtime/__fixtures__/codex-0157-update-available-dialog.txt b/src/main/runtime/__fixtures__/codex-0157-update-available-dialog.txt new file mode 100644 index 000000000000..4701e63af24b --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0157-update-available-dialog.txt @@ -0,0 +1,2 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l╭───────────────────────────────────────╮│ >_ OpenAI Codex (v0.157.0) ││ ││ model: loading /model to change ││ directory: loading │╰───────────────────────────────────────╯ › Ask Codex to do anything ? for shortcuts[0 q╭[?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l───────────╮ │ │ loading /model to change │ /Users/user1/cr/rounds/dlg-u57/repo ││ permissions: YOLO mode │╰──────────────────────────────────────────────────╯[?25h[?2026l[?2026h[?25h[?2026l[?1006l[?1015l[?1003l[?1002l[?1000l[<1u[?1007l[?1049l[<1u[>4;0m[?2004l[?1004l[0 q[?25hInstalling daemon from CLI version 0.157.0 into /Users/user1/cr/rounds/dlg-u57/home/.codex/packages/app-server-daemon... +[?2004h[>4;0m[>7u[?1004h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l╭──────────────────────────────────────────────────╮│ >_ OpenAI Codex (v0.157.0) ││ ││ model: loading /model to change ││ directory: /Users/user1/cr/rounds/dlg-u57/repo ││ permissions: YOLO mode │╰──────────────────────────────────────────────────╯ › Ask Codex to do anything ? for shortcuts[0 q╭[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l  Update available · 0.157.0 → 0.159.0 Release notes: ]8;;https://github.com/openai/codex/releases/latesthttps://github.com/openai/codex/releases/latest]8;; › 1. Update now (runs `npm install -g @openai/codex`)  2. Skip 3. Skip until next version  enter continue · esc skip    [?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0158-fresh-home-greeting.meta.json b/src/main/runtime/__fixtures__/codex-0158-fresh-home-greeting.meta.json new file mode 100644 index 000000000000..ea7d9513a9f7 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-fresh-home-greeting.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-28T21:44:00.000Z", + "platform": "darwin", + "command": ["codex", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.158.0, plain launch (no -m/-c) on a fresh CODEX_HOME. Greeting layout: an unboxed `>_ OpenAI Codex (v0.158.0)` header with no model:/directory: labels, starting from a provisional screen whose directory reads `loading`; the live status row under the composer appears last. Braille logo animation frames included. Cut 4.6 s after spawn. Home-directory user name redacted by hand, same length.", + "exitCode": null +} diff --git a/src/main/runtime/__fixtures__/codex-0158-fresh-home-greeting.txt b/src/main/runtime/__fixtures__/codex-0158-fresh-home-greeting.txt new file mode 100644 index 000000000000..72670b00f4b4 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-fresh-home-greeting.txt @@ -0,0 +1 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l>_ OpenAI Codex (v0.158.0)loadingShall we see where this goes?⣀⣤⣤⣤⣀⣀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣤⣤⣤⣤⡀⢀⣾⣿⣿⠿⠋⠉⠉⢉⣭⣿⣿⣿⣿⣿⠿⣿⣿⣿⣿⣷⣄⣀⣾⣿⣿⠃⣀⣴⣾⣿⣿⡿⠟⠋⣀⡀⠈⠙⢿⣿⣿⣧⣀⣶⣿⣿⣿⣿⡇⢸⣿⣿⡿⠛⠉⢀⣠⣴⣿⣿⣿⣷⣦⣀⠈⢻⣿⣿⡇⣰⣿⣿⡿⢿⣿⣿⡇⢸⣿⣿⢀⣤⣶⣿⣿⣿⠟⠛⠻⣿⣿⣿⣿⣮⣿⣿⡷⢰⣿⣿⡟⠁⢸⣿⣿⡇⢸⣿⣿⣿⣿⠿⠿⣿⣿⣿⣦⣄⡀⠈⠛⠿⣿⣿⣿⣧⡀⣾⣿⣿⠃⢸⣿⣿⡇⢸⣿⣿⠋⠁⠈⠙⢻⣿⣿⣿⣶⣤⡀⠹⢿⣿⣷⡄⢸⣿⣿⣇⠸⣿⣿⣷⣦⣼⣿⣿⢸⣿⣿⠻⢿⣿⣿⡇⠘⣿⣿⣿⠈⢿⣿⣿⣦⡀⠈⠛⠿⣿⣿⣿⣿⣄⡀⢀⣠⣼⣿⣿⣿⣿⡇⣿⣿⣿⠇⢻⣿⣿⣿⣷⣦⣀⠈⠙⠻⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⣿⣿⡇⣠⣿⣿⣿⢸⣿⣿⡿⢿⣿⣿⣿⣦⣠⣴⣿⣿⣿⡿⠟⠋⢸⣿⣿⣿⣿⣷⣴⣿⣿⣿⠃⠘⣿⣿⣷⠈⠛⢿⣿⣿⣿⠿⠋⠉⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠻⣿⣿⣿⣤⣀⠈⠉⢀⣤⣶⣿⣿⣿⠿⠟⠁⣰⣿⣿⡟⠋⠁⠈⠿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⠟⠋⠁⣠⣼⣿⣿⡟⠙⠛⠛⠛⠻⠛⢿⣿⣿⣿⣿⣷⣾⣿⣿⣿⡿⠏⠈⠙⠛⠿⠿⠿⠿⠛⠉ › Ask Codex to do anything ? for shortcuts[0 q [?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l/Users/user1/cr/rounds/x158fresh/repo permissions: YOLO modeShall we see where this goes?[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;repo[?2026h[?25h[?2026l[?2026h[?25lGPT-6-Astra default · /Users/user1/cr/rounds/x158fresh/repo←agens · ? for shortcuts[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠋ repo[?2026h[?25h[?2026l[?2026h[?25h[?2026l]0;⠙ repo[?2026h[?25h[?2026l]0;repo[?2026h[?25l⠈⢀⠁⠂⠄⠈⠁⠈⠁⠈⢀⠠⠄⠠⢀⠠⡀⠠⠁⢀⠁[?25h[?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0158-hooks-review-dialog.meta.json b/src/main/runtime/__fixtures__/codex-0158-hooks-review-dialog.meta.json new file mode 100644 index 000000000000..896d34744827 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-hooks-review-dialog.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-29T03:30:46.000Z", + "platform": "darwin", + "command": ["codex", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.158.0, plain launch on a fresh CODEX_HOME with a hooks.json of 8 command hooks that were never trusted. Over the provisional screen Codex paints `Hooks need review`, `1. Review hooks` / `2. Trust all and continue` / `3. Continue without trusting (hooks won't run)` and the key row `enter confirm · esc skip`, where older builds wrote `Press enter to confirm`. No key was sent (only automatic terminal-query replies). Cut 6 s after spawn. Home-directory user name redacted by hand, same length.", + "exitCode": null +} diff --git a/src/main/runtime/__fixtures__/codex-0158-hooks-review-dialog.txt b/src/main/runtime/__fixtures__/codex-0158-hooks-review-dialog.txt new file mode 100644 index 000000000000..ad25e6eda6ee --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-hooks-review-dialog.txt @@ -0,0 +1 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l>_ OpenAI Codex (v0.158.0)loadingBring your unfinished thoughts.⣀⣤⣤⣤⣀⣀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣤⣤⣤⣤⡀⢀⣾⣿⣿⠿⠋⠉⠉⢉⣭⣿⣿⣿⣿⣿⠿⣿⣿⣿⣿⣷⣄⣀⣾⣿⣿⠃⣀⣴⣾⣿⣿⡿⠟⠋⣀⡀⠈⠙⢿⣿⣿⣧⣀⣶⣿⣿⣿⣿⡇⢸⣿⣿⡿⠛⠉⢀⣠⣴⣿⣿⣿⣷⣦⣀⠈⢻⣿⣿⡇⣰⣿⣿⡿⢿⣿⣿⡇⢸⣿⣿⢀⣤⣶⣿⣿⣿⠟⠛⠻⣿⣿⣿⣿⣮⣿⣿⡷⢰⣿⣿⡟⠁⢸⣿⣿⡇⢸⣿⣿⣿⣿⠿⠿⣿⣿⣿⣦⣄⡀⠈⠛⠿⣿⣿⣿⣧⡀⣾⣿⣿⠃⢸⣿⣿⡇⢸⣿⣿⠋⠁⠈⠙⢻⣿⣿⣿⣶⣤⡀⠹⢿⣿⣷⡄⢸⣿⣿⣇⠸⣿⣿⣷⣦⣼⣿⣿⢸⣿⣿⠻⢿⣿⣿⡇⠘⣿⣿⣿⠈⢿⣿⣿⣦⡀⠈⠛⠿⣿⣿⣿⣿⣄⡀⢀⣠⣼⣿⣿⣿⣿⡇⣿⣿⣿⠇⢻⣿⣿⣿⣷⣦⣀⠈⠙⠻⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⣿⣿⡇⣠⣿⣿⣿⢸⣿⣿⡿⢿⣿⣿⣿⣦⣠⣴⣿⣿⣿⡿⠟⠋⢸⣿⣿⣿⣿⣷⣴⣿⣿⣿⠃⠘⣿⣿⣷⠈⠛⢿⣿⣿⣿⠿⠋⠉⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠻⣿⣿⣿⣤⣀⠈⠉⢀⣤⣶⣿⣿⣿⠿⠟⠁⣰⣿⣿⡟⠋⠁⠈⠿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⠟⠋⠁⣠⣼⣿⣿⡟⠙⠛⠛⠛⠻⠛⢿⣿⣿⣿⣿⣷⣾⣿⣿⣿⡿⠏⠈⠙⠛⠿⠿⠿⠿⠛⠉ › Ask Codex to do anything ? for shortcuts[0 q [?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l/Users/user1/cr/rounds/dlg-h58/repo permissions: YOLO modeBring your unfinished thoughts.[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l  Hooks need review 8 hooks are new or changed. Hooks can run outside the sandbox after you trust them.  › 1. Review hooks  2. Trust all and continue 3. Continue without trusting (hooks won't run) enter confirm · esc skip    [?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0158-model-announcement-dialog.meta.json b/src/main/runtime/__fixtures__/codex-0158-model-announcement-dialog.meta.json new file mode 100644 index 000000000000..05790b10e952 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-model-announcement-dialog.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-28T21:44:30.000Z", + "platform": "darwin", + "command": ["codex", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.158.0, plain launch on a fresh CODEX_HOME whose config.toml sets an older model with an available upgrade. After the provisional screen, Codex paints its model announcement (`Meet GPT-6 Sol`, `1. Try new model` / `2. Use existing model`, `enter/esc confirm`), which owns Enter. Cut 6 s after spawn. Home-directory user name redacted by hand, same length.", + "exitCode": null +} diff --git a/src/main/runtime/__fixtures__/codex-0158-model-announcement-dialog.txt b/src/main/runtime/__fixtures__/codex-0158-model-announcement-dialog.txt new file mode 100644 index 000000000000..a5c88157d749 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-model-announcement-dialog.txt @@ -0,0 +1 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l>_ OpenAI Codex (v0.158.0)loadingHere for a quick fix or the extended edition?⣀⣤⣤⣤⣀⣀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣤⣤⣤⣤⡀⢀⣾⣿⣿⠿⠋⠉⠉⢉⣭⣿⣿⣿⣿⣿⠿⣿⣿⣿⣿⣷⣄⣀⣾⣿⣿⠃⣀⣴⣾⣿⣿⡿⠟⠋⣀⡀⠈⠙⢿⣿⣿⣧⣀⣶⣿⣿⣿⣿⡇⢸⣿⣿⡿⠛⠉⢀⣠⣴⣿⣿⣿⣷⣦⣀⠈⢻⣿⣿⡇⣰⣿⣿⡿⢿⣿⣿⡇⢸⣿⣿⢀⣤⣶⣿⣿⣿⠟⠛⠻⣿⣿⣿⣿⣮⣿⣿⡷⢰⣿⣿⡟⠁⢸⣿⣿⡇⢸⣿⣿⣿⣿⠿⠿⣿⣿⣿⣦⣄⡀⠈⠛⠿⣿⣿⣿⣧⡀⣾⣿⣿⠃⢸⣿⣿⡇⢸⣿⣿⠋⠁⠈⠙⢻⣿⣿⣿⣶⣤⡀⠹⢿⣿⣷⡄⢸⣿⣿⣇⠸⣿⣿⣷⣦⣼⣿⣿⢸⣿⣿⠻⢿⣿⣿⡇⠘⣿⣿⣿⠈⢿⣿⣿⣦⡀⠈⠛⠿⣿⣿⣿⣿⣄⡀⢀⣠⣼⣿⣿⣿⣿⡇⣿⣿⣿⠇⢻⣿⣿⣿⣷⣦⣀⠈⠙⠻⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⣿⣿⡇⣠⣿⣿⣿⢸⣿⣿⡿⢿⣿⣿⣿⣦⣠⣴⣿⣿⣿⡿⠟⠋⢸⣿⣿⣿⣿⣷⣴⣿⣿⣿⠃⠘⣿⣿⣷⠈⠛⢿⣿⣿⣿⠿⠋⠉⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠻⣿⣿⣿⣤⣀⠈⠉⢀⣤⣶⣿⣿⣿⠿⠟⠁⣰⣿⣿⡟⠋⠁⠈⠿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⠟⠋⠁⣠⣼⣿⣿⡟⠙⠛⠛⠛⠻⠛⢿⣿⣿⣿⣿⣷⣾⣿⣿⣿⡿⠏⠈⠙⠛⠿⠿⠿⠿⠛⠉ › Ask Codex to do anything ? for shortcuts[0 q [?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l/Users/user1/cr/rounds/x158mig/repo permissions: YOLO modeHere for a quick fix or the extended edition?[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l  Meet GPT-6 Sol  Our latest Sol is more intelligent and more efficient so your usage limits go further. This model is a great daily driver for complex tasks, especially coding. › 1. Try new model  2. Use existing model  enter/esc confirm · ctrl+c quit    [?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0158-model-retired-dialog.meta.json b/src/main/runtime/__fixtures__/codex-0158-model-retired-dialog.meta.json new file mode 100644 index 000000000000..92137927416c --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-model-retired-dialog.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-29T03:31:56.000Z", + "platform": "darwin", + "command": ["codex", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.158.0, plain launch on a fresh CODEX_HOME whose config.toml sets model_provider = \"amazon-bedrock\" and model = \"openai.gpt-5.4\" (0.158 keeps the notice for a model missing from its catalog only on the OpenAI and Bedrock providers, and the OpenAI provider asks for a sign-in first, which the rig does not have). Codex shows the notice without choices: `GPT-5.4 on Amazon Bedrock is no longer offered in Codex`, `Switch to GPT-6 Sol on Amazon Bedrock to continue.` and the key row `enter/esc continue · ctrl+c quit`. Enter or Esc switches the model. No key was sent (only automatic terminal-query replies). Cut 6 s after spawn. Home-directory user name redacted by hand, same length.", + "exitCode": null +} diff --git a/src/main/runtime/__fixtures__/codex-0158-model-retired-dialog.txt b/src/main/runtime/__fixtures__/codex-0158-model-retired-dialog.txt new file mode 100644 index 000000000000..fd9fac82c431 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-model-retired-dialog.txt @@ -0,0 +1 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l>_ OpenAI Codex (v0.158.0)loadingBring a question. Bonus points if it’s a weird one.⣀⣤⣤⣤⣀⣀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣤⣤⣤⣤⡀⢀⣾⣿⣿⠿⠋⠉⠉⢉⣭⣿⣿⣿⣿⣿⠿⣿⣿⣿⣿⣷⣄⣀⣾⣿⣿⠃⣀⣴⣾⣿⣿⡿⠟⠋⣀⡀⠈⠙⢿⣿⣿⣧⣀⣶⣿⣿⣿⣿⡇⢸⣿⣿⡿⠛⠉⢀⣠⣴⣿⣿⣿⣷⣦⣀⠈⢻⣿⣿⡇⣰⣿⣿⡿⢿⣿⣿⡇⢸⣿⣿⢀⣤⣶⣿⣿⣿⠟⠛⠻⣿⣿⣿⣿⣮⣿⣿⡷⢰⣿⣿⡟⠁⢸⣿⣿⡇⢸⣿⣿⣿⣿⠿⠿⣿⣿⣿⣦⣄⡀⠈⠛⠿⣿⣿⣿⣧⡀⣾⣿⣿⠃⢸⣿⣿⡇⢸⣿⣿⠋⠁⠈⠙⢻⣿⣿⣿⣶⣤⡀⠹⢿⣿⣷⡄⢸⣿⣿⣇⠸⣿⣿⣷⣦⣼⣿⣿⢸⣿⣿⠻⢿⣿⣿⡇⠘⣿⣿⣿⠈⢿⣿⣿⣦⡀⠈⠛⠿⣿⣿⣿⣿⣄⡀⢀⣠⣼⣿⣿⣿⣿⡇⣿⣿⣿⠇⢻⣿⣿⣿⣷⣦⣀⠈⠙⠻⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⣿⣿⡇⣠⣿⣿⣿⢸⣿⣿⡿⢿⣿⣿⣿⣦⣠⣴⣿⣿⣿⡿⠟⠋⢸⣿⣿⣿⣿⣷⣴⣿⣿⣿⠃⠘⣿⣿⣷⠈⠛⢿⣿⣿⣿⠿⠋⠉⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠻⣿⣿⣿⣤⣀⠈⠉⢀⣤⣶⣿⣿⣿⠿⠟⠁⣰⣿⣿⡟⠋⠁⠈⠿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⠟⠋⠁⣠⣼⣿⣿⡟⠙⠛⠛⠛⠻⠛⢿⣿⣿⣿⣿⣷⣾⣿⣿⣿⡿⠏⠈⠙⠛⠿⠿⠿⠿⠛⠉ › Ask Codex to do anything ? for shortcuts[0 q [?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l/Users/user1/cr/rounds/dlg-m58b/repo permissions: YOLO modeBring a question. Bonus points if it’s a weird one.[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l  GPT-5.4 on Amazon Bedrock is no longer offered in Codex  Codex now uses GPT-6 Sol on Amazon Bedrock in place of GPT-5.4 on Amazon Bedrock. Switch to GPT-6 Sol on Amazon Bedrock to continue. enter/esc continue · ctrl+c quit    [?2026l \ No newline at end of file diff --git a/src/main/runtime/__fixtures__/codex-0158-update-available-dialog.meta.json b/src/main/runtime/__fixtures__/codex-0158-update-available-dialog.meta.json new file mode 100644 index 000000000000..db18029d3085 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-update-available-dialog.meta.json @@ -0,0 +1,9 @@ +{ + "capturedAt": "2026-09-29T03:30:10.000Z", + "platform": "darwin", + "command": ["codex", "--dangerously-bypass-approvals-and-sandbox"], + "cols": 120, + "rows": 40, + "note": "codex-cli 0.158.0, plain launch on a fresh CODEX_HOME whose config.toml sets check_for_update_on_startup = true, with a version.json cache naming 0.159.0 checked moments earlier (so no network check) and CODEX_MANAGED_BY_NPM=1 so Codex offers an update command. Over the provisional screen Codex paints `Update available · 0.158.0 → 0.159.0`, `1. Update now (runs `npm install -g @openai/codex`)` / `2. Skip` / `3. Skip until next version` and the key row `enter continue · esc skip`, where older builds wrote `Press enter to continue`. Enter picks Update now. No key was sent (only automatic terminal-query replies). Cut 6 s after spawn. Home-directory user name redacted by hand, same length.", + "exitCode": null +} diff --git a/src/main/runtime/__fixtures__/codex-0158-update-available-dialog.txt b/src/main/runtime/__fixtures__/codex-0158-update-available-dialog.txt new file mode 100644 index 000000000000..2c92e766ae26 --- /dev/null +++ b/src/main/runtime/__fixtures__/codex-0158-update-available-dialog.txt @@ -0,0 +1 @@ +[?2004h[>4;0m[>7u[?1004h]10;?\]11;?\[?u[?2026h[?25l[?1049h[>4;0m[>7u[?1007l[?1000h[?1002h[?1006h[?1003h[?25l[?2026h[?25l>_ OpenAI Codex (v0.158.0)loadingHere for a quick fix or the extended edition?⣀⣤⣤⣤⣀⣀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣦⣤⣤⣤⣤⣤⣤⡀⢀⣾⣿⣿⠿⠋⠉⠉⢉⣭⣿⣿⣿⣿⣿⠿⣿⣿⣿⣿⣷⣄⣀⣾⣿⣿⠃⣀⣴⣾⣿⣿⡿⠟⠋⣀⡀⠈⠙⢿⣿⣿⣧⣀⣶⣿⣿⣿⣿⡇⢸⣿⣿⡿⠛⠉⢀⣠⣴⣿⣿⣿⣷⣦⣀⠈⢻⣿⣿⡇⣰⣿⣿⡿⢿⣿⣿⡇⢸⣿⣿⢀⣤⣶⣿⣿⣿⠟⠛⠻⣿⣿⣿⣿⣮⣿⣿⡷⢰⣿⣿⡟⠁⢸⣿⣿⡇⢸⣿⣿⣿⣿⠿⠿⣿⣿⣿⣦⣄⡀⠈⠛⠿⣿⣿⣿⣧⡀⣾⣿⣿⠃⢸⣿⣿⡇⢸⣿⣿⠋⠁⠈⠙⢻⣿⣿⣿⣶⣤⡀⠹⢿⣿⣷⡄⢸⣿⣿⣇⠸⣿⣿⣷⣦⣼⣿⣿⢸⣿⣿⠻⢿⣿⣿⡇⠘⣿⣿⣿⠈⢿⣿⣿⣦⡀⠈⠛⠿⣿⣿⣿⣿⣄⡀⢀⣠⣼⣿⣿⣿⣿⡇⣿⣿⣿⠇⢻⣿⣿⣿⣷⣦⣀⠈⠙⠻⣿⣿⣿⣶⣶⣿⣿⣿⣿⣿⣿⣿⡇⣠⣿⣿⣿⢸⣿⣿⡿⢿⣿⣿⣿⣦⣠⣴⣿⣿⣿⡿⠟⠋⢸⣿⣿⣿⣿⣷⣴⣿⣿⣿⠃⠘⣿⣿⣷⠈⠛⢿⣿⣿⣿⠿⠋⠉⣠⣴⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠻⣿⣿⣿⣤⣀⠈⠉⢀⣤⣶⣿⣿⣿⠿⠟⠁⣰⣿⣿⡟⠋⠁⠈⠿⣿⣿⣿⣿⣶⣾⣿⣿⣿⣿⠟⠋⠁⣠⣼⣿⣿⡟⠙⠛⠛⠛⠻⠛⢿⣿⣿⣿⣿⣷⣾⣿⣿⣿⡿⠏⠈⠙⠛⠿⠿⠿⠿⠛⠉ › Ask Codex to do anything ? for shortcuts[0 q [?25h[?2026l[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l/Users/user1/cr/rounds/dlg-u58/repo permissions: YOLO modeHere for a quick fix or the extended edition?[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25h[?2026l[?2026h[?25l  Update available · 0.158.0 → 0.159.0 Release notes: ]8;;https://github.com/openai/codex/releases/latesthttps://github.com/openai/codex/releases/latest]8;; › 1. Update now (runs `npm install -g @openai/codex`)  2. Skip 3. Skip until next version  enter continue · esc skip    [?2026l \ No newline at end of file diff --git a/src/main/runtime/codex-header-readiness-transcripts.test.ts b/src/main/runtime/codex-header-readiness-transcripts.test.ts index 0cfcf548017f..ea8dc03cef2c 100644 --- a/src/main/runtime/codex-header-readiness-transcripts.test.ts +++ b/src/main/runtime/codex-header-readiness-transcripts.test.ts @@ -5,7 +5,11 @@ import { replayTranscript, type TranscriptReplayFrame } from './agent-transcript-replay-test-harness' -import { isKnownReadyPromptBody, isKnownReadyPromptPreview } from './terminal-wait-detection' +import { + isKnownReadyPromptBody, + isKnownReadyPromptPreview, + isKnownReadyPromptSettled +} from './terminal-wait-detection' vi.mock('electron', () => ({ BrowserWindow: { fromId: vi.fn(() => null) }, @@ -19,7 +23,9 @@ const PLAIN = 'codex-0157-plain-ready' const EFFORT_OVERRIDE = 'codex-0157-effort-override-embedded-warning' const CONFIG_OVERRIDE = 'codex-0157-config-override-embedded-warning' const NO_DAEMON = 'codex-0157-no-daemon-effort-override' -const ALL_FIXTURES = [PLAIN, EFFORT_OVERRIDE, CONFIG_OVERRIDE, NO_DAEMON] +// Fresh CODEX_HOME: the provisional header stays up while Codex installs and starts its daemon. +const FRESH_HOME = 'codex-0157-fresh-home-daemon-install' +const ALL_FIXTURES = [PLAIN, EFFORT_OVERRIDE, CONFIG_OVERRIDE, NO_DAEMON, FRESH_HOME] async function finalFrame( name: string, @@ -41,6 +47,16 @@ function screenShowsLoadingHeader(screenLines: string[]): boolean { return screen.includes('openai codex') && /(?:model|directory):\s+loading/.test(screen) } +// Codex's default status row opens with ` ·`; only the live chat paints it. +const LIVE_STATUS_ROW_RE = /\b(?:default|minimal|low|medium|high|xhigh) ·/ + +function screenShowsProvisionalStartup(screenLines: string[]): boolean { + return ( + screenShowsLoadingHeader(screenLines) && + !screenLines.some((line) => LIVE_STATUS_ROW_RE.test(line.toLowerCase())) + ) +} + describe('Codex 0.157 header readiness from captured bytes', () => { it.each([EFFORT_OVERRIDE, CONFIG_OVERRIDE])( '%s: the line-folded wait text never shows a ready header', @@ -71,6 +87,26 @@ describe('Codex 0.157 header readiness from captured bytes', () => { } ) + // Why: 0.157 discards input typed during its daemon start, behind the provisional header. + it.each(ALL_FIXTURES)( + '%s: never ready while the screen shows the provisional `model: loading` startup screen', + async (name) => { + let sawTextOnlyReadiness = false + for await (const frame of replayTranscript(readRuntimeFixture(name), 120, 40)) { + if (screenShowsProvisionalStartup(frame.screenLines)) { + sawTextOnlyReadiness ||= isKnownReadyPromptPreview(frame.waitText) + expect(isKnownReadyPromptBody(frame.waitText, 'codex', () => frame.screenLines)).toBe( + false + ) + } + } + // Presence precondition for the text-copy fixtures: the text rules alone would say ready here. + if (name === PLAIN || name === FRESH_HOME) { + expect(sawTextOnlyReadiness).toBe(true) + } + } + ) + // Why these sizes: grids out of step with the 120x40 recording garble the header (review of #23475). describe.each([ [120, 40], @@ -78,15 +114,21 @@ describe('Codex 0.157 header readiness from captured bytes', () => { [30, 50], [108, 30], [60, 5] - ])('at %ix%i the screen never takes readiness away from the text rules', (cols, rows) => { + ])('at %ix%i the screen never takes a settled header away from the text rules', (cols, rows) => { it.each(ALL_FIXTURES)('%s', async (name) => { + let settledFrames = 0 for await (const frame of replayTranscript(readRuntimeFixture(name), cols, rows)) { - if (isKnownReadyPromptPreview(frame.waitText)) { + if (isKnownReadyPromptSettled(frame.waitText)) { + settledFrames += 1 expect(isKnownReadyPromptBody(frame.waitText, 'codex', () => frame.screenLines)).toBe( true ) } } + // Presence precondition: the text-copy fixtures reach a settled header. + if (name === PLAIN || name === FRESH_HOME || name === NO_DAEMON) { + expect(settledFrames).toBeGreaterThan(0) + } }) }) @@ -175,6 +217,58 @@ describe('Codex 0.157 header readiness from captured bytes', () => { 15_000 ) + it('does not settle while Codex is still installing its daemon behind the provisional screen', async () => { + const data = readRuntimeFixture(FRESH_HOME) + const install = data.indexOf('Installing daemon') + // Presence precondition: the cut keeps the provisional header and stops before the live chat. + expect(install).toBeGreaterThan(0) + const provisional = data.slice(0, data.indexOf('\n', install) + 1) + expect(provisional).toMatch(/model:.*loading/) + const { runtime, handle } = await createTranscriptPane({ + paneTitle: 'Terminal', + foregroundProcess: 'codex', + launchAgent: 'codex', + data: provisional, + size: { cols: 120, rows: 40 } + }) + await expect( + runtime.waitForTerminal(handle, { condition: 'tui-idle', timeoutMs: 2_500 }) + ).rejects.toThrow(/timeout/) + }, 15_000) + + // Why no bytes: worker-start waits on a pane that has printed nothing yet, which is when the + // runtime asks for a visible-screen read instead of its own text copy. + it('does not settle from a visible-screen read of the provisional screen', async () => { + const { runtime, handle } = await createTranscriptPane({ + paneTitle: 'Terminal', + foregroundProcess: 'codex', + launchAgent: 'codex', + data: '', + size: { cols: 120, rows: 40 } + }) + const readVisibleScreen = vi.spyOn(runtime, 'readTerminal').mockResolvedValue({ + handle, + status: 'running', + tail: [ + '╭──────────────────────────────────────────╮', + '│ >_ OpenAI Codex (v0.157.0) │', + '│ model: loading /model to change │', + '│ directory: ~/repo/app │', + '╰──────────────────────────────────────────╯', + '› Ask Codex to do anything', + ' ? for shortcuts' + ], + truncated: false, + nextCursor: null, + source: 'screen' + }) + await expect( + runtime.waitForTerminal(handle, { condition: 'tui-idle', timeoutMs: 2_500 }) + ).rejects.toThrow(/timeout/) + // Presence precondition: the visible-screen probe actually ran. + expect(readVisibleScreen).toHaveBeenCalled() + }, 15_000) + it('keeps timing out on the garbled 80x24 default grid, as before', async () => { const { runtime, handle } = await codexPane(EFFORT_OVERRIDE) await expect( diff --git a/src/main/runtime/codex-startup-dialog-transcripts.test.ts b/src/main/runtime/codex-startup-dialog-transcripts.test.ts new file mode 100644 index 000000000000..01dbe447304d --- /dev/null +++ b/src/main/runtime/codex-startup-dialog-transcripts.test.ts @@ -0,0 +1,198 @@ +import { describe, expect, it, vi } from 'vitest' +import type { RuntimeTerminalWaitBlockedReason } from '../../shared/runtime-types' +import { createTranscriptPane } from './agent-transcript-pane-test-harness' +import { + readRuntimeFixture, + replayTranscript, + type TranscriptReplayFrame +} from './agent-transcript-replay-test-harness' +import { detectTerminalWaitBlockedReason, isKnownReadyPromptBody } from './terminal-wait-detection' + +vi.mock('electron', () => ({ + BrowserWindow: { fromId: vi.fn(() => null) }, + webContents: { fromId: vi.fn(() => null) }, + ipcMain: { on: vi.fn(), removeListener: vi.fn() }, + app: { getPath: vi.fn(() => '/tmp') } +})) + +type StartupDialog = { + name: string + reason: RuntimeTerminalWaitBlockedReason + heading: string + keyRow: string +} + +// codex-cli 0.157.0 / 0.158.0 recordings at 120x40 on a fresh CODEX_HOME (see each .meta.json). +// Each dialog owns Enter, and none prints the `Press enter to …` wording older builds did. +const DIALOGS: StartupDialog[] = [ + { + // Recorded separately on 0.157.1 (STA-8834). + name: 'codex-0-157-1-update-dialog', + reason: 'agent-update-prompt', + heading: 'Update available ·', + keyRow: 'enter continue · esc skip' + }, + { + name: 'codex-0157-update-available-dialog', + reason: 'agent-update-prompt', + heading: 'Update available ·', + keyRow: 'enter continue · esc skip' + }, + { + name: 'codex-0158-update-available-dialog', + reason: 'agent-update-prompt', + heading: 'Update available ·', + keyRow: 'enter continue · esc skip' + }, + { + name: 'codex-0157-hooks-review-dialog', + reason: 'agent-hooks-review-prompt', + heading: 'Hooks need review', + keyRow: 'enter confirm · esc skip' + }, + { + name: 'codex-0158-hooks-review-dialog', + reason: 'agent-hooks-review-prompt', + heading: 'Hooks need review', + keyRow: 'enter confirm · esc skip' + }, + { + name: 'codex-0157-model-retired-dialog', + reason: 'codex-model-migration-prompt', + heading: 'is no longer available', + keyRow: 'enter/esc continue · ctrl+c quit' + }, + { + name: 'codex-0158-model-retired-dialog', + reason: 'codex-model-migration-prompt', + heading: 'is no longer offered', + keyRow: 'enter/esc continue · ctrl+c quit' + }, + { + name: 'codex-0158-model-announcement-dialog', + reason: 'codex-model-migration-prompt', + heading: 'Try new model', + keyRow: 'enter/esc confirm · ctrl+c quit' + } +] +const DIALOGS_0158 = DIALOGS.filter((dialog) => dialog.name.startsWith('codex-0158-')) +const LIVE_CHAT_FIXTURES = [ + 'codex-0157-plain-ready', + 'codex-0157-effort-override-embedded-warning', + 'codex-0157-config-override-embedded-warning', + 'codex-0157-no-daemon-effort-override', + 'codex-0157-fresh-home-daemon-install', + 'codex-0158-fresh-home-greeting' +] + +function screenText(frame: TranscriptReplayFrame): string { + return frame.screenLines.join('\n') +} + +async function lastFrame(data: string): Promise { + let last: TranscriptReplayFrame | null = null + for await (const frame of replayTranscript(data, 120, 40)) { + last = frame + } + return last +} + +// Why stitched: no capture spans answering a dialog. Codex repaints every cell once a startup +// dialog closes, so the 0.158 greeting capture's paints stand in for that repaint. +function answered(name: string): string { + const greeting = readRuntimeFixture('codex-0158-fresh-home-greeting') + return readRuntimeFixture(name) + greeting.slice(greeting.indexOf('\x1b[?2026h')) +} + +describe('Codex 0.157/0.158 startup dialogs from captured bytes', () => { + it.each(DIALOGS)( + '$name: reports $reason from its key row on, and never reads ready while it is up', + async ({ name, reason, heading, keyRow }) => { + let headingFrames = 0 + let keyRowFrames = 0 + for await (const frame of replayTranscript(readRuntimeFixture(name), 120, 40)) { + const screen = screenText(frame) + if (screen.includes(heading)) { + headingFrames += 1 + expect(isKnownReadyPromptBody(frame.waitText, 'codex', () => frame.screenLines)).toBe( + false + ) + } + if (keyRowFrames > 0 || screen.includes(keyRow)) { + keyRowFrames += 1 + expect(detectTerminalWaitBlockedReason(frame.waitText)).toBe(reason) + } + } + // Presence precondition: the dialog and its key row were painted, not just parsed. + expect(headingFrames).toBeGreaterThan(0) + expect(keyRowFrames).toBeGreaterThan(0) + } + ) + + it.each(DIALOGS_0158)( + '$name: stops reporting once Codex repaints its chat after it', + async ({ name, heading }) => { + const last = await lastFrame(answered(name)) + // Presence precondition: the answered dialog is still in the text copy. + expect(last?.waitText).toContain(heading.replace(' ·', '')) + expect(detectTerminalWaitBlockedReason(last?.waitText ?? '')).toBeNull() + } + ) + + it.each(DIALOGS)( + '$name: still reports $reason when Codex is relaunched in the same pane and shows it again', + async ({ name, reason }) => { + // Why: quitting Codex from a dialog leaves that copy in the text copy ahead of the relaunch. + const dialog = readRuntimeFixture(name) + const last = await lastFrame(`${dialog}\x1b[?1049l\r\n% codex\r\n${dialog}`) + expect(detectTerminalWaitBlockedReason(last?.waitText ?? '')).toBe(reason) + expect( + isKnownReadyPromptBody(last?.waitText ?? '', 'codex', () => last?.screenLines ?? null) + ).toBe(false) + } + ) + + it.each(LIVE_CHAT_FIXTURES)('%s: a live chat reports no dialog', async (name) => { + const waitText = (await lastFrame(readRuntimeFixture(name)))?.waitText ?? '' + expect(detectTerminalWaitBlockedReason(waitText)).toBeNull() + // Why these lines: chat can name a dialog, and Codex's own update notice and footer draw `·`. + const chat = [ + '› is there an update available, and do my hooks need review?', + '✨ Update available! 0.158.0 -> 0.159.0', + 'Run npm install -g @openai/codex to update.', + ' gpt-6-astra default · ~/repo', + ' ← for agents · ? for shortcuts' + ].join('\n') + expect(detectTerminalWaitBlockedReason(`${waitText}\n${chat}`)).toBeNull() + }) + + it('does not name a mid-session Codex popup a hooks review', () => { + // Why: Codex's rate-limit reset popup (and other pickers) ends `enter confirm · esc back`. + const popup = [ + ' Use this reset?', + ' 1. Yes, use reset Reset your weekly and 5-hour usage limits.', + '› 2. No, go back Choose a different reset', + ' enter confirm · esc back' + ].join('\n') + expect(detectTerminalWaitBlockedReason(popup)).not.toBe('agent-hooks-review-prompt') + }) + + describe('through the runtime', () => { + it.each(DIALOGS)( + '$name: stops a tui-idle wait as $reason instead of typing into it', + async ({ name, reason }) => { + const { runtime, handle } = await createTranscriptPane({ + paneTitle: 'Terminal', + foregroundProcess: 'codex', + launchAgent: 'codex', + data: readRuntimeFixture(name), + size: { cols: 120, rows: 40 } + }) + await expect( + runtime.waitForTerminal(handle, { condition: 'tui-idle', timeoutMs: 2_500 }) + ).resolves.toMatchObject({ satisfied: false, blockedReason: reason }) + }, + 15_000 + ) + }) +}) diff --git a/src/main/runtime/codex-terminal-readiness.ts b/src/main/runtime/codex-terminal-readiness.ts index 3b15c3359dfc..cdbc8903d212 100644 --- a/src/main/runtime/codex-terminal-readiness.ts +++ b/src/main/runtime/codex-terminal-readiness.ts @@ -34,6 +34,27 @@ export function findCodexScreenReadyPromptIndex(screen: string): number | null { : null } +// Why the text copy: 0.157 leaves its alternate screen while it starts its daemon, so the live +// screen shows no header then, while the text copy keeps the provisional one until the live chat +// paints its footer after it (a later model repaint rewrites only the value, never the label). +// Why `·`: every live footer row draws one (status row, `← for agents · ?`, `⚠ N warning · f2`); +// startup dialogs draw one too, which is why startup-dialog-blocked-signals.ts matches them first. +export function isCodexProvisionalStartupText(normalized: string): boolean { + const headerIndex = normalized.lastIndexOf('openai codex') + if (headerIndex === -1) { + return false + } + const loading = /model:\s+loading/.exec(normalized.slice(headerIndex)) + return loading !== null && !normalized.includes('·', headerIndex + loading.index) +} + +// Why: Codex repaints its whole screen, header included, once a startup dialog closes, and the +// dialog never draws the header; 0.158's header has no labels, so the header alone marks it answered. +export function findCodexHeaderIndex(normalized: string): number | null { + const index = normalized.lastIndexOf('openai codex (v') + return index === -1 ? null : index +} + /** * Tier 1b, codex panes only: the empty composer with no busy status row just above it and no * header load. Codex 0.158 dropped `model:`/`directory:`, and a long session scrolls the header diff --git a/src/main/runtime/orca-runtime-start-tui-idle-visible-read-probe.ts b/src/main/runtime/orca-runtime-start-tui-idle-visible-read-probe.ts index bb03b17eca3c..4d70572eb2a3 100644 --- a/src/main/runtime/orca-runtime-start-tui-idle-visible-read-probe.ts +++ b/src/main/runtime/orca-runtime-start-tui-idle-visible-read-probe.ts @@ -11,7 +11,7 @@ import { import { withTimeout } from './runtime-async-boundaries' import { detectTerminalWaitBlockedReason, - isKnownReadyPromptPreview + isKnownReadyPromptSettled } from './terminal-wait-detection' import type { RuntimeTerminalWait, @@ -80,7 +80,7 @@ export class OrcaRuntimeWithStartTuiIdleVisibleReadProbe extends OrcaRuntimeWith const ready = agent === 'antigravity' ? isAntigravityReadyPromptSnapshot(snapshotText) - : isKnownReadyPromptPreview(snapshotText) + : isKnownReadyPromptSettled(snapshotText) if (!blockedReason && !ready) { return } diff --git a/src/main/runtime/startup-dialog-blocked-signals.ts b/src/main/runtime/startup-dialog-blocked-signals.ts new file mode 100644 index 000000000000..e964205a9ccc --- /dev/null +++ b/src/main/runtime/startup-dialog-blocked-signals.ts @@ -0,0 +1,76 @@ +import type { RuntimeTerminalWaitBlockedReason } from '../../shared/runtime-types' + +// Why rows, from each dialog's first `·` on: codex-terminal-readiness.ts takes a `·` after the +// startup header for the live chat's footer, so each dialog must be matched by the time that `·` +// lands. Why not headings: Codex 0.157+ paints them by cell diff over its startup screen, so the +// text copy can lose letters and spaces (`updat available`); these rows are fixed literals. +// Update: `Update available · 0.157.1 → 0.158.0`, then `enter continue · esc skip`. +const CODEX_UPDATE_ROW_RE = /available\s*·\s*\d+\.\d+|enter\s*continue\s*·\s*esc\s*skip/g +// Why not `esc back`: Codex's mid-session pickers end `enter confirm · esc back`. +const CODEX_HOOKS_REVIEW_KEY_ROW_RE = /enter\s*confirm\s*·(?!\s*esc\s*back)/g +// Why both verbs: the retired-model notice says `continue`, the new-model announcement `confirm`. +const CODEX_MODEL_MIGRATION_KEY_ROW_RE = /enter\/esc\s*(?:continue|confirm)\s*·/g + +function lastMatchIndex(text: string, row: RegExp): number { + let index = -1 + for (const match of text.matchAll(row)) { + index = match.index + } + return index +} + +// Why the last match, and the legacy wording too: an answered dialog stays in the text copy, and +// builds before 0.157 wrote `Press enter to continue/confirm`. +function findDialogIndex( + normalized: string, + legacyHeading: string, + legacyKeys: string, + row: RegExp +): number { + const rowIndex = lastMatchIndex(normalized, row) + const headingIndex = normalized.lastIndexOf(legacyHeading) + const legacyIndex = + headingIndex !== -1 && normalized.includes(legacyKeys, headingIndex) ? headingIndex : -1 + return Math.max(rowIndex, legacyIndex) +} + +// Why together: each startup dialog owns Enter before the chat exists, so a brief typed into one +// answers it (Codex's update dialog defaults to `Update now`). +export function findStartupDialogBlockedSignals( + normalized: string +): { reason: RuntimeTerminalWaitBlockedReason; index: number }[] { + const candidates: { reason: RuntimeTerminalWaitBlockedReason; index: number }[] = [] + const updateIndex = findDialogIndex( + normalized, + 'update available', + 'press enter to continue', + CODEX_UPDATE_ROW_RE + ) + if (updateIndex !== -1) { + candidates.push({ reason: 'agent-update-prompt', index: updateIndex }) + } + const cwdIndex = normalized.lastIndexOf('choose working directory to') + if (cwdIndex !== -1 && normalized.includes('press enter to continue', cwdIndex)) { + candidates.push({ reason: 'agent-cwd-prompt', index: cwdIndex }) + } + const modelMigrationIndex = findDialogIndex( + normalized, + 'codex just got an upgrade', + 'press enter to continue', + CODEX_MODEL_MIGRATION_KEY_ROW_RE + ) + if (modelMigrationIndex !== -1) { + candidates.push({ reason: 'codex-model-migration-prompt', index: modelMigrationIndex }) + } + const hooksIndex = findDialogIndex( + normalized, + 'hooks need review', + 'press enter to confirm', + CODEX_HOOKS_REVIEW_KEY_ROW_RE + ) + if (hooksIndex !== -1) { + // Why neutral: this matcher never inspects the agent -- 'hooks need review' is not Codex-only wording. + candidates.push({ reason: 'agent-hooks-review-prompt', index: hooksIndex }) + } + return candidates +} diff --git a/src/main/runtime/terminal-wait-detection.ts b/src/main/runtime/terminal-wait-detection.ts index 1540eef2d5f0..2618a50279c3 100644 --- a/src/main/runtime/terminal-wait-detection.ts +++ b/src/main/runtime/terminal-wait-detection.ts @@ -9,9 +9,12 @@ import type { RuntimeTerminalWaitBlockedReason } from '../../shared/runtime-type import type { TuiAgent } from '../../shared/tui-agent' import { findAntigravityReadyPromptIndex } from './antigravity-terminal-readiness' import { + findCodexHeaderIndex, findCodexScreenReadyPromptIndex, - isCodexComposerReadyScreen + isCodexComposerReadyScreen, + isCodexProvisionalStartupText } from './codex-terminal-readiness' +import { findStartupDialogBlockedSignals } from './startup-dialog-blocked-signals' import { startOfLastLines, startOfLastNonBlankLines } from './terminal-wait-tail-window' const EXPLICIT_IDLE_TITLE_RE = /(^|\s)(ready|idle|done)(\s|$|[.!?])/i @@ -52,6 +55,19 @@ export function isKnownReadyPromptPreview(preview: string): boolean { return isReadyPromptUnblocked(normalized, findKnownReadyPromptIndex(normalized)) } +/** + * The ready-prompt text rules for a pane about to take input. Unlike isKnownReadyPromptPreview + * (agent presence), Codex's provisional startup header does not count: 0.157 discards input typed + * behind it while its daemon starts. + */ +export function isKnownReadyPromptSettled(preview: string): boolean { + const normalized = preview.toLowerCase() + return ( + isReadyPromptUnblocked(normalized, findKnownReadyPromptIndex(normalized)) && + !isCodexProvisionalStartupText(normalized) + ) +} + /** * Tier 1 body evidence for every tui-idle site. `readScreenLines` yields the live emulator's * visible grid, or null when the runtime has no trustworthy one. @@ -69,7 +85,7 @@ export function isKnownReadyPromptBody( if (agent === 'qoder') { return isQoderComposerReady(readScreenLines()) } - if (isKnownReadyPromptPreview(waitText)) { + if (isKnownReadyPromptSettled(waitText)) { return true } // Why the agent gate: another agent's screen can merely mention "OpenAI Codex". @@ -139,6 +155,7 @@ export function findActionableTerminalWaitBlockedSignal( function findDismissedStartupModalIndex(normalized: string): number | null { const indexes = [ findCodexReadyPromptIndex(normalized), + findCodexHeaderIndex(normalized), findAntigravityReadyPromptIndex(normalized), findCursorActivePromptIndex(normalized), findMuseReadyPromptIndex(normalized) @@ -199,7 +216,7 @@ function findCodexReadyPromptIndex(normalized: string): number | null { } export const TERMINAL_WAIT_BLOCKED_SENTINEL_RE = - /update available|choose working directory to|codex just got an upgrade|hooks need review|do you trust|trust this|trusted workspace|press enter to (?:confirm|continue|view|insert)|press t to trust|permission required|requires permission|allow once|allow always|run this command\?/i + /update available|choose working directory to|codex just got an upgrade|available\s*·|esc\s*skip|enter\s*confirm\s*·|enter\/esc\s*(?:continue|confirm)|hooks need review|do you trust|trust this|trusted workspace|press enter to (?:confirm|continue|view|insert)|press t to trust|permission required|requires permission|allow once|allow always|run this command\?/i // Why text at all: cursor-agent has no approval hook, so the key-bound menu is the only authority. const CURSOR_APPROVAL_CHOICE_MARKERS = [ @@ -268,27 +285,7 @@ function findTerminalWaitBlockedSignal( function findBlockedSignalInLiveWindow( normalized: string ): { reason: RuntimeTerminalWaitBlockedReason; index: number } | null { - const candidates: { reason: RuntimeTerminalWaitBlockedReason; index: number }[] = [] - const updateIndex = normalized.lastIndexOf('update available') - if (updateIndex !== -1 && normalized.includes('press enter to continue', updateIndex)) { - candidates.push({ reason: 'agent-update-prompt', index: updateIndex }) - } - const cwdIndex = normalized.lastIndexOf('choose working directory to') - if (cwdIndex !== -1 && normalized.includes('press enter to continue', cwdIndex)) { - candidates.push({ reason: 'agent-cwd-prompt', index: cwdIndex }) - } - const modelMigrationIndex = normalized.lastIndexOf('codex just got an upgrade') - if ( - modelMigrationIndex !== -1 && - normalized.includes('press enter to continue', modelMigrationIndex) - ) { - candidates.push({ reason: 'codex-model-migration-prompt', index: modelMigrationIndex }) - } - const hooksIndex = normalized.lastIndexOf('hooks need review') - if (hooksIndex !== -1 && normalized.includes('press enter to confirm', hooksIndex)) { - // Why neutral: this matcher never inspects the agent -- 'hooks need review' is not Codex-only wording. - candidates.push({ reason: 'agent-hooks-review-prompt', index: hooksIndex }) - } + const candidates = findStartupDialogBlockedSignals(normalized) const trustIndex = Math.max( normalized.lastIndexOf('do you trust'), normalized.lastIndexOf('trust this'), From e1362ada4c33e7ef14709dff56564ea5dbcf5d98 Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Tue, 29 Sep 2026 01:20:37 -0700 Subject: [PATCH 86/90] fix(terminal): stop inline-image decoders exhausting the renderer's wasm memory budget (#23499) V8 reserves an 8 GiB guard region per wasm memory inside its 1 TiB sandbox, so an Electron renderer can hold only ~124 live wasm memories regardless of free RAM. @xterm/addon-image instantiated a SIXEL decoder per terminal at activation (and kept IIP decoders after the first image), so ~120+ terminals exhausted the budget: new panes raised 'WebAssembly.instantiate(): Out of memory' rejections, and the next Kitty/IIP image threw 'WebAssembly.Memory(): could not allocate memory' out of the parser, permanently wedging that terminal's write queue. The addon-image source patch now borrows SIXEL decoders from a shared pool only while a sequence is open (color registers stay on the terminal), drops IIP decoders after each image, and turns a failed decoder allocation into a dropped image instead of a parser throw. Bundles regenerated with regenerate-xterm-patches.mjs --write. Co-authored-by: m4air --- .../@xterm__addon-image@0.10.0-beta.300.patch | 279 ++++++++++++++++-- ...erm__addon-image@0.10.0-beta.300.src.patch | 259 +++++++++++++++- .../xterm-image-wasm-budget-contract.test.mjs | 160 ++++++++++ docs/reference/xterm-patch-regeneration.md | 9 + pnpm-lock.yaml | 6 +- 5 files changed, 676 insertions(+), 37 deletions(-) create mode 100644 config/scripts/xterm-image-wasm-budget-contract.test.mjs diff --git a/config/patches/@xterm__addon-image@0.10.0-beta.300.patch b/config/patches/@xterm__addon-image@0.10.0-beta.300.patch index c44cb33d2d50..44d6ac32c148 100644 --- a/config/patches/@xterm__addon-image@0.10.0-beta.300.patch +++ b/config/patches/@xterm__addon-image@0.10.0-beta.300.patch @@ -1,24 +1,24 @@ diff --git a/lib/addon-image.js b/lib/addon-image.js -index 38cf9e8708a5f314b8d587e5428ce7facb0d4076..4807d674d75a5aeaba40cf86972ce0a6158a33f4 100644 +index 38cf9e8708a5f314b8d587e5428ce7facb0d4076..4c5f44e00b0972978d762df5990de86002537649 100644 --- a/lib/addon-image.js +++ b/lib/addon-image.js @@ -1,3 +1,3 @@ /*! For license information please see addon-image.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ImageAddon=t():e.ImageAddon=t()}(globalThis,()=>(()=>{"use strict";var e={939(e,t){function A(e){return 255&e}function i(e){return e>>>8&255}function s(e){return e>>>16&255}function r(e,t,A,i=255){return((255&i)<<24|(255&A)<<16|(255&t)<<8|255&e)>>>0}function o(e,t,A){return Math.max(e,Math.min(A,t))}function a(e,t,A){return A<0&&(A+=1),A>1&&(A-=1),6*A<1?t+6*(e-t)*A:2*A<1?e:3*A<2?t+(e-t)*(4-6*A):t}function n(e,t,A){return(4278190080|Math.round(A/100*255)<<16|Math.round(t/100*255)<<8|Math.round(e/100*255))>>>0}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FOREGROUND=t.DEFAULT_BACKGROUND=t.PALETTE_ANSI_256=t.PALETTE_VT340_GREY=t.PALETTE_VT340_COLOR=t.normalizeHLS=t.normalizeRGB=t.nearestColorIndex=t.fromRGBA8888=t.toRGBA8888=t.alpha=t.blue=t.green=t.red=t.BIG_ENDIAN=void 0,t.BIG_ENDIAN=255===new Uint8Array(new Uint32Array([4278190080]).buffer)[0],t.BIG_ENDIAN&&console.warn("BE platform detected. This version of node-sixel works only on LE properly."),t.red=A,t.green=i,t.blue=s,t.alpha=function(e){return e>>>24&255},t.toRGBA8888=r,t.fromRGBA8888=function(e){return[255&e,e>>8&255,e>>16&255,e>>>24]},t.nearestColorIndex=function(e,t){const r=A(e),o=i(e),a=s(e);let n=Number.MAX_SAFE_INTEGER,h=-1;for(let e=0;e{const e=[r(0,0,0),r(205,0,0),r(0,205,0),r(205,205,0),r(0,0,238),r(205,0,205),r(0,250,205),r(229,229,229),r(127,127,127),r(255,0,0),r(0,255,0),r(255,255,0),r(92,92,255),r(255,0,255),r(0,255,255),r(255,255,255)],t=[0,95,135,175,215,255];for(let A=0;A<6;++A)for(let i=0;i<6;++i)for(let s=0;s<6;++s)e.push(r(t[A],t[i],t[s]));for(let t=8;t<=238;t+=10)e.push(r(t,t,t));return new Uint32Array(e)})(),t.DEFAULT_BACKGROUND=r(0,0,0,255),t.DEFAULT_FOREGROUND=r(255,255,255,255)},591(e,t,A){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAsync=t.decode=t.Decoder=t.DecoderAsync=void 0;const i=A(939),s=A(199),r=function(e){if("undefined"!=typeof Buffer)return Buffer.from(e,"base64");const t=atob(e),A=new Uint8Array(t.length);for(let e=0;e1,this.modeHandler=e=>1}handle_band(e){return this.bandHandler(e)}mode_parsed(e){return this.modeHandler(e)}}const h={memoryLimit:134217728,sixelColor:i.DEFAULT_FOREGROUND,fillColor:i.DEFAULT_BACKGROUND,palette:i.PALETTE_VT340_COLOR,paletteLimit:s.LIMITS.PALETTE_SIZE,truncate:!0};function g(e){const t=new n,A={env:{handle_band:t.handle_band.bind(t),mode_parsed:t.mode_parsed.bind(t)}};return WebAssembly.instantiate(o||r,A).then(A=>(o=o||A.module,new d(e,A.instance||A,t)))}t.DecoderAsync=g;class d{constructor(e,t,A){if(this._PIXEL_OFFSET=s.LIMITS.MAX_WIDTH+4,this._canvas=a,this._bandWidths=[],this._maxWidth=0,this._minWidth=s.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0,this._opts=Object.assign({},h,e),this._opts.paletteLimit>s.LIMITS.PALETTE_SIZE)throw new Error(`DecoderOptions.paletteLimit must not exceed ${s.LIMITS.PALETTE_SIZE}`);if(t)A.bandHandler=this._handle_band.bind(this),A.modeHandler=this._initCanvas.bind(this);else{const e=o||(o=new WebAssembly.Module(r));t=new WebAssembly.Instance(e,{env:{handle_band:this._handle_band.bind(this),mode_parsed:this._initCanvas.bind(this)}})}this._instance=t,this._wasm=this._instance.exports,this._chunk=new Uint8Array(this._wasm.memory.buffer,this._wasm.get_chunk_address(),s.LIMITS.CHUNK_SIZE),this._states=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_state_address(),12),this._palette=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_palette_address(),s.LIMITS.PALETTE_SIZE),this._palette.set(this._opts.palette),this._pSrc=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_p0_address()),this._wasm.init(i.DEFAULT_FOREGROUND,0,this._opts.paletteLimit,0)}get _fillColor(){return this._states[0]}get _truncate(){return this._states[8]}get _rasterWidth(){return this._states[6]}get _rasterHeight(){return this._states[7]}get _width(){return this._states[2]?this._states[2]-4:0}get _height(){return this._states[3]}get _level(){return this._states[9]}get _mode(){return this._states[10]}get _paletteLimit(){return this._states[11]}_initCanvas(e){if(2===e){const e=this.width*this.height;if(e>this._canvas.length){if(this._opts.memoryLimit&&4*e>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(e)}this._maxWidth=this._width}else if(1===e)if(2===this._level){const e=Math.min(this._rasterWidth,s.LIMITS.MAX_WIDTH)*this._rasterHeight;if(e>this._canvas.length){if(this._opts.memoryLimit&&4*e>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(e)}}else this._canvas.length<65536&&(this._canvas=new Uint32Array(65536));return 0}_realloc(e,t){const A=e+t;if(A>this._canvas.length){if(this._opts.memoryLimit&&4*A>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");const e=new Uint32Array(65536*Math.ceil(A/65536));e.set(this._canvas),this._canvas=e}}_handle_band(e){const t=this._PIXEL_OFFSET;let A=this._lastOffset;if(2===this._mode){let i=this.height-this._currentHeight,s=0;for(;s<6&&i>0;)this._canvas.set(this._pSrc.subarray(t*s,t*s+e),A+e*s),s++,i--;this._lastOffset+=e*s,this._currentHeight+=s}else if(1===this._mode){this._realloc(A,6*e),this._maxWidth=Math.max(this._maxWidth,e),this._minWidth=Math.min(this._minWidth,e);for(let i=0;i<6;++i)this._canvas.set(this._pSrc.subarray(t*i,t*i+e),A+e*i);this._bandWidths.push(e),this._lastOffset+=6*e,this._currentHeight+=6}return 0}get width(){return 1!==this._mode?this._width:Math.max(this._maxWidth,this._wasm.current_width())}get height(){return 1!==this._mode?this._height:this._wasm.current_width()?6*this._bandWidths.length+this._wasm.current_height():6*this._bandWidths.length}get palette(){return this._palette.subarray(0,this._paletteLimit)}get memoryUsage(){return this._canvas.byteLength+this._wasm.memory.buffer.byteLength+8*this._bandWidths.length}get properties(){return{width:this.width,height:this.height,mode:this._mode,level:this._level,truncate:!!this._truncate,paletteLimit:this._paletteLimit,fillColor:this._fillColor,memUsage:this.memoryUsage,rasterAttributes:{numerator:this._states[4],denominator:this._states[5],width:this._rasterWidth,height:this._rasterHeight}}}init(e=this._opts.fillColor,t=this._opts.palette,A=this._opts.paletteLimit,i=this._opts.truncate){this._wasm.init(this._opts.sixelColor,e,A,i?1:0),t&&this._palette.set(t.subarray(0,s.LIMITS.PALETTE_SIZE)),this._bandWidths.length=0,this._maxWidth=0,this._minWidth=s.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0}decode(e,t=0,A=e.length){let i=t;for(;i0){const A=this._PIXEL_OFFSET;let i=this._lastOffset,s=0;for(;s<6&&t>0;)this._canvas.set(this._pSrc.subarray(A*s,A*s+e),i+e*s),s++,t--;t&&this._canvas.fill(this._fillColor,i+e*s)}return this._canvas.subarray(0,this.width*this.height)}if(1===this._mode){if(this._minWidth===this._maxWidth){let t=!1;if(e)if(e!==this._minWidth)t=!0;else{const t=this._PIXEL_OFFSET;let A=this._lastOffset;this._realloc(A,6*e);for(let i=0;i<6;++i)this._canvas.set(this._pSrc.subarray(t*i,t*i+e),A+e*i)}if(!t)return this._canvas.subarray(0,this.width*this.height)}const t=new Uint32Array(this.width*this.height);t.fill(this._fillColor);let A=0,i=0;for(let e=0;e{if(this._disposed)return(0,i.toDisposable)(()=>{});const s={fn:e,thisArgs:t};this._listeners=this._listeners.slice(),this._listeners.push(s);const r=(0,i.toDisposable)(()=>{const e=this._listeners.indexOf(s);-1!==e&&(this._listeners=this._listeners.slice(),this._listeners.splice(e,1))});return A&&(Array.isArray(A)?A.push(r):A.add(r)),r}),this._event}fire(e){if(this._disposed||!this._listeners.length)return;if(1===this._listeners.length)return void this._listeners[0].fn.call(this._listeners[0].thisArgs,e);const t=this._listeners;for(let A=0,i=t.length;At.fire(e))},e.map=function(e,t){return(A,i,s)=>e(e=>A.call(i,t(e)),void 0,s)},e.any=function(...e){return(t,A,s)=>{const r=new i.DisposableStore;for(const i of e)r.add(i(e=>t.call(A,e)));return s&&(Array.isArray(s)?s.push(r):s.add(r)),r}},e.runAndSubscribe=function(e,t,A){return t(A),e(e=>t(e))}}(s||(t.EventUtils=s={}))},426(e,t){function A(e){return{dispose:e}}function i(e){if(!e)return e;if(Array.isArray(e)){for(const t of e)t.dispose();return[]}return e.dispose(),e}Object.defineProperty(t,"__esModule",{value:!0}),t.MutableDisposable=t.Disposable=t.DisposableStore=void 0,t.toDisposable=A,t.dispose=i,t.combinedDisposable=function(...e){return A(()=>i(e))};class s{constructor(){this._disposables=new Set,this._isDisposed=!1}get isDisposed(){return this._isDisposed}add(e){return this._isDisposed?e.dispose():this._disposables.add(e),e}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.clear()}}clear(){for(const e of this._disposables)e.dispose();this._disposables.clear()}}t.DisposableStore=s;class r{constructor(){this._store=new s}dispose(){this._store.dispose()}_register(e){return this._store.add(e)}}t.Disposable=r,r.None=Object.freeze({dispose(){}}),t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}}},795(e,t,A){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IIPHandler=void 0;const s=A(463),r=A(699),o=i(A(669)),a=i(A(61)),n=A(389),h=A(462),g={type:0,name:"Unnamed file",size:0,width:"auto",height:"auto",preserveAspectRatio:1,inline:0};t.IIPHandler=class{constructor(e,t,A,i){this._opts=e,this._renderer=t,this._storage=A,this._coreTerminal=i,this._aborted=!1,this._hp=new n.HeaderParser,this._header=g,this._isMultipart=!1,this._abortMulti=!1;const s=Math.ceil(4*this._opts.iipSizeLimit/3),r=Math.min(1048576,s);this._dec=new o.default(4194304,s,r),this._qoiDec=new a.default(4194304)}reset(){this._hp.reset(),this._dec.release(),this._qoiDec.release()}start(){this._aborted=!1,this._hp.reset()}put(e,t,A){if(!this._aborted)if(4===this._hp.state)0!==this._dec.put(e.subarray(t,A))&&(this._dec.release(),this._aborted=!0);else{const i=this._hp.parse(e,t,A);if(-1===i)return void(this._aborted=!0);if(i>0){if(1===this._hp.fields.type){if(this._isMultipart&&(this._isMultipart=!1,this._abortMulti=!1,this._dec.release()),this._header=Object.assign({},g,this._hp.fields),!this._header.inline)return void(this._aborted=!0);this._dec.init()}else if(this._abortMulti)return void(this._aborted=!0);0!==this._dec.put(e.subarray(i,A))&&(this._dec.release(),this._aborted=!0,this._isMultipart&&(this._abortMulti=!0))}}}end(e){var t,A,i;if(this._aborted)return!0;if(4!==this._hp.state&&this._hp.end())return!0;const o=this._hp.fields.type;if(3===o)return!0;if(5===o){let e=r.CELL_SIZE_DEFAULT.width,A=r.CELL_SIZE_DEFAULT.height;this._renderer.dimensions&&(e=this._renderer.dimensions.css.canvas.width/this._coreTerminal.cols,A=this._renderer.dimensions.css.canvas.height/this._coreTerminal.rows);const s=null!==(i=null===(t=this._coreTerminal._core._coreBrowserService)||void 0===t?void 0:t.dpr)&&void 0!==i?i:1,o=`]1337;ReportCellSize=${A.toFixed(3)};${e.toFixed(3)};${s.toFixed(3)}\\`;return this._coreTerminal.input(o,!1),!0}if(2===o)return this._header=Object.assign({},g,this._hp.fields),this._isMultipart=!0,this._abortMulti=!1,this._dec.release(),this._dec.init(),!0;if(4===o){if(!this._isMultipart)return!0;if(this._isMultipart=!1,this._abortMulti||2!==this._header.type)return!0}let a,n,d=0,l=0,I=h.UNSUPPORTED_TYPE;if((a=e)&&((a=!this._dec.end())?(I=(0,h.imageType)(this._dec.data8),(a="unsupported"!==I.mime)?(d=I.width,l=I.height,(a=d&&l&&d*l(this._storage.addImage(e),!0)).catch(e=>(console.warn(`IIP: decoding error ${I.mime} ${I.width}x${I.height}`,e),!0))}_resize(e,t){var A,i,s,o;const a=(null===(A=this._renderer.dimensions)||void 0===A?void 0:A.css.cell.width)||r.CELL_SIZE_DEFAULT.width,n=(null===(i=this._renderer.dimensions)||void 0===i?void 0:i.css.cell.height)||r.CELL_SIZE_DEFAULT.height,h=(null===(s=this._renderer.dimensions)||void 0===s?void 0:s.css.canvas.width)||a*this._coreTerminal.cols,g=(null===(o=this._renderer.dimensions)||void 0===o?void 0:o.css.canvas.height)||n*this._coreTerminal.rows,d=this._dim(this._header.width,h,a),l=this._dim(this._header.height,g,n);if(!d&&!l){const A=h/e,i=(g-n)/t,s=Math.min(A,i);return s<1?[e*s,t*s]:[e,t]}return d?!this._header.preserveAspectRatio&&d&&l?[d,l]:[d,t*d/e]:[e*l/t,l]}_dim(e,t,A){return"auto"===e?0:e.endsWith("%")?parseInt(e.slice(0,-1),10)*t/100:e.endsWith("px")?parseInt(e.slice(0,-2),10):parseInt(e,10)*A}}},389(e,t){function A(e){let t="";for(let A=0;A57)throw new Error("illegal char");t=10*t+e[A]-48}return t}function s(e){const t=A(e);if(!t.match(/^((auto)|(\d+?((px)|(%)){0,1}))$/))throw new Error("illegal size");return t}Object.defineProperty(t,"__esModule",{value:!0}),t.HeaderParser=void 0;const r={inline:i,size:i,name:function(e){if("undefined"!=typeof Buffer)return Buffer.from(A(e),"base64").toString();const t=atob(A(e)),i=new Uint8Array(t.length);for(let e=0;e14)return-1;for(let h=t;h=d)return this._a();r[s++]=t}break;case 58:return 3!==i||this._storeValue(s)?(this.state=4,h+1):this._a();default:if(s>=d)return this._a();r[s++]=t}}return this.state=i,this._position=s,-2}_a(){return this.fields.type=0,this.state=1,-1}_storeKey(e){const t=A(this._buffer.subarray(0,e));return!!t&&(this._key=t,this.fields[t]=null,!0)}_storeValue(e){if(this._key){try{const t=this._buffer.slice(0,e);this.fields[this._key]=r[this._key]?r[this._key](t):t}catch(e){return!1}return!0}return!1}}},649(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.IIPImageStorage=void 0,t.IIPImageStorage=class{constructor(e){this._storage=e,this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"iip"}}addImage(e){this._storage.addImage(e,this._addImageOpts)}}},462(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.UNSUPPORTED_TYPE=void 0,t.imageType=function(e){if(e.length<32)return t.UNSUPPORTED_TYPE;const A=new Uint32Array(e.buffer,e.byteOffset,8);if(1196314761===A[0]&&169478669===A[1]&&1380206665===A[3])return{mime:"image/png",width:e[16]<<24|e[17]<<16|e[18]<<8|e[19],height:e[20]<<24|e[21]<<16|e[22]<<8|e[23]};if(255===e[0]&&216===e[1]&&255===e[2]){const[t,A]=function(e){const t=e.length;let A=4,i=e[A]<<8|e[A+1];for(;;){if(A+=i,A>=t)return[0,0];if(255!==e[A])return[0,0];if(192===e[A+1]||194===e[A+1])return A+8>>14&16383)};case 32:return 157!==e[23]||1!==e[24]||42!==e[25]?t.UNSUPPORTED_TYPE:{mime:"image/webp",width:16383&(e[26]|e[27]<<8),height:16383&(e[28]|e[29]<<8)}}return t.UNSUPPORTED_TYPE}if(1887007846===A[1]&&(1718187617===A[2]||1936291425===A[2])){let A=-1;const i=Math.min(e.length-16,1024);for(let t=8;t0&&i>0)return{mime:"image/avif",width:t,height:i}}return t.UNSUPPORTED_TYPE}return t.UNSUPPORTED_TYPE},t.UNSUPPORTED_TYPE={mime:"unsupported",width:0,height:0}},463(e,t,A){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageRenderer=void 0;const i=A(939),s=A(426);class r extends s.Disposable{get canvas(){var e;return null===(e=this._layers.get("top"))||void 0===e?void 0:e.canvas}static createCanvas(e,t,A){const i=(null!=e?e:document).createElement("canvas");return i.width=0|t,i.height=0|A,i}static createImageData(e,t,A,i){if("function"!=typeof ImageData){const s=e.createImageData(t,A);return i&&s.data.set(new Uint8ClampedArray(i,0,t*A*4)),s}return i?new ImageData(new Uint8ClampedArray(i,0,t*A*4),t,A):new ImageData(t,A)}static createImageBitmap(e){return"function"!=typeof createImageBitmap?Promise.resolve(void 0):createImageBitmap(e)}constructor(e){super(),this._terminal=e,this._layers=new Map,this._optionsRefresh=this._register(new s.MutableDisposable),this._oldOpen=this._terminal._core.open,this._terminal._core.open=e=>{var t;null===(t=this._oldOpen)||void 0===t||t.call(this._terminal._core,e),this._open()},this._terminal._core.screenElement&&this._open(),this._optionsRefresh.value=this._terminal._core.optionsService.onOptionChange(e=>{var t;"fontSize"===e&&(this.rescaleCanvas(),null===(t=this._renderService)||void 0===t||t.refreshRows(0,this._terminal.rows))}),this._register((0,s.toDisposable)(()=>{var e;this.removeLayerFromDom(),this.removeLayerFromDom("bottom"),this._terminal._core&&this._oldOpen&&(this._terminal._core.open=this._oldOpen,this._oldOpen=void 0),this._renderService&&this._oldSetRenderer&&(this._renderService.setRenderer=this._oldSetRenderer,this._oldSetRenderer=void 0),this._renderService=void 0,this._layers.clear(),null===(e=this._placeholderBitmap)||void 0===e||e.close(),this._placeholderBitmap=void 0,this._placeholder=void 0}))}showPlaceholder(e){var t,A;e?this._placeholder||-1===this.cellSize.height||this._createPlaceHolder(Math.max(this.cellSize.height+1,24)):(null===(t=this._placeholderBitmap)||void 0===t||t.close(),this._placeholderBitmap=void 0,this._placeholder=void 0),null===(A=this._renderService)||void 0===A||A.refreshRows(0,this._terminal.rows)}get dimensions(){return this._terminal.dimensions}get cellSize(){var e,t;return{width:(null===(e=this.dimensions)||void 0===e?void 0:e.css.cell.width)||-1,height:(null===(t=this.dimensions)||void 0===t?void 0:t.css.cell.height)||-1}}clearLines(e,t,A){var i,s,r,o,a;const n=e*((null===(i=this.dimensions)||void 0===i?void 0:i.css.cell.height)||0),h=(null===(s=this.dimensions)||void 0===s?void 0:s.css.canvas.width)||0,g=(t+1-e)*((null===(r=this.dimensions)||void 0===r?void 0:r.css.cell.height)||0);A&&"top"!==A||null===(o=this._layers.get("top"))||void 0===o||o.clearRect(0,n,h,g),A&&"bottom"!==A||null===(a=this._layers.get("bottom"))||void 0===a||a.clearRect(0,n,h,g)}clearAll(e){if(!e||"top"===e){const e=this._layers.get("top");null==e||e.clearRect(0,0,e.canvas.width,e.canvas.height)}if(!e||"bottom"===e){const e=this._layers.get("bottom");null==e||e.clearRect(0,0,e.canvas.width,e.canvas.height)}}draw(e,t,A,i,s=1){const r=this._layers.get(e.layer);if(!r)return;const{width:o,height:a}=this.cellSize;if(-1===o||-1===a)return;this._rescaleImage(e,o,a);const n=e.actual,h=Math.ceil(n.width/o),g=t%h*o,d=Math.floor(t/h)*a,l=A*o,I=i*a,c=s*o+g>n.width?n.width-g:s*o,_=d+a>n.height?n.height-d:a;r.drawImage(n,Math.floor(g),Math.floor(d),Math.ceil(c),Math.ceil(_),Math.floor(l),Math.floor(I),Math.ceil(c),Math.ceil(_))}extractTile(e,t){const{width:A,height:i}=this.cellSize;if(-1===A||-1===i)return;this._rescaleImage(e,A,i);const s=e.actual,o=Math.ceil(s.width/A),a=t%o*A,n=Math.floor(t/o)*i,h=A+a>s.width?s.width-a:A,g=n+i>s.height?s.height-n:i,d=r.createCanvas(this.document,h,g),l=d.getContext("2d");return l?(l.drawImage(s,Math.floor(a),Math.floor(n),Math.floor(h),Math.floor(g),0,0,Math.floor(h),Math.floor(g)),d):void 0}drawPlaceholder(e,t,A=1){var i;const s=this._layers.get("top");if(s){const{width:r,height:o}=this.cellSize;if(-1===r||-1===o)return;if(this._placeholder?o>=this._placeholder.height&&this._createPlaceHolder(o+1):this._createPlaceHolder(Math.max(o+1,24)),!this._placeholder)return;s.drawImage(null!==(i=this._placeholderBitmap)&&void 0!==i?i:this._placeholder,e*r,t*o%2?0:1,r*A,o,e*r,t*o,r*A,o)}}rescaleCanvas(){var e,t;const A=(null===(e=this.dimensions)||void 0===e?void 0:e.css.canvas.width)||0,i=(null===(t=this.dimensions)||void 0===t?void 0:t.css.canvas.height)||0;for(const e of this._layers.values())e.canvas.width===A&&e.canvas.height===i||(e.canvas.width=A,e.canvas.height=i)}_rescaleImage(e,t,A){if(t===e.actualCellSize.width&&A===e.actualCellSize.height)return;const{width:i,height:s}=e.origCellSize;if(t===i&&A===s)return e.actual=e.orig,e.actualCellSize.width=i,void(e.actualCellSize.height=s);const o=r.createCanvas(this.document,Math.ceil(e.orig.width*t/i),Math.ceil(e.orig.height*A/s)),a=o.getContext("2d");a&&(a.drawImage(e.orig,0,0,o.width,o.height),e.actual=o,e.actualCellSize.width=t,e.actualCellSize.height=A)}_open(){this._renderService=this._terminal._core._renderService,this._oldSetRenderer=this._renderService.setRenderer.bind(this._renderService),this._renderService.setRenderer=e=>{var t;for(const e of[...this._layers.keys()])this.removeLayerFromDom(e);null===(t=this._oldSetRenderer)||void 0===t||t.call(this._renderService,e)}}insertLayerToDom(e="top"){var t,A;if(!this.document||!this._terminal._core.screenElement)return void console.warn("image addon: cannot insert output canvas to DOM, missing document or screenElement");if(this._layers.has(e))return;const i=r.createCanvas(this.document,(null===(t=this.dimensions)||void 0===t?void 0:t.css.canvas.width)||0,(null===(A=this.dimensions)||void 0===A?void 0:A.css.canvas.height)||0);i.classList.add(`xterm-image-layer-${e}`);const s=this._terminal._core.screenElement;s.style.isolation="isolate","bottom"===e?(i.style.zIndex="-1",s.insertBefore(i,s.firstChild)):(i.style.zIndex="0",s.appendChild(i));const o=i.getContext("2d",{alpha:!0});o?(this._layers.set(e,o),this.clearAll(e)):i.remove()}removeLayerFromDom(e="top"){const t=this._layers.get(e);t&&(t.canvas.remove(),this._layers.delete(e))}hasLayer(e){return this._layers.has(e)}_createPlaceHolder(e=24){var t;null===(t=this._placeholderBitmap)||void 0===t||t.close(),this._placeholderBitmap=void 0;const A=32,s=r.createCanvas(this.document,A,e),o=s.getContext("2d",{alpha:!1});if(!o)return;const a=r.createImageData(o,A,e),n=new Uint32Array(a.data.buffer),h=(0,i.toRGBA8888)(0,0,0),g=(0,i.toRGBA8888)(255,255,255);n.fill(h);for(let t=0;tthis._placeholderBitmap=e)}else this._placeholder=void 0}get document(){var e;return null===(e=this._terminal._core._coreBrowserService)||void 0===e?void 0:e.window.document}}t.ImageRenderer=r},699(e,t,A){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageStorage=t.CELL_SIZE_DEFAULT=void 0;const i=A(463);t.CELL_SIZE_DEFAULT={width:7,height:14};class s{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}get urlId(){return this._urlId}set urlId(e){this._urlId=e}constructor(e=0,t=0,A=-1,i=-1){this.imageId=A,this.tileId=i,this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new s(this._ext,this._urlId,this.imageId,this.tileId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId&&-1===this.imageId}}const r=new s;t.ImageStorage=class{constructor(e,t,A){this._terminal=e,this._renderer=t,this._opts=A,this._images=new Map,this._lastId=0,this._lowestId=0,this._fullyCleared=!1,this._needsFullClear=!1,this._pixelLimit=25e5;try{this.setLimit(this._opts.storageLimit)}catch(e){e instanceof Error&&console.error(e.message),console.warn(`storageLimit is set to ${this.getLimit()} MB`)}this._viewportMetrics={cols:this._terminal.cols,rows:this._terminal.rows}}dispose(){this.reset()}reset(){var e;for(const t of this._images.values())null===(e=t.marker)||void 0===e||e.dispose();this._images.clear(),this._renderer.clearAll()}getLimit(){return 4*this._pixelLimit/1e6}setLimit(e){if(e<.5||e>1e3)throw RangeError("invalid storageLimit, should be at least 0.5 MB and not exceed 1G");this._pixelLimit=e/4*1e6>>>0,this._evictOldest(0)}getUsage(){return 4*this._getStoredPixels()/1e6}_getStoredPixels(){let e=0;for(const t of this._images.values())t.orig&&(e+=t.orig.width*t.orig.height,t.actual&&t.actual!==t.orig&&(e+=t.actual.width*t.actual.height));return e}_delImg(e){var t;const A=this._images.get(e);A&&(this._images.delete(e),window.ImageBitmap&&A.orig instanceof ImageBitmap&&A.orig.close(),null===(t=this.onImageDeleted)||void 0===t||t.call(this,e))}wipeAlternate(){var e;const t=[];for(const[A,i]of this._images.entries())"alternate"===i.bufferType&&(null===(e=i.marker)||void 0===e||e.dispose(),t.push(A));for(const e of t)this._delImg(e);this._needsFullClear=!0,this._fullyCleared=!1}deleteImage(e){var t;const A=this._images.get(e);A&&(null===(t=A.marker)||void 0===t||t.dispose(),this._delImg(e))}addImage(e,A){var i,s;this._evictOldest(e.width*e.height);let r=this._renderer.cellSize;-1!==r.width&&-1!==r.height||(r=t.CELL_SIZE_DEFAULT);const o=Math.ceil(e.width/r.width),a=Math.ceil(e.height/r.height),n=++this._lastId,h=this._terminal._core.buffer,g=this._terminal.cols,d=this._terminal.rows,l=h.x,I=h.y;let c=l,_=0;A.scrolling||(h.x=0,h.y=0,c=0),this._terminal._core._inputHandler._dirtyRowTracker.markDirty(h.y);for(let e=0;e=g);++A)this._writeToCell(t,c+A,n,e*o+A),_++;if(A.scrolling)e=d)break;h.x=c}this._terminal._core._inputHandler._dirtyRowTracker.markDirty(h.y),A.scrolling?"iip"===A.cursorPos?h.x=Math.min(c+o,g):h.x=c:(h.x=l,h.y=I);const C=[];for(const[e,t]of this._images.entries())t.tileCount<1&&(null===(i=t.marker)||void 0===i||i.dispose(),C.push(e));for(const e of C)this._delImg(e);const B=this._terminal.registerMarker(0);null==B||B.onDispose(()=>{this._images.get(n)&&this._delImg(n)}),"alternate"===this._terminal.buffer.active.type&&this._evictOnAlternate();const Q={orig:e,origCellSize:r,actual:e,actualCellSize:Object.assign({},r),marker:B||void 0,tileCount:_,bufferType:this._terminal.buffer.active.type,layer:A.layer,zIndex:A.zIndex};return this._images.set(n,Q),null===(s=this.onImageAdded)||void 0===s||s.call(this),n}render(e){var t,A;let i=!1,s=!1;for(const e of this._images.values())if("bottom"===e.layer?s=!0:i=!0,i&&s)break;if(i&&!this._renderer.hasLayer("top")&&(this._renderer.insertLayerToDom("top"),!this._renderer.hasLayer("top")))return;if(s&&!this._renderer.hasLayer("bottom")&&this._renderer.insertLayerToDom("bottom"),this._renderer.rescaleCanvas(),!this._images.size)return this._fullyCleared||(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1),this._renderer.hasLayer("top")&&this._renderer.removeLayerFromDom("top"),void(this._renderer.hasLayer("bottom")&&this._renderer.removeLayerFromDom("bottom"));!i&&this._renderer.hasLayer("top")&&(this._renderer.clearAll("top"),this._renderer.removeLayerFromDom("top")),!s&&this._renderer.hasLayer("bottom")&&(this._renderer.clearAll("bottom"),this._renderer.removeLayerFromDom("bottom")),this._needsFullClear&&(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1);const{start:o,end:a}=e,n=this._terminal._core.buffer,h=this._terminal._core.cols;this._renderer.clearLines(o,a);const g=[],d=[];for(let e=o;e<=a;++e){const i=n.lines.get(e+n.ydisp);if(!i)return;for(let s=0;se.imgSpec.zIndex-t.imgSpec.zIndex);for(const e of d)this._renderer.drawPlaceholder(e.col,e.row,e.count);for(const e of g)this._renderer.draw(e.imgSpec,e.tileId,e.col,e.row,e.count)}viewportResize(e){var t,A;if(!this._images.size)return void(this._viewportMetrics=e);if(this._viewportMetrics.cols>=e.cols)return void(this._viewportMetrics=e);const i=this._terminal._core.buffer,s=i.lines.length,o=this._viewportMetrics.cols-1;for(let a=0;a=h)continue;let g=!1;for(let t=o+1;t>e.cols;++t)if(4194303&s._data[3*t+0]){g=!0;break}if(g)continue;const d=Math.min(e.cols,h-i.tileId%h+o);let l=i.tileId;for(let e=o+1;e>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255}o.set(i.PALETTE_VT340_COLOR),t.SixelHandler=class{constructor(e,t,A){this._opts=e,this._storage=t,this._coreTerminal=A,this._size=0,this._aborted=!1,(0,r.DecoderAsync)({memoryLimit:4*this._opts.pixelLimit,palette:o,paletteLimit:this._opts.sixelPaletteLimit}).then(e=>this._dec=e)}reset(){this._dec&&(this._dec.release(),this._dec._palette.fill(0),this._dec.init(0,o,this._opts.sixelPaletteLimit))}hook(e){var t;if(this._size=0,this._aborted=!1,this._dec){const A=1===e.params[1]?0:function(e,t){let A=0;if(!t)return A;if(e.isInverse())if(e.isFgDefault())A=a(t.foreground.rgba);else if(e.isFgRGB()){const t=e.constructor.toColorRGB(e.getFgColor());A=(0,i.toRGBA8888)(...t)}else A=a(t.ansi[e.getFgColor()].rgba);else if(e.isBgDefault())A=a(t.background.rgba);else if(e.isBgRGB()){const t=e.constructor.toColorRGB(e.getBgColor());A=(0,i.toRGBA8888)(...t)}else A=a(t.ansi[e.getBgColor()].rgba);return A}(this._coreTerminal._core._inputHandler._curAttrData,null===(t=this._coreTerminal._core._themeService)||void 0===t?void 0:t.colors);this._dec.init(A,null,this._opts.sixelPaletteLimit)}}put(e,t,A){if(!this._aborted&&this._dec){if(this._size+=A-t,this._size>this._opts.sixelSizeLimit)return console.warn("SIXEL: too much data, aborting"),this._aborted=!0,void this._dec.release();try{this._dec.decode(e,t,A)}catch(e){console.warn(`SIXEL: error while decoding image - ${e}`),this._aborted=!0,this._dec.release()}}}unhook(e){var t;if(this._aborted||!e||!this._dec)return!0;const A=this._dec.width,i=this._dec.height;if(!A||!i)return i&&this._storage.advanceCursor(i),!0;const r=s.ImageRenderer.createCanvas(void 0,A,i);return null===(t=r.getContext("2d"))||void 0===t||t.putImageData(new ImageData(this._dec.data8,A,i),0,0),this._dec.memoryUsage>4194304&&this._dec.release(),this._storage.addImage(r),!0}}},994(e,t,A){Object.defineProperty(t,"__esModule",{value:!0}),t.SixelImageStorage=void 0;const i=A(699);t.SixelImageStorage=class{constructor(e,t,A,i){this._storage=e,this._opts=t,this._renderer=A,this._terminal=i,this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"vt340"}}addImage(e){this._addImageOpts.scrolling=this._opts.sixelScrolling,this._storage.addImage(e,this._addImageOpts)}advanceCursor(e){if(this._opts.sixelScrolling){let t=this._renderer.cellSize;-1!==t.width&&-1!==t.height||(t=i.CELL_SIZE_DEFAULT);const A=Math.ceil(e/t.height);for(let e=1;e512)return void(this._aborted=!0);if(this._controlData.set(e.subarray(t,s),this._controlLength),this._controlLength+=r,!this._inControlData){if(this._parsedCommand=(0,a.parseKittyCommand)(this._parseControlDataString()),void 0!==this._parsedCommand.id&&void 0!==this._parsedCommand.imageNumber)return this._sendResponse(this._parsedCommand.id,"EINVAL:cannot specify both i and I keys",null!==(i=this._parsedCommand.quiet)&&void 0!==i?i:0),void(this._aborted=!0);if("d"===this._parsedCommand.action)return;const t=s+1;tthis._encodedSizeLimit){const e=null!==(n=this._activeDecoder)&&void 0!==n?n:null==g?void 0:g.decoder;return e&&e.release(),this._activeDecoder=null,g&&this._removePendingEntry(h),void(this._aborted=!0)}this._decodeError||((null==g?void 0:g.decoder)&&!this._activeDecoder&&(this._activeDecoder=g.decoder),this._activeDecoder||(this._activeDecoder=new o.default(4194304,this._maxEncodedBytes,this._initialEncodedBytes),this._activeDecoder.init()),0!==this._activeDecoder.put(e.subarray(t,A))&&(this._activeDecoder.release(),this._activeDecoder=null,this._decodeError=!0,g&&this._removePendingEntry(h)))}end(e){var t,A;if(this._aborted||!e)return this._activeDecoder&&(this._activeDecoder.release(),this._activeDecoder=null),!0;if(this._inControlData)return this._handleNoPayloadCommand();const i=this._parsedCommand;if("d"===i.action)return this._handleDelete(i);const s=null!==(A=null!==(t=i.id)&&void 0!==t?t:this._lastPendingKey)&&void 0!==A?A:0,r=1===i.more,o=this._pendingTransmissions.get(s);if(r)return this._activeDecoder&&(o?(o.totalEncodedSize+=this._totalEncodedSize,o.decodeError=o.decodeError||this._decodeError):this._pendingTransmissions.set(s,{cmd:Object.assign({},i),decoder:this._activeDecoder,totalEncodedSize:this._totalEncodedSize,decodeError:this._decodeError}),this._lastPendingKey=s,this._activeDecoder=null),!0;o&&(this._lastPendingKey=void 0);let a=this._decodeError,n=i,h=this._activeDecoder;o&&(n=o.cmd,h=o.decoder,a=a||o.decodeError,this._pendingTransmissions.delete(s));let g=new Uint8Array(0);h&&(0!==h.end()&&(a=!0),g=h.data8),this._activeDecoder=null;const d=this._handleCommandWithBytesAndCmd(n,g,a);return h&&h.release(),d}_parseControlDataString(){let e="";for(let t=0;t0&&this._sendResponse(e.id,"OK",null!==(o=e.quiet)&&void 0!==o?o:0)),i}case"T":return this._handleTransmitDisplay(e,t,A);case"q":return this._handleQuery(e,t,A);case"p":return this._handlePlacement(e);default:return void 0!==e.id&&this._sendResponse(e.id,"EINVAL:unsupported action",null!==(a=e.quiet)&&void 0!==a?a:0),!0}}_handlePlacement(e){var t;if(void 0===e.id)return!0;const A=e.id,i=this._kittyStorage.getImage(A);return i?this._displayImage(i,e).then(t=>{var i;return this._sendResponse(A,t?"OK":"EINVAL:image rendering failed",null!==(i=e.quiet)&&void 0!==i?i:0,e.placementId),!0}):(this._sendResponse(A,"ENOENT:image not found",null!==(t=e.quiet)&&void 0!==t?t:0,e.placementId),!0)}_handleTransmit(e,t,A){var i,s,r,o,a,n;return"d"!==(null!==(i=e.transmission)&&void 0!==i?i:"d")?(void 0!==e.id&&this._sendResponse(e.id,"EINVAL:unsupported transmission medium",null!==(s=e.quiet)&&void 0!==s?s:0),!0):(A||0===t.length||this._kittyStorage.storeImage(e.id,{data:new Blob([t]),width:null!==(r=e.width)&&void 0!==r?r:0,height:null!==(o=e.height)&&void 0!==o?o:0,format:null!==(a=e.format)&&void 0!==a?a:32,compression:null!==(n=e.compression)&&void 0!==n?n:""}),!0)}_handleTransmitDisplay(e,t,A){var i,s;if(A)return void 0!==e.id&&this._sendResponse(e.id,"EINVAL:invalid base64 data",null!==(i=e.quiet)&&void 0!==i?i:0),!0;this._handleTransmit(e,t,A);const r=null!==(s=e.id)&&void 0!==s?s:this._kittyStorage.lastImageId,o=this._kittyStorage.getImage(r);if(o){const t=this._displayImage(o,e);return void 0!==e.id?t.then(t=>{var A;return this._sendResponse(r,t?"OK":"EINVAL:image rendering failed",null!==(A=e.quiet)&&void 0!==A?A:0),!0}):t.then(()=>!0)}return!0}_handleQuery(e,t,A){var i,s,r,o,a,n;const h=null!==(i=e.id)&&void 0!==i?i:0,g=null!==(s=e.quiet)&&void 0!==s?s:0;if("d"!==(null!==(r=e.transmission)&&void 0!==r?r:"d"))return this._sendResponse(h,"EINVAL:unsupported transmission medium",g),!0;if(A)return this._sendResponse(h,"EINVAL:invalid base64 data",g),!0;if(0===t.length)return this._sendResponse(h,"OK",g),!0;const d=null!==(o=e.format)&&void 0!==o?o:32;if(100===d)this._sendResponse(h,"OK",g);else{const A=null!==(a=e.width)&&void 0!==a?a:0,i=null!==(n=e.height)&&void 0!==n?n:0;if(!A||!i)return this._sendResponse(h,"EINVAL:width and height required for raw pixel data",g),!0;const s=A*i*(32===d?4:3);if(t.length=1)return;if(!s&&A>=2)return;const r=`_Gi=${e}${i?`,p=${i}`:""};${t}\\`;this._coreTerminal._core.coreService.triggerDataEvent(r)}_displayImage(e,t){return this._decodeAndDisplay(e,t).then(()=>!0).catch(()=>!1)}async _decodeAndDisplay(e,t){var A,i,o,a,n,h,g;let d=await this._createBitmap(e);try{const l=Math.max(0,null!==(o=t.x)&&void 0!==o?o:0),I=Math.max(0,null!==(a=t.y)&&void 0!==a?a:0),c=t.sourceWidth||d.width-l,_=t.sourceHeight||d.height-I,C=Math.max(0,d.width-l),B=Math.max(0,d.height-I),Q=Math.max(0,Math.min(c,C)),m=Math.max(0,Math.min(_,B));if(0===Q||0===m)throw new Error("invalid source rectangle");if(0!==l||0!==I||Q!==d.width||m!==d.height){const e=await createImageBitmap(d,l,I,Q,m);d.close(),d=e}const E=(null===(A=this._renderer.dimensions)||void 0===A?void 0:A.css.cell.width)||r.CELL_SIZE_DEFAULT.width,u=(null===(i=this._renderer.dimensions)||void 0===i?void 0:i.css.cell.height)||r.CELL_SIZE_DEFAULT.height;let w,p;void 0!==t.columns&&void 0!==t.rows?(w=t.columns,p=t.rows):void 0!==t.columns?(w=t.columns,p=Math.max(1,Math.ceil(d.height/d.width*(w*E)/u))):void 0!==t.rows?(p=t.rows,w=Math.max(1,Math.ceil(d.width/d.height*(p*u)/E))):(w=Math.ceil(d.width/E),p=Math.ceil(d.height/u));let f=d.width,D=d.height;if(void 0===t.columns&&void 0===t.rows||(f=Math.round(w*E),D=Math.round(p*u)),f*D>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");const y=this._coreTerminal._core.buffer,v=y.x,k=y.y,M=y.ybase,b=void 0!==t.zIndex&&t.zIndex<0?"bottom":"top";if(f!==d.width||D!==d.height){const e=await createImageBitmap(d,{resizeWidth:f,resizeHeight:D});d.close(),d=e}const S=Math.min(Math.max(0,null!==(n=t.xOffset)&&void 0!==n?n:0),E-1),L=Math.min(Math.max(0,null!==(h=t.yOffset)&&void 0!==h?h:0),u-1);if(0!==S||0!==L){const e=void 0!==t.columns?Math.round(w*E):d.width+S,A=void 0!==t.rows?Math.round(p*u):d.height+L,i=s.ImageRenderer.createCanvas(window.document,e,A),r=i.getContext("2d");if(!r)throw new Error("Failed to create offset canvas context");r.drawImage(d,S,L);const o=await createImageBitmap(i);if(i.width=i.height=0,d.close(),d=o,f=d.width,D=d.height,f*D>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");void 0===t.columns&&(w=Math.ceil(d.width/E)),void 0===t.rows&&(p=Math.ceil(d.height/u))}const N=null!==(g=t.zIndex)&&void 0!==g?g:0;if(this._kittyStorage.addImage(e.id,d,!0,b,N),d=void 0,1===t.cursorMovement){const e=y.ybase-M;y.x=v,y.y=Math.max(k-e,0)}else y.x=Math.min(v+w,this._coreTerminal.cols)}catch(e){throw null==d||d.close(),e}}async _createBitmap(e){let t=new Uint8Array(await e.data.arrayBuffer());if("z"===e.compression&&(t=await this._decompressZlib(t)),100===e.format){const e=new Blob([t],{type:"image/png"});if(!window.createImageBitmap){const t=URL.createObjectURL(e),A=new Image;return new Promise((e,i)=>{A.addEventListener("load",()=>{var r;URL.revokeObjectURL(t);const o=s.ImageRenderer.createCanvas(window.document,A.width,A.height);null===(r=o.getContext("2d"))||void 0===r||r.drawImage(A,0,0),createImageBitmap(o).then(e).catch(i)}),A.addEventListener("error",()=>{URL.revokeObjectURL(t),i(new Error("Failed to load image"))}),A.src=t})}return createImageBitmap(e)}const A=e.width,i=e.height;if(!A||!i)throw new Error("Width and height required for raw pixel data");const r=A*i*(32===e.format?4:3);if(t.length>>24|t<<8,h[l++]=4278190080|t>>>16|A<<16,h[l++]=4278190080|A>>>8}let I=3*g,c=4*g;for(let e=g;ee+t.length,0),a=new Uint8Array(o);let n=0;for(const e of s)a.set(e,n),n+=e.length;return a}get images(){return this._kittyStorage.images}get _kittyIdToStorageId(){return this._kittyStorage.kittyIdToStorageId}get pendingTransmissions(){return this._pendingTransmissions}}},470(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseKittyCommand=function(e){const t={},A=e.split(",");for(const e of A){const A=e.indexOf("=");if(-1===A)continue;const i=e.substring(0,A),s=e.substring(A+1);if("a"===i){t.action=s;continue}if("o"===i){t.compression=s;continue}if("t"===i){t.transmission=s;continue}if("d"===i){t.deleteSelector=s;continue}const r=parseInt(s,10);switch(i){case"f":t.format=r;break;case"i":t.id=r;break;case"I":t.imageNumber=r;break;case"s":t.width=r;break;case"v":t.height=r;break;case"x":t.x=r;break;case"y":t.y=r;break;case"w":t.sourceWidth=r;break;case"h":t.sourceHeight=r;break;case"X":t.xOffset=r;break;case"Y":t.yOffset=r;break;case"c":t.columns=r;break;case"r":t.rows=r;break;case"m":t.more=r;break;case"q":t.quiet=r;break;case"C":t.cursorMovement=r;break;case"z":t.zIndex=r;break;case"p":t.placementId=r}}return t}},235(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.KittyImageStorage=void 0;class A{constructor(e){this._storage=e,this._nextImageId=1,this._images=new Map,this._kittyIdToStorageId=new Map,this._storageIdToKittyId=new Map,this._handleStorageImageDeleted=e=>{const t=this._storageIdToKittyId.get(e);void 0!==t&&(this._kittyIdToStorageId.delete(t),this._storageIdToKittyId.delete(e),this._images.delete(t))},this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"iip"},this._previousOnImageDeleted=this._storage.onImageDeleted,this._wrappedOnImageDeleted=e=>{var t;null===(t=this._previousOnImageDeleted)||void 0===t||t.call(this,e),this._handleStorageImageDeleted(e)},this._storage.onImageDeleted=this._wrappedOnImageDeleted}reset(){this._nextImageId=1,this._images.clear(),this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}dispose(){this.reset(),this._storage.onImageDeleted===this._wrappedOnImageDeleted&&(this._storage.onImageDeleted=this._previousOnImageDeleted)}storeImage(e,t){const i=null!=e?e:this._nextImageId++,s=this._kittyIdToStorageId.get(i);return void 0!==s&&(this._storage.deleteImage(s),this._kittyIdToStorageId.delete(i),this._storageIdToKittyId.delete(s)),!this._images.has(i)&&this._images.size>=A._maxStoredImages&&this._evictUndisplayedImages(),this._images.set(i,Object.assign(Object.assign({},t),{id:i})),i}addImage(e,t,A,i,s){const r=this._kittyIdToStorageId.get(e);void 0!==r&&this._storageIdToKittyId.delete(r),this._addImageOpts.scrolling=A,this._addImageOpts.layer=i,this._addImageOpts.zIndex=s;const o=this._storage.addImage(t,this._addImageOpts);this._kittyIdToStorageId.set(e,o),this._storageIdToKittyId.set(o,e)}getImage(e){return this._images.get(e)}deleteById(e){this._images.delete(e);const t=this._kittyIdToStorageId.get(e);void 0!==t&&(this._storage.deleteImage(t),this._kittyIdToStorageId.delete(e),this._storageIdToKittyId.delete(t))}deleteAll(){this._images.clear();for(const e of this._kittyIdToStorageId.values())this._storage.deleteImage(e);this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}get images(){return this._images}get kittyIdToStorageId(){return this._kittyIdToStorageId}get lastImageId(){return this._nextImageId-1}_evictUndisplayedImages(){for(const[e]of this._images){if(this._images.size<=A._maxStoredImages/2)break;this._kittyIdToStorageId.has(e)||this._images.delete(e)}}}t.KittyImageStorage=A,A._maxStoredImages=256},669(e,t,A){Object.defineProperty(t,"__esModule",{value:!0});const i=(0,A(552).InWasm)({s:1,t:0,d:"AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML"}),s=new Uint8Array("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").map(e=>e.charCodeAt(0))),r=new Uint32Array(1024);r.fill(4278190080);for(let e=0;e>4|(e<<4&255)<<8;for(let e=0;e>2<<8|(e<<6&255)<<16;for(let e=0;ethis.maxBytes||this.maxBytes>4294901760)throw new Error("invalid byte settings")}get data8(){return this._inst?this._d.subarray(0,this._m32[1282]):o}release(){this._inst&&(this._bytes>this.keepSize?this._inst=this._m32=this._d=this._mem=null:(this._m32[1280]=0,this._m32[1281]=0,this._m32[1282]=0))}init(e,t){if(this.maxBytes=null!=e?e:this.maxBytes,this._bytes=null!=t?t:Math.min(this._bytes,this.maxBytes),this._bytes>this.maxBytes||this.maxBytes>4294901760)throw Error("invalid byte settings");let A=this._m32;const s=this._bytes+5152;this._inst?this._mem.buffer.byteLengththis.maxBytes)return-3;let e=this._bytes;for(;(e*=2)this._mem.buffer.byteLength){const t=Math.ceil((e+5152-this._mem.buffer.byteLength)/65536);this._mem.grow(t),this._m32=new Uint32Array(this._mem.buffer,0),this._d=new Uint8Array(this._mem.buffer,5152)}this._bytes=e}return 0}put(e){if(!this._inst||this._ended)return-2;if(this._realloc(e.length))return-3;const t=this._m32;return this._d.set(e,t[1280]),t[1280]+=e.length,t[1280]-t[1281]>=131072?this._inst.exports.dec():0}end(){return this._ended=!0,this._inst?this._inst.exports.end():-2}get loadedBytes(){return this._inst?this._m32[1280]:0}get freeBytes(){return this._inst?this.maxBytes-this._m32[1280]:0}}},61(e,t,A){Object.defineProperty(t,"__esModule",{value:!0});const i=(0,A(552).InWasm)({s:1,t:0,d:"AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=="});t.default=class{constructor(e){this.keepSize=e,this.width=0,this.height=0}decode(e){this.width=e[4]<<24|e[5]<<16|e[6]<<8|e[7],this.height=e[8]<<24|e[9]<<16|e[10]<<8|e[11];const t=this.width*this.height,A=4*t,s=e.length,r=Math.max(A,s)+(Math.min(A,s)>>1)+4096;this._inst?this._mem.buffer.byteLengththis.keepSize&&(this._inst=this._d=this._mem=null)}}},552(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.InWasm=function(e){if(e.d){const{t,s:i,d:s}=e;let r,o;const a=WebAssembly;return 0===t?i?e=>new a.Instance(o||(o=new a.Module(r||(r=A(s)))),e):e=>o?a.instantiate(o,e):a.instantiate(r||(r=A(s)),e).then(e=>(o=e.module)&&e.instance):1===t?i?()=>o||(o=new a.Module(r||(r=A(s)))):()=>o?Promise.resolve(o):a.compile(r||(r=A(s))).then(e=>o=e):i?()=>r||(r=A(s)):()=>Promise.resolve(r||(r=A(s)))}if("undefined"==typeof _wasmCtx)throw new Error('must run "inwasm"');_wasmCtx.add(e)};let A=e=>{if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);if("undefined"!=typeof Buffer)return Buffer.from(e,"base64");const t=atob(e),A=new Uint8Array(t.length);for(let e=0;e{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.ImageAddon=void 0;const t=A(414),s=A(795),r=A(463),o=A(699),a=A(23),n=A(235),h=A(566),g=A(994),d=A(649),l={enableSizeReports:!0,pixelLimit:16777216,sixelSupport:!0,sixelScrolling:!0,sixelPaletteLimit:4096,sixelSizeLimit:33554432,storageLimit:128,showPlaceholder:!0,iipSupport:!0,iipSizeLimit:33554432,kittySupport:!0,kittySizeLimit:33554432};e.ImageAddon=class{constructor(e){this._disposables=[],this._handlers=new Map,this._onImageAdded=new t.Emitter,this.onImageAdded=this._onImageAdded.event,this._opts=Object.assign({},l,e),this._defaultOpts=Object.assign({},l,e)}dispose(){for(const e of this._disposables)e.dispose();this._disposables.length=0,this._handlers.clear(),this._onImageAdded.dispose()}_disposeLater(...e){for(const t of e)this._disposables.push(t)}activate(e){var t;if(this._terminal=e,this._renderer=new r.ImageRenderer(e),this._storage=new o.ImageStorage(e,this._renderer,this._opts),this._storage.onImageAdded=()=>this._onImageAdded.fire(),this._opts.enableSizeReports){const A=null!==(t=e.options.windowOptions)&&void 0!==t?t:{};A.getWinSizePixels=!0,A.getCellSizePixels=!0,A.getWinSizeChars=!0,e.options.windowOptions=A}if(this._disposeLater(this._renderer,this._storage,e.parser.registerCsiHandler({prefix:"?",final:"h"},e=>this._decset(e)),e.parser.registerCsiHandler({prefix:"?",final:"l"},e=>this._decrst(e)),e.parser.registerCsiHandler({final:"c"},e=>this._da1(e)),e.parser.registerCsiHandler({prefix:"?",final:"S"},e=>this._xtermGraphicsAttributes(e)),e.onRender(e=>{var t;return null===(t=this._storage)||void 0===t?void 0:t.render(e)}),e.parser.registerCsiHandler({intermediates:"!",final:"p"},()=>this.reset()),e.parser.registerEscHandler({final:"c"},()=>this.reset()),e._core._inputHandler.onRequestReset(()=>this.reset()),e.buffer.onBufferChange(()=>{var e;return null===(e=this._storage)||void 0===e?void 0:e.wipeAlternate()}),e.onResize(e=>{var t;return null===(t=this._storage)||void 0===t?void 0:t.viewportResize(e)})),this._opts.sixelSupport){const t=new g.SixelImageStorage(this._storage,this._opts,this._renderer,e),A=new h.SixelHandler(this._opts,t,e);this._handlers.set("sixel",A),this._disposeLater(e._core._inputHandler._parser.registerDcsHandler({final:"q"},A))}if(this._opts.iipSupport){const t=new d.IIPImageStorage(this._storage),A=new s.IIPHandler(this._opts,this._renderer,t,e);this._handlers.set("iip",A),this._disposeLater(e._core._inputHandler._parser.registerOscHandler(1337,A))}if(this._opts.kittySupport){const t=new n.KittyImageStorage(this._storage),A=new a.KittyGraphicsHandler(this._opts,this._renderer,t,e);this._handlers.set("kitty",A),this._disposeLater(t,A,e._core._inputHandler._parser.registerApcHandler({final:"G"},A))}}reset(){var e;this._opts.sixelScrolling=this._defaultOpts.sixelScrolling,this._opts.sixelPaletteLimit=this._defaultOpts.sixelPaletteLimit,null===(e=this._storage)||void 0===e||e.reset();for(const e of this._handlers.values())e.reset();return!1}get storageLimit(){var e;return(null===(e=this._storage)||void 0===e?void 0:e.getLimit())||-1}set storageLimit(e){var t;null===(t=this._storage)||void 0===t||t.setLimit(e),this._opts.storageLimit=e}get storageUsage(){return this._storage?this._storage.getUsage():-1}get showPlaceholder(){return this._opts.showPlaceholder}set showPlaceholder(e){var t;this._opts.showPlaceholder=e,null===(t=this._renderer)||void 0===t||t.showPlaceholder(e)}getImageAtBufferCell(e,t){var A;return null===(A=this._storage)||void 0===A?void 0:A.getImageAtBufferCell(e,t)}extractTileAtBufferCell(e,t){var A;return null===(A=this._storage)||void 0===A?void 0:A.extractTileAtBufferCell(e,t)}_report(e){var t;null===(t=this._terminal)||void 0===t||t._core.input(e,!1)}_decset(e){for(let t=0;t2&&!(e[2]instanceof Array)&&e[2]<=4096?(this._opts.sixelPaletteLimit=e[2],this._report(`[?${e[0]};0;${this._opts.sixelPaletteLimit}S`)):this._report(`[?${e[0]};2S`),!0;case 4:return this._report(`[?${e[0]};0;4096S`),!0;default:return this._report(`[?${e[0]};2S`),!0}if(2===e[0])switch(e[1]){case 1:let n=null===(A=null===(t=this._renderer)||void 0===t?void 0:t.dimensions)||void 0===A?void 0:A.css.canvas.width,h=null===(s=null===(i=this._renderer)||void 0===i?void 0:i.dimensions)||void 0===s?void 0:s.css.canvas.height;if(!n||!h){const e=o.CELL_SIZE_DEFAULT;n=((null===(r=this._terminal)||void 0===r?void 0:r.cols)||80)*e.width,h=((null===(a=this._terminal)||void 0===a?void 0:a.rows)||24)*e.height}if(n*h(()=>{"use strict";var e={939(e,t){function i(e){return 255&e}function A(e){return e>>>8&255}function s(e){return e>>>16&255}function r(e,t,i,A=255){return((255&A)<<24|(255&i)<<16|(255&t)<<8|255&e)>>>0}function o(e,t,i){return Math.max(e,Math.min(i,t))}function a(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?t+6*(e-t)*i:2*i<1?e:3*i<2?t+(e-t)*(4-6*i):t}function n(e,t,i){return(4278190080|Math.round(i/100*255)<<16|Math.round(t/100*255)<<8|Math.round(e/100*255))>>>0}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FOREGROUND=t.DEFAULT_BACKGROUND=t.PALETTE_ANSI_256=t.PALETTE_VT340_GREY=t.PALETTE_VT340_COLOR=t.normalizeHLS=t.normalizeRGB=t.nearestColorIndex=t.fromRGBA8888=t.toRGBA8888=t.alpha=t.blue=t.green=t.red=t.BIG_ENDIAN=void 0,t.BIG_ENDIAN=255===new Uint8Array(new Uint32Array([4278190080]).buffer)[0],t.BIG_ENDIAN&&console.warn("BE platform detected. This version of node-sixel works only on LE properly."),t.red=i,t.green=A,t.blue=s,t.alpha=function(e){return e>>>24&255},t.toRGBA8888=r,t.fromRGBA8888=function(e){return[255&e,e>>8&255,e>>16&255,e>>>24]},t.nearestColorIndex=function(e,t){const r=i(e),o=A(e),a=s(e);let n=Number.MAX_SAFE_INTEGER,h=-1;for(let e=0;e{const e=[r(0,0,0),r(205,0,0),r(0,205,0),r(205,205,0),r(0,0,238),r(205,0,205),r(0,250,205),r(229,229,229),r(127,127,127),r(255,0,0),r(0,255,0),r(255,255,0),r(92,92,255),r(255,0,255),r(0,255,255),r(255,255,255)],t=[0,95,135,175,215,255];for(let i=0;i<6;++i)for(let A=0;A<6;++A)for(let s=0;s<6;++s)e.push(r(t[i],t[A],t[s]));for(let t=8;t<=238;t+=10)e.push(r(t,t,t));return new Uint32Array(e)})(),t.DEFAULT_BACKGROUND=r(0,0,0,255),t.DEFAULT_FOREGROUND=r(255,255,255,255)},591(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAsync=t.decode=t.Decoder=t.DecoderAsync=void 0;const A=i(939),s=i(199),r=function(e){if("undefined"!=typeof Buffer)return Buffer.from(e,"base64");const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e1,this.modeHandler=e=>1}handle_band(e){return this.bandHandler(e)}mode_parsed(e){return this.modeHandler(e)}}const h={memoryLimit:134217728,sixelColor:A.DEFAULT_FOREGROUND,fillColor:A.DEFAULT_BACKGROUND,palette:A.PALETTE_VT340_COLOR,paletteLimit:s.LIMITS.PALETTE_SIZE,truncate:!0};function g(e){const t=new n,i={env:{handle_band:t.handle_band.bind(t),mode_parsed:t.mode_parsed.bind(t)}};return WebAssembly.instantiate(o||r,i).then(i=>(o=o||i.module,new d(e,i.instance||i,t)))}t.DecoderAsync=g;class d{constructor(e,t,i){if(this._PIXEL_OFFSET=s.LIMITS.MAX_WIDTH+4,this._canvas=a,this._bandWidths=[],this._maxWidth=0,this._minWidth=s.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0,this._opts=Object.assign({},h,e),this._opts.paletteLimit>s.LIMITS.PALETTE_SIZE)throw new Error(`DecoderOptions.paletteLimit must not exceed ${s.LIMITS.PALETTE_SIZE}`);if(t)i.bandHandler=this._handle_band.bind(this),i.modeHandler=this._initCanvas.bind(this);else{const e=o||(o=new WebAssembly.Module(r));t=new WebAssembly.Instance(e,{env:{handle_band:this._handle_band.bind(this),mode_parsed:this._initCanvas.bind(this)}})}this._instance=t,this._wasm=this._instance.exports,this._chunk=new Uint8Array(this._wasm.memory.buffer,this._wasm.get_chunk_address(),s.LIMITS.CHUNK_SIZE),this._states=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_state_address(),12),this._palette=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_palette_address(),s.LIMITS.PALETTE_SIZE),this._palette.set(this._opts.palette),this._pSrc=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_p0_address()),this._wasm.init(A.DEFAULT_FOREGROUND,0,this._opts.paletteLimit,0)}get _fillColor(){return this._states[0]}get _truncate(){return this._states[8]}get _rasterWidth(){return this._states[6]}get _rasterHeight(){return this._states[7]}get _width(){return this._states[2]?this._states[2]-4:0}get _height(){return this._states[3]}get _level(){return this._states[9]}get _mode(){return this._states[10]}get _paletteLimit(){return this._states[11]}_initCanvas(e){if(2===e){const e=this.width*this.height;if(e>this._canvas.length){if(this._opts.memoryLimit&&4*e>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(e)}this._maxWidth=this._width}else if(1===e)if(2===this._level){const e=Math.min(this._rasterWidth,s.LIMITS.MAX_WIDTH)*this._rasterHeight;if(e>this._canvas.length){if(this._opts.memoryLimit&&4*e>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(e)}}else this._canvas.length<65536&&(this._canvas=new Uint32Array(65536));return 0}_realloc(e,t){const i=e+t;if(i>this._canvas.length){if(this._opts.memoryLimit&&4*i>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");const e=new Uint32Array(65536*Math.ceil(i/65536));e.set(this._canvas),this._canvas=e}}_handle_band(e){const t=this._PIXEL_OFFSET;let i=this._lastOffset;if(2===this._mode){let A=this.height-this._currentHeight,s=0;for(;s<6&&A>0;)this._canvas.set(this._pSrc.subarray(t*s,t*s+e),i+e*s),s++,A--;this._lastOffset+=e*s,this._currentHeight+=s}else if(1===this._mode){this._realloc(i,6*e),this._maxWidth=Math.max(this._maxWidth,e),this._minWidth=Math.min(this._minWidth,e);for(let A=0;A<6;++A)this._canvas.set(this._pSrc.subarray(t*A,t*A+e),i+e*A);this._bandWidths.push(e),this._lastOffset+=6*e,this._currentHeight+=6}return 0}get width(){return 1!==this._mode?this._width:Math.max(this._maxWidth,this._wasm.current_width())}get height(){return 1!==this._mode?this._height:this._wasm.current_width()?6*this._bandWidths.length+this._wasm.current_height():6*this._bandWidths.length}get palette(){return this._palette.subarray(0,this._paletteLimit)}get memoryUsage(){return this._canvas.byteLength+this._wasm.memory.buffer.byteLength+8*this._bandWidths.length}get properties(){return{width:this.width,height:this.height,mode:this._mode,level:this._level,truncate:!!this._truncate,paletteLimit:this._paletteLimit,fillColor:this._fillColor,memUsage:this.memoryUsage,rasterAttributes:{numerator:this._states[4],denominator:this._states[5],width:this._rasterWidth,height:this._rasterHeight}}}init(e=this._opts.fillColor,t=this._opts.palette,i=this._opts.paletteLimit,A=this._opts.truncate){this._wasm.init(this._opts.sixelColor,e,i,A?1:0),t&&this._palette.set(t.subarray(0,s.LIMITS.PALETTE_SIZE)),this._bandWidths.length=0,this._maxWidth=0,this._minWidth=s.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0}decode(e,t=0,i=e.length){let A=t;for(;A0){const i=this._PIXEL_OFFSET;let A=this._lastOffset,s=0;for(;s<6&&t>0;)this._canvas.set(this._pSrc.subarray(i*s,i*s+e),A+e*s),s++,t--;t&&this._canvas.fill(this._fillColor,A+e*s)}return this._canvas.subarray(0,this.width*this.height)}if(1===this._mode){if(this._minWidth===this._maxWidth){let t=!1;if(e)if(e!==this._minWidth)t=!0;else{const t=this._PIXEL_OFFSET;let i=this._lastOffset;this._realloc(i,6*e);for(let A=0;A<6;++A)this._canvas.set(this._pSrc.subarray(t*A,t*A+e),i+e*A)}if(!t)return this._canvas.subarray(0,this.width*this.height)}const t=new Uint32Array(this.width*this.height);t.fill(this._fillColor);let i=0,A=0;for(let e=0;e{if(this._disposed)return(0,A.toDisposable)(()=>{});const s={fn:e,thisArgs:t};this._listeners=this._listeners.slice(),this._listeners.push(s);const r=(0,A.toDisposable)(()=>{const e=this._listeners.indexOf(s);-1!==e&&(this._listeners=this._listeners.slice(),this._listeners.splice(e,1))});return i&&(Array.isArray(i)?i.push(r):i.add(r)),r}),this._event}fire(e){if(this._disposed||!this._listeners.length)return;if(1===this._listeners.length)return void this._listeners[0].fn.call(this._listeners[0].thisArgs,e);const t=this._listeners;for(let i=0,A=t.length;it.fire(e))},e.map=function(e,t){return(i,A,s)=>e(e=>i.call(A,t(e)),void 0,s)},e.any=function(...e){return(t,i,s)=>{const r=new A.DisposableStore;for(const A of e)r.add(A(e=>t.call(i,e)));return s&&(Array.isArray(s)?s.push(r):s.add(r)),r}},e.runAndSubscribe=function(e,t,i){return t(i),e(e=>t(e))}}(s||(t.EventUtils=s={}))},426(e,t){function i(e){return{dispose:e}}function A(e){if(!e)return e;if(Array.isArray(e)){for(const t of e)t.dispose();return[]}return e.dispose(),e}Object.defineProperty(t,"__esModule",{value:!0}),t.MutableDisposable=t.Disposable=t.DisposableStore=void 0,t.toDisposable=i,t.dispose=A,t.combinedDisposable=function(...e){return i(()=>A(e))};class s{constructor(){this._disposables=new Set,this._isDisposed=!1}get isDisposed(){return this._isDisposed}add(e){return this._isDisposed?e.dispose():this._disposables.add(e),e}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.clear()}}clear(){for(const e of this._disposables)e.dispose();this._disposables.clear()}}t.DisposableStore=s;class r{constructor(){this._store=new s}dispose(){this._store.dispose()}_register(e){return this._store.add(e)}}t.Disposable=r,r.None=Object.freeze({dispose(){}}),t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}}},795(e,t,i){var A=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IIPHandler=void 0;const s=i(463),r=i(699),o=A(i(669)),a=A(i(61)),n=i(389),h=i(462),g={type:0,name:"Unnamed file",size:0,width:"auto",height:"auto",preserveAspectRatio:1,inline:0};t.IIPHandler=class{constructor(e,t,i,A){this._opts=e,this._renderer=t,this._storage=i,this._coreTerminal=A,this._generation=0,this._aborted=!1,this._hp=new n.HeaderParser,this._header=g,this._isMultipart=!1,this._abortMulti=!1;const s=Math.ceil(4*this._opts.iipSizeLimit/3),r=Math.min(1048576,s);this._dec=new o.default(4194304,s,r),this._qoiDec=new a.default(4194304)}reset(){this._generation++,this._hp.reset(),this._dec.release(),this._qoiDec.release()}start(){this._aborted=!1,this._hp.reset()}put(e,t,i){if(!this._aborted)if(4===this._hp.state)0!==this._dec.put(e.subarray(t,i))&&(this._dec.release(),this._aborted=!0);else{const A=this._hp.parse(e,t,i);if(-1===A)return void(this._aborted=!0);if(A>0){if(1===this._hp.fields.type){if(this._isMultipart&&(this._isMultipart=!1,this._abortMulti=!1,this._dec.release()),this._header=Object.assign({},g,this._hp.fields),!this._header.inline)return void(this._aborted=!0);this._dec.init()}else if(this._abortMulti)return void(this._aborted=!0);0!==this._dec.put(e.subarray(A,i))&&(this._dec.release(),this._aborted=!0,this._isMultipart&&(this._abortMulti=!0))}}}end(e){var t,i,A;if(this._aborted)return!0;if(4!==this._hp.state&&this._hp.end())return!0;const o=this._hp.fields.type;if(3===o)return!0;if(5===o){let e=r.CELL_SIZE_DEFAULT.width,i=r.CELL_SIZE_DEFAULT.height;this._renderer.dimensions&&(e=this._renderer.dimensions.css.canvas.width/this._coreTerminal.cols,i=this._renderer.dimensions.css.canvas.height/this._coreTerminal.rows);const s=null!==(A=null===(t=this._coreTerminal._core._coreBrowserService)||void 0===t?void 0:t.dpr)&&void 0!==A?A:1,o=`]1337;ReportCellSize=${i.toFixed(3)};${e.toFixed(3)};${s.toFixed(3)}\\`;return this._coreTerminal.input(o,!1),!0}if(2===o)return this._header=Object.assign({},g,this._hp.fields),this._isMultipart=!0,this._abortMulti=!1,this._dec.release(),this._dec.init(),!0;if(4===o){if(!this._isMultipart)return!0;if(this._isMultipart=!1,this._abortMulti||2!==this._header.type)return!0}let a,n,d=0,l=0,I=h.UNSUPPORTED_TYPE;if((a=e)&&((a=!this._dec.end())?(I=(0,h.imageType)(this._dec.data8),(a="unsupported"!==I.mime)?(d=I.width,l=I.height,(a=d&&l&&d*lc!==this._generation?(e.close(),!0):(this._storage.addImage(e),!0)).catch(e=>(console.warn(`IIP: decoding error ${I.mime} ${I.width}x${I.height}`,e),!0))}_resize(e,t){var i,A,s,o;const a=(null===(i=this._renderer.dimensions)||void 0===i?void 0:i.css.cell.width)||r.CELL_SIZE_DEFAULT.width,n=(null===(A=this._renderer.dimensions)||void 0===A?void 0:A.css.cell.height)||r.CELL_SIZE_DEFAULT.height,h=(null===(s=this._renderer.dimensions)||void 0===s?void 0:s.css.canvas.width)||a*this._coreTerminal.cols,g=(null===(o=this._renderer.dimensions)||void 0===o?void 0:o.css.canvas.height)||n*this._coreTerminal.rows,d=this._dim(this._header.width,h,a),l=this._dim(this._header.height,g,n);if(!d&&!l){const i=h/e,A=(g-n)/t,s=Math.min(i,A);return s<1?[e*s,t*s]:[e,t]}return d?!this._header.preserveAspectRatio&&d&&l?[d,l]:[d,t*d/e]:[e*l/t,l]}_dim(e,t,i){return"auto"===e?0:e.endsWith("%")?parseInt(e.slice(0,-1),10)*t/100:e.endsWith("px")?parseInt(e.slice(0,-2),10):parseInt(e,10)*i}}},389(e,t){function i(e){let t="";for(let i=0;i57)throw new Error("illegal char");t=10*t+e[i]-48}return t}function s(e){const t=i(e);if(!t.match(/^((auto)|(\d+?((px)|(%)){0,1}))$/))throw new Error("illegal size");return t}Object.defineProperty(t,"__esModule",{value:!0}),t.HeaderParser=void 0;const r={inline:A,size:A,name:function(e){if("undefined"!=typeof Buffer)return Buffer.from(i(e),"base64").toString();const t=atob(i(e)),A=new Uint8Array(t.length);for(let e=0;e14)return-1;for(let h=t;h=d)return this._a();r[s++]=t}break;case 58:return 3!==A||this._storeValue(s)?(this.state=4,h+1):this._a();default:if(s>=d)return this._a();r[s++]=t}}return this.state=A,this._position=s,-2}_a(){return this.fields.type=0,this.state=1,-1}_storeKey(e){const t=i(this._buffer.subarray(0,e));return!!t&&(this._key=t,this.fields[t]=null,!0)}_storeValue(e){if(this._key){try{const t=this._buffer.slice(0,e);this.fields[this._key]=r[this._key]?r[this._key](t):t}catch(e){return!1}return!0}return!1}}},649(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.IIPImageStorage=void 0,t.IIPImageStorage=class{constructor(e){this._storage=e,this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"iip"}}addImage(e){this._storage.addImage(e,this._addImageOpts)}}},462(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.UNSUPPORTED_TYPE=void 0,t.imageType=function(e){if(e.length<32)return t.UNSUPPORTED_TYPE;const i=new Uint32Array(e.buffer,e.byteOffset,8);if(1196314761===i[0]&&169478669===i[1]&&1380206665===i[3])return{mime:"image/png",width:e[16]<<24|e[17]<<16|e[18]<<8|e[19],height:e[20]<<24|e[21]<<16|e[22]<<8|e[23]};if(255===e[0]&&216===e[1]&&255===e[2]){const[t,i]=function(e){const t=e.length;let i=4,A=e[i]<<8|e[i+1];for(;;){if(i+=A,i>=t)return[0,0];if(255!==e[i])return[0,0];if(192===e[i+1]||194===e[i+1])return i+8>>14&16383)};case 32:return 157!==e[23]||1!==e[24]||42!==e[25]?t.UNSUPPORTED_TYPE:{mime:"image/webp",width:16383&(e[26]|e[27]<<8),height:16383&(e[28]|e[29]<<8)}}return t.UNSUPPORTED_TYPE}if(1887007846===i[1]&&(1718187617===i[2]||1936291425===i[2])){let i=-1;const A=Math.min(e.length-16,1024);for(let t=8;t0&&A>0)return{mime:"image/avif",width:t,height:A}}return t.UNSUPPORTED_TYPE}return t.UNSUPPORTED_TYPE},t.UNSUPPORTED_TYPE={mime:"unsupported",width:0,height:0}},463(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageRenderer=void 0;const A=i(939),s=i(426);class r extends s.Disposable{get canvas(){var e;return null===(e=this._layers.get("top"))||void 0===e?void 0:e.canvas}static createCanvas(e,t,i){const A=(null!=e?e:document).createElement("canvas");return A.width=0|t,A.height=0|i,A}static createImageData(e,t,i,A){if("function"!=typeof ImageData){const s=e.createImageData(t,i);return A&&s.data.set(new Uint8ClampedArray(A,0,t*i*4)),s}return A?new ImageData(new Uint8ClampedArray(A,0,t*i*4),t,i):new ImageData(t,i)}static createImageBitmap(e){return"function"!=typeof createImageBitmap?Promise.resolve(void 0):createImageBitmap(e)}constructor(e){super(),this._terminal=e,this._layers=new Map,this._optionsRefresh=this._register(new s.MutableDisposable),this._oldOpen=this._terminal._core.open,this._terminal._core.open=e=>{var t;null===(t=this._oldOpen)||void 0===t||t.call(this._terminal._core,e),this._open()},this._terminal._core.screenElement&&this._open(),this._optionsRefresh.value=this._terminal._core.optionsService.onOptionChange(e=>{var t;"fontSize"===e&&(this.rescaleCanvas(),null===(t=this._renderService)||void 0===t||t.refreshRows(0,this._terminal.rows))}),this._register((0,s.toDisposable)(()=>{var e;this.removeLayerFromDom(),this.removeLayerFromDom("bottom"),this._terminal._core&&this._oldOpen&&(this._terminal._core.open=this._oldOpen,this._oldOpen=void 0),this._renderService&&this._oldSetRenderer&&(this._renderService.setRenderer=this._oldSetRenderer,this._oldSetRenderer=void 0),this._renderService=void 0,this._layers.clear(),null===(e=this._placeholderBitmap)||void 0===e||e.close(),this._placeholderBitmap=void 0,this._placeholder=void 0}))}showPlaceholder(e){var t,i;e?this._placeholder||-1===this.cellSize.height||this._createPlaceHolder(Math.max(this.cellSize.height+1,24)):(null===(t=this._placeholderBitmap)||void 0===t||t.close(),this._placeholderBitmap=void 0,this._placeholder=void 0),null===(i=this._renderService)||void 0===i||i.refreshRows(0,this._terminal.rows)}get dimensions(){return this._terminal.dimensions}get cellSize(){var e,t;return{width:(null===(e=this.dimensions)||void 0===e?void 0:e.css.cell.width)||-1,height:(null===(t=this.dimensions)||void 0===t?void 0:t.css.cell.height)||-1}}clearLines(e,t,i){var A,s,r,o,a;const n=e*((null===(A=this.dimensions)||void 0===A?void 0:A.css.cell.height)||0),h=(null===(s=this.dimensions)||void 0===s?void 0:s.css.canvas.width)||0,g=(t+1-e)*((null===(r=this.dimensions)||void 0===r?void 0:r.css.cell.height)||0);i&&"top"!==i||null===(o=this._layers.get("top"))||void 0===o||o.clearRect(0,n,h,g),i&&"bottom"!==i||null===(a=this._layers.get("bottom"))||void 0===a||a.clearRect(0,n,h,g)}clearAll(e){if(!e||"top"===e){const e=this._layers.get("top");null==e||e.clearRect(0,0,e.canvas.width,e.canvas.height)}if(!e||"bottom"===e){const e=this._layers.get("bottom");null==e||e.clearRect(0,0,e.canvas.width,e.canvas.height)}}draw(e,t,i,A,s=1){const r=this._layers.get(e.layer);if(!r)return;const{width:o,height:a}=this.cellSize;if(-1===o||-1===a)return;this._rescaleImage(e,o,a);const n=e.actual,{width:h,height:g}=e.actualCellSize,d=Math.ceil(n.width/h),l=t%d*h,I=Math.floor(t/d)*g,c=i*o,_=A*a,C=s*h+l>n.width?n.width-l:s*h,B=I+g>n.height?n.height-I:g;r.drawImage(n,Math.floor(l),Math.floor(I),Math.ceil(C),Math.ceil(B),Math.floor(c),Math.floor(_),Math.ceil(C*o/h),Math.ceil(B*a/g))}extractTile(e,t){const{width:i,height:A}=this.cellSize;if(-1===i||-1===A)return;this._rescaleImage(e,i,A);const s=e.actual,{width:o,height:a}=e.actualCellSize,n=Math.ceil(s.width/o),h=t%n*o,g=Math.floor(t/n)*a,d=o+h>s.width?s.width-h:o,l=g+a>s.height?s.height-g:a,I=r.createCanvas(this.document,Math.ceil(d*i/o),Math.ceil(l*A/a)),c=I.getContext("2d");return c?(c.drawImage(s,Math.floor(h),Math.floor(g),Math.floor(d),Math.floor(l),0,0,I.width,I.height),I):void 0}drawPlaceholder(e,t,i=1){var A;const s=this._layers.get("top");if(s){const{width:r,height:o}=this.cellSize;if(-1===r||-1===o)return;if(this._placeholder?o>=this._placeholder.height&&this._createPlaceHolder(o+1):this._createPlaceHolder(Math.max(o+1,24)),!this._placeholder)return;s.drawImage(null!==(A=this._placeholderBitmap)&&void 0!==A?A:this._placeholder,e*r,t*o%2?0:1,r*i,o,e*r,t*o,r*i,o)}}rescaleCanvas(){var e,t;const i=(null===(e=this.dimensions)||void 0===e?void 0:e.css.canvas.width)||0,A=(null===(t=this.dimensions)||void 0===t?void 0:t.css.canvas.height)||0;for(const e of this._layers.values())e.canvas.width===i&&e.canvas.height===A||(e.canvas.width=i,e.canvas.height=A)}_rescaleImage(e,t,i){if(t===e.actualCellSize.width&&i===e.actualCellSize.height)return;const{width:A,height:s}=e.origCellSize;if(t===A&&i===s)return e.actual=e.orig,e.actualCellSize.width=A,void(e.actualCellSize.height=s);const o=Math.ceil(e.orig.width*t/A),a=Math.ceil(e.orig.height*i/s);if(o*a>e.orig.width*e.orig.height)return e.actual=e.orig,e.actualCellSize.width=A,void(e.actualCellSize.height=s);const n=r.createCanvas(this.document,o,a),h=n.getContext("2d");h&&(h.drawImage(e.orig,0,0,n.width,n.height),e.actual=n,e.actualCellSize.width=t,e.actualCellSize.height=i)}_open(){this._renderService=this._terminal._core._renderService,this._oldSetRenderer=this._renderService.setRenderer.bind(this._renderService),this._renderService.setRenderer=e=>{var t;for(const e of[...this._layers.keys()])this.removeLayerFromDom(e);null===(t=this._oldSetRenderer)||void 0===t||t.call(this._renderService,e)}}insertLayerToDom(e="top"){var t,i;if(!this.document||!this._terminal._core.screenElement)return void console.warn("image addon: cannot insert output canvas to DOM, missing document or screenElement");if(this._layers.has(e))return;const A=r.createCanvas(this.document,(null===(t=this.dimensions)||void 0===t?void 0:t.css.canvas.width)||0,(null===(i=this.dimensions)||void 0===i?void 0:i.css.canvas.height)||0);A.classList.add(`xterm-image-layer-${e}`);const s=this._terminal._core.screenElement;s.style.isolation="isolate","bottom"===e?(A.style.zIndex="-1",s.insertBefore(A,s.firstChild)):(A.style.zIndex="0",s.appendChild(A));const o=A.getContext("2d",{alpha:!0});o?(this._layers.set(e,o),this.clearAll(e)):A.remove()}removeLayerFromDom(e="top"){const t=this._layers.get(e);t&&(t.canvas.remove(),this._layers.delete(e))}hasLayer(e){return this._layers.has(e)}_createPlaceHolder(e=24){var t;null===(t=this._placeholderBitmap)||void 0===t||t.close(),this._placeholderBitmap=void 0;const i=32,s=r.createCanvas(this.document,i,e),o=s.getContext("2d",{alpha:!1});if(!o)return;const a=r.createImageData(o,i,e),n=new Uint32Array(a.data.buffer),h=(0,A.toRGBA8888)(0,0,0),g=(0,A.toRGBA8888)(255,255,255);n.fill(h);for(let t=0;t{this._placeholder!==I?null==e||e.close():this._placeholderBitmap=e}).catch(()=>{})}get document(){var e;return null===(e=this._terminal._core._coreBrowserService)||void 0===e?void 0:e.window.document}}t.ImageRenderer=r},699(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageStorage=t.CELL_SIZE_DEFAULT=void 0;const A=i(463);t.CELL_SIZE_DEFAULT={width:7,height:14};class s{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}get urlId(){return this._urlId}set urlId(e){this._urlId=e}constructor(e=0,t=0,i=-1,A=-1){this.imageId=i,this.tileId=A,this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new s(this._ext,this._urlId,this.imageId,this.tileId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId&&-1===this.imageId}}const r=new s;t.ImageStorage=class{constructor(e,t,i){this._terminal=e,this._renderer=t,this._opts=i,this._images=new Map,this._lastId=0,this._lowestId=0,this._fullyCleared=!1,this._needsFullClear=!1,this._pixelLimit=25e5;try{this.setLimit(this._opts.storageLimit)}catch(e){e instanceof Error&&console.error(e.message),console.warn(`storageLimit is set to ${this.getLimit()} MB`)}this._viewportMetrics={cols:this._terminal.cols,rows:this._terminal.rows}}dispose(){this.reset()}reset(){var e;for(const t of this._images.values())null===(e=t.marker)||void 0===e||e.dispose();this._images.clear(),this._renderer.clearAll()}getLimit(){return 4*this._pixelLimit/1e6}setLimit(e){if(e<.5||e>1e3)throw RangeError("invalid storageLimit, should be at least 0.5 MB and not exceed 1G");this._pixelLimit=e/4*1e6>>>0,this._evictOldest(0)}getUsage(){return 4*this._getStoredPixels()/1e6}_getStoredPixels(){let e=0;for(const t of this._images.values())t.orig&&(e+=t.orig.width*t.orig.height,t.actual&&t.actual!==t.orig&&(e+=t.actual.width*t.actual.height));return e}_delImg(e){var t;const i=this._images.get(e);i&&(this._images.delete(e),window.ImageBitmap&&i.orig instanceof ImageBitmap&&i.orig.close(),null===(t=this.onImageDeleted)||void 0===t||t.call(this,e))}wipeAlternate(){var e;const t=[];for(const[i,A]of this._images.entries())"alternate"===A.bufferType&&(null===(e=A.marker)||void 0===e||e.dispose(),t.push(i));for(const e of t)this._delImg(e);this._needsFullClear=!0,this._fullyCleared=!1}deleteImage(e){var t;const i=this._images.get(e);i&&(null===(t=i.marker)||void 0===t||t.dispose(),this._delImg(e))}addImage(e,i){var A,s;this._evictOldest(e.width*e.height);let r=this._renderer.cellSize;-1!==r.width&&-1!==r.height||(r=t.CELL_SIZE_DEFAULT);const o=Math.ceil(e.width/r.width),a=Math.ceil(e.height/r.height),n=++this._lastId,h=this._terminal._core.buffer,g=this._terminal.cols,d=this._terminal.rows,l=h.x,I=h.y;let c=l,_=0;i.scrolling||(h.x=0,h.y=0,c=0),this._terminal._core._inputHandler._dirtyRowTracker.markDirty(h.y);for(let e=0;e=g);++i)this._writeToCell(t,c+i,n,e*o+i),_++;if(i.scrolling)e=d)break;h.x=c}this._terminal._core._inputHandler._dirtyRowTracker.markDirty(h.y),i.scrolling?"iip"===i.cursorPos?h.x=Math.min(c+o,g):h.x=c:(h.x=l,h.y=I);const C=[];for(const[e,t]of this._images.entries())t.tileCount<1&&(null===(A=t.marker)||void 0===A||A.dispose(),C.push(e));for(const e of C)this._delImg(e);const B=this._terminal.registerMarker(0);null==B||B.onDispose(()=>{this._images.get(n)&&this._delImg(n)}),"alternate"===this._terminal.buffer.active.type&&this._evictOnAlternate();const Q={orig:e,origCellSize:r,actual:e,actualCellSize:Object.assign({},r),marker:B||void 0,tileCount:_,bufferType:this._terminal.buffer.active.type,layer:i.layer,zIndex:i.zIndex};return this._images.set(n,Q),null===(s=this.onImageAdded)||void 0===s||s.call(this),n}render(e){var t,i;let A=!1,s=!1;for(const e of this._images.values())if("bottom"===e.layer?s=!0:A=!0,A&&s)break;if(A&&!this._renderer.hasLayer("top")&&(this._renderer.insertLayerToDom("top"),!this._renderer.hasLayer("top")))return;if(s&&!this._renderer.hasLayer("bottom")&&this._renderer.insertLayerToDom("bottom"),this._renderer.rescaleCanvas(),!this._images.size)return this._fullyCleared||(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1),this._renderer.hasLayer("top")&&this._renderer.removeLayerFromDom("top"),void(this._renderer.hasLayer("bottom")&&this._renderer.removeLayerFromDom("bottom"));!A&&this._renderer.hasLayer("top")&&(this._renderer.clearAll("top"),this._renderer.removeLayerFromDom("top")),!s&&this._renderer.hasLayer("bottom")&&(this._renderer.clearAll("bottom"),this._renderer.removeLayerFromDom("bottom")),this._needsFullClear&&(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1);const{start:o,end:a}=e,n=this._terminal._core.buffer,h=this._terminal._core.cols;this._renderer.clearLines(o,a);const g=[],d=[];for(let e=o;e<=a;++e){const A=n.lines.get(e+n.ydisp);if(!A)return;for(let s=0;se.imgSpec.zIndex-t.imgSpec.zIndex);for(const e of d)this._renderer.drawPlaceholder(e.col,e.row,e.count);for(const e of g)this._renderer.draw(e.imgSpec,e.tileId,e.col,e.row,e.count)}viewportResize(e){var t,i;if(!this._images.size)return void(this._viewportMetrics=e);if(this._viewportMetrics.cols>=e.cols)return void(this._viewportMetrics=e);const A=this._terminal._core.buffer,s=A.lines.length,o=this._viewportMetrics.cols-1;for(let a=0;a=h)continue;let g=!1;for(let t=o+1;t>e.cols;++t)if(4194303&s._data[3*t+0]){g=!0;break}if(g)continue;const d=Math.min(e.cols,h-A.tileId%h+o);let l=A.tileId;for(let e=o+1;e>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255}o.set(A.PALETTE_VT340_COLOR),t.SixelHandler=class{constructor(e,t,i){this._opts=e,this._storage=t,this._coreTerminal=i,this._size=0,this._aborted=!1,(0,r.DecoderAsync)({memoryLimit:4*this._opts.pixelLimit,palette:o,paletteLimit:this._opts.sixelPaletteLimit}).then(e=>this._dec=e)}reset(){this._dec&&(this._dec.release(),this._dec._palette.fill(0),this._dec.init(0,o,this._opts.sixelPaletteLimit))}hook(e){var t;if(this._size=0,this._aborted=!1,this._dec){const i=1===e.params[1]?0:function(e,t){let i=0;if(!t)return i;if(e.isInverse())if(e.isFgDefault())i=a(t.foreground.rgba);else if(e.isFgRGB()){const t=e.constructor.toColorRGB(e.getFgColor());i=(0,A.toRGBA8888)(...t)}else i=a(t.ansi[e.getFgColor()].rgba);else if(e.isBgDefault())i=a(t.background.rgba);else if(e.isBgRGB()){const t=e.constructor.toColorRGB(e.getBgColor());i=(0,A.toRGBA8888)(...t)}else i=a(t.ansi[e.getBgColor()].rgba);return i}(this._coreTerminal._core._inputHandler._curAttrData,null===(t=this._coreTerminal._core._themeService)||void 0===t?void 0:t.colors);this._dec.init(i,null,this._opts.sixelPaletteLimit)}}put(e,t,i){if(!this._aborted&&this._dec){if(this._size+=i-t,this._size>this._opts.sixelSizeLimit)return console.warn("SIXEL: too much data, aborting"),this._aborted=!0,void this._dec.release();try{this._dec.decode(e,t,i)}catch(e){console.warn(`SIXEL: error while decoding image - ${e}`),this._aborted=!0,this._dec.release()}}}unhook(e){var t;if(this._aborted||!e||!this._dec)return!0;const i=this._dec.width,A=this._dec.height;if(!i||!A)return A&&this._storage.advanceCursor(A),!0;const r=s.ImageRenderer.createCanvas(void 0,i,A);return null===(t=r.getContext("2d"))||void 0===t||t.putImageData(new ImageData(this._dec.data8,i,A),0,0),this._dec.memoryUsage>4194304&&this._dec.release(),this._storage.addImage(r),!0}}},994(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SixelImageStorage=void 0;const A=i(699);t.SixelImageStorage=class{constructor(e,t,i,A){this._storage=e,this._opts=t,this._renderer=i,this._terminal=A,this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"vt340"}}addImage(e){this._addImageOpts.scrolling=this._opts.sixelScrolling,this._storage.addImage(e,this._addImageOpts)}advanceCursor(e){if(this._opts.sixelScrolling){let t=this._renderer.cellSize;-1!==t.width&&-1!==t.height||(t=A.CELL_SIZE_DEFAULT);const i=Math.ceil(e/t.height);for(let e=1;e512)return void(this._aborted=!0);if(this._controlData.set(e.subarray(t,s),this._controlLength),this._controlLength+=r,!this._inControlData){if(this._parsedCommand=(0,n.parseKittyCommand)(this._parseControlDataString()),void 0!==this._parsedCommand.id&&void 0!==this._parsedCommand.imageNumber)return this._sendResponse(this._parsedCommand.id,"EINVAL:cannot specify both i and I keys",null!==(A=this._parsedCommand.quiet)&&void 0!==A?A:0),void(this._aborted=!0);if("d"===this._parsedCommand.action)return;const t=s+1;tthis._encodedSizeLimit){const e=null!==(h=this._activeDecoder)&&void 0!==h?h:null==I?void 0:I.decoder;return e&&e.release(),this._activeDecoder=null,I&&this._removePendingEntry(l),void(this._aborted=!0)}if(!this._decodeError){if((null==I?void 0:I.decoder)&&!this._activeDecoder&&(this._activeDecoder=I.decoder),!this._activeDecoder){const e=this._maxEncodedBytes+131072;if(e>1e6*this._opts.storageLimit)return this._aborted=!0,void(void 0!==(null===(s=this._parsedCommand)||void 0===s?void 0:s.id)&&this._sendResponse(this._parsedCommand.id,"ENOMEM:pending image budget exceeded",null!==(g=this._parsedCommand.quiet)&&void 0!==g?g:0));const t=Math.max(1,Math.floor(1e6*this._opts.storageLimit/e));for(;this._pendingTransmissions.size>=t;){const e=this._pendingTransmissions.entries().next().value;if(!e)break;e[1].decoder.release(),this._removePendingEntry(e[0]),void 0!==e[1].cmd.id&&this._sendResponse(e[1].cmd.id,"ENOMEM:pending image budget exceeded",null!==(d=e[1].cmd.quiet)&&void 0!==d?d:0)}this._activeDecoder=new a.default(4194304,this._maxEncodedBytes,this._initialEncodedBytes),this._activeDecoder.init()}0!==this._activeDecoder.put(e.subarray(t,i))&&(this._activeDecoder.release(),this._activeDecoder=null,this._decodeError=!0,I&&this._removePendingEntry(l))}}end(e){var t,i;if(this._aborted||!e)return this._activeDecoder&&(this._activeDecoder.release(),this._activeDecoder=null),!0;if(this._inControlData)return this._handleNoPayloadCommand();const A=this._parsedCommand;if("d"===A.action)return this._handleDelete(A);const s=null!==(i=null!==(t=A.id)&&void 0!==t?t:this._lastPendingKey)&&void 0!==i?i:0,r=1===A.more,o=this._pendingTransmissions.get(s);if(r)return this._activeDecoder&&(o?(o.totalEncodedSize+=this._totalEncodedSize,o.decodeError=o.decodeError||this._decodeError):this._pendingTransmissions.set(s,{cmd:Object.assign({},A),decoder:this._activeDecoder,totalEncodedSize:this._totalEncodedSize,decodeError:this._decodeError}),this._lastPendingKey=s,this._activeDecoder=null),!0;o&&(this._lastPendingKey=void 0);let a=this._decodeError,n=A,h=this._activeDecoder;o&&(n=o.cmd,h=o.decoder,a=a||o.decodeError,this._pendingTransmissions.delete(s));let g=new Uint8Array(0);h&&(0!==h.end()&&(a=!0),g=h.data8),this._activeDecoder=null;const d=this._handleCommandWithBytesAndCmd(n,g,a);return h&&h.release(),d}_parseControlDataString(){let e="";for(let t=0;t0&&this._sendResponse(e.id,"OK",null!==(o=e.quiet)&&void 0!==o?o:0)),A}case"T":return this._handleTransmitDisplay(e,t,i);case"q":return this._handleQuery(e,t,i);case"p":return this._handlePlacement(e);default:return void 0!==e.id&&this._sendResponse(e.id,"EINVAL:unsupported action",null!==(a=e.quiet)&&void 0!==a?a:0),!0}}_handlePlacement(e){var t;if(void 0===e.id)return!0;const i=e.id,A=this._kittyStorage.getImage(i);return A?this._displayImage(A,e).then(t=>{var A;return this._sendResponse(i,t?"OK":"EINVAL:image rendering failed",null!==(A=e.quiet)&&void 0!==A?A:0,e.placementId),!0}):(this._sendResponse(i,"ENOENT:image not found",null!==(t=e.quiet)&&void 0!==t?t:0,e.placementId),!0)}_handleTransmit(e,t,i){var A,s,r,o,a,n;return"d"!==(null!==(A=e.transmission)&&void 0!==A?A:"d")?(void 0!==e.id&&this._sendResponse(e.id,"EINVAL:unsupported transmission medium",null!==(s=e.quiet)&&void 0!==s?s:0),!0):(i||0===t.length||this._kittyStorage.storeImage(e.id,{data:new Blob([t]),width:null!==(r=e.width)&&void 0!==r?r:0,height:null!==(o=e.height)&&void 0!==o?o:0,format:null!==(a=e.format)&&void 0!==a?a:32,compression:null!==(n=e.compression)&&void 0!==n?n:""}),!0)}_handleTransmitDisplay(e,t,i){var A,s;if(i)return void 0!==e.id&&this._sendResponse(e.id,"EINVAL:invalid base64 data",null!==(A=e.quiet)&&void 0!==A?A:0),!0;this._handleTransmit(e,t,i);const r=null!==(s=e.id)&&void 0!==s?s:this._kittyStorage.lastImageId,o=this._kittyStorage.getImage(r);if(o){const t=this._displayImage(o,e);return void 0!==e.id?t.then(t=>{var i;return this._sendResponse(r,t?"OK":"EINVAL:image rendering failed",null!==(i=e.quiet)&&void 0!==i?i:0),!0}):t.then(()=>!0)}return!0}_handleQuery(e,t,i){var A,s,r,o,a,n;const h=null!==(A=e.id)&&void 0!==A?A:0,g=null!==(s=e.quiet)&&void 0!==s?s:0;if("d"!==(null!==(r=e.transmission)&&void 0!==r?r:"d"))return this._sendResponse(h,"EINVAL:unsupported transmission medium",g),!0;if(i)return this._sendResponse(h,"EINVAL:invalid base64 data",g),!0;if(0===t.length)return this._sendResponse(h,"OK",g),!0;const d=null!==(o=e.format)&&void 0!==o?o:32;if(100===d)this._sendResponse(h,"OK",g);else{const i=null!==(a=e.width)&&void 0!==a?a:0,A=null!==(n=e.height)&&void 0!==n?n:0;if(!i||!A)return this._sendResponse(h,"EINVAL:width and height required for raw pixel data",g),!0;const s=i*A*(32===d?4:3);if(t.length=1)return;if(!s&&i>=2)return;const r=`_Gi=${e}${A?`,p=${A}`:""};${t}\\`;this._coreTerminal._core.coreService.triggerDataEvent(r)}_displayImage(e,t){return this._decodeAndDisplay(e,t).then(()=>!0).catch(()=>!1)}async _decodeAndDisplay(e,t){var i,A,o,a,n,h,g;const d=this._generation;let l=await this._createBitmap(e);try{if(d!==this._generation)throw new Error("image decode canceled");const I=Math.max(0,null!==(o=t.x)&&void 0!==o?o:0),c=Math.max(0,null!==(a=t.y)&&void 0!==a?a:0),_=t.sourceWidth||l.width-I,C=t.sourceHeight||l.height-c,B=Math.max(0,l.width-I),Q=Math.max(0,l.height-c),m=Math.max(0,Math.min(_,B)),E=Math.max(0,Math.min(C,Q));if(0===m||0===E)throw new Error("invalid source rectangle");if(0!==I||0!==c||m!==l.width||E!==l.height){const e=await createImageBitmap(l,I,c,m,E);l.close(),l=e}const u=(null===(i=this._renderer.dimensions)||void 0===i?void 0:i.css.cell.width)||r.CELL_SIZE_DEFAULT.width,p=(null===(A=this._renderer.dimensions)||void 0===A?void 0:A.css.cell.height)||r.CELL_SIZE_DEFAULT.height;let w,f;void 0!==t.columns&&void 0!==t.rows?(w=t.columns,f=t.rows):void 0!==t.columns?(w=t.columns,f=Math.max(1,Math.ceil(l.height/l.width*(w*u)/p))):void 0!==t.rows?(f=t.rows,w=Math.max(1,Math.ceil(l.width/l.height*(f*p)/u))):(w=Math.ceil(l.width/u),f=Math.ceil(l.height/p));let D=l.width,y=l.height;if(void 0===t.columns&&void 0===t.rows||(D=Math.round(w*u),y=Math.round(f*p)),D*y>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");const v=this._coreTerminal._core.buffer,k=v.x,M=v.y,b=v.ybase,S=void 0!==t.zIndex&&t.zIndex<0?"bottom":"top";if(D!==l.width||y!==l.height){const e=await createImageBitmap(l,{resizeWidth:D,resizeHeight:y});l.close(),l=e}const L=Math.min(Math.max(0,null!==(n=t.xOffset)&&void 0!==n?n:0),u-1),N=Math.min(Math.max(0,null!==(h=t.yOffset)&&void 0!==h?h:0),p-1);if(0!==L||0!==N){const e=void 0!==t.columns?Math.round(w*u):l.width+L,i=void 0!==t.rows?Math.round(f*p):l.height+N,A=s.ImageRenderer.createCanvas(window.document,e,i),r=A.getContext("2d");if(!r)throw new Error("Failed to create offset canvas context");r.drawImage(l,L,N);const o=await createImageBitmap(A);if(A.width=A.height=0,l.close(),l=o,D=l.width,y=l.height,D*y>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");void 0===t.columns&&(w=Math.ceil(l.width/u)),void 0===t.rows&&(f=Math.ceil(l.height/p))}if(d!==this._generation)throw new Error("image decode canceled");const G=null!==(g=t.zIndex)&&void 0!==g?g:0;if(this._kittyStorage.addImage(e.id,l,!0,S,G),l=void 0,1===t.cursorMovement){const e=v.ybase-b;v.x=k,v.y=Math.max(M-e,0)}else v.x=Math.min(k+w,this._coreTerminal.cols)}catch(e){throw null==l||l.close(),e}}async _createBitmap(e){let t=new Uint8Array(await e.data.arrayBuffer());if("z"===e.compression&&(t=await this._decompressZlib(t)),100===e.format){const e=(0,o.imageType)(t);if("image/png"!==e.mime||!(e.width>0)||!(e.height>0)||e.width*e.height>this._opts.pixelLimit)throw new RangeError("PNG exceeds pixel limit or has invalid dimensions");const i=new Blob([t],{type:"image/png"});if(!window.createImageBitmap){const e=URL.createObjectURL(i),t=new Image;return new Promise((i,A)=>{t.addEventListener("load",()=>{var r;URL.revokeObjectURL(e);const o=s.ImageRenderer.createCanvas(window.document,t.width,t.height);null===(r=o.getContext("2d"))||void 0===r||r.drawImage(t,0,0),createImageBitmap(o).then(i).catch(A)}),t.addEventListener("error",()=>{URL.revokeObjectURL(e),A(new Error("Failed to load image"))}),t.src=e})}return createImageBitmap(i)}const i=e.width,A=e.height;if(!i||!A)throw new Error("Width and height required for raw pixel data");const r=i*A*(32===e.format?4:3);if(t.length>>24|t<<8,g[I++]=4278190080|t>>>16|i<<16,g[I++]=4278190080|i>>>8}let c=3*d,_=4*d;for(let e=d;e=e.length)return void t.close();const i=Math.min(A+4096,e.length);t.enqueue(new Uint8Array(e.subarray(A,i))),A=i}}).pipeThrough(new DecompressionStream(t)).getReader(),r=[];let o=0;try{for(;;){const{done:e,value:t}=await s.read();if(e)break;if(o+=t.byteLength,o>i)throw await s.cancel().catch(()=>{}),new RangeError("decompressed image exceeds byte limit");r.push(t)}}finally{s.releaseLock()}const a=new Uint8Array(o);let n=0;for(const e of r)a.set(e,n),n+=e.length;return a}get images(){return this._kittyStorage.images}get _kittyIdToStorageId(){return this._kittyStorage.kittyIdToStorageId}get pendingTransmissions(){return this._pendingTransmissions}}},470(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseKittyCommand=function(e){const t={},i=e.split(",");for(const e of i){const i=e.indexOf("=");if(-1===i)continue;const A=e.substring(0,i),s=e.substring(i+1);if("a"===A){t.action=s;continue}if("o"===A){t.compression=s;continue}if("t"===A){t.transmission=s;continue}if("d"===A){t.deleteSelector=s;continue}const r=parseInt(s,10);switch(A){case"f":t.format=r;break;case"i":t.id=r;break;case"I":t.imageNumber=r;break;case"s":t.width=r;break;case"v":t.height=r;break;case"x":t.x=r;break;case"y":t.y=r;break;case"w":t.sourceWidth=r;break;case"h":t.sourceHeight=r;break;case"X":t.xOffset=r;break;case"Y":t.yOffset=r;break;case"c":t.columns=r;break;case"r":t.rows=r;break;case"m":t.more=r;break;case"q":t.quiet=r;break;case"C":t.cursorMovement=r;break;case"z":t.zIndex=r;break;case"p":t.placementId=r}}return t}},235(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.KittyImageStorage=void 0;class i{constructor(e){this._storage=e,this._nextImageId=1,this._images=new Map,this._kittyIdToStorageId=new Map,this._storageIdToKittyId=new Map,this._handleStorageImageDeleted=e=>{const t=this._storageIdToKittyId.get(e);void 0!==t&&(this._kittyIdToStorageId.delete(t),this._storageIdToKittyId.delete(e),this._images.delete(t))},this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"iip"},this._previousOnImageDeleted=this._storage.onImageDeleted,this._wrappedOnImageDeleted=e=>{var t;null===(t=this._previousOnImageDeleted)||void 0===t||t.call(this,e),this._handleStorageImageDeleted(e)},this._storage.onImageDeleted=this._wrappedOnImageDeleted}reset(){this._nextImageId=1,this._images.clear(),this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}dispose(){this.reset(),this._storage.onImageDeleted===this._wrappedOnImageDeleted&&(this._storage.onImageDeleted=this._previousOnImageDeleted)}storeImage(e,t){const A=null!=e?e:this._nextImageId++,s=this._kittyIdToStorageId.get(A);void 0!==s&&(this._storage.deleteImage(s),this._kittyIdToStorageId.delete(A),this._storageIdToKittyId.delete(s)),!this._images.has(A)&&this._images.size>=i._maxStoredImages&&this._evictUndisplayedImages();const r=1e6*this._storage.getLimit();this._images.delete(A);let o=0;for(const e of this._images.values())o+=e.data.size;for(const e of[!1,!0])for(const[i,A]of this._images){if(o+t.data.size<=r)break;this._kittyIdToStorageId.has(i)===e&&(o-=A.data.size,this.deleteById(i))}return this._images.set(A,Object.assign(Object.assign({},t),{id:A})),A}addImage(e,t,i,A,s){const r=this._kittyIdToStorageId.get(e);void 0!==r&&this._storageIdToKittyId.delete(r),this._addImageOpts.scrolling=i,this._addImageOpts.layer=A,this._addImageOpts.zIndex=s;const o=this._storage.addImage(t,this._addImageOpts);this._kittyIdToStorageId.set(e,o),this._storageIdToKittyId.set(o,e)}getImage(e){return this._images.get(e)}deleteById(e){this._images.delete(e);const t=this._kittyIdToStorageId.get(e);void 0!==t&&(this._storage.deleteImage(t),this._kittyIdToStorageId.delete(e),this._storageIdToKittyId.delete(t))}deleteAll(){this._images.clear();for(const e of this._kittyIdToStorageId.values())this._storage.deleteImage(e);this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}get images(){return this._images}get kittyIdToStorageId(){return this._kittyIdToStorageId}get lastImageId(){return this._nextImageId-1}_evictUndisplayedImages(){for(const[e]of this._images){if(this._images.size<=i._maxStoredImages/2)break;this._kittyIdToStorageId.has(e)||this._images.delete(e)}}}t.KittyImageStorage=i,i._maxStoredImages=256},669(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});const A=(0,i(552).InWasm)({s:1,t:0,d:"AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML"}),s=new Uint8Array("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").map(e=>e.charCodeAt(0))),r=new Uint32Array(1024);r.fill(4278190080);for(let e=0;e>4|(e<<4&255)<<8;for(let e=0;e>2<<8|(e<<6&255)<<16;for(let e=0;ethis.maxBytes||this.maxBytes>4294901760)throw new Error("invalid byte settings")}get data8(){return this._inst?this._d.subarray(0,this._m32[1282]):o}release(){this._inst&&(this._bytes>this.keepSize?this._inst=this._m32=this._d=this._mem=null:(this._m32[1280]=0,this._m32[1281]=0,this._m32[1282]=0))}init(e,t){if(this.maxBytes=null!=e?e:this.maxBytes,this._bytes=null!=t?t:Math.min(this._bytes,this.maxBytes),this._bytes>this.maxBytes||this.maxBytes>4294901760)throw Error("invalid byte settings");let i=this._m32;const s=this._bytes+5152;this._inst?this._mem.buffer.byteLengththis.maxBytes)return-3;let e=this._bytes;for(;(e*=2)this._mem.buffer.byteLength){const t=Math.ceil((e+5152-this._mem.buffer.byteLength)/65536);this._mem.grow(t),this._m32=new Uint32Array(this._mem.buffer,0),this._d=new Uint8Array(this._mem.buffer,5152)}this._bytes=e}return 0}put(e){if(!this._inst||this._ended)return-2;if(this._realloc(e.length))return-3;const t=this._m32;return this._d.set(e,t[1280]),t[1280]+=e.length,t[1280]-t[1281]>=131072?this._inst.exports.dec():0}end(){return this._ended=!0,this._inst?this._inst.exports.end():-2}get loadedBytes(){return this._inst?this._m32[1280]:0}get freeBytes(){return this._inst?this.maxBytes-this._m32[1280]:0}}},61(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});const A=(0,i(552).InWasm)({s:1,t:0,d:"AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=="});t.default=class{constructor(e){this.keepSize=e,this.width=0,this.height=0}decode(e){this.width=e[4]<<24|e[5]<<16|e[6]<<8|e[7],this.height=e[8]<<24|e[9]<<16|e[10]<<8|e[11];const t=this.width*this.height,i=4*t,s=e.length,r=Math.max(i,s)+(Math.min(i,s)>>1)+4096;this._inst?this._mem.buffer.byteLengththis.keepSize&&(this._inst=this._d=this._mem=null)}}},552(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.InWasm=function(e){if(e.d){const{t,s:A,d:s}=e;let r,o;const a=WebAssembly;return 0===t?A?e=>new a.Instance(o||(o=new a.Module(r||(r=i(s)))),e):e=>o?a.instantiate(o,e):a.instantiate(r||(r=i(s)),e).then(e=>(o=e.module)&&e.instance):1===t?A?()=>o||(o=new a.Module(r||(r=i(s)))):()=>o?Promise.resolve(o):a.compile(r||(r=i(s))).then(e=>o=e):A?()=>r||(r=i(s)):()=>Promise.resolve(r||(r=i(s)))}if("undefined"==typeof _wasmCtx)throw new Error('must run "inwasm"');_wasmCtx.add(e)};let i=e=>{if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);if("undefined"!=typeof Buffer)return Buffer.from(e,"base64");const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e{var e=A;Object.defineProperty(e,"__esModule",{value:!0}),e.ImageAddon=void 0;const t=i(414),s=i(795),r=i(463),o=i(699),a=i(23),n=i(235),h=i(566),g=i(994),d=i(649),l={enableSizeReports:!0,pixelLimit:16777216,sixelSupport:!0,sixelScrolling:!0,sixelPaletteLimit:4096,sixelSizeLimit:33554432,storageLimit:128,showPlaceholder:!0,iipSupport:!0,iipSizeLimit:33554432,kittySupport:!0,kittySizeLimit:33554432};e.ImageAddon=class{constructor(e){this._disposables=[],this._handlers=new Map,this._onImageAdded=new t.Emitter,this.onImageAdded=this._onImageAdded.event,this._opts=Object.assign({},l,e),this._defaultOpts=Object.assign({},l,e)}dispose(){for(const e of this._handlers.values())e.reset();for(const e of this._disposables)e.dispose();this._disposables.length=0,this._handlers.clear(),this._onImageAdded.dispose()}_disposeLater(...e){for(const t of e)this._disposables.push(t)}activate(e){var t;if(this._terminal=e,this._renderer=new r.ImageRenderer(e),this._storage=new o.ImageStorage(e,this._renderer,this._opts),this._storage.onImageAdded=()=>this._onImageAdded.fire(),this._opts.enableSizeReports){const i=null!==(t=e.options.windowOptions)&&void 0!==t?t:{};i.getWinSizePixels=!0,i.getCellSizePixels=!0,i.getWinSizeChars=!0,e.options.windowOptions=i}if(this._disposeLater(this._renderer,this._storage,e.parser.registerCsiHandler({prefix:"?",final:"h"},e=>this._decset(e)),e.parser.registerCsiHandler({prefix:"?",final:"l"},e=>this._decrst(e)),e.parser.registerCsiHandler({final:"c"},e=>this._da1(e)),e.parser.registerCsiHandler({prefix:"?",final:"S"},e=>this._xtermGraphicsAttributes(e)),e.onRender(e=>{var t;return null===(t=this._storage)||void 0===t?void 0:t.render(e)}),e.parser.registerCsiHandler({intermediates:"!",final:"p"},()=>this.reset()),e.parser.registerEscHandler({final:"c"},()=>this.reset()),e._core._inputHandler.onRequestReset(()=>this.reset()),e.buffer.onBufferChange(()=>{var e;return null===(e=this._storage)||void 0===e?void 0:e.wipeAlternate()}),e.onResize(e=>{var t;return null===(t=this._storage)||void 0===t?void 0:t.viewportResize(e)})),this._opts.sixelSupport){const t=new g.SixelImageStorage(this._storage,this._opts,this._renderer,e),i=new h.SixelHandler(this._opts,t,e);this._handlers.set("sixel",i),this._disposeLater(e._core._inputHandler._parser.registerDcsHandler({final:"q"},i))}if(this._opts.iipSupport){const t=new d.IIPImageStorage(this._storage),i=new s.IIPHandler(this._opts,this._renderer,t,e);this._handlers.set("iip",i),this._disposeLater(e._core._inputHandler._parser.registerOscHandler(1337,i))}if(this._opts.kittySupport){const t=new n.KittyImageStorage(this._storage),i=new a.KittyGraphicsHandler(this._opts,this._renderer,t,e);this._handlers.set("kitty",i),this._disposeLater(t,i,e._core._inputHandler._parser.registerApcHandler({final:"G"},i))}}reset(){var e;this._opts.sixelScrolling=this._defaultOpts.sixelScrolling,this._opts.sixelPaletteLimit=this._defaultOpts.sixelPaletteLimit,null===(e=this._storage)||void 0===e||e.reset();for(const e of this._handlers.values())e.reset();return!1}get storageLimit(){var e;return(null===(e=this._storage)||void 0===e?void 0:e.getLimit())||-1}set storageLimit(e){var t;null===(t=this._storage)||void 0===t||t.setLimit(e),this._opts.storageLimit=e}get storageUsage(){return this._storage?this._storage.getUsage():-1}get showPlaceholder(){return this._opts.showPlaceholder}set showPlaceholder(e){var t;this._opts.showPlaceholder=e,null===(t=this._renderer)||void 0===t||t.showPlaceholder(e)}getImageAtBufferCell(e,t){var i;return null===(i=this._storage)||void 0===i?void 0:i.getImageAtBufferCell(e,t)}extractTileAtBufferCell(e,t){var i;return null===(i=this._storage)||void 0===i?void 0:i.extractTileAtBufferCell(e,t)}_report(e){var t;null===(t=this._terminal)||void 0===t||t._core.input(e,!1)}_decset(e){for(let t=0;t2&&!(e[2]instanceof Array)&&e[2]<=4096?(this._opts.sixelPaletteLimit=e[2],this._report(`[?${e[0]};0;${this._opts.sixelPaletteLimit}S`)):this._report(`[?${e[0]};2S`),!0;case 4:return this._report(`[?${e[0]};0;4096S`),!0;default:return this._report(`[?${e[0]};2S`),!0}if(2===e[0])switch(e[1]){case 1:let n=null===(i=null===(t=this._renderer)||void 0===t?void 0:t.dimensions)||void 0===i?void 0:i.css.canvas.width,h=null===(s=null===(A=this._renderer)||void 0===A?void 0:A.dimensions)||void 0===s?void 0:s.css.canvas.height;if(!n||!h){const e=o.CELL_SIZE_DEFAULT;n=((null===(r=this._terminal)||void 0===r?void 0:r.cols)||80)*e.width,h=((null===(a=this._terminal)||void 0===a?void 0:a.rows)||24)*e.height}if(n*h(()=>{"use strict";var e={939(e,t){function i(e){return 255&e}function A(e){return e>>>8&255}function s(e){return e>>>16&255}function r(e,t,i,A=255){return((255&A)<<24|(255&i)<<16|(255&t)<<8|255&e)>>>0}function o(e,t,i){return Math.max(e,Math.min(i,t))}function a(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?t+6*(e-t)*i:2*i<1?e:3*i<2?t+(e-t)*(4-6*i):t}function n(e,t,i){return(4278190080|Math.round(i/100*255)<<16|Math.round(t/100*255)<<8|Math.round(e/100*255))>>>0}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FOREGROUND=t.DEFAULT_BACKGROUND=t.PALETTE_ANSI_256=t.PALETTE_VT340_GREY=t.PALETTE_VT340_COLOR=t.normalizeHLS=t.normalizeRGB=t.nearestColorIndex=t.fromRGBA8888=t.toRGBA8888=t.alpha=t.blue=t.green=t.red=t.BIG_ENDIAN=void 0,t.BIG_ENDIAN=255===new Uint8Array(new Uint32Array([4278190080]).buffer)[0],t.BIG_ENDIAN&&console.warn("BE platform detected. This version of node-sixel works only on LE properly."),t.red=i,t.green=A,t.blue=s,t.alpha=function(e){return e>>>24&255},t.toRGBA8888=r,t.fromRGBA8888=function(e){return[255&e,e>>8&255,e>>16&255,e>>>24]},t.nearestColorIndex=function(e,t){const r=i(e),o=A(e),a=s(e);let n=Number.MAX_SAFE_INTEGER,h=-1;for(let e=0;e{const e=[r(0,0,0),r(205,0,0),r(0,205,0),r(205,205,0),r(0,0,238),r(205,0,205),r(0,250,205),r(229,229,229),r(127,127,127),r(255,0,0),r(0,255,0),r(255,255,0),r(92,92,255),r(255,0,255),r(0,255,255),r(255,255,255)],t=[0,95,135,175,215,255];for(let i=0;i<6;++i)for(let A=0;A<6;++A)for(let s=0;s<6;++s)e.push(r(t[i],t[A],t[s]));for(let t=8;t<=238;t+=10)e.push(r(t,t,t));return new Uint32Array(e)})(),t.DEFAULT_BACKGROUND=r(0,0,0,255),t.DEFAULT_FOREGROUND=r(255,255,255,255)},591(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAsync=t.decode=t.Decoder=t.DecoderAsync=void 0;const A=i(939),s=i(199),r=function(e){if("undefined"!=typeof Buffer)return Buffer.from(e,"base64");const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e1,this.modeHandler=e=>1}handle_band(e){return this.bandHandler(e)}mode_parsed(e){return this.modeHandler(e)}}const h={memoryLimit:134217728,sixelColor:A.DEFAULT_FOREGROUND,fillColor:A.DEFAULT_BACKGROUND,palette:A.PALETTE_VT340_COLOR,paletteLimit:s.LIMITS.PALETTE_SIZE,truncate:!0};function g(e){const t=new n,i={env:{handle_band:t.handle_band.bind(t),mode_parsed:t.mode_parsed.bind(t)}};return WebAssembly.instantiate(o||r,i).then(i=>(o=o||i.module,new d(e,i.instance||i,t)))}t.DecoderAsync=g;class d{constructor(e,t,i){if(this._PIXEL_OFFSET=s.LIMITS.MAX_WIDTH+4,this._canvas=a,this._bandWidths=[],this._maxWidth=0,this._minWidth=s.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0,this._opts=Object.assign({},h,e),this._opts.paletteLimit>s.LIMITS.PALETTE_SIZE)throw new Error(`DecoderOptions.paletteLimit must not exceed ${s.LIMITS.PALETTE_SIZE}`);if(t)i.bandHandler=this._handle_band.bind(this),i.modeHandler=this._initCanvas.bind(this);else{const e=o||(o=new WebAssembly.Module(r));t=new WebAssembly.Instance(e,{env:{handle_band:this._handle_band.bind(this),mode_parsed:this._initCanvas.bind(this)}})}this._instance=t,this._wasm=this._instance.exports,this._chunk=new Uint8Array(this._wasm.memory.buffer,this._wasm.get_chunk_address(),s.LIMITS.CHUNK_SIZE),this._states=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_state_address(),12),this._palette=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_palette_address(),s.LIMITS.PALETTE_SIZE),this._palette.set(this._opts.palette),this._pSrc=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_p0_address()),this._wasm.init(A.DEFAULT_FOREGROUND,0,this._opts.paletteLimit,0)}get _fillColor(){return this._states[0]}get _truncate(){return this._states[8]}get _rasterWidth(){return this._states[6]}get _rasterHeight(){return this._states[7]}get _width(){return this._states[2]?this._states[2]-4:0}get _height(){return this._states[3]}get _level(){return this._states[9]}get _mode(){return this._states[10]}get _paletteLimit(){return this._states[11]}_initCanvas(e){if(2===e){const e=this.width*this.height;if(e>this._canvas.length){if(this._opts.memoryLimit&&4*e>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(e)}this._maxWidth=this._width}else if(1===e)if(2===this._level){const e=Math.min(this._rasterWidth,s.LIMITS.MAX_WIDTH)*this._rasterHeight;if(e>this._canvas.length){if(this._opts.memoryLimit&&4*e>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(e)}}else this._canvas.length<65536&&(this._canvas=new Uint32Array(65536));return 0}_realloc(e,t){const i=e+t;if(i>this._canvas.length){if(this._opts.memoryLimit&&4*i>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");const e=new Uint32Array(65536*Math.ceil(i/65536));e.set(this._canvas),this._canvas=e}}_handle_band(e){const t=this._PIXEL_OFFSET;let i=this._lastOffset;if(2===this._mode){let A=this.height-this._currentHeight,s=0;for(;s<6&&A>0;)this._canvas.set(this._pSrc.subarray(t*s,t*s+e),i+e*s),s++,A--;this._lastOffset+=e*s,this._currentHeight+=s}else if(1===this._mode){this._realloc(i,6*e),this._maxWidth=Math.max(this._maxWidth,e),this._minWidth=Math.min(this._minWidth,e);for(let A=0;A<6;++A)this._canvas.set(this._pSrc.subarray(t*A,t*A+e),i+e*A);this._bandWidths.push(e),this._lastOffset+=6*e,this._currentHeight+=6}return 0}get width(){return 1!==this._mode?this._width:Math.max(this._maxWidth,this._wasm.current_width())}get height(){return 1!==this._mode?this._height:this._wasm.current_width()?6*this._bandWidths.length+this._wasm.current_height():6*this._bandWidths.length}get palette(){return this._palette.subarray(0,this._paletteLimit)}get memoryUsage(){return this._canvas.byteLength+this._wasm.memory.buffer.byteLength+8*this._bandWidths.length}get properties(){return{width:this.width,height:this.height,mode:this._mode,level:this._level,truncate:!!this._truncate,paletteLimit:this._paletteLimit,fillColor:this._fillColor,memUsage:this.memoryUsage,rasterAttributes:{numerator:this._states[4],denominator:this._states[5],width:this._rasterWidth,height:this._rasterHeight}}}init(e=this._opts.fillColor,t=this._opts.palette,i=this._opts.paletteLimit,A=this._opts.truncate){this._wasm.init(this._opts.sixelColor,e,i,A?1:0),t&&this._palette.set(t.subarray(0,s.LIMITS.PALETTE_SIZE)),this._bandWidths.length=0,this._maxWidth=0,this._minWidth=s.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0}decode(e,t=0,i=e.length){let A=t;for(;A0){const i=this._PIXEL_OFFSET;let A=this._lastOffset,s=0;for(;s<6&&t>0;)this._canvas.set(this._pSrc.subarray(i*s,i*s+e),A+e*s),s++,t--;t&&this._canvas.fill(this._fillColor,A+e*s)}return this._canvas.subarray(0,this.width*this.height)}if(1===this._mode){if(this._minWidth===this._maxWidth){let t=!1;if(e)if(e!==this._minWidth)t=!0;else{const t=this._PIXEL_OFFSET;let i=this._lastOffset;this._realloc(i,6*e);for(let A=0;A<6;++A)this._canvas.set(this._pSrc.subarray(t*A,t*A+e),i+e*A)}if(!t)return this._canvas.subarray(0,this.width*this.height)}const t=new Uint32Array(this.width*this.height);t.fill(this._fillColor);let i=0,A=0;for(let e=0;e{if(this._disposed)return(0,A.toDisposable)(()=>{});const s={fn:e,thisArgs:t};this._listeners=this._listeners.slice(),this._listeners.push(s);const r=(0,A.toDisposable)(()=>{const e=this._listeners.indexOf(s);-1!==e&&(this._listeners=this._listeners.slice(),this._listeners.splice(e,1))});return i&&(Array.isArray(i)?i.push(r):i.add(r)),r}),this._event}fire(e){if(this._disposed||!this._listeners.length)return;if(1===this._listeners.length)return void this._listeners[0].fn.call(this._listeners[0].thisArgs,e);const t=this._listeners;for(let i=0,A=t.length;it.fire(e))},e.map=function(e,t){return(i,A,s)=>e(e=>i.call(A,t(e)),void 0,s)},e.any=function(...e){return(t,i,s)=>{const r=new A.DisposableStore;for(const A of e)r.add(A(e=>t.call(i,e)));return s&&(Array.isArray(s)?s.push(r):s.add(r)),r}},e.runAndSubscribe=function(e,t,i){return t(i),e(e=>t(e))}}(s||(t.EventUtils=s={}))},426(e,t){function i(e){return{dispose:e}}function A(e){if(!e)return e;if(Array.isArray(e)){for(const t of e)t.dispose();return[]}return e.dispose(),e}Object.defineProperty(t,"__esModule",{value:!0}),t.MutableDisposable=t.Disposable=t.DisposableStore=void 0,t.toDisposable=i,t.dispose=A,t.combinedDisposable=function(...e){return i(()=>A(e))};class s{constructor(){this._disposables=new Set,this._isDisposed=!1}get isDisposed(){return this._isDisposed}add(e){return this._isDisposed?e.dispose():this._disposables.add(e),e}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.clear()}}clear(){for(const e of this._disposables)e.dispose();this._disposables.clear()}}t.DisposableStore=s;class r{constructor(){this._store=new s}dispose(){this._store.dispose()}_register(e){return this._store.add(e)}}t.Disposable=r,r.None=Object.freeze({dispose(){}}),t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}}},795(e,t,i){var A=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IIPHandler=void 0;const s=i(463),r=i(699),o=A(i(669)),a=A(i(61)),n=i(389),h=i(462),g={type:0,name:"Unnamed file",size:0,width:"auto",height:"auto",preserveAspectRatio:1,inline:0};t.IIPHandler=class{constructor(e,t,i,A){this._opts=e,this._renderer=t,this._storage=i,this._coreTerminal=A,this._generation=0,this._aborted=!1,this._hp=new n.HeaderParser,this._header=g,this._isMultipart=!1,this._abortMulti=!1;const s=Math.ceil(4*this._opts.iipSizeLimit/3),r=Math.min(1048576,s);this._dec=new o.default(0,s,r),this._qoiDec=new a.default(0)}reset(){this._generation++,this._hp.reset(),this._dec.release(),this._qoiDec.release()}start(){this._aborted=!1,this._hp.reset()}put(e,t,i){if(!this._aborted)if(4===this._hp.state)0!==this._dec.put(e.subarray(t,i))&&(this._dec.release(),this._aborted=!0);else{const A=this._hp.parse(e,t,i);if(-1===A)return void(this._aborted=!0);if(A>0){if(1===this._hp.fields.type){if(this._isMultipart&&(this._isMultipart=!1,this._abortMulti=!1,this._dec.release()),this._header=Object.assign({},g,this._hp.fields),!this._header.inline)return void(this._aborted=!0);if(!this._initDecoder())return void(this._aborted=!0)}else if(this._abortMulti)return void(this._aborted=!0);0!==this._dec.put(e.subarray(A,i))&&(this._dec.release(),this._aborted=!0,this._isMultipart&&(this._abortMulti=!0))}}}end(e){var t,i,A;if(this._aborted)return!0;if(4!==this._hp.state&&this._hp.end())return!0;const o=this._hp.fields.type;if(3===o)return!0;if(5===o){let e=r.CELL_SIZE_DEFAULT.width,i=r.CELL_SIZE_DEFAULT.height;this._renderer.dimensions&&(e=this._renderer.dimensions.css.canvas.width/this._coreTerminal.cols,i=this._renderer.dimensions.css.canvas.height/this._coreTerminal.rows);const s=null!==(A=null===(t=this._coreTerminal._core._coreBrowserService)||void 0===t?void 0:t.dpr)&&void 0!==A?A:1,o=`]1337;ReportCellSize=${i.toFixed(3)};${e.toFixed(3)};${s.toFixed(3)}\\`;return this._coreTerminal.input(o,!1),!0}if(2===o)return this._header=Object.assign({},g,this._hp.fields),this._isMultipart=!0,this._abortMulti=!1,this._dec.release(),this._initDecoder()||(this._abortMulti=!0),!0;if(4===o){if(!this._isMultipart)return!0;if(this._isMultipart=!1,this._abortMulti||2!==this._header.type)return!0}let a,n,d=0,l=0,I=h.UNSUPPORTED_TYPE;if((a=e)&&((a=!this._dec.end())?(I=(0,h.imageType)(this._dec.data8),(a="unsupported"!==I.mime)?(d=I.width,l=I.height,(a=d&&l&&d*lc!==this._generation?(e.close(),!0):(this._storage.addImage(e),!0)).catch(e=>(console.warn(`IIP: decoding error ${I.mime} ${I.width}x${I.height}`,e),!0))}_initDecoder(){try{return this._dec.init(),!0}catch(e){return console.warn("IIP: could not allocate decoder",e),this._dec.release(),!1}}_resize(e,t){var i,A,s,o;const a=(null===(i=this._renderer.dimensions)||void 0===i?void 0:i.css.cell.width)||r.CELL_SIZE_DEFAULT.width,n=(null===(A=this._renderer.dimensions)||void 0===A?void 0:A.css.cell.height)||r.CELL_SIZE_DEFAULT.height,h=(null===(s=this._renderer.dimensions)||void 0===s?void 0:s.css.canvas.width)||a*this._coreTerminal.cols,g=(null===(o=this._renderer.dimensions)||void 0===o?void 0:o.css.canvas.height)||n*this._coreTerminal.rows,d=this._dim(this._header.width,h,a),l=this._dim(this._header.height,g,n);if(!d&&!l){const i=h/e,A=(g-n)/t,s=Math.min(i,A);return s<1?[e*s,t*s]:[e,t]}return d?!this._header.preserveAspectRatio&&d&&l?[d,l]:[d,t*d/e]:[e*l/t,l]}_dim(e,t,i){return"auto"===e?0:e.endsWith("%")?parseInt(e.slice(0,-1),10)*t/100:e.endsWith("px")?parseInt(e.slice(0,-2),10):parseInt(e,10)*i}}},389(e,t){function i(e){let t="";for(let i=0;i57)throw new Error("illegal char");t=10*t+e[i]-48}return t}function s(e){const t=i(e);if(!t.match(/^((auto)|(\d+?((px)|(%)){0,1}))$/))throw new Error("illegal size");return t}Object.defineProperty(t,"__esModule",{value:!0}),t.HeaderParser=void 0;const r={inline:A,size:A,name:function(e){if("undefined"!=typeof Buffer)return Buffer.from(i(e),"base64").toString();const t=atob(i(e)),A=new Uint8Array(t.length);for(let e=0;e14)return-1;for(let h=t;h=d)return this._a();r[s++]=t}break;case 58:return 3!==A||this._storeValue(s)?(this.state=4,h+1):this._a();default:if(s>=d)return this._a();r[s++]=t}}return this.state=A,this._position=s,-2}_a(){return this.fields.type=0,this.state=1,-1}_storeKey(e){const t=i(this._buffer.subarray(0,e));return!!t&&(this._key=t,this.fields[t]=null,!0)}_storeValue(e){if(this._key){try{const t=this._buffer.slice(0,e);this.fields[this._key]=r[this._key]?r[this._key](t):t}catch(e){return!1}return!0}return!1}}},649(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.IIPImageStorage=void 0,t.IIPImageStorage=class{constructor(e){this._storage=e,this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"iip"}}addImage(e){this._storage.addImage(e,this._addImageOpts)}}},462(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.UNSUPPORTED_TYPE=void 0,t.imageType=function(e){if(e.length<32)return t.UNSUPPORTED_TYPE;const i=new Uint32Array(e.buffer,e.byteOffset,8);if(1196314761===i[0]&&169478669===i[1]&&1380206665===i[3])return{mime:"image/png",width:e[16]<<24|e[17]<<16|e[18]<<8|e[19],height:e[20]<<24|e[21]<<16|e[22]<<8|e[23]};if(255===e[0]&&216===e[1]&&255===e[2]){const[t,i]=function(e){const t=e.length;let i=4,A=e[i]<<8|e[i+1];for(;;){if(i+=A,i>=t)return[0,0];if(255!==e[i])return[0,0];if(192===e[i+1]||194===e[i+1])return i+8>>14&16383)};case 32:return 157!==e[23]||1!==e[24]||42!==e[25]?t.UNSUPPORTED_TYPE:{mime:"image/webp",width:16383&(e[26]|e[27]<<8),height:16383&(e[28]|e[29]<<8)}}return t.UNSUPPORTED_TYPE}if(1887007846===i[1]&&(1718187617===i[2]||1936291425===i[2])){let i=-1;const A=Math.min(e.length-16,1024);for(let t=8;t0&&A>0)return{mime:"image/avif",width:t,height:A}}return t.UNSUPPORTED_TYPE}return t.UNSUPPORTED_TYPE},t.UNSUPPORTED_TYPE={mime:"unsupported",width:0,height:0}},463(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageRenderer=void 0;const A=i(939),s=i(426);class r extends s.Disposable{get canvas(){var e;return null===(e=this._layers.get("top"))||void 0===e?void 0:e.canvas}static createCanvas(e,t,i){const A=(null!=e?e:document).createElement("canvas");return A.width=0|t,A.height=0|i,A}static createImageData(e,t,i,A){if("function"!=typeof ImageData){const s=e.createImageData(t,i);return A&&s.data.set(new Uint8ClampedArray(A,0,t*i*4)),s}return A?new ImageData(new Uint8ClampedArray(A,0,t*i*4),t,i):new ImageData(t,i)}static createImageBitmap(e){return"function"!=typeof createImageBitmap?Promise.resolve(void 0):createImageBitmap(e)}constructor(e){super(),this._terminal=e,this._layers=new Map,this._optionsRefresh=this._register(new s.MutableDisposable),this._oldOpen=this._terminal._core.open,this._terminal._core.open=e=>{var t;null===(t=this._oldOpen)||void 0===t||t.call(this._terminal._core,e),this._open()},this._terminal._core.screenElement&&this._open(),this._optionsRefresh.value=this._terminal._core.optionsService.onOptionChange(e=>{var t;"fontSize"===e&&(this.rescaleCanvas(),null===(t=this._renderService)||void 0===t||t.refreshRows(0,this._terminal.rows))}),this._register((0,s.toDisposable)(()=>{var e;this.removeLayerFromDom(),this.removeLayerFromDom("bottom"),this._terminal._core&&this._oldOpen&&(this._terminal._core.open=this._oldOpen,this._oldOpen=void 0),this._renderService&&this._oldSetRenderer&&(this._renderService.setRenderer=this._oldSetRenderer,this._oldSetRenderer=void 0),this._renderService=void 0,this._layers.clear(),null===(e=this._placeholderBitmap)||void 0===e||e.close(),this._placeholderBitmap=void 0,this._placeholder=void 0}))}showPlaceholder(e){var t,i;e?this._placeholder||-1===this.cellSize.height||this._createPlaceHolder(Math.max(this.cellSize.height+1,24)):(null===(t=this._placeholderBitmap)||void 0===t||t.close(),this._placeholderBitmap=void 0,this._placeholder=void 0),null===(i=this._renderService)||void 0===i||i.refreshRows(0,this._terminal.rows)}get dimensions(){return this._terminal.dimensions}get cellSize(){var e,t;return{width:(null===(e=this.dimensions)||void 0===e?void 0:e.css.cell.width)||-1,height:(null===(t=this.dimensions)||void 0===t?void 0:t.css.cell.height)||-1}}clearLines(e,t,i){var A,s,r,o,a;const n=e*((null===(A=this.dimensions)||void 0===A?void 0:A.css.cell.height)||0),h=(null===(s=this.dimensions)||void 0===s?void 0:s.css.canvas.width)||0,g=(t+1-e)*((null===(r=this.dimensions)||void 0===r?void 0:r.css.cell.height)||0);i&&"top"!==i||null===(o=this._layers.get("top"))||void 0===o||o.clearRect(0,n,h,g),i&&"bottom"!==i||null===(a=this._layers.get("bottom"))||void 0===a||a.clearRect(0,n,h,g)}clearAll(e){if(!e||"top"===e){const e=this._layers.get("top");null==e||e.clearRect(0,0,e.canvas.width,e.canvas.height)}if(!e||"bottom"===e){const e=this._layers.get("bottom");null==e||e.clearRect(0,0,e.canvas.width,e.canvas.height)}}draw(e,t,i,A,s=1){const r=this._layers.get(e.layer);if(!r)return;const{width:o,height:a}=this.cellSize;if(-1===o||-1===a)return;this._rescaleImage(e,o,a);const n=e.actual,{width:h,height:g}=e.actualCellSize,d=Math.ceil(n.width/h),l=t%d*h,I=Math.floor(t/d)*g,c=i*o,_=A*a,C=s*h+l>n.width?n.width-l:s*h,B=I+g>n.height?n.height-I:g;r.drawImage(n,Math.floor(l),Math.floor(I),Math.ceil(C),Math.ceil(B),Math.floor(c),Math.floor(_),Math.ceil(C*o/h),Math.ceil(B*a/g))}extractTile(e,t){const{width:i,height:A}=this.cellSize;if(-1===i||-1===A)return;this._rescaleImage(e,i,A);const s=e.actual,{width:o,height:a}=e.actualCellSize,n=Math.ceil(s.width/o),h=t%n*o,g=Math.floor(t/n)*a,d=o+h>s.width?s.width-h:o,l=g+a>s.height?s.height-g:a,I=r.createCanvas(this.document,Math.ceil(d*i/o),Math.ceil(l*A/a)),c=I.getContext("2d");return c?(c.drawImage(s,Math.floor(h),Math.floor(g),Math.floor(d),Math.floor(l),0,0,I.width,I.height),I):void 0}drawPlaceholder(e,t,i=1){var A;const s=this._layers.get("top");if(s){const{width:r,height:o}=this.cellSize;if(-1===r||-1===o)return;if(this._placeholder?o>=this._placeholder.height&&this._createPlaceHolder(o+1):this._createPlaceHolder(Math.max(o+1,24)),!this._placeholder)return;s.drawImage(null!==(A=this._placeholderBitmap)&&void 0!==A?A:this._placeholder,e*r,t*o%2?0:1,r*i,o,e*r,t*o,r*i,o)}}rescaleCanvas(){var e,t;const i=(null===(e=this.dimensions)||void 0===e?void 0:e.css.canvas.width)||0,A=(null===(t=this.dimensions)||void 0===t?void 0:t.css.canvas.height)||0;for(const e of this._layers.values())e.canvas.width===i&&e.canvas.height===A||(e.canvas.width=i,e.canvas.height=A)}_rescaleImage(e,t,i){if(t===e.actualCellSize.width&&i===e.actualCellSize.height)return;const{width:A,height:s}=e.origCellSize;if(t===A&&i===s)return e.actual=e.orig,e.actualCellSize.width=A,void(e.actualCellSize.height=s);const o=Math.ceil(e.orig.width*t/A),a=Math.ceil(e.orig.height*i/s);if(o*a>e.orig.width*e.orig.height)return e.actual=e.orig,e.actualCellSize.width=A,void(e.actualCellSize.height=s);const n=r.createCanvas(this.document,o,a),h=n.getContext("2d");h&&(h.drawImage(e.orig,0,0,n.width,n.height),e.actual=n,e.actualCellSize.width=t,e.actualCellSize.height=i)}_open(){this._renderService=this._terminal._core._renderService,this._oldSetRenderer=this._renderService.setRenderer.bind(this._renderService),this._renderService.setRenderer=e=>{var t;for(const e of[...this._layers.keys()])this.removeLayerFromDom(e);null===(t=this._oldSetRenderer)||void 0===t||t.call(this._renderService,e)}}insertLayerToDom(e="top"){var t,i;if(!this.document||!this._terminal._core.screenElement)return void console.warn("image addon: cannot insert output canvas to DOM, missing document or screenElement");if(this._layers.has(e))return;const A=r.createCanvas(this.document,(null===(t=this.dimensions)||void 0===t?void 0:t.css.canvas.width)||0,(null===(i=this.dimensions)||void 0===i?void 0:i.css.canvas.height)||0);A.classList.add(`xterm-image-layer-${e}`);const s=this._terminal._core.screenElement;s.style.isolation="isolate","bottom"===e?(A.style.zIndex="-1",s.insertBefore(A,s.firstChild)):(A.style.zIndex="0",s.appendChild(A));const o=A.getContext("2d",{alpha:!0});o?(this._layers.set(e,o),this.clearAll(e)):A.remove()}removeLayerFromDom(e="top"){const t=this._layers.get(e);t&&(t.canvas.remove(),this._layers.delete(e))}hasLayer(e){return this._layers.has(e)}_createPlaceHolder(e=24){var t;null===(t=this._placeholderBitmap)||void 0===t||t.close(),this._placeholderBitmap=void 0;const i=32,s=r.createCanvas(this.document,i,e),o=s.getContext("2d",{alpha:!1});if(!o)return;const a=r.createImageData(o,i,e),n=new Uint32Array(a.data.buffer),h=(0,A.toRGBA8888)(0,0,0),g=(0,A.toRGBA8888)(255,255,255);n.fill(h);for(let t=0;t{this._placeholder!==I?null==e||e.close():this._placeholderBitmap=e}).catch(()=>{})}get document(){var e;return null===(e=this._terminal._core._coreBrowserService)||void 0===e?void 0:e.window.document}}t.ImageRenderer=r},699(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageStorage=t.CELL_SIZE_DEFAULT=void 0;const A=i(463);t.CELL_SIZE_DEFAULT={width:7,height:14};class s{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}get urlId(){return this._urlId}set urlId(e){this._urlId=e}constructor(e=0,t=0,i=-1,A=-1){this.imageId=i,this.tileId=A,this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new s(this._ext,this._urlId,this.imageId,this.tileId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId&&-1===this.imageId}}const r=new s;t.ImageStorage=class{constructor(e,t,i){this._terminal=e,this._renderer=t,this._opts=i,this._images=new Map,this._lastId=0,this._lowestId=0,this._fullyCleared=!1,this._needsFullClear=!1,this._pixelLimit=25e5;try{this.setLimit(this._opts.storageLimit)}catch(e){e instanceof Error&&console.error(e.message),console.warn(`storageLimit is set to ${this.getLimit()} MB`)}this._viewportMetrics={cols:this._terminal.cols,rows:this._terminal.rows}}dispose(){this.reset()}reset(){var e;for(const t of this._images.values())null===(e=t.marker)||void 0===e||e.dispose();this._images.clear(),this._renderer.clearAll()}getLimit(){return 4*this._pixelLimit/1e6}setLimit(e){if(e<.5||e>1e3)throw RangeError("invalid storageLimit, should be at least 0.5 MB and not exceed 1G");this._pixelLimit=e/4*1e6>>>0,this._evictOldest(0)}getUsage(){return 4*this._getStoredPixels()/1e6}_getStoredPixels(){let e=0;for(const t of this._images.values())t.orig&&(e+=t.orig.width*t.orig.height,t.actual&&t.actual!==t.orig&&(e+=t.actual.width*t.actual.height));return e}_delImg(e){var t;const i=this._images.get(e);i&&(this._images.delete(e),window.ImageBitmap&&i.orig instanceof ImageBitmap&&i.orig.close(),null===(t=this.onImageDeleted)||void 0===t||t.call(this,e))}wipeAlternate(){var e;const t=[];for(const[i,A]of this._images.entries())"alternate"===A.bufferType&&(null===(e=A.marker)||void 0===e||e.dispose(),t.push(i));for(const e of t)this._delImg(e);this._needsFullClear=!0,this._fullyCleared=!1}deleteImage(e){var t;const i=this._images.get(e);i&&(null===(t=i.marker)||void 0===t||t.dispose(),this._delImg(e))}addImage(e,i){var A,s;this._evictOldest(e.width*e.height);let r=this._renderer.cellSize;-1!==r.width&&-1!==r.height||(r=t.CELL_SIZE_DEFAULT);const o=Math.ceil(e.width/r.width),a=Math.ceil(e.height/r.height),n=++this._lastId,h=this._terminal._core.buffer,g=this._terminal.cols,d=this._terminal.rows,l=h.x,I=h.y;let c=l,_=0;i.scrolling||(h.x=0,h.y=0,c=0),this._terminal._core._inputHandler._dirtyRowTracker.markDirty(h.y);for(let e=0;e=g);++i)this._writeToCell(t,c+i,n,e*o+i),_++;if(i.scrolling)e=d)break;h.x=c}this._terminal._core._inputHandler._dirtyRowTracker.markDirty(h.y),i.scrolling?"iip"===i.cursorPos?h.x=Math.min(c+o,g):h.x=c:(h.x=l,h.y=I);const C=[];for(const[e,t]of this._images.entries())t.tileCount<1&&(null===(A=t.marker)||void 0===A||A.dispose(),C.push(e));for(const e of C)this._delImg(e);const B=this._terminal.registerMarker(0);null==B||B.onDispose(()=>{this._images.get(n)&&this._delImg(n)}),"alternate"===this._terminal.buffer.active.type&&this._evictOnAlternate();const Q={orig:e,origCellSize:r,actual:e,actualCellSize:Object.assign({},r),marker:B||void 0,tileCount:_,bufferType:this._terminal.buffer.active.type,layer:i.layer,zIndex:i.zIndex};return this._images.set(n,Q),null===(s=this.onImageAdded)||void 0===s||s.call(this),n}render(e){var t,i;let A=!1,s=!1;for(const e of this._images.values())if("bottom"===e.layer?s=!0:A=!0,A&&s)break;if(A&&!this._renderer.hasLayer("top")&&(this._renderer.insertLayerToDom("top"),!this._renderer.hasLayer("top")))return;if(s&&!this._renderer.hasLayer("bottom")&&this._renderer.insertLayerToDom("bottom"),this._renderer.rescaleCanvas(),!this._images.size)return this._fullyCleared||(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1),this._renderer.hasLayer("top")&&this._renderer.removeLayerFromDom("top"),void(this._renderer.hasLayer("bottom")&&this._renderer.removeLayerFromDom("bottom"));!A&&this._renderer.hasLayer("top")&&(this._renderer.clearAll("top"),this._renderer.removeLayerFromDom("top")),!s&&this._renderer.hasLayer("bottom")&&(this._renderer.clearAll("bottom"),this._renderer.removeLayerFromDom("bottom")),this._needsFullClear&&(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1);const{start:o,end:a}=e,n=this._terminal._core.buffer,h=this._terminal._core.cols;this._renderer.clearLines(o,a);const g=[],d=[];for(let e=o;e<=a;++e){const A=n.lines.get(e+n.ydisp);if(!A)return;for(let s=0;se.imgSpec.zIndex-t.imgSpec.zIndex);for(const e of d)this._renderer.drawPlaceholder(e.col,e.row,e.count);for(const e of g)this._renderer.draw(e.imgSpec,e.tileId,e.col,e.row,e.count)}viewportResize(e){var t,i;if(!this._images.size)return void(this._viewportMetrics=e);if(this._viewportMetrics.cols>=e.cols)return void(this._viewportMetrics=e);const A=this._terminal._core.buffer,s=A.lines.length,o=this._viewportMetrics.cols-1;for(let a=0;a=h)continue;let g=!1;for(let t=o+1;t>e.cols;++t)if(4194303&s._data[3*t+0]){g=!0;break}if(g)continue;const d=Math.min(e.cols,h-A.tileId%h+o);let l=A.tileId;for(let e=o+1;e4194304&&e.release();const A=null!==(i=n.get(t))&&void 0!==i?i:[];A.length<2&&(A.push(e),n.set(t,A))}function d(e){return A.BIG_ENDIAN?e:(255&e)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255}t.SixelHandler=class{constructor(e,t,i){var A;this._opts=e,this._storage=t,this._coreTerminal=i,this._size=0,this._aborted=!1,this._decMemoryLimit=0,this._palette=new Uint32Array(o.LIMITS.PALETTE_SIZE),this._palette.set(a),A=4*this._opts.pixelLimit,h||(h=!0,(0,r.DecoderAsync)({memoryLimit:A,palette:a}).then(e=>g(e,A),()=>{h=!1}))}reset(){this._returnDecoder(),this._palette.fill(0),this._palette.set(a)}hook(e){var t;this._size=0,this._aborted=!1,this._returnDecoder();const i=4*this._opts.pixelLimit;try{this._dec=function(e){var t,i;return null!==(i=null===(t=n.get(e))||void 0===t?void 0:t.pop())&&void 0!==i?i:new r.Decoder({memoryLimit:e,palette:a})}(i)}catch(e){return console.warn(`SIXEL: could not allocate decoder - ${e}`),void(this._aborted=!0)}this._decMemoryLimit=i;const s=1===e.params[1]?0:function(e,t){let i=0;if(!t)return i;if(e.isInverse())if(e.isFgDefault())i=d(t.foreground.rgba);else if(e.isFgRGB()){const t=e.constructor.toColorRGB(e.getFgColor());i=(0,A.toRGBA8888)(...t)}else i=d(t.ansi[e.getFgColor()].rgba);else if(e.isBgDefault())i=d(t.background.rgba);else if(e.isBgRGB()){const t=e.constructor.toColorRGB(e.getBgColor());i=(0,A.toRGBA8888)(...t)}else i=d(t.ansi[e.getBgColor()].rgba);return i}(this._coreTerminal._core._inputHandler._curAttrData,null===(t=this._coreTerminal._core._themeService)||void 0===t?void 0:t.colors);this._dec.init(s,this._palette,this._opts.sixelPaletteLimit)}_returnDecoder(){const e=this._dec;e&&(this._dec=void 0,this._palette.set(e.palette),g(e,this._decMemoryLimit))}put(e,t,i){if(!this._aborted&&this._dec){if(this._size+=i-t,this._size>this._opts.sixelSizeLimit)return console.warn("SIXEL: too much data, aborting"),this._aborted=!0,void this._dec.release();try{this._dec.decode(e,t,i)}catch(e){console.warn(`SIXEL: error while decoding image - ${e}`),this._aborted=!0,this._dec.release()}}}unhook(e){try{return this._unhook(e)}finally{this._returnDecoder()}}_unhook(e){var t;if(this._aborted||!e||!this._dec)return!0;const i=this._dec.width,A=this._dec.height;if(!i||!A)return A&&this._storage.advanceCursor(A),!0;const r=s.ImageRenderer.createCanvas(void 0,i,A);return null===(t=r.getContext("2d"))||void 0===t||t.putImageData(new ImageData(this._dec.data8,i,A),0,0),this._storage.addImage(r),!0}}},994(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.SixelImageStorage=void 0;const A=i(699);t.SixelImageStorage=class{constructor(e,t,i,A){this._storage=e,this._opts=t,this._renderer=i,this._terminal=A,this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"vt340"}}addImage(e){this._addImageOpts.scrolling=this._opts.sixelScrolling,this._storage.addImage(e,this._addImageOpts)}advanceCursor(e){if(this._opts.sixelScrolling){let t=this._renderer.cellSize;-1!==t.width&&-1!==t.height||(t=A.CELL_SIZE_DEFAULT);const i=Math.ceil(e/t.height);for(let e=1;e512)return void(this._aborted=!0);if(this._controlData.set(e.subarray(t,s),this._controlLength),this._controlLength+=r,!this._inControlData){if(this._parsedCommand=(0,n.parseKittyCommand)(this._parseControlDataString()),void 0!==this._parsedCommand.id&&void 0!==this._parsedCommand.imageNumber)return this._sendResponse(this._parsedCommand.id,"EINVAL:cannot specify both i and I keys",null!==(A=this._parsedCommand.quiet)&&void 0!==A?A:0),void(this._aborted=!0);if("d"===this._parsedCommand.action)return;const t=s+1;tthis._encodedSizeLimit){const e=null!==(g=this._activeDecoder)&&void 0!==g?g:null==_?void 0:_.decoder;return e&&e.release(),this._activeDecoder=null,_&&this._removePendingEntry(c),void(this._aborted=!0)}if(!this._decodeError){if((null==_?void 0:_.decoder)&&!this._activeDecoder&&(this._activeDecoder=_.decoder),!this._activeDecoder){const e=this._maxEncodedBytes+131072;if(e>1e6*this._opts.storageLimit)return this._aborted=!0,void(void 0!==(null===(s=this._parsedCommand)||void 0===s?void 0:s.id)&&this._sendResponse(this._parsedCommand.id,"ENOMEM:pending image budget exceeded",null!==(d=this._parsedCommand.quiet)&&void 0!==d?d:0));const t=Math.max(1,Math.floor(1e6*this._opts.storageLimit/e));for(;this._pendingTransmissions.size>=t;){const e=this._pendingTransmissions.entries().next().value;if(!e)break;e[1].decoder.release(),this._removePendingEntry(e[0]),void 0!==e[1].cmd.id&&this._sendResponse(e[1].cmd.id,"ENOMEM:pending image budget exceeded",null!==(l=e[1].cmd.quiet)&&void 0!==l?l:0)}const i=new a.default(4194304,this._maxEncodedBytes,this._initialEncodedBytes);try{i.init()}catch(e){return console.warn("KITTY: could not allocate decoder",e),this._aborted=!0,void(void 0!==(null===(r=this._parsedCommand)||void 0===r?void 0:r.id)&&this._sendResponse(this._parsedCommand.id,"ENOMEM:could not allocate decoder",null!==(I=this._parsedCommand.quiet)&&void 0!==I?I:0))}this._activeDecoder=i}0!==this._activeDecoder.put(e.subarray(t,i))&&(this._activeDecoder.release(),this._activeDecoder=null,this._decodeError=!0,_&&this._removePendingEntry(c))}}end(e){var t,i;if(this._aborted||!e)return this._activeDecoder&&(this._activeDecoder.release(),this._activeDecoder=null),!0;if(this._inControlData)return this._handleNoPayloadCommand();const A=this._parsedCommand;if("d"===A.action)return this._handleDelete(A);const s=null!==(i=null!==(t=A.id)&&void 0!==t?t:this._lastPendingKey)&&void 0!==i?i:0,r=1===A.more,o=this._pendingTransmissions.get(s);if(r)return this._activeDecoder&&(o?(o.totalEncodedSize+=this._totalEncodedSize,o.decodeError=o.decodeError||this._decodeError):this._pendingTransmissions.set(s,{cmd:Object.assign({},A),decoder:this._activeDecoder,totalEncodedSize:this._totalEncodedSize,decodeError:this._decodeError}),this._lastPendingKey=s,this._activeDecoder=null),!0;o&&(this._lastPendingKey=void 0);let a=this._decodeError,n=A,h=this._activeDecoder;o&&(n=o.cmd,h=o.decoder,a=a||o.decodeError,this._pendingTransmissions.delete(s));let g=new Uint8Array(0);h&&(0!==h.end()&&(a=!0),g=h.data8),this._activeDecoder=null;const d=this._handleCommandWithBytesAndCmd(n,g,a);return h&&h.release(),d}_parseControlDataString(){let e="";for(let t=0;t0&&this._sendResponse(e.id,"OK",null!==(o=e.quiet)&&void 0!==o?o:0)),A}case"T":return this._handleTransmitDisplay(e,t,i);case"q":return this._handleQuery(e,t,i);case"p":return this._handlePlacement(e);default:return void 0!==e.id&&this._sendResponse(e.id,"EINVAL:unsupported action",null!==(a=e.quiet)&&void 0!==a?a:0),!0}}_handlePlacement(e){var t;if(void 0===e.id)return!0;const i=e.id,A=this._kittyStorage.getImage(i);return A?this._displayImage(A,e).then(t=>{var A;return this._sendResponse(i,t?"OK":"EINVAL:image rendering failed",null!==(A=e.quiet)&&void 0!==A?A:0,e.placementId),!0}):(this._sendResponse(i,"ENOENT:image not found",null!==(t=e.quiet)&&void 0!==t?t:0,e.placementId),!0)}_handleTransmit(e,t,i){var A,s,r,o,a,n;return"d"!==(null!==(A=e.transmission)&&void 0!==A?A:"d")?(void 0!==e.id&&this._sendResponse(e.id,"EINVAL:unsupported transmission medium",null!==(s=e.quiet)&&void 0!==s?s:0),!0):(i||0===t.length||this._kittyStorage.storeImage(e.id,{data:new Blob([t]),width:null!==(r=e.width)&&void 0!==r?r:0,height:null!==(o=e.height)&&void 0!==o?o:0,format:null!==(a=e.format)&&void 0!==a?a:32,compression:null!==(n=e.compression)&&void 0!==n?n:""}),!0)}_handleTransmitDisplay(e,t,i){var A,s;if(i)return void 0!==e.id&&this._sendResponse(e.id,"EINVAL:invalid base64 data",null!==(A=e.quiet)&&void 0!==A?A:0),!0;this._handleTransmit(e,t,i);const r=null!==(s=e.id)&&void 0!==s?s:this._kittyStorage.lastImageId,o=this._kittyStorage.getImage(r);if(o){const t=this._displayImage(o,e);return void 0!==e.id?t.then(t=>{var i;return this._sendResponse(r,t?"OK":"EINVAL:image rendering failed",null!==(i=e.quiet)&&void 0!==i?i:0),!0}):t.then(()=>!0)}return!0}_handleQuery(e,t,i){var A,s,r,o,a,n;const h=null!==(A=e.id)&&void 0!==A?A:0,g=null!==(s=e.quiet)&&void 0!==s?s:0;if("d"!==(null!==(r=e.transmission)&&void 0!==r?r:"d"))return this._sendResponse(h,"EINVAL:unsupported transmission medium",g),!0;if(i)return this._sendResponse(h,"EINVAL:invalid base64 data",g),!0;if(0===t.length)return this._sendResponse(h,"OK",g),!0;const d=null!==(o=e.format)&&void 0!==o?o:32;if(100===d)this._sendResponse(h,"OK",g);else{const i=null!==(a=e.width)&&void 0!==a?a:0,A=null!==(n=e.height)&&void 0!==n?n:0;if(!i||!A)return this._sendResponse(h,"EINVAL:width and height required for raw pixel data",g),!0;const s=i*A*(32===d?4:3);if(t.length=1)return;if(!s&&i>=2)return;const r=`_Gi=${e}${A?`,p=${A}`:""};${t}\\`;this._coreTerminal._core.coreService.triggerDataEvent(r)}_displayImage(e,t){return this._decodeAndDisplay(e,t).then(()=>!0).catch(()=>!1)}async _decodeAndDisplay(e,t){var i,A,o,a,n,h,g;const d=this._generation;let l=await this._createBitmap(e);try{if(d!==this._generation)throw new Error("image decode canceled");const I=Math.max(0,null!==(o=t.x)&&void 0!==o?o:0),c=Math.max(0,null!==(a=t.y)&&void 0!==a?a:0),_=t.sourceWidth||l.width-I,C=t.sourceHeight||l.height-c,B=Math.max(0,l.width-I),Q=Math.max(0,l.height-c),m=Math.max(0,Math.min(_,B)),u=Math.max(0,Math.min(C,Q));if(0===m||0===u)throw new Error("invalid source rectangle");if(0!==I||0!==c||m!==l.width||u!==l.height){const e=await createImageBitmap(l,I,c,m,u);l.close(),l=e}const E=(null===(i=this._renderer.dimensions)||void 0===i?void 0:i.css.cell.width)||r.CELL_SIZE_DEFAULT.width,p=(null===(A=this._renderer.dimensions)||void 0===A?void 0:A.css.cell.height)||r.CELL_SIZE_DEFAULT.height;let w,f;void 0!==t.columns&&void 0!==t.rows?(w=t.columns,f=t.rows):void 0!==t.columns?(w=t.columns,f=Math.max(1,Math.ceil(l.height/l.width*(w*E)/p))):void 0!==t.rows?(f=t.rows,w=Math.max(1,Math.ceil(l.width/l.height*(f*p)/E))):(w=Math.ceil(l.width/E),f=Math.ceil(l.height/p));let D=l.width,y=l.height;if(void 0===t.columns&&void 0===t.rows||(D=Math.round(w*E),y=Math.round(f*p)),D*y>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");const v=this._coreTerminal._core.buffer,M=v.x,k=v.y,b=v.ybase,S=void 0!==t.zIndex&&t.zIndex<0?"bottom":"top";if(D!==l.width||y!==l.height){const e=await createImageBitmap(l,{resizeWidth:D,resizeHeight:y});l.close(),l=e}const L=Math.min(Math.max(0,null!==(n=t.xOffset)&&void 0!==n?n:0),E-1),N=Math.min(Math.max(0,null!==(h=t.yOffset)&&void 0!==h?h:0),p-1);if(0!==L||0!==N){const e=void 0!==t.columns?Math.round(w*E):l.width+L,i=void 0!==t.rows?Math.round(f*p):l.height+N,A=s.ImageRenderer.createCanvas(window.document,e,i),r=A.getContext("2d");if(!r)throw new Error("Failed to create offset canvas context");r.drawImage(l,L,N);const o=await createImageBitmap(A);if(A.width=A.height=0,l.close(),l=o,D=l.width,y=l.height,D*y>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");void 0===t.columns&&(w=Math.ceil(l.width/E)),void 0===t.rows&&(f=Math.ceil(l.height/p))}if(d!==this._generation)throw new Error("image decode canceled");const G=null!==(g=t.zIndex)&&void 0!==g?g:0;if(this._kittyStorage.addImage(e.id,l,!0,S,G),l=void 0,1===t.cursorMovement){const e=v.ybase-b;v.x=M,v.y=Math.max(k-e,0)}else v.x=Math.min(M+w,this._coreTerminal.cols)}catch(e){throw null==l||l.close(),e}}async _createBitmap(e){let t=new Uint8Array(await e.data.arrayBuffer());if("z"===e.compression&&(t=await this._decompressZlib(t)),100===e.format){const e=(0,o.imageType)(t);if("image/png"!==e.mime||!(e.width>0)||!(e.height>0)||e.width*e.height>this._opts.pixelLimit)throw new RangeError("PNG exceeds pixel limit or has invalid dimensions");const i=new Blob([t],{type:"image/png"});if(!window.createImageBitmap){const e=URL.createObjectURL(i),t=new Image;return new Promise((i,A)=>{t.addEventListener("load",()=>{var r;URL.revokeObjectURL(e);const o=s.ImageRenderer.createCanvas(window.document,t.width,t.height);null===(r=o.getContext("2d"))||void 0===r||r.drawImage(t,0,0),createImageBitmap(o).then(i).catch(A)}),t.addEventListener("error",()=>{URL.revokeObjectURL(e),A(new Error("Failed to load image"))}),t.src=e})}return createImageBitmap(i)}const i=e.width,A=e.height;if(!i||!A)throw new Error("Width and height required for raw pixel data");const r=i*A*(32===e.format?4:3);if(t.length>>24|t<<8,g[I++]=4278190080|t>>>16|i<<16,g[I++]=4278190080|i>>>8}let c=3*d,_=4*d;for(let e=d;e=e.length)return void t.close();const i=Math.min(A+4096,e.length);t.enqueue(new Uint8Array(e.subarray(A,i))),A=i}}).pipeThrough(new DecompressionStream(t)).getReader(),r=[];let o=0;try{for(;;){const{done:e,value:t}=await s.read();if(e)break;if(o+=t.byteLength,o>i)throw await s.cancel().catch(()=>{}),new RangeError("decompressed image exceeds byte limit");r.push(t)}}finally{s.releaseLock()}const a=new Uint8Array(o);let n=0;for(const e of r)a.set(e,n),n+=e.length;return a}get images(){return this._kittyStorage.images}get _kittyIdToStorageId(){return this._kittyStorage.kittyIdToStorageId}get pendingTransmissions(){return this._pendingTransmissions}}},470(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseKittyCommand=function(e){const t={},i=e.split(",");for(const e of i){const i=e.indexOf("=");if(-1===i)continue;const A=e.substring(0,i),s=e.substring(i+1);if("a"===A){t.action=s;continue}if("o"===A){t.compression=s;continue}if("t"===A){t.transmission=s;continue}if("d"===A){t.deleteSelector=s;continue}const r=parseInt(s,10);switch(A){case"f":t.format=r;break;case"i":t.id=r;break;case"I":t.imageNumber=r;break;case"s":t.width=r;break;case"v":t.height=r;break;case"x":t.x=r;break;case"y":t.y=r;break;case"w":t.sourceWidth=r;break;case"h":t.sourceHeight=r;break;case"X":t.xOffset=r;break;case"Y":t.yOffset=r;break;case"c":t.columns=r;break;case"r":t.rows=r;break;case"m":t.more=r;break;case"q":t.quiet=r;break;case"C":t.cursorMovement=r;break;case"z":t.zIndex=r;break;case"p":t.placementId=r}}return t}},235(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.KittyImageStorage=void 0;class i{constructor(e){this._storage=e,this._nextImageId=1,this._images=new Map,this._kittyIdToStorageId=new Map,this._storageIdToKittyId=new Map,this._handleStorageImageDeleted=e=>{const t=this._storageIdToKittyId.get(e);void 0!==t&&(this._kittyIdToStorageId.delete(t),this._storageIdToKittyId.delete(e),this._images.delete(t))},this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"iip"},this._previousOnImageDeleted=this._storage.onImageDeleted,this._wrappedOnImageDeleted=e=>{var t;null===(t=this._previousOnImageDeleted)||void 0===t||t.call(this,e),this._handleStorageImageDeleted(e)},this._storage.onImageDeleted=this._wrappedOnImageDeleted}reset(){this._nextImageId=1,this._images.clear(),this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}dispose(){this.reset(),this._storage.onImageDeleted===this._wrappedOnImageDeleted&&(this._storage.onImageDeleted=this._previousOnImageDeleted)}storeImage(e,t){const A=null!=e?e:this._nextImageId++,s=this._kittyIdToStorageId.get(A);void 0!==s&&(this._storage.deleteImage(s),this._kittyIdToStorageId.delete(A),this._storageIdToKittyId.delete(s)),!this._images.has(A)&&this._images.size>=i._maxStoredImages&&this._evictUndisplayedImages();const r=1e6*this._storage.getLimit();this._images.delete(A);let o=0;for(const e of this._images.values())o+=e.data.size;for(const e of[!1,!0])for(const[i,A]of this._images){if(o+t.data.size<=r)break;this._kittyIdToStorageId.has(i)===e&&(o-=A.data.size,this.deleteById(i))}return this._images.set(A,Object.assign(Object.assign({},t),{id:A})),A}addImage(e,t,i,A,s){const r=this._kittyIdToStorageId.get(e);void 0!==r&&this._storageIdToKittyId.delete(r),this._addImageOpts.scrolling=i,this._addImageOpts.layer=A,this._addImageOpts.zIndex=s;const o=this._storage.addImage(t,this._addImageOpts);this._kittyIdToStorageId.set(e,o),this._storageIdToKittyId.set(o,e)}getImage(e){return this._images.get(e)}deleteById(e){this._images.delete(e);const t=this._kittyIdToStorageId.get(e);void 0!==t&&(this._storage.deleteImage(t),this._kittyIdToStorageId.delete(e),this._storageIdToKittyId.delete(t))}deleteAll(){this._images.clear();for(const e of this._kittyIdToStorageId.values())this._storage.deleteImage(e);this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}get images(){return this._images}get kittyIdToStorageId(){return this._kittyIdToStorageId}get lastImageId(){return this._nextImageId-1}_evictUndisplayedImages(){for(const[e]of this._images){if(this._images.size<=i._maxStoredImages/2)break;this._kittyIdToStorageId.has(e)||this._images.delete(e)}}}t.KittyImageStorage=i,i._maxStoredImages=256},669(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});const A=(0,i(552).InWasm)({s:1,t:0,d:"AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML"}),s=new Uint8Array("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").map(e=>e.charCodeAt(0))),r=new Uint32Array(1024);r.fill(4278190080);for(let e=0;e>4|(e<<4&255)<<8;for(let e=0;e>2<<8|(e<<6&255)<<16;for(let e=0;ethis.maxBytes||this.maxBytes>4294901760)throw new Error("invalid byte settings")}get data8(){return this._inst?this._d.subarray(0,this._m32[1282]):o}release(){this._inst&&(this._bytes>this.keepSize?this._inst=this._m32=this._d=this._mem=null:(this._m32[1280]=0,this._m32[1281]=0,this._m32[1282]=0))}init(e,t){if(this.maxBytes=null!=e?e:this.maxBytes,this._bytes=null!=t?t:Math.min(this._bytes,this.maxBytes),this._bytes>this.maxBytes||this.maxBytes>4294901760)throw Error("invalid byte settings");let i=this._m32;const s=this._bytes+5152;this._inst?this._mem.buffer.byteLengththis.maxBytes)return-3;let e=this._bytes;for(;(e*=2)this._mem.buffer.byteLength){const t=Math.ceil((e+5152-this._mem.buffer.byteLength)/65536);this._mem.grow(t),this._m32=new Uint32Array(this._mem.buffer,0),this._d=new Uint8Array(this._mem.buffer,5152)}this._bytes=e}return 0}put(e){if(!this._inst||this._ended)return-2;if(this._realloc(e.length))return-3;const t=this._m32;return this._d.set(e,t[1280]),t[1280]+=e.length,t[1280]-t[1281]>=131072?this._inst.exports.dec():0}end(){return this._ended=!0,this._inst?this._inst.exports.end():-2}get loadedBytes(){return this._inst?this._m32[1280]:0}get freeBytes(){return this._inst?this.maxBytes-this._m32[1280]:0}}},61(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});const A=(0,i(552).InWasm)({s:1,t:0,d:"AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=="});t.default=class{constructor(e){this.keepSize=e,this.width=0,this.height=0}decode(e){this.width=e[4]<<24|e[5]<<16|e[6]<<8|e[7],this.height=e[8]<<24|e[9]<<16|e[10]<<8|e[11];const t=this.width*this.height,i=4*t,s=e.length,r=Math.max(i,s)+(Math.min(i,s)>>1)+4096;this._inst?this._mem.buffer.byteLengththis.keepSize&&(this._inst=this._d=this._mem=null)}}},552(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.InWasm=function(e){if(e.d){const{t,s:A,d:s}=e;let r,o;const a=WebAssembly;return 0===t?A?e=>new a.Instance(o||(o=new a.Module(r||(r=i(s)))),e):e=>o?a.instantiate(o,e):a.instantiate(r||(r=i(s)),e).then(e=>(o=e.module)&&e.instance):1===t?A?()=>o||(o=new a.Module(r||(r=i(s)))):()=>o?Promise.resolve(o):a.compile(r||(r=i(s))).then(e=>o=e):A?()=>r||(r=i(s)):()=>Promise.resolve(r||(r=i(s)))}if("undefined"==typeof _wasmCtx)throw new Error('must run "inwasm"');_wasmCtx.add(e)};let i=e=>{if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);if("undefined"!=typeof Buffer)return Buffer.from(e,"base64");const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e{var e=A;Object.defineProperty(e,"__esModule",{value:!0}),e.ImageAddon=void 0;const t=i(414),s=i(795),r=i(463),o=i(699),a=i(23),n=i(235),h=i(566),g=i(994),d=i(649),l={enableSizeReports:!0,pixelLimit:16777216,sixelSupport:!0,sixelScrolling:!0,sixelPaletteLimit:4096,sixelSizeLimit:33554432,storageLimit:128,showPlaceholder:!0,iipSupport:!0,iipSizeLimit:33554432,kittySupport:!0,kittySizeLimit:33554432};e.ImageAddon=class{constructor(e){this._disposables=[],this._handlers=new Map,this._onImageAdded=new t.Emitter,this.onImageAdded=this._onImageAdded.event,this._opts=Object.assign({},l,e),this._defaultOpts=Object.assign({},l,e)}dispose(){for(const e of this._handlers.values())e.reset();for(const e of this._disposables)e.dispose();this._disposables.length=0,this._handlers.clear(),this._onImageAdded.dispose()}_disposeLater(...e){for(const t of e)this._disposables.push(t)}activate(e){var t;if(this._terminal=e,this._renderer=new r.ImageRenderer(e),this._storage=new o.ImageStorage(e,this._renderer,this._opts),this._storage.onImageAdded=()=>this._onImageAdded.fire(),this._opts.enableSizeReports){const i=null!==(t=e.options.windowOptions)&&void 0!==t?t:{};i.getWinSizePixels=!0,i.getCellSizePixels=!0,i.getWinSizeChars=!0,e.options.windowOptions=i}if(this._disposeLater(this._renderer,this._storage,e.parser.registerCsiHandler({prefix:"?",final:"h"},e=>this._decset(e)),e.parser.registerCsiHandler({prefix:"?",final:"l"},e=>this._decrst(e)),e.parser.registerCsiHandler({final:"c"},e=>this._da1(e)),e.parser.registerCsiHandler({prefix:"?",final:"S"},e=>this._xtermGraphicsAttributes(e)),e.onRender(e=>{var t;return null===(t=this._storage)||void 0===t?void 0:t.render(e)}),e.parser.registerCsiHandler({intermediates:"!",final:"p"},()=>this.reset()),e.parser.registerEscHandler({final:"c"},()=>this.reset()),e._core._inputHandler.onRequestReset(()=>this.reset()),e.buffer.onBufferChange(()=>{var e;return null===(e=this._storage)||void 0===e?void 0:e.wipeAlternate()}),e.onResize(e=>{var t;return null===(t=this._storage)||void 0===t?void 0:t.viewportResize(e)})),this._opts.sixelSupport){const t=new g.SixelImageStorage(this._storage,this._opts,this._renderer,e),i=new h.SixelHandler(this._opts,t,e);this._handlers.set("sixel",i),this._disposeLater(e._core._inputHandler._parser.registerDcsHandler({final:"q"},i))}if(this._opts.iipSupport){const t=new d.IIPImageStorage(this._storage),i=new s.IIPHandler(this._opts,this._renderer,t,e);this._handlers.set("iip",i),this._disposeLater(e._core._inputHandler._parser.registerOscHandler(1337,i))}if(this._opts.kittySupport){const t=new n.KittyImageStorage(this._storage),i=new a.KittyGraphicsHandler(this._opts,this._renderer,t,e);this._handlers.set("kitty",i),this._disposeLater(t,i,e._core._inputHandler._parser.registerApcHandler({final:"G"},i))}}reset(){var e;this._opts.sixelScrolling=this._defaultOpts.sixelScrolling,this._opts.sixelPaletteLimit=this._defaultOpts.sixelPaletteLimit,null===(e=this._storage)||void 0===e||e.reset();for(const e of this._handlers.values())e.reset();return!1}get storageLimit(){var e;return(null===(e=this._storage)||void 0===e?void 0:e.getLimit())||-1}set storageLimit(e){var t;null===(t=this._storage)||void 0===t||t.setLimit(e),this._opts.storageLimit=e}get storageUsage(){return this._storage?this._storage.getUsage():-1}get showPlaceholder(){return this._opts.showPlaceholder}set showPlaceholder(e){var t;this._opts.showPlaceholder=e,null===(t=this._renderer)||void 0===t||t.showPlaceholder(e)}getImageAtBufferCell(e,t){var i;return null===(i=this._storage)||void 0===i?void 0:i.getImageAtBufferCell(e,t)}extractTileAtBufferCell(e,t){var i;return null===(i=this._storage)||void 0===i?void 0:i.extractTileAtBufferCell(e,t)}_report(e){var t;null===(t=this._terminal)||void 0===t||t._core.input(e,!1)}_decset(e){for(let t=0;t2&&!(e[2]instanceof Array)&&e[2]<=4096?(this._opts.sixelPaletteLimit=e[2],this._report(`[?${e[0]};0;${this._opts.sixelPaletteLimit}S`)):this._report(`[?${e[0]};2S`),!0;case 4:return this._report(`[?${e[0]};0;4096S`),!0;default:return this._report(`[?${e[0]};2S`),!0}if(2===e[0])switch(e[1]){case 1:let n=null===(i=null===(t=this._renderer)||void 0===t?void 0:t.dimensions)||void 0===i?void 0:i.css.canvas.width,h=null===(s=null===(A=this._renderer)||void 0===A?void 0:A.dimensions)||void 0===s?void 0:s.css.canvas.height;if(!n||!h){const e=o.CELL_SIZE_DEFAULT;n=((null===(r=this._terminal)||void 0===r?void 0:r.cols)||80)*e.width,h=((null===(a=this._terminal)||void 0===a?void 0:a.rows)||24)*e.height}if(n*h {\nreturn ","\"use strict\";\n/**\n * Copyright (c) 2019 Joerg Breitbart.\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DEFAULT_FOREGROUND = exports.DEFAULT_BACKGROUND = exports.PALETTE_ANSI_256 = exports.PALETTE_VT340_GREY = exports.PALETTE_VT340_COLOR = exports.normalizeHLS = exports.normalizeRGB = exports.nearestColorIndex = exports.fromRGBA8888 = exports.toRGBA8888 = exports.alpha = exports.blue = exports.green = exports.red = exports.BIG_ENDIAN = void 0;\n// FIXME: cleanup this mess, move things either to decoder/encoder, keep only shared things\n// system endianess\nexports.BIG_ENDIAN = new Uint8Array(new Uint32Array([0xFF000000]).buffer)[0] === 0xFF;\nif (exports.BIG_ENDIAN) {\n console.warn('BE platform detected. This version of node-sixel works only on LE properly.');\n}\n// channel values\nfunction red(n) {\n return n & 0xFF;\n}\nexports.red = red;\nfunction green(n) {\n return (n >>> 8) & 0xFF;\n}\nexports.green = green;\nfunction blue(n) {\n return (n >>> 16) & 0xFF;\n}\nexports.blue = blue;\nfunction alpha(n) {\n return (n >>> 24) & 0xFF;\n}\nexports.alpha = alpha;\n/**\n * Convert RGB channels to native color RGBA8888.\n */\nfunction toRGBA8888(r, g, b, a = 255) {\n return ((a & 0xFF) << 24 | (b & 0xFF) << 16 | (g & 0xFF) << 8 | (r & 0xFF)) >>> 0; // ABGR32\n}\nexports.toRGBA8888 = toRGBA8888;\n/**\n * Convert native color to [r, g, b, a].\n */\nfunction fromRGBA8888(color) {\n return [color & 0xFF, (color >> 8) & 0xFF, (color >> 16) & 0xFF, color >>> 24];\n}\nexports.fromRGBA8888 = fromRGBA8888;\n/**\n * Get index of nearest color in `palette` for `color`.\n * Uses euclidean distance without any luminescence correction.\n */\nfunction nearestColorIndex(color, palette) {\n const r = red(color);\n const g = green(color);\n const b = blue(color);\n let min = Number.MAX_SAFE_INTEGER;\n let idx = -1;\n // use euclidean distance (manhattan gives very poor results)\n for (let i = 0; i < palette.length; ++i) {\n const dr = r - palette[i][0];\n const dg = g - palette[i][1];\n const db = b - palette[i][2];\n const d = dr * dr + dg * dg + db * db;\n if (!d)\n return i;\n if (d < min) {\n min = d;\n idx = i;\n }\n }\n return idx;\n}\nexports.nearestColorIndex = nearestColorIndex;\n// color conversions\n// HLS taken from: http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl\nfunction clamp(low, high, value) {\n return Math.max(low, Math.min(value, high));\n}\nfunction h2c(t1, t2, c) {\n if (c < 0)\n c += 1;\n if (c > 1)\n c -= 1;\n return c * 6 < 1\n ? t2 + (t1 - t2) * 6 * c\n : c * 2 < 1\n ? t1\n : c * 3 < 2\n ? t2 + (t1 - t2) * (4 - c * 6)\n : t2;\n}\nfunction HLStoRGB(h, l, s) {\n if (!s) {\n const v = Math.round(l * 255);\n return toRGBA8888(v, v, v);\n }\n const t1 = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const t2 = 2 * l - t1;\n return toRGBA8888(clamp(0, 255, Math.round(h2c(t1, t2, h + 1 / 3) * 255)), clamp(0, 255, Math.round(h2c(t1, t2, h) * 255)), clamp(0, 255, Math.round(h2c(t1, t2, h - 1 / 3) * 255)));\n}\n/**\n * Normalize SIXEL RGB values (percent based, 0-100) to RGBA8888.\n */\nfunction normalizeRGB(r, g, b) {\n return (0xFF000000 | Math.round(b / 100 * 255) << 16 | Math.round(g / 100 * 255) << 8 | Math.round(r / 100 * 255)) >>> 0; // ABGR32\n}\nexports.normalizeRGB = normalizeRGB;\n/**\n * Normalize SIXEL HLS values to RGBA8888. Applies hue correction of +240°.\n */\nfunction normalizeHLS(h, l, s) {\n // Note: hue value is turned by 240° in VT340, all values given as fractions\n return HLStoRGB((h + 240 % 360) / 360, l / 100, s / 100);\n}\nexports.normalizeHLS = normalizeHLS;\n/**\n * default palettes\n */\n// FIXME: move palettes to Decoder.ts\n/**\n * 16 predefined color registers of VT340 (values in %):\n * ```\n * R G B\n * 0 Black 0 0 0\n * 1 Blue 20 20 80\n * 2 Red 80 13 13\n * 3 Green 20 80 20\n * 4 Magenta 80 20 80\n * 5 Cyan 20 80 80\n * 6 Yellow 80 80 20\n * 7 Gray 50% 53 53 53\n * 8 Gray 25% 26 26 26\n * 9 Blue* 33 33 60\n * 10 Red* 60 26 26\n * 11 Green* 33 60 33\n * 12 Magenta* 60 33 60\n * 13 Cyan* 33 60 60\n * 14 Yellow* 60 60 33\n * 15 Gray 75% 80 80 80\n * ```\n * (*) less saturated\n *\n * @see https://vt100.net/docs/vt3xx-gp/chapter2.html#S2.4\n*/\nexports.PALETTE_VT340_COLOR = new Uint32Array([\n normalizeRGB(0, 0, 0),\n normalizeRGB(20, 20, 80),\n normalizeRGB(80, 13, 13),\n normalizeRGB(20, 80, 20),\n normalizeRGB(80, 20, 80),\n normalizeRGB(20, 80, 80),\n normalizeRGB(80, 80, 20),\n normalizeRGB(53, 53, 53),\n normalizeRGB(26, 26, 26),\n normalizeRGB(33, 33, 60),\n normalizeRGB(60, 26, 26),\n normalizeRGB(33, 60, 33),\n normalizeRGB(60, 33, 60),\n normalizeRGB(33, 60, 60),\n normalizeRGB(60, 60, 33),\n normalizeRGB(80, 80, 80)\n]);\n/**\n * 16 predefined monochrome registers of VT340 (values in %):\n * ```\n * R G B\n * 0 Black 0 0 0\n * 1 Gray-2 13 13 13\n * 2 Gray-4 26 26 26\n * 3 Gray-6 40 40 40\n * 4 Gray-1 6 6 6\n * 5 Gray-3 20 20 20\n * 6 Gray-5 33 33 33\n * 7 White 7 46 46 46\n * 8 Black 0 0 0 0\n * 9 Gray-2 13 13 13\n * 10 Gray-4 26 26 26\n * 11 Gray-6 40 40 40\n * 12 Gray-1 6 6 6\n * 13 Gray-3 20 20 20\n * 14 Gray-5 33 33 33\n * 15 White 7 46 46 46\n * ```\n *\n * @see https://vt100.net/docs/vt3xx-gp/chapter2.html#S2.4\n */\nexports.PALETTE_VT340_GREY = new Uint32Array([\n normalizeRGB(0, 0, 0),\n normalizeRGB(13, 13, 13),\n normalizeRGB(26, 26, 26),\n normalizeRGB(40, 40, 40),\n normalizeRGB(6, 6, 6),\n normalizeRGB(20, 20, 20),\n normalizeRGB(33, 33, 33),\n normalizeRGB(46, 46, 46),\n normalizeRGB(0, 0, 0),\n normalizeRGB(13, 13, 13),\n normalizeRGB(26, 26, 26),\n normalizeRGB(40, 40, 40),\n normalizeRGB(6, 6, 6),\n normalizeRGB(20, 20, 20),\n normalizeRGB(33, 33, 33),\n normalizeRGB(46, 46, 46)\n]);\n/**\n * 256 predefined ANSI colors.\n *\n * @see https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit\n */\nexports.PALETTE_ANSI_256 = (() => {\n // 16 lower colors (taken from xterm)\n const p = [\n toRGBA8888(0, 0, 0),\n toRGBA8888(205, 0, 0),\n toRGBA8888(0, 205, 0),\n toRGBA8888(205, 205, 0),\n toRGBA8888(0, 0, 238),\n toRGBA8888(205, 0, 205),\n toRGBA8888(0, 250, 205),\n toRGBA8888(229, 229, 229),\n toRGBA8888(127, 127, 127),\n toRGBA8888(255, 0, 0),\n toRGBA8888(0, 255, 0),\n toRGBA8888(255, 255, 0),\n toRGBA8888(92, 92, 255),\n toRGBA8888(255, 0, 255),\n toRGBA8888(0, 255, 255),\n toRGBA8888(255, 255, 255),\n ];\n // colors up to 232\n const d = [0, 95, 135, 175, 215, 255];\n for (let r = 0; r < 6; ++r) {\n for (let g = 0; g < 6; ++g) {\n for (let b = 0; b < 6; ++b) {\n p.push(toRGBA8888(d[r], d[g], d[b]));\n }\n }\n }\n // grey scale to up 255\n for (let v = 8; v <= 238; v += 10) {\n p.push(toRGBA8888(v, v, v));\n }\n return new Uint32Array(p);\n})();\n/**\n * Background: Black by default.\n * Foreground: White by default.\n *\n * Background color is used whenever a fill color is needed and not explicitly set.\n * Foreground color is used as default initial sixel color.\n */\nexports.DEFAULT_BACKGROUND = toRGBA8888(0, 0, 0, 255);\nexports.DEFAULT_FOREGROUND = toRGBA8888(255, 255, 255, 255);\n//# sourceMappingURL=Colors.js.map","\"use strict\";\n/**\n * Copyright (c) 2021 Joerg Breitbart.\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeAsync = exports.decode = exports.Decoder = exports.DecoderAsync = void 0;\nconst Colors_1 = require(\"./Colors\");\nconst wasm_1 = require(\"./wasm\");\n/* istanbul ignore next */\nfunction decodeBase64(s) {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(s, 'base64');\n }\n const bytestring = atob(s);\n const result = new Uint8Array(bytestring.length);\n for (let i = 0; i < result.length; ++i) {\n result[i] = bytestring.charCodeAt(i);\n }\n return result;\n}\nconst WASM_BYTES = decodeBase64(wasm_1.LIMITS.BYTES);\nlet WASM_MODULE;\n// empty canvas\nconst NULL_CANVAS = new Uint32Array();\n// proxy for lazy binding of decoder methods to wasm env callbacks\nclass CallbackProxy {\n constructor() {\n this.bandHandler = (width) => 1;\n this.modeHandler = (mode) => 1;\n }\n handle_band(width) {\n return this.bandHandler(width);\n }\n mode_parsed(mode) {\n return this.modeHandler(mode);\n }\n}\n// default decoder options\nconst DEFAULT_OPTIONS = {\n memoryLimit: 2048 * 65536,\n sixelColor: Colors_1.DEFAULT_FOREGROUND,\n fillColor: Colors_1.DEFAULT_BACKGROUND,\n palette: Colors_1.PALETTE_VT340_COLOR,\n paletteLimit: wasm_1.LIMITS.PALETTE_SIZE,\n truncate: true\n};\n/**\n * Create a decoder instance asynchronously.\n * To be used in the browser main thread.\n */\nfunction DecoderAsync(opts) {\n const cbProxy = new CallbackProxy();\n const importObj = {\n env: {\n handle_band: cbProxy.handle_band.bind(cbProxy),\n mode_parsed: cbProxy.mode_parsed.bind(cbProxy)\n }\n };\n return WebAssembly.instantiate(WASM_MODULE || WASM_BYTES, importObj)\n .then((inst) => {\n WASM_MODULE = WASM_MODULE || inst.module;\n return new Decoder(opts, inst.instance || inst, cbProxy);\n });\n}\nexports.DecoderAsync = DecoderAsync;\n/**\n * Decoder - web assembly based sixel stream decoder.\n *\n * Usage pattern:\n * - call `init` to initialize decoder for new image\n * - feed data chunks to `decode` or `decodeString`\n * - grab pixels from `data32`\n * - optional: call `release` to free memory (e.g. after big images)\n * - start over with next image by calling `init`\n *\n * Properties:\n * - max width of 2^14 - 4 pixels (compile time setting in wasm)\n * - no explicit height limit (only limited by memory)\n * - max 4096 colors palette (compile time setting in wasm)\n *\n * Explanation operation modes:\n * - M1 Mode chosen for level 1 images (no raster attributes),\n * or for level 2 images with `truncate=false`.\n * - M2 Mode chosen for level 2 images with `truncate=true` (default).\n * While this mode is not fully spec conform (decoder not expected to truncate),\n * it is what spec conform encoders should create (should not excess raster).\n * This mode has several advantages:\n * - ~15% faster decoding speed\n * - image dimensions can be evaluated early without processing the whole data\n * - faster pixel access in `data32` (precalulated)\n * - image height is not reported as multiple of 6 pixels\n * - M0 Undecided mode state after `init`.\n * The level of an image is determined during early decoding based on the fact,\n * whether the data contains valid raster attributes before any sixel data.\n * Until then the mode of an image is marked as M0, meaning the real operation mode\n * could not be decided yet.\n */\nclass Decoder {\n /**\n * Synchonous ctor. Can be called from nodejs or a webworker context.\n * For instantiation in the browser main thread use `WasmDecoderAsync` instead.\n */\n constructor(opts, _instance, _cbProxy) {\n this._PIXEL_OFFSET = wasm_1.LIMITS.MAX_WIDTH + 4;\n this._canvas = NULL_CANVAS;\n this._bandWidths = [];\n this._maxWidth = 0;\n this._minWidth = wasm_1.LIMITS.MAX_WIDTH;\n this._lastOffset = 0;\n this._currentHeight = 0;\n this._opts = Object.assign({}, DEFAULT_OPTIONS, opts);\n if (this._opts.paletteLimit > wasm_1.LIMITS.PALETTE_SIZE) {\n throw new Error(`DecoderOptions.paletteLimit must not exceed ${wasm_1.LIMITS.PALETTE_SIZE}`);\n }\n if (!_instance) {\n const module = WASM_MODULE || (WASM_MODULE = new WebAssembly.Module(WASM_BYTES));\n _instance = new WebAssembly.Instance(module, {\n env: {\n handle_band: this._handle_band.bind(this),\n mode_parsed: this._initCanvas.bind(this)\n }\n });\n }\n else {\n _cbProxy.bandHandler = this._handle_band.bind(this);\n _cbProxy.modeHandler = this._initCanvas.bind(this);\n }\n this._instance = _instance;\n this._wasm = this._instance.exports;\n this._chunk = new Uint8Array(this._wasm.memory.buffer, this._wasm.get_chunk_address(), wasm_1.LIMITS.CHUNK_SIZE);\n this._states = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_state_address(), 12);\n this._palette = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_palette_address(), wasm_1.LIMITS.PALETTE_SIZE);\n this._palette.set(this._opts.palette);\n this._pSrc = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_p0_address());\n this._wasm.init(Colors_1.DEFAULT_FOREGROUND, 0, this._opts.paletteLimit, 0);\n }\n // some readonly parser states for internal usage\n get _fillColor() { return this._states[0]; }\n get _truncate() { return this._states[8]; }\n get _rasterWidth() { return this._states[6]; }\n get _rasterHeight() { return this._states[7]; }\n get _width() { return this._states[2] ? this._states[2] - 4 : 0; }\n get _height() { return this._states[3]; }\n get _level() { return this._states[9]; }\n get _mode() { return this._states[10]; }\n get _paletteLimit() { return this._states[11]; }\n _initCanvas(mode) {\n if (mode === 2 /* M2 */) {\n const pixels = this.width * this.height;\n if (pixels > this._canvas.length) {\n if (this._opts.memoryLimit && pixels * 4 > this._opts.memoryLimit) {\n this.release();\n throw new Error('image exceeds memory limit');\n }\n this._canvas = new Uint32Array(pixels);\n }\n this._maxWidth = this._width;\n }\n else if (mode === 1 /* M1 */) {\n if (this._level === 2) {\n // got raster attributes, use them as initial size hint\n const pixels = Math.min(this._rasterWidth, wasm_1.LIMITS.MAX_WIDTH) * this._rasterHeight;\n if (pixels > this._canvas.length) {\n if (this._opts.memoryLimit && pixels * 4 > this._opts.memoryLimit) {\n this.release();\n throw new Error('image exceeds memory limit');\n }\n this._canvas = new Uint32Array(pixels);\n }\n }\n else {\n // else fallback to generic resizing, starting with 256*256 pixels\n if (this._canvas.length < 65536) {\n this._canvas = new Uint32Array(65536);\n }\n }\n }\n return 0; // 0 - continue, 1 - abort right away\n }\n _realloc(offset, additionalPixels) {\n const pixels = offset + additionalPixels;\n if (pixels > this._canvas.length) {\n if (this._opts.memoryLimit && pixels * 4 > this._opts.memoryLimit) {\n this.release();\n throw new Error('image exceeds memory limit');\n }\n // extend in 65536 pixel blocks\n const newCanvas = new Uint32Array(Math.ceil(pixels / 65536) * 65536);\n newCanvas.set(this._canvas);\n this._canvas = newCanvas;\n }\n }\n _handle_band(width) {\n const adv = this._PIXEL_OFFSET;\n let offset = this._lastOffset;\n if (this._mode === 2 /* M2 */) {\n let remaining = this.height - this._currentHeight;\n let c = 0;\n while (c < 6 && remaining > 0) {\n this._canvas.set(this._pSrc.subarray(adv * c, adv * c + width), offset + width * c);\n c++;\n remaining--;\n }\n this._lastOffset += width * c;\n this._currentHeight += c;\n }\n else if (this._mode === 1 /* M1 */) {\n this._realloc(offset, width * 6);\n this._maxWidth = Math.max(this._maxWidth, width);\n this._minWidth = Math.min(this._minWidth, width);\n for (let i = 0; i < 6; ++i) {\n this._canvas.set(this._pSrc.subarray(adv * i, adv * i + width), offset + width * i);\n }\n this._bandWidths.push(width);\n this._lastOffset += width * 6;\n this._currentHeight += 6;\n }\n return 0; // 0 - continue, 1 - abort right away\n }\n /**\n * Width of the image data.\n * Returns the rasterWidth in level2/truncating mode,\n * otherwise the max width, that has been seen so far.\n */\n get width() {\n return this._mode !== 1 /* M1 */\n ? this._width\n : Math.max(this._maxWidth, this._wasm.current_width());\n }\n /**\n * Height of the image data.\n * Returns the rasterHeight in level2/truncating mode,\n * otherwise height touched by sixels.\n */\n get height() {\n return this._mode !== 1 /* M1 */\n ? this._height\n : this._wasm.current_width()\n ? this._bandWidths.length * 6 + this._wasm.current_height()\n : this._bandWidths.length * 6;\n }\n /**\n * Get active palette colors as RGBA8888[] (borrowed).\n */\n get palette() {\n return this._palette.subarray(0, this._paletteLimit);\n }\n /**\n * Get the memory used by the decoder.\n *\n * This is a rough estimate accounting the wasm instance memory\n * and pixel buffers held on JS side (real value will be slightly\n * higher due to JS book-keeping).\n * Note that the decoder does not free ressources on its own,\n * call `release` to free excess memory.\n */\n get memoryUsage() {\n return this._canvas.byteLength + this._wasm.memory.buffer.byteLength + 8 * this._bandWidths.length;\n }\n /**\n * Get various properties of the decoder and the current image.\n */\n get properties() {\n return {\n width: this.width,\n height: this.height,\n mode: this._mode,\n level: this._level,\n truncate: !!this._truncate,\n paletteLimit: this._paletteLimit,\n fillColor: this._fillColor,\n memUsage: this.memoryUsage,\n rasterAttributes: {\n numerator: this._states[4],\n denominator: this._states[5],\n width: this._rasterWidth,\n height: this._rasterHeight,\n }\n };\n }\n /**\n * Initialize decoder for next image. Must be called before\n * any calls to `decode` or `decodeString`.\n */\n // FIXME: reorder arguments, better palette handling\n init(fillColor = this._opts.fillColor, palette = this._opts.palette, paletteLimit = this._opts.paletteLimit, truncate = this._opts.truncate) {\n this._wasm.init(this._opts.sixelColor, fillColor, paletteLimit, truncate ? 1 : 0);\n if (palette) {\n this._palette.set(palette.subarray(0, wasm_1.LIMITS.PALETTE_SIZE));\n }\n this._bandWidths.length = 0;\n this._maxWidth = 0;\n this._minWidth = wasm_1.LIMITS.MAX_WIDTH;\n this._lastOffset = 0;\n this._currentHeight = 0;\n }\n /**\n * Decode next chunk of data from start to end index (exclusive).\n * @throws Will throw if the image exceeds the memory limit.\n */\n decode(data, start = 0, end = data.length) {\n let p = start;\n while (p < end) {\n const length = Math.min(end - p, wasm_1.LIMITS.CHUNK_SIZE);\n this._chunk.set(data.subarray(p, p += length));\n this._wasm.decode(0, length);\n }\n }\n /**\n * Decode next chunk of string data from start to end index (exclusive).\n * Note: Decoding from string data is rather slow, use `decode` with byte data instead.\n * @throws Will throw if the image exceeds the memory limit.\n */\n decodeString(data, start = 0, end = data.length) {\n let p = start;\n while (p < end) {\n const length = Math.min(end - p, wasm_1.LIMITS.CHUNK_SIZE);\n for (let i = 0, j = p; i < length; ++i, ++j) {\n this._chunk[i] = data.charCodeAt(j);\n }\n p += length;\n this._wasm.decode(0, length);\n }\n }\n /**\n * Get current pixel data as 32-bit typed array (RGBA8888).\n * Also peeks into pixel data of the current band, that got not pushed yet.\n */\n get data32() {\n if (this._mode === 0 /* M0 */ || !this.width || !this.height) {\n return NULL_CANVAS;\n }\n // get width of pending band to peek into left-over data\n const currentWidth = this._wasm.current_width();\n if (this._mode === 2 /* M2 */) {\n let remaining = this.height - this._currentHeight;\n if (remaining > 0) {\n const adv = this._PIXEL_OFFSET;\n let offset = this._lastOffset;\n let c = 0;\n while (c < 6 && remaining > 0) {\n this._canvas.set(this._pSrc.subarray(adv * c, adv * c + currentWidth), offset + currentWidth * c);\n c++;\n remaining--;\n }\n if (remaining) {\n this._canvas.fill(this._fillColor, offset + currentWidth * c);\n }\n }\n return this._canvas.subarray(0, this.width * this.height);\n }\n if (this._mode === 1 /* M1 */) {\n if (this._minWidth === this._maxWidth) {\n let escape = false;\n if (currentWidth) {\n if (currentWidth !== this._minWidth) {\n escape = true;\n }\n else {\n const adv = this._PIXEL_OFFSET;\n let offset = this._lastOffset;\n this._realloc(offset, currentWidth * 6);\n for (let i = 0; i < 6; ++i) {\n this._canvas.set(this._pSrc.subarray(adv * i, adv * i + currentWidth), offset + currentWidth * i);\n }\n }\n }\n if (!escape) {\n return this._canvas.subarray(0, this.width * this.height);\n }\n }\n // worst case: re-align pixels if we have bands with different width\n // This is somewhat allocation intensive, any way to do that in-place, and just once?\n const final = new Uint32Array(this.width * this.height);\n final.fill(this._fillColor);\n let finalOffset = 0;\n let start = 0;\n for (let i = 0; i < this._bandWidths.length; ++i) {\n const bw = this._bandWidths[i];\n for (let p = 0; p < 6; ++p) {\n final.set(this._canvas.subarray(start, start += bw), finalOffset);\n finalOffset += this.width;\n }\n }\n // also handle left-over pixels of the current band\n if (currentWidth) {\n const adv = this._PIXEL_OFFSET;\n // other than finished bands, this runs only up to currentHeight\n const currentHeight = this._wasm.current_height();\n for (let i = 0; i < currentHeight; ++i) {\n final.set(this._pSrc.subarray(adv * i, adv * i + currentWidth), finalOffset + this.width * i);\n }\n }\n return final;\n }\n // fallthrough for all not handled cases\n return NULL_CANVAS;\n }\n /**\n * Same as `data32`, but returning pixel data as Uint8ClampedArray suitable\n * for direct usage with `ImageData`.\n */\n get data8() {\n return new Uint8ClampedArray(this.data32.buffer, 0, this.width * this.height * 4);\n }\n /**\n * Release image ressources on JS side held by the decoder.\n *\n * The decoder tries to re-use memory ressources of a previous image\n * to lower allocation and GC pressure. Decoding a single big image\n * will grow the memory usage of the decoder permanently.\n * Call `release` to reset the internal buffers and free the memory.\n * Note that this destroys the image data, call it when done processing\n * a rather big image, otherwise it is not needed. Use `memoryUsage`\n * to decide, whether the held memory is still within your limits.\n * This does not affect the wasm module (operates on static memory).\n */\n release() {\n this._canvas = NULL_CANVAS;\n this._bandWidths.length = 0;\n this._maxWidth = 0;\n this._minWidth = wasm_1.LIMITS.MAX_WIDTH;\n // also nullify parser states in wasm to avoid\n // width/height reporting potential out-of-bound values\n this._wasm.init(Colors_1.DEFAULT_FOREGROUND, 0, this._opts.paletteLimit, 0);\n }\n}\nexports.Decoder = Decoder;\n/**\n * Convenient decoding functions for easier usage.\n *\n * These can be used for casual decoding of sixel images,\n * that dont come in as stream chunks.\n * Note that the functions instantiate a stream decoder for every call,\n * which comes with a performance penalty of ~25%.\n */\n/**\n * Decode function with synchronous wasm loading.\n * Can be used in a web worker or in nodejs. Does not work reliable in normal browser context.\n * @throws Will throw if the image exceeds the memory limit.\n */\nfunction decode(data, opts) {\n const dec = new Decoder(opts);\n dec.init();\n typeof data === 'string' ? dec.decodeString(data) : dec.decode(data);\n return {\n width: dec.width,\n height: dec.height,\n data32: dec.data32,\n data8: dec.data8\n };\n}\nexports.decode = decode;\n/**\n * Decode function with asynchronous wasm loading.\n * Use this version in normal browser context.\n * @throws Will throw if the image exceeds the memory limit.\n */\nasync function decodeAsync(data, opts) {\n const dec = await DecoderAsync(opts);\n dec.init();\n typeof data === 'string' ? dec.decodeString(data) : dec.decode(data);\n return {\n width: dec.width,\n height: dec.height,\n data32: dec.data32,\n data8: dec.data8\n };\n}\nexports.decodeAsync = decodeAsync;\n//# sourceMappingURL=Decoder.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LIMITS = void 0;\nexports.LIMITS = {\n CHUNK_SIZE: 16384,\n PALETTE_SIZE: 4096,\n MAX_WIDTH: 16384,\n BYTES: 'AGFzbQEAAAABJAdgAAF/YAJ/fwBgA39/fwF/YAF/AX9gAABgBH9/f38AYAF/AAIlAgNlbnYLaGFuZGxlX2JhbmQAAwNlbnYLbW9kZV9wYXJzZWQAAwMTEgQAAAAAAQQBAQUBAAACAgAGAwQFAXABBwcFBAEBBwcGCAF/AUGAihoLB9wBDgZtZW1vcnkCABFnZXRfc3RhdGVfYWRkcmVzcwADEWdldF9jaHVua19hZGRyZXNzAAQOZ2V0X3AwX2FkZHJlc3MABRNnZXRfcGFsZXR0ZV9hZGRyZXNzAAYEaW5pdAALBmRlY29kZQAMDWN1cnJlbnRfd2lkdGgADQ5jdXJyZW50X2hlaWdodAAOGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtfaW5pdGlhbGl6ZQACCXN0YWNrU2F2ZQARDHN0YWNrUmVzdG9yZQASCnN0YWNrQWxsb2MAEwkMAQBBAQsGCgcJDxACDAEBCq5UEgMAAQsFAEGgCAsGAEGQiQELBgBBsIkCCwUAQZAJC+okAQh/QeQIKAIAIQVB4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AEHYiwIgADcDAEHQiwIgADcDAEHIiwIgADcDAEHAiwIgADcDAEG4iwIgADcDAEGwiwIgADcDAEGoiwIgADcDAEGgiwIgADcDAEGYiwIgADcDAEGQiwIgADcDAEGIiwIgADcDAEGAiwIgADcDAEH4igIgADcDAEHwigIgADcDAEHoigIgADcDAEHgigIgADcDAEHYigIgADcDAEHQigIgADcDAEHIigIgADcDAEHAigIgADcDAEG4igIgADcDAEGwigIgADcDAEGoigIgADcDAEGgigIgADcDAEGYigIgADcDAEGQigIgADcDAEGIigIgADcDAEGAigIgADcDAEH4iQIgADcDAEHwiQIgADcDAEHoiQIgADcDAEHgiQIgADcDAEHYiQIgADcDAEHQiQIgADcDAEHIiQIgADcDAEHAiQIgADcDAEG4iQIgADcDAEGwiQIgADcDAEGoCCgCACIEQf8AakGAAW0hCAJAIARBgQFIDQBBASEBIAhBAiAIQQJKG0EBayICQQFxIQMgBEGBAk4EQCACQX5xIQIDQCABQQl0IgdBEHJBoIkCakGwiQJBgAT8CgAAIAdBsI0CakGwiQJBgAT8CgAAIAFBAmohASACQQJrIgINAAsLIANFDQAgAUEJdEEQckGgiQJqQbCJAkGABPwKAAALAkAgBEEBSA0AIAhBASAIQQFKGyIDQQFxIQUCQCADQQFrIgdFBEBBACEBDAELIANB/v///wdxIQJBACEBA0AgAUEJdCIGQRByQbCJBmpBsIkCQYAE/AoAACAGQZAEckGwiQZqQbCJAkGABPwKAAAgAUECaiEBIAJBAmsiAg0ACwsgBQRAIAFBCXRBEHJBsIkGakGwiQJBgAT8CgAACyAEQQFIDQAgA0EBcSEFIAcEfyADQf7///8HcSECQQAhAQNAIAFBCXQiBkEQckHAiQpqQbCJAkGABPwKAAAgBkGQBHJBwIkKakGwiQJBgAT8CgAAIAFBAmohASACQQJrIgINAAsgAUEHdEEEcgVBBAshASAFBEAgAUECdEHAiQpqQbCJAkGABPwKAAALIARBAUgNACADQQFxIQUgBwR/IANB/v///wdxIQJBACEBA0AgAUEJdCIGQRByQdCJDmp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AkACAACwsYAQBBgAgLEQEAAAACAAAAAwAAAAQAAAAF'\n};\n//# sourceMappingURL=wasm.js.map","/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal event utilities for xterm.js core.\n * Simplified from VS Code's event.ts - no leak detection/profiling.\n */\n\nimport { IDisposable, DisposableStore, toDisposable } from './Lifecycle';\n\nexport interface IEvent {\n (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\n}\n\nexport class Emitter {\n private _listeners: { fn: (e: T) => any, thisArgs: any }[] = [];\n private _disposed = false;\n private _event: IEvent | undefined;\n\n public get event(): IEvent {\n if (this._event) {\n return this._event;\n }\n this._event = (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n if (this._disposed) {\n return toDisposable(() => {});\n }\n\n const entry = { fn: listener, thisArgs };\n this._listeners = this._listeners.slice();\n this._listeners.push(entry);\n\n const result = toDisposable(() => {\n const idx = this._listeners.indexOf(entry);\n if (idx !== -1) {\n this._listeners = this._listeners.slice();\n this._listeners.splice(idx, 1);\n }\n });\n\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(result);\n } else {\n disposables.add(result);\n }\n }\n\n return result;\n };\n return this._event;\n }\n\n public fire(event: T): void {\n if (this._disposed || !this._listeners.length) {\n return;\n }\n if (this._listeners.length === 1) {\n this._listeners[0].fn.call(this._listeners[0].thisArgs, event);\n return;\n }\n const listeners = this._listeners;\n for (let i = 0, len = listeners.length; i < len; ++i) {\n listeners[i].fn.call(listeners[i].thisArgs, event);\n }\n }\n\n public dispose(): void {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n this._listeners.length = 0;\n }\n}\n\nexport namespace EventUtils {\n export function forward(from: IEvent, to: Emitter): IDisposable {\n return from(e => to.fire(e));\n }\n\n export function map(event: IEvent, map: (i: I) => O): IEvent {\n return (listener: (e: O) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n return event(i => listener.call(thisArgs, map(i)), undefined, disposables);\n };\n }\n\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent {\n return (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n const store = new DisposableStore();\n for (const event of events) {\n store.add(event(e => listener.call(thisArgs, e)));\n }\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(store);\n } else {\n disposables.add(store);\n }\n }\n return store;\n };\n }\n\n export function runAndSubscribe(event: IEvent, handler: (e: T) => void, initial: T): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void, initial?: T): IDisposable {\n handler(initial);\n return event(e => handler(e));\n }\n}\n","/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal lifecycle utilities for xterm.js core.\n * Simplified from VS Code's lifecycle.ts - no tracking/leak detection.\n */\n\nexport interface IDisposable {\n dispose(): void;\n}\n\nexport function toDisposable(fn: () => void): IDisposable {\n return { dispose: fn };\n}\n\nexport function dispose(disposable: T): T;\nexport function dispose(disposable: T | undefined): T | undefined;\nexport function dispose(disposables: T[]): T[];\nexport function dispose(arg: T | T[] | undefined): T | T[] | undefined {\n if (!arg) {\n return arg;\n }\n if (Array.isArray(arg)) {\n for (const d of arg) {\n d.dispose();\n }\n return [];\n }\n arg.dispose();\n return arg;\n}\n\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n return toDisposable(() => dispose(disposables));\n}\n\nexport class DisposableStore implements IDisposable {\n private readonly _disposables = new Set();\n private _isDisposed = false;\n\n public get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n public add(o: T): T {\n if (this._isDisposed) {\n o.dispose();\n } else {\n this._disposables.add(o);\n }\n return o;\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n\n public clear(): void {\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n}\n\nexport abstract class Disposable implements IDisposable {\n public static readonly None: IDisposable = Object.freeze({ dispose() { } });\n\n protected readonly _store = new DisposableStore();\n\n public dispose(): void {\n this._store.dispose();\n }\n\n protected _register(o: T): T {\n return this._store.add(o);\n }\n}\n\nexport class MutableDisposable implements IDisposable {\n private _value: T | undefined;\n private _isDisposed = false;\n\n public get value(): T | undefined {\n return this._isDisposed ? undefined : this._value;\n }\n\n public set value(value: T | undefined) {\n if (this._isDisposed || value === this._value) {\n return;\n }\n this._value?.dispose();\n this._value = value;\n }\n\n public clear(): void {\n this.value = undefined;\n }\n\n public dispose(): void {\n this._isDisposed = true;\n this._value?.dispose();\n this._value = undefined;\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IImageAddonOptions, IOscHandler, IResetHandler, ITerminalExt } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { CELL_SIZE_DEFAULT } from './ImageStorage';\nimport Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport QoiDecoder from 'xterm-wasm-parts/lib/qoi/QoiDecoder.wasm';\nimport { HeaderParser, IHeaderFields, HeaderState, SequenceType } from './IIPHeaderParser';\nimport { imageType, UNSUPPORTED_TYPE } from './IIPMetrics';\n\n// Local const enum mirror - esbuild can't inline const enums from external packages\nconst enum DecoderConst {\n // Limit held memory in base64 decoder (encoded bytes).\n KEEP_DATA = 4194304,\n // Initial buffer allocation for the decoder.\n INITIAL_DATA = 1048576,\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n OK = 0\n}\n\n// default IIP header values\nconst DEFAULT_HEADER: IHeaderFields = {\n type: SequenceType.INVALID,\n name: 'Unnamed file',\n size: 0,\n width: 'auto',\n height: 'auto',\n preserveAspectRatio: 1,\n inline: 0\n};\n\n\nexport class IIPHandler implements IOscHandler, IResetHandler {\n private _aborted = false;\n private _hp = new HeaderParser();\n private _header: IHeaderFields = DEFAULT_HEADER;\n private _dec: Base64Decoder;\n private _qoiDec: QoiDecoder;\n private _isMultipart = false;\n private _abortMulti = false;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _storage: IIPImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n const maxEncodedBytes = Math.ceil(this._opts.iipSizeLimit * 4 / 3);\n const initialBytes = Math.min(DecoderConst.INITIAL_DATA, maxEncodedBytes);\n this._dec = new Base64Decoder(DecoderConst.KEEP_DATA, maxEncodedBytes, initialBytes);\n this._qoiDec = new QoiDecoder(DecoderConst.KEEP_DATA);\n }\n\n public reset(): void {\n this._hp.reset();\n this._dec.release();\n this._qoiDec.release();\n }\n\n public start(): void {\n this._aborted = false;\n this._hp.reset();\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (this._hp.state === HeaderState.END) {\n if ((this._dec.put(data.subarray(start, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n }\n } else {\n const dataPos = this._hp.parse(data, start, end);\n if (dataPos === -1) {\n this._aborted = true;\n return;\n }\n if (dataPos > 0) {\n const seqType = this._hp.fields.type;\n if (seqType === SequenceType.FILE) {\n if (this._isMultipart) {\n this._isMultipart = false;\n this._abortMulti = false;\n this._dec.release();\n }\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n if (!this._header.inline) {\n this._aborted = true;\n return;\n }\n this._dec.init();\n } else if (this._abortMulti) {\n this._aborted = true;\n return;\n }\n if ((this._dec.put(data.subarray(dataPos, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n if (this._isMultipart) this._abortMulti = true;\n }\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted) return true;\n\n if (this._hp.state !== HeaderState.END) {\n if (this._hp.end()) return true;\n }\n const seqType = this._hp.fields.type;\n\n if (seqType === SequenceType.FILEPART) return true;\n\n if (seqType === SequenceType.REPORTCELLSIZE) {\n // OSC 1337 ; ReportCellSize=[height];[width];[scale] ST\n let w = CELL_SIZE_DEFAULT.width;\n let h = CELL_SIZE_DEFAULT.height;\n if (this._renderer.dimensions) {\n w = this._renderer.dimensions.css.canvas.width / this._coreTerminal.cols;\n h = this._renderer.dimensions.css.canvas.height / this._coreTerminal.rows;\n }\n const scale = this._coreTerminal._core._coreBrowserService?.dpr ?? 1;\n const report = `\\x1b]1337;ReportCellSize=${h.toFixed(3)};${w.toFixed(3)};${scale.toFixed(3)}\\x1b\\\\`;\n this._coreTerminal.input(report, false);\n return true;\n }\n\n if (seqType === SequenceType.MULTIPARTFILE) {\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n this._isMultipart = true;\n this._abortMulti = false;\n this._dec.release();\n this._dec.init();\n return true;\n }\n\n if (seqType === SequenceType.FILEEND) {\n if (!this._isMultipart) return true;\n this._isMultipart = false;\n if (this._abortMulti || this._header.type !== SequenceType.MULTIPARTFILE) return true;\n }\n\n // fallthrough for SequenceType.FILE & SequenceType.FILEEND\n\n let w = 0;\n let h = 0;\n\n // early exit condition chain\n let cond: number | boolean;\n let metrics = UNSUPPORTED_TYPE;\n if (cond = success) {\n if (cond = !this._dec.end()) {\n metrics = imageType(this._dec.data8);\n if (cond = metrics.mime !== 'unsupported') {\n w = metrics.width;\n h = metrics.height;\n if (cond = w && h && w * h < this._opts.pixelLimit) {\n [w, h] = this._resize(w, h).map(Math.floor);\n cond = w && h && w * h < this._opts.pixelLimit;\n } else {\n console.warn(`IIP: image dimension issue ${metrics.width}x${metrics.height}`);\n }\n } else {\n console.warn('IIP: unsupported image type');\n }\n } else {\n console.warn('IIP: error during BASE64 decoding');\n }\n }\n if (!cond) {\n this._dec.release();\n return true;\n }\n\n let blob: Blob | ImageData;\n if (metrics.mime === 'image/qoi') {\n const data = this._qoiDec.decode(this._dec.data8);\n blob = new ImageData(\n new Uint8ClampedArray(data.buffer, data.byteOffset, data.byteLength),\n this._qoiDec.width,\n this._qoiDec.height\n );\n this._qoiDec.release();\n if (w === this._qoiDec.width && h === this._qoiDec.height) {\n // use fast-path if we don't need to rescale\n this._dec.release();\n const canvas = ImageRenderer.createCanvas(undefined, this._qoiDec.width, this._qoiDec.height);\n canvas.getContext('2d')?.putImageData(blob, 0, 0);\n this._storage.addImage(canvas);\n return true;\n }\n } else {\n blob = new Blob([this._dec.data8], { type: metrics.mime });\n }\n this._dec.release();\n return createImageBitmap(blob, { resizeWidth: w, resizeHeight: h })\n .then(bm => {\n this._storage.addImage(bm);\n return true;\n })\n .catch(e => {\n console.warn(`IIP: decoding error ${metrics.mime} ${metrics.width}x${metrics.height}`, e);\n return true;\n });\n }\n\n private _resize(w: number, h: number): [number, number] {\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n const width = this._renderer.dimensions?.css.canvas.width || cw * this._coreTerminal.cols;\n const height = this._renderer.dimensions?.css.canvas.height || ch * this._coreTerminal.rows;\n\n const rw = this._dim(this._header.width!, width, cw);\n const rh = this._dim(this._header.height!, height, ch);\n if (!rw && !rh) {\n const wf = width / w; // TODO: should this respect initial cursor offset?\n const hf = (height - ch) / h; // TODO: fix offset issues from float cell height\n const f = Math.min(wf, hf);\n return f < 1 ? [w * f, h * f] : [w, h];\n }\n return !rw\n ? [w * rh / h, rh]\n : this._header.preserveAspectRatio || !rw || !rh\n ? [rw, h * rw / w] : [rw, rh];\n }\n\n private _dim(s: string, total: number, cdim: number): number {\n if (s === 'auto') return 0;\n if (s.endsWith('%')) return parseInt(s.slice(0, -1), 10) * total / 100;\n if (s.endsWith('px')) return parseInt(s.slice(0, -2), 10);\n return parseInt(s, 10) * cdim;\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// eslint-disable-next-line\ndeclare const Buffer: any;\n\nexport const enum HeaderState {\n START = 0,\n ABORT = 1,\n KEY = 2,\n VALUE = 3,\n END = 4\n}\n\nexport const enum SequenceType {\n INVALID = 0,\n FILE = 1,\n MULTIPARTFILE = 2,\n FILEPART = 3,\n FILEEND = 4,\n REPORTCELLSIZE = 5\n}\n\nexport interface IHeaderFields {\n [key: string]: number | string | Uint32Array | null | undefined;\n // sequence type\n type: SequenceType;\n // base-64 encoded filename. Defaults to \"Unnamed file\".\n name: string;\n // File size in bytes. The file transfer will be canceled if this size is exceeded.\n size: number;\n /**\n * Optional width and height to render:\n * - N: N character cells.\n * - Npx: N pixels.\n * - N%: N percent of the session's width or height.\n * - auto: The image's inherent size will be used to determine an appropriate dimension.\n */\n width?: string;\n height?: string;\n // Optional, defaults to 1 respecting aspect ratio (width takes precedence).\n preserveAspectRatio?: number;\n // Optional, defaults to 0. If set to 1, the file will be displayed inline, else downloaded\n // (download not supported).\n inline?: number;\n}\n\n// field value decoders\n\n// ASCII bytes to string\nfunction toStr(data: Uint32Array): string {\n let s = '';\n for (let i = 0; i < data.length; ++i) {\n s += String.fromCharCode(data[i]);\n }\n return s;\n}\n\n// digits to integer\nfunction toInt(data: Uint32Array): number {\n let v = 0;\n for (let i = 0; i < data.length; ++i) {\n if (data[i] < 48 || data[i] > 57) {\n throw new Error('illegal char');\n }\n v = v * 10 + data[i] - 48;\n }\n return v;\n}\n\n// check for correct size entry\nfunction toSize(data: Uint32Array): string {\n const v = toStr(data);\n if (!v.match(/^((auto)|(\\d+?((px)|(%)){0,1}))$/)) {\n throw new Error('illegal size');\n }\n return v;\n}\n\n// name is base64 encoded utf-8\nfunction toName(data: Uint32Array): string {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(toStr(data), 'base64').toString();\n }\n const bs = atob(toStr(data));\n const b = new Uint8Array(bs.length);\n for (let i = 0; i < b.length; ++i) {\n b[i] = bs.charCodeAt(i);\n }\n return new TextDecoder().decode(b);\n}\n\nconst DECODERS: {[key: string]: (v: Uint32Array) => number | string} = {\n inline: toInt,\n size: toInt,\n name: toName,\n width: toSize,\n height: toSize,\n preserveAspectRatio: toInt\n};\n\n\n// sequence type markers\n// File\nconst FILE_MARKER = [70, 105, 108, 101];\n// MultipartFile\nconst MULTIPARTFILE_MARKER = [77, 117, 108, 116, 105, 112, 97, 114, 116, 70, 105, 108, 101];\n// FilePart\nconst FILEPART_MARKER = [70, 105, 108, 101, 80, 97, 114, 116];\n// FileEnd\nconst FILEEND_MARKER = [70, 105, 108, 101, 69, 110, 100];\n// ReportCellSize\nconst REPORTCELLSIZE_MARKER = [82, 101, 112, 111, 114, 116, 67, 101, 108, 108, 83, 105, 122, 101];\n\n// max allowed chars for sequence header\nconst MAX_FIELDCHARS = 1024;\n\n\nexport class HeaderParser {\n public state: HeaderState = HeaderState.START;\n private _buffer = new Uint32Array(MAX_FIELDCHARS);\n private _position = 0;\n private _key = '';\n public fields: {[key: string]: number | string | Uint32Array | null | undefined} = {};\n\n public reset(): void {\n this._buffer.fill(0);\n this.state = HeaderState.START;\n this._position = 0;\n this.fields = {};\n this._key = '';\n }\n\n public end(): number {\n if (this.state === HeaderState.START) {\n if (this._position === FILEEND_MARKER.length) {\n for (let k = 0; k < FILEEND_MARKER.length; ++k) {\n if (this._buffer[k] !== FILEEND_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEEND;\n this.state = HeaderState.END;\n return 0;\n }\n if (this._position === REPORTCELLSIZE_MARKER.length) {\n for (let k = 0; k < REPORTCELLSIZE_MARKER.length; ++k) {\n if (this._buffer[k] !== REPORTCELLSIZE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.REPORTCELLSIZE;\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n if (this.state === HeaderState.END) return 0;\n if (this.state === HeaderState.VALUE\n && this.fields.type === SequenceType.MULTIPARTFILE\n ) {\n if (!this._storeValue(this._position)) return this._a();\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n\n public parse(data: Uint32Array, start: number, end: number): number {\n let state = this.state;\n let pos = this._position;\n const buffer = this._buffer;\n if (state === HeaderState.ABORT || state === HeaderState.END) return -1;\n if (state === HeaderState.START && pos > 14) return -1;\n for (let i = start; i < end; ++i) {\n const c = data[i];\n switch (c) {\n case 59: // ;\n if (!this._storeValue(pos)) return this._a();\n state = HeaderState.KEY;\n pos = 0;\n break;\n case 61: // =\n if (state === HeaderState.START) {\n if (buffer[0] === 70) {\n // 'File' or 'FilePart'\n let k = 0;\n for (; k < FILE_MARKER.length; ++k) {\n if (buffer[k] !== FILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILE;\n if (pos === FILEPART_MARKER.length) {\n for (; k < FILEPART_MARKER.length; ++k) {\n if (buffer[k] !== FILEPART_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEPART;\n this.state = HeaderState.END;\n return i + 1;\n }\n } else if (buffer[0] === 77) {\n // 'MultipartFile'\n for (let k = 0; k < MULTIPARTFILE_MARKER.length; ++k) {\n if (buffer[k] !== MULTIPARTFILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.MULTIPARTFILE;\n } else {\n return this._a();\n }\n state = HeaderState.KEY;\n pos = 0;\n } else if (state === HeaderState.KEY) {\n if (!this._storeKey(pos)) return this._a();\n state = HeaderState.VALUE;\n pos = 0;\n } else if (state === HeaderState.VALUE) {\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n break;\n case 58: // :\n if (state === HeaderState.VALUE) {\n if (!this._storeValue(pos)) return this._a();\n }\n this.state = HeaderState.END;\n return i + 1;\n default:\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n }\n this.state = state;\n this._position = pos;\n return -2;\n }\n\n private _a(): number {\n this.fields.type = SequenceType.INVALID;\n this.state = HeaderState.ABORT;\n return -1;\n }\n\n private _storeKey(pos: number): boolean {\n const k = toStr(this._buffer.subarray(0, pos));\n if (k) {\n this._key = k;\n this.fields[k] = null;\n return true;\n }\n return false;\n }\n\n private _storeValue(pos: number): boolean {\n if (this._key) {\n try {\n const v = this._buffer.slice(0, pos);\n this.fields[this._key] = DECODERS[this._key] ? DECODERS[this._key](v) : v;\n } catch {\n return false;\n }\n return true;\n }\n return false;\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAddImageOpts } from './Types';\nimport { ImageStorage } from './ImageStorage';\n\n/**\n * IIP (iTerm Image Protocol) specific image storage controller.\n *\n * Wraps the shared ImageStorage with IIP protocol semantics:\n * - Always uses scrolling mode (cursor advances with image)\n */\nexport class IIPImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n constructor(\n private readonly _storage: ImageStorage\n ) {}\n\n /**\n * Add an IIP image to storage.\n * Always uses scrolling mode — cursor advances past the image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._storage.addImage(img, this._addImageOpts);\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n\nexport type ImageType = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/qoi' | 'image/webp' | 'image/avif' | 'unsupported' | '';\n\nexport interface IMetrics {\n mime: ImageType;\n width: number;\n height: number;\n}\n\nexport const UNSUPPORTED_TYPE: IMetrics = {\n mime: 'unsupported',\n width: 0,\n height: 0\n};\n\nexport function imageType(d: Uint8Array): IMetrics {\n if (d.length < 32) {\n return UNSUPPORTED_TYPE;\n }\n const d32 = new Uint32Array(d.buffer, d.byteOffset, 8);\n // PNG: 89 50 4E 47 0D 0A 1A 0A (8 first bytes == magic number for PNG)\n // + first chunk must be IHDR\n if (d32[0] === 0x474E5089 && d32[1] === 0x0A1A0A0D && d32[3] === 0x52444849) {\n return {\n mime: 'image/png',\n width: d[16] << 24 | d[17] << 16 | d[18] << 8 | d[19],\n height: d[20] << 24 | d[21] << 16 | d[22] << 8 | d[23]\n };\n }\n // JPEG: FF D8 FF\n if (d[0] === 0xFF && d[1] === 0xD8 && d[2] === 0xFF) {\n const [width, height] = jpgSize(d);\n return { mime: 'image/jpeg', width, height };\n }\n // GIF: GIF87a or GIF89a\n if (d32[0] === 0x38464947 && (d[4] === 0x37 || d[4] === 0x39) && d[5] === 0x61) {\n return {\n mime: 'image/gif',\n width: d[7] << 8 | d[6],\n height: d[9] << 8 | d[8]\n };\n }\n // QOI: qoif\n if (d32[0] === 0x66696F71) {\n return {\n mime: 'image/qoi',\n width: d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7],\n height: d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11]\n };\n }\n // WEBP: RIFF | xxxx | WEBP | VP8x\n if (d32[0] === 0x46464952 && d32[2] === 0x50424557 && (d32[3] & 0xFFFFFF) === 0x385056) {\n switch (d[15]) {\n case 0x58: // Extended WebP VP8X --> \"X\"\n return {\n mime: 'image/webp',\n width: (d[24] | d[25] << 8 | d[26] << 16) + 1,\n height: (d[27] | d[28] << 8 | d[29] << 16) + 1\n };\n case 0x4C: // Lossless WebP VP8L --> \"L\"\n if (d[20] !== 0x2f) return UNSUPPORTED_TYPE;\n const dim = d[21] | d[22] << 8 | d[23] << 16 | d[24] << 24;\n return {\n mime: 'image/webp',\n width: (dim & 0x3FFF) + 1,\n height: (dim >>> 14 & 0x3FFF) + 1\n };\n case 0x20: // Lossy WebP VP8 --> \" \"\n if (d[23] !== 0x9d || d[24] !== 0x01 || d[25] !== 0x2a) return UNSUPPORTED_TYPE;\n return {\n mime: 'image/webp',\n width: (d[26] | d[27] << 8) & 0x3FFF,\n height: (d[28] | d[29] << 8) & 0x3FFF\n };\n }\n return UNSUPPORTED_TYPE;\n }\n // AVIF: Box size | ftyp | avif/avis\n if (d32[1] === 0x70797466 && (d32[2] === 0x66697661 || d32[2] === 0x73697661)) {\n let pos = -1;\n // search for ispe box within first 1024 bytes\n const limit = Math.min(d.length - 16, 1024);\n for (let i = 8; i < limit; i++) {\n // scan for ispe\n if (d[i] === 0x69 && d[i + 1] === 0x73 && d[i + 2] === 0x70 && d[i + 3] === 0x65) {\n pos = i;\n break;\n }\n }\n if (pos !== -1) {\n // dimensions are in BE at +8 (width) at +12 (height)\n const width =\n d[pos + 8] << 24 |\n d[pos + 9] << 16 |\n d[pos + 10] << 8 |\n d[pos + 11];\n const height =\n d[pos + 12] << 24 |\n d[pos + 13] << 16 |\n d[pos + 14] << 8 |\n d[pos + 15];\n if (width > 0 && height > 0) {\n return { mime: 'image/avif', width, height };\n }\n }\n return UNSUPPORTED_TYPE;\n }\n return UNSUPPORTED_TYPE;\n}\n\n\nfunction jpgSize(d: Uint8Array): [number, number] {\n const len = d.length;\n let i = 4;\n let blockLength = d[i] << 8 | d[i + 1];\n while (true) {\n i += blockLength;\n if (i >= len) {\n // exhausted without size info\n return [0, 0];\n }\n if (d[i] !== 0xFF) {\n return [0, 0];\n }\n if (d[i + 1] === 0xC0 || d[i + 1] === 0xC2) {\n if (i + 8 < len) {\n return [\n d[i + 7] << 8 | d[i + 8],\n d[i + 5] << 8 | d[i + 6]\n ];\n }\n return [0, 0];\n }\n i += 2;\n blockLength = d[i] << 8 | d[i + 1];\n }\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { toRGBA8888 } from 'sixel/lib/Colors';\nimport { IDisposable } from '@xterm/xterm';\nimport { ICellSize, ImageLayer, ITerminalExt, IImageSpec, IRenderDimensions, IRenderService } from './Types';\nimport { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';\n\nconst enum Constants {\n PLACEHOLDER_LENGTH = 4096,\n PLACEHOLDER_HEIGHT = 24\n}\n\n/**\n * ImageRenderer - terminal frontend extension:\n * - provide primitives for canvas, ImageData, Bitmap (static)\n * - add canvas layer to DOM (browser only for now)\n * - draw image tiles onRender\n */\nexport class ImageRenderer extends Disposable implements IDisposable {\n /** @deprecated Kept for backward compat — points to top layer canvas. */\n public get canvas(): HTMLCanvasElement | undefined { return this._layers.get('top')?.canvas; }\n private _layers = new Map();\n private _placeholder: HTMLCanvasElement | undefined;\n private _placeholderBitmap: ImageBitmap | undefined;\n private _optionsRefresh = this._register(new MutableDisposable());\n private _oldOpen: ((parent: HTMLElement) => void) | undefined;\n private _renderService: IRenderService | undefined;\n private _oldSetRenderer: ((renderer: any) => void) | undefined;\n\n // drawing primitive - canvas\n public static createCanvas(localDocument: Document | undefined, width: number, height: number): HTMLCanvasElement {\n /**\n * NOTE: We normally dont care, from which document the canvas\n * gets created, so we can fall back to global document,\n * if the terminal has no document associated yet.\n * This way early image loads before calling .open keep working\n * (still discouraged though, as the metrics will be screwed up).\n * Only the DOM output canvas should be on the terminal's document,\n * which gets explicitly checked in `insertLayerToDom`.\n */\n const canvas = (localDocument ?? document).createElement('canvas');\n canvas.width = width | 0;\n canvas.height = height | 0;\n return canvas;\n }\n\n // drawing primitive - ImageData with optional buffer\n public static createImageData(ctx: CanvasRenderingContext2D, width: number, height: number, buffer?: ArrayBuffer): ImageData {\n if (typeof ImageData !== 'function') {\n const imgData = ctx.createImageData(width, height);\n if (buffer) {\n imgData.data.set(new Uint8ClampedArray(buffer, 0, width * height * 4));\n }\n return imgData;\n }\n return buffer\n ? new ImageData(new Uint8ClampedArray(buffer, 0, width * height * 4), width, height)\n : new ImageData(width, height);\n }\n\n // drawing primitive - ImageBitmap\n public static createImageBitmap(img: ImageBitmapSource): Promise {\n if (typeof createImageBitmap !== 'function') {\n return Promise.resolve(undefined);\n }\n return createImageBitmap(img);\n }\n\n\n constructor(private _terminal: ITerminalExt) {\n super();\n this._oldOpen = this._terminal._core.open;\n this._terminal._core.open = (parent: HTMLElement): void => {\n this._oldOpen?.call(this._terminal._core, parent);\n this._open();\n };\n if (this._terminal._core.screenElement) {\n this._open();\n }\n // hack to spot fontSize changes\n this._optionsRefresh.value = this._terminal._core.optionsService.onOptionChange(option => {\n if (option === 'fontSize') {\n this.rescaleCanvas();\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n });\n this._register(toDisposable(() => {\n this.removeLayerFromDom();\n this.removeLayerFromDom('bottom');\n if (this._terminal._core && this._oldOpen) {\n this._terminal._core.open = this._oldOpen;\n this._oldOpen = undefined;\n }\n if (this._renderService && this._oldSetRenderer) {\n this._renderService.setRenderer = this._oldSetRenderer;\n this._oldSetRenderer = undefined;\n }\n this._renderService = undefined;\n this._layers.clear();\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }));\n }\n\n /**\n * Enable the placeholder.\n */\n public showPlaceholder(value: boolean): void {\n if (value) {\n if (!this._placeholder && this.cellSize.height !== -1) {\n this._createPlaceHolder(Math.max(this.cellSize.height + 1, Constants.PLACEHOLDER_HEIGHT));\n }\n } else {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n\n /**\n * Dimensions of the terminal.\n * Forwarded from internal render service.\n */\n public get dimensions(): IRenderDimensions | undefined {\n return this._terminal.dimensions;\n }\n\n /**\n * Current cell size (float).\n */\n public get cellSize(): ICellSize {\n return {\n width: this.dimensions?.css.cell.width || -1,\n height: this.dimensions?.css.cell.height || -1\n };\n }\n\n /**\n * Clear a region of the image layer canvas.\n */\n public clearLines(start: number, end: number, layer?: ImageLayer): void {\n const y = start * (this.dimensions?.css.cell.height || 0);\n const w = this.dimensions?.css.canvas.width || 0;\n const h = (end + 1 - start) * (this.dimensions?.css.cell.height || 0);\n if (!layer || layer === 'top') {\n this._layers.get('top')?.clearRect(0, y, w, h);\n }\n if (!layer || layer === 'bottom') {\n this._layers.get('bottom')?.clearRect(0, y, w, h);\n }\n }\n\n /**\n * Clear whole image canvas.\n */\n public clearAll(layer?: ImageLayer): void {\n if (!layer || layer === 'top') {\n const ctx = this._layers.get('top');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n if (!layer || layer === 'bottom') {\n const ctx = this._layers.get('bottom');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n }\n\n /**\n * Draw neighboring tiles on the image layer canvas.\n */\n public draw(imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get(imgSpec.layer);\n if (!ctx) {\n return;\n }\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const cols = Math.ceil(img.width / width);\n\n const sx = (tileId % cols) * width;\n const sy = Math.floor(tileId / cols) * height;\n const dx = col * width;\n const dy = row * height;\n\n // safari bug: never access image source out of bounds\n const finalWidth = count * width + sx > img.width ? img.width - sx : count * width;\n const finalHeight = sy + height > img.height ? img.height - sy : height;\n\n // Floor all pixel offsets to get stable tile mapping without any overflows.\n // Note: For not pixel perfect aligned cells like in the DOM renderer\n // this will move a tile slightly to the top/left (subpixel range, thus ignore it).\n // FIX #34: avoid striping on displays with pixelDeviceRatio != 1 by ceiling height and width\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.ceil(finalWidth), Math.ceil(finalHeight),\n Math.floor(dx), Math.floor(dy), Math.ceil(finalWidth), Math.ceil(finalHeight)\n );\n }\n\n /**\n * Extract a single tile from an image.\n */\n public extractTile(imgSpec: IImageSpec, tileId: number): HTMLCanvasElement | undefined {\n const { width, height } = this.cellSize;\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const cols = Math.ceil(img.width / width);\n const sx = (tileId % cols) * width;\n const sy = Math.floor(tileId / cols) * height;\n const finalWidth = width + sx > img.width ? img.width - sx : width;\n const finalHeight = sy + height > img.height ? img.height - sy : height;\n\n const canvas = ImageRenderer.createCanvas(this.document, finalWidth, finalHeight);\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.floor(finalWidth), Math.floor(finalHeight),\n 0, 0, Math.floor(finalWidth), Math.floor(finalHeight)\n );\n return canvas;\n }\n }\n\n /**\n * Draw a line with placeholder on the image layer canvas.\n */\n public drawPlaceholder(col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get('top');\n if (ctx) {\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n if (!this._placeholder) {\n this._createPlaceHolder(Math.max(height + 1, Constants.PLACEHOLDER_HEIGHT));\n } else if (height >= this._placeholder!.height) {\n this._createPlaceHolder(height + 1);\n }\n if (!this._placeholder) return;\n ctx.drawImage(\n this._placeholderBitmap ?? this._placeholder!,\n col * width,\n (row * height) % 2 ? 0 : 1, // needs %2 offset correction\n width * count,\n height,\n col * width,\n row * height,\n width * count,\n height\n );\n }\n }\n\n /**\n * Rescale image layer canvas if needed.\n * Checked once from `ImageStorage.render`.\n */\n public rescaleCanvas(): void {\n const w = this.dimensions?.css.canvas.width || 0;\n const h = this.dimensions?.css.canvas.height || 0;\n for (const ctx of this._layers.values()) {\n if (ctx.canvas.width !== w || ctx.canvas.height !== h) {\n ctx.canvas.width = w;\n ctx.canvas.height = h;\n }\n }\n }\n\n /**\n * Rescale image in storage if needed.\n */\n private _rescaleImage(spec: IImageSpec, currentWidth: number, currentHeight: number): void {\n if (currentWidth === spec.actualCellSize.width && currentHeight === spec.actualCellSize.height) {\n return;\n }\n const { width: originalWidth, height: originalHeight } = spec.origCellSize;\n if (currentWidth === originalWidth && currentHeight === originalHeight) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const canvas = ImageRenderer.createCanvas(\n this.document,\n Math.ceil(spec.orig!.width * currentWidth / originalWidth),\n Math.ceil(spec.orig!.height * currentHeight / originalHeight)\n );\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(spec.orig!, 0, 0, canvas.width, canvas.height);\n spec.actual = canvas;\n spec.actualCellSize.width = currentWidth;\n spec.actualCellSize.height = currentHeight;\n }\n }\n\n /**\n * Lazy init for the renderer.\n */\n private _open(): void {\n this._renderService = this._terminal._core._renderService;\n this._oldSetRenderer = this._renderService.setRenderer.bind(this._renderService);\n this._renderService.setRenderer = (renderer: any) => {\n for (const key of [...this._layers.keys()]) {\n this.removeLayerFromDom(key);\n }\n this._oldSetRenderer?.call(this._renderService, renderer);\n };\n }\n\n public insertLayerToDom(layer: ImageLayer = 'top'): void {\n // make sure that the terminal is attached to a document and to DOM\n if (!this.document || !this._terminal._core.screenElement) {\n console.warn('image addon: cannot insert output canvas to DOM, missing document or screenElement');\n return;\n }\n if (this._layers.has(layer)) {\n return;\n }\n const canvas = ImageRenderer.createCanvas(\n this.document, this.dimensions?.css.canvas.width || 0,\n this.dimensions?.css.canvas.height || 0\n );\n canvas.classList.add(`xterm-image-layer-${layer}`);\n const screenElement = this._terminal._core.screenElement;\n // Use isolation to create a stacking context without overriding z-index,\n // which would conflict with integrators (e.g. VS Code) that set their\n // own z-index on the screen element.\n screenElement.style.isolation = 'isolate';\n if (layer === 'bottom') {\n // Use z-index:-1 so it paints behind non-positioned text elements.\n // The screen element needs to be a stacking context (via isolation)\n // to contain the negative z-index, otherwise it would go behind the\n // entire terminal.\n canvas.style.zIndex = '-1';\n screenElement.insertBefore(canvas, screenElement.firstChild);\n } else {\n // Explicit z-index ensures the image canvas reliably stacks above\n // the text layer (DOM renderer rows). z-index: 0 is below the\n // selection overlay (z-index: 1).\n canvas.style.zIndex = '0';\n screenElement.appendChild(canvas);\n }\n const ctx = canvas.getContext('2d', { alpha: true });\n if (!ctx) {\n canvas.remove();\n return;\n }\n this._layers.set(layer, ctx);\n this.clearAll(layer);\n }\n\n public removeLayerFromDom(layer: ImageLayer = 'top'): void {\n const ctx = this._layers.get(layer);\n if (ctx) {\n ctx.canvas.remove();\n this._layers.delete(layer);\n }\n }\n\n public hasLayer(layer: ImageLayer): boolean {\n return this._layers.has(layer);\n }\n\n private _createPlaceHolder(height: number = Constants.PLACEHOLDER_HEIGHT): void {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n\n // create blueprint to fill placeholder with\n const bWidth = 32; // must be 2^n\n const blueprint = ImageRenderer.createCanvas(this.document, bWidth, height);\n const ctx = blueprint.getContext('2d', { alpha: false });\n if (!ctx) return;\n const imgData = ImageRenderer.createImageData(ctx, bWidth, height);\n const d32 = new Uint32Array(imgData.data.buffer);\n const black = toRGBA8888(0, 0, 0);\n const white = toRGBA8888(255, 255, 255);\n d32.fill(black);\n for (let y = 0; y < height; ++y) {\n const shift = y % 2;\n const offset = y * bWidth;\n for (let x = 0; x < bWidth; x += 2) {\n d32[offset + x + shift] = white;\n }\n }\n ctx.putImageData(imgData, 0, 0);\n\n // create placeholder line, width aligned to blueprint width\n const width = (screen.width + bWidth - 1) & ~(bWidth - 1) || Constants.PLACEHOLDER_LENGTH;\n this._placeholder = ImageRenderer.createCanvas(this.document, width, height);\n const ctx2 = this._placeholder.getContext('2d', { alpha: false });\n if (!ctx2) {\n this._placeholder = undefined;\n return;\n }\n for (let i = 0; i < width; i += bWidth) {\n ctx2.drawImage(blueprint, i, 0);\n }\n ImageRenderer.createImageBitmap(this._placeholder).then(bitmap => this._placeholderBitmap = bitmap);\n }\n\n public get document(): Document | undefined {\n return this._terminal._core._coreBrowserService?.window.document;\n }\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageRenderer } from './ImageRenderer';\nimport {\n ITerminalExt, IExtendedAttrsImage, IImageAddonOptions, IImageSpec,\n IBufferLineExt, BgFlags, Cell, Content, ICellSize, ExtFlags, Attributes,\n UnderlineStyle, IAddImageOpts\n} from './Types';\n\n\n// fallback default cell size\nexport const CELL_SIZE_DEFAULT: ICellSize = {\n width: 7,\n height: 14\n};\n\n/**\n * Extend extended attribute to also hold image tile information.\n *\n * Object definition is copied from base repo to fully mimick its behavior.\n * Image data is added as additional public properties `imageId` and `tileId`.\n */\nclass ExtendedAttrsImage implements IExtendedAttrsImage {\n private _ext: number = 0;\n public get ext(): number {\n if (this._urlId) {\n return (\n (this._ext & ~ExtFlags.UNDERLINE_STYLE) |\n (this.underlineStyle << 26)\n );\n }\n return this._ext;\n }\n public set ext(value: number) { this._ext = value; }\n\n public get underlineStyle(): UnderlineStyle {\n // Always return the URL style if it has one\n if (this._urlId) {\n return UnderlineStyle.DASHED;\n }\n return (this._ext & ExtFlags.UNDERLINE_STYLE) >> 26;\n }\n public set underlineStyle(value: UnderlineStyle) {\n this._ext &= ~ExtFlags.UNDERLINE_STYLE;\n this._ext |= (value << 26) & ExtFlags.UNDERLINE_STYLE;\n }\n\n public get underlineColor(): number {\n return this._ext & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n public set underlineColor(value: number) {\n this._ext &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n this._ext |= value & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n\n public get underlineVariantOffset(): number {\n const val = (this._ext & ExtFlags.VARIANT_OFFSET) >> 29;\n if (val < 0) {\n return val ^ 0xFFFFFFF8;\n }\n return val;\n }\n public set underlineVariantOffset(value: number) {\n this._ext &= ~ExtFlags.VARIANT_OFFSET;\n this._ext |= (value << 29) & ExtFlags.VARIANT_OFFSET;\n }\n\n private _urlId: number = 0;\n public get urlId(): number {\n return this._urlId;\n }\n public set urlId(value: number) {\n this._urlId = value;\n }\n\n constructor(\n ext: number = 0,\n urlId: number = 0,\n public imageId = -1,\n public tileId = -1\n ) {\n this._ext = ext;\n this._urlId = urlId;\n }\n\n public clone(): IExtendedAttrsImage {\n /**\n * Technically we dont need a clone variant of ExtendedAttrsImage,\n * as we never clone a cell holding image data.\n * Note: Clone is only meant to be used by the InputHandler for\n * sticky attributes, which is never the case for image data.\n * We still provide a proper clone method to reflect the full ext attr\n * state in case there are future use cases for clone.\n */\n return new ExtendedAttrsImage(this._ext, this._urlId, this.imageId, this.tileId);\n }\n\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0 && this.imageId === -1;\n }\n}\nconst EMPTY_ATTRS = new ExtendedAttrsImage();\n\n\n/**\n * ImageStorage - extension of CoreTerminal:\n * - hold image data\n * - write/read image data to/from buffer\n *\n * TODO: image composition for overwrites\n */\nexport class ImageStorage implements IDisposable {\n // storage\n private _images: Map = new Map();\n // last used id\n private _lastId = 0;\n // last evicted id\n private _lowestId = 0;\n // whether a full clear happened before\n private _fullyCleared = false;\n // whether render should do a full clear\n private _needsFullClear = false;\n // hard limit of stored pixels (fallback limit of 10 MB)\n private _pixelLimit: number = 2500000;\n\n private _viewportMetrics: { cols: number, rows: number };\n public onImageAdded: (() => void) | undefined;\n public onImageDeleted: ((storageId: number) => void) | undefined;\n\n constructor(\n private _terminal: ITerminalExt,\n private _renderer: ImageRenderer,\n private _opts: IImageAddonOptions\n ) {\n try {\n this.setLimit(this._opts.storageLimit);\n } catch (e: unknown) {\n if (e instanceof Error) {\n console.error(e.message);\n }\n console.warn(`storageLimit is set to ${this.getLimit()} MB`);\n }\n this._viewportMetrics = {\n cols: this._terminal.cols,\n rows: this._terminal.rows\n };\n }\n\n public dispose(): void {\n this.reset();\n }\n\n public reset(): void {\n for (const spec of this._images.values()) {\n spec.marker?.dispose();\n }\n // NOTE: marker.dispose above already calls ImageBitmap.close\n // therefore we can just wipe the map here\n this._images.clear();\n this._renderer.clearAll();\n }\n\n public getLimit(): number {\n return this._pixelLimit * 4 / 1000000;\n }\n\n public setLimit(value: number): void {\n if (value < 0.5 || value > 1000) {\n throw RangeError('invalid storageLimit, should be at least 0.5 MB and not exceed 1G');\n }\n this._pixelLimit = (value / 4 * 1000000) >>> 0;\n this._evictOldest(0);\n }\n\n public getUsage(): number {\n return this._getStoredPixels() * 4 / 1000000;\n }\n\n private _getStoredPixels(): number {\n let storedPixels = 0;\n for (const spec of this._images.values()) {\n if (spec.orig) {\n storedPixels += spec.orig.width * spec.orig.height;\n if (spec.actual && spec.actual !== spec.orig) {\n storedPixels += spec.actual.width * spec.actual.height;\n }\n }\n }\n return storedPixels;\n }\n\n private _delImg(id: number): void {\n const spec = this._images.get(id);\n if (!spec) return;\n this._images.delete(id);\n // FIXME: really ugly workaround to get bitmaps deallocated :(\n if (window.ImageBitmap && spec.orig instanceof ImageBitmap) {\n spec.orig.close();\n }\n this.onImageDeleted?.(id);\n }\n\n /**\n * Wipe canvas and images on alternate buffer.\n */\n public wipeAlternate(): void {\n // remove all alternate tagged images\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate') {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n // mark canvas to be wiped on next render\n this._needsFullClear = true;\n this._fullyCleared = false;\n }\n\n /**\n * Delete an image by its internal storage ID.\n * Used by protocols that support explicit deletion (e.g. Kitty a=d).\n */\n public deleteImage(id: number): void {\n const spec = this._images.get(id);\n if (spec) {\n spec.marker?.dispose();\n this._delImg(id);\n }\n }\n\n /**\n * Method to add an image to the storage.\n * @param img - The image to add (canvas or bitmap).\n * @param opts - Options for addImage:\n * - scrolling: When true, cursor advances with the image.\n * When false, image is placed at ORIGIN and cursor does not move.\n * - layer: Which canvas layer to render on ('top' or 'bottom').\n * - zIndex: Z-index for image layering within the same layer.\n * - cursorPos: 'vt340' for bottom-left, 'iip' for bottom.right.\n * @returns The internal image ID assigned to the stored image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap, opts: IAddImageOpts): number {\n // never allow storage to exceed memory limit\n this._evictOldest(img.width * img.height);\n\n // calc rows x cols needed to display the image\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const cols = Math.ceil(img.width / cellSize.width);\n const rows = Math.ceil(img.height / cellSize.height);\n\n const imageId = ++this._lastId;\n\n const buffer = this._terminal._core.buffer;\n const termCols = this._terminal.cols;\n const termRows = this._terminal.rows;\n const originX = buffer.x;\n const originY = buffer.y;\n let offset = originX;\n let tileCount = 0;\n\n if (!opts.scrolling) {\n buffer.x = 0;\n buffer.y = 0;\n offset = 0;\n }\n\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(buffer.y + buffer.ybase);\n for (let col = 0; col < cols; ++col) {\n if (offset + col >= termCols) break;\n this._writeToCell(line as IBufferLineExt, offset + col, imageId, row * cols + col);\n tileCount++;\n }\n if (opts.scrolling) {\n if (row < rows - 1) this._terminal._core._inputHandler.lineFeed();\n } else {\n if (++buffer.y >= termRows) break;\n }\n buffer.x = offset;\n }\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n\n // cursor positioning modes\n if (opts.scrolling) {\n if (opts.cursorPos === 'iip') {\n buffer.x = Math.min(offset + cols, termCols);\n } else {\n buffer.x = offset;\n }\n } else {\n buffer.x = originX;\n buffer.y = originY;\n }\n\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.tileCount < 1) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n\n // eviction marker:\n // delete the image when the marker gets disposed\n const endMarker = this._terminal.registerMarker(0);\n endMarker?.onDispose(() => {\n const spec = this._images.get(imageId);\n if (spec) {\n this._delImg(imageId);\n }\n });\n\n // since markers do not work on alternate for some reason,\n // we evict images here manually\n if (this._terminal.buffer.active.type === 'alternate') {\n this._evictOnAlternate();\n }\n\n // create storage entry\n const imgSpec: IImageSpec = {\n orig: img,\n origCellSize: cellSize,\n actual: img,\n actualCellSize: { ...cellSize }, // clone needed, since later modified\n marker: endMarker || undefined,\n tileCount,\n bufferType: this._terminal.buffer.active.type,\n layer: opts.layer,\n zIndex: opts.zIndex\n };\n\n // finally add the image\n this._images.set(imageId, imgSpec);\n this.onImageAdded?.();\n return imageId;\n }\n\n\n /**\n * Render method. Collects buffer information and triggers\n * canvas updates.\n */\n // TODO: Should we move this to the ImageRenderer?\n public render(range: { start: number, end: number }): void {\n // Determine which layers have images\n let hasTopImages = false;\n let hasBottomImages = false;\n for (const spec of this._images.values()) {\n if (spec.layer === 'bottom') {\n hasBottomImages = true;\n } else {\n hasTopImages = true;\n }\n if (hasTopImages && hasBottomImages) break;\n }\n\n // Lazily insert layers that are needed\n if (hasTopImages && !this._renderer.hasLayer('top')) {\n this._renderer.insertLayerToDom('top');\n if (!this._renderer.hasLayer('top')) return;\n }\n if (hasBottomImages && !this._renderer.hasLayer('bottom')) {\n this._renderer.insertLayerToDom('bottom');\n }\n\n // rescale if needed\n this._renderer.rescaleCanvas();\n\n // exit early if we dont have any images to test for\n if (!this._images.size) {\n if (!this._fullyCleared) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n if (this._renderer.hasLayer('top')) {\n this._renderer.removeLayerFromDom('top');\n }\n if (this._renderer.hasLayer('bottom')) {\n this._renderer.removeLayerFromDom('bottom');\n }\n return;\n }\n\n // Remove layers no longer needed\n if (!hasTopImages && this._renderer.hasLayer('top')) {\n this._renderer.clearAll('top');\n this._renderer.removeLayerFromDom('top');\n }\n if (!hasBottomImages && this._renderer.hasLayer('bottom')) {\n this._renderer.clearAll('bottom');\n this._renderer.removeLayerFromDom('bottom');\n }\n\n // buffer switches force a full clear\n if (this._needsFullClear) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n\n const { start, end } = range;\n const buffer = this._terminal._core.buffer;\n const cols = this._terminal._core.cols;\n\n // clear drawing area\n this._renderer.clearLines(start, end);\n\n // Collect draw calls so we can sort by z-index (lower z drawn first).\n const drawCalls: { imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number }[] = [];\n const placeholderCalls: { col: number, row: number, count: number }[] = [];\n\n // walk all cells in viewport and collect tiles found\n for (let row = start; row <= end; ++row) {\n const line = buffer.lines.get(row + buffer.ydisp) as IBufferLineExt;\n if (!line) return;\n for (let col = 0; col < cols; ++col) {\n if (line.getBg(col) & BgFlags.HAS_EXTENDED) {\n let e: IExtendedAttrsImage = line._extendedAttrs[col] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (e.tileId !== -1) {\n const startTile = e.tileId;\n const startCol = col;\n let count = 1;\n /**\n * merge tiles to the right into a single draw call, if:\n * - not at end of line\n * - cell has same image id\n * - cell has consecutive tile id\n */\n while (\n ++col < cols\n && (line.getBg(col) & BgFlags.HAS_EXTENDED)\n && (e = line._extendedAttrs[col] ?? EMPTY_ATTRS)\n && (e.imageId === imageId)\n && (e.tileId === startTile + count)\n ) {\n count++;\n }\n col--;\n if (imgSpec) {\n if (imgSpec.actual) {\n drawCalls.push({ imgSpec, tileId: startTile, col: startCol, row, count });\n }\n } else if (this._opts.showPlaceholder) {\n placeholderCalls.push({ col: startCol, row, count });\n }\n this._fullyCleared = false;\n }\n }\n }\n }\n\n // Sort by z-index so lower z draws first (higher z renders on top)\n drawCalls.sort((a, b) => a.imgSpec.zIndex - b.imgSpec.zIndex);\n\n // Draw placeholders first (lowest priority)\n for (const call of placeholderCalls) {\n this._renderer.drawPlaceholder(call.col, call.row, call.count);\n }\n\n // Draw images in z-index order\n for (const call of drawCalls) {\n this._renderer.draw(call.imgSpec, call.tileId, call.col, call.row, call.count);\n }\n }\n\n public viewportResize(metrics: { cols: number, rows: number }): void {\n // exit early if we have nothing in storage\n if (!this._images.size) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // handle only viewport width enlargements, exit all other cases\n // TODO: needs patch for tile counter\n if (this._viewportMetrics.cols >= metrics.cols) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // walk scrollbuffer at old col width to find all possible expansion matches\n const buffer = this._terminal._core.buffer;\n const rows = buffer.lines.length;\n const oldCol = this._viewportMetrics.cols - 1;\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(row) as IBufferLineExt;\n if (line.getBg(oldCol) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[oldCol] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (!imgSpec) {\n continue;\n }\n // found an image tile at oldCol, check if it qualifies for right exapansion\n const tilesPerRow = Math.ceil((imgSpec.actual?.width || 0) / imgSpec.actualCellSize.width);\n if ((e.tileId % tilesPerRow) + 1 >= tilesPerRow) {\n continue;\n }\n // expand only if right side is empty (nothing got wrapped from below)\n let hasData = false;\n for (let rightCol = oldCol + 1; rightCol > metrics.cols; ++rightCol) {\n if (line._data[rightCol * Cell.SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK) {\n hasData = true;\n break;\n }\n }\n if (hasData) {\n continue;\n }\n // do right expansion on terminal buffer\n const end = Math.min(metrics.cols, tilesPerRow - (e.tileId % tilesPerRow) + oldCol);\n let lastTile = e.tileId;\n for (let expandCol = oldCol + 1; expandCol < end; ++expandCol) {\n this._writeToCell(line as IBufferLineExt, expandCol, imageId, ++lastTile);\n imgSpec.tileCount++;\n }\n }\n }\n // store new viewport metrics\n this._viewportMetrics = metrics;\n }\n\n /**\n * Retrieve original canvas at buffer position.\n */\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1) {\n const orig = this._images.get(e.imageId)?.orig;\n if (window.ImageBitmap && orig instanceof ImageBitmap) {\n const canvas = ImageRenderer.createCanvas(window.document, orig.width, orig.height);\n canvas.getContext('2d')?.drawImage(orig, 0, 0, orig.width, orig.height);\n return canvas;\n }\n return orig as HTMLCanvasElement;\n }\n }\n }\n\n /**\n * Extract active single tile at buffer position.\n */\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1 && e.tileId !== -1) {\n const spec = this._images.get(e.imageId);\n if (spec) {\n return this._renderer.extractTile(spec, e.tileId);\n }\n }\n }\n }\n\n // TODO: Do we need some blob offloading tricks here to avoid early eviction?\n // also see https://stackoverflow.com/questions/28307789/is-there-any-limitation-on-javascript-max-blob-size\n private _evictOldest(room: number): number {\n const used = this._getStoredPixels();\n let current = used;\n while (this._pixelLimit < current + room && this._images.size) {\n const spec = this._images.get(++this._lowestId);\n if (spec && spec.orig) {\n current -= spec.orig.width * spec.orig.height;\n if (spec.actual && spec.orig !== spec.actual) {\n current -= spec.actual.width * spec.actual.height;\n }\n spec.marker?.dispose();\n this._delImg(this._lowestId);\n }\n }\n return used - current;\n }\n\n private _writeToCell(line: IBufferLineExt, x: number, imageId: number, tileId: number): void {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const old = line._extendedAttrs[x];\n if (old) {\n if (old.imageId !== undefined) {\n // found an old ExtendedAttrsImage, since we know that\n // they are always isolated instances (single cell usage),\n // we can re-use it and just update their id entries\n const oldSpec = this._images.get(old.imageId);\n if (oldSpec) {\n // early eviction for in-viewport overwrites\n oldSpec.tileCount--;\n }\n old.imageId = imageId;\n old.tileId = tileId;\n return;\n }\n // found a plain ExtendedAttrs instance, clone it to new entry\n line._extendedAttrs[x] = new ExtendedAttrsImage(old.ext, old.urlId, imageId, tileId);\n return;\n }\n }\n // fall-through: always create new ExtendedAttrsImage entry\n line._data[x * Cell.SIZE + Cell.BG] |= BgFlags.HAS_EXTENDED;\n line._extendedAttrs[x] = new ExtendedAttrsImage(0, 0, imageId, tileId);\n }\n\n private _evictOnAlternate(): void {\n // nullify tile count of all images on alternate buffer\n for (const spec of this._images.values()) {\n if (spec.bufferType === 'alternate') {\n spec.tileCount = 0;\n }\n }\n // re-count tiles on whole buffer\n const buffer = this._terminal._core.buffer;\n for (let y = 0; y < this._terminal.rows; ++y) {\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (!line) {\n continue;\n }\n for (let x = 0; x < this._terminal.cols; ++x) {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const imgId = line._extendedAttrs[x]?.imageId;\n if (imgId) {\n const spec = this._images.get(imgId);\n if (spec) {\n spec.tileCount++;\n }\n }\n }\n }\n }\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate' && !spec.tileCount) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n }\n}\n","/**\n * Copyright (c) 2020, 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IDcsHandler, IParams, IImageAddonOptions, ITerminalExt, AttributeData, IResetHandler, ReadonlyColorSet } from './Types';\nimport { toRGBA8888, BIG_ENDIAN, PALETTE_ANSI_256, PALETTE_VT340_COLOR } from 'sixel/lib/Colors';\nimport { RGBA8888 } from 'sixel/lib/Types';\nimport { ImageRenderer } from './ImageRenderer';\n\nimport { DecoderAsync, Decoder } from 'sixel/lib/Decoder';\n\n// always free decoder ressources after decoding if it exceeds this limit\nconst MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB\n\n// custom default palette: VT340 (lower 16 colors) + ANSI256 (up to 256) + zeroed (up to 4096)\nconst DEFAULT_PALETTE = PALETTE_ANSI_256;\nDEFAULT_PALETTE.set(PALETTE_VT340_COLOR);\n\n\nexport class SixelHandler implements IDcsHandler, IResetHandler {\n private _size = 0;\n private _aborted = false;\n private _dec: Decoder | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _storage: SixelImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n DecoderAsync({\n memoryLimit: this._opts.pixelLimit * 4,\n palette: DEFAULT_PALETTE,\n paletteLimit: this._opts.sixelPaletteLimit\n }).then(d => this._dec = d);\n }\n\n public reset(): void {\n /**\n * reset sixel decoder to defaults:\n * - release all memory\n * - nullify palette (4096)\n * - apply default palette (256)\n */\n if (this._dec) {\n this._dec.release();\n // FIXME: missing interface on decoder to nullify full palette\n (this._dec as any)._palette.fill(0);\n this._dec.init(0, DEFAULT_PALETTE, this._opts.sixelPaletteLimit);\n }\n }\n\n public hook(params: IParams): void {\n this._size = 0;\n this._aborted = false;\n if (this._dec) {\n const fillColor = params.params[1] === 1 ? 0 : extractActiveBg(\n this._coreTerminal._core._inputHandler._curAttrData,\n this._coreTerminal._core._themeService?.colors);\n this._dec.init(fillColor, null, this._opts.sixelPaletteLimit);\n }\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted || !this._dec) {\n return;\n }\n this._size += end - start;\n if (this._size > this._opts.sixelSizeLimit) {\n console.warn(`SIXEL: too much data, aborting`);\n this._aborted = true;\n this._dec.release();\n return;\n }\n try {\n this._dec.decode(data, start, end);\n } catch (e) {\n console.warn(`SIXEL: error while decoding image - ${e}`);\n this._aborted = true;\n this._dec.release();\n }\n }\n\n public unhook(success: boolean): boolean | Promise {\n if (this._aborted || !success || !this._dec) {\n return true;\n }\n\n const width = this._dec.width;\n const height = this._dec.height;\n\n // partial fix for https://github.com/jerch/xterm-addon-image/issues/37\n if (!width || !height) {\n if (height) {\n this._storage.advanceCursor(height);\n }\n return true;\n }\n\n const canvas = ImageRenderer.createCanvas(undefined, width, height);\n canvas.getContext('2d')?.putImageData(new ImageData(this._dec.data8 as Uint8ClampedArray, width, height), 0, 0);\n if (this._dec.memoryUsage > MEM_PERMA_LIMIT) {\n this._dec.release();\n }\n this._storage.addImage(canvas);\n return true;\n }\n}\n\n\n/**\n * Some helpers to extract current terminal colors.\n */\n\n// get currently active background color from terminal\n// also respect INVERSE setting\nfunction extractActiveBg(attr: AttributeData, colors: ReadonlyColorSet | undefined): RGBA8888 {\n let bg = 0;\n if (!colors) {\n // FIXME: theme service is prolly not available yet,\n // happens if .open() was not called yet (bug in core?)\n return bg;\n }\n if (attr.isInverse()) {\n if (attr.isFgDefault()) {\n bg = convertLe(colors.foreground.rgba);\n } else if (attr.isFgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getFgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getFgColor()].rgba);\n }\n } else {\n if (attr.isBgDefault()) {\n bg = convertLe(colors.background.rgba);\n } else if (attr.isBgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getBgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getBgColor()].rgba);\n }\n }\n return bg;\n}\n\n// rgba values on the color managers are always in BE, thus convert to LE\nfunction convertLe(color: number): RGBA8888 {\n if (BIG_ENDIAN) return color;\n return (color & 0xFF) << 24 | (color >>> 8 & 0xFF) << 16 | (color >>> 16 & 0xFF) << 8 | color >>> 24 & 0xFF;\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { IImageAddonOptions, ITerminalExt, IAddImageOpts } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\n\n/**\n * Sixel-specific image storage controller.\n *\n * Wraps the shared ImageStorage with sixel protocol semantics:\n * - Cursor behavior governed by DECSET 80 (sixelScrolling option)\n * - advanceCursor for empty sixels carrying only height\n */\nexport class SixelImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'vt340' };\n constructor(\n private readonly _storage: ImageStorage,\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _terminal: ITerminalExt\n ) {}\n\n /**\n * Add a sixel image to storage.\n * Cursor behavior depends on the sixelScrolling option (DECSET 80).\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._addImageOpts.scrolling = this._opts.sixelScrolling;\n this._storage.addImage(img, this._addImageOpts);\n }\n\n /**\n * Only advance text cursor.\n * This is an edge case from empty sixels carrying only a height but no pixels.\n * Partially fixes https://github.com/jerch/xterm-addon-image/issues/37.\n */\n public advanceCursor(height: number): void {\n if (this._opts.sixelScrolling) {\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const rows = Math.ceil(height / cellSize.height);\n for (let i = 1; i < rows; ++i) {\n this._terminal._core._inputHandler.lineFeed();\n }\n }\n }\n}\n","/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { IApcHandler, IImageAddonOptions, IResetHandler, ITerminalExt, ImageLayer } from '../Types';\nimport { ImageRenderer } from '../ImageRenderer';\nimport { CELL_SIZE_DEFAULT } from '../ImageStorage';\nimport { KittyImageStorage } from './KittyImageStorage';\nimport Base64Decoder, { type DecodeStatus } from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport {\n KittyAction,\n KittyFormat,\n KittyCompression,\n IKittyCommand,\n IPendingTransmission,\n IKittyImageData,\n KittyPixelConstants,\n parseKittyCommand\n} from './KittyGraphicsTypes';\n\nconst enum Constants {\n // Memory limit for base64 decoder (4MB, same as IIPHandler)\n DECODER_KEEP_DATA = 4194304,\n DECODER_INITIAL_DATA = 4194304, // 4MB\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n DECODER_OK = 0,\n // Maximum control data size\n MAX_CONTROL_DATA_SIZE = 512,\n // Semicolon codepoint\n SEMICOLON = 0x3B\n}\n\nconst DECODER_OK = Constants.DECODER_OK as unknown as DecodeStatus.OK;\n\n// Kitty graphics protocol handler with streaming base64 decoding.\nexport class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDisposable {\n private _aborted = false;\n private _decodeError = false;\n\n private _activeDecoder: Base64Decoder | null = null;\n private readonly _maxEncodedBytes: number;\n private readonly _initialEncodedBytes: number;\n\n // Streaming related states\n\n // True while receiving control data (before semicolon).\n private _inControlData = true;\n\n // Buffer for control data.\n private _controlData = new Uint32Array(Constants.MAX_CONTROL_DATA_SIZE);\n private _controlLength = 0;\n\n // Pre-calculated encoded size limit\n private _encodedSizeLimit = 0;\n private _totalEncodedSize = 0;\n\n // Parsed command. These are the control data before semicolon.\n private _parsedCommand: IKittyCommand | null = null;\n\n // Storage related states\n\n private _pendingTransmissions: Map = new Map();\n // Tracks the pending key of the most recently started chunked upload.\n // Per spec, subsequent chunks only need m= (and optionally q=), without i=.\n // When a chunk arrives with no i=, this key is used to find the pending upload.\n private _lastPendingKey: number | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _kittyStorage: KittyImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n // Convert decoded size limit -> max encoded bytes.\n this._maxEncodedBytes = Math.ceil(this._opts.kittySizeLimit * 4 / 3);\n // ensure we preallocate more than configured limit while using 4mb initial size.\n this._initialEncodedBytes = Math.min(Constants.DECODER_INITIAL_DATA, this._maxEncodedBytes);\n }\n\n public reset(): void {\n this._cleanupAllPending();\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n this._kittyStorage.reset();\n }\n\n public dispose(): void {\n this.reset();\n }\n\n private _removePendingEntry(key: number): void {\n this._pendingTransmissions.delete(key);\n if (this._lastPendingKey === key) {\n this._lastPendingKey = undefined;\n }\n }\n\n private _cleanupAllPending(): void {\n for (const pending of this._pendingTransmissions.values()) {\n pending.decoder.release();\n }\n this._pendingTransmissions.clear();\n this._lastPendingKey = undefined;\n }\n\n public start(): void {\n this._aborted = false;\n this._decodeError = false;\n this._inControlData = true;\n this._controlLength = 0;\n this._parsedCommand = null;\n // Pre-calculate encoded limit once: base64 is 4 bytes encoded → 3 bytes decoded\n this._encodedSizeLimit = this._maxEncodedBytes;\n this._totalEncodedSize = 0;\n this._activeDecoder = null;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (!this._inControlData) {\n this._streamPayload(data, start, end);\n } else {\n // Scan for semicolon\n let controlEnd = end;\n for (let i = start; i < end; i++) {\n if (data[i] === Constants.SEMICOLON) {\n this._inControlData = false;\n controlEnd = i;\n break;\n }\n }\n\n // Copy control data\n const copyLength = controlEnd - start;\n if (this._controlLength + copyLength > Constants.MAX_CONTROL_DATA_SIZE) {\n this._aborted = true;\n return;\n }\n this._controlData.set(data.subarray(start, controlEnd), this._controlLength);\n this._controlLength += copyLength;\n\n if (!this._inControlData) {\n // Found semicolon - parse control data early for validation\n this._parsedCommand = parseKittyCommand(this._parseControlDataString());\n\n // Early validation: i+I conflict\n if (this._parsedCommand.id !== undefined && this._parsedCommand.imageNumber !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'EINVAL:cannot specify both i and I keys', this._parsedCommand.quiet ?? 0);\n this._aborted = true;\n return;\n }\n\n // Delete action doesn't need payload - skip streaming\n if (this._parsedCommand.action === KittyAction.DELETE) {\n return;\n }\n\n // Stream remaining as payload\n const payloadStart = controlEnd + 1;\n if (payloadStart < end) {\n this._streamPayload(data, payloadStart, end);\n }\n }\n }\n }\n\n // Stream payload bytes into the base64 decoder.\n private _streamPayload(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n // Check size limit (compare encoded bytes against pre-calculated limit)\n // Include cumulative size from pending transmission for multi-chunk images.\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = this._parsedCommand?.id ?? this._lastPendingKey ?? 0;\n const pending = this._pendingTransmissions.get(pendingKey);\n const previousEncodedSize = pending?.totalEncodedSize ?? 0;\n this._totalEncodedSize += end - start;\n const cumulativeEncodedSize = previousEncodedSize + this._totalEncodedSize;\n if (cumulativeEncodedSize > this._encodedSizeLimit) {\n const decoderToRelease = this._activeDecoder ?? pending?.decoder;\n if (decoderToRelease) {\n decoderToRelease.release();\n }\n this._activeDecoder = null;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n this._aborted = true;\n return;\n }\n\n if (this._decodeError) return;\n\n if (pending?.decoder && !this._activeDecoder) {\n this._activeDecoder = pending.decoder;\n }\n if (!this._activeDecoder) {\n this._activeDecoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes);\n this._activeDecoder.init();\n }\n\n if (this._activeDecoder.put(data.subarray(start, end)) !== DECODER_OK) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n this._decodeError = true;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted || !success) {\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n return true;\n }\n\n // No semicolon = no payload (delete, capability query)\n if (this._inControlData) {\n return this._handleNoPayloadCommand();\n }\n\n // Use command parsed early in put() - i+I already validated there\n const cmd = this._parsedCommand!;\n\n // Delete action was handled by skipping payload - just execute\n if (cmd.action === KittyAction.DELETE) {\n return this._handleDelete(cmd);\n }\n\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = cmd.id ?? this._lastPendingKey ?? 0;\n const isMoreComing = cmd.more === 1;\n const pending = this._pendingTransmissions.get(pendingKey);\n\n if (isMoreComing) {\n if (this._activeDecoder) {\n if (pending) {\n pending.totalEncodedSize += this._totalEncodedSize;\n pending.decodeError = pending.decodeError || this._decodeError;\n } else {\n this._pendingTransmissions.set(pendingKey, {\n cmd: { ...cmd },\n decoder: this._activeDecoder,\n totalEncodedSize: this._totalEncodedSize,\n decodeError: this._decodeError\n });\n }\n this._lastPendingKey = pendingKey;\n this._activeDecoder = null;\n }\n return true;\n }\n\n // Final chunk received — clear the last pending key\n if (pending) {\n this._lastPendingKey = undefined;\n }\n\n let decodeError = this._decodeError;\n let finalCmd = cmd;\n let decoder = this._activeDecoder;\n\n if (pending) {\n finalCmd = pending.cmd;\n decoder = pending.decoder;\n decodeError = decodeError || pending.decodeError;\n this._pendingTransmissions.delete(pendingKey);\n }\n\n let imageBytes = new Uint8Array(0);\n if (decoder) {\n if (decoder.end() !== DECODER_OK) {\n decodeError = true;\n }\n imageBytes = decoder.data8;\n }\n this._activeDecoder = null;\n\n // Handle command first — handlers create Blob/ImageData from imageBytes,\n // which copies the data. Only then is it safe to release the decoder's\n // wasm memory that imageBytes points into.\n const result = this._handleCommandWithBytesAndCmd(finalCmd, imageBytes, decodeError);\n if (decoder) {\n decoder.release();\n }\n return result;\n }\n\n // Command handling\n\n private _parseControlDataString(): string {\n let str = '';\n for (let i = 0; i < this._controlLength; i++) {\n str += String.fromCodePoint(this._controlData[i]);\n }\n return str;\n }\n\n private _handleNoPayloadCommand(): boolean | Promise {\n const cmd = parseKittyCommand(this._parseControlDataString());\n\n // Per spec: specifying both i and I is an error\n if (cmd.id !== undefined && cmd.imageNumber !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:cannot specify both i and I keys', cmd.quiet ?? 0);\n return true;\n }\n\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.DELETE:\n return this._handleDelete(cmd);\n case KittyAction.QUERY:\n this._sendResponse(cmd.id ?? 0, 'OK', cmd.quiet ?? 0);\n return true;\n case KittyAction.PLACEMENT:\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handleCommandWithBytesAndCmd(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.TRANSMIT: {\n const result = this._handleTransmit(cmd, bytes, decodeError);\n // Only send response when _handleTransmit didn't already respond\n // (it handles unsupported transmission medium responses internally)\n if ((cmd.transmission ?? 'd') === 'd' && cmd.id !== undefined) {\n if (decodeError) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n } else if (bytes.length > 0) {\n this._sendResponse(cmd.id, 'OK', cmd.quiet ?? 0);\n }\n }\n return result;\n }\n case KittyAction.TRANSMIT_DISPLAY:\n return this._handleTransmitDisplay(cmd, bytes, decodeError);\n case KittyAction.QUERY:\n return this._handleQuery(cmd, bytes, decodeError);\n case KittyAction.PLACEMENT:\n // a=p ignores any payload — image data was already transmitted\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handlePlacement(cmd: IKittyCommand): boolean | Promise {\n if (cmd.id === undefined) {\n return true;\n }\n const id = cmd.id;\n const image = this._kittyStorage.getImage(id);\n if (!image) {\n this._sendResponse(id, 'ENOENT:image not found', cmd.quiet ?? 0, cmd.placementId);\n return true;\n }\n const result = this._displayImage(image, cmd);\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0, cmd.placementId);\n return true;\n });\n }\n\n private _handleTransmit(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n // TODO: Support file-based transmission modes (t=f, t=t, t=s)\n // Currently only supports direct transmission (t=d, the default).\n // - t=f (file): Payload is base64-encoded file path. Terminal reads image from that path.\n // - t=t (temp file): Payload is base64-encoded path in temp directory. Terminal reads, deletes.\n // - t=s: Payload is base64-encoded POSIX shm name. Terminal reads from shared memory.\n // These modes require filesystem/IPC access not available in browsers. For Node.js/Electron:\n // 1. Check cmd.transmission (t key) before treating bytes as image data\n // 2. For t=f/t/s: decode bytes as UTF-8 string (the path/name), then read file contents\n // 3. For t=d: treat bytes as image data (current behavior)\n // When implementing, also update _handleQuery to accept these transmission mediums.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported transmission medium', cmd.quiet ?? 0);\n }\n return true;\n }\n\n if (decodeError || bytes.length === 0) return true;\n\n this._kittyStorage.storeImage(cmd.id, {\n data: new Blob([bytes as BlobPart]),\n width: cmd.width ?? 0,\n height: cmd.height ?? 0,\n format: (cmd.format ?? KittyFormat.RGBA) as 24 | 32 | 100,\n compression: cmd.compression ?? ''\n });\n return true;\n }\n\n private _handleTransmitDisplay(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n if (decodeError) {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n }\n return true;\n }\n\n this._handleTransmit(cmd, bytes, decodeError);\n\n const id = cmd.id ?? this._kittyStorage.lastImageId;\n const image = this._kittyStorage.getImage(id);\n if (image) {\n const result = this._displayImage(image, cmd);\n if (cmd.id !== undefined) {\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0);\n return true;\n });\n }\n return result.then(() => true);\n }\n return true;\n }\n\n private _handleQuery(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n const id = cmd.id ?? 0;\n const quiet = cmd.quiet ?? 0;\n\n // Per spec: reject unsupported transmission mediums (only t=d is supported atm)\n // TODO: When filesystem support is added (Node.js/Electron), update this to accept\n // t=f (file), t=t (temp file), and t=s (shared memory) and respond OK for queries.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n this._sendResponse(id, 'EINVAL:unsupported transmission medium', quiet);\n return true;\n }\n\n // Check decode error first (invalid base64)\n if (decodeError) {\n this._sendResponse(id, 'EINVAL:invalid base64 data', quiet);\n return true;\n }\n\n // Capability query (no payload) - just respond OK\n if (bytes.length === 0) {\n this._sendResponse(id, 'OK', quiet);\n return true;\n }\n\n const format = cmd.format ?? KittyFormat.RGBA;\n\n if (format === KittyFormat.PNG) {\n this._sendResponse(id, 'OK', quiet);\n } else {\n const width = cmd.width ?? 0;\n const height = cmd.height ?? 0;\n\n if (!width || !height) {\n this._sendResponse(id, 'EINVAL:width and height required for raw pixel data', quiet);\n return true;\n }\n\n const bytesPerPixel = format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n this._sendResponse(id, `EINVAL:insufficient pixel data`, quiet);\n return true;\n }\n\n this._sendResponse(id, 'OK', quiet);\n }\n return true;\n }\n\n private _handleDelete(cmd: IKittyCommand): boolean {\n // Per spec: default delete selector is 'a' (delete all visible placements)\n const selector = cmd.deleteSelector ?? 'a';\n\n // TODO: Distinguish lowercase (delete placements only) from uppercase\n // (delete placements + free stored image data). Currently both variants\n // free everything since we don't separate stored data from placements.\n switch (selector) {\n case 'a':\n case 'A':\n this._cleanupAllPending();\n this._kittyStorage.deleteAll();\n break;\n case 'i':\n case 'I':\n // TODO: When placement id tracking is implemented (see TODO in\n // KittyImageStorage), d=i with p= should delete only that\n // specific placement, while d=i without p should delete all\n // placements for the image.\n if (cmd.id !== undefined) {\n const pending = this._pendingTransmissions.get(cmd.id);\n if (pending) {\n pending.decoder.release();\n }\n this._removePendingEntry(cmd.id);\n this._kittyStorage.deleteById(cmd.id);\n }\n break;\n default:\n // Unsupported selectors (c, n, p, q, r, x, y, z, f) — ignore for now\n break;\n }\n return true;\n }\n\n private _sendResponse(id: number, message: string, quiet: number, placementId?: number): void {\n const isOk = message === 'OK';\n if (isOk && quiet >= 1) return;\n if (!isOk && quiet >= 2) return;\n\n const pPart = placementId ? `,p=${placementId}` : '';\n const response = `\\x1b_Gi=${id}${pPart};${message}\\x1b\\\\`;\n this._coreTerminal._core.coreService.triggerDataEvent(response);\n }\n\n // Image display\n\n private _displayImage(image: IKittyImageData, cmd: IKittyCommand): Promise {\n return this._decodeAndDisplay(image, cmd)\n .then(() => true)\n .catch(() => false);\n }\n\n private async _decodeAndDisplay(image: IKittyImageData, cmd: IKittyCommand): Promise {\n let bitmap: ImageBitmap | undefined = await this._createBitmap(image);\n\n try {\n const cropX = Math.max(0, cmd.x ?? 0);\n const cropY = Math.max(0, cmd.y ?? 0);\n const cropW = cmd.sourceWidth || (bitmap.width - cropX);\n const cropH = cmd.sourceHeight || (bitmap.height - cropY);\n\n const maxCropW = Math.max(0, bitmap.width - cropX);\n const maxCropH = Math.max(0, bitmap.height - cropY);\n const finalCropW = Math.max(0, Math.min(cropW, maxCropW));\n const finalCropH = Math.max(0, Math.min(cropH, maxCropH));\n\n if (finalCropW === 0 || finalCropH === 0) {\n throw new Error('invalid source rectangle');\n }\n\n if (cropX !== 0 || cropY !== 0 || finalCropW !== bitmap.width || finalCropH !== bitmap.height) {\n const cropped = await createImageBitmap(bitmap, cropX, cropY, finalCropW, finalCropH);\n bitmap.close();\n bitmap = cropped;\n }\n\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n\n // Per spec: c/r default to image's natural cell dimensions.\n // If only one of c/r is specified, compute the other from image aspect ratio.\n let imgCols: number;\n let imgRows: number;\n if (cmd.columns !== undefined && cmd.rows !== undefined) {\n imgCols = cmd.columns;\n imgRows = cmd.rows;\n } else if (cmd.columns !== undefined) {\n imgCols = cmd.columns;\n imgRows = Math.max(1, Math.ceil((bitmap.height / bitmap.width) * (imgCols * cw) / ch));\n } else if (cmd.rows !== undefined) {\n imgRows = cmd.rows;\n imgCols = Math.max(1, Math.ceil((bitmap.width / bitmap.height) * (imgRows * ch) / cw));\n } else {\n imgCols = Math.ceil(bitmap.width / cw);\n imgRows = Math.ceil(bitmap.height / ch);\n }\n\n let w = bitmap.width;\n let h = bitmap.height;\n\n // Scale bitmap to fit placement rectangle when c/r are specified\n if (cmd.columns !== undefined || cmd.rows !== undefined) {\n w = Math.round(imgCols * cw);\n h = Math.round(imgRows * ch);\n }\n\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n\n // Save cursor position before addImage modifies it\n const buffer = this._coreTerminal._core.buffer;\n const savedX = buffer.x;\n const savedY = buffer.y;\n const savedYbase = buffer.ybase;\n\n // Determine layer based on z-index: negative = behind text, 0+ = on top.\n // When z<0 we always use the bottom layer even without allowTransparency —\n // the image will simply be hidden behind the opaque text background, which\n // is the correct behavior (client asked for \"behind text\").\n const wantsBottom = cmd.zIndex !== undefined && cmd.zIndex < 0;\n const layer: ImageLayer = wantsBottom ? 'bottom' : 'top';\n\n if (w !== bitmap.width || h !== bitmap.height) {\n const scaled = await createImageBitmap(bitmap, { resizeWidth: w, resizeHeight: h });\n bitmap.close();\n bitmap = scaled;\n }\n\n // Per spec: X/Y are pixel offsets within the first cell, so clamp to cell dimensions\n const xOffset = Math.min(Math.max(0, cmd.xOffset ?? 0), cw - 1);\n const yOffset = Math.min(Math.max(0, cmd.yOffset ?? 0), ch - 1);\n if (xOffset !== 0 || yOffset !== 0) {\n // Per spec: X/Y is not added to c/r area. When c/r are explicit, the\n // total placement area remains c*cw × r*ch pixels and the offset image\n // is clipped to fit. When c/r are unset, the padded canvas determines\n // the natural cell dimensions.\n const canvasW = (cmd.columns !== undefined) ? Math.round(imgCols * cw) : bitmap.width + xOffset;\n const canvasH = (cmd.rows !== undefined) ? Math.round(imgRows * ch) : bitmap.height + yOffset;\n const offsetCanvas = ImageRenderer.createCanvas(window.document, canvasW, canvasH);\n const offsetCtx = offsetCanvas.getContext('2d');\n if (!offsetCtx) {\n throw new Error('Failed to create offset canvas context');\n }\n offsetCtx.drawImage(bitmap, xOffset, yOffset);\n\n const offsetBitmap = await createImageBitmap(offsetCanvas);\n offsetCanvas.width = offsetCanvas.height = 0;\n bitmap.close();\n bitmap = offsetBitmap;\n w = bitmap.width;\n h = bitmap.height;\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n if (cmd.columns === undefined) {\n imgCols = Math.ceil(bitmap.width / cw);\n }\n if (cmd.rows === undefined) {\n imgRows = Math.ceil(bitmap.height / ch);\n }\n }\n\n const zIndex = cmd.zIndex ?? 0;\n this._kittyStorage.addImage(image.id, bitmap, true, layer, zIndex);\n bitmap = undefined; // ownership transferred to storage\n\n // Kitty cursor movement\n // Per spec: cursor placed at first column after last image column,\n // on the last row of the image. C=1 means don't move cursor.\n if (cmd.cursorMovement === 1) {\n // C=1: restore cursor to position before image was placed\n const scrolled = buffer.ybase - savedYbase;\n buffer.x = savedX;\n // Can't restore cursor to scrollback?\n buffer.y = Math.max(savedY - scrolled, 0);\n } else {\n // Default (C=0): advance cursor horizontally past the image\n // addImage already positioned cursor on the last row via lineFeeds\n buffer.x = Math.min(savedX + imgCols, this._coreTerminal.cols);\n }\n } catch (e) {\n bitmap?.close();\n throw e;\n }\n }\n\n // Create ImageBitmap from already-decoded image data.\n private async _createBitmap(image: IKittyImageData): Promise {\n let bytes: Uint8Array = new Uint8Array(await image.data.arrayBuffer());\n\n if (image.compression === KittyCompression.ZLIB) {\n bytes = await this._decompressZlib(bytes);\n }\n\n if (image.format === KittyFormat.PNG) {\n const blob = new Blob([bytes as BlobPart], { type: 'image/png' });\n if (!window.createImageBitmap) {\n const url = URL.createObjectURL(blob);\n const img = new Image();\n return new Promise((resolve, reject) => {\n img.addEventListener('load', () => {\n URL.revokeObjectURL(url);\n const canvas = ImageRenderer.createCanvas(window.document, img.width, img.height);\n canvas.getContext('2d')?.drawImage(img, 0, 0);\n createImageBitmap(canvas).then(resolve).catch(reject);\n });\n img.addEventListener('error', () => {\n URL.revokeObjectURL(url);\n reject(new Error('Failed to load image'));\n });\n img.src = url;\n });\n }\n return createImageBitmap(blob);\n }\n\n // Raw pixel data\n const width = image.width;\n const height = image.height;\n\n if (!width || !height) {\n throw new Error('Width and height required for raw pixel data');\n }\n\n const bytesPerPixel = image.format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n throw new Error('Insufficient pixel data');\n }\n\n const pixelCount = width * height;\n\n if (image.format === KittyFormat.RGBA) {\n // RGBA: use bytes directly — no copy needed\n return createImageBitmap(new ImageData(new Uint8ClampedArray(bytes.buffer as ArrayBuffer, bytes.byteOffset, pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA), width, height));\n }\n\n // RGB→RGBA: interleave alpha using uint32 block processing (4 pixels per iteration).\n // 3 uint32 reads + 4 uint32 writes per 4 pixels vs 28 byte reads/writes — ~6x faster.\n // Assumes little-endian (all modern browsers/Node.js).\n const data = new Uint8ClampedArray(pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA);\n const src32 = new Uint32Array(bytes.buffer, bytes.byteOffset, Math.floor(bytes.byteLength / 4));\n const dst32 = new Uint32Array(data.buffer);\n const alignedPixels = pixelCount & ~3; // round down to multiple of 4\n\n let srcOffset = 0;\n let dstOffset = 0;\n for (let i = 0; i < alignedPixels; i += 4) {\n const b0 = src32[srcOffset++];\n const b1 = src32[srcOffset++];\n const b2 = src32[srcOffset++];\n // Little-endian: pixel bytes are [R,G,B] → uint32 ABGR layout\n dst32[dstOffset++] = 0xFF000000 | b0;\n dst32[dstOffset++] = 0xFF000000 | (b0 >>> 24) | (b1 << 8);\n dst32[dstOffset++] = 0xFF000000 | (b1 >>> 16) | (b2 << 16);\n dst32[dstOffset++] = 0xFF000000 | (b2 >>> 8);\n }\n\n // Handle remaining 1–3 pixels\n let srcByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n let dstByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n for (let i = alignedPixels; i < pixelCount; i++) {\n data[dstByte] = bytes[srcByte];\n data[dstByte + 1] = bytes[srcByte + 1];\n data[dstByte + 2] = bytes[srcByte + 2];\n data[dstByte + 3] = KittyPixelConstants.ALPHA_OPAQUE;\n srcByte += KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n dstByte += KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n }\n\n return createImageBitmap(new ImageData(data, width, height));\n }\n\n private async _decompressZlib(compressed: Uint8Array): Promise {\n try {\n return await this._decompress(compressed, 'deflate');\n } catch {\n return await this._decompress(compressed, 'deflate-raw');\n }\n }\n\n private async _decompress(compressed: Uint8Array, format: 'deflate' | 'deflate-raw'): Promise {\n const ds = new DecompressionStream(format);\n const writer = ds.writable.getWriter();\n writer.write(compressed as BufferSource);\n writer.close();\n\n const chunks: Uint8Array[] = [];\n const reader = ds.readable.getReader();\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n\n const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n }\n\n public get images(): ReadonlyMap {\n return this._kittyStorage.images;\n }\n\n public get _kittyIdToStorageId(): ReadonlyMap {\n return this._kittyStorage.kittyIdToStorageId;\n }\n\n public get pendingTransmissions(): ReadonlyMap {\n return this._pendingTransmissions;\n }\n}\n","/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Kitty graphics protocol types, constants, and parsing utilities.\n */\n\nimport type Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\n\n// Kitty graphics protocol action types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'a'.\nexport const enum KittyAction {\n TRANSMIT = 't',\n TRANSMIT_DISPLAY = 'T',\n QUERY = 'q',\n PLACEMENT = 'p',\n DELETE = 'd'\n}\n\n// Kitty graphics protocol format types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyFormat {\n RGB = 24,\n RGBA = 32,\n PNG = 100\n}\n\n// Kitty graphics protocol compression types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'o'.\nexport const enum KittyCompression {\n NONE = '',\n ZLIB = 'z'\n}\n\n// Kitty graphics protocol control data keys.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyKey {\n // Action to perform (t=transmit, T=transmit+display, q=query, p=placement, d=delete)\n ACTION = 'a',\n // Image format (24=RGB, 32=RGBA, 100=PNG)\n FORMAT = 'f',\n // Image ID for referencing stored images\n ID = 'i',\n // Image number (alternative to ID, terminal assigns ID)\n IMAGE_NUMBER = 'I',\n // Source image width in pixels\n WIDTH = 's',\n // Source image height in pixels\n HEIGHT = 'v',\n // The left edge (in pixels) of the image area to display\n X_OFFSET = 'x',\n // The top edge (in pixels) of the image area to display\n Y_OFFSET = 'y',\n // Width (in pixels) of the source rectangle to display\n SOURCE_WIDTH = 'w',\n // Height (in pixels) of the source rectangle to display\n SOURCE_HEIGHT = 'h',\n // Horizontal offset (in pixels) within the first cell\n X_PLACEMENT_OFFSET = 'X',\n // Vertical offset (in pixels) within the first cell\n Y_PLACEMENT_OFFSET = 'Y',\n // Number of terminal columns to display the image over\n COLUMNS = 'c',\n // Number of terminal rows to display the image over\n ROWS = 'r',\n // More data flag (1=more chunks coming, 0=final chunk)\n MORE = 'm',\n // Compression type (z=zlib). This is essential for chunking larger images.\n COMPRESSION = 'o',\n // Quiet mode (1=suppress OK responses, 2=suppress error responses)\n QUIET = 'q',\n // Cursor movement policy (0=move cursor after image, 1=don't move cursor)\n CURSOR_MOVEMENT = 'C',\n // Z-index for image layering (negative = behind text, 0+ = on top)\n Z_INDEX = 'z',\n // Transmission medium (d=direct, f=file, t=temp file, s=shared memory)\n TRANSMISSION = 't',\n // Delete selector (a/A=all, i/I=by id, c/C=at cursor, etc.) — only used when a=d\n DELETE_SELECTOR = 'd',\n // Placement ID for targeting specific placements\n PLACEMENT_ID = 'p'\n}\n\n// Pixel format constants\nexport const enum KittyPixelConstants {\n BYTES_PER_PIXEL_RGB = 3,\n BYTES_PER_PIXEL_RGBA = 4,\n ALPHA_OPAQUE = 255\n}\n\n// Parsed Kitty graphics command.\nexport interface IKittyCommand {\n action?: string;\n format?: number;\n id?: number;\n imageNumber?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n sourceWidth?: number;\n sourceHeight?: number;\n xOffset?: number;\n yOffset?: number;\n columns?: number;\n rows?: number;\n more?: number;\n quiet?: number;\n cursorMovement?: number;\n zIndex?: number;\n transmission?: string;\n deleteSelector?: string;\n placementId?: number;\n compression?: string;\n payload?: string;\n}\n\n// Pending chunked transmission state.\n// Stores metadata from the first chunk while accumulating decoded payload data.\nexport interface IPendingTransmission {\n // The parsed command from the first chunk (contains action, format, dimensions, etc.)\n cmd: IKittyCommand;\n // Decoder used across chunked payloads\n decoder: Base64Decoder;\n // Total encoded (base64) bytes received across all chunks - for size limit enforcement\n totalEncodedSize: number;\n // Whether any chunk has failed to decode\n decodeError: boolean;\n}\n\n// Stored Kitty image data.\nexport interface IKittyImageData {\n id: number;\n // Decoded image data stored as Blob (off JS heap) to avoid 2GB heap limit\n data: Blob;\n width: number;\n height: number;\n format: 24 | 32 | 100;\n compression?: string;\n}\n\n// Parses Kitty graphics control data into a command object.\nexport function parseKittyCommand(data: string): IKittyCommand {\n const cmd: IKittyCommand = {};\n const parts = data.split(',');\n\n for (const part of parts) {\n const eqIdx = part.indexOf('=');\n if (eqIdx === -1) continue;\n\n const key = part.substring(0, eqIdx);\n const value = part.substring(eqIdx + 1);\n\n // Handle string keys first\n if (key === KittyKey.ACTION) {\n cmd.action = value;\n continue;\n }\n if (key === KittyKey.COMPRESSION) {\n cmd.compression = value;\n continue;\n }\n if (key === KittyKey.TRANSMISSION) {\n cmd.transmission = value;\n continue;\n }\n if (key === KittyKey.DELETE_SELECTOR) {\n cmd.deleteSelector = value;\n continue;\n }\n const numValue = parseInt(value, 10);\n switch (key) {\n case KittyKey.FORMAT: cmd.format = numValue; break;\n case KittyKey.ID: cmd.id = numValue; break;\n case KittyKey.IMAGE_NUMBER: cmd.imageNumber = numValue; break;\n case KittyKey.WIDTH: cmd.width = numValue; break;\n case KittyKey.HEIGHT: cmd.height = numValue; break;\n case KittyKey.X_OFFSET: cmd.x = numValue; break;\n case KittyKey.Y_OFFSET: cmd.y = numValue; break;\n case KittyKey.SOURCE_WIDTH: cmd.sourceWidth = numValue; break;\n case KittyKey.SOURCE_HEIGHT: cmd.sourceHeight = numValue; break;\n case KittyKey.X_PLACEMENT_OFFSET: cmd.xOffset = numValue; break;\n case KittyKey.Y_PLACEMENT_OFFSET: cmd.yOffset = numValue; break;\n case KittyKey.COLUMNS: cmd.columns = numValue; break;\n case KittyKey.ROWS: cmd.rows = numValue; break;\n case KittyKey.MORE: cmd.more = numValue; break;\n case KittyKey.QUIET: cmd.quiet = numValue; break;\n case KittyKey.CURSOR_MOVEMENT: cmd.cursorMovement = numValue; break;\n case KittyKey.Z_INDEX: cmd.zIndex = numValue; break;\n case KittyKey.PLACEMENT_ID: cmd.placementId = numValue; break;\n }\n }\n\n return cmd;\n}\n","/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageStorage } from '../ImageStorage';\nimport { ImageLayer, IAddImageOpts } from '../Types';\nimport { IKittyImageData } from './KittyGraphicsTypes';\n\n// Kitty-specific image storage controller.\n//\n// Wraps shared ImageStorage with kitty protocol semantics:\n// - tracks transmitted image payloads by kitty image id\n// - tracks kitty image id -> shared ImageStorage id mapping for displayed images\n// - mirrors shared-storage evictions into kitty maps\n// - applies protocol-level undisplayed-image eviction policy\nexport class KittyImageStorage implements IDisposable {\n private static readonly _maxStoredImages = 256;\n\n private _nextImageId = 1;\n private readonly _images: Map = new Map();\n // TODO: Support multiple placements per image. The kitty spec identifies\n // placements by an (image id, placement id) pair — same i + different p\n // values should coexist, and same i + same p should replace the prior\n // placement. Currently we track only one storage entry per kitty image id,\n // so multiple placements of the same image overwrite each other. Fixing\n // this requires changing these maps to Map>\n // (kittyId → placementId → storageId) and updating addImage/deleteById\n // accordingly. The underlying shared ImageStorage would also need to\n // support multiple entries per logical image.\n private readonly _kittyIdToStorageId: Map = new Map();\n private readonly _storageIdToKittyId: Map = new Map();\n\n private readonly _previousOnImageDeleted: ((storageId: number) => void) | undefined;\n private readonly _wrappedOnImageDeleted: (storageId: number) => void;\n private readonly _handleStorageImageDeleted = (storageId: number): void => {\n const kittyId = this._storageIdToKittyId.get(storageId);\n if (kittyId !== undefined) {\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n this._images.delete(kittyId);\n }\n };\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n\n constructor(\n private readonly _storage: ImageStorage\n ) {\n this._previousOnImageDeleted = this._storage.onImageDeleted;\n this._wrappedOnImageDeleted = (storageId: number) => {\n this._previousOnImageDeleted?.(storageId);\n this._handleStorageImageDeleted(storageId);\n };\n this._storage.onImageDeleted = this._wrappedOnImageDeleted;\n }\n\n public reset(): void {\n this._nextImageId = 1;\n this._images.clear();\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public dispose(): void {\n this.reset();\n if (this._storage.onImageDeleted === this._wrappedOnImageDeleted) {\n this._storage.onImageDeleted = this._previousOnImageDeleted;\n }\n }\n\n public storeImage(id: number | undefined, imageData: Omit): number {\n const imageId = id ?? this._nextImageId++;\n\n const oldStorageId = this._kittyIdToStorageId.get(imageId);\n if (oldStorageId !== undefined) {\n this._storage.deleteImage(oldStorageId);\n this._kittyIdToStorageId.delete(imageId);\n this._storageIdToKittyId.delete(oldStorageId);\n }\n\n if (!this._images.has(imageId) && this._images.size >= KittyImageStorage._maxStoredImages) {\n this._evictUndisplayedImages();\n }\n\n this._images.set(imageId, {\n ...imageData,\n id: imageId\n });\n return imageId;\n }\n\n public addImage(kittyId: number, image: HTMLCanvasElement | ImageBitmap, scrolling: boolean, layer: ImageLayer, zIndex: number): void {\n // Clean up stale reverse-mapping from a previous placement of the same\n // kitty image. The old shared-storage entry is kept (it may still be\n // visible on screen) but its reverse mapping is removed so that eviction\n // of the old entry won't incorrectly delete the kitty image data.\n const oldStorageId = this._kittyIdToStorageId.get(kittyId);\n if (oldStorageId !== undefined) {\n this._storageIdToKittyId.delete(oldStorageId);\n }\n this._addImageOpts.scrolling = scrolling;\n this._addImageOpts.layer = layer;\n this._addImageOpts.zIndex = zIndex;\n const storageId = this._storage.addImage(image, this._addImageOpts);\n this._kittyIdToStorageId.set(kittyId, storageId);\n this._storageIdToKittyId.set(storageId, kittyId);\n }\n\n public getImage(kittyId: number): IKittyImageData | undefined {\n return this._images.get(kittyId);\n }\n\n public deleteById(kittyId: number): void {\n this._images.delete(kittyId);\n const storageId = this._kittyIdToStorageId.get(kittyId);\n if (storageId !== undefined) {\n this._storage.deleteImage(storageId);\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n }\n }\n\n public deleteAll(): void {\n this._images.clear();\n for (const storageId of this._kittyIdToStorageId.values()) {\n this._storage.deleteImage(storageId);\n }\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public get images(): ReadonlyMap {\n return this._images;\n }\n\n public get kittyIdToStorageId(): ReadonlyMap {\n return this._kittyIdToStorageId;\n }\n\n public get lastImageId(): number {\n return this._nextImageId - 1;\n }\n\n private _evictUndisplayedImages(): void {\n for (const [kittyId] of this._images) {\n if (this._images.size <= KittyImageStorage._maxStoredImages / 2) {\n break;\n }\n if (!this._kittyIdToStorageId.has(kittyId)) {\n this._images.delete(kittyId);\n }\n }\n }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023, 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\n/**\n * wasm base64 decoder.\n */\nconst wasmDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#828e69684093b2c6:rdef-start:\"decode\"*/{s:1,t:0,d:'AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML'}/*inwasm#828e69684093b2c6:rdef-end:\"decode\"*/);\n// SIMD version (speedup ~1.4x, not covered by tests yet)\n/*\nconst wasmDecode = InWasm({\n name: 'decode',\n type: OutputType.INSTANCE,\n mode: OutputMode.SYNC,\n srctype: 'Clang-C',\n imports: {\n env: { memory: new WebAssembly.Memory({ initial: 1 }) }\n },\n exports: {\n dec: () => 0,\n end: () => 0\n },\n compile: {\n switches: ['-msimd128', '-Wl,-z,stack-size=0', '-Wl,--stack-first']\n },\n code: `\n #include \n typedef struct {\n unsigned int wp;\n unsigned int sp;\n unsigned int dp;\n unsigned int e_size;\n unsigned int dummy[4];\n unsigned char data[0];\n } State;\n\n unsigned int *D0 = (unsigned int *) ${P32.D0 * 4};\n unsigned int *D1 = (unsigned int *) ${P32.D1 * 4};\n unsigned int *D2 = (unsigned int *) ${P32.D2 * 4};\n unsigned int *D3 = (unsigned int *) ${P32.D3 * 4};\n State *state = (State *) ${P32.STATE * 4};\n\n #define packed_byte(x) wasm_i8x16_splat((char) x)\n #define packed_dword(x) wasm_i32x4_splat(x)\n #define masked(x, mask) wasm_v128_and(x, wasm_i32x4_splat(mask))\n\n __attribute__((noinline)) int dec() {\n unsigned int nsp = (state->wp - 1) & ~3;\n unsigned char *src = state->data + state->sp;\n unsigned char *end = state->data + nsp;\n unsigned char *dst = state->data + state->dp;\n unsigned int error = 0;\n\n v128_t err = wasm_i8x16_splat(0);\n unsigned char *end16 = state->data + (nsp & ~15);\n while (src < end16) {\n v128_t data = wasm_v128_load((v128_t *) src);\n\n // wasm-simd rewrite of http://0x80.pl/notesen/2016-01-17-sse-base64-decoding.html#vector-lookup-pshufb\n const v128_t higher_nibble = wasm_u32x4_shr(data, 4) & packed_byte(0x0f);\n const char linv = 1;\n const char hinv = 0;\n\n const v128_t lower_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n linv, linv, 0x2b, 0x30,\n 0x41, 0x50, 0x61, 0x70,\n linv, linv, linv, linv,\n linv, linv, linv, linv\n );\n const v128_t upper_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n hinv, hinv, 0x2b, 0x39,\n 0x4f, 0x5a, 0x6f, 0x7a,\n hinv, hinv, hinv, hinv,\n hinv, hinv, hinv, hinv\n );\n // the difference between the shift and lower bound\n const v128_t shift_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n 0x00, 0x00, 0x3e - 0x2b, 0x34 - 0x30,\n 0x00 - 0x41, 0x0f - 0x50, 0x1a - 0x61, 0x29 - 0x70,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00\n );\n\n const v128_t upper_bound = wasm_i8x16_swizzle(upper_bound_LUT, higher_nibble);\n const v128_t lower_bound = wasm_i8x16_swizzle(lower_bound_LUT, higher_nibble);\n\n const v128_t below = wasm_i8x16_lt(data, lower_bound);\n const v128_t above = wasm_i8x16_gt(data, upper_bound);\n const v128_t eq_2f = wasm_i8x16_eq(data, packed_byte(0x2f));\n\n // in_range = not (below or above) or eq_2f\n // outside = not in_range = below or above and not eq_2f (from deMorgan law)\n const v128_t outside = wasm_v128_andnot(eq_2f, above | below);\n err = wasm_v128_or(err, outside);\n\n const v128_t shift = wasm_i8x16_swizzle(shift_LUT, higher_nibble);\n const v128_t t0 = wasm_i8x16_add(data, shift);\n v128_t v = wasm_i8x16_add(t0, wasm_v128_and(eq_2f, packed_byte(-3)));\n\n // pack bytes\n const v128_t ca = masked(v, 0x003f003f);\n const v128_t db = masked(v, 0x3f003f00);\n const v128_t t00 = wasm_v128_or(wasm_u32x4_shr(db, 8), wasm_i32x4_shl(ca, 6));\n v128_t res = wasm_v128_or(wasm_u32x4_shr(t00, 16), wasm_i32x4_shl(t00, 12));\n res = wasm_i8x16_swizzle(res, wasm_i8x16_const(2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, 16, 16, 16, 16));\n\n wasm_v128_store((v128_t *) dst, res);\n dst += 12;\n src += 16;\n }\n //if (wasm_i8x16_bitmask(err) != 0) return -1;\n if (wasm_v128_any_true(err)) return -1;\n\n // operate on 4-byte blocks\n while (src < end) {\n error |= *((unsigned int *) dst) = D0[src[0]] | D1[src[1]] | D2[src[2]] | D3[src[3]];\n dst += 3;\n src += 4;\n }\n if (error >> 24) return -1;\n state->sp = nsp;\n state->dp = dst - state->data;\n return 0;\n }\n\n int end() {\n int rem = state->wp - state->sp;\n if (rem > 4 && dec()) return -1;\n rem = state->wp - state->sp;\n if (rem < 2) return -1;\n\n unsigned char *src = state->data + state->sp;\n if (rem == 4) {\n if (src[3] == 61) rem--;\n if (src[2] == 61) rem--;\n }\n unsigned int accu = D0[src[0]] | D1[src[1]];\n int dp = 1;\n if (rem > 2) {\n accu |= D2[src[2]];\n dp++;\n if (rem == 4) {\n accu |= D3[src[3]];\n dp++;\n }\n }\n if (accu >> 24) return -1;\n *((unsigned int *) (state->data + state->dp)) = accu;\n state->dp += dp;\n return 0;\n }\n `\n});\n*/\n// base64 map\nconst MAP = new Uint8Array('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n .split('')\n .map(el => el.charCodeAt(0)));\n// init decoder maps in LE order\nconst D = new Uint32Array(1024);\nD.fill(0xFF000000);\nfor (let i = 0; i < MAP.length; ++i)\n D[MAP[i]] = i << 2;\nfor (let i = 0; i < MAP.length; ++i)\n D[256 + MAP[i]] = i >> 4 | ((i << 4) & 0xFF) << 8;\nfor (let i = 0; i < MAP.length; ++i)\n D[512 + MAP[i]] = (i >> 2) << 8 | ((i << 6) & 0xFF) << 16;\nfor (let i = 0; i < MAP.length; ++i)\n D[768 + MAP[i]] = i << 16;\nconst EMPTY = new Uint8Array(0);\n/**\n * base64 stream decoder.\n *\n * Features / assumptions:\n * - lazy chunkwise decoding\n * - errors out on any non base64 chars (no support for NL formatted base64)\n * - decodes in wasm\n * - inplace decoding to save memory\n * - supports a keepSize for lazy memory release\n */\nclass Base64Decoder {\n /**\n * @param keepSize Keep the wasm instance below this limit when calling `release()`.\n * @param maxBytes Max allowed bytes to allocate.\n * @param initialBytes Initial bytes to allocate.\n */\n constructor(keepSize, maxBytes, initialBytes) {\n this._inst = null;\n this._ended = true;\n this._bytes = 0;\n this.keepSize = keepSize !== null && keepSize !== void 0 ? keepSize : 1048576 /* Bytes.KEEP */;\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : 4294901760 /* Bytes.MAX */;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : 32768 /* Bytes.INITIAL */;\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw new Error('invalid byte settings');\n }\n }\n /**\n * Currently decoded bytes (borrowed).\n * Must be accessed before calling `release` or `init`.\n */\n get data8() {\n return this._inst ? this._d.subarray(0, this._m32[1282 /* P32.STATE_DP */]) : EMPTY;\n }\n /**\n * Release memory conditionally based on `keepSize`.\n * If memory gets released, also the wasm instance will be freed and recreated on next `init`,\n * otherwise the instance will be reused.\n */\n release() {\n if (!this._inst)\n return;\n if (this._bytes > this.keepSize) {\n this._inst = this._m32 = this._d = this._mem = null;\n }\n else {\n this._m32[1280 /* P32.STATE_WP */] = 0;\n this._m32[1281 /* P32.STATE_SP */] = 0;\n this._m32[1282 /* P32.STATE_DP */] = 0;\n }\n }\n /**\n * Initializes the decoder for new base64 data.\n * Must be called before doing any decoding attempts.\n * The method will either spawn a new wasm instance or grow\n * the needed memory of an existing instance.\n * @param maxBytes Max allowed bytes to allocate (overwrites ctor value).\n * @param initialBytes Initial bytes to allocate (overwrites ctor value).\n */\n init(maxBytes, initialBytes) {\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : this.maxBytes;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : Math.min(this._bytes, this.maxBytes);\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw Error('invalid byte settings');\n }\n let m = this._m32;\n const bytes = this._bytes + 5152 /* Bytes._DATA_OFFSET */;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmDecode({ env: { memory: this._mem } });\n m = new Uint32Array(this._mem.buffer, 0);\n m.set(D, 256 /* P32.D0 */);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n m = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n m[1280 /* P32.STATE_WP */] = 0;\n m[1281 /* P32.STATE_SP */] = 0;\n m[1282 /* P32.STATE_DP */] = 0;\n this._m32 = m;\n this._ended = false;\n }\n /**\n * Realloc memory. Realloc only happens, if the requested\n * size doesn't fit in the current memory.\n * The new size will be capped by `maxBytes`.\n * @param requested Bytes to be stored.\n */\n _realloc(requested) {\n const needed = this._m32[1280 /* P32.STATE_WP */] + requested;\n if (this._bytes < needed) {\n if (needed > this.maxBytes) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n let newSize = this._bytes;\n while ((newSize *= 2) < needed) { }\n newSize = Math.min(newSize, this.maxBytes);\n if (newSize < needed) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n if (newSize + 5152 /* Bytes._DATA_OFFSET */ > this._mem.buffer.byteLength) {\n const addPages = Math.ceil((newSize + 5152 /* Bytes._DATA_OFFSET */ - this._mem.buffer.byteLength) / 65536);\n this._mem.grow(addPages);\n this._m32 = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n this._bytes = newSize;\n }\n return 0 /* DecodeStatus.OK */;\n }\n /**\n * Put bytes in `data` into the decoder.\n * Additionally decodes the payload, if it reached 2^17 bytes.\n * The return value indicates the type of issue.\n * @param data Bytes to be loaded.\n */\n put(data) {\n if (!this._inst || this._ended) {\n return -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n if (this._realloc(data.length)) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n const m = this._m32;\n this._d.set(data, m[1280 /* P32.STATE_WP */]);\n m[1280 /* P32.STATE_WP */] += data.length;\n // max chunk in input handler is 2^17, try to run in \"tandem mode\"\n return m[1280 /* P32.STATE_WP */] - m[1281 /* P32.STATE_SP */] >= 131072\n ? this._inst.exports.dec()\n : 0 /* DecodeStatus.OK */;\n }\n /**\n * End the current decoding.\n * Also decodes leftover payload from previous put calls.\n */\n end() {\n this._ended = true;\n return this._inst\n ? this._inst.exports.end()\n : -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n /**\n * Bytes loaded into the decoder.\n */\n get loadedBytes() {\n return this._inst\n ? this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n /**\n * Free bytes to feed to the decoder.\n */\n get freeBytes() {\n return this._inst\n ? this.maxBytes - this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n}\nexports.default = Base64Decoder;\n//# sourceMappingURL=Base64Decoder.wasm.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\nconst wasmQoiDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#459f9e1bfb80b1a8:rdef-start:\"qoi_decode\"*/{s:1,t:0,d:'AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=='}/*inwasm#459f9e1bfb80b1a8:rdef-end:\"qoi_decode\"*/);\nclass QoiDecoder {\n constructor(keepSize) {\n this.keepSize = keepSize;\n this.width = 0;\n this.height = 0;\n }\n decode(d) {\n this.width = d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7];\n this.height = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];\n const pixels = this.width * this.height;\n const ib = pixels * 4;\n const dl = d.length;\n /**\n * byte/offset calculation:\n * To save some memory we dont reserve full memory for decoded + encoded,\n * but place encoded at the end of decoded plus 50% security distance\n * to avoid reads before writes positions:\n *\n * encoded < decoded (good compression)\n * enc ####################\n * dec #######################################\n * ^ ^\n * DST_P CHUNK_P\n *\n * encoded > decoded (degenerated compression, should not happen)\n * enc ##############################\n * dec ####################\n * ^ ^\n * DST_P CHUNK_P\n *\n * There is still a chance for overlapping r/w positions in case the compressed\n * data has very different pixel progression, yet the 50% security distance\n * should deal with that, as QOI will bloat data by 25% at max (RGB -> OP byte + RGB).\n * Since we always assume RGBA at decoding stage, the possible bloat reduces to 20% at max.\n */\n const bytes = Math.max(ib, dl) + (Math.min(ib, dl) >> 1) + 4096;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmQoiDecode({ env: { memory: this._mem } });\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n this._d = null;\n }\n if (!this._d) {\n this._d = new Uint8Array(this._mem.buffer);\n }\n // put src data at the end of memory, also align to 256\n const chunkP = (this._mem.buffer.byteLength - dl) & ~0xFF;\n this._d.set(d, chunkP);\n this._inst.exports.dec(chunkP, dl, pixels);\n return this._d.subarray(1024 /* P8.DST_P */, 1024 /* P8.DST_P */ + ib);\n }\n release() {\n if (!this._inst)\n return;\n if (this._mem.buffer.byteLength > this.keepSize) {\n this._inst = this._d = this._mem = null;\n }\n }\n}\nexports.default = QoiDecoder;\n//# sourceMappingURL=QoiDecoder.wasm.js.map","\"use strict\";\n/**\n * Copyright (c) 2022, 2026 Joerg Breitbart\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InWasm = InWasm;\nlet z = (s) => {\n if (Uint8Array.fromBase64)\n return Uint8Array.fromBase64(s);\n if (typeof Buffer !== 'undefined')\n return Buffer.from(s, 'base64');\n const b = atob(s);\n const r = new Uint8Array(b.length);\n for (let i = 0; i < r.length; ++i)\n r[i] = b.charCodeAt(i);\n return r;\n};\nfunction InWasm(def) {\n if (def.d) {\n const { t, s, d } = def;\n let b;\n let m;\n const W = WebAssembly;\n if (t === 0 /* OutputType.INSTANCE */) {\n if (s)\n return (e) => new W.Instance(m || (m = new W.Module(b || (b = z(d)))), e);\n return (e) => m\n ? W.instantiate(m, e)\n : W.instantiate(b || (b = z(d)), e).then(r => (m = r.module) && r.instance);\n }\n if (t === 1 /* OutputType.MODULE */) {\n if (s)\n return () => m || (m = new W.Module(b || (b = z(d))));\n return () => m\n ? Promise.resolve(m)\n : W.compile(b || (b = z(d))).then(r => m = r);\n }\n if (s)\n return () => b || (b = z(d));\n return () => Promise.resolve(b || (b = z(d)));\n }\n if (typeof _wasmCtx === 'undefined')\n throw new Error('must run \"inwasm\"');\n _wasmCtx.add(def);\n}\n//# sourceMappingURL=index.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport type { ITerminalAddon, IDisposable } from '@xterm/xterm';\nimport type { ImageAddon as IImageApi } from '@xterm/addon-image';\nimport { Emitter, type IEvent } from 'common/Event';\nimport { IIPHandler } from './IIPHandler';\nimport { ImageRenderer } from './ImageRenderer';\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { KittyGraphicsHandler } from './kitty/KittyGraphicsHandler';\nimport { KittyImageStorage } from './kitty/KittyImageStorage';\nimport { SixelHandler } from './SixelHandler';\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { ITerminalExt, IImageAddonOptions, IResetHandler } from './Types';\n\n\n/**\n * Document VT features provided by this addon.\n *\n * @vt: #E[Supported via @xterm/addon-image.] DCS SIXEL \"SIXEL Graphics\" \"DCS Ps ; Ps ; Ps ; q Pt ST\" \"Draw SIXEL image.\"\n *\n * Sixel support is provided by the addon @xterm/addon-image with these limitations:\n * - immediate coloring (no shared palette, allows high color settings of `img2sixel`)\n * - max. palette size of 4096 colors\n * - max. pixel width of 16K\n * - max. 25 MB per sixel sequence\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] OSC 1337 \"iTerm2 Commands\" \"OSC 1337 ; Pt BEL\" \"Custom iTerm2 commands.\"\n *\n * Only the inline image protocol (IIP) is supported by the addon @xterm/addon-image with\n * the following limitations:\n * - sequence:\n * - format: `OSC 1337 ; File=inline=1 ; size= ; ... : BEL`\n * - size param must be set and payload may not exceed CEIL(size * 4 / 3)\n * - strict base64 handling as of RFC4648 §4 (standard alphabet, optional padding,\n * no separator bytes allowed)\n * - supported params: size, name, width, height, preserveAspectRatio\n * - image formats: PNG, JPEG and GIF\n * - no animation support (renders first image of a GIF)\n * - no multipart support\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image)\n * and [iTerm2 IIP docs](https://iterm2.com/documentation-images.html) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] APC KITTY_GRAPHICS \"Kitty Graphics\" \"APC G Pt ST\" \"Kitty Graphics Protocol.\"\n *\n * Kitty graphics support is provided by the addon @xterm/addon-image.\n * Note that while basic image output already works, this is still work in progress.\n */\n\n// default values of addon ctor options\nconst DEFAULT_OPTIONS: IImageAddonOptions = {\n enableSizeReports: true,\n pixelLimit: 16777216, // limit to 4096 * 4096 pixels\n sixelSupport: true,\n sixelScrolling: true,\n sixelPaletteLimit: 4096,\n sixelSizeLimit: 33554432,\n storageLimit: 128,\n showPlaceholder: true,\n iipSupport: true,\n iipSizeLimit: 33554432,\n kittySupport: true,\n kittySizeLimit: 33554432\n};\n\n// max palette size supported by the sixel lib (compile time setting)\nconst MAX_SIXEL_PALETTE_SIZE = 4096;\n\n// definitions for _xtermGraphicsAttributes sequence\nconst enum GaItem {\n COLORS = 1,\n SIXEL_GEO = 2,\n REGIS_GEO = 3\n}\nconst enum GaAction {\n READ = 1,\n SET_DEFAULT = 2,\n SET = 3,\n READ_MAX = 4\n}\nconst enum GaStatus {\n SUCCESS = 0,\n ITEM_ERROR = 1,\n ACTION_ERROR = 2,\n FAILURE = 3\n}\n\n\nexport class ImageAddon implements ITerminalAddon, IImageApi {\n private _opts: IImageAddonOptions;\n private _defaultOpts: IImageAddonOptions;\n private _storage: ImageStorage | undefined;\n private _renderer: ImageRenderer | undefined;\n private _disposables: IDisposable[] = [];\n private _terminal: ITerminalExt | undefined;\n private _handlers: Map = new Map();\n private readonly _onImageAdded = new Emitter();\n public readonly onImageAdded: IEvent = this._onImageAdded.event;\n\n constructor(opts?: Partial) {\n this._opts = Object.assign({}, DEFAULT_OPTIONS, opts);\n this._defaultOpts = Object.assign({}, DEFAULT_OPTIONS, opts);\n }\n\n public dispose(): void {\n for (const obj of this._disposables) {\n obj.dispose();\n }\n this._disposables.length = 0;\n this._handlers.clear();\n this._onImageAdded.dispose();\n }\n\n private _disposeLater(...args: IDisposable[]): void {\n for (const obj of args) {\n this._disposables.push(obj);\n }\n }\n\n public activate(terminal: ITerminalExt): void {\n this._terminal = terminal;\n\n // internal data structures\n this._renderer = new ImageRenderer(terminal);\n this._storage = new ImageStorage(terminal, this._renderer, this._opts);\n this._storage.onImageAdded = () => this._onImageAdded.fire();\n\n // enable size reports\n if (this._opts.enableSizeReports) {\n const windowOps = terminal.options.windowOptions ?? {};\n windowOps.getWinSizePixels = true;\n windowOps.getCellSizePixels = true;\n windowOps.getWinSizeChars = true;\n terminal.options.windowOptions = windowOps;\n }\n\n this._disposeLater(\n this._renderer,\n this._storage,\n\n // DECSET/DECRST/DA1/XTSMGRAPHICS handlers\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'h' }, params => this._decset(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'l' }, params => this._decrst(params)),\n terminal.parser.registerCsiHandler({ final: 'c' }, params => this._da1(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'S' }, params => this._xtermGraphicsAttributes(params)),\n\n // render hook\n terminal.onRender(range => this._storage?.render(range)),\n\n /**\n * reset handlers covered:\n * - DECSTR\n * - RIS\n * - Terminal.reset()\n */\n terminal.parser.registerCsiHandler({ intermediates: '!', final: 'p' }, () => this.reset()),\n terminal.parser.registerEscHandler({ final: 'c' }, () => this.reset()),\n terminal._core._inputHandler.onRequestReset(() => this.reset()),\n\n // wipe canvas and delete alternate images on buffer switch\n terminal.buffer.onBufferChange(() => this._storage?.wipeAlternate()),\n\n // extend images to the right on resize\n terminal.onResize(metrics => this._storage?.viewportResize(metrics))\n );\n\n // SIXEL handler\n if (this._opts.sixelSupport) {\n const sixelStorage = new SixelImageStorage(this._storage!, this._opts, this._renderer!, terminal);\n const sixelHandler = new SixelHandler(this._opts, sixelStorage, terminal);\n this._handlers.set('sixel', sixelHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerDcsHandler({ final: 'q' }, sixelHandler)\n );\n }\n\n // iTerm IIP handler\n if (this._opts.iipSupport) {\n const iipStorage = new IIPImageStorage(this._storage!);\n const iipHandler = new IIPHandler(this._opts, this._renderer!, iipStorage, terminal);\n this._handlers.set('iip', iipHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerOscHandler(1337, iipHandler)\n );\n }\n\n // Kitty graphics handler\n if (this._opts.kittySupport) {\n const kittyStorage = new KittyImageStorage(this._storage!);\n const kittyHandler = new KittyGraphicsHandler(this._opts, this._renderer!, kittyStorage, terminal);\n this._handlers.set('kitty', kittyHandler);\n this._disposeLater(\n kittyStorage,\n kittyHandler,\n terminal._core._inputHandler._parser.registerApcHandler({ final: 'G' }, kittyHandler)\n );\n }\n }\n\n // Note: storageLimit is skipped here to not intoduce a surprising side effect.\n public reset(): boolean {\n // reset options customizable by sequences to defaults\n this._opts.sixelScrolling = this._defaultOpts.sixelScrolling;\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n // also clear image storage\n this._storage?.reset();\n // reset protocol handlers\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return false;\n }\n\n public get storageLimit(): number {\n return this._storage?.getLimit() || -1;\n }\n\n public set storageLimit(limit: number) {\n this._storage?.setLimit(limit);\n this._opts.storageLimit = limit;\n }\n\n public get storageUsage(): number {\n if (this._storage) {\n return this._storage.getUsage();\n }\n return -1;\n }\n\n public get showPlaceholder(): boolean {\n return this._opts.showPlaceholder;\n }\n\n public set showPlaceholder(value: boolean) {\n this._opts.showPlaceholder = value;\n this._renderer?.showPlaceholder(value);\n }\n\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.getImageAtBufferCell(x, y);\n }\n\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.extractTileAtBufferCell(x, y);\n }\n\n private _report(s: string): void {\n this._terminal?._core.input(s, false);\n }\n\n private _decset(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = false;\n break;\n }\n }\n return false;\n }\n\n private _decrst(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = true;\n break;\n }\n }\n return false;\n }\n\n // overload DA to return something more appropriate\n private _da1(params: (number | number[])[]): boolean {\n if (params[0]) {\n return true;\n }\n // reported features:\n // 62 - VT220\n // 4 - SIXEL support\n // 9 - charsets\n // 22 - ANSI colors\n if (this._opts.sixelSupport) {\n this._report(`\\x1b[?62;4;9;22c`);\n return true;\n }\n return false;\n }\n\n /**\n * Implementation of xterm's graphics attribute sequence.\n *\n * Supported features:\n * - read/change palette limits (max 4096 by sixel lib)\n * - read SIXEL canvas geometry (reports current window canvas or\n * squared pixelLimit if canvas > pixel limit)\n *\n * Everything else is deactivated.\n */\n private _xtermGraphicsAttributes(params: (number | number[])[]): boolean {\n if (params.length < 2) {\n return true;\n }\n if (params[0] === GaItem.COLORS) {\n switch (params[1]) {\n case GaAction.READ:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n return true;\n case GaAction.SET_DEFAULT:\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n // also reset protocol handlers for now\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return true;\n case GaAction.SET:\n if (params.length > 2 && !(params[2] instanceof Array) && params[2] <= MAX_SIXEL_PALETTE_SIZE) {\n this._opts.sixelPaletteLimit = params[2];\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n } else {\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n }\n return true;\n case GaAction.READ_MAX:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${MAX_SIXEL_PALETTE_SIZE}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n if (params[0] === GaItem.SIXEL_GEO) {\n switch (params[1]) {\n // we only implement read and read_max here\n case GaAction.READ:\n let width = this._renderer?.dimensions?.css.canvas.width;\n let height = this._renderer?.dimensions?.css.canvas.height;\n if (!width || !height) {\n // for some reason we have no working image renderer\n // --> fallback to default cell size\n const cellSize = CELL_SIZE_DEFAULT;\n width = (this._terminal?.cols || 80) * cellSize.width;\n height = (this._terminal?.rows || 24) * cellSize.height;\n }\n if (width * height < this._opts.pixelLimit) {\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${width.toFixed(0)};${height.toFixed(0)}S`);\n } else {\n // if we overflow pixelLimit report that squared instead\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n }\n return true;\n case GaAction.READ_MAX:\n // read_max returns pixelLimit as square area\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n // exit with error on ReGIS or any other requests\n this._report(`\\x1b[?${params[0]};${GaStatus.ITEM_ERROR}S`);\n return true;\n }\n}\n"],"names":["root","factory","exports","module","define","amd","globalThis","red","n","green","blue","toRGBA8888","r","g","b","a","clamp","low","high","value","Math","max","min","h2c","t1","t2","c","normalizeRGB","round","Object","defineProperty","DEFAULT_FOREGROUND","DEFAULT_BACKGROUND","PALETTE_ANSI_256","PALETTE_VT340_GREY","PALETTE_VT340_COLOR","normalizeHLS","nearestColorIndex","fromRGBA8888","alpha","BIG_ENDIAN","Uint8Array","Uint32Array","buffer","console","warn","color","palette","Number","MAX_SAFE_INTEGER","idx","i","length","dr","dg","db","d","h","l","s","v","HLStoRGB","p","push","decodeAsync","decode","Decoder","DecoderAsync","Colors_1","__webpack_require__","wasm_1","WASM_BYTES","Buffer","from","bytestring","atob","result","charCodeAt","decodeBase64","LIMITS","BYTES","WASM_MODULE","NULL_CANVAS","CallbackProxy","constructor","this","bandHandler","width","modeHandler","mode","handle_band","mode_parsed","DEFAULT_OPTIONS","memoryLimit","sixelColor","fillColor","paletteLimit","PALETTE_SIZE","truncate","opts","cbProxy","importObj","env","bind","WebAssembly","instantiate","then","inst","instance","_instance","_cbProxy","_PIXEL_OFFSET","MAX_WIDTH","_canvas","_bandWidths","_maxWidth","_minWidth","_lastOffset","_currentHeight","_opts","assign","Error","_handle_band","_initCanvas","Module","Instance","_wasm","_chunk","memory","get_chunk_address","CHUNK_SIZE","_states","get_state_address","_palette","get_palette_address","set","_pSrc","get_p0_address","init","_fillColor","_truncate","_rasterWidth","_rasterHeight","_width","_height","_level","_mode","_paletteLimit","pixels","height","release","_realloc","offset","additionalPixels","newCanvas","ceil","adv","remaining","subarray","current_width","current_height","memoryUsage","byteLength","properties","level","memUsage","rasterAttributes","numerator","denominator","data","start","end","decodeString","j","data32","currentWidth","fill","escape","final","finalOffset","bw","currentHeight","data8","Uint8ClampedArray","dec","async","Lifecycle_1","EventUtils","_listeners","_disposed","event","_event","listener","thisArgs","disposables","toDisposable","entry","fn","slice","indexOf","splice","Array","isArray","add","fire","call","listeners","len","dispose","forward","to","e","map","undefined","any","events","store","DisposableStore","runAndSubscribe","handler","initial","arg","_disposables","Set","_isDisposed","isDisposed","o","clear","Disposable","_store","_register","None","freeze","_value","ImageRenderer_1","ImageStorage_1","Base64Decoder_wasm_1","__importDefault","QoiDecoder_wasm_1","IIPHeaderParser_1","IIPMetrics_1","DEFAULT_HEADER","type","name","size","preserveAspectRatio","inline","_renderer","_storage","_coreTerminal","_aborted","_hp","HeaderParser","_header","_isMultipart","_abortMulti","maxEncodedBytes","iipSizeLimit","initialBytes","_dec","default","_qoiDec","reset","put","state","dataPos","parse","fields","success","seqType","w","CELL_SIZE_DEFAULT","dimensions","css","canvas","cols","rows","scale","_c","_a","_core","_coreBrowserService","dpr","report","toFixed","input","cond","blob","metrics","UNSUPPORTED_TYPE","imageType","mime","pixelLimit","_resize","floor","ImageData","byteOffset","ImageRenderer","createCanvas","_b","getContext","putImageData","addImage","Blob","createImageBitmap","resizeWidth","resizeHeight","bm","catch","cw","cell","ch","_d","rw","_dim","rh","wf","hf","f","total","cdim","endsWith","parseInt","toStr","String","fromCharCode","toInt","toSize","match","DECODERS","toString","bs","TextDecoder","FILE_MARKER","MULTIPARTFILE_MARKER","FILEPART_MARKER","FILEEND_MARKER","REPORTCELLSIZE_MARKER","MAX_FIELDCHARS","_buffer","_position","_key","k","_storeValue","pos","_storeKey","_addImageOpts","scrolling","layer","zIndex","cursorPos","img","d32","blockLength","jpgSize","dim","limit","_layers","get","localDocument","document","createElement","createImageData","ctx","imgData","Promise","resolve","_terminal","super","Map","_optionsRefresh","MutableDisposable","_oldOpen","open","parent","_open","screenElement","optionsService","onOptionChange","option","rescaleCanvas","_renderService","refreshRows","removeLayerFromDom","_oldSetRenderer","setRenderer","_placeholderBitmap","close","_placeholder","showPlaceholder","cellSize","_createPlaceHolder","clearLines","y","clearRect","_e","clearAll","draw","imgSpec","tileId","col","row","count","_rescaleImage","actual","sx","sy","dx","dy","finalWidth","finalHeight","drawImage","extractTile","drawPlaceholder","values","spec","actualCellSize","originalWidth","originalHeight","origCellSize","orig","renderer","key","keys","insertLayerToDom","has","classList","style","isolation","insertBefore","firstChild","appendChild","remove","delete","hasLayer","bWidth","blueprint","black","white","shift","x","screen","ctx2","bitmap","window","ExtendedAttrsImage","ext","_urlId","_ext","underlineStyle","underlineColor","underlineVariantOffset","val","urlId","imageId","clone","isEmpty","EMPTY_ATTRS","_images","_lastId","_lowestId","_fullyCleared","_needsFullClear","_pixelLimit","setLimit","storageLimit","error","message","getLimit","_viewportMetrics","marker","RangeError","_evictOldest","getUsage","_getStoredPixels","storedPixels","_delImg","id","ImageBitmap","onImageDeleted","wipeAlternate","zero","entries","bufferType","deleteImage","termCols","termRows","originX","originY","tileCount","_inputHandler","_dirtyRowTracker","markDirty","line","lines","ybase","_writeToCell","lineFeed","endMarker","registerMarker","onDispose","active","_evictOnAlternate","onImageAdded","render","range","hasTopImages","hasBottomImages","drawCalls","placeholderCalls","ydisp","getBg","_extendedAttrs","startTile","startCol","sort","viewportResize","oldCol","tilesPerRow","hasData","rightCol","_data","lastTile","expandCol","getImageAtBufferCell","extractTileAtBufferCell","room","used","current","old","oldSpec","imgId","Decoder_1","DEFAULT_PALETTE","convertLe","_size","sixelPaletteLimit","hook","params","attr","colors","bg","isInverse","isFgDefault","foreground","rgba","isFgRGB","t","toColorRGB","getFgColor","ansi","isBgDefault","background","isBgRGB","getBgColor","extractActiveBg","_curAttrData","_themeService","sixelSizeLimit","unhook","advanceCursor","sixelScrolling","KittyGraphicsTypes_1","_kittyStorage","_decodeError","_activeDecoder","_inControlData","_controlData","_controlLength","_encodedSizeLimit","_totalEncodedSize","_parsedCommand","_pendingTransmissions","_maxEncodedBytes","kittySizeLimit","_initialEncodedBytes","_cleanupAllPending","_removePendingEntry","_lastPendingKey","pending","decoder","controlEnd","copyLength","parseKittyCommand","_parseControlDataString","imageNumber","_sendResponse","quiet","action","payloadStart","_streamPayload","pendingKey","previousEncodedSize","totalEncodedSize","decoderToRelease","_handleNoPayloadCommand","cmd","_handleDelete","isMoreComing","more","decodeError","finalCmd","imageBytes","_handleCommandWithBytesAndCmd","str","fromCodePoint","_handlePlacement","bytes","_handleTransmit","transmission","_handleTransmitDisplay","_handleQuery","image","getImage","_displayImage","placementId","storeImage","format","compression","_f","lastImageId","expectedBytes","deleteSelector","deleteAll","deleteById","isOk","response","coreService","triggerDataEvent","_decodeAndDisplay","_createBitmap","cropX","cropY","cropW","sourceWidth","cropH","sourceHeight","maxCropW","maxCropH","finalCropW","finalCropH","cropped","imgCols","imgRows","columns","savedX","savedY","savedYbase","scaled","xOffset","yOffset","canvasW","canvasH","offsetCanvas","offsetCtx","offsetBitmap","_g","cursorMovement","scrolled","arrayBuffer","_decompressZlib","url","URL","createObjectURL","Image","reject","addEventListener","revokeObjectURL","src","pixelCount","src32","dst32","alignedPixels","srcOffset","dstOffset","b0","b1","b2","srcByte","dstByte","compressed","_decompress","ds","DecompressionStream","writer","writable","getWriter","write","chunks","reader","readable","getReader","done","read","totalLength","reduce","sum","chunk","images","_kittyIdToStorageId","kittyIdToStorageId","pendingTransmissions","parts","split","part","eqIdx","substring","numValue","KittyImageStorage","_nextImageId","_storageIdToKittyId","_handleStorageImageDeleted","storageId","kittyId","_previousOnImageDeleted","_wrappedOnImageDeleted","imageData","oldStorageId","_maxStoredImages","_evictUndisplayedImages","wasmDecode","InWasm","MAP","el","D","EMPTY","keepSize","maxBytes","_inst","_ended","_bytes","_m32","_mem","m","grow","Memory","requested","needed","newSize","addPages","loadedBytes","freeBytes","wasmQoiDecode","ib","dl","chunkP","def","W","z","compile","_wasmCtx","fromBase64","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","Event_1","IIPHandler_1","KittyGraphicsHandler_1","KittyImageStorage_1","SixelHandler_1","SixelImageStorage_1","IIPImageStorage_1","enableSizeReports","sixelSupport","iipSupport","kittySupport","_handlers","_onImageAdded","Emitter","_defaultOpts","obj","_disposeLater","args","activate","terminal","ImageStorage","windowOps","options","windowOptions","getWinSizePixels","getCellSizePixels","getWinSizeChars","parser","registerCsiHandler","prefix","_decset","_decrst","_da1","_xtermGraphicsAttributes","onRender","intermediates","registerEscHandler","onRequestReset","onBufferChange","onResize","sixelStorage","SixelImageStorage","sixelHandler","SixelHandler","_parser","registerDcsHandler","iipStorage","IIPImageStorage","iipHandler","IIPHandler","registerOscHandler","kittyStorage","kittyHandler","KittyGraphicsHandler","registerApcHandler","storageUsage","_report","sqrt"],"sourceRoot":""} \ No newline at end of file -+{"version":3,"file":"addon-image.js","mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,WAAAD,IAEAD,EAAA,WAAAC,GACC,CATD,CASCK,WAAA,uCCKD,SAAAC,EAAAC,GAC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node_modules/sixel/lib/Colors.js","webpack://ImageAddon/../node_modules/sixel/lib/Decoder.js","webpack://ImageAddon/../node_modules/sixel/lib/wasm.js","webpack://ImageAddon/../src/common/Event.ts","webpack://ImageAddon/../src/common/Lifecycle.ts","webpack://ImageAddon/./src/IIPHandler.ts","webpack://ImageAddon/./src/IIPHeaderParser.ts","webpack://ImageAddon/./src/IIPImageStorage.ts","webpack://ImageAddon/./src/IIPMetrics.ts","webpack://ImageAddon/./src/ImageRenderer.ts","webpack://ImageAddon/./src/ImageStorage.ts","webpack://ImageAddon/./src/SixelHandler.ts","webpack://ImageAddon/./src/SixelImageStorage.ts","webpack://ImageAddon/./src/kitty/KittyGraphicsHandler.ts","webpack://ImageAddon/./src/kitty/KittyGraphicsTypes.ts","webpack://ImageAddon/./src/kitty/KittyImageStorage.ts","webpack://ImageAddon/../node_modules/xterm-wasm-parts/lib/base64/Base64Decoder.wasm.js","webpack://ImageAddon/../node_modules/xterm-wasm-parts/lib/qoi/QoiDecoder.wasm.js","webpack://ImageAddon/javascript/node_modules/inwasm-runtime/lib/index.cjs","webpack://ImageAddon/webpack/bootstrap","webpack://ImageAddon/./src/ImageAddon.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ImageAddon\"] = factory();\n\telse\n\t\troot[\"ImageAddon\"] = factory();\n})(globalThis, () => {\nreturn ","\"use strict\";\n/**\n * Copyright (c) 2019 Joerg Breitbart.\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DEFAULT_FOREGROUND = exports.DEFAULT_BACKGROUND = exports.PALETTE_ANSI_256 = exports.PALETTE_VT340_GREY = exports.PALETTE_VT340_COLOR = exports.normalizeHLS = exports.normalizeRGB = exports.nearestColorIndex = exports.fromRGBA8888 = exports.toRGBA8888 = exports.alpha = exports.blue = exports.green = exports.red = exports.BIG_ENDIAN = void 0;\n// FIXME: cleanup this mess, move things either to decoder/encoder, keep only shared things\n// system endianess\nexports.BIG_ENDIAN = new Uint8Array(new Uint32Array([0xFF000000]).buffer)[0] === 0xFF;\nif (exports.BIG_ENDIAN) {\n console.warn('BE platform detected. This version of node-sixel works only on LE properly.');\n}\n// channel values\nfunction red(n) {\n return n & 0xFF;\n}\nexports.red = red;\nfunction green(n) {\n return (n >>> 8) & 0xFF;\n}\nexports.green = green;\nfunction blue(n) {\n return (n >>> 16) & 0xFF;\n}\nexports.blue = blue;\nfunction alpha(n) {\n return (n >>> 24) & 0xFF;\n}\nexports.alpha = alpha;\n/**\n * Convert RGB channels to native color RGBA8888.\n */\nfunction toRGBA8888(r, g, b, a = 255) {\n return ((a & 0xFF) << 24 | (b & 0xFF) << 16 | (g & 0xFF) << 8 | (r & 0xFF)) >>> 0; // ABGR32\n}\nexports.toRGBA8888 = toRGBA8888;\n/**\n * Convert native color to [r, g, b, a].\n */\nfunction fromRGBA8888(color) {\n return [color & 0xFF, (color >> 8) & 0xFF, (color >> 16) & 0xFF, color >>> 24];\n}\nexports.fromRGBA8888 = fromRGBA8888;\n/**\n * Get index of nearest color in `palette` for `color`.\n * Uses euclidean distance without any luminescence correction.\n */\nfunction nearestColorIndex(color, palette) {\n const r = red(color);\n const g = green(color);\n const b = blue(color);\n let min = Number.MAX_SAFE_INTEGER;\n let idx = -1;\n // use euclidean distance (manhattan gives very poor results)\n for (let i = 0; i < palette.length; ++i) {\n const dr = r - palette[i][0];\n const dg = g - palette[i][1];\n const db = b - palette[i][2];\n const d = dr * dr + dg * dg + db * db;\n if (!d)\n return i;\n if (d < min) {\n min = d;\n idx = i;\n }\n }\n return idx;\n}\nexports.nearestColorIndex = nearestColorIndex;\n// color conversions\n// HLS taken from: http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl\nfunction clamp(low, high, value) {\n return Math.max(low, Math.min(value, high));\n}\nfunction h2c(t1, t2, c) {\n if (c < 0)\n c += 1;\n if (c > 1)\n c -= 1;\n return c * 6 < 1\n ? t2 + (t1 - t2) * 6 * c\n : c * 2 < 1\n ? t1\n : c * 3 < 2\n ? t2 + (t1 - t2) * (4 - c * 6)\n : t2;\n}\nfunction HLStoRGB(h, l, s) {\n if (!s) {\n const v = Math.round(l * 255);\n return toRGBA8888(v, v, v);\n }\n const t1 = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const t2 = 2 * l - t1;\n return toRGBA8888(clamp(0, 255, Math.round(h2c(t1, t2, h + 1 / 3) * 255)), clamp(0, 255, Math.round(h2c(t1, t2, h) * 255)), clamp(0, 255, Math.round(h2c(t1, t2, h - 1 / 3) * 255)));\n}\n/**\n * Normalize SIXEL RGB values (percent based, 0-100) to RGBA8888.\n */\nfunction normalizeRGB(r, g, b) {\n return (0xFF000000 | Math.round(b / 100 * 255) << 16 | Math.round(g / 100 * 255) << 8 | Math.round(r / 100 * 255)) >>> 0; // ABGR32\n}\nexports.normalizeRGB = normalizeRGB;\n/**\n * Normalize SIXEL HLS values to RGBA8888. Applies hue correction of +240°.\n */\nfunction normalizeHLS(h, l, s) {\n // Note: hue value is turned by 240° in VT340, all values given as fractions\n return HLStoRGB((h + 240 % 360) / 360, l / 100, s / 100);\n}\nexports.normalizeHLS = normalizeHLS;\n/**\n * default palettes\n */\n// FIXME: move palettes to Decoder.ts\n/**\n * 16 predefined color registers of VT340 (values in %):\n * ```\n * R G B\n * 0 Black 0 0 0\n * 1 Blue 20 20 80\n * 2 Red 80 13 13\n * 3 Green 20 80 20\n * 4 Magenta 80 20 80\n * 5 Cyan 20 80 80\n * 6 Yellow 80 80 20\n * 7 Gray 50% 53 53 53\n * 8 Gray 25% 26 26 26\n * 9 Blue* 33 33 60\n * 10 Red* 60 26 26\n * 11 Green* 33 60 33\n * 12 Magenta* 60 33 60\n * 13 Cyan* 33 60 60\n * 14 Yellow* 60 60 33\n * 15 Gray 75% 80 80 80\n * ```\n * (*) less saturated\n *\n * @see https://vt100.net/docs/vt3xx-gp/chapter2.html#S2.4\n*/\nexports.PALETTE_VT340_COLOR = new Uint32Array([\n normalizeRGB(0, 0, 0),\n normalizeRGB(20, 20, 80),\n normalizeRGB(80, 13, 13),\n normalizeRGB(20, 80, 20),\n normalizeRGB(80, 20, 80),\n normalizeRGB(20, 80, 80),\n normalizeRGB(80, 80, 20),\n normalizeRGB(53, 53, 53),\n normalizeRGB(26, 26, 26),\n normalizeRGB(33, 33, 60),\n normalizeRGB(60, 26, 26),\n normalizeRGB(33, 60, 33),\n normalizeRGB(60, 33, 60),\n normalizeRGB(33, 60, 60),\n normalizeRGB(60, 60, 33),\n normalizeRGB(80, 80, 80)\n]);\n/**\n * 16 predefined monochrome registers of VT340 (values in %):\n * ```\n * R G B\n * 0 Black 0 0 0\n * 1 Gray-2 13 13 13\n * 2 Gray-4 26 26 26\n * 3 Gray-6 40 40 40\n * 4 Gray-1 6 6 6\n * 5 Gray-3 20 20 20\n * 6 Gray-5 33 33 33\n * 7 White 7 46 46 46\n * 8 Black 0 0 0 0\n * 9 Gray-2 13 13 13\n * 10 Gray-4 26 26 26\n * 11 Gray-6 40 40 40\n * 12 Gray-1 6 6 6\n * 13 Gray-3 20 20 20\n * 14 Gray-5 33 33 33\n * 15 White 7 46 46 46\n * ```\n *\n * @see https://vt100.net/docs/vt3xx-gp/chapter2.html#S2.4\n */\nexports.PALETTE_VT340_GREY = new Uint32Array([\n normalizeRGB(0, 0, 0),\n normalizeRGB(13, 13, 13),\n normalizeRGB(26, 26, 26),\n normalizeRGB(40, 40, 40),\n normalizeRGB(6, 6, 6),\n normalizeRGB(20, 20, 20),\n normalizeRGB(33, 33, 33),\n normalizeRGB(46, 46, 46),\n normalizeRGB(0, 0, 0),\n normalizeRGB(13, 13, 13),\n normalizeRGB(26, 26, 26),\n normalizeRGB(40, 40, 40),\n normalizeRGB(6, 6, 6),\n normalizeRGB(20, 20, 20),\n normalizeRGB(33, 33, 33),\n normalizeRGB(46, 46, 46)\n]);\n/**\n * 256 predefined ANSI colors.\n *\n * @see https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit\n */\nexports.PALETTE_ANSI_256 = (() => {\n // 16 lower colors (taken from xterm)\n const p = [\n toRGBA8888(0, 0, 0),\n toRGBA8888(205, 0, 0),\n toRGBA8888(0, 205, 0),\n toRGBA8888(205, 205, 0),\n toRGBA8888(0, 0, 238),\n toRGBA8888(205, 0, 205),\n toRGBA8888(0, 250, 205),\n toRGBA8888(229, 229, 229),\n toRGBA8888(127, 127, 127),\n toRGBA8888(255, 0, 0),\n toRGBA8888(0, 255, 0),\n toRGBA8888(255, 255, 0),\n toRGBA8888(92, 92, 255),\n toRGBA8888(255, 0, 255),\n toRGBA8888(0, 255, 255),\n toRGBA8888(255, 255, 255),\n ];\n // colors up to 232\n const d = [0, 95, 135, 175, 215, 255];\n for (let r = 0; r < 6; ++r) {\n for (let g = 0; g < 6; ++g) {\n for (let b = 0; b < 6; ++b) {\n p.push(toRGBA8888(d[r], d[g], d[b]));\n }\n }\n }\n // grey scale to up 255\n for (let v = 8; v <= 238; v += 10) {\n p.push(toRGBA8888(v, v, v));\n }\n return new Uint32Array(p);\n})();\n/**\n * Background: Black by default.\n * Foreground: White by default.\n *\n * Background color is used whenever a fill color is needed and not explicitly set.\n * Foreground color is used as default initial sixel color.\n */\nexports.DEFAULT_BACKGROUND = toRGBA8888(0, 0, 0, 255);\nexports.DEFAULT_FOREGROUND = toRGBA8888(255, 255, 255, 255);\n//# sourceMappingURL=Colors.js.map","\"use strict\";\n/**\n * Copyright (c) 2021 Joerg Breitbart.\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeAsync = exports.decode = exports.Decoder = exports.DecoderAsync = void 0;\nconst Colors_1 = require(\"./Colors\");\nconst wasm_1 = require(\"./wasm\");\n/* istanbul ignore next */\nfunction decodeBase64(s) {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(s, 'base64');\n }\n const bytestring = atob(s);\n const result = new Uint8Array(bytestring.length);\n for (let i = 0; i < result.length; ++i) {\n result[i] = bytestring.charCodeAt(i);\n }\n return result;\n}\nconst WASM_BYTES = decodeBase64(wasm_1.LIMITS.BYTES);\nlet WASM_MODULE;\n// empty canvas\nconst NULL_CANVAS = new Uint32Array();\n// proxy for lazy binding of decoder methods to wasm env callbacks\nclass CallbackProxy {\n constructor() {\n this.bandHandler = (width) => 1;\n this.modeHandler = (mode) => 1;\n }\n handle_band(width) {\n return this.bandHandler(width);\n }\n mode_parsed(mode) {\n return this.modeHandler(mode);\n }\n}\n// default decoder options\nconst DEFAULT_OPTIONS = {\n memoryLimit: 2048 * 65536,\n sixelColor: Colors_1.DEFAULT_FOREGROUND,\n fillColor: Colors_1.DEFAULT_BACKGROUND,\n palette: Colors_1.PALETTE_VT340_COLOR,\n paletteLimit: wasm_1.LIMITS.PALETTE_SIZE,\n truncate: true\n};\n/**\n * Create a decoder instance asynchronously.\n * To be used in the browser main thread.\n */\nfunction DecoderAsync(opts) {\n const cbProxy = new CallbackProxy();\n const importObj = {\n env: {\n handle_band: cbProxy.handle_band.bind(cbProxy),\n mode_parsed: cbProxy.mode_parsed.bind(cbProxy)\n }\n };\n return WebAssembly.instantiate(WASM_MODULE || WASM_BYTES, importObj)\n .then((inst) => {\n WASM_MODULE = WASM_MODULE || inst.module;\n return new Decoder(opts, inst.instance || inst, cbProxy);\n });\n}\nexports.DecoderAsync = DecoderAsync;\n/**\n * Decoder - web assembly based sixel stream decoder.\n *\n * Usage pattern:\n * - call `init` to initialize decoder for new image\n * - feed data chunks to `decode` or `decodeString`\n * - grab pixels from `data32`\n * - optional: call `release` to free memory (e.g. after big images)\n * - start over with next image by calling `init`\n *\n * Properties:\n * - max width of 2^14 - 4 pixels (compile time setting in wasm)\n * - no explicit height limit (only limited by memory)\n * - max 4096 colors palette (compile time setting in wasm)\n *\n * Explanation operation modes:\n * - M1 Mode chosen for level 1 images (no raster attributes),\n * or for level 2 images with `truncate=false`.\n * - M2 Mode chosen for level 2 images with `truncate=true` (default).\n * While this mode is not fully spec conform (decoder not expected to truncate),\n * it is what spec conform encoders should create (should not excess raster).\n * This mode has several advantages:\n * - ~15% faster decoding speed\n * - image dimensions can be evaluated early without processing the whole data\n * - faster pixel access in `data32` (precalulated)\n * - image height is not reported as multiple of 6 pixels\n * - M0 Undecided mode state after `init`.\n * The level of an image is determined during early decoding based on the fact,\n * whether the data contains valid raster attributes before any sixel data.\n * Until then the mode of an image is marked as M0, meaning the real operation mode\n * could not be decided yet.\n */\nclass Decoder {\n /**\n * Synchonous ctor. Can be called from nodejs or a webworker context.\n * For instantiation in the browser main thread use `WasmDecoderAsync` instead.\n */\n constructor(opts, _instance, _cbProxy) {\n this._PIXEL_OFFSET = wasm_1.LIMITS.MAX_WIDTH + 4;\n this._canvas = NULL_CANVAS;\n this._bandWidths = [];\n this._maxWidth = 0;\n this._minWidth = wasm_1.LIMITS.MAX_WIDTH;\n this._lastOffset = 0;\n this._currentHeight = 0;\n this._opts = Object.assign({}, DEFAULT_OPTIONS, opts);\n if (this._opts.paletteLimit > wasm_1.LIMITS.PALETTE_SIZE) {\n throw new Error(`DecoderOptions.paletteLimit must not exceed ${wasm_1.LIMITS.PALETTE_SIZE}`);\n }\n if (!_instance) {\n const module = WASM_MODULE || (WASM_MODULE = new WebAssembly.Module(WASM_BYTES));\n _instance = new WebAssembly.Instance(module, {\n env: {\n handle_band: this._handle_band.bind(this),\n mode_parsed: this._initCanvas.bind(this)\n }\n });\n }\n else {\n _cbProxy.bandHandler = this._handle_band.bind(this);\n _cbProxy.modeHandler = this._initCanvas.bind(this);\n }\n this._instance = _instance;\n this._wasm = this._instance.exports;\n this._chunk = new Uint8Array(this._wasm.memory.buffer, this._wasm.get_chunk_address(), wasm_1.LIMITS.CHUNK_SIZE);\n this._states = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_state_address(), 12);\n this._palette = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_palette_address(), wasm_1.LIMITS.PALETTE_SIZE);\n this._palette.set(this._opts.palette);\n this._pSrc = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_p0_address());\n this._wasm.init(Colors_1.DEFAULT_FOREGROUND, 0, this._opts.paletteLimit, 0);\n }\n // some readonly parser states for internal usage\n get _fillColor() { return this._states[0]; }\n get _truncate() { return this._states[8]; }\n get _rasterWidth() { return this._states[6]; }\n get _rasterHeight() { return this._states[7]; }\n get _width() { return this._states[2] ? this._states[2] - 4 : 0; }\n get _height() { return this._states[3]; }\n get _level() { return this._states[9]; }\n get _mode() { return this._states[10]; }\n get _paletteLimit() { return this._states[11]; }\n _initCanvas(mode) {\n if (mode === 2 /* M2 */) {\n const pixels = this.width * this.height;\n if (pixels > this._canvas.length) {\n if (this._opts.memoryLimit && pixels * 4 > this._opts.memoryLimit) {\n this.release();\n throw new Error('image exceeds memory limit');\n }\n this._canvas = new Uint32Array(pixels);\n }\n this._maxWidth = this._width;\n }\n else if (mode === 1 /* M1 */) {\n if (this._level === 2) {\n // got raster attributes, use them as initial size hint\n const pixels = Math.min(this._rasterWidth, wasm_1.LIMITS.MAX_WIDTH) * this._rasterHeight;\n if (pixels > this._canvas.length) {\n if (this._opts.memoryLimit && pixels * 4 > this._opts.memoryLimit) {\n this.release();\n throw new Error('image exceeds memory limit');\n }\n this._canvas = new Uint32Array(pixels);\n }\n }\n else {\n // else fallback to generic resizing, starting with 256*256 pixels\n if (this._canvas.length < 65536) {\n this._canvas = new Uint32Array(65536);\n }\n }\n }\n return 0; // 0 - continue, 1 - abort right away\n }\n _realloc(offset, additionalPixels) {\n const pixels = offset + additionalPixels;\n if (pixels > this._canvas.length) {\n if (this._opts.memoryLimit && pixels * 4 > this._opts.memoryLimit) {\n this.release();\n throw new Error('image exceeds memory limit');\n }\n // extend in 65536 pixel blocks\n const newCanvas = new Uint32Array(Math.ceil(pixels / 65536) * 65536);\n newCanvas.set(this._canvas);\n this._canvas = newCanvas;\n }\n }\n _handle_band(width) {\n const adv = this._PIXEL_OFFSET;\n let offset = this._lastOffset;\n if (this._mode === 2 /* M2 */) {\n let remaining = this.height - this._currentHeight;\n let c = 0;\n while (c < 6 && remaining > 0) {\n this._canvas.set(this._pSrc.subarray(adv * c, adv * c + width), offset + width * c);\n c++;\n remaining--;\n }\n this._lastOffset += width * c;\n this._currentHeight += c;\n }\n else if (this._mode === 1 /* M1 */) {\n this._realloc(offset, width * 6);\n this._maxWidth = Math.max(this._maxWidth, width);\n this._minWidth = Math.min(this._minWidth, width);\n for (let i = 0; i < 6; ++i) {\n this._canvas.set(this._pSrc.subarray(adv * i, adv * i + width), offset + width * i);\n }\n this._bandWidths.push(width);\n this._lastOffset += width * 6;\n this._currentHeight += 6;\n }\n return 0; // 0 - continue, 1 - abort right away\n }\n /**\n * Width of the image data.\n * Returns the rasterWidth in level2/truncating mode,\n * otherwise the max width, that has been seen so far.\n */\n get width() {\n return this._mode !== 1 /* M1 */\n ? this._width\n : Math.max(this._maxWidth, this._wasm.current_width());\n }\n /**\n * Height of the image data.\n * Returns the rasterHeight in level2/truncating mode,\n * otherwise height touched by sixels.\n */\n get height() {\n return this._mode !== 1 /* M1 */\n ? this._height\n : this._wasm.current_width()\n ? this._bandWidths.length * 6 + this._wasm.current_height()\n : this._bandWidths.length * 6;\n }\n /**\n * Get active palette colors as RGBA8888[] (borrowed).\n */\n get palette() {\n return this._palette.subarray(0, this._paletteLimit);\n }\n /**\n * Get the memory used by the decoder.\n *\n * This is a rough estimate accounting the wasm instance memory\n * and pixel buffers held on JS side (real value will be slightly\n * higher due to JS book-keeping).\n * Note that the decoder does not free ressources on its own,\n * call `release` to free excess memory.\n */\n get memoryUsage() {\n return this._canvas.byteLength + this._wasm.memory.buffer.byteLength + 8 * this._bandWidths.length;\n }\n /**\n * Get various properties of the decoder and the current image.\n */\n get properties() {\n return {\n width: this.width,\n height: this.height,\n mode: this._mode,\n level: this._level,\n truncate: !!this._truncate,\n paletteLimit: this._paletteLimit,\n fillColor: this._fillColor,\n memUsage: this.memoryUsage,\n rasterAttributes: {\n numerator: this._states[4],\n denominator: this._states[5],\n width: this._rasterWidth,\n height: this._rasterHeight,\n }\n };\n }\n /**\n * Initialize decoder for next image. Must be called before\n * any calls to `decode` or `decodeString`.\n */\n // FIXME: reorder arguments, better palette handling\n init(fillColor = this._opts.fillColor, palette = this._opts.palette, paletteLimit = this._opts.paletteLimit, truncate = this._opts.truncate) {\n this._wasm.init(this._opts.sixelColor, fillColor, paletteLimit, truncate ? 1 : 0);\n if (palette) {\n this._palette.set(palette.subarray(0, wasm_1.LIMITS.PALETTE_SIZE));\n }\n this._bandWidths.length = 0;\n this._maxWidth = 0;\n this._minWidth = wasm_1.LIMITS.MAX_WIDTH;\n this._lastOffset = 0;\n this._currentHeight = 0;\n }\n /**\n * Decode next chunk of data from start to end index (exclusive).\n * @throws Will throw if the image exceeds the memory limit.\n */\n decode(data, start = 0, end = data.length) {\n let p = start;\n while (p < end) {\n const length = Math.min(end - p, wasm_1.LIMITS.CHUNK_SIZE);\n this._chunk.set(data.subarray(p, p += length));\n this._wasm.decode(0, length);\n }\n }\n /**\n * Decode next chunk of string data from start to end index (exclusive).\n * Note: Decoding from string data is rather slow, use `decode` with byte data instead.\n * @throws Will throw if the image exceeds the memory limit.\n */\n decodeString(data, start = 0, end = data.length) {\n let p = start;\n while (p < end) {\n const length = Math.min(end - p, wasm_1.LIMITS.CHUNK_SIZE);\n for (let i = 0, j = p; i < length; ++i, ++j) {\n this._chunk[i] = data.charCodeAt(j);\n }\n p += length;\n this._wasm.decode(0, length);\n }\n }\n /**\n * Get current pixel data as 32-bit typed array (RGBA8888).\n * Also peeks into pixel data of the current band, that got not pushed yet.\n */\n get data32() {\n if (this._mode === 0 /* M0 */ || !this.width || !this.height) {\n return NULL_CANVAS;\n }\n // get width of pending band to peek into left-over data\n const currentWidth = this._wasm.current_width();\n if (this._mode === 2 /* M2 */) {\n let remaining = this.height - this._currentHeight;\n if (remaining > 0) {\n const adv = this._PIXEL_OFFSET;\n let offset = this._lastOffset;\n let c = 0;\n while (c < 6 && remaining > 0) {\n this._canvas.set(this._pSrc.subarray(adv * c, adv * c + currentWidth), offset + currentWidth * c);\n c++;\n remaining--;\n }\n if (remaining) {\n this._canvas.fill(this._fillColor, offset + currentWidth * c);\n }\n }\n return this._canvas.subarray(0, this.width * this.height);\n }\n if (this._mode === 1 /* M1 */) {\n if (this._minWidth === this._maxWidth) {\n let escape = false;\n if (currentWidth) {\n if (currentWidth !== this._minWidth) {\n escape = true;\n }\n else {\n const adv = this._PIXEL_OFFSET;\n let offset = this._lastOffset;\n this._realloc(offset, currentWidth * 6);\n for (let i = 0; i < 6; ++i) {\n this._canvas.set(this._pSrc.subarray(adv * i, adv * i + currentWidth), offset + currentWidth * i);\n }\n }\n }\n if (!escape) {\n return this._canvas.subarray(0, this.width * this.height);\n }\n }\n // worst case: re-align pixels if we have bands with different width\n // This is somewhat allocation intensive, any way to do that in-place, and just once?\n const final = new Uint32Array(this.width * this.height);\n final.fill(this._fillColor);\n let finalOffset = 0;\n let start = 0;\n for (let i = 0; i < this._bandWidths.length; ++i) {\n const bw = this._bandWidths[i];\n for (let p = 0; p < 6; ++p) {\n final.set(this._canvas.subarray(start, start += bw), finalOffset);\n finalOffset += this.width;\n }\n }\n // also handle left-over pixels of the current band\n if (currentWidth) {\n const adv = this._PIXEL_OFFSET;\n // other than finished bands, this runs only up to currentHeight\n const currentHeight = this._wasm.current_height();\n for (let i = 0; i < currentHeight; ++i) {\n final.set(this._pSrc.subarray(adv * i, adv * i + currentWidth), finalOffset + this.width * i);\n }\n }\n return final;\n }\n // fallthrough for all not handled cases\n return NULL_CANVAS;\n }\n /**\n * Same as `data32`, but returning pixel data as Uint8ClampedArray suitable\n * for direct usage with `ImageData`.\n */\n get data8() {\n return new Uint8ClampedArray(this.data32.buffer, 0, this.width * this.height * 4);\n }\n /**\n * Release image ressources on JS side held by the decoder.\n *\n * The decoder tries to re-use memory ressources of a previous image\n * to lower allocation and GC pressure. Decoding a single big image\n * will grow the memory usage of the decoder permanently.\n * Call `release` to reset the internal buffers and free the memory.\n * Note that this destroys the image data, call it when done processing\n * a rather big image, otherwise it is not needed. Use `memoryUsage`\n * to decide, whether the held memory is still within your limits.\n * This does not affect the wasm module (operates on static memory).\n */\n release() {\n this._canvas = NULL_CANVAS;\n this._bandWidths.length = 0;\n this._maxWidth = 0;\n this._minWidth = wasm_1.LIMITS.MAX_WIDTH;\n // also nullify parser states in wasm to avoid\n // width/height reporting potential out-of-bound values\n this._wasm.init(Colors_1.DEFAULT_FOREGROUND, 0, this._opts.paletteLimit, 0);\n }\n}\nexports.Decoder = Decoder;\n/**\n * Convenient decoding functions for easier usage.\n *\n * These can be used for casual decoding of sixel images,\n * that dont come in as stream chunks.\n * Note that the functions instantiate a stream decoder for every call,\n * which comes with a performance penalty of ~25%.\n */\n/**\n * Decode function with synchronous wasm loading.\n * Can be used in a web worker or in nodejs. Does not work reliable in normal browser context.\n * @throws Will throw if the image exceeds the memory limit.\n */\nfunction decode(data, opts) {\n const dec = new Decoder(opts);\n dec.init();\n typeof data === 'string' ? dec.decodeString(data) : dec.decode(data);\n return {\n width: dec.width,\n height: dec.height,\n data32: dec.data32,\n data8: dec.data8\n };\n}\nexports.decode = decode;\n/**\n * Decode function with asynchronous wasm loading.\n * Use this version in normal browser context.\n * @throws Will throw if the image exceeds the memory limit.\n */\nasync function decodeAsync(data, opts) {\n const dec = await DecoderAsync(opts);\n dec.init();\n typeof data === 'string' ? dec.decodeString(data) : dec.decode(data);\n return {\n width: dec.width,\n height: dec.height,\n data32: dec.data32,\n data8: dec.data8\n };\n}\nexports.decodeAsync = decodeAsync;\n//# sourceMappingURL=Decoder.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LIMITS = void 0;\nexports.LIMITS = {\n CHUNK_SIZE: 16384,\n PALETTE_SIZE: 4096,\n MAX_WIDTH: 16384,\n BYTES: 'AGFzbQEAAAABJAdgAAF/YAJ/fwBgA39/fwF/YAF/AX9g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n8CfSADIAcgA5NDAADAQJQgBJSSIARDq6oqPl0NABogByAEQwAAAD9dDQAaIAMgBEOrqio/XUUNABogAyAHIAOTIARDAADAwJRDAACAQJKUkgtDAAB/Q5RDAAAAP5IiBkMAAIBPXSAGQwAAAABgcQRAIAapDAELQQALIQACQCACBEAgBUMAAIA/kiEFDAELIAVDAACAP15FDQAgBUMAAIC/kiEFCwJAIAVDq6oqPl0EQCADIAcgA5NDAADAQJQgBZSSIQcMAQsgBUMAAAA/XQ0AIAVDq6oqP11FBEAgAyEHDAELIAMgByADkyAFQwAAwMCUQwAAgECSlJIhBwsgAEEIdAJ/IAdDAAB/Q5RDAAAAP5IiBkMAAIBPXSAGQwAAAABgcQRAIAapDAELQQALQRB0ciABcgtBgICAeHILNwAgAEH/AWxBMmpB5ABtIAFB/wFsQTJqQeQAbUEIdHIgAkH/AWxBMmpB5ABtQRB0ckGAgIB4cgsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwsYAQBBgAgLEQEAAAACAAAAAwAAAAQAAAAF'\n};\n//# sourceMappingURL=wasm.js.map","/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal event utilities for xterm.js core.\n * Simplified from VS Code's event.ts - no leak detection/profiling.\n */\n\nimport { IDisposable, DisposableStore, toDisposable } from './Lifecycle';\n\nexport interface IEvent {\n (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\n}\n\nexport class Emitter {\n private _listeners: { fn: (e: T) => any, thisArgs: any }[] = [];\n private _disposed = false;\n private _event: IEvent | undefined;\n\n public get event(): IEvent {\n if (this._event) {\n return this._event;\n }\n this._event = (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n if (this._disposed) {\n return toDisposable(() => {});\n }\n\n const entry = { fn: listener, thisArgs };\n this._listeners = this._listeners.slice();\n this._listeners.push(entry);\n\n const result = toDisposable(() => {\n const idx = this._listeners.indexOf(entry);\n if (idx !== -1) {\n this._listeners = this._listeners.slice();\n this._listeners.splice(idx, 1);\n }\n });\n\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(result);\n } else {\n disposables.add(result);\n }\n }\n\n return result;\n };\n return this._event;\n }\n\n public fire(event: T): void {\n if (this._disposed || !this._listeners.length) {\n return;\n }\n if (this._listeners.length === 1) {\n this._listeners[0].fn.call(this._listeners[0].thisArgs, event);\n return;\n }\n const listeners = this._listeners;\n for (let i = 0, len = listeners.length; i < len; ++i) {\n listeners[i].fn.call(listeners[i].thisArgs, event);\n }\n }\n\n public dispose(): void {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n this._listeners.length = 0;\n }\n}\n\nexport namespace EventUtils {\n export function forward(from: IEvent, to: Emitter): IDisposable {\n return from(e => to.fire(e));\n }\n\n export function map(event: IEvent, map: (i: I) => O): IEvent {\n return (listener: (e: O) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n return event(i => listener.call(thisArgs, map(i)), undefined, disposables);\n };\n }\n\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent {\n return (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n const store = new DisposableStore();\n for (const event of events) {\n store.add(event(e => listener.call(thisArgs, e)));\n }\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(store);\n } else {\n disposables.add(store);\n }\n }\n return store;\n };\n }\n\n export function runAndSubscribe(event: IEvent, handler: (e: T) => void, initial: T): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void, initial?: T): IDisposable {\n handler(initial);\n return event(e => handler(e));\n }\n}\n","/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal lifecycle utilities for xterm.js core.\n * Simplified from VS Code's lifecycle.ts - no tracking/leak detection.\n */\n\nexport interface IDisposable {\n dispose(): void;\n}\n\nexport function toDisposable(fn: () => void): IDisposable {\n return { dispose: fn };\n}\n\nexport function dispose(disposable: T): T;\nexport function dispose(disposable: T | undefined): T | undefined;\nexport function dispose(disposables: T[]): T[];\nexport function dispose(arg: T | T[] | undefined): T | T[] | undefined {\n if (!arg) {\n return arg;\n }\n if (Array.isArray(arg)) {\n for (const d of arg) {\n d.dispose();\n }\n return [];\n }\n arg.dispose();\n return arg;\n}\n\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n return toDisposable(() => dispose(disposables));\n}\n\nexport class DisposableStore implements IDisposable {\n private readonly _disposables = new Set();\n private _isDisposed = false;\n\n public get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n public add(o: T): T {\n if (this._isDisposed) {\n o.dispose();\n } else {\n this._disposables.add(o);\n }\n return o;\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n\n public clear(): void {\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n}\n\nexport abstract class Disposable implements IDisposable {\n public static readonly None: IDisposable = Object.freeze({ dispose() { } });\n\n protected readonly _store = new DisposableStore();\n\n public dispose(): void {\n this._store.dispose();\n }\n\n protected _register(o: T): T {\n return this._store.add(o);\n }\n}\n\nexport class MutableDisposable implements IDisposable {\n private _value: T | undefined;\n private _isDisposed = false;\n\n public get value(): T | undefined {\n return this._isDisposed ? undefined : this._value;\n }\n\n public set value(value: T | undefined) {\n if (this._isDisposed || value === this._value) {\n return;\n }\n this._value?.dispose();\n this._value = value;\n }\n\n public clear(): void {\n this.value = undefined;\n }\n\n public dispose(): void {\n this._isDisposed = true;\n this._value?.dispose();\n this._value = undefined;\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IImageAddonOptions, IOscHandler, IResetHandler, ITerminalExt } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { CELL_SIZE_DEFAULT } from './ImageStorage';\nimport Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport QoiDecoder from 'xterm-wasm-parts/lib/qoi/QoiDecoder.wasm';\nimport { HeaderParser, IHeaderFields, HeaderState, SequenceType } from './IIPHeaderParser';\nimport { imageType, UNSUPPORTED_TYPE } from './IIPMetrics';\n\n// Local const enum mirror - esbuild can't inline const enums from external packages\nconst enum DecoderConst {\n // Limit held memory in base64 decoder (encoded bytes).\n KEEP_DATA = 4194304,\n // Initial buffer allocation for the decoder.\n INITIAL_DATA = 1048576,\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n OK = 0\n}\n\n// default IIP header values\nconst DEFAULT_HEADER: IHeaderFields = {\n type: SequenceType.INVALID,\n name: 'Unnamed file',\n size: 0,\n width: 'auto',\n height: 'auto',\n preserveAspectRatio: 1,\n inline: 0\n};\n\n\nexport class IIPHandler implements IOscHandler, IResetHandler {\n private _generation = 0;\n private _aborted = false;\n private _hp = new HeaderParser();\n private _header: IHeaderFields = DEFAULT_HEADER;\n private _dec: Base64Decoder;\n private _qoiDec: QoiDecoder;\n private _isMultipart = false;\n private _abortMulti = false;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _storage: IIPImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n const maxEncodedBytes = Math.ceil(this._opts.iipSizeLimit * 4 / 3);\n const initialBytes = Math.min(DecoderConst.INITIAL_DATA, maxEncodedBytes);\n this._dec = new Base64Decoder(DecoderConst.KEEP_DATA, maxEncodedBytes, initialBytes);\n this._qoiDec = new QoiDecoder(DecoderConst.KEEP_DATA);\n }\n\n public reset(): void {\n this._generation++;\n this._hp.reset();\n this._dec.release();\n this._qoiDec.release();\n }\n\n public start(): void {\n this._aborted = false;\n this._hp.reset();\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (this._hp.state === HeaderState.END) {\n if ((this._dec.put(data.subarray(start, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n }\n } else {\n const dataPos = this._hp.parse(data, start, end);\n if (dataPos === -1) {\n this._aborted = true;\n return;\n }\n if (dataPos > 0) {\n const seqType = this._hp.fields.type;\n if (seqType === SequenceType.FILE) {\n if (this._isMultipart) {\n this._isMultipart = false;\n this._abortMulti = false;\n this._dec.release();\n }\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n if (!this._header.inline) {\n this._aborted = true;\n return;\n }\n this._dec.init();\n } else if (this._abortMulti) {\n this._aborted = true;\n return;\n }\n if ((this._dec.put(data.subarray(dataPos, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n if (this._isMultipart) this._abortMulti = true;\n }\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted) return true;\n\n if (this._hp.state !== HeaderState.END) {\n if (this._hp.end()) return true;\n }\n const seqType = this._hp.fields.type;\n\n if (seqType === SequenceType.FILEPART) return true;\n\n if (seqType === SequenceType.REPORTCELLSIZE) {\n // OSC 1337 ; ReportCellSize=[height];[width];[scale] ST\n let w = CELL_SIZE_DEFAULT.width;\n let h = CELL_SIZE_DEFAULT.height;\n if (this._renderer.dimensions) {\n w = this._renderer.dimensions.css.canvas.width / this._coreTerminal.cols;\n h = this._renderer.dimensions.css.canvas.height / this._coreTerminal.rows;\n }\n const scale = this._coreTerminal._core._coreBrowserService?.dpr ?? 1;\n const report = `\\x1b]1337;ReportCellSize=${h.toFixed(3)};${w.toFixed(3)};${scale.toFixed(3)}\\x1b\\\\`;\n this._coreTerminal.input(report, false);\n return true;\n }\n\n if (seqType === SequenceType.MULTIPARTFILE) {\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n this._isMultipart = true;\n this._abortMulti = false;\n this._dec.release();\n this._dec.init();\n return true;\n }\n\n if (seqType === SequenceType.FILEEND) {\n if (!this._isMultipart) return true;\n this._isMultipart = false;\n if (this._abortMulti || this._header.type !== SequenceType.MULTIPARTFILE) return true;\n }\n\n // fallthrough for SequenceType.FILE & SequenceType.FILEEND\n\n let w = 0;\n let h = 0;\n\n // early exit condition chain\n let cond: number | boolean;\n let metrics = UNSUPPORTED_TYPE;\n if (cond = success) {\n if (cond = !this._dec.end()) {\n metrics = imageType(this._dec.data8);\n if (cond = metrics.mime !== 'unsupported') {\n w = metrics.width;\n h = metrics.height;\n if (cond = w && h && w * h < this._opts.pixelLimit) {\n [w, h] = this._resize(w, h).map(Math.floor);\n cond = w && h && w * h < this._opts.pixelLimit;\n } else {\n console.warn(`IIP: image dimension issue ${metrics.width}x${metrics.height}`);\n }\n } else {\n console.warn('IIP: unsupported image type');\n }\n } else {\n console.warn('IIP: error during BASE64 decoding');\n }\n }\n if (!cond) {\n this._dec.release();\n return true;\n }\n\n let blob: Blob | ImageData;\n if (metrics.mime === 'image/qoi') {\n const data = this._qoiDec.decode(this._dec.data8);\n blob = new ImageData(\n new Uint8ClampedArray(data.buffer, data.byteOffset, data.byteLength),\n this._qoiDec.width,\n this._qoiDec.height\n );\n this._qoiDec.release();\n if (w === this._qoiDec.width && h === this._qoiDec.height) {\n // use fast-path if we don't need to rescale\n this._dec.release();\n const canvas = ImageRenderer.createCanvas(undefined, this._qoiDec.width, this._qoiDec.height);\n canvas.getContext('2d')?.putImageData(blob, 0, 0);\n this._storage.addImage(canvas);\n return true;\n }\n } else {\n blob = new Blob([this._dec.data8], { type: metrics.mime });\n }\n this._dec.release();\n const generation = this._generation;\n return createImageBitmap(blob, { resizeWidth: w, resizeHeight: h })\n .then(bm => {\n if (generation !== this._generation) {\n bm.close();\n return true;\n }\n this._storage.addImage(bm);\n return true;\n })\n .catch(e => {\n console.warn(`IIP: decoding error ${metrics.mime} ${metrics.width}x${metrics.height}`, e);\n return true;\n });\n }\n\n private _resize(w: number, h: number): [number, number] {\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n const width = this._renderer.dimensions?.css.canvas.width || cw * this._coreTerminal.cols;\n const height = this._renderer.dimensions?.css.canvas.height || ch * this._coreTerminal.rows;\n\n const rw = this._dim(this._header.width!, width, cw);\n const rh = this._dim(this._header.height!, height, ch);\n if (!rw && !rh) {\n const wf = width / w; // TODO: should this respect initial cursor offset?\n const hf = (height - ch) / h; // TODO: fix offset issues from float cell height\n const f = Math.min(wf, hf);\n return f < 1 ? [w * f, h * f] : [w, h];\n }\n return !rw\n ? [w * rh / h, rh]\n : this._header.preserveAspectRatio || !rw || !rh\n ? [rw, h * rw / w] : [rw, rh];\n }\n\n private _dim(s: string, total: number, cdim: number): number {\n if (s === 'auto') return 0;\n if (s.endsWith('%')) return parseInt(s.slice(0, -1), 10) * total / 100;\n if (s.endsWith('px')) return parseInt(s.slice(0, -2), 10);\n return parseInt(s, 10) * cdim;\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// eslint-disable-next-line\ndeclare const Buffer: any;\n\nexport const enum HeaderState {\n START = 0,\n ABORT = 1,\n KEY = 2,\n VALUE = 3,\n END = 4\n}\n\nexport const enum SequenceType {\n INVALID = 0,\n FILE = 1,\n MULTIPARTFILE = 2,\n FILEPART = 3,\n FILEEND = 4,\n REPORTCELLSIZE = 5\n}\n\nexport interface IHeaderFields {\n [key: string]: number | string | Uint32Array | null | undefined;\n // sequence type\n type: SequenceType;\n // base-64 encoded filename. Defaults to \"Unnamed file\".\n name: string;\n // File size in bytes. The file transfer will be canceled if this size is exceeded.\n size: number;\n /**\n * Optional width and height to render:\n * - N: N character cells.\n * - Npx: N pixels.\n * - N%: N percent of the session's width or height.\n * - auto: The image's inherent size will be used to determine an appropriate dimension.\n */\n width?: string;\n height?: string;\n // Optional, defaults to 1 respecting aspect ratio (width takes precedence).\n preserveAspectRatio?: number;\n // Optional, defaults to 0. If set to 1, the file will be displayed inline, else downloaded\n // (download not supported).\n inline?: number;\n}\n\n// field value decoders\n\n// ASCII bytes to string\nfunction toStr(data: Uint32Array): string {\n let s = '';\n for (let i = 0; i < data.length; ++i) {\n s += String.fromCharCode(data[i]);\n }\n return s;\n}\n\n// digits to integer\nfunction toInt(data: Uint32Array): number {\n let v = 0;\n for (let i = 0; i < data.length; ++i) {\n if (data[i] < 48 || data[i] > 57) {\n throw new Error('illegal char');\n }\n v = v * 10 + data[i] - 48;\n }\n return v;\n}\n\n// check for correct size entry\nfunction toSize(data: Uint32Array): string {\n const v = toStr(data);\n if (!v.match(/^((auto)|(\\d+?((px)|(%)){0,1}))$/)) {\n throw new Error('illegal size');\n }\n return v;\n}\n\n// name is base64 encoded utf-8\nfunction toName(data: Uint32Array): string {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(toStr(data), 'base64').toString();\n }\n const bs = atob(toStr(data));\n const b = new Uint8Array(bs.length);\n for (let i = 0; i < b.length; ++i) {\n b[i] = bs.charCodeAt(i);\n }\n return new TextDecoder().decode(b);\n}\n\nconst DECODERS: {[key: string]: (v: Uint32Array) => number | string} = {\n inline: toInt,\n size: toInt,\n name: toName,\n width: toSize,\n height: toSize,\n preserveAspectRatio: toInt\n};\n\n\n// sequence type markers\n// File\nconst FILE_MARKER = [70, 105, 108, 101];\n// MultipartFile\nconst MULTIPARTFILE_MARKER = [77, 117, 108, 116, 105, 112, 97, 114, 116, 70, 105, 108, 101];\n// FilePart\nconst FILEPART_MARKER = [70, 105, 108, 101, 80, 97, 114, 116];\n// FileEnd\nconst FILEEND_MARKER = [70, 105, 108, 101, 69, 110, 100];\n// ReportCellSize\nconst REPORTCELLSIZE_MARKER = [82, 101, 112, 111, 114, 116, 67, 101, 108, 108, 83, 105, 122, 101];\n\n// max allowed chars for sequence header\nconst MAX_FIELDCHARS = 1024;\n\n\nexport class HeaderParser {\n public state: HeaderState = HeaderState.START;\n private _buffer = new Uint32Array(MAX_FIELDCHARS);\n private _position = 0;\n private _key = '';\n public fields: {[key: string]: number | string | Uint32Array | null | undefined} = {};\n\n public reset(): void {\n this._buffer.fill(0);\n this.state = HeaderState.START;\n this._position = 0;\n this.fields = {};\n this._key = '';\n }\n\n public end(): number {\n if (this.state === HeaderState.START) {\n if (this._position === FILEEND_MARKER.length) {\n for (let k = 0; k < FILEEND_MARKER.length; ++k) {\n if (this._buffer[k] !== FILEEND_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEEND;\n this.state = HeaderState.END;\n return 0;\n }\n if (this._position === REPORTCELLSIZE_MARKER.length) {\n for (let k = 0; k < REPORTCELLSIZE_MARKER.length; ++k) {\n if (this._buffer[k] !== REPORTCELLSIZE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.REPORTCELLSIZE;\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n if (this.state === HeaderState.END) return 0;\n if (this.state === HeaderState.VALUE\n && this.fields.type === SequenceType.MULTIPARTFILE\n ) {\n if (!this._storeValue(this._position)) return this._a();\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n\n public parse(data: Uint32Array, start: number, end: number): number {\n let state = this.state;\n let pos = this._position;\n const buffer = this._buffer;\n if (state === HeaderState.ABORT || state === HeaderState.END) return -1;\n if (state === HeaderState.START && pos > 14) return -1;\n for (let i = start; i < end; ++i) {\n const c = data[i];\n switch (c) {\n case 59: // ;\n if (!this._storeValue(pos)) return this._a();\n state = HeaderState.KEY;\n pos = 0;\n break;\n case 61: // =\n if (state === HeaderState.START) {\n if (buffer[0] === 70) {\n // 'File' or 'FilePart'\n let k = 0;\n for (; k < FILE_MARKER.length; ++k) {\n if (buffer[k] !== FILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILE;\n if (pos === FILEPART_MARKER.length) {\n for (; k < FILEPART_MARKER.length; ++k) {\n if (buffer[k] !== FILEPART_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEPART;\n this.state = HeaderState.END;\n return i + 1;\n }\n } else if (buffer[0] === 77) {\n // 'MultipartFile'\n for (let k = 0; k < MULTIPARTFILE_MARKER.length; ++k) {\n if (buffer[k] !== MULTIPARTFILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.MULTIPARTFILE;\n } else {\n return this._a();\n }\n state = HeaderState.KEY;\n pos = 0;\n } else if (state === HeaderState.KEY) {\n if (!this._storeKey(pos)) return this._a();\n state = HeaderState.VALUE;\n pos = 0;\n } else if (state === HeaderState.VALUE) {\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n break;\n case 58: // :\n if (state === HeaderState.VALUE) {\n if (!this._storeValue(pos)) return this._a();\n }\n this.state = HeaderState.END;\n return i + 1;\n default:\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n }\n this.state = state;\n this._position = pos;\n return -2;\n }\n\n private _a(): number {\n this.fields.type = SequenceType.INVALID;\n this.state = HeaderState.ABORT;\n return -1;\n }\n\n private _storeKey(pos: number): boolean {\n const k = toStr(this._buffer.subarray(0, pos));\n if (k) {\n this._key = k;\n this.fields[k] = null;\n return true;\n }\n return false;\n }\n\n private _storeValue(pos: number): boolean {\n if (this._key) {\n try {\n const v = this._buffer.slice(0, pos);\n this.fields[this._key] = DECODERS[this._key] ? DECODERS[this._key](v) : v;\n } catch {\n return false;\n }\n return true;\n }\n return false;\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAddImageOpts } from './Types';\nimport { ImageStorage } from './ImageStorage';\n\n/**\n * IIP (iTerm Image Protocol) specific image storage controller.\n *\n * Wraps the shared ImageStorage with IIP protocol semantics:\n * - Always uses scrolling mode (cursor advances with image)\n */\nexport class IIPImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n constructor(\n private readonly _storage: ImageStorage\n ) {}\n\n /**\n * Add an IIP image to storage.\n * Always uses scrolling mode — cursor advances past the image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._storage.addImage(img, this._addImageOpts);\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n\nexport type ImageType = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/qoi' | 'image/webp' | 'image/avif' | 'unsupported' | '';\n\nexport interface IMetrics {\n mime: ImageType;\n width: number;\n height: number;\n}\n\nexport const UNSUPPORTED_TYPE: IMetrics = {\n mime: 'unsupported',\n width: 0,\n height: 0\n};\n\nexport function imageType(d: Uint8Array): IMetrics {\n if (d.length < 32) {\n return UNSUPPORTED_TYPE;\n }\n const d32 = new Uint32Array(d.buffer, d.byteOffset, 8);\n // PNG: 89 50 4E 47 0D 0A 1A 0A (8 first bytes == magic number for PNG)\n // + first chunk must be IHDR\n if (d32[0] === 0x474E5089 && d32[1] === 0x0A1A0A0D && d32[3] === 0x52444849) {\n return {\n mime: 'image/png',\n width: d[16] << 24 | d[17] << 16 | d[18] << 8 | d[19],\n height: d[20] << 24 | d[21] << 16 | d[22] << 8 | d[23]\n };\n }\n // JPEG: FF D8 FF\n if (d[0] === 0xFF && d[1] === 0xD8 && d[2] === 0xFF) {\n const [width, height] = jpgSize(d);\n return { mime: 'image/jpeg', width, height };\n }\n // GIF: GIF87a or GIF89a\n if (d32[0] === 0x38464947 && (d[4] === 0x37 || d[4] === 0x39) && d[5] === 0x61) {\n return {\n mime: 'image/gif',\n width: d[7] << 8 | d[6],\n height: d[9] << 8 | d[8]\n };\n }\n // QOI: qoif\n if (d32[0] === 0x66696F71) {\n return {\n mime: 'image/qoi',\n width: d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7],\n height: d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11]\n };\n }\n // WEBP: RIFF | xxxx | WEBP | VP8x\n if (d32[0] === 0x46464952 && d32[2] === 0x50424557 && (d32[3] & 0xFFFFFF) === 0x385056) {\n switch (d[15]) {\n case 0x58: // Extended WebP VP8X --> \"X\"\n return {\n mime: 'image/webp',\n width: (d[24] | d[25] << 8 | d[26] << 16) + 1,\n height: (d[27] | d[28] << 8 | d[29] << 16) + 1\n };\n case 0x4C: // Lossless WebP VP8L --> \"L\"\n if (d[20] !== 0x2f) return UNSUPPORTED_TYPE;\n const dim = d[21] | d[22] << 8 | d[23] << 16 | d[24] << 24;\n return {\n mime: 'image/webp',\n width: (dim & 0x3FFF) + 1,\n height: (dim >>> 14 & 0x3FFF) + 1\n };\n case 0x20: // Lossy WebP VP8 --> \" \"\n if (d[23] !== 0x9d || d[24] !== 0x01 || d[25] !== 0x2a) return UNSUPPORTED_TYPE;\n return {\n mime: 'image/webp',\n width: (d[26] | d[27] << 8) & 0x3FFF,\n height: (d[28] | d[29] << 8) & 0x3FFF\n };\n }\n return UNSUPPORTED_TYPE;\n }\n // AVIF: Box size | ftyp | avif/avis\n if (d32[1] === 0x70797466 && (d32[2] === 0x66697661 || d32[2] === 0x73697661)) {\n let pos = -1;\n // search for ispe box within first 1024 bytes\n const limit = Math.min(d.length - 16, 1024);\n for (let i = 8; i < limit; i++) {\n // scan for ispe\n if (d[i] === 0x69 && d[i + 1] === 0x73 && d[i + 2] === 0x70 && d[i + 3] === 0x65) {\n pos = i;\n break;\n }\n }\n if (pos !== -1) {\n // dimensions are in BE at +8 (width) at +12 (height)\n const width =\n d[pos + 8] << 24 |\n d[pos + 9] << 16 |\n d[pos + 10] << 8 |\n d[pos + 11];\n const height =\n d[pos + 12] << 24 |\n d[pos + 13] << 16 |\n d[pos + 14] << 8 |\n d[pos + 15];\n if (width > 0 && height > 0) {\n return { mime: 'image/avif', width, height };\n }\n }\n return UNSUPPORTED_TYPE;\n }\n return UNSUPPORTED_TYPE;\n}\n\n\nfunction jpgSize(d: Uint8Array): [number, number] {\n const len = d.length;\n let i = 4;\n let blockLength = d[i] << 8 | d[i + 1];\n while (true) {\n i += blockLength;\n if (i >= len) {\n // exhausted without size info\n return [0, 0];\n }\n if (d[i] !== 0xFF) {\n return [0, 0];\n }\n if (d[i + 1] === 0xC0 || d[i + 1] === 0xC2) {\n if (i + 8 < len) {\n return [\n d[i + 7] << 8 | d[i + 8],\n d[i + 5] << 8 | d[i + 6]\n ];\n }\n return [0, 0];\n }\n i += 2;\n blockLength = d[i] << 8 | d[i + 1];\n }\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { toRGBA8888 } from 'sixel/lib/Colors';\nimport { IDisposable } from '@xterm/xterm';\nimport { ICellSize, ImageLayer, ITerminalExt, IImageSpec, IRenderDimensions, IRenderService } from './Types';\nimport { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';\n\nconst enum Constants {\n PLACEHOLDER_LENGTH = 4096,\n PLACEHOLDER_HEIGHT = 24\n}\n\n/**\n * ImageRenderer - terminal frontend extension:\n * - provide primitives for canvas, ImageData, Bitmap (static)\n * - add canvas layer to DOM (browser only for now)\n * - draw image tiles onRender\n */\nexport class ImageRenderer extends Disposable implements IDisposable {\n /** @deprecated Kept for backward compat — points to top layer canvas. */\n public get canvas(): HTMLCanvasElement | undefined { return this._layers.get('top')?.canvas; }\n private _layers = new Map();\n private _placeholder: HTMLCanvasElement | undefined;\n private _placeholderBitmap: ImageBitmap | undefined;\n private _optionsRefresh = this._register(new MutableDisposable());\n private _oldOpen: ((parent: HTMLElement) => void) | undefined;\n private _renderService: IRenderService | undefined;\n private _oldSetRenderer: ((renderer: any) => void) | undefined;\n\n // drawing primitive - canvas\n public static createCanvas(localDocument: Document | undefined, width: number, height: number): HTMLCanvasElement {\n /**\n * NOTE: We normally dont care, from which document the canvas\n * gets created, so we can fall back to global document,\n * if the terminal has no document associated yet.\n * This way early image loads before calling .open keep working\n * (still discouraged though, as the metrics will be screwed up).\n * Only the DOM output canvas should be on the terminal's document,\n * which gets explicitly checked in `insertLayerToDom`.\n */\n const canvas = (localDocument ?? document).createElement('canvas');\n canvas.width = width | 0;\n canvas.height = height | 0;\n return canvas;\n }\n\n // drawing primitive - ImageData with optional buffer\n public static createImageData(ctx: CanvasRenderingContext2D, width: number, height: number, buffer?: ArrayBuffer): ImageData {\n if (typeof ImageData !== 'function') {\n const imgData = ctx.createImageData(width, height);\n if (buffer) {\n imgData.data.set(new Uint8ClampedArray(buffer, 0, width * height * 4));\n }\n return imgData;\n }\n return buffer\n ? new ImageData(new Uint8ClampedArray(buffer, 0, width * height * 4), width, height)\n : new ImageData(width, height);\n }\n\n // drawing primitive - ImageBitmap\n public static createImageBitmap(img: ImageBitmapSource): Promise {\n if (typeof createImageBitmap !== 'function') {\n return Promise.resolve(undefined);\n }\n return createImageBitmap(img);\n }\n\n\n constructor(private _terminal: ITerminalExt) {\n super();\n this._oldOpen = this._terminal._core.open;\n this._terminal._core.open = (parent: HTMLElement): void => {\n this._oldOpen?.call(this._terminal._core, parent);\n this._open();\n };\n if (this._terminal._core.screenElement) {\n this._open();\n }\n // hack to spot fontSize changes\n this._optionsRefresh.value = this._terminal._core.optionsService.onOptionChange(option => {\n if (option === 'fontSize') {\n this.rescaleCanvas();\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n });\n this._register(toDisposable(() => {\n this.removeLayerFromDom();\n this.removeLayerFromDom('bottom');\n if (this._terminal._core && this._oldOpen) {\n this._terminal._core.open = this._oldOpen;\n this._oldOpen = undefined;\n }\n if (this._renderService && this._oldSetRenderer) {\n this._renderService.setRenderer = this._oldSetRenderer;\n this._oldSetRenderer = undefined;\n }\n this._renderService = undefined;\n this._layers.clear();\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }));\n }\n\n /**\n * Enable the placeholder.\n */\n public showPlaceholder(value: boolean): void {\n if (value) {\n if (!this._placeholder && this.cellSize.height !== -1) {\n this._createPlaceHolder(Math.max(this.cellSize.height + 1, Constants.PLACEHOLDER_HEIGHT));\n }\n } else {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n\n /**\n * Dimensions of the terminal.\n * Forwarded from internal render service.\n */\n public get dimensions(): IRenderDimensions | undefined {\n return this._terminal.dimensions;\n }\n\n /**\n * Current cell size (float).\n */\n public get cellSize(): ICellSize {\n return {\n width: this.dimensions?.css.cell.width || -1,\n height: this.dimensions?.css.cell.height || -1\n };\n }\n\n /**\n * Clear a region of the image layer canvas.\n */\n public clearLines(start: number, end: number, layer?: ImageLayer): void {\n const y = start * (this.dimensions?.css.cell.height || 0);\n const w = this.dimensions?.css.canvas.width || 0;\n const h = (end + 1 - start) * (this.dimensions?.css.cell.height || 0);\n if (!layer || layer === 'top') {\n this._layers.get('top')?.clearRect(0, y, w, h);\n }\n if (!layer || layer === 'bottom') {\n this._layers.get('bottom')?.clearRect(0, y, w, h);\n }\n }\n\n /**\n * Clear whole image canvas.\n */\n public clearAll(layer?: ImageLayer): void {\n if (!layer || layer === 'top') {\n const ctx = this._layers.get('top');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n if (!layer || layer === 'bottom') {\n const ctx = this._layers.get('bottom');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n }\n\n /**\n * Draw neighboring tiles on the image layer canvas.\n */\n public draw(imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get(imgSpec.layer);\n if (!ctx) {\n return;\n }\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const { width: sourceWidth, height: sourceHeight } = imgSpec.actualCellSize;\n const cols = Math.ceil(img.width / sourceWidth);\n\n const sx = (tileId % cols) * sourceWidth;\n const sy = Math.floor(tileId / cols) * sourceHeight;\n const dx = col * width;\n const dy = row * height;\n\n // safari bug: never access image source out of bounds\n const finalWidth = count * sourceWidth + sx > img.width ? img.width - sx : count * sourceWidth;\n const finalHeight = sy + sourceHeight > img.height ? img.height - sy : sourceHeight;\n\n // Floor all pixel offsets to get stable tile mapping without any overflows.\n // Note: For not pixel perfect aligned cells like in the DOM renderer\n // this will move a tile slightly to the top/left (subpixel range, thus ignore it).\n // FIX #34: avoid striping on displays with pixelDeviceRatio != 1 by ceiling height and width\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.ceil(finalWidth), Math.ceil(finalHeight),\n Math.floor(dx), Math.floor(dy), Math.ceil(finalWidth * width / sourceWidth), Math.ceil(finalHeight * height / sourceHeight)\n );\n }\n\n /**\n * Extract a single tile from an image.\n */\n public extractTile(imgSpec: IImageSpec, tileId: number): HTMLCanvasElement | undefined {\n const { width, height } = this.cellSize;\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const { width: sourceWidth, height: sourceHeight } = imgSpec.actualCellSize;\n const cols = Math.ceil(img.width / sourceWidth);\n const sx = (tileId % cols) * sourceWidth;\n const sy = Math.floor(tileId / cols) * sourceHeight;\n const finalWidth = sourceWidth + sx > img.width ? img.width - sx : sourceWidth;\n const finalHeight = sy + sourceHeight > img.height ? img.height - sy : sourceHeight;\n\n const canvas = ImageRenderer.createCanvas(this.document, Math.ceil(finalWidth * width / sourceWidth), Math.ceil(finalHeight * height / sourceHeight));\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.floor(finalWidth), Math.floor(finalHeight),\n 0, 0, canvas.width, canvas.height\n );\n return canvas;\n }\n }\n\n /**\n * Draw a line with placeholder on the image layer canvas.\n */\n public drawPlaceholder(col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get('top');\n if (ctx) {\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n if (!this._placeholder) {\n this._createPlaceHolder(Math.max(height + 1, Constants.PLACEHOLDER_HEIGHT));\n } else if (height >= this._placeholder!.height) {\n this._createPlaceHolder(height + 1);\n }\n if (!this._placeholder) return;\n ctx.drawImage(\n this._placeholderBitmap ?? this._placeholder!,\n col * width,\n (row * height) % 2 ? 0 : 1, // needs %2 offset correction\n width * count,\n height,\n col * width,\n row * height,\n width * count,\n height\n );\n }\n }\n\n /**\n * Rescale image layer canvas if needed.\n * Checked once from `ImageStorage.render`.\n */\n public rescaleCanvas(): void {\n const w = this.dimensions?.css.canvas.width || 0;\n const h = this.dimensions?.css.canvas.height || 0;\n for (const ctx of this._layers.values()) {\n if (ctx.canvas.width !== w || ctx.canvas.height !== h) {\n ctx.canvas.width = w;\n ctx.canvas.height = h;\n }\n }\n }\n\n /**\n * Rescale image in storage if needed.\n */\n private _rescaleImage(spec: IImageSpec, currentWidth: number, currentHeight: number): void {\n if (currentWidth === spec.actualCellSize.width && currentHeight === spec.actualCellSize.height) {\n return;\n }\n const { width: originalWidth, height: originalHeight } = spec.origCellSize;\n if (currentWidth === originalWidth && currentHeight === originalHeight) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const scaledWidth = Math.ceil(spec.orig!.width * currentWidth / originalWidth);\n const scaledHeight = Math.ceil(spec.orig!.height * currentHeight / originalHeight);\n // Upscale visible tiles directly; a full zoomed copy can dwarf the image budget.\n if (scaledWidth * scaledHeight > spec.orig!.width * spec.orig!.height) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const canvas = ImageRenderer.createCanvas(this.document, scaledWidth, scaledHeight);\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(spec.orig!, 0, 0, canvas.width, canvas.height);\n spec.actual = canvas;\n spec.actualCellSize.width = currentWidth;\n spec.actualCellSize.height = currentHeight;\n }\n }\n\n /**\n * Lazy init for the renderer.\n */\n private _open(): void {\n this._renderService = this._terminal._core._renderService;\n this._oldSetRenderer = this._renderService.setRenderer.bind(this._renderService);\n this._renderService.setRenderer = (renderer: any) => {\n for (const key of [...this._layers.keys()]) {\n this.removeLayerFromDom(key);\n }\n this._oldSetRenderer?.call(this._renderService, renderer);\n };\n }\n\n public insertLayerToDom(layer: ImageLayer = 'top'): void {\n // make sure that the terminal is attached to a document and to DOM\n if (!this.document || !this._terminal._core.screenElement) {\n console.warn('image addon: cannot insert output canvas to DOM, missing document or screenElement');\n return;\n }\n if (this._layers.has(layer)) {\n return;\n }\n const canvas = ImageRenderer.createCanvas(\n this.document, this.dimensions?.css.canvas.width || 0,\n this.dimensions?.css.canvas.height || 0\n );\n canvas.classList.add(`xterm-image-layer-${layer}`);\n const screenElement = this._terminal._core.screenElement;\n // Use isolation to create a stacking context without overriding z-index,\n // which would conflict with integrators (e.g. VS Code) that set their\n // own z-index on the screen element.\n screenElement.style.isolation = 'isolate';\n if (layer === 'bottom') {\n // Use z-index:-1 so it paints behind non-positioned text elements.\n // The screen element needs to be a stacking context (via isolation)\n // to contain the negative z-index, otherwise it would go behind the\n // entire terminal.\n canvas.style.zIndex = '-1';\n screenElement.insertBefore(canvas, screenElement.firstChild);\n } else {\n // Explicit z-index ensures the image canvas reliably stacks above\n // the text layer (DOM renderer rows). z-index: 0 is below the\n // selection overlay (z-index: 1).\n canvas.style.zIndex = '0';\n screenElement.appendChild(canvas);\n }\n const ctx = canvas.getContext('2d', { alpha: true });\n if (!ctx) {\n canvas.remove();\n return;\n }\n this._layers.set(layer, ctx);\n this.clearAll(layer);\n }\n\n public removeLayerFromDom(layer: ImageLayer = 'top'): void {\n const ctx = this._layers.get(layer);\n if (ctx) {\n ctx.canvas.remove();\n this._layers.delete(layer);\n }\n }\n\n public hasLayer(layer: ImageLayer): boolean {\n return this._layers.has(layer);\n }\n\n private _createPlaceHolder(height: number = Constants.PLACEHOLDER_HEIGHT): void {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n\n // create blueprint to fill placeholder with\n const bWidth = 32; // must be 2^n\n const blueprint = ImageRenderer.createCanvas(this.document, bWidth, height);\n const ctx = blueprint.getContext('2d', { alpha: false });\n if (!ctx) return;\n const imgData = ImageRenderer.createImageData(ctx, bWidth, height);\n const d32 = new Uint32Array(imgData.data.buffer);\n const black = toRGBA8888(0, 0, 0);\n const white = toRGBA8888(255, 255, 255);\n d32.fill(black);\n for (let y = 0; y < height; ++y) {\n const shift = y % 2;\n const offset = y * bWidth;\n for (let x = 0; x < bWidth; x += 2) {\n d32[offset + x + shift] = white;\n }\n }\n ctx.putImageData(imgData, 0, 0);\n\n // create placeholder line, width aligned to blueprint width\n const width = (screen.width + bWidth - 1) & ~(bWidth - 1) || Constants.PLACEHOLDER_LENGTH;\n this._placeholder = ImageRenderer.createCanvas(this.document, width, height);\n const ctx2 = this._placeholder.getContext('2d', { alpha: false });\n if (!ctx2) {\n this._placeholder = undefined;\n return;\n }\n for (let i = 0; i < width; i += bWidth) {\n ctx2.drawImage(blueprint, i, 0);\n }\n const placeholder = this._placeholder;\n ImageRenderer.createImageBitmap(placeholder).then(bitmap => {\n if (this._placeholder !== placeholder) bitmap?.close();\n else this._placeholderBitmap = bitmap;\n }).catch(() => {});\n }\n\n public get document(): Document | undefined {\n return this._terminal._core._coreBrowserService?.window.document;\n }\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageRenderer } from './ImageRenderer';\nimport {\n ITerminalExt, IExtendedAttrsImage, IImageAddonOptions, IImageSpec,\n IBufferLineExt, BgFlags, Cell, Content, ICellSize, ExtFlags, Attributes,\n UnderlineStyle, IAddImageOpts\n} from './Types';\n\n\n// fallback default cell size\nexport const CELL_SIZE_DEFAULT: ICellSize = {\n width: 7,\n height: 14\n};\n\n/**\n * Extend extended attribute to also hold image tile information.\n *\n * Object definition is copied from base repo to fully mimick its behavior.\n * Image data is added as additional public properties `imageId` and `tileId`.\n */\nclass ExtendedAttrsImage implements IExtendedAttrsImage {\n private _ext: number = 0;\n public get ext(): number {\n if (this._urlId) {\n return (\n (this._ext & ~ExtFlags.UNDERLINE_STYLE) |\n (this.underlineStyle << 26)\n );\n }\n return this._ext;\n }\n public set ext(value: number) { this._ext = value; }\n\n public get underlineStyle(): UnderlineStyle {\n // Always return the URL style if it has one\n if (this._urlId) {\n return UnderlineStyle.DASHED;\n }\n return (this._ext & ExtFlags.UNDERLINE_STYLE) >> 26;\n }\n public set underlineStyle(value: UnderlineStyle) {\n this._ext &= ~ExtFlags.UNDERLINE_STYLE;\n this._ext |= (value << 26) & ExtFlags.UNDERLINE_STYLE;\n }\n\n public get underlineColor(): number {\n return this._ext & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n public set underlineColor(value: number) {\n this._ext &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n this._ext |= value & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n\n public get underlineVariantOffset(): number {\n const val = (this._ext & ExtFlags.VARIANT_OFFSET) >> 29;\n if (val < 0) {\n return val ^ 0xFFFFFFF8;\n }\n return val;\n }\n public set underlineVariantOffset(value: number) {\n this._ext &= ~ExtFlags.VARIANT_OFFSET;\n this._ext |= (value << 29) & ExtFlags.VARIANT_OFFSET;\n }\n\n private _urlId: number = 0;\n public get urlId(): number {\n return this._urlId;\n }\n public set urlId(value: number) {\n this._urlId = value;\n }\n\n constructor(\n ext: number = 0,\n urlId: number = 0,\n public imageId = -1,\n public tileId = -1\n ) {\n this._ext = ext;\n this._urlId = urlId;\n }\n\n public clone(): IExtendedAttrsImage {\n /**\n * Technically we dont need a clone variant of ExtendedAttrsImage,\n * as we never clone a cell holding image data.\n * Note: Clone is only meant to be used by the InputHandler for\n * sticky attributes, which is never the case for image data.\n * We still provide a proper clone method to reflect the full ext attr\n * state in case there are future use cases for clone.\n */\n return new ExtendedAttrsImage(this._ext, this._urlId, this.imageId, this.tileId);\n }\n\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0 && this.imageId === -1;\n }\n}\nconst EMPTY_ATTRS = new ExtendedAttrsImage();\n\n\n/**\n * ImageStorage - extension of CoreTerminal:\n * - hold image data\n * - write/read image data to/from buffer\n *\n * TODO: image composition for overwrites\n */\nexport class ImageStorage implements IDisposable {\n // storage\n private _images: Map = new Map();\n // last used id\n private _lastId = 0;\n // last evicted id\n private _lowestId = 0;\n // whether a full clear happened before\n private _fullyCleared = false;\n // whether render should do a full clear\n private _needsFullClear = false;\n // hard limit of stored pixels (fallback limit of 10 MB)\n private _pixelLimit: number = 2500000;\n\n private _viewportMetrics: { cols: number, rows: number };\n public onImageAdded: (() => void) | undefined;\n public onImageDeleted: ((storageId: number) => void) | undefined;\n\n constructor(\n private _terminal: ITerminalExt,\n private _renderer: ImageRenderer,\n private _opts: IImageAddonOptions\n ) {\n try {\n this.setLimit(this._opts.storageLimit);\n } catch (e: unknown) {\n if (e instanceof Error) {\n console.error(e.message);\n }\n console.warn(`storageLimit is set to ${this.getLimit()} MB`);\n }\n this._viewportMetrics = {\n cols: this._terminal.cols,\n rows: this._terminal.rows\n };\n }\n\n public dispose(): void {\n this.reset();\n }\n\n public reset(): void {\n for (const spec of this._images.values()) {\n spec.marker?.dispose();\n }\n // NOTE: marker.dispose above already calls ImageBitmap.close\n // therefore we can just wipe the map here\n this._images.clear();\n this._renderer.clearAll();\n }\n\n public getLimit(): number {\n return this._pixelLimit * 4 / 1000000;\n }\n\n public setLimit(value: number): void {\n if (value < 0.5 || value > 1000) {\n throw RangeError('invalid storageLimit, should be at least 0.5 MB and not exceed 1G');\n }\n this._pixelLimit = (value / 4 * 1000000) >>> 0;\n this._evictOldest(0);\n }\n\n public getUsage(): number {\n return this._getStoredPixels() * 4 / 1000000;\n }\n\n private _getStoredPixels(): number {\n let storedPixels = 0;\n for (const spec of this._images.values()) {\n if (spec.orig) {\n storedPixels += spec.orig.width * spec.orig.height;\n if (spec.actual && spec.actual !== spec.orig) {\n storedPixels += spec.actual.width * spec.actual.height;\n }\n }\n }\n return storedPixels;\n }\n\n private _delImg(id: number): void {\n const spec = this._images.get(id);\n if (!spec) return;\n this._images.delete(id);\n // FIXME: really ugly workaround to get bitmaps deallocated :(\n if (window.ImageBitmap && spec.orig instanceof ImageBitmap) {\n spec.orig.close();\n }\n this.onImageDeleted?.(id);\n }\n\n /**\n * Wipe canvas and images on alternate buffer.\n */\n public wipeAlternate(): void {\n // remove all alternate tagged images\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate') {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n // mark canvas to be wiped on next render\n this._needsFullClear = true;\n this._fullyCleared = false;\n }\n\n /**\n * Delete an image by its internal storage ID.\n * Used by protocols that support explicit deletion (e.g. Kitty a=d).\n */\n public deleteImage(id: number): void {\n const spec = this._images.get(id);\n if (spec) {\n spec.marker?.dispose();\n this._delImg(id);\n }\n }\n\n /**\n * Method to add an image to the storage.\n * @param img - The image to add (canvas or bitmap).\n * @param opts - Options for addImage:\n * - scrolling: When true, cursor advances with the image.\n * When false, image is placed at ORIGIN and cursor does not move.\n * - layer: Which canvas layer to render on ('top' or 'bottom').\n * - zIndex: Z-index for image layering within the same layer.\n * - cursorPos: 'vt340' for bottom-left, 'iip' for bottom.right.\n * @returns The internal image ID assigned to the stored image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap, opts: IAddImageOpts): number {\n // never allow storage to exceed memory limit\n this._evictOldest(img.width * img.height);\n\n // calc rows x cols needed to display the image\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const cols = Math.ceil(img.width / cellSize.width);\n const rows = Math.ceil(img.height / cellSize.height);\n\n const imageId = ++this._lastId;\n\n const buffer = this._terminal._core.buffer;\n const termCols = this._terminal.cols;\n const termRows = this._terminal.rows;\n const originX = buffer.x;\n const originY = buffer.y;\n let offset = originX;\n let tileCount = 0;\n\n if (!opts.scrolling) {\n buffer.x = 0;\n buffer.y = 0;\n offset = 0;\n }\n\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(buffer.y + buffer.ybase);\n for (let col = 0; col < cols; ++col) {\n if (offset + col >= termCols) break;\n this._writeToCell(line as IBufferLineExt, offset + col, imageId, row * cols + col);\n tileCount++;\n }\n if (opts.scrolling) {\n if (row < rows - 1) this._terminal._core._inputHandler.lineFeed();\n } else {\n if (++buffer.y >= termRows) break;\n }\n buffer.x = offset;\n }\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n\n // cursor positioning modes\n if (opts.scrolling) {\n if (opts.cursorPos === 'iip') {\n buffer.x = Math.min(offset + cols, termCols);\n } else {\n buffer.x = offset;\n }\n } else {\n buffer.x = originX;\n buffer.y = originY;\n }\n\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.tileCount < 1) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n\n // eviction marker:\n // delete the image when the marker gets disposed\n const endMarker = this._terminal.registerMarker(0);\n endMarker?.onDispose(() => {\n const spec = this._images.get(imageId);\n if (spec) {\n this._delImg(imageId);\n }\n });\n\n // since markers do not work on alternate for some reason,\n // we evict images here manually\n if (this._terminal.buffer.active.type === 'alternate') {\n this._evictOnAlternate();\n }\n\n // create storage entry\n const imgSpec: IImageSpec = {\n orig: img,\n origCellSize: cellSize,\n actual: img,\n actualCellSize: { ...cellSize }, // clone needed, since later modified\n marker: endMarker || undefined,\n tileCount,\n bufferType: this._terminal.buffer.active.type,\n layer: opts.layer,\n zIndex: opts.zIndex\n };\n\n // finally add the image\n this._images.set(imageId, imgSpec);\n this.onImageAdded?.();\n return imageId;\n }\n\n\n /**\n * Render method. Collects buffer information and triggers\n * canvas updates.\n */\n // TODO: Should we move this to the ImageRenderer?\n public render(range: { start: number, end: number }): void {\n // Determine which layers have images\n let hasTopImages = false;\n let hasBottomImages = false;\n for (const spec of this._images.values()) {\n if (spec.layer === 'bottom') {\n hasBottomImages = true;\n } else {\n hasTopImages = true;\n }\n if (hasTopImages && hasBottomImages) break;\n }\n\n // Lazily insert layers that are needed\n if (hasTopImages && !this._renderer.hasLayer('top')) {\n this._renderer.insertLayerToDom('top');\n if (!this._renderer.hasLayer('top')) return;\n }\n if (hasBottomImages && !this._renderer.hasLayer('bottom')) {\n this._renderer.insertLayerToDom('bottom');\n }\n\n // rescale if needed\n this._renderer.rescaleCanvas();\n\n // exit early if we dont have any images to test for\n if (!this._images.size) {\n if (!this._fullyCleared) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n if (this._renderer.hasLayer('top')) {\n this._renderer.removeLayerFromDom('top');\n }\n if (this._renderer.hasLayer('bottom')) {\n this._renderer.removeLayerFromDom('bottom');\n }\n return;\n }\n\n // Remove layers no longer needed\n if (!hasTopImages && this._renderer.hasLayer('top')) {\n this._renderer.clearAll('top');\n this._renderer.removeLayerFromDom('top');\n }\n if (!hasBottomImages && this._renderer.hasLayer('bottom')) {\n this._renderer.clearAll('bottom');\n this._renderer.removeLayerFromDom('bottom');\n }\n\n // buffer switches force a full clear\n if (this._needsFullClear) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n\n const { start, end } = range;\n const buffer = this._terminal._core.buffer;\n const cols = this._terminal._core.cols;\n\n // clear drawing area\n this._renderer.clearLines(start, end);\n\n // Collect draw calls so we can sort by z-index (lower z drawn first).\n const drawCalls: { imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number }[] = [];\n const placeholderCalls: { col: number, row: number, count: number }[] = [];\n\n // walk all cells in viewport and collect tiles found\n for (let row = start; row <= end; ++row) {\n const line = buffer.lines.get(row + buffer.ydisp) as IBufferLineExt;\n if (!line) return;\n for (let col = 0; col < cols; ++col) {\n if (line.getBg(col) & BgFlags.HAS_EXTENDED) {\n let e: IExtendedAttrsImage = line._extendedAttrs[col] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (e.tileId !== -1) {\n const startTile = e.tileId;\n const startCol = col;\n let count = 1;\n /**\n * merge tiles to the right into a single draw call, if:\n * - not at end of line\n * - cell has same image id\n * - cell has consecutive tile id\n */\n while (\n ++col < cols\n && (line.getBg(col) & BgFlags.HAS_EXTENDED)\n && (e = line._extendedAttrs[col] ?? EMPTY_ATTRS)\n && (e.imageId === imageId)\n && (e.tileId === startTile + count)\n ) {\n count++;\n }\n col--;\n if (imgSpec) {\n if (imgSpec.actual) {\n drawCalls.push({ imgSpec, tileId: startTile, col: startCol, row, count });\n }\n } else if (this._opts.showPlaceholder) {\n placeholderCalls.push({ col: startCol, row, count });\n }\n this._fullyCleared = false;\n }\n }\n }\n }\n\n // Sort by z-index so lower z draws first (higher z renders on top)\n drawCalls.sort((a, b) => a.imgSpec.zIndex - b.imgSpec.zIndex);\n\n // Draw placeholders first (lowest priority)\n for (const call of placeholderCalls) {\n this._renderer.drawPlaceholder(call.col, call.row, call.count);\n }\n\n // Draw images in z-index order\n for (const call of drawCalls) {\n this._renderer.draw(call.imgSpec, call.tileId, call.col, call.row, call.count);\n }\n }\n\n public viewportResize(metrics: { cols: number, rows: number }): void {\n // exit early if we have nothing in storage\n if (!this._images.size) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // handle only viewport width enlargements, exit all other cases\n // TODO: needs patch for tile counter\n if (this._viewportMetrics.cols >= metrics.cols) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // walk scrollbuffer at old col width to find all possible expansion matches\n const buffer = this._terminal._core.buffer;\n const rows = buffer.lines.length;\n const oldCol = this._viewportMetrics.cols - 1;\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(row) as IBufferLineExt;\n if (line.getBg(oldCol) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[oldCol] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (!imgSpec) {\n continue;\n }\n // found an image tile at oldCol, check if it qualifies for right exapansion\n const tilesPerRow = Math.ceil((imgSpec.actual?.width || 0) / imgSpec.actualCellSize.width);\n if ((e.tileId % tilesPerRow) + 1 >= tilesPerRow) {\n continue;\n }\n // expand only if right side is empty (nothing got wrapped from below)\n let hasData = false;\n for (let rightCol = oldCol + 1; rightCol > metrics.cols; ++rightCol) {\n if (line._data[rightCol * Cell.SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK) {\n hasData = true;\n break;\n }\n }\n if (hasData) {\n continue;\n }\n // do right expansion on terminal buffer\n const end = Math.min(metrics.cols, tilesPerRow - (e.tileId % tilesPerRow) + oldCol);\n let lastTile = e.tileId;\n for (let expandCol = oldCol + 1; expandCol < end; ++expandCol) {\n this._writeToCell(line as IBufferLineExt, expandCol, imageId, ++lastTile);\n imgSpec.tileCount++;\n }\n }\n }\n // store new viewport metrics\n this._viewportMetrics = metrics;\n }\n\n /**\n * Retrieve original canvas at buffer position.\n */\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1) {\n const orig = this._images.get(e.imageId)?.orig;\n if (window.ImageBitmap && orig instanceof ImageBitmap) {\n const canvas = ImageRenderer.createCanvas(window.document, orig.width, orig.height);\n canvas.getContext('2d')?.drawImage(orig, 0, 0, orig.width, orig.height);\n return canvas;\n }\n return orig as HTMLCanvasElement;\n }\n }\n }\n\n /**\n * Extract active single tile at buffer position.\n */\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1 && e.tileId !== -1) {\n const spec = this._images.get(e.imageId);\n if (spec) {\n return this._renderer.extractTile(spec, e.tileId);\n }\n }\n }\n }\n\n // TODO: Do we need some blob offloading tricks here to avoid early eviction?\n // also see https://stackoverflow.com/questions/28307789/is-there-any-limitation-on-javascript-max-blob-size\n private _evictOldest(room: number): number {\n const used = this._getStoredPixels();\n let current = used;\n while (this._pixelLimit < current + room && this._images.size) {\n const spec = this._images.get(++this._lowestId);\n if (spec && spec.orig) {\n current -= spec.orig.width * spec.orig.height;\n if (spec.actual && spec.orig !== spec.actual) {\n current -= spec.actual.width * spec.actual.height;\n }\n spec.marker?.dispose();\n this._delImg(this._lowestId);\n }\n }\n return used - current;\n }\n\n private _writeToCell(line: IBufferLineExt, x: number, imageId: number, tileId: number): void {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const old = line._extendedAttrs[x];\n if (old) {\n if (old.imageId !== undefined) {\n // found an old ExtendedAttrsImage, since we know that\n // they are always isolated instances (single cell usage),\n // we can re-use it and just update their id entries\n const oldSpec = this._images.get(old.imageId);\n if (oldSpec) {\n // early eviction for in-viewport overwrites\n oldSpec.tileCount--;\n }\n old.imageId = imageId;\n old.tileId = tileId;\n return;\n }\n // found a plain ExtendedAttrs instance, clone it to new entry\n line._extendedAttrs[x] = new ExtendedAttrsImage(old.ext, old.urlId, imageId, tileId);\n return;\n }\n }\n // fall-through: always create new ExtendedAttrsImage entry\n line._data[x * Cell.SIZE + Cell.BG] |= BgFlags.HAS_EXTENDED;\n line._extendedAttrs[x] = new ExtendedAttrsImage(0, 0, imageId, tileId);\n }\n\n private _evictOnAlternate(): void {\n // nullify tile count of all images on alternate buffer\n for (const spec of this._images.values()) {\n if (spec.bufferType === 'alternate') {\n spec.tileCount = 0;\n }\n }\n // re-count tiles on whole buffer\n const buffer = this._terminal._core.buffer;\n for (let y = 0; y < this._terminal.rows; ++y) {\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (!line) {\n continue;\n }\n for (let x = 0; x < this._terminal.cols; ++x) {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const imgId = line._extendedAttrs[x]?.imageId;\n if (imgId) {\n const spec = this._images.get(imgId);\n if (spec) {\n spec.tileCount++;\n }\n }\n }\n }\n }\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate' && !spec.tileCount) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n }\n}\n","/**\n * Copyright (c) 2020, 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IDcsHandler, IParams, IImageAddonOptions, ITerminalExt, AttributeData, IResetHandler, ReadonlyColorSet } from './Types';\nimport { toRGBA8888, BIG_ENDIAN, PALETTE_ANSI_256, PALETTE_VT340_COLOR } from 'sixel/lib/Colors';\nimport { RGBA8888 } from 'sixel/lib/Types';\nimport { ImageRenderer } from './ImageRenderer';\n\nimport { DecoderAsync, Decoder } from 'sixel/lib/Decoder';\n\n// always free decoder ressources after decoding if it exceeds this limit\nconst MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB\n\n// custom default palette: VT340 (lower 16 colors) + ANSI256 (up to 256) + zeroed (up to 4096)\nconst DEFAULT_PALETTE = PALETTE_ANSI_256;\nDEFAULT_PALETTE.set(PALETTE_VT340_COLOR);\n\n\nexport class SixelHandler implements IDcsHandler, IResetHandler {\n private _size = 0;\n private _aborted = false;\n private _dec: Decoder | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _storage: SixelImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n DecoderAsync({\n memoryLimit: this._opts.pixelLimit * 4,\n palette: DEFAULT_PALETTE,\n paletteLimit: this._opts.sixelPaletteLimit\n }).then(d => this._dec = d);\n }\n\n public reset(): void {\n /**\n * reset sixel decoder to defaults:\n * - release all memory\n * - nullify palette (4096)\n * - apply default palette (256)\n */\n if (this._dec) {\n this._dec.release();\n // FIXME: missing interface on decoder to nullify full palette\n (this._dec as any)._palette.fill(0);\n this._dec.init(0, DEFAULT_PALETTE, this._opts.sixelPaletteLimit);\n }\n }\n\n public hook(params: IParams): void {\n this._size = 0;\n this._aborted = false;\n if (this._dec) {\n const fillColor = params.params[1] === 1 ? 0 : extractActiveBg(\n this._coreTerminal._core._inputHandler._curAttrData,\n this._coreTerminal._core._themeService?.colors);\n this._dec.init(fillColor, null, this._opts.sixelPaletteLimit);\n }\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted || !this._dec) {\n return;\n }\n this._size += end - start;\n if (this._size > this._opts.sixelSizeLimit) {\n console.warn(`SIXEL: too much data, aborting`);\n this._aborted = true;\n this._dec.release();\n return;\n }\n try {\n this._dec.decode(data, start, end);\n } catch (e) {\n console.warn(`SIXEL: error while decoding image - ${e}`);\n this._aborted = true;\n this._dec.release();\n }\n }\n\n public unhook(success: boolean): boolean | Promise {\n if (this._aborted || !success || !this._dec) {\n return true;\n }\n\n const width = this._dec.width;\n const height = this._dec.height;\n\n // partial fix for https://github.com/jerch/xterm-addon-image/issues/37\n if (!width || !height) {\n if (height) {\n this._storage.advanceCursor(height);\n }\n return true;\n }\n\n const canvas = ImageRenderer.createCanvas(undefined, width, height);\n canvas.getContext('2d')?.putImageData(new ImageData(this._dec.data8 as Uint8ClampedArray, width, height), 0, 0);\n if (this._dec.memoryUsage > MEM_PERMA_LIMIT) {\n this._dec.release();\n }\n this._storage.addImage(canvas);\n return true;\n }\n}\n\n\n/**\n * Some helpers to extract current terminal colors.\n */\n\n// get currently active background color from terminal\n// also respect INVERSE setting\nfunction extractActiveBg(attr: AttributeData, colors: ReadonlyColorSet | undefined): RGBA8888 {\n let bg = 0;\n if (!colors) {\n // FIXME: theme service is prolly not available yet,\n // happens if .open() was not called yet (bug in core?)\n return bg;\n }\n if (attr.isInverse()) {\n if (attr.isFgDefault()) {\n bg = convertLe(colors.foreground.rgba);\n } else if (attr.isFgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getFgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getFgColor()].rgba);\n }\n } else {\n if (attr.isBgDefault()) {\n bg = convertLe(colors.background.rgba);\n } else if (attr.isBgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getBgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getBgColor()].rgba);\n }\n }\n return bg;\n}\n\n// rgba values on the color managers are always in BE, thus convert to LE\nfunction convertLe(color: number): RGBA8888 {\n if (BIG_ENDIAN) return color;\n return (color & 0xFF) << 24 | (color >>> 8 & 0xFF) << 16 | (color >>> 16 & 0xFF) << 8 | color >>> 24 & 0xFF;\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { IImageAddonOptions, ITerminalExt, IAddImageOpts } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\n\n/**\n * Sixel-specific image storage controller.\n *\n * Wraps the shared ImageStorage with sixel protocol semantics:\n * - Cursor behavior governed by DECSET 80 (sixelScrolling option)\n * - advanceCursor for empty sixels carrying only height\n */\nexport class SixelImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'vt340' };\n constructor(\n private readonly _storage: ImageStorage,\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _terminal: ITerminalExt\n ) {}\n\n /**\n * Add a sixel image to storage.\n * Cursor behavior depends on the sixelScrolling option (DECSET 80).\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._addImageOpts.scrolling = this._opts.sixelScrolling;\n this._storage.addImage(img, this._addImageOpts);\n }\n\n /**\n * Only advance text cursor.\n * This is an edge case from empty sixels carrying only a height but no pixels.\n * Partially fixes https://github.com/jerch/xterm-addon-image/issues/37.\n */\n public advanceCursor(height: number): void {\n if (this._opts.sixelScrolling) {\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const rows = Math.ceil(height / cellSize.height);\n for (let i = 1; i < rows; ++i) {\n this._terminal._core._inputHandler.lineFeed();\n }\n }\n }\n}\n","/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { IApcHandler, IImageAddonOptions, IResetHandler, ITerminalExt, ImageLayer } from '../Types';\nimport { ImageRenderer } from '../ImageRenderer';\nimport { CELL_SIZE_DEFAULT } from '../ImageStorage';\nimport { imageType } from '../IIPMetrics';\nimport { KittyImageStorage } from './KittyImageStorage';\nimport Base64Decoder, { type DecodeStatus } from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport {\n KittyAction,\n KittyFormat,\n KittyCompression,\n IKittyCommand,\n IPendingTransmission,\n IKittyImageData,\n KittyPixelConstants,\n parseKittyCommand\n} from './KittyGraphicsTypes';\n\nconst enum Constants {\n // Memory limit for base64 decoder (4MB, same as IIPHandler)\n DECODER_KEEP_DATA = 4194304,\n DECODER_INITIAL_DATA = 4194304, // 4MB\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n DECODER_OK = 0,\n // Maximum control data size\n MAX_CONTROL_DATA_SIZE = 512,\n // Semicolon codepoint\n SEMICOLON = 0x3B\n}\n\nconst DECODER_OK = Constants.DECODER_OK as unknown as DecodeStatus.OK;\n\n// Kitty graphics protocol handler with streaming base64 decoding.\nexport class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDisposable {\n private _aborted = false;\n private _generation = 0;\n private _decodeError = false;\n\n private _activeDecoder: Base64Decoder | null = null;\n private readonly _maxEncodedBytes: number;\n private readonly _initialEncodedBytes: number;\n\n // Streaming related states\n\n // True while receiving control data (before semicolon).\n private _inControlData = true;\n\n // Buffer for control data.\n private _controlData = new Uint32Array(Constants.MAX_CONTROL_DATA_SIZE);\n private _controlLength = 0;\n\n // Pre-calculated encoded size limit\n private _encodedSizeLimit = 0;\n private _totalEncodedSize = 0;\n\n // Parsed command. These are the control data before semicolon.\n private _parsedCommand: IKittyCommand | null = null;\n\n // Storage related states\n\n private _pendingTransmissions: Map = new Map();\n // Tracks the pending key of the most recently started chunked upload.\n // Per spec, subsequent chunks only need m= (and optionally q=), without i=.\n // When a chunk arrives with no i=, this key is used to find the pending upload.\n private _lastPendingKey: number | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _kittyStorage: KittyImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n // Convert decoded size limit -> max encoded bytes.\n this._maxEncodedBytes = Math.ceil(this._opts.kittySizeLimit * 4 / 3);\n // ensure we preallocate more than configured limit while using 4mb initial size.\n this._initialEncodedBytes = Math.min(Constants.DECODER_INITIAL_DATA, this._maxEncodedBytes);\n }\n\n public reset(): void {\n this._generation++;\n this._cleanupAllPending();\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n this._kittyStorage.reset();\n }\n\n public dispose(): void {\n this.reset();\n }\n\n private _removePendingEntry(key: number): void {\n this._pendingTransmissions.delete(key);\n if (this._lastPendingKey === key) {\n this._lastPendingKey = undefined;\n }\n }\n\n private _cleanupAllPending(): void {\n for (const pending of this._pendingTransmissions.values()) {\n pending.decoder.release();\n }\n this._pendingTransmissions.clear();\n this._lastPendingKey = undefined;\n }\n\n public start(): void {\n this._aborted = false;\n this._decodeError = false;\n this._inControlData = true;\n this._controlLength = 0;\n this._parsedCommand = null;\n // Pre-calculate encoded limit once: base64 is 4 bytes encoded → 3 bytes decoded\n this._encodedSizeLimit = this._maxEncodedBytes;\n this._totalEncodedSize = 0;\n this._activeDecoder = null;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (!this._inControlData) {\n this._streamPayload(data, start, end);\n } else {\n // Scan for semicolon\n let controlEnd = end;\n for (let i = start; i < end; i++) {\n if (data[i] === Constants.SEMICOLON) {\n this._inControlData = false;\n controlEnd = i;\n break;\n }\n }\n\n // Copy control data\n const copyLength = controlEnd - start;\n if (this._controlLength + copyLength > Constants.MAX_CONTROL_DATA_SIZE) {\n this._aborted = true;\n return;\n }\n this._controlData.set(data.subarray(start, controlEnd), this._controlLength);\n this._controlLength += copyLength;\n\n if (!this._inControlData) {\n // Found semicolon - parse control data early for validation\n this._parsedCommand = parseKittyCommand(this._parseControlDataString());\n\n // Early validation: i+I conflict\n if (this._parsedCommand.id !== undefined && this._parsedCommand.imageNumber !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'EINVAL:cannot specify both i and I keys', this._parsedCommand.quiet ?? 0);\n this._aborted = true;\n return;\n }\n\n // Delete action doesn't need payload - skip streaming\n if (this._parsedCommand.action === KittyAction.DELETE) {\n return;\n }\n\n // Stream remaining as payload\n const payloadStart = controlEnd + 1;\n if (payloadStart < end) {\n this._streamPayload(data, payloadStart, end);\n }\n }\n }\n }\n\n // Stream payload bytes into the base64 decoder.\n private _streamPayload(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n // Check size limit (compare encoded bytes against pre-calculated limit)\n // Include cumulative size from pending transmission for multi-chunk images.\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = this._parsedCommand?.id ?? this._lastPendingKey ?? 0;\n const pending = this._pendingTransmissions.get(pendingKey);\n const previousEncodedSize = pending?.totalEncodedSize ?? 0;\n this._totalEncodedSize += end - start;\n const cumulativeEncodedSize = previousEncodedSize + this._totalEncodedSize;\n if (cumulativeEncodedSize > this._encodedSizeLimit) {\n const decoderToRelease = this._activeDecoder ?? pending?.decoder;\n if (decoderToRelease) {\n decoderToRelease.release();\n }\n this._activeDecoder = null;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n this._aborted = true;\n return;\n }\n\n if (this._decodeError) return;\n\n if (pending?.decoder && !this._activeDecoder) {\n this._activeDecoder = pending.decoder;\n }\n if (!this._activeDecoder) {\n // Budget WASM capacity, including one page of decoder state and rounding.\n const decoderCapacity = this._maxEncodedBytes + 131072;\n if (decoderCapacity > this._opts.storageLimit * 1000000) {\n this._aborted = true;\n if (this._parsedCommand?.id !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'ENOMEM:pending image budget exceeded', this._parsedCommand.quiet ?? 0);\n }\n return;\n }\n const maxPending = Math.max(1, Math.floor(this._opts.storageLimit * 1000000 / decoderCapacity));\n while (this._pendingTransmissions.size >= maxPending) {\n const oldest = this._pendingTransmissions.entries().next().value;\n if (!oldest) break;\n oldest[1].decoder.release();\n this._removePendingEntry(oldest[0]);\n if (oldest[1].cmd.id !== undefined) {\n this._sendResponse(oldest[1].cmd.id, 'ENOMEM:pending image budget exceeded', oldest[1].cmd.quiet ?? 0);\n }\n }\n this._activeDecoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes);\n this._activeDecoder.init();\n }\n\n if (this._activeDecoder.put(data.subarray(start, end)) !== DECODER_OK) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n this._decodeError = true;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted || !success) {\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n return true;\n }\n\n // No semicolon = no payload (delete, capability query)\n if (this._inControlData) {\n return this._handleNoPayloadCommand();\n }\n\n // Use command parsed early in put() - i+I already validated there\n const cmd = this._parsedCommand!;\n\n // Delete action was handled by skipping payload - just execute\n if (cmd.action === KittyAction.DELETE) {\n return this._handleDelete(cmd);\n }\n\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = cmd.id ?? this._lastPendingKey ?? 0;\n const isMoreComing = cmd.more === 1;\n const pending = this._pendingTransmissions.get(pendingKey);\n\n if (isMoreComing) {\n if (this._activeDecoder) {\n if (pending) {\n pending.totalEncodedSize += this._totalEncodedSize;\n pending.decodeError = pending.decodeError || this._decodeError;\n } else {\n this._pendingTransmissions.set(pendingKey, {\n cmd: { ...cmd },\n decoder: this._activeDecoder,\n totalEncodedSize: this._totalEncodedSize,\n decodeError: this._decodeError\n });\n }\n this._lastPendingKey = pendingKey;\n this._activeDecoder = null;\n }\n return true;\n }\n\n // Final chunk received — clear the last pending key\n if (pending) {\n this._lastPendingKey = undefined;\n }\n\n let decodeError = this._decodeError;\n let finalCmd = cmd;\n let decoder = this._activeDecoder;\n\n if (pending) {\n finalCmd = pending.cmd;\n decoder = pending.decoder;\n decodeError = decodeError || pending.decodeError;\n this._pendingTransmissions.delete(pendingKey);\n }\n\n let imageBytes = new Uint8Array(0);\n if (decoder) {\n if (decoder.end() !== DECODER_OK) {\n decodeError = true;\n }\n imageBytes = decoder.data8;\n }\n this._activeDecoder = null;\n\n // Handle command first — handlers create Blob/ImageData from imageBytes,\n // which copies the data. Only then is it safe to release the decoder's\n // wasm memory that imageBytes points into.\n const result = this._handleCommandWithBytesAndCmd(finalCmd, imageBytes, decodeError);\n if (decoder) {\n decoder.release();\n }\n return result;\n }\n\n // Command handling\n\n private _parseControlDataString(): string {\n let str = '';\n for (let i = 0; i < this._controlLength; i++) {\n str += String.fromCodePoint(this._controlData[i]);\n }\n return str;\n }\n\n private _handleNoPayloadCommand(): boolean | Promise {\n const cmd = parseKittyCommand(this._parseControlDataString());\n\n // Per spec: specifying both i and I is an error\n if (cmd.id !== undefined && cmd.imageNumber !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:cannot specify both i and I keys', cmd.quiet ?? 0);\n return true;\n }\n\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.DELETE:\n return this._handleDelete(cmd);\n case KittyAction.QUERY:\n this._sendResponse(cmd.id ?? 0, 'OK', cmd.quiet ?? 0);\n return true;\n case KittyAction.PLACEMENT:\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handleCommandWithBytesAndCmd(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.TRANSMIT: {\n const result = this._handleTransmit(cmd, bytes, decodeError);\n // Only send response when _handleTransmit didn't already respond\n // (it handles unsupported transmission medium responses internally)\n if ((cmd.transmission ?? 'd') === 'd' && cmd.id !== undefined) {\n if (decodeError) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n } else if (bytes.length > 0) {\n this._sendResponse(cmd.id, 'OK', cmd.quiet ?? 0);\n }\n }\n return result;\n }\n case KittyAction.TRANSMIT_DISPLAY:\n return this._handleTransmitDisplay(cmd, bytes, decodeError);\n case KittyAction.QUERY:\n return this._handleQuery(cmd, bytes, decodeError);\n case KittyAction.PLACEMENT:\n // a=p ignores any payload — image data was already transmitted\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handlePlacement(cmd: IKittyCommand): boolean | Promise {\n if (cmd.id === undefined) {\n return true;\n }\n const id = cmd.id;\n const image = this._kittyStorage.getImage(id);\n if (!image) {\n this._sendResponse(id, 'ENOENT:image not found', cmd.quiet ?? 0, cmd.placementId);\n return true;\n }\n const result = this._displayImage(image, cmd);\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0, cmd.placementId);\n return true;\n });\n }\n\n private _handleTransmit(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n // TODO: Support file-based transmission modes (t=f, t=t, t=s)\n // Currently only supports direct transmission (t=d, the default).\n // - t=f (file): Payload is base64-encoded file path. Terminal reads image from that path.\n // - t=t (temp file): Payload is base64-encoded path in temp directory. Terminal reads, deletes.\n // - t=s: Payload is base64-encoded POSIX shm name. Terminal reads from shared memory.\n // These modes require filesystem/IPC access not available in browsers. For Node.js/Electron:\n // 1. Check cmd.transmission (t key) before treating bytes as image data\n // 2. For t=f/t/s: decode bytes as UTF-8 string (the path/name), then read file contents\n // 3. For t=d: treat bytes as image data (current behavior)\n // When implementing, also update _handleQuery to accept these transmission mediums.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported transmission medium', cmd.quiet ?? 0);\n }\n return true;\n }\n\n if (decodeError || bytes.length === 0) return true;\n\n this._kittyStorage.storeImage(cmd.id, {\n data: new Blob([bytes as BlobPart]),\n width: cmd.width ?? 0,\n height: cmd.height ?? 0,\n format: (cmd.format ?? KittyFormat.RGBA) as 24 | 32 | 100,\n compression: cmd.compression ?? ''\n });\n return true;\n }\n\n private _handleTransmitDisplay(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n if (decodeError) {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n }\n return true;\n }\n\n this._handleTransmit(cmd, bytes, decodeError);\n\n const id = cmd.id ?? this._kittyStorage.lastImageId;\n const image = this._kittyStorage.getImage(id);\n if (image) {\n const result = this._displayImage(image, cmd);\n if (cmd.id !== undefined) {\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0);\n return true;\n });\n }\n return result.then(() => true);\n }\n return true;\n }\n\n private _handleQuery(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n const id = cmd.id ?? 0;\n const quiet = cmd.quiet ?? 0;\n\n // Per spec: reject unsupported transmission mediums (only t=d is supported atm)\n // TODO: When filesystem support is added (Node.js/Electron), update this to accept\n // t=f (file), t=t (temp file), and t=s (shared memory) and respond OK for queries.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n this._sendResponse(id, 'EINVAL:unsupported transmission medium', quiet);\n return true;\n }\n\n // Check decode error first (invalid base64)\n if (decodeError) {\n this._sendResponse(id, 'EINVAL:invalid base64 data', quiet);\n return true;\n }\n\n // Capability query (no payload) - just respond OK\n if (bytes.length === 0) {\n this._sendResponse(id, 'OK', quiet);\n return true;\n }\n\n const format = cmd.format ?? KittyFormat.RGBA;\n\n if (format === KittyFormat.PNG) {\n this._sendResponse(id, 'OK', quiet);\n } else {\n const width = cmd.width ?? 0;\n const height = cmd.height ?? 0;\n\n if (!width || !height) {\n this._sendResponse(id, 'EINVAL:width and height required for raw pixel data', quiet);\n return true;\n }\n\n const bytesPerPixel = format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n this._sendResponse(id, `EINVAL:insufficient pixel data`, quiet);\n return true;\n }\n\n this._sendResponse(id, 'OK', quiet);\n }\n return true;\n }\n\n private _handleDelete(cmd: IKittyCommand): boolean {\n // Per spec: default delete selector is 'a' (delete all visible placements)\n const selector = cmd.deleteSelector ?? 'a';\n\n // TODO: Distinguish lowercase (delete placements only) from uppercase\n // (delete placements + free stored image data). Currently both variants\n // free everything since we don't separate stored data from placements.\n switch (selector) {\n case 'a':\n case 'A':\n this._cleanupAllPending();\n this._kittyStorage.deleteAll();\n break;\n case 'i':\n case 'I':\n // TODO: When placement id tracking is implemented (see TODO in\n // KittyImageStorage), d=i with p= should delete only that\n // specific placement, while d=i without p should delete all\n // placements for the image.\n if (cmd.id !== undefined) {\n const pending = this._pendingTransmissions.get(cmd.id);\n if (pending) {\n pending.decoder.release();\n }\n this._removePendingEntry(cmd.id);\n this._kittyStorage.deleteById(cmd.id);\n }\n break;\n default:\n // Unsupported selectors (c, n, p, q, r, x, y, z, f) — ignore for now\n break;\n }\n return true;\n }\n\n private _sendResponse(id: number, message: string, quiet: number, placementId?: number): void {\n const isOk = message === 'OK';\n if (isOk && quiet >= 1) return;\n if (!isOk && quiet >= 2) return;\n\n const pPart = placementId ? `,p=${placementId}` : '';\n const response = `\\x1b_Gi=${id}${pPart};${message}\\x1b\\\\`;\n this._coreTerminal._core.coreService.triggerDataEvent(response);\n }\n\n // Image display\n\n private _displayImage(image: IKittyImageData, cmd: IKittyCommand): Promise {\n return this._decodeAndDisplay(image, cmd)\n .then(() => true)\n .catch(() => false);\n }\n\n private async _decodeAndDisplay(image: IKittyImageData, cmd: IKittyCommand): Promise {\n const generation = this._generation;\n let bitmap: ImageBitmap | undefined = await this._createBitmap(image);\n\n try {\n if (generation !== this._generation) throw new Error('image decode canceled');\n const cropX = Math.max(0, cmd.x ?? 0);\n const cropY = Math.max(0, cmd.y ?? 0);\n const cropW = cmd.sourceWidth || (bitmap.width - cropX);\n const cropH = cmd.sourceHeight || (bitmap.height - cropY);\n\n const maxCropW = Math.max(0, bitmap.width - cropX);\n const maxCropH = Math.max(0, bitmap.height - cropY);\n const finalCropW = Math.max(0, Math.min(cropW, maxCropW));\n const finalCropH = Math.max(0, Math.min(cropH, maxCropH));\n\n if (finalCropW === 0 || finalCropH === 0) {\n throw new Error('invalid source rectangle');\n }\n\n if (cropX !== 0 || cropY !== 0 || finalCropW !== bitmap.width || finalCropH !== bitmap.height) {\n const cropped = await createImageBitmap(bitmap, cropX, cropY, finalCropW, finalCropH);\n bitmap.close();\n bitmap = cropped;\n }\n\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n\n // Per spec: c/r default to image's natural cell dimensions.\n // If only one of c/r is specified, compute the other from image aspect ratio.\n let imgCols: number;\n let imgRows: number;\n if (cmd.columns !== undefined && cmd.rows !== undefined) {\n imgCols = cmd.columns;\n imgRows = cmd.rows;\n } else if (cmd.columns !== undefined) {\n imgCols = cmd.columns;\n imgRows = Math.max(1, Math.ceil((bitmap.height / bitmap.width) * (imgCols * cw) / ch));\n } else if (cmd.rows !== undefined) {\n imgRows = cmd.rows;\n imgCols = Math.max(1, Math.ceil((bitmap.width / bitmap.height) * (imgRows * ch) / cw));\n } else {\n imgCols = Math.ceil(bitmap.width / cw);\n imgRows = Math.ceil(bitmap.height / ch);\n }\n\n let w = bitmap.width;\n let h = bitmap.height;\n\n // Scale bitmap to fit placement rectangle when c/r are specified\n if (cmd.columns !== undefined || cmd.rows !== undefined) {\n w = Math.round(imgCols * cw);\n h = Math.round(imgRows * ch);\n }\n\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n\n // Save cursor position before addImage modifies it\n const buffer = this._coreTerminal._core.buffer;\n const savedX = buffer.x;\n const savedY = buffer.y;\n const savedYbase = buffer.ybase;\n\n // Determine layer based on z-index: negative = behind text, 0+ = on top.\n // When z<0 we always use the bottom layer even without allowTransparency —\n // the image will simply be hidden behind the opaque text background, which\n // is the correct behavior (client asked for \"behind text\").\n const wantsBottom = cmd.zIndex !== undefined && cmd.zIndex < 0;\n const layer: ImageLayer = wantsBottom ? 'bottom' : 'top';\n\n if (w !== bitmap.width || h !== bitmap.height) {\n const scaled = await createImageBitmap(bitmap, { resizeWidth: w, resizeHeight: h });\n bitmap.close();\n bitmap = scaled;\n }\n\n // Per spec: X/Y are pixel offsets within the first cell, so clamp to cell dimensions\n const xOffset = Math.min(Math.max(0, cmd.xOffset ?? 0), cw - 1);\n const yOffset = Math.min(Math.max(0, cmd.yOffset ?? 0), ch - 1);\n if (xOffset !== 0 || yOffset !== 0) {\n // Per spec: X/Y is not added to c/r area. When c/r are explicit, the\n // total placement area remains c*cw × r*ch pixels and the offset image\n // is clipped to fit. When c/r are unset, the padded canvas determines\n // the natural cell dimensions.\n const canvasW = (cmd.columns !== undefined) ? Math.round(imgCols * cw) : bitmap.width + xOffset;\n const canvasH = (cmd.rows !== undefined) ? Math.round(imgRows * ch) : bitmap.height + yOffset;\n const offsetCanvas = ImageRenderer.createCanvas(window.document, canvasW, canvasH);\n const offsetCtx = offsetCanvas.getContext('2d');\n if (!offsetCtx) {\n throw new Error('Failed to create offset canvas context');\n }\n offsetCtx.drawImage(bitmap, xOffset, yOffset);\n\n const offsetBitmap = await createImageBitmap(offsetCanvas);\n offsetCanvas.width = offsetCanvas.height = 0;\n bitmap.close();\n bitmap = offsetBitmap;\n w = bitmap.width;\n h = bitmap.height;\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n if (cmd.columns === undefined) {\n imgCols = Math.ceil(bitmap.width / cw);\n }\n if (cmd.rows === undefined) {\n imgRows = Math.ceil(bitmap.height / ch);\n }\n }\n\n if (generation !== this._generation) throw new Error('image decode canceled');\n const zIndex = cmd.zIndex ?? 0;\n this._kittyStorage.addImage(image.id, bitmap, true, layer, zIndex);\n bitmap = undefined; // ownership transferred to storage\n\n // Kitty cursor movement\n // Per spec: cursor placed at first column after last image column,\n // on the last row of the image. C=1 means don't move cursor.\n if (cmd.cursorMovement === 1) {\n // C=1: restore cursor to position before image was placed\n const scrolled = buffer.ybase - savedYbase;\n buffer.x = savedX;\n // Can't restore cursor to scrollback?\n buffer.y = Math.max(savedY - scrolled, 0);\n } else {\n // Default (C=0): advance cursor horizontally past the image\n // addImage already positioned cursor on the last row via lineFeeds\n buffer.x = Math.min(savedX + imgCols, this._coreTerminal.cols);\n }\n } catch (e) {\n bitmap?.close();\n throw e;\n }\n }\n\n // Create ImageBitmap from already-decoded image data.\n private async _createBitmap(image: IKittyImageData): Promise {\n let bytes: Uint8Array = new Uint8Array(await image.data.arrayBuffer());\n\n if (image.compression === KittyCompression.ZLIB) {\n bytes = await this._decompressZlib(bytes);\n }\n\n if (image.format === KittyFormat.PNG) {\n const metrics = imageType(bytes);\n // IHDR dimensions are parsed with signed shifts, so a value >= 0x80000000 comes\n // back negative and a bare `>` pixel-limit test passes it; require positive.\n if (metrics.mime !== 'image/png' || !(metrics.width > 0) || !(metrics.height > 0) || metrics.width * metrics.height > this._opts.pixelLimit) {\n throw new RangeError('PNG exceeds pixel limit or has invalid dimensions');\n }\n const blob = new Blob([bytes as BlobPart], { type: 'image/png' });\n if (!window.createImageBitmap) {\n const url = URL.createObjectURL(blob);\n const img = new Image();\n return new Promise((resolve, reject) => {\n img.addEventListener('load', () => {\n URL.revokeObjectURL(url);\n const canvas = ImageRenderer.createCanvas(window.document, img.width, img.height);\n canvas.getContext('2d')?.drawImage(img, 0, 0);\n createImageBitmap(canvas).then(resolve).catch(reject);\n });\n img.addEventListener('error', () => {\n URL.revokeObjectURL(url);\n reject(new Error('Failed to load image'));\n });\n img.src = url;\n });\n }\n return createImageBitmap(blob);\n }\n\n // Raw pixel data\n const width = image.width;\n const height = image.height;\n\n if (!width || !height) {\n throw new Error('Width and height required for raw pixel data');\n }\n\n const bytesPerPixel = image.format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n throw new Error('Insufficient pixel data');\n }\n\n const pixelCount = width * height;\n\n if (image.format === KittyFormat.RGBA) {\n // RGBA: use bytes directly — no copy needed\n return createImageBitmap(new ImageData(new Uint8ClampedArray(bytes.buffer as ArrayBuffer, bytes.byteOffset, pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA), width, height));\n }\n\n // RGB→RGBA: interleave alpha using uint32 block processing (4 pixels per iteration).\n // 3 uint32 reads + 4 uint32 writes per 4 pixels vs 28 byte reads/writes — ~6x faster.\n // Assumes little-endian (all modern browsers/Node.js).\n const data = new Uint8ClampedArray(pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA);\n const src32 = new Uint32Array(bytes.buffer, bytes.byteOffset, Math.floor(bytes.byteLength / 4));\n const dst32 = new Uint32Array(data.buffer);\n const alignedPixels = pixelCount & ~3; // round down to multiple of 4\n\n let srcOffset = 0;\n let dstOffset = 0;\n for (let i = 0; i < alignedPixels; i += 4) {\n const b0 = src32[srcOffset++];\n const b1 = src32[srcOffset++];\n const b2 = src32[srcOffset++];\n // Little-endian: pixel bytes are [R,G,B] → uint32 ABGR layout\n dst32[dstOffset++] = 0xFF000000 | b0;\n dst32[dstOffset++] = 0xFF000000 | (b0 >>> 24) | (b1 << 8);\n dst32[dstOffset++] = 0xFF000000 | (b1 >>> 16) | (b2 << 16);\n dst32[dstOffset++] = 0xFF000000 | (b2 >>> 8);\n }\n\n // Handle remaining 1–3 pixels\n let srcByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n let dstByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n for (let i = alignedPixels; i < pixelCount; i++) {\n data[dstByte] = bytes[srcByte];\n data[dstByte + 1] = bytes[srcByte + 1];\n data[dstByte + 2] = bytes[srcByte + 2];\n data[dstByte + 3] = KittyPixelConstants.ALPHA_OPAQUE;\n srcByte += KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n dstByte += KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n }\n\n return createImageBitmap(new ImageData(data, width, height));\n }\n\n private async _decompressZlib(compressed: Uint8Array): Promise {\n try {\n return await this._decompress(compressed, 'deflate');\n } catch (error) {\n if (error instanceof RangeError) throw error;\n return await this._decompress(compressed, 'deflate-raw');\n }\n }\n\n private async _decompress(compressed: Uint8Array, format: 'deflate' | 'deflate-raw'): Promise {\n const limit = Math.min(this._opts.kittySizeLimit, this._opts.pixelLimit * 4, this._opts.storageLimit * 1000000);\n let offsetIn = 0;\n // Bound inflation within one native transform before its output is budgeted.\n const source = new ReadableStream({\n pull(controller) {\n if (offsetIn >= compressed.length) {\n controller.close();\n return;\n }\n const end = Math.min(offsetIn + 4096, compressed.length);\n controller.enqueue(new Uint8Array(compressed.subarray(offsetIn, end)));\n offsetIn = end;\n }\n });\n const reader = source.pipeThrough(new DecompressionStream(format)).getReader();\n const chunks: Uint8Array[] = [];\n let totalLength = 0;\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n totalLength += value.byteLength;\n if (totalLength > limit) {\n await reader.cancel().catch(() => {});\n throw new RangeError('decompressed image exceeds byte limit');\n }\n chunks.push(value);\n }\n } finally {\n reader.releaseLock();\n }\n\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n }\n\n public get images(): ReadonlyMap {\n return this._kittyStorage.images;\n }\n\n public get _kittyIdToStorageId(): ReadonlyMap {\n return this._kittyStorage.kittyIdToStorageId;\n }\n\n public get pendingTransmissions(): ReadonlyMap {\n return this._pendingTransmissions;\n }\n}\n","/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Kitty graphics protocol types, constants, and parsing utilities.\n */\n\nimport type Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\n\n// Kitty graphics protocol action types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'a'.\nexport const enum KittyAction {\n TRANSMIT = 't',\n TRANSMIT_DISPLAY = 'T',\n QUERY = 'q',\n PLACEMENT = 'p',\n DELETE = 'd'\n}\n\n// Kitty graphics protocol format types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyFormat {\n RGB = 24,\n RGBA = 32,\n PNG = 100\n}\n\n// Kitty graphics protocol compression types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'o'.\nexport const enum KittyCompression {\n NONE = '',\n ZLIB = 'z'\n}\n\n// Kitty graphics protocol control data keys.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyKey {\n // Action to perform (t=transmit, T=transmit+display, q=query, p=placement, d=delete)\n ACTION = 'a',\n // Image format (24=RGB, 32=RGBA, 100=PNG)\n FORMAT = 'f',\n // Image ID for referencing stored images\n ID = 'i',\n // Image number (alternative to ID, terminal assigns ID)\n IMAGE_NUMBER = 'I',\n // Source image width in pixels\n WIDTH = 's',\n // Source image height in pixels\n HEIGHT = 'v',\n // The left edge (in pixels) of the image area to display\n X_OFFSET = 'x',\n // The top edge (in pixels) of the image area to display\n Y_OFFSET = 'y',\n // Width (in pixels) of the source rectangle to display\n SOURCE_WIDTH = 'w',\n // Height (in pixels) of the source rectangle to display\n SOURCE_HEIGHT = 'h',\n // Horizontal offset (in pixels) within the first cell\n X_PLACEMENT_OFFSET = 'X',\n // Vertical offset (in pixels) within the first cell\n Y_PLACEMENT_OFFSET = 'Y',\n // Number of terminal columns to display the image over\n COLUMNS = 'c',\n // Number of terminal rows to display the image over\n ROWS = 'r',\n // More data flag (1=more chunks coming, 0=final chunk)\n MORE = 'm',\n // Compression type (z=zlib). This is essential for chunking larger images.\n COMPRESSION = 'o',\n // Quiet mode (1=suppress OK responses, 2=suppress error responses)\n QUIET = 'q',\n // Cursor movement policy (0=move cursor after image, 1=don't move cursor)\n CURSOR_MOVEMENT = 'C',\n // Z-index for image layering (negative = behind text, 0+ = on top)\n Z_INDEX = 'z',\n // Transmission medium (d=direct, f=file, t=temp file, s=shared memory)\n TRANSMISSION = 't',\n // Delete selector (a/A=all, i/I=by id, c/C=at cursor, etc.) — only used when a=d\n DELETE_SELECTOR = 'd',\n // Placement ID for targeting specific placements\n PLACEMENT_ID = 'p'\n}\n\n// Pixel format constants\nexport const enum KittyPixelConstants {\n BYTES_PER_PIXEL_RGB = 3,\n BYTES_PER_PIXEL_RGBA = 4,\n ALPHA_OPAQUE = 255\n}\n\n// Parsed Kitty graphics command.\nexport interface IKittyCommand {\n action?: string;\n format?: number;\n id?: number;\n imageNumber?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n sourceWidth?: number;\n sourceHeight?: number;\n xOffset?: number;\n yOffset?: number;\n columns?: number;\n rows?: number;\n more?: number;\n quiet?: number;\n cursorMovement?: number;\n zIndex?: number;\n transmission?: string;\n deleteSelector?: string;\n placementId?: number;\n compression?: string;\n payload?: string;\n}\n\n// Pending chunked transmission state.\n// Stores metadata from the first chunk while accumulating decoded payload data.\nexport interface IPendingTransmission {\n // The parsed command from the first chunk (contains action, format, dimensions, etc.)\n cmd: IKittyCommand;\n // Decoder used across chunked payloads\n decoder: Base64Decoder;\n // Total encoded (base64) bytes received across all chunks - for size limit enforcement\n totalEncodedSize: number;\n // Whether any chunk has failed to decode\n decodeError: boolean;\n}\n\n// Stored Kitty image data.\nexport interface IKittyImageData {\n id: number;\n // Decoded image data stored as Blob (off JS heap) to avoid 2GB heap limit\n data: Blob;\n width: number;\n height: number;\n format: 24 | 32 | 100;\n compression?: string;\n}\n\n// Parses Kitty graphics control data into a command object.\nexport function parseKittyCommand(data: string): IKittyCommand {\n const cmd: IKittyCommand = {};\n const parts = data.split(',');\n\n for (const part of parts) {\n const eqIdx = part.indexOf('=');\n if (eqIdx === -1) continue;\n\n const key = part.substring(0, eqIdx);\n const value = part.substring(eqIdx + 1);\n\n // Handle string keys first\n if (key === KittyKey.ACTION) {\n cmd.action = value;\n continue;\n }\n if (key === KittyKey.COMPRESSION) {\n cmd.compression = value;\n continue;\n }\n if (key === KittyKey.TRANSMISSION) {\n cmd.transmission = value;\n continue;\n }\n if (key === KittyKey.DELETE_SELECTOR) {\n cmd.deleteSelector = value;\n continue;\n }\n const numValue = parseInt(value, 10);\n switch (key) {\n case KittyKey.FORMAT: cmd.format = numValue; break;\n case KittyKey.ID: cmd.id = numValue; break;\n case KittyKey.IMAGE_NUMBER: cmd.imageNumber = numValue; break;\n case KittyKey.WIDTH: cmd.width = numValue; break;\n case KittyKey.HEIGHT: cmd.height = numValue; break;\n case KittyKey.X_OFFSET: cmd.x = numValue; break;\n case KittyKey.Y_OFFSET: cmd.y = numValue; break;\n case KittyKey.SOURCE_WIDTH: cmd.sourceWidth = numValue; break;\n case KittyKey.SOURCE_HEIGHT: cmd.sourceHeight = numValue; break;\n case KittyKey.X_PLACEMENT_OFFSET: cmd.xOffset = numValue; break;\n case KittyKey.Y_PLACEMENT_OFFSET: cmd.yOffset = numValue; break;\n case KittyKey.COLUMNS: cmd.columns = numValue; break;\n case KittyKey.ROWS: cmd.rows = numValue; break;\n case KittyKey.MORE: cmd.more = numValue; break;\n case KittyKey.QUIET: cmd.quiet = numValue; break;\n case KittyKey.CURSOR_MOVEMENT: cmd.cursorMovement = numValue; break;\n case KittyKey.Z_INDEX: cmd.zIndex = numValue; break;\n case KittyKey.PLACEMENT_ID: cmd.placementId = numValue; break;\n }\n }\n\n return cmd;\n}\n","/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageStorage } from '../ImageStorage';\nimport { ImageLayer, IAddImageOpts } from '../Types';\nimport { IKittyImageData } from './KittyGraphicsTypes';\n\n// Kitty-specific image storage controller.\n//\n// Wraps shared ImageStorage with kitty protocol semantics:\n// - tracks transmitted image payloads by kitty image id\n// - tracks kitty image id -> shared ImageStorage id mapping for displayed images\n// - mirrors shared-storage evictions into kitty maps\n// - applies protocol-level undisplayed-image eviction policy\nexport class KittyImageStorage implements IDisposable {\n private static readonly _maxStoredImages = 256;\n\n private _nextImageId = 1;\n private readonly _images: Map = new Map();\n // TODO: Support multiple placements per image. The kitty spec identifies\n // placements by an (image id, placement id) pair — same i + different p\n // values should coexist, and same i + same p should replace the prior\n // placement. Currently we track only one storage entry per kitty image id,\n // so multiple placements of the same image overwrite each other. Fixing\n // this requires changing these maps to Map>\n // (kittyId → placementId → storageId) and updating addImage/deleteById\n // accordingly. The underlying shared ImageStorage would also need to\n // support multiple entries per logical image.\n private readonly _kittyIdToStorageId: Map = new Map();\n private readonly _storageIdToKittyId: Map = new Map();\n\n private readonly _previousOnImageDeleted: ((storageId: number) => void) | undefined;\n private readonly _wrappedOnImageDeleted: (storageId: number) => void;\n private readonly _handleStorageImageDeleted = (storageId: number): void => {\n const kittyId = this._storageIdToKittyId.get(storageId);\n if (kittyId !== undefined) {\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n this._images.delete(kittyId);\n }\n };\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n\n constructor(\n private readonly _storage: ImageStorage\n ) {\n this._previousOnImageDeleted = this._storage.onImageDeleted;\n this._wrappedOnImageDeleted = (storageId: number) => {\n this._previousOnImageDeleted?.(storageId);\n this._handleStorageImageDeleted(storageId);\n };\n this._storage.onImageDeleted = this._wrappedOnImageDeleted;\n }\n\n public reset(): void {\n this._nextImageId = 1;\n this._images.clear();\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public dispose(): void {\n this.reset();\n if (this._storage.onImageDeleted === this._wrappedOnImageDeleted) {\n this._storage.onImageDeleted = this._previousOnImageDeleted;\n }\n }\n\n public storeImage(id: number | undefined, imageData: Omit): number {\n const imageId = id ?? this._nextImageId++;\n\n const oldStorageId = this._kittyIdToStorageId.get(imageId);\n if (oldStorageId !== undefined) {\n this._storage.deleteImage(oldStorageId);\n this._kittyIdToStorageId.delete(imageId);\n this._storageIdToKittyId.delete(oldStorageId);\n }\n\n if (!this._images.has(imageId) && this._images.size >= KittyImageStorage._maxStoredImages) {\n this._evictUndisplayedImages();\n }\n\n // Encoded images awaiting placement are outside ImageStorage's pixel budget.\n // Unplaced payloads are evicted first so a new upload cannot erase a visible\n // image while abandoned blobs still hold budget; placed ones go only when\n // that is not enough, because the byte cap is a hard bound. The new image is\n // always stored, so an oversized one overshoots by at most one payload\n // (itself bounded by kittySizeLimit) rather than being dropped after an OK ack.\n const byteLimit = this._storage.getLimit() * 1000000;\n this._images.delete(imageId);\n let retainedBytes = 0;\n for (const image of this._images.values()) retainedBytes += image.data.size;\n for (const evictPlaced of [false, true]) {\n for (const [oldestId, image] of this._images) {\n if (retainedBytes + imageData.data.size <= byteLimit) break;\n if (this._kittyIdToStorageId.has(oldestId) !== evictPlaced) continue;\n retainedBytes -= image.data.size;\n this.deleteById(oldestId);\n }\n }\n\n this._images.set(imageId, {\n ...imageData,\n id: imageId\n });\n return imageId;\n }\n\n public addImage(kittyId: number, image: HTMLCanvasElement | ImageBitmap, scrolling: boolean, layer: ImageLayer, zIndex: number): void {\n // Clean up stale reverse-mapping from a previous placement of the same\n // kitty image. The old shared-storage entry is kept (it may still be\n // visible on screen) but its reverse mapping is removed so that eviction\n // of the old entry won't incorrectly delete the kitty image data.\n const oldStorageId = this._kittyIdToStorageId.get(kittyId);\n if (oldStorageId !== undefined) {\n this._storageIdToKittyId.delete(oldStorageId);\n }\n this._addImageOpts.scrolling = scrolling;\n this._addImageOpts.layer = layer;\n this._addImageOpts.zIndex = zIndex;\n const storageId = this._storage.addImage(image, this._addImageOpts);\n this._kittyIdToStorageId.set(kittyId, storageId);\n this._storageIdToKittyId.set(storageId, kittyId);\n }\n\n public getImage(kittyId: number): IKittyImageData | undefined {\n return this._images.get(kittyId);\n }\n\n public deleteById(kittyId: number): void {\n this._images.delete(kittyId);\n const storageId = this._kittyIdToStorageId.get(kittyId);\n if (storageId !== undefined) {\n this._storage.deleteImage(storageId);\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n }\n }\n\n public deleteAll(): void {\n this._images.clear();\n for (const storageId of this._kittyIdToStorageId.values()) {\n this._storage.deleteImage(storageId);\n }\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public get images(): ReadonlyMap {\n return this._images;\n }\n\n public get kittyIdToStorageId(): ReadonlyMap {\n return this._kittyIdToStorageId;\n }\n\n public get lastImageId(): number {\n return this._nextImageId - 1;\n }\n\n private _evictUndisplayedImages(): void {\n for (const [kittyId] of this._images) {\n if (this._images.size <= KittyImageStorage._maxStoredImages / 2) {\n break;\n }\n if (!this._kittyIdToStorageId.has(kittyId)) {\n this._images.delete(kittyId);\n }\n }\n }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023, 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\n/**\n * wasm base64 decoder.\n */\nconst wasmDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#828e69684093b2c6:rdef-start:\"decode\"*/{s:1,t:0,d:'AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML'}/*inwasm#828e69684093b2c6:rdef-end:\"decode\"*/);\n// SIMD version (speedup ~1.4x, not covered by tests yet)\n/*\nconst wasmDecode = InWasm({\n name: 'decode',\n type: OutputType.INSTANCE,\n mode: OutputMode.SYNC,\n srctype: 'Clang-C',\n imports: {\n env: { memory: new WebAssembly.Memory({ initial: 1 }) }\n },\n exports: {\n dec: () => 0,\n end: () => 0\n },\n compile: {\n switches: ['-msimd128', '-Wl,-z,stack-size=0', '-Wl,--stack-first']\n },\n code: `\n #include \n typedef struct {\n unsigned int wp;\n unsigned int sp;\n unsigned int dp;\n unsigned int e_size;\n unsigned int dummy[4];\n unsigned char data[0];\n } State;\n\n unsigned int *D0 = (unsigned int *) ${P32.D0 * 4};\n unsigned int *D1 = (unsigned int *) ${P32.D1 * 4};\n unsigned int *D2 = (unsigned int *) ${P32.D2 * 4};\n unsigned int *D3 = (unsigned int *) ${P32.D3 * 4};\n State *state = (State *) ${P32.STATE * 4};\n\n #define packed_byte(x) wasm_i8x16_splat((char) x)\n #define packed_dword(x) wasm_i32x4_splat(x)\n #define masked(x, mask) wasm_v128_and(x, wasm_i32x4_splat(mask))\n\n __attribute__((noinline)) int dec() {\n unsigned int nsp = (state->wp - 1) & ~3;\n unsigned char *src = state->data + state->sp;\n unsigned char *end = state->data + nsp;\n unsigned char *dst = state->data + state->dp;\n unsigned int error = 0;\n\n v128_t err = wasm_i8x16_splat(0);\n unsigned char *end16 = state->data + (nsp & ~15);\n while (src < end16) {\n v128_t data = wasm_v128_load((v128_t *) src);\n\n // wasm-simd rewrite of http://0x80.pl/notesen/2016-01-17-sse-base64-decoding.html#vector-lookup-pshufb\n const v128_t higher_nibble = wasm_u32x4_shr(data, 4) & packed_byte(0x0f);\n const char linv = 1;\n const char hinv = 0;\n\n const v128_t lower_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n linv, linv, 0x2b, 0x30,\n 0x41, 0x50, 0x61, 0x70,\n linv, linv, linv, linv,\n linv, linv, linv, linv\n );\n const v128_t upper_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n hinv, hinv, 0x2b, 0x39,\n 0x4f, 0x5a, 0x6f, 0x7a,\n hinv, hinv, hinv, hinv,\n hinv, hinv, hinv, hinv\n );\n // the difference between the shift and lower bound\n const v128_t shift_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n 0x00, 0x00, 0x3e - 0x2b, 0x34 - 0x30,\n 0x00 - 0x41, 0x0f - 0x50, 0x1a - 0x61, 0x29 - 0x70,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00\n );\n\n const v128_t upper_bound = wasm_i8x16_swizzle(upper_bound_LUT, higher_nibble);\n const v128_t lower_bound = wasm_i8x16_swizzle(lower_bound_LUT, higher_nibble);\n\n const v128_t below = wasm_i8x16_lt(data, lower_bound);\n const v128_t above = wasm_i8x16_gt(data, upper_bound);\n const v128_t eq_2f = wasm_i8x16_eq(data, packed_byte(0x2f));\n\n // in_range = not (below or above) or eq_2f\n // outside = not in_range = below or above and not eq_2f (from deMorgan law)\n const v128_t outside = wasm_v128_andnot(eq_2f, above | below);\n err = wasm_v128_or(err, outside);\n\n const v128_t shift = wasm_i8x16_swizzle(shift_LUT, higher_nibble);\n const v128_t t0 = wasm_i8x16_add(data, shift);\n v128_t v = wasm_i8x16_add(t0, wasm_v128_and(eq_2f, packed_byte(-3)));\n\n // pack bytes\n const v128_t ca = masked(v, 0x003f003f);\n const v128_t db = masked(v, 0x3f003f00);\n const v128_t t00 = wasm_v128_or(wasm_u32x4_shr(db, 8), wasm_i32x4_shl(ca, 6));\n v128_t res = wasm_v128_or(wasm_u32x4_shr(t00, 16), wasm_i32x4_shl(t00, 12));\n res = wasm_i8x16_swizzle(res, wasm_i8x16_const(2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, 16, 16, 16, 16));\n\n wasm_v128_store((v128_t *) dst, res);\n dst += 12;\n src += 16;\n }\n //if (wasm_i8x16_bitmask(err) != 0) return -1;\n if (wasm_v128_any_true(err)) return -1;\n\n // operate on 4-byte blocks\n while (src < end) {\n error |= *((unsigned int *) dst) = D0[src[0]] | D1[src[1]] | D2[src[2]] | D3[src[3]];\n dst += 3;\n src += 4;\n }\n if (error >> 24) return -1;\n state->sp = nsp;\n state->dp = dst - state->data;\n return 0;\n }\n\n int end() {\n int rem = state->wp - state->sp;\n if (rem > 4 && dec()) return -1;\n rem = state->wp - state->sp;\n if (rem < 2) return -1;\n\n unsigned char *src = state->data + state->sp;\n if (rem == 4) {\n if (src[3] == 61) rem--;\n if (src[2] == 61) rem--;\n }\n unsigned int accu = D0[src[0]] | D1[src[1]];\n int dp = 1;\n if (rem > 2) {\n accu |= D2[src[2]];\n dp++;\n if (rem == 4) {\n accu |= D3[src[3]];\n dp++;\n }\n }\n if (accu >> 24) return -1;\n *((unsigned int *) (state->data + state->dp)) = accu;\n state->dp += dp;\n return 0;\n }\n `\n});\n*/\n// base64 map\nconst MAP = new Uint8Array('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n .split('')\n .map(el => el.charCodeAt(0)));\n// init decoder maps in LE order\nconst D = new Uint32Array(1024);\nD.fill(0xFF000000);\nfor (let i = 0; i < MAP.length; ++i)\n D[MAP[i]] = i << 2;\nfor (let i = 0; i < MAP.length; ++i)\n D[256 + MAP[i]] = i >> 4 | ((i << 4) & 0xFF) << 8;\nfor (let i = 0; i < MAP.length; ++i)\n D[512 + MAP[i]] = (i >> 2) << 8 | ((i << 6) & 0xFF) << 16;\nfor (let i = 0; i < MAP.length; ++i)\n D[768 + MAP[i]] = i << 16;\nconst EMPTY = new Uint8Array(0);\n/**\n * base64 stream decoder.\n *\n * Features / assumptions:\n * - lazy chunkwise decoding\n * - errors out on any non base64 chars (no support for NL formatted base64)\n * - decodes in wasm\n * - inplace decoding to save memory\n * - supports a keepSize for lazy memory release\n */\nclass Base64Decoder {\n /**\n * @param keepSize Keep the wasm instance below this limit when calling `release()`.\n * @param maxBytes Max allowed bytes to allocate.\n * @param initialBytes Initial bytes to allocate.\n */\n constructor(keepSize, maxBytes, initialBytes) {\n this._inst = null;\n this._ended = true;\n this._bytes = 0;\n this.keepSize = keepSize !== null && keepSize !== void 0 ? keepSize : 1048576 /* Bytes.KEEP */;\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : 4294901760 /* Bytes.MAX */;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : 32768 /* Bytes.INITIAL */;\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw new Error('invalid byte settings');\n }\n }\n /**\n * Currently decoded bytes (borrowed).\n * Must be accessed before calling `release` or `init`.\n */\n get data8() {\n return this._inst ? this._d.subarray(0, this._m32[1282 /* P32.STATE_DP */]) : EMPTY;\n }\n /**\n * Release memory conditionally based on `keepSize`.\n * If memory gets released, also the wasm instance will be freed and recreated on next `init`,\n * otherwise the instance will be reused.\n */\n release() {\n if (!this._inst)\n return;\n if (this._bytes > this.keepSize) {\n this._inst = this._m32 = this._d = this._mem = null;\n }\n else {\n this._m32[1280 /* P32.STATE_WP */] = 0;\n this._m32[1281 /* P32.STATE_SP */] = 0;\n this._m32[1282 /* P32.STATE_DP */] = 0;\n }\n }\n /**\n * Initializes the decoder for new base64 data.\n * Must be called before doing any decoding attempts.\n * The method will either spawn a new wasm instance or grow\n * the needed memory of an existing instance.\n * @param maxBytes Max allowed bytes to allocate (overwrites ctor value).\n * @param initialBytes Initial bytes to allocate (overwrites ctor value).\n */\n init(maxBytes, initialBytes) {\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : this.maxBytes;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : Math.min(this._bytes, this.maxBytes);\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw Error('invalid byte settings');\n }\n let m = this._m32;\n const bytes = this._bytes + 5152 /* Bytes._DATA_OFFSET */;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmDecode({ env: { memory: this._mem } });\n m = new Uint32Array(this._mem.buffer, 0);\n m.set(D, 256 /* P32.D0 */);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n m = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n m[1280 /* P32.STATE_WP */] = 0;\n m[1281 /* P32.STATE_SP */] = 0;\n m[1282 /* P32.STATE_DP */] = 0;\n this._m32 = m;\n this._ended = false;\n }\n /**\n * Realloc memory. Realloc only happens, if the requested\n * size doesn't fit in the current memory.\n * The new size will be capped by `maxBytes`.\n * @param requested Bytes to be stored.\n */\n _realloc(requested) {\n const needed = this._m32[1280 /* P32.STATE_WP */] + requested;\n if (this._bytes < needed) {\n if (needed > this.maxBytes) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n let newSize = this._bytes;\n while ((newSize *= 2) < needed) { }\n newSize = Math.min(newSize, this.maxBytes);\n if (newSize < needed) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n if (newSize + 5152 /* Bytes._DATA_OFFSET */ > this._mem.buffer.byteLength) {\n const addPages = Math.ceil((newSize + 5152 /* Bytes._DATA_OFFSET */ - this._mem.buffer.byteLength) / 65536);\n this._mem.grow(addPages);\n this._m32 = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n this._bytes = newSize;\n }\n return 0 /* DecodeStatus.OK */;\n }\n /**\n * Put bytes in `data` into the decoder.\n * Additionally decodes the payload, if it reached 2^17 bytes.\n * The return value indicates the type of issue.\n * @param data Bytes to be loaded.\n */\n put(data) {\n if (!this._inst || this._ended) {\n return -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n if (this._realloc(data.length)) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n const m = this._m32;\n this._d.set(data, m[1280 /* P32.STATE_WP */]);\n m[1280 /* P32.STATE_WP */] += data.length;\n // max chunk in input handler is 2^17, try to run in \"tandem mode\"\n return m[1280 /* P32.STATE_WP */] - m[1281 /* P32.STATE_SP */] >= 131072\n ? this._inst.exports.dec()\n : 0 /* DecodeStatus.OK */;\n }\n /**\n * End the current decoding.\n * Also decodes leftover payload from previous put calls.\n */\n end() {\n this._ended = true;\n return this._inst\n ? this._inst.exports.end()\n : -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n /**\n * Bytes loaded into the decoder.\n */\n get loadedBytes() {\n return this._inst\n ? this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n /**\n * Free bytes to feed to the decoder.\n */\n get freeBytes() {\n return this._inst\n ? this.maxBytes - this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n}\nexports.default = Base64Decoder;\n//# sourceMappingURL=Base64Decoder.wasm.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\nconst wasmQoiDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#459f9e1bfb80b1a8:rdef-start:\"qoi_decode\"*/{s:1,t:0,d:'AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=='}/*inwasm#459f9e1bfb80b1a8:rdef-end:\"qoi_decode\"*/);\nclass QoiDecoder {\n constructor(keepSize) {\n this.keepSize = keepSize;\n this.width = 0;\n this.height = 0;\n }\n decode(d) {\n this.width = d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7];\n this.height = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];\n const pixels = this.width * this.height;\n const ib = pixels * 4;\n const dl = d.length;\n /**\n * byte/offset calculation:\n * To save some memory we dont reserve full memory for decoded + encoded,\n * but place encoded at the end of decoded plus 50% security distance\n * to avoid reads before writes positions:\n *\n * encoded < decoded (good compression)\n * enc ####################\n * dec #######################################\n * ^ ^\n * DST_P CHUNK_P\n *\n * encoded > decoded (degenerated compression, should not happen)\n * enc ##############################\n * dec ####################\n * ^ ^\n * DST_P CHUNK_P\n *\n * There is still a chance for overlapping r/w positions in case the compressed\n * data has very different pixel progression, yet the 50% security distance\n * should deal with that, as QOI will bloat data by 25% at max (RGB -> OP byte + RGB).\n * Since we always assume RGBA at decoding stage, the possible bloat reduces to 20% at max.\n */\n const bytes = Math.max(ib, dl) + (Math.min(ib, dl) >> 1) + 4096;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmQoiDecode({ env: { memory: this._mem } });\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n this._d = null;\n }\n if (!this._d) {\n this._d = new Uint8Array(this._mem.buffer);\n }\n // put src data at the end of memory, also align to 256\n const chunkP = (this._mem.buffer.byteLength - dl) & ~0xFF;\n this._d.set(d, chunkP);\n this._inst.exports.dec(chunkP, dl, pixels);\n return this._d.subarray(1024 /* P8.DST_P */, 1024 /* P8.DST_P */ + ib);\n }\n release() {\n if (!this._inst)\n return;\n if (this._mem.buffer.byteLength > this.keepSize) {\n this._inst = this._d = this._mem = null;\n }\n }\n}\nexports.default = QoiDecoder;\n//# sourceMappingURL=QoiDecoder.wasm.js.map","\"use strict\";\n/**\n * Copyright (c) 2022, 2026 Joerg Breitbart\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InWasm = InWasm;\nlet z = (s) => {\n if (Uint8Array.fromBase64)\n return Uint8Array.fromBase64(s);\n if (typeof Buffer !== 'undefined')\n return Buffer.from(s, 'base64');\n const b = atob(s);\n const r = new Uint8Array(b.length);\n for (let i = 0; i < r.length; ++i)\n r[i] = b.charCodeAt(i);\n return r;\n};\nfunction InWasm(def) {\n if (def.d) {\n const { t, s, d } = def;\n let b;\n let m;\n const W = WebAssembly;\n if (t === 0 /* OutputType.INSTANCE */) {\n if (s)\n return (e) => new W.Instance(m || (m = new W.Module(b || (b = z(d)))), e);\n return (e) => m\n ? W.instantiate(m, e)\n : W.instantiate(b || (b = z(d)), e).then(r => (m = r.module) && r.instance);\n }\n if (t === 1 /* OutputType.MODULE */) {\n if (s)\n return () => m || (m = new W.Module(b || (b = z(d))));\n return () => m\n ? Promise.resolve(m)\n : W.compile(b || (b = z(d))).then(r => m = r);\n }\n if (s)\n return () => b || (b = z(d));\n return () => Promise.resolve(b || (b = z(d)));\n }\n if (typeof _wasmCtx === 'undefined')\n throw new Error('must run \"inwasm\"');\n _wasmCtx.add(def);\n}\n//# sourceMappingURL=index.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport type { ITerminalAddon, IDisposable } from '@xterm/xterm';\nimport type { ImageAddon as IImageApi } from '@xterm/addon-image';\nimport { Emitter, type IEvent } from 'common/Event';\nimport { IIPHandler } from './IIPHandler';\nimport { ImageRenderer } from './ImageRenderer';\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { KittyGraphicsHandler } from './kitty/KittyGraphicsHandler';\nimport { KittyImageStorage } from './kitty/KittyImageStorage';\nimport { SixelHandler } from './SixelHandler';\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { ITerminalExt, IImageAddonOptions, IResetHandler } from './Types';\n\n\n/**\n * Document VT features provided by this addon.\n *\n * @vt: #E[Supported via @xterm/addon-image.] DCS SIXEL \"SIXEL Graphics\" \"DCS Ps ; Ps ; Ps ; q Pt ST\" \"Draw SIXEL image.\"\n *\n * Sixel support is provided by the addon @xterm/addon-image with these limitations:\n * - immediate coloring (no shared palette, allows high color settings of `img2sixel`)\n * - max. palette size of 4096 colors\n * - max. pixel width of 16K\n * - max. 25 MB per sixel sequence\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] OSC 1337 \"iTerm2 Commands\" \"OSC 1337 ; Pt BEL\" \"Custom iTerm2 commands.\"\n *\n * Only the inline image protocol (IIP) is supported by the addon @xterm/addon-image with\n * the following limitations:\n * - sequence:\n * - format: `OSC 1337 ; File=inline=1 ; size= ; ... : BEL`\n * - size param must be set and payload may not exceed CEIL(size * 4 / 3)\n * - strict base64 handling as of RFC4648 §4 (standard alphabet, optional padding,\n * no separator bytes allowed)\n * - supported params: size, name, width, height, preserveAspectRatio\n * - image formats: PNG, JPEG and GIF\n * - no animation support (renders first image of a GIF)\n * - no multipart support\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image)\n * and [iTerm2 IIP docs](https://iterm2.com/documentation-images.html) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] APC KITTY_GRAPHICS \"Kitty Graphics\" \"APC G Pt ST\" \"Kitty Graphics Protocol.\"\n *\n * Kitty graphics support is provided by the addon @xterm/addon-image.\n * Note that while basic image output already works, this is still work in progress.\n */\n\n// default values of addon ctor options\nconst DEFAULT_OPTIONS: IImageAddonOptions = {\n enableSizeReports: true,\n pixelLimit: 16777216, // limit to 4096 * 4096 pixels\n sixelSupport: true,\n sixelScrolling: true,\n sixelPaletteLimit: 4096,\n sixelSizeLimit: 33554432,\n storageLimit: 128,\n showPlaceholder: true,\n iipSupport: true,\n iipSizeLimit: 33554432,\n kittySupport: true,\n kittySizeLimit: 33554432\n};\n\n// max palette size supported by the sixel lib (compile time setting)\nconst MAX_SIXEL_PALETTE_SIZE = 4096;\n\n// definitions for _xtermGraphicsAttributes sequence\nconst enum GaItem {\n COLORS = 1,\n SIXEL_GEO = 2,\n REGIS_GEO = 3\n}\nconst enum GaAction {\n READ = 1,\n SET_DEFAULT = 2,\n SET = 3,\n READ_MAX = 4\n}\nconst enum GaStatus {\n SUCCESS = 0,\n ITEM_ERROR = 1,\n ACTION_ERROR = 2,\n FAILURE = 3\n}\n\n\nexport class ImageAddon implements ITerminalAddon, IImageApi {\n private _opts: IImageAddonOptions;\n private _defaultOpts: IImageAddonOptions;\n private _storage: ImageStorage | undefined;\n private _renderer: ImageRenderer | undefined;\n private _disposables: IDisposable[] = [];\n private _terminal: ITerminalExt | undefined;\n private _handlers: Map = new Map();\n private readonly _onImageAdded = new Emitter();\n public readonly onImageAdded: IEvent = this._onImageAdded.event;\n\n constructor(opts?: Partial) {\n this._opts = Object.assign({}, DEFAULT_OPTIONS, opts);\n this._defaultOpts = Object.assign({}, DEFAULT_OPTIONS, opts);\n }\n\n public dispose(): void {\n for (const handler of this._handlers.values()) handler.reset();\n for (const obj of this._disposables) {\n obj.dispose();\n }\n this._disposables.length = 0;\n this._handlers.clear();\n this._onImageAdded.dispose();\n }\n\n private _disposeLater(...args: IDisposable[]): void {\n for (const obj of args) {\n this._disposables.push(obj);\n }\n }\n\n public activate(terminal: ITerminalExt): void {\n this._terminal = terminal;\n\n // internal data structures\n this._renderer = new ImageRenderer(terminal);\n this._storage = new ImageStorage(terminal, this._renderer, this._opts);\n this._storage.onImageAdded = () => this._onImageAdded.fire();\n\n // enable size reports\n if (this._opts.enableSizeReports) {\n const windowOps = terminal.options.windowOptions ?? {};\n windowOps.getWinSizePixels = true;\n windowOps.getCellSizePixels = true;\n windowOps.getWinSizeChars = true;\n terminal.options.windowOptions = windowOps;\n }\n\n this._disposeLater(\n this._renderer,\n this._storage,\n\n // DECSET/DECRST/DA1/XTSMGRAPHICS handlers\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'h' }, params => this._decset(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'l' }, params => this._decrst(params)),\n terminal.parser.registerCsiHandler({ final: 'c' }, params => this._da1(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'S' }, params => this._xtermGraphicsAttributes(params)),\n\n // render hook\n terminal.onRender(range => this._storage?.render(range)),\n\n /**\n * reset handlers covered:\n * - DECSTR\n * - RIS\n * - Terminal.reset()\n */\n terminal.parser.registerCsiHandler({ intermediates: '!', final: 'p' }, () => this.reset()),\n terminal.parser.registerEscHandler({ final: 'c' }, () => this.reset()),\n terminal._core._inputHandler.onRequestReset(() => this.reset()),\n\n // wipe canvas and delete alternate images on buffer switch\n terminal.buffer.onBufferChange(() => this._storage?.wipeAlternate()),\n\n // extend images to the right on resize\n terminal.onResize(metrics => this._storage?.viewportResize(metrics))\n );\n\n // SIXEL handler\n if (this._opts.sixelSupport) {\n const sixelStorage = new SixelImageStorage(this._storage!, this._opts, this._renderer!, terminal);\n const sixelHandler = new SixelHandler(this._opts, sixelStorage, terminal);\n this._handlers.set('sixel', sixelHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerDcsHandler({ final: 'q' }, sixelHandler)\n );\n }\n\n // iTerm IIP handler\n if (this._opts.iipSupport) {\n const iipStorage = new IIPImageStorage(this._storage!);\n const iipHandler = new IIPHandler(this._opts, this._renderer!, iipStorage, terminal);\n this._handlers.set('iip', iipHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerOscHandler(1337, iipHandler)\n );\n }\n\n // Kitty graphics handler\n if (this._opts.kittySupport) {\n const kittyStorage = new KittyImageStorage(this._storage!);\n const kittyHandler = new KittyGraphicsHandler(this._opts, this._renderer!, kittyStorage, terminal);\n this._handlers.set('kitty', kittyHandler);\n this._disposeLater(\n kittyStorage,\n kittyHandler,\n terminal._core._inputHandler._parser.registerApcHandler({ final: 'G' }, kittyHandler)\n );\n }\n }\n\n // Note: storageLimit is skipped here to not intoduce a surprising side effect.\n public reset(): boolean {\n // reset options customizable by sequences to defaults\n this._opts.sixelScrolling = this._defaultOpts.sixelScrolling;\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n // also clear image storage\n this._storage?.reset();\n // reset protocol handlers\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return false;\n }\n\n public get storageLimit(): number {\n return this._storage?.getLimit() || -1;\n }\n\n public set storageLimit(limit: number) {\n this._storage?.setLimit(limit);\n this._opts.storageLimit = limit;\n }\n\n public get storageUsage(): number {\n if (this._storage) {\n return this._storage.getUsage();\n }\n return -1;\n }\n\n public get showPlaceholder(): boolean {\n return this._opts.showPlaceholder;\n }\n\n public set showPlaceholder(value: boolean) {\n this._opts.showPlaceholder = value;\n this._renderer?.showPlaceholder(value);\n }\n\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.getImageAtBufferCell(x, y);\n }\n\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.extractTileAtBufferCell(x, y);\n }\n\n private _report(s: string): void {\n this._terminal?._core.input(s, false);\n }\n\n private _decset(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = false;\n break;\n }\n }\n return false;\n }\n\n private _decrst(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = true;\n break;\n }\n }\n return false;\n }\n\n // overload DA to return something more appropriate\n private _da1(params: (number | number[])[]): boolean {\n if (params[0]) {\n return true;\n }\n // reported features:\n // 62 - VT220\n // 4 - SIXEL support\n // 9 - charsets\n // 22 - ANSI colors\n if (this._opts.sixelSupport) {\n this._report(`\\x1b[?62;4;9;22c`);\n return true;\n }\n return false;\n }\n\n /**\n * Implementation of xterm's graphics attribute sequence.\n *\n * Supported features:\n * - read/change palette limits (max 4096 by sixel lib)\n * - read SIXEL canvas geometry (reports current window canvas or\n * squared pixelLimit if canvas > pixel limit)\n *\n * Everything else is deactivated.\n */\n private _xtermGraphicsAttributes(params: (number | number[])[]): boolean {\n if (params.length < 2) {\n return true;\n }\n if (params[0] === GaItem.COLORS) {\n switch (params[1]) {\n case GaAction.READ:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n return true;\n case GaAction.SET_DEFAULT:\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n // also reset protocol handlers for now\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return true;\n case GaAction.SET:\n if (params.length > 2 && !(params[2] instanceof Array) && params[2] <= MAX_SIXEL_PALETTE_SIZE) {\n this._opts.sixelPaletteLimit = params[2];\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n } else {\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n }\n return true;\n case GaAction.READ_MAX:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${MAX_SIXEL_PALETTE_SIZE}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n if (params[0] === GaItem.SIXEL_GEO) {\n switch (params[1]) {\n // we only implement read and read_max here\n case GaAction.READ:\n let width = this._renderer?.dimensions?.css.canvas.width;\n let height = this._renderer?.dimensions?.css.canvas.height;\n if (!width || !height) {\n // for some reason we have no working image renderer\n // --> fallback to default cell size\n const cellSize = CELL_SIZE_DEFAULT;\n width = (this._terminal?.cols || 80) * cellSize.width;\n height = (this._terminal?.rows || 24) * cellSize.height;\n }\n if (width * height < this._opts.pixelLimit) {\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${width.toFixed(0)};${height.toFixed(0)}S`);\n } else {\n // if we overflow pixelLimit report that squared instead\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n }\n return true;\n case GaAction.READ_MAX:\n // read_max returns pixelLimit as square area\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n // exit with error on ReGIS or any other requests\n this._report(`\\x1b[?${params[0]};${GaStatus.ITEM_ERROR}S`);\n return true;\n }\n}\n"],"names":["root","factory","exports","module","define","amd","globalThis","red","n","green","blue","toRGBA8888","r","g","b","a","clamp","low","high","value","Math","max","min","h2c","t1","t2","c","normalizeRGB","round","Object","defineProperty","DEFAULT_FOREGROUND","DEFAULT_BACKGROUND","PALETTE_ANSI_256","PALETTE_VT340_GREY","PALETTE_VT340_COLOR","normalizeHLS","nearestColorIndex","fromRGBA8888","alpha","BIG_ENDIAN","Uint8Array","Uint32Array","buffer","console","warn","color","palette","Number","MAX_SAFE_INTEGER","idx","i","length","dr","dg","db","d","h","l","s","v","HLStoRGB","p","push","decodeAsync","decode","Decoder","DecoderAsync","Colors_1","__webpack_require__","wasm_1","WASM_BYTES","Buffer","from","bytestring","atob","result","charCodeAt","decodeBase64","LIMITS","BYTES","WASM_MODULE","NULL_CANVAS","CallbackProxy","constructor","this","bandHandler","width","modeHandler","mode","handle_band","mode_parsed","DEFAULT_OPTIONS","memoryLimit","sixelColor","fillColor","paletteLimit","PALETTE_SIZE","truncate","opts","cbProxy","importObj","env","bind","WebAssembly","instantiate","then","inst","instance","_instance","_cbProxy","_PIXEL_OFFSET","MAX_WIDTH","_canvas","_bandWidths","_maxWidth","_minWidth","_lastOffset","_currentHeight","_opts","assign","Error","_handle_band","_initCanvas","Module","Instance","_wasm","_chunk","memory","get_chunk_address","CHUNK_SIZE","_states","get_state_address","_palette","get_palette_address","set","_pSrc","get_p0_address","init","_fillColor","_truncate","_rasterWidth","_rasterHeight","_width","_height","_level","_mode","_paletteLimit","pixels","height","release","_realloc","offset","additionalPixels","newCanvas","ceil","adv","remaining","subarray","current_width","current_height","memoryUsage","byteLength","properties","level","memUsage","rasterAttributes","numerator","denominator","data","start","end","decodeString","j","data32","currentWidth","fill","escape","final","finalOffset","bw","currentHeight","data8","Uint8ClampedArray","dec","async","Lifecycle_1","EventUtils","_listeners","_disposed","event","_event","listener","thisArgs","disposables","toDisposable","entry","fn","slice","indexOf","splice","Array","isArray","add","fire","call","listeners","len","dispose","forward","to","e","map","undefined","any","events","store","DisposableStore","runAndSubscribe","handler","initial","arg","_disposables","Set","_isDisposed","isDisposed","o","clear","Disposable","_store","_register","None","freeze","_value","ImageRenderer_1","ImageStorage_1","Base64Decoder_wasm_1","__importDefault","QoiDecoder_wasm_1","IIPHeaderParser_1","IIPMetrics_1","DEFAULT_HEADER","type","name","size","preserveAspectRatio","inline","_renderer","_storage","_coreTerminal","_generation","_aborted","_hp","HeaderParser","_header","_isMultipart","_abortMulti","maxEncodedBytes","iipSizeLimit","initialBytes","_dec","default","_qoiDec","reset","put","state","dataPos","parse","fields","success","seqType","w","CELL_SIZE_DEFAULT","dimensions","css","canvas","cols","rows","scale","_c","_a","_core","_coreBrowserService","dpr","report","toFixed","input","cond","blob","metrics","UNSUPPORTED_TYPE","imageType","mime","pixelLimit","_resize","floor","ImageData","byteOffset","ImageRenderer","createCanvas","_b","getContext","putImageData","addImage","Blob","generation","createImageBitmap","resizeWidth","resizeHeight","bm","close","catch","cw","cell","ch","_d","rw","_dim","rh","wf","hf","f","total","cdim","endsWith","parseInt","toStr","String","fromCharCode","toInt","toSize","match","DECODERS","toString","bs","TextDecoder","FILE_MARKER","MULTIPARTFILE_MARKER","FILEPART_MARKER","FILEEND_MARKER","REPORTCELLSIZE_MARKER","MAX_FIELDCHARS","_buffer","_position","_key","k","_storeValue","pos","_storeKey","_addImageOpts","scrolling","layer","zIndex","cursorPos","img","d32","blockLength","jpgSize","dim","limit","_layers","get","localDocument","document","createElement","createImageData","ctx","imgData","Promise","resolve","_terminal","super","Map","_optionsRefresh","MutableDisposable","_oldOpen","open","parent","_open","screenElement","optionsService","onOptionChange","option","rescaleCanvas","_renderService","refreshRows","removeLayerFromDom","_oldSetRenderer","setRenderer","_placeholderBitmap","_placeholder","showPlaceholder","cellSize","_createPlaceHolder","clearLines","y","clearRect","_e","clearAll","draw","imgSpec","tileId","col","row","count","_rescaleImage","actual","sourceWidth","sourceHeight","actualCellSize","sx","sy","dx","dy","finalWidth","finalHeight","drawImage","extractTile","drawPlaceholder","values","spec","originalWidth","originalHeight","origCellSize","orig","scaledWidth","scaledHeight","renderer","key","keys","insertLayerToDom","has","classList","style","isolation","insertBefore","firstChild","appendChild","remove","delete","hasLayer","bWidth","blueprint","black","white","shift","x","screen","ctx2","placeholder","bitmap","window","ExtendedAttrsImage","ext","_urlId","_ext","underlineStyle","underlineColor","underlineVariantOffset","val","urlId","imageId","clone","isEmpty","EMPTY_ATTRS","_images","_lastId","_lowestId","_fullyCleared","_needsFullClear","_pixelLimit","setLimit","storageLimit","error","message","getLimit","_viewportMetrics","marker","RangeError","_evictOldest","getUsage","_getStoredPixels","storedPixels","_delImg","id","ImageBitmap","onImageDeleted","wipeAlternate","zero","entries","bufferType","deleteImage","termCols","termRows","originX","originY","tileCount","_inputHandler","_dirtyRowTracker","markDirty","line","lines","ybase","_writeToCell","lineFeed","endMarker","registerMarker","onDispose","active","_evictOnAlternate","onImageAdded","render","range","hasTopImages","hasBottomImages","drawCalls","placeholderCalls","ydisp","getBg","_extendedAttrs","startTile","startCol","sort","viewportResize","oldCol","tilesPerRow","hasData","rightCol","_data","lastTile","expandCol","getImageAtBufferCell","extractTileAtBufferCell","room","used","current","old","oldSpec","imgId","Decoder_1","DEFAULT_PALETTE","convertLe","_size","sixelPaletteLimit","hook","params","attr","colors","bg","isInverse","isFgDefault","foreground","rgba","isFgRGB","t","toColorRGB","getFgColor","ansi","isBgDefault","background","isBgRGB","getBgColor","extractActiveBg","_curAttrData","_themeService","sixelSizeLimit","unhook","advanceCursor","sixelScrolling","KittyGraphicsTypes_1","_kittyStorage","_decodeError","_activeDecoder","_inControlData","_controlData","_controlLength","_encodedSizeLimit","_totalEncodedSize","_parsedCommand","_pendingTransmissions","_maxEncodedBytes","kittySizeLimit","_initialEncodedBytes","_cleanupAllPending","_removePendingEntry","_lastPendingKey","pending","decoder","controlEnd","copyLength","parseKittyCommand","_parseControlDataString","imageNumber","_sendResponse","quiet","action","payloadStart","_streamPayload","pendingKey","previousEncodedSize","totalEncodedSize","decoderToRelease","_f","decoderCapacity","_g","maxPending","oldest","next","cmd","_h","_handleNoPayloadCommand","_handleDelete","isMoreComing","more","decodeError","finalCmd","imageBytes","_handleCommandWithBytesAndCmd","str","fromCodePoint","_handlePlacement","bytes","_handleTransmit","transmission","_handleTransmitDisplay","_handleQuery","image","getImage","_displayImage","placementId","storeImage","format","compression","lastImageId","expectedBytes","deleteSelector","deleteAll","deleteById","isOk","response","coreService","triggerDataEvent","_decodeAndDisplay","_createBitmap","cropX","cropY","cropW","cropH","maxCropW","maxCropH","finalCropW","finalCropH","cropped","imgCols","imgRows","columns","savedX","savedY","savedYbase","scaled","xOffset","yOffset","canvasW","canvasH","offsetCanvas","offsetCtx","offsetBitmap","cursorMovement","scrolled","arrayBuffer","_decompressZlib","url","URL","createObjectURL","Image","reject","addEventListener","revokeObjectURL","src","pixelCount","src32","dst32","alignedPixels","srcOffset","dstOffset","b0","b1","b2","srcByte","dstByte","compressed","_decompress","offsetIn","reader","ReadableStream","pull","controller","enqueue","pipeThrough","DecompressionStream","getReader","chunks","totalLength","done","read","cancel","releaseLock","chunk","images","_kittyIdToStorageId","kittyIdToStorageId","pendingTransmissions","parts","split","part","eqIdx","substring","numValue","KittyImageStorage","_nextImageId","_storageIdToKittyId","_handleStorageImageDeleted","storageId","kittyId","_previousOnImageDeleted","_wrappedOnImageDeleted","imageData","oldStorageId","_maxStoredImages","_evictUndisplayedImages","byteLimit","retainedBytes","evictPlaced","oldestId","wasmDecode","InWasm","MAP","el","D","EMPTY","keepSize","maxBytes","_inst","_ended","_bytes","_m32","_mem","m","grow","Memory","requested","needed","newSize","addPages","loadedBytes","freeBytes","wasmQoiDecode","ib","dl","chunkP","def","W","z","compile","_wasmCtx","fromBase64","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","Event_1","IIPHandler_1","KittyGraphicsHandler_1","KittyImageStorage_1","SixelHandler_1","SixelImageStorage_1","IIPImageStorage_1","enableSizeReports","sixelSupport","iipSupport","kittySupport","_handlers","_onImageAdded","Emitter","_defaultOpts","obj","_disposeLater","args","activate","terminal","ImageStorage","windowOps","options","windowOptions","getWinSizePixels","getCellSizePixels","getWinSizeChars","parser","registerCsiHandler","prefix","_decset","_decrst","_da1","_xtermGraphicsAttributes","onRender","intermediates","registerEscHandler","onRequestReset","onBufferChange","onResize","sixelStorage","SixelImageStorage","sixelHandler","SixelHandler","_parser","registerDcsHandler","iipStorage","IIPImageStorage","iipHandler","IIPHandler","registerOscHandler","kittyStorage","kittyHandler","KittyGraphicsHandler","registerApcHandler","storageUsage","_report","sqrt"],"sourceRoot":""} ++{"version":3,"file":"addon-image.js","mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,QAAAA,OAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,WAAAD,IAEAD,EAAA,WAAAC,GACC,CATD,CASCK,WAAA,uCCKD,SAAAC,EAAAC,GACA,WAAAA,CACA,CAEA,SAAAC,EAAAD,GACA,OAAAA,IAAA,KACA,CAEA,SAAAE,EAAAF,GACA,OAAAA,IAAA,MACA,CASA,SAAAG,EAAAC,EAAAC,EAAAC,EAAAC,EAAA,KACA,YAAAA,IAAA,QAAAD,IAAA,QAAAD,IAAA,MAAAD,KAAA,CACA,CAqCA,SAAAI,EAAAC,EAAAC,EAAAC,GACA,OAAAC,KAAAC,IAAAJ,EAAAG,KAAAE,IAAAH,EAAAD,GACA,CACA,SAAAK,EAAAC,EAAAC,EAAAC,GAKA,OAJAA,EAAA,IACAA,GAAA,GACAA,EAAA,IACAA,GAAA,GACA,EAAAA,EAAA,EACAD,EAAA,GAAAD,EAAAC,GAAAC,EACA,EAAAA,EAAA,EACAF,EACA,EAAAE,EAAA,EACAD,GAAAD,EAAAC,IAAA,IAAAC,GACAD,CACA,CAaA,SAAAE,EAAAf,EAAAC,EAAAC,GACA,kBAAAM,KAAAQ,MAAAd,EAAA,aAAAM,KAAAQ,MAAAf,EAAA,YAAAO,KAAAQ,MAAAhB,EAAA,aACA,CAjGAiB,OAAAC,eAAA5B,EAAA,cAA+CiB,OAAA,IAC/CjB,EAAA6B,mBAA6B7B,EAAA8B,mBAA6B9B,EAAA+B,iBAA2B/B,EAAAgC,mBAA6BhC,EAAAiC,oBAA8BjC,EAAAk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U8D,EAAQ,CAGrB,MAAMoP,EAAW9J,EAAAsC,kBACjB1L,IAAuB,QAAduT,EAAAzT,KAAK8R,iBAAS,IAAA2B,OAAA,EAAAA,EAAEzH,OAAQ,IAAMoH,EAASlT,MAChD8D,IAAwB,QAAd6c,EAAA7gB,KAAK8R,iBAAS,IAAA+O,OAAA,EAAAA,EAAE5U,OAAQ,IAAMmH,EAASpP,MACnD,CACA,GAAI9D,EAAQ8D,EAAShE,KAAKkC,MAAM+K,WAC9BjN,KAAKivB,QAAQ,MAAS/R,EAAO,QAA0Bhd,EAAMuM,QAAQ,MAAMzI,EAAOyI,QAAQ,WACrF,CAEL,MAAMiK,EAAI3a,KAAKoR,MAAMpR,KAAKmzB,KAAKlvB,KAAKkC,MAAM+K,aAC1CjN,KAAKivB,QAAQ,MAAS/R,EAAO,QAA0BxG,KAAKA,KAC9D,CACA,OAAO,EACT,OAEE,MAAMA,EAAI3a,KAAKoR,MAAMpR,KAAKmzB,KAAKlvB,KAAKkC,MAAM+K,aAE1C,OADAjN,KAAKivB,QAAQ,MAAS/R,EAAO,QAA0BxG,KAAKA,OACrD,EACT,QAEE,OADA1W,KAAKivB,QAAQ,MAAS/R,EAAO,UACtB,EAKb,OADAld,KAAKivB,QAAQ,MAAS/R,EAAO,UACtB,CACT","sources":["webpack://ImageAddon/webpack/universalModuleDefinition","webpack://ImageAddon/../node_modules/sixel/lib/Colors.js","webpack://ImageAddon/../node_modules/sixel/lib/Decoder.js","webpack://ImageAddon/../node_modules/sixel/lib/wasm.js","webpack://ImageAddon/../src/common/Event.ts","webpack://ImageAddon/../src/common/Lifecycle.ts","webpack://ImageAddon/./src/IIPHandler.ts","webpack://ImageAddon/./src/IIPHeaderParser.ts","webpack://ImageAddon/./src/IIPImageStorage.ts","webpack://ImageAddon/./src/IIPMetrics.ts","webpack://ImageAddon/./src/ImageRenderer.ts","webpack://ImageAddon/./src/ImageStorage.ts","webpack://ImageAddon/./src/SixelHandler.ts","webpack://ImageAddon/./src/SixelImageStorage.ts","webpack://ImageAddon/./src/kitty/KittyGraphicsHandler.ts","webpack://ImageAddon/./src/kitty/KittyGraphicsTypes.ts","webpack://ImageAddon/./src/kitty/KittyImageStorage.ts","webpack://ImageAddon/../node_modules/xterm-wasm-parts/lib/base64/Base64Decoder.wasm.js","webpack://ImageAddon/../node_modules/xterm-wasm-parts/lib/qoi/QoiDecoder.wasm.js","webpack://ImageAddon/javascript/node_modules/inwasm-runtime/lib/index.cjs","webpack://ImageAddon/webpack/bootstrap","webpack://ImageAddon/./src/ImageAddon.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ImageAddon\"] = factory();\n\telse\n\t\troot[\"ImageAddon\"] = factory();\n})(globalThis, () => {\nreturn ","\"use strict\";\n/**\n * Copyright (c) 2019 Joerg Breitbart.\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DEFAULT_FOREGROUND = exports.DEFAULT_BACKGROUND = exports.PALETTE_ANSI_256 = exports.PALETTE_VT340_GREY = exports.PALETTE_VT340_COLOR = exports.normalizeHLS = exports.normalizeRGB = exports.nearestColorIndex = exports.fromRGBA8888 = exports.toRGBA8888 = exports.alpha = exports.blue = exports.green = exports.red = exports.BIG_ENDIAN = void 0;\n// FIXME: cleanup this mess, move things either to decoder/encoder, keep only shared things\n// system endianess\nexports.BIG_ENDIAN = new Uint8Array(new Uint32Array([0xFF000000]).buffer)[0] === 0xFF;\nif (exports.BIG_ENDIAN) {\n console.warn('BE platform detected. This version of node-sixel works only on LE properly.');\n}\n// channel values\nfunction red(n) {\n return n & 0xFF;\n}\nexports.red = red;\nfunction green(n) {\n return (n >>> 8) & 0xFF;\n}\nexports.green = green;\nfunction blue(n) {\n return (n >>> 16) & 0xFF;\n}\nexports.blue = blue;\nfunction alpha(n) {\n return (n >>> 24) & 0xFF;\n}\nexports.alpha = alpha;\n/**\n * Convert RGB channels to native color RGBA8888.\n */\nfunction toRGBA8888(r, g, b, a = 255) {\n return ((a & 0xFF) << 24 | (b & 0xFF) << 16 | (g & 0xFF) << 8 | (r & 0xFF)) >>> 0; // ABGR32\n}\nexports.toRGBA8888 = toRGBA8888;\n/**\n * Convert native color to [r, g, b, a].\n */\nfunction fromRGBA8888(color) {\n return [color & 0xFF, (color >> 8) & 0xFF, (color >> 16) & 0xFF, color >>> 24];\n}\nexports.fromRGBA8888 = fromRGBA8888;\n/**\n * Get index of nearest color in `palette` for `color`.\n * Uses euclidean distance without any luminescence correction.\n */\nfunction nearestColorIndex(color, palette) {\n const r = red(color);\n const g = green(color);\n const b = blue(color);\n let min = Number.MAX_SAFE_INTEGER;\n let idx = -1;\n // use euclidean distance (manhattan gives very poor results)\n for (let i = 0; i < palette.length; ++i) {\n const dr = r - palette[i][0];\n const dg = g - palette[i][1];\n const db = b - palette[i][2];\n const d = dr * dr + dg * dg + db * db;\n if (!d)\n return i;\n if (d < min) {\n min = d;\n idx = i;\n }\n }\n return idx;\n}\nexports.nearestColorIndex = nearestColorIndex;\n// color conversions\n// HLS taken from: http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl\nfunction clamp(low, high, value) {\n return Math.max(low, Math.min(value, high));\n}\nfunction h2c(t1, t2, c) {\n if (c < 0)\n c += 1;\n if (c > 1)\n c -= 1;\n return c * 6 < 1\n ? t2 + (t1 - t2) * 6 * c\n : c * 2 < 1\n ? t1\n : c * 3 < 2\n ? t2 + (t1 - t2) * (4 - c * 6)\n : t2;\n}\nfunction HLStoRGB(h, l, s) {\n if (!s) {\n const v = Math.round(l * 255);\n return toRGBA8888(v, v, v);\n }\n const t1 = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const t2 = 2 * l - t1;\n return toRGBA8888(clamp(0, 255, Math.round(h2c(t1, t2, h + 1 / 3) * 255)), clamp(0, 255, Math.round(h2c(t1, t2, h) * 255)), clamp(0, 255, Math.round(h2c(t1, t2, h - 1 / 3) * 255)));\n}\n/**\n * Normalize SIXEL RGB values (percent based, 0-100) to RGBA8888.\n */\nfunction normalizeRGB(r, g, b) {\n return (0xFF000000 | Math.round(b / 100 * 255) << 16 | Math.round(g / 100 * 255) << 8 | Math.round(r / 100 * 255)) >>> 0; // ABGR32\n}\nexports.normalizeRGB = normalizeRGB;\n/**\n * Normalize SIXEL HLS values to RGBA8888. Applies hue correction of +240°.\n */\nfunction normalizeHLS(h, l, s) {\n // Note: hue value is turned by 240° in VT340, all values given as fractions\n return HLStoRGB((h + 240 % 360) / 360, l / 100, s / 100);\n}\nexports.normalizeHLS = normalizeHLS;\n/**\n * default palettes\n */\n// FIXME: move palettes to Decoder.ts\n/**\n * 16 predefined color registers of VT340 (values in %):\n * ```\n * R G B\n * 0 Black 0 0 0\n * 1 Blue 20 20 80\n * 2 Red 80 13 13\n * 3 Green 20 80 20\n * 4 Magenta 80 20 80\n * 5 Cyan 20 80 80\n * 6 Yellow 80 80 20\n * 7 Gray 50% 53 53 53\n * 8 Gray 25% 26 26 26\n * 9 Blue* 33 33 60\n * 10 Red* 60 26 26\n * 11 Green* 33 60 33\n * 12 Magenta* 60 33 60\n * 13 Cyan* 33 60 60\n * 14 Yellow* 60 60 33\n * 15 Gray 75% 80 80 80\n * ```\n * (*) less saturated\n *\n * @see https://vt100.net/docs/vt3xx-gp/chapter2.html#S2.4\n*/\nexports.PALETTE_VT340_COLOR = new Uint32Array([\n normalizeRGB(0, 0, 0),\n normalizeRGB(20, 20, 80),\n normalizeRGB(80, 13, 13),\n normalizeRGB(20, 80, 20),\n normalizeRGB(80, 20, 80),\n normalizeRGB(20, 80, 80),\n normalizeRGB(80, 80, 20),\n normalizeRGB(53, 53, 53),\n normalizeRGB(26, 26, 26),\n normalizeRGB(33, 33, 60),\n normalizeRGB(60, 26, 26),\n normalizeRGB(33, 60, 33),\n normalizeRGB(60, 33, 60),\n normalizeRGB(33, 60, 60),\n normalizeRGB(60, 60, 33),\n normalizeRGB(80, 80, 80)\n]);\n/**\n * 16 predefined monochrome registers of VT340 (values in %):\n * ```\n * R G B\n * 0 Black 0 0 0\n * 1 Gray-2 13 13 13\n * 2 Gray-4 26 26 26\n * 3 Gray-6 40 40 40\n * 4 Gray-1 6 6 6\n * 5 Gray-3 20 20 20\n * 6 Gray-5 33 33 33\n * 7 White 7 46 46 46\n * 8 Black 0 0 0 0\n * 9 Gray-2 13 13 13\n * 10 Gray-4 26 26 26\n * 11 Gray-6 40 40 40\n * 12 Gray-1 6 6 6\n * 13 Gray-3 20 20 20\n * 14 Gray-5 33 33 33\n * 15 White 7 46 46 46\n * ```\n *\n * @see https://vt100.net/docs/vt3xx-gp/chapter2.html#S2.4\n */\nexports.PALETTE_VT340_GREY = new Uint32Array([\n normalizeRGB(0, 0, 0),\n normalizeRGB(13, 13, 13),\n normalizeRGB(26, 26, 26),\n normalizeRGB(40, 40, 40),\n normalizeRGB(6, 6, 6),\n normalizeRGB(20, 20, 20),\n normalizeRGB(33, 33, 33),\n normalizeRGB(46, 46, 46),\n normalizeRGB(0, 0, 0),\n normalizeRGB(13, 13, 13),\n normalizeRGB(26, 26, 26),\n normalizeRGB(40, 40, 40),\n normalizeRGB(6, 6, 6),\n normalizeRGB(20, 20, 20),\n normalizeRGB(33, 33, 33),\n normalizeRGB(46, 46, 46)\n]);\n/**\n * 256 predefined ANSI colors.\n *\n * @see https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit\n */\nexports.PALETTE_ANSI_256 = (() => {\n // 16 lower colors (taken from xterm)\n const p = [\n toRGBA8888(0, 0, 0),\n toRGBA8888(205, 0, 0),\n toRGBA8888(0, 205, 0),\n toRGBA8888(205, 205, 0),\n toRGBA8888(0, 0, 238),\n toRGBA8888(205, 0, 205),\n toRGBA8888(0, 250, 205),\n toRGBA8888(229, 229, 229),\n toRGBA8888(127, 127, 127),\n toRGBA8888(255, 0, 0),\n toRGBA8888(0, 255, 0),\n toRGBA8888(255, 255, 0),\n toRGBA8888(92, 92, 255),\n toRGBA8888(255, 0, 255),\n toRGBA8888(0, 255, 255),\n toRGBA8888(255, 255, 255),\n ];\n // colors up to 232\n const d = [0, 95, 135, 175, 215, 255];\n for (let r = 0; r < 6; ++r) {\n for (let g = 0; g < 6; ++g) {\n for (let b = 0; b < 6; ++b) {\n p.push(toRGBA8888(d[r], d[g], d[b]));\n }\n }\n }\n // grey scale to up 255\n for (let v = 8; v <= 238; v += 10) {\n p.push(toRGBA8888(v, v, v));\n }\n return new Uint32Array(p);\n})();\n/**\n * Background: Black by default.\n * Foreground: White by default.\n *\n * Background color is used whenever a fill color is needed and not explicitly set.\n * Foreground color is used as default initial sixel color.\n */\nexports.DEFAULT_BACKGROUND = toRGBA8888(0, 0, 0, 255);\nexports.DEFAULT_FOREGROUND = toRGBA8888(255, 255, 255, 255);\n//# sourceMappingURL=Colors.js.map","\"use strict\";\n/**\n * Copyright (c) 2021 Joerg Breitbart.\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decodeAsync = exports.decode = exports.Decoder = exports.DecoderAsync = void 0;\nconst Colors_1 = require(\"./Colors\");\nconst wasm_1 = require(\"./wasm\");\n/* istanbul ignore next */\nfunction decodeBase64(s) {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(s, 'base64');\n }\n const bytestring = atob(s);\n const result = new Uint8Array(bytestring.length);\n for (let i = 0; i < result.length; ++i) {\n result[i] = bytestring.charCodeAt(i);\n }\n return result;\n}\nconst WASM_BYTES = decodeBase64(wasm_1.LIMITS.BYTES);\nlet WASM_MODULE;\n// empty canvas\nconst NULL_CANVAS = new Uint32Array();\n// proxy for lazy binding of decoder methods to wasm env callbacks\nclass CallbackProxy {\n constructor() {\n this.bandHandler = (width) => 1;\n this.modeHandler = (mode) => 1;\n }\n handle_band(width) {\n return this.bandHandler(width);\n }\n mode_parsed(mode) {\n return this.modeHandler(mode);\n }\n}\n// default decoder options\nconst DEFAULT_OPTIONS = {\n memoryLimit: 2048 * 65536,\n sixelColor: Colors_1.DEFAULT_FOREGROUND,\n fillColor: Colors_1.DEFAULT_BACKGROUND,\n palette: Colors_1.PALETTE_VT340_COLOR,\n paletteLimit: wasm_1.LIMITS.PALETTE_SIZE,\n truncate: true\n};\n/**\n * Create a decoder instance asynchronously.\n * To be used in the browser main thread.\n */\nfunction DecoderAsync(opts) {\n const cbProxy = new CallbackProxy();\n const importObj = {\n env: {\n handle_band: cbProxy.handle_band.bind(cbProxy),\n mode_parsed: cbProxy.mode_parsed.bind(cbProxy)\n }\n };\n return WebAssembly.instantiate(WASM_MODULE || WASM_BYTES, importObj)\n .then((inst) => {\n WASM_MODULE = WASM_MODULE || inst.module;\n return new Decoder(opts, inst.instance || inst, cbProxy);\n });\n}\nexports.DecoderAsync = DecoderAsync;\n/**\n * Decoder - web assembly based sixel stream decoder.\n *\n * Usage pattern:\n * - call `init` to initialize decoder for new image\n * - feed data chunks to `decode` or `decodeString`\n * - grab pixels from `data32`\n * - optional: call `release` to free memory (e.g. after big images)\n * - start over with next image by calling `init`\n *\n * Properties:\n * - max width of 2^14 - 4 pixels (compile time setting in wasm)\n * - no explicit height limit (only limited by memory)\n * - max 4096 colors palette (compile time setting in wasm)\n *\n * Explanation operation modes:\n * - M1 Mode chosen for level 1 images (no raster attributes),\n * or for level 2 images with `truncate=false`.\n * - M2 Mode chosen for level 2 images with `truncate=true` (default).\n * While this mode is not fully spec conform (decoder not expected to truncate),\n * it is what spec conform encoders should create (should not excess raster).\n * This mode has several advantages:\n * - ~15% faster decoding speed\n * - image dimensions can be evaluated early without processing the whole data\n * - faster pixel access in `data32` (precalulated)\n * - image height is not reported as multiple of 6 pixels\n * - M0 Undecided mode state after `init`.\n * The level of an image is determined during early decoding based on the fact,\n * whether the data contains valid raster attributes before any sixel data.\n * Until then the mode of an image is marked as M0, meaning the real operation mode\n * could not be decided yet.\n */\nclass Decoder {\n /**\n * Synchonous ctor. Can be called from nodejs or a webworker context.\n * For instantiation in the browser main thread use `WasmDecoderAsync` instead.\n */\n constructor(opts, _instance, _cbProxy) {\n this._PIXEL_OFFSET = wasm_1.LIMITS.MAX_WIDTH + 4;\n this._canvas = NULL_CANVAS;\n this._bandWidths = [];\n this._maxWidth = 0;\n this._minWidth = wasm_1.LIMITS.MAX_WIDTH;\n this._lastOffset = 0;\n this._currentHeight = 0;\n this._opts = Object.assign({}, DEFAULT_OPTIONS, opts);\n if (this._opts.paletteLimit > wasm_1.LIMITS.PALETTE_SIZE) {\n throw new Error(`DecoderOptions.paletteLimit must not exceed ${wasm_1.LIMITS.PALETTE_SIZE}`);\n }\n if (!_instance) {\n const module = WASM_MODULE || (WASM_MODULE = new WebAssembly.Module(WASM_BYTES));\n _instance = new WebAssembly.Instance(module, {\n env: {\n handle_band: this._handle_band.bind(this),\n mode_parsed: this._initCanvas.bind(this)\n }\n });\n }\n else {\n _cbProxy.bandHandler = this._handle_band.bind(this);\n _cbProxy.modeHandler = this._initCanvas.bind(this);\n }\n this._instance = _instance;\n this._wasm = this._instance.exports;\n this._chunk = new Uint8Array(this._wasm.memory.buffer, this._wasm.get_chunk_address(), wasm_1.LIMITS.CHUNK_SIZE);\n this._states = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_state_address(), 12);\n this._palette = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_palette_address(), wasm_1.LIMITS.PALETTE_SIZE);\n this._palette.set(this._opts.palette);\n this._pSrc = new Uint32Array(this._wasm.memory.buffer, this._wasm.get_p0_address());\n this._wasm.init(Colors_1.DEFAULT_FOREGROUND, 0, this._opts.paletteLimit, 0);\n }\n // some readonly parser states for internal usage\n get _fillColor() { return this._states[0]; }\n get _truncate() { return this._states[8]; }\n get _rasterWidth() { return this._states[6]; }\n get _rasterHeight() { return this._states[7]; }\n get _width() { return this._states[2] ? this._states[2] - 4 : 0; }\n get _height() { return this._states[3]; }\n get _level() { return this._states[9]; }\n get _mode() { return this._states[10]; }\n get _paletteLimit() { return this._states[11]; }\n _initCanvas(mode) {\n if (mode === 2 /* M2 */) {\n const pixels = this.width * this.height;\n if (pixels > this._canvas.length) {\n if (this._opts.memoryLimit && pixels * 4 > this._opts.memoryLimit) {\n this.release();\n throw new Error('image exceeds memory limit');\n }\n this._canvas = new Uint32Array(pixels);\n }\n this._maxWidth = this._width;\n }\n else if (mode === 1 /* M1 */) {\n if (this._level === 2) {\n // got raster attributes, use them as initial size hint\n const pixels = Math.min(this._rasterWidth, wasm_1.LIMITS.MAX_WIDTH) * this._rasterHeight;\n if (pixels > this._canvas.length) {\n if (this._opts.memoryLimit && pixels * 4 > this._opts.memoryLimit) {\n this.release();\n throw new Error('image exceeds memory limit');\n }\n this._canvas = new Uint32Array(pixels);\n }\n }\n else {\n // else fallback to generic resizing, starting with 256*256 pixels\n if (this._canvas.length < 65536) {\n this._canvas = new Uint32Array(65536);\n }\n }\n }\n return 0; // 0 - continue, 1 - abort right away\n }\n _realloc(offset, additionalPixels) {\n const pixels = offset + additionalPixels;\n if (pixels > this._canvas.length) {\n if (this._opts.memoryLimit && pixels * 4 > this._opts.memoryLimit) {\n this.release();\n throw new Error('image exceeds memory limit');\n }\n // extend in 65536 pixel blocks\n const newCanvas = new Uint32Array(Math.ceil(pixels / 65536) * 65536);\n newCanvas.set(this._canvas);\n this._canvas = newCanvas;\n }\n }\n _handle_band(width) {\n const adv = this._PIXEL_OFFSET;\n let offset = this._lastOffset;\n if (this._mode === 2 /* M2 */) {\n let remaining = this.height - this._currentHeight;\n let c = 0;\n while (c < 6 && remaining > 0) {\n this._canvas.set(this._pSrc.subarray(adv * c, adv * c + width), offset + width * c);\n c++;\n remaining--;\n }\n this._lastOffset += width * c;\n this._currentHeight += c;\n }\n else if (this._mode === 1 /* M1 */) {\n this._realloc(offset, width * 6);\n this._maxWidth = Math.max(this._maxWidth, width);\n this._minWidth = Math.min(this._minWidth, width);\n for (let i = 0; i < 6; ++i) {\n this._canvas.set(this._pSrc.subarray(adv * i, adv * i + width), offset + width * i);\n }\n this._bandWidths.push(width);\n this._lastOffset += width * 6;\n this._currentHeight += 6;\n }\n return 0; // 0 - continue, 1 - abort right away\n }\n /**\n * Width of the image data.\n * Returns the rasterWidth in level2/truncating mode,\n * otherwise the max width, that has been seen so far.\n */\n get width() {\n return this._mode !== 1 /* M1 */\n ? this._width\n : Math.max(this._maxWidth, this._wasm.current_width());\n }\n /**\n * Height of the image data.\n * Returns the rasterHeight in level2/truncating mode,\n * otherwise height touched by sixels.\n */\n get height() {\n return this._mode !== 1 /* M1 */\n ? this._height\n : this._wasm.current_width()\n ? this._bandWidths.length * 6 + this._wasm.current_height()\n : this._bandWidths.length * 6;\n }\n /**\n * Get active palette colors as RGBA8888[] (borrowed).\n */\n get palette() {\n return this._palette.subarray(0, this._paletteLimit);\n }\n /**\n * Get the memory used by the decoder.\n *\n * This is a rough estimate accounting the wasm instance memory\n * and pixel buffers held on JS side (real value will be slightly\n * higher due to JS book-keeping).\n * Note that the decoder does not free ressources on its own,\n * call `release` to free excess memory.\n */\n get memoryUsage() {\n return this._canvas.byteLength + this._wasm.memory.buffer.byteLength + 8 * this._bandWidths.length;\n }\n /**\n * Get various properties of the decoder and the current image.\n */\n get properties() {\n return {\n width: this.width,\n height: this.height,\n mode: this._mode,\n level: this._level,\n truncate: !!this._truncate,\n paletteLimit: this._paletteLimit,\n fillColor: this._fillColor,\n memUsage: this.memoryUsage,\n rasterAttributes: {\n numerator: this._states[4],\n denominator: this._states[5],\n width: this._rasterWidth,\n height: this._rasterHeight,\n }\n };\n }\n /**\n * Initialize decoder for next image. Must be called before\n * any calls to `decode` or `decodeString`.\n */\n // FIXME: reorder arguments, better palette handling\n init(fillColor = this._opts.fillColor, palette = this._opts.palette, paletteLimit = this._opts.paletteLimit, truncate = this._opts.truncate) {\n this._wasm.init(this._opts.sixelColor, fillColor, paletteLimit, truncate ? 1 : 0);\n if (palette) {\n this._palette.set(palette.subarray(0, wasm_1.LIMITS.PALETTE_SIZE));\n }\n this._bandWidths.length = 0;\n this._maxWidth = 0;\n this._minWidth = wasm_1.LIMITS.MAX_WIDTH;\n this._lastOffset = 0;\n this._currentHeight = 0;\n }\n /**\n * Decode next chunk of data from start to end index (exclusive).\n * @throws Will throw if the image exceeds the memory limit.\n */\n decode(data, start = 0, end = data.length) {\n let p = start;\n while (p < end) {\n const length = Math.min(end - p, wasm_1.LIMITS.CHUNK_SIZE);\n this._chunk.set(data.subarray(p, p += length));\n this._wasm.decode(0, length);\n }\n }\n /**\n * Decode next chunk of string data from start to end index (exclusive).\n * Note: Decoding from string data is rather slow, use `decode` with byte data instead.\n * @throws Will throw if the image exceeds the memory limit.\n */\n decodeString(data, start = 0, end = data.length) {\n let p = start;\n while (p < end) {\n const length = Math.min(end - p, wasm_1.LIMITS.CHUNK_SIZE);\n for (let i = 0, j = p; i < length; ++i, ++j) {\n this._chunk[i] = data.charCodeAt(j);\n }\n p += length;\n this._wasm.decode(0, length);\n }\n }\n /**\n * Get current pixel data as 32-bit typed array (RGBA8888).\n * Also peeks into pixel data of the current band, that got not pushed yet.\n */\n get data32() {\n if (this._mode === 0 /* M0 */ || !this.width || !this.height) {\n return NULL_CANVAS;\n }\n // get width of pending band to peek into left-over data\n const currentWidth = this._wasm.current_width();\n if (this._mode === 2 /* M2 */) {\n let remaining = this.height - this._currentHeight;\n if (remaining > 0) {\n const adv = this._PIXEL_OFFSET;\n let offset = this._lastOffset;\n let c = 0;\n while (c < 6 && remaining > 0) {\n this._canvas.set(this._pSrc.subarray(adv * c, adv * c + currentWidth), offset + currentWidth * c);\n c++;\n remaining--;\n }\n if (remaining) {\n this._canvas.fill(this._fillColor, offset + currentWidth * c);\n }\n }\n return this._canvas.subarray(0, this.width * this.height);\n }\n if (this._mode === 1 /* M1 */) {\n if (this._minWidth === this._maxWidth) {\n let escape = false;\n if (currentWidth) {\n if (currentWidth !== this._minWidth) {\n escape = true;\n }\n else {\n const adv = this._PIXEL_OFFSET;\n let offset = this._lastOffset;\n this._realloc(offset, currentWidth * 6);\n for (let i = 0; i < 6; ++i) {\n this._canvas.set(this._pSrc.subarray(adv * i, adv * i + currentWidth), offset + currentWidth * i);\n }\n }\n }\n if (!escape) {\n return this._canvas.subarray(0, this.width * this.height);\n }\n }\n // worst case: re-align pixels if we have bands with different width\n // This is somewhat allocation intensive, any way to do that in-place, and just once?\n const final = new Uint32Array(this.width * this.height);\n final.fill(this._fillColor);\n let finalOffset = 0;\n let start = 0;\n for (let i = 0; i < this._bandWidths.length; ++i) {\n const bw = this._bandWidths[i];\n for (let p = 0; p < 6; ++p) {\n final.set(this._canvas.subarray(start, start += bw), finalOffset);\n finalOffset += this.width;\n }\n }\n // also handle left-over pixels of the current band\n if (currentWidth) {\n const adv = this._PIXEL_OFFSET;\n // other than finished bands, this runs only up to currentHeight\n const currentHeight = this._wasm.current_height();\n for (let i = 0; i < currentHeight; ++i) {\n final.set(this._pSrc.subarray(adv * i, adv * i + currentWidth), finalOffset + this.width * i);\n }\n }\n return final;\n }\n // fallthrough for all not handled cases\n return NULL_CANVAS;\n }\n /**\n * Same as `data32`, but returning pixel data as Uint8ClampedArray suitable\n * for direct usage with `ImageData`.\n */\n get data8() {\n return new Uint8ClampedArray(this.data32.buffer, 0, this.width * this.height * 4);\n }\n /**\n * Release image ressources on JS side held by the decoder.\n *\n * The decoder tries to re-use memory ressources of a previous image\n * to lower allocation and GC pressure. Decoding a single big image\n * will grow the memory usage of the decoder permanently.\n * Call `release` to reset the internal buffers and free the memory.\n * Note that this destroys the image data, call it when done processing\n * a rather big image, otherwise it is not needed. Use `memoryUsage`\n * to decide, whether the held memory is still within your limits.\n * This does not affect the wasm module (operates on static memory).\n */\n release() {\n this._canvas = NULL_CANVAS;\n this._bandWidths.length = 0;\n this._maxWidth = 0;\n this._minWidth = wasm_1.LIMITS.MAX_WIDTH;\n // also nullify parser states in wasm to avoid\n // width/height reporting potential out-of-bound values\n this._wasm.init(Colors_1.DEFAULT_FOREGROUND, 0, this._opts.paletteLimit, 0);\n }\n}\nexports.Decoder = Decoder;\n/**\n * Convenient decoding functions for easier usage.\n *\n * These can be used for casual decoding of sixel images,\n * that dont come in as stream chunks.\n * Note that the functions instantiate a stream decoder for every call,\n * which comes with a performance penalty of ~25%.\n */\n/**\n * Decode function with synchronous wasm loading.\n * Can be used in a web worker or in nodejs. Does not work reliable in normal browser context.\n * @throws Will throw if the image exceeds the memory limit.\n */\nfunction decode(data, opts) {\n const dec = new Decoder(opts);\n dec.init();\n typeof data === 'string' ? dec.decodeString(data) : dec.decode(data);\n return {\n width: dec.width,\n height: dec.height,\n data32: dec.data32,\n data8: dec.data8\n };\n}\nexports.decode = decode;\n/**\n * Decode function with asynchronous wasm loading.\n * Use this version in normal browser context.\n * @throws Will throw if the image exceeds the memory limit.\n */\nasync function decodeAsync(data, opts) {\n const dec = await DecoderAsync(opts);\n dec.init();\n typeof data === 'string' ? dec.decodeString(data) : dec.decode(data);\n return {\n width: dec.width,\n height: dec.height,\n data32: dec.data32,\n data8: dec.data8\n };\n}\nexports.decodeAsync = decodeAsync;\n//# sourceMappingURL=Decoder.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LIMITS = void 0;\nexports.LIMITS = {\n CHUNK_SIZE: 16384,\n PALETTE_SIZE: 4096,\n MAX_WIDTH: 16384,\n BYTES: 'AGFzbQEAAAABJAdgAAF/YAJ/fwBgA39/fwF/YAF/AX9gAABgBH9/f38AYAF/AAIlAgNlbnYLaGFuZGxlX2JhbmQAAwNlbnYLbW9kZV9wYXJzZWQAAwMTEgQAAAAAAQQBAQUBAAACAgAGAwQFAXABBwcFBAEBBwcGCAF/AUGAihoLB9wBDgZtZW1vcnkCABFnZXRfc3RhdGVfYWRkcmVzcwADEWdldF9jaHVua19hZGRyZXNzAAQOZ2V0X3AwX2FkZHJlc3MABRNnZXRfcGFsZXR0ZV9hZGRyZXNzAAYEaW5pdAALBmRlY29kZQAMDWN1cnJlbnRfd2lkdGgADQ5jdXJyZW50X2hlaWdodAAOGV9faW5kaXJlY3R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cDAEHYjAIgADcDAEHQjAIgADcDAEHIjAIgADcDAEHAjAIgADcDAEG4jAIgADcDAEGwjAIgADcDAEGojAIgADcDAEGgjAIgADcDAEGYjAIgADcDAEGQjAIgADcDAEGIjAIgADcDAEGAjAIgADcDAEH4iwIgADcDAEHwiwIgADcDAEHoiwIgADcDAEHgiwIgADcDAEHYiwIgADcDAEHQiwIgADcDAEHIiwIgADcDAEHAiwIgADcDAEG4iwIgADcDAEGwiwIgADcDAEGoiwIgADcDAEGgiwIgADcDAEGYiwIgADcDAEGQiwIgADcDAEGIiwIgADcDAEGAiwIgADcDAEH4igIgADcDAEHwigIgADcDAEHoigIgADcDAEHgigIgADcDAEHYigIgADcDAEHQigIgADcDAEHIigIgADcDAEHAigIgADcDAEG4igIgADcDAEGwigIgADcDAEGoigIgADcDAEGgigIgADcDAEGYigIgADcDAEGQigIgADcDAEGIigIgADcDAEGAigIgADcDAEH4iQIgADcDAEHwiQIgADcDAEHoiQIgADcDAEHgiQIgADcDAEHYiQIgADcDAEHQiQIgADcDAEHIiQIgADcDAEHAiQIgADcDAEG4iQIgADcDAEGwiQIgADcDAEGoCCgCACIEQf8AakGAAW0hCAJAIARBgQFIDQBBASEBIAhBAiAIQQJKG0EBayICQQFxIQMgBEGBAk4EQCACQX5xIQIDQCABQQl0IgdBEHJBoIkCakGwiQJBgAT8CgAAIAdBsI0CakGwiQJBgAT8CgAAIAFBAmohASACQQJrIgINAAsLIANFDQAgAUEJdEEQckGgiQJqQbCJAkGABPwKAAALAkAgBEEBSA0AIAhBASAIQQFKGyIDQQFxIQUCQCADQQFrIgdFBEBBACEBDAELIANB/v///wdxIQJBACEBA0AgAUEJdCIGQRByQbCJBmpBsIkCQYAE/AoAACAGQZAEckGwiQZqQbCJAkGABPwKAAAgAUECaiEBIAJBAmsiAg0ACwsgBQRAIAFBCXRBEHJBsIkGakGwiQJBgAT8CgAACyAEQQFIDQAgA0EBcSEFIAcEfyADQf7///8HcSECQQAhAQNAIAFBCXQiBk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dAJ/IAdDAAB/Q5RDAAAAP5IiBkMAAIBPXSAGQwAAAABgcQRAIAapDAELQQALQRB0ciABcgtBgICAeHILNwAgAEH/AWxBMmpB5ABtIAFB/wFsQTJqQeQAbUEIdHIgAkH/AWxBMmpB5ABtQRB0ckGAgIB4cgsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwsYAQBBgAgLEQEAAAACAAAAAwAAAAQAAAAF'\n};\n//# sourceMappingURL=wasm.js.map","/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal event utilities for xterm.js core.\n * Simplified from VS Code's event.ts - no leak detection/profiling.\n */\n\nimport { IDisposable, DisposableStore, toDisposable } from './Lifecycle';\n\nexport interface IEvent {\n (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\n}\n\nexport class Emitter {\n private _listeners: { fn: (e: T) => any, thisArgs: any }[] = [];\n private _disposed = false;\n private _event: IEvent | undefined;\n\n public get event(): IEvent {\n if (this._event) {\n return this._event;\n }\n this._event = (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n if (this._disposed) {\n return toDisposable(() => {});\n }\n\n const entry = { fn: listener, thisArgs };\n this._listeners = this._listeners.slice();\n this._listeners.push(entry);\n\n const result = toDisposable(() => {\n const idx = this._listeners.indexOf(entry);\n if (idx !== -1) {\n this._listeners = this._listeners.slice();\n this._listeners.splice(idx, 1);\n }\n });\n\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(result);\n } else {\n disposables.add(result);\n }\n }\n\n return result;\n };\n return this._event;\n }\n\n public fire(event: T): void {\n if (this._disposed || !this._listeners.length) {\n return;\n }\n if (this._listeners.length === 1) {\n this._listeners[0].fn.call(this._listeners[0].thisArgs, event);\n return;\n }\n const listeners = this._listeners;\n for (let i = 0, len = listeners.length; i < len; ++i) {\n listeners[i].fn.call(listeners[i].thisArgs, event);\n }\n }\n\n public dispose(): void {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n this._listeners.length = 0;\n }\n}\n\nexport namespace EventUtils {\n export function forward(from: IEvent, to: Emitter): IDisposable {\n return from(e => to.fire(e));\n }\n\n export function map(event: IEvent, map: (i: I) => O): IEvent {\n return (listener: (e: O) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n return event(i => listener.call(thisArgs, map(i)), undefined, disposables);\n };\n }\n\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent {\n return (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n const store = new DisposableStore();\n for (const event of events) {\n store.add(event(e => listener.call(thisArgs, e)));\n }\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(store);\n } else {\n disposables.add(store);\n }\n }\n return store;\n };\n }\n\n export function runAndSubscribe(event: IEvent, handler: (e: T) => void, initial: T): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void, initial?: T): IDisposable {\n handler(initial);\n return event(e => handler(e));\n }\n}\n","/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal lifecycle utilities for xterm.js core.\n * Simplified from VS Code's lifecycle.ts - no tracking/leak detection.\n */\n\nexport interface IDisposable {\n dispose(): void;\n}\n\nexport function toDisposable(fn: () => void): IDisposable {\n return { dispose: fn };\n}\n\nexport function dispose(disposable: T): T;\nexport function dispose(disposable: T | undefined): T | undefined;\nexport function dispose(disposables: T[]): T[];\nexport function dispose(arg: T | T[] | undefined): T | T[] | undefined {\n if (!arg) {\n return arg;\n }\n if (Array.isArray(arg)) {\n for (const d of arg) {\n d.dispose();\n }\n return [];\n }\n arg.dispose();\n return arg;\n}\n\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n return toDisposable(() => dispose(disposables));\n}\n\nexport class DisposableStore implements IDisposable {\n private readonly _disposables = new Set();\n private _isDisposed = false;\n\n public get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n public add(o: T): T {\n if (this._isDisposed) {\n o.dispose();\n } else {\n this._disposables.add(o);\n }\n return o;\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n\n public clear(): void {\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n}\n\nexport abstract class Disposable implements IDisposable {\n public static readonly None: IDisposable = Object.freeze({ dispose() { } });\n\n protected readonly _store = new DisposableStore();\n\n public dispose(): void {\n this._store.dispose();\n }\n\n protected _register(o: T): T {\n return this._store.add(o);\n }\n}\n\nexport class MutableDisposable implements IDisposable {\n private _value: T | undefined;\n private _isDisposed = false;\n\n public get value(): T | undefined {\n return this._isDisposed ? undefined : this._value;\n }\n\n public set value(value: T | undefined) {\n if (this._isDisposed || value === this._value) {\n return;\n }\n this._value?.dispose();\n this._value = value;\n }\n\n public clear(): void {\n this.value = undefined;\n }\n\n public dispose(): void {\n this._isDisposed = true;\n this._value?.dispose();\n this._value = undefined;\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IImageAddonOptions, IOscHandler, IResetHandler, ITerminalExt } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { CELL_SIZE_DEFAULT } from './ImageStorage';\nimport Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport QoiDecoder from 'xterm-wasm-parts/lib/qoi/QoiDecoder.wasm';\nimport { HeaderParser, IHeaderFields, HeaderState, SequenceType } from './IIPHeaderParser';\nimport { imageType, UNSUPPORTED_TYPE } from './IIPMetrics';\n\n// Local const enum mirror - esbuild can't inline const enums from external packages\nconst enum DecoderConst {\n // Held memory in base64/QOI decoders between images. Zero because each kept\n // decoder pins a wasm memory, and V8 caps those per process (~124 in a\n // sandboxed renderer), so idle terminals must not hold one.\n KEEP_DATA = 0,\n // Initial buffer allocation for the decoder.\n INITIAL_DATA = 1048576,\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n OK = 0\n}\n\n// default IIP header values\nconst DEFAULT_HEADER: IHeaderFields = {\n type: SequenceType.INVALID,\n name: 'Unnamed file',\n size: 0,\n width: 'auto',\n height: 'auto',\n preserveAspectRatio: 1,\n inline: 0\n};\n\n\nexport class IIPHandler implements IOscHandler, IResetHandler {\n private _generation = 0;\n private _aborted = false;\n private _hp = new HeaderParser();\n private _header: IHeaderFields = DEFAULT_HEADER;\n private _dec: Base64Decoder;\n private _qoiDec: QoiDecoder;\n private _isMultipart = false;\n private _abortMulti = false;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _storage: IIPImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n const maxEncodedBytes = Math.ceil(this._opts.iipSizeLimit * 4 / 3);\n const initialBytes = Math.min(DecoderConst.INITIAL_DATA, maxEncodedBytes);\n this._dec = new Base64Decoder(DecoderConst.KEEP_DATA, maxEncodedBytes, initialBytes);\n this._qoiDec = new QoiDecoder(DecoderConst.KEEP_DATA);\n }\n\n public reset(): void {\n this._generation++;\n this._hp.reset();\n this._dec.release();\n this._qoiDec.release();\n }\n\n public start(): void {\n this._aborted = false;\n this._hp.reset();\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (this._hp.state === HeaderState.END) {\n if ((this._dec.put(data.subarray(start, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n }\n } else {\n const dataPos = this._hp.parse(data, start, end);\n if (dataPos === -1) {\n this._aborted = true;\n return;\n }\n if (dataPos > 0) {\n const seqType = this._hp.fields.type;\n if (seqType === SequenceType.FILE) {\n if (this._isMultipart) {\n this._isMultipart = false;\n this._abortMulti = false;\n this._dec.release();\n }\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n if (!this._header.inline) {\n this._aborted = true;\n return;\n }\n if (!this._initDecoder()) {\n this._aborted = true;\n return;\n }\n } else if (this._abortMulti) {\n this._aborted = true;\n return;\n }\n if ((this._dec.put(data.subarray(dataPos, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n if (this._isMultipart) this._abortMulti = true;\n }\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted) return true;\n\n if (this._hp.state !== HeaderState.END) {\n if (this._hp.end()) return true;\n }\n const seqType = this._hp.fields.type;\n\n if (seqType === SequenceType.FILEPART) return true;\n\n if (seqType === SequenceType.REPORTCELLSIZE) {\n // OSC 1337 ; ReportCellSize=[height];[width];[scale] ST\n let w = CELL_SIZE_DEFAULT.width;\n let h = CELL_SIZE_DEFAULT.height;\n if (this._renderer.dimensions) {\n w = this._renderer.dimensions.css.canvas.width / this._coreTerminal.cols;\n h = this._renderer.dimensions.css.canvas.height / this._coreTerminal.rows;\n }\n const scale = this._coreTerminal._core._coreBrowserService?.dpr ?? 1;\n const report = `\\x1b]1337;ReportCellSize=${h.toFixed(3)};${w.toFixed(3)};${scale.toFixed(3)}\\x1b\\\\`;\n this._coreTerminal.input(report, false);\n return true;\n }\n\n if (seqType === SequenceType.MULTIPARTFILE) {\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n this._isMultipart = true;\n this._abortMulti = false;\n this._dec.release();\n if (!this._initDecoder()) {\n this._abortMulti = true;\n }\n return true;\n }\n\n if (seqType === SequenceType.FILEEND) {\n if (!this._isMultipart) return true;\n this._isMultipart = false;\n if (this._abortMulti || this._header.type !== SequenceType.MULTIPARTFILE) return true;\n }\n\n // fallthrough for SequenceType.FILE & SequenceType.FILEEND\n\n let w = 0;\n let h = 0;\n\n // early exit condition chain\n let cond: number | boolean;\n let metrics = UNSUPPORTED_TYPE;\n if (cond = success) {\n if (cond = !this._dec.end()) {\n metrics = imageType(this._dec.data8);\n if (cond = metrics.mime !== 'unsupported') {\n w = metrics.width;\n h = metrics.height;\n if (cond = w && h && w * h < this._opts.pixelLimit) {\n [w, h] = this._resize(w, h).map(Math.floor);\n cond = w && h && w * h < this._opts.pixelLimit;\n } else {\n console.warn(`IIP: image dimension issue ${metrics.width}x${metrics.height}`);\n }\n } else {\n console.warn('IIP: unsupported image type');\n }\n } else {\n console.warn('IIP: error during BASE64 decoding');\n }\n }\n if (!cond) {\n this._dec.release();\n return true;\n }\n\n let blob: Blob | ImageData;\n if (metrics.mime === 'image/qoi') {\n let data: Uint8Array;\n try {\n data = this._qoiDec.decode(this._dec.data8);\n } catch (e) {\n console.warn('IIP: could not decode QOI image', e);\n this._dec.release();\n this._qoiDec.release();\n return true;\n }\n blob = new ImageData(\n new Uint8ClampedArray(data.buffer, data.byteOffset, data.byteLength),\n this._qoiDec.width,\n this._qoiDec.height\n );\n this._qoiDec.release();\n if (w === this._qoiDec.width && h === this._qoiDec.height) {\n // use fast-path if we don't need to rescale\n this._dec.release();\n const canvas = ImageRenderer.createCanvas(undefined, this._qoiDec.width, this._qoiDec.height);\n canvas.getContext('2d')?.putImageData(blob, 0, 0);\n this._storage.addImage(canvas);\n return true;\n }\n } else {\n blob = new Blob([this._dec.data8], { type: metrics.mime });\n }\n this._dec.release();\n const generation = this._generation;\n return createImageBitmap(blob, { resizeWidth: w, resizeHeight: h })\n .then(bm => {\n if (generation !== this._generation) {\n bm.close();\n return true;\n }\n this._storage.addImage(bm);\n return true;\n })\n .catch(e => {\n console.warn(`IIP: decoding error ${metrics.mime} ${metrics.width}x${metrics.height}`, e);\n return true;\n });\n }\n\n // Why: wasm memory exhaustion must drop this image, not throw out of the parser and wedge the write queue.\n private _initDecoder(): boolean {\n try {\n this._dec.init();\n return true;\n } catch (e) {\n console.warn('IIP: could not allocate decoder', e);\n this._dec.release();\n return false;\n }\n }\n\n private _resize(w: number, h: number): [number, number] {\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n const width = this._renderer.dimensions?.css.canvas.width || cw * this._coreTerminal.cols;\n const height = this._renderer.dimensions?.css.canvas.height || ch * this._coreTerminal.rows;\n\n const rw = this._dim(this._header.width!, width, cw);\n const rh = this._dim(this._header.height!, height, ch);\n if (!rw && !rh) {\n const wf = width / w; // TODO: should this respect initial cursor offset?\n const hf = (height - ch) / h; // TODO: fix offset issues from float cell height\n const f = Math.min(wf, hf);\n return f < 1 ? [w * f, h * f] : [w, h];\n }\n return !rw\n ? [w * rh / h, rh]\n : this._header.preserveAspectRatio || !rw || !rh\n ? [rw, h * rw / w] : [rw, rh];\n }\n\n private _dim(s: string, total: number, cdim: number): number {\n if (s === 'auto') return 0;\n if (s.endsWith('%')) return parseInt(s.slice(0, -1), 10) * total / 100;\n if (s.endsWith('px')) return parseInt(s.slice(0, -2), 10);\n return parseInt(s, 10) * cdim;\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// eslint-disable-next-line\ndeclare const Buffer: any;\n\nexport const enum HeaderState {\n START = 0,\n ABORT = 1,\n KEY = 2,\n VALUE = 3,\n END = 4\n}\n\nexport const enum SequenceType {\n INVALID = 0,\n FILE = 1,\n MULTIPARTFILE = 2,\n FILEPART = 3,\n FILEEND = 4,\n REPORTCELLSIZE = 5\n}\n\nexport interface IHeaderFields {\n [key: string]: number | string | Uint32Array | null | undefined;\n // sequence type\n type: SequenceType;\n // base-64 encoded filename. Defaults to \"Unnamed file\".\n name: string;\n // File size in bytes. The file transfer will be canceled if this size is exceeded.\n size: number;\n /**\n * Optional width and height to render:\n * - N: N character cells.\n * - Npx: N pixels.\n * - N%: N percent of the session's width or height.\n * - auto: The image's inherent size will be used to determine an appropriate dimension.\n */\n width?: string;\n height?: string;\n // Optional, defaults to 1 respecting aspect ratio (width takes precedence).\n preserveAspectRatio?: number;\n // Optional, defaults to 0. If set to 1, the file will be displayed inline, else downloaded\n // (download not supported).\n inline?: number;\n}\n\n// field value decoders\n\n// ASCII bytes to string\nfunction toStr(data: Uint32Array): string {\n let s = '';\n for (let i = 0; i < data.length; ++i) {\n s += String.fromCharCode(data[i]);\n }\n return s;\n}\n\n// digits to integer\nfunction toInt(data: Uint32Array): number {\n let v = 0;\n for (let i = 0; i < data.length; ++i) {\n if (data[i] < 48 || data[i] > 57) {\n throw new Error('illegal char');\n }\n v = v * 10 + data[i] - 48;\n }\n return v;\n}\n\n// check for correct size entry\nfunction toSize(data: Uint32Array): string {\n const v = toStr(data);\n if (!v.match(/^((auto)|(\\d+?((px)|(%)){0,1}))$/)) {\n throw new Error('illegal size');\n }\n return v;\n}\n\n// name is base64 encoded utf-8\nfunction toName(data: Uint32Array): string {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(toStr(data), 'base64').toString();\n }\n const bs = atob(toStr(data));\n const b = new Uint8Array(bs.length);\n for (let i = 0; i < b.length; ++i) {\n b[i] = bs.charCodeAt(i);\n }\n return new TextDecoder().decode(b);\n}\n\nconst DECODERS: {[key: string]: (v: Uint32Array) => number | string} = {\n inline: toInt,\n size: toInt,\n name: toName,\n width: toSize,\n height: toSize,\n preserveAspectRatio: toInt\n};\n\n\n// sequence type markers\n// File\nconst FILE_MARKER = [70, 105, 108, 101];\n// MultipartFile\nconst MULTIPARTFILE_MARKER = [77, 117, 108, 116, 105, 112, 97, 114, 116, 70, 105, 108, 101];\n// FilePart\nconst FILEPART_MARKER = [70, 105, 108, 101, 80, 97, 114, 116];\n// FileEnd\nconst FILEEND_MARKER = [70, 105, 108, 101, 69, 110, 100];\n// ReportCellSize\nconst REPORTCELLSIZE_MARKER = [82, 101, 112, 111, 114, 116, 67, 101, 108, 108, 83, 105, 122, 101];\n\n// max allowed chars for sequence header\nconst MAX_FIELDCHARS = 1024;\n\n\nexport class HeaderParser {\n public state: HeaderState = HeaderState.START;\n private _buffer = new Uint32Array(MAX_FIELDCHARS);\n private _position = 0;\n private _key = '';\n public fields: {[key: string]: number | string | Uint32Array | null | undefined} = {};\n\n public reset(): void {\n this._buffer.fill(0);\n this.state = HeaderState.START;\n this._position = 0;\n this.fields = {};\n this._key = '';\n }\n\n public end(): number {\n if (this.state === HeaderState.START) {\n if (this._position === FILEEND_MARKER.length) {\n for (let k = 0; k < FILEEND_MARKER.length; ++k) {\n if (this._buffer[k] !== FILEEND_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEEND;\n this.state = HeaderState.END;\n return 0;\n }\n if (this._position === REPORTCELLSIZE_MARKER.length) {\n for (let k = 0; k < REPORTCELLSIZE_MARKER.length; ++k) {\n if (this._buffer[k] !== REPORTCELLSIZE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.REPORTCELLSIZE;\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n if (this.state === HeaderState.END) return 0;\n if (this.state === HeaderState.VALUE\n && this.fields.type === SequenceType.MULTIPARTFILE\n ) {\n if (!this._storeValue(this._position)) return this._a();\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n\n public parse(data: Uint32Array, start: number, end: number): number {\n let state = this.state;\n let pos = this._position;\n const buffer = this._buffer;\n if (state === HeaderState.ABORT || state === HeaderState.END) return -1;\n if (state === HeaderState.START && pos > 14) return -1;\n for (let i = start; i < end; ++i) {\n const c = data[i];\n switch (c) {\n case 59: // ;\n if (!this._storeValue(pos)) return this._a();\n state = HeaderState.KEY;\n pos = 0;\n break;\n case 61: // =\n if (state === HeaderState.START) {\n if (buffer[0] === 70) {\n // 'File' or 'FilePart'\n let k = 0;\n for (; k < FILE_MARKER.length; ++k) {\n if (buffer[k] !== FILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILE;\n if (pos === FILEPART_MARKER.length) {\n for (; k < FILEPART_MARKER.length; ++k) {\n if (buffer[k] !== FILEPART_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEPART;\n this.state = HeaderState.END;\n return i + 1;\n }\n } else if (buffer[0] === 77) {\n // 'MultipartFile'\n for (let k = 0; k < MULTIPARTFILE_MARKER.length; ++k) {\n if (buffer[k] !== MULTIPARTFILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.MULTIPARTFILE;\n } else {\n return this._a();\n }\n state = HeaderState.KEY;\n pos = 0;\n } else if (state === HeaderState.KEY) {\n if (!this._storeKey(pos)) return this._a();\n state = HeaderState.VALUE;\n pos = 0;\n } else if (state === HeaderState.VALUE) {\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n break;\n case 58: // :\n if (state === HeaderState.VALUE) {\n if (!this._storeValue(pos)) return this._a();\n }\n this.state = HeaderState.END;\n return i + 1;\n default:\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n }\n this.state = state;\n this._position = pos;\n return -2;\n }\n\n private _a(): number {\n this.fields.type = SequenceType.INVALID;\n this.state = HeaderState.ABORT;\n return -1;\n }\n\n private _storeKey(pos: number): boolean {\n const k = toStr(this._buffer.subarray(0, pos));\n if (k) {\n this._key = k;\n this.fields[k] = null;\n return true;\n }\n return false;\n }\n\n private _storeValue(pos: number): boolean {\n if (this._key) {\n try {\n const v = this._buffer.slice(0, pos);\n this.fields[this._key] = DECODERS[this._key] ? DECODERS[this._key](v) : v;\n } catch {\n return false;\n }\n return true;\n }\n return false;\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAddImageOpts } from './Types';\nimport { ImageStorage } from './ImageStorage';\n\n/**\n * IIP (iTerm Image Protocol) specific image storage controller.\n *\n * Wraps the shared ImageStorage with IIP protocol semantics:\n * - Always uses scrolling mode (cursor advances with image)\n */\nexport class IIPImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n constructor(\n private readonly _storage: ImageStorage\n ) {}\n\n /**\n * Add an IIP image to storage.\n * Always uses scrolling mode — cursor advances past the image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._storage.addImage(img, this._addImageOpts);\n }\n}\n","/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n\nexport type ImageType = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/qoi' | 'image/webp' | 'image/avif' | 'unsupported' | '';\n\nexport interface IMetrics {\n mime: ImageType;\n width: number;\n height: number;\n}\n\nexport const UNSUPPORTED_TYPE: IMetrics = {\n mime: 'unsupported',\n width: 0,\n height: 0\n};\n\nexport function imageType(d: Uint8Array): IMetrics {\n if (d.length < 32) {\n return UNSUPPORTED_TYPE;\n }\n const d32 = new Uint32Array(d.buffer, d.byteOffset, 8);\n // PNG: 89 50 4E 47 0D 0A 1A 0A (8 first bytes == magic number for PNG)\n // + first chunk must be IHDR\n if (d32[0] === 0x474E5089 && d32[1] === 0x0A1A0A0D && d32[3] === 0x52444849) {\n return {\n mime: 'image/png',\n width: d[16] << 24 | d[17] << 16 | d[18] << 8 | d[19],\n height: d[20] << 24 | d[21] << 16 | d[22] << 8 | d[23]\n };\n }\n // JPEG: FF D8 FF\n if (d[0] === 0xFF && d[1] === 0xD8 && d[2] === 0xFF) {\n const [width, height] = jpgSize(d);\n return { mime: 'image/jpeg', width, height };\n }\n // GIF: GIF87a or GIF89a\n if (d32[0] === 0x38464947 && (d[4] === 0x37 || d[4] === 0x39) && d[5] === 0x61) {\n return {\n mime: 'image/gif',\n width: d[7] << 8 | d[6],\n height: d[9] << 8 | d[8]\n };\n }\n // QOI: qoif\n if (d32[0] === 0x66696F71) {\n return {\n mime: 'image/qoi',\n width: d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7],\n height: d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11]\n };\n }\n // WEBP: RIFF | xxxx | WEBP | VP8x\n if (d32[0] === 0x46464952 && d32[2] === 0x50424557 && (d32[3] & 0xFFFFFF) === 0x385056) {\n switch (d[15]) {\n case 0x58: // Extended WebP VP8X --> \"X\"\n return {\n mime: 'image/webp',\n width: (d[24] | d[25] << 8 | d[26] << 16) + 1,\n height: (d[27] | d[28] << 8 | d[29] << 16) + 1\n };\n case 0x4C: // Lossless WebP VP8L --> \"L\"\n if (d[20] !== 0x2f) return UNSUPPORTED_TYPE;\n const dim = d[21] | d[22] << 8 | d[23] << 16 | d[24] << 24;\n return {\n mime: 'image/webp',\n width: (dim & 0x3FFF) + 1,\n height: (dim >>> 14 & 0x3FFF) + 1\n };\n case 0x20: // Lossy WebP VP8 --> \" \"\n if (d[23] !== 0x9d || d[24] !== 0x01 || d[25] !== 0x2a) return UNSUPPORTED_TYPE;\n return {\n mime: 'image/webp',\n width: (d[26] | d[27] << 8) & 0x3FFF,\n height: (d[28] | d[29] << 8) & 0x3FFF\n };\n }\n return UNSUPPORTED_TYPE;\n }\n // AVIF: Box size | ftyp | avif/avis\n if (d32[1] === 0x70797466 && (d32[2] === 0x66697661 || d32[2] === 0x73697661)) {\n let pos = -1;\n // search for ispe box within first 1024 bytes\n const limit = Math.min(d.length - 16, 1024);\n for (let i = 8; i < limit; i++) {\n // scan for ispe\n if (d[i] === 0x69 && d[i + 1] === 0x73 && d[i + 2] === 0x70 && d[i + 3] === 0x65) {\n pos = i;\n break;\n }\n }\n if (pos !== -1) {\n // dimensions are in BE at +8 (width) at +12 (height)\n const width =\n d[pos + 8] << 24 |\n d[pos + 9] << 16 |\n d[pos + 10] << 8 |\n d[pos + 11];\n const height =\n d[pos + 12] << 24 |\n d[pos + 13] << 16 |\n d[pos + 14] << 8 |\n d[pos + 15];\n if (width > 0 && height > 0) {\n return { mime: 'image/avif', width, height };\n }\n }\n return UNSUPPORTED_TYPE;\n }\n return UNSUPPORTED_TYPE;\n}\n\n\nfunction jpgSize(d: Uint8Array): [number, number] {\n const len = d.length;\n let i = 4;\n let blockLength = d[i] << 8 | d[i + 1];\n while (true) {\n i += blockLength;\n if (i >= len) {\n // exhausted without size info\n return [0, 0];\n }\n if (d[i] !== 0xFF) {\n return [0, 0];\n }\n if (d[i + 1] === 0xC0 || d[i + 1] === 0xC2) {\n if (i + 8 < len) {\n return [\n d[i + 7] << 8 | d[i + 8],\n d[i + 5] << 8 | d[i + 6]\n ];\n }\n return [0, 0];\n }\n i += 2;\n blockLength = d[i] << 8 | d[i + 1];\n }\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { toRGBA8888 } from 'sixel/lib/Colors';\nimport { IDisposable } from '@xterm/xterm';\nimport { ICellSize, ImageLayer, ITerminalExt, IImageSpec, IRenderDimensions, IRenderService } from './Types';\nimport { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';\n\nconst enum Constants {\n PLACEHOLDER_LENGTH = 4096,\n PLACEHOLDER_HEIGHT = 24\n}\n\n/**\n * ImageRenderer - terminal frontend extension:\n * - provide primitives for canvas, ImageData, Bitmap (static)\n * - add canvas layer to DOM (browser only for now)\n * - draw image tiles onRender\n */\nexport class ImageRenderer extends Disposable implements IDisposable {\n /** @deprecated Kept for backward compat — points to top layer canvas. */\n public get canvas(): HTMLCanvasElement | undefined { return this._layers.get('top')?.canvas; }\n private _layers = new Map();\n private _placeholder: HTMLCanvasElement | undefined;\n private _placeholderBitmap: ImageBitmap | undefined;\n private _optionsRefresh = this._register(new MutableDisposable());\n private _oldOpen: ((parent: HTMLElement) => void) | undefined;\n private _renderService: IRenderService | undefined;\n private _oldSetRenderer: ((renderer: any) => void) | undefined;\n\n // drawing primitive - canvas\n public static createCanvas(localDocument: Document | undefined, width: number, height: number): HTMLCanvasElement {\n /**\n * NOTE: We normally dont care, from which document the canvas\n * gets created, so we can fall back to global document,\n * if the terminal has no document associated yet.\n * This way early image loads before calling .open keep working\n * (still discouraged though, as the metrics will be screwed up).\n * Only the DOM output canvas should be on the terminal's document,\n * which gets explicitly checked in `insertLayerToDom`.\n */\n const canvas = (localDocument ?? document).createElement('canvas');\n canvas.width = width | 0;\n canvas.height = height | 0;\n return canvas;\n }\n\n // drawing primitive - ImageData with optional buffer\n public static createImageData(ctx: CanvasRenderingContext2D, width: number, height: number, buffer?: ArrayBuffer): ImageData {\n if (typeof ImageData !== 'function') {\n const imgData = ctx.createImageData(width, height);\n if (buffer) {\n imgData.data.set(new Uint8ClampedArray(buffer, 0, width * height * 4));\n }\n return imgData;\n }\n return buffer\n ? new ImageData(new Uint8ClampedArray(buffer, 0, width * height * 4), width, height)\n : new ImageData(width, height);\n }\n\n // drawing primitive - ImageBitmap\n public static createImageBitmap(img: ImageBitmapSource): Promise {\n if (typeof createImageBitmap !== 'function') {\n return Promise.resolve(undefined);\n }\n return createImageBitmap(img);\n }\n\n\n constructor(private _terminal: ITerminalExt) {\n super();\n this._oldOpen = this._terminal._core.open;\n this._terminal._core.open = (parent: HTMLElement): void => {\n this._oldOpen?.call(this._terminal._core, parent);\n this._open();\n };\n if (this._terminal._core.screenElement) {\n this._open();\n }\n // hack to spot fontSize changes\n this._optionsRefresh.value = this._terminal._core.optionsService.onOptionChange(option => {\n if (option === 'fontSize') {\n this.rescaleCanvas();\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n });\n this._register(toDisposable(() => {\n this.removeLayerFromDom();\n this.removeLayerFromDom('bottom');\n if (this._terminal._core && this._oldOpen) {\n this._terminal._core.open = this._oldOpen;\n this._oldOpen = undefined;\n }\n if (this._renderService && this._oldSetRenderer) {\n this._renderService.setRenderer = this._oldSetRenderer;\n this._oldSetRenderer = undefined;\n }\n this._renderService = undefined;\n this._layers.clear();\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }));\n }\n\n /**\n * Enable the placeholder.\n */\n public showPlaceholder(value: boolean): void {\n if (value) {\n if (!this._placeholder && this.cellSize.height !== -1) {\n this._createPlaceHolder(Math.max(this.cellSize.height + 1, Constants.PLACEHOLDER_HEIGHT));\n }\n } else {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n\n /**\n * Dimensions of the terminal.\n * Forwarded from internal render service.\n */\n public get dimensions(): IRenderDimensions | undefined {\n return this._terminal.dimensions;\n }\n\n /**\n * Current cell size (float).\n */\n public get cellSize(): ICellSize {\n return {\n width: this.dimensions?.css.cell.width || -1,\n height: this.dimensions?.css.cell.height || -1\n };\n }\n\n /**\n * Clear a region of the image layer canvas.\n */\n public clearLines(start: number, end: number, layer?: ImageLayer): void {\n const y = start * (this.dimensions?.css.cell.height || 0);\n const w = this.dimensions?.css.canvas.width || 0;\n const h = (end + 1 - start) * (this.dimensions?.css.cell.height || 0);\n if (!layer || layer === 'top') {\n this._layers.get('top')?.clearRect(0, y, w, h);\n }\n if (!layer || layer === 'bottom') {\n this._layers.get('bottom')?.clearRect(0, y, w, h);\n }\n }\n\n /**\n * Clear whole image canvas.\n */\n public clearAll(layer?: ImageLayer): void {\n if (!layer || layer === 'top') {\n const ctx = this._layers.get('top');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n if (!layer || layer === 'bottom') {\n const ctx = this._layers.get('bottom');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n }\n\n /**\n * Draw neighboring tiles on the image layer canvas.\n */\n public draw(imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get(imgSpec.layer);\n if (!ctx) {\n return;\n }\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const { width: sourceWidth, height: sourceHeight } = imgSpec.actualCellSize;\n const cols = Math.ceil(img.width / sourceWidth);\n\n const sx = (tileId % cols) * sourceWidth;\n const sy = Math.floor(tileId / cols) * sourceHeight;\n const dx = col * width;\n const dy = row * height;\n\n // safari bug: never access image source out of bounds\n const finalWidth = count * sourceWidth + sx > img.width ? img.width - sx : count * sourceWidth;\n const finalHeight = sy + sourceHeight > img.height ? img.height - sy : sourceHeight;\n\n // Floor all pixel offsets to get stable tile mapping without any overflows.\n // Note: For not pixel perfect aligned cells like in the DOM renderer\n // this will move a tile slightly to the top/left (subpixel range, thus ignore it).\n // FIX #34: avoid striping on displays with pixelDeviceRatio != 1 by ceiling height and width\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.ceil(finalWidth), Math.ceil(finalHeight),\n Math.floor(dx), Math.floor(dy), Math.ceil(finalWidth * width / sourceWidth), Math.ceil(finalHeight * height / sourceHeight)\n );\n }\n\n /**\n * Extract a single tile from an image.\n */\n public extractTile(imgSpec: IImageSpec, tileId: number): HTMLCanvasElement | undefined {\n const { width, height } = this.cellSize;\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const { width: sourceWidth, height: sourceHeight } = imgSpec.actualCellSize;\n const cols = Math.ceil(img.width / sourceWidth);\n const sx = (tileId % cols) * sourceWidth;\n const sy = Math.floor(tileId / cols) * sourceHeight;\n const finalWidth = sourceWidth + sx > img.width ? img.width - sx : sourceWidth;\n const finalHeight = sy + sourceHeight > img.height ? img.height - sy : sourceHeight;\n\n const canvas = ImageRenderer.createCanvas(this.document, Math.ceil(finalWidth * width / sourceWidth), Math.ceil(finalHeight * height / sourceHeight));\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.floor(finalWidth), Math.floor(finalHeight),\n 0, 0, canvas.width, canvas.height\n );\n return canvas;\n }\n }\n\n /**\n * Draw a line with placeholder on the image layer canvas.\n */\n public drawPlaceholder(col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get('top');\n if (ctx) {\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n if (!this._placeholder) {\n this._createPlaceHolder(Math.max(height + 1, Constants.PLACEHOLDER_HEIGHT));\n } else if (height >= this._placeholder!.height) {\n this._createPlaceHolder(height + 1);\n }\n if (!this._placeholder) return;\n ctx.drawImage(\n this._placeholderBitmap ?? this._placeholder!,\n col * width,\n (row * height) % 2 ? 0 : 1, // needs %2 offset correction\n width * count,\n height,\n col * width,\n row * height,\n width * count,\n height\n );\n }\n }\n\n /**\n * Rescale image layer canvas if needed.\n * Checked once from `ImageStorage.render`.\n */\n public rescaleCanvas(): void {\n const w = this.dimensions?.css.canvas.width || 0;\n const h = this.dimensions?.css.canvas.height || 0;\n for (const ctx of this._layers.values()) {\n if (ctx.canvas.width !== w || ctx.canvas.height !== h) {\n ctx.canvas.width = w;\n ctx.canvas.height = h;\n }\n }\n }\n\n /**\n * Rescale image in storage if needed.\n */\n private _rescaleImage(spec: IImageSpec, currentWidth: number, currentHeight: number): void {\n if (currentWidth === spec.actualCellSize.width && currentHeight === spec.actualCellSize.height) {\n return;\n }\n const { width: originalWidth, height: originalHeight } = spec.origCellSize;\n if (currentWidth === originalWidth && currentHeight === originalHeight) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const scaledWidth = Math.ceil(spec.orig!.width * currentWidth / originalWidth);\n const scaledHeight = Math.ceil(spec.orig!.height * currentHeight / originalHeight);\n // Upscale visible tiles directly; a full zoomed copy can dwarf the image budget.\n if (scaledWidth * scaledHeight > spec.orig!.width * spec.orig!.height) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const canvas = ImageRenderer.createCanvas(this.document, scaledWidth, scaledHeight);\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(spec.orig!, 0, 0, canvas.width, canvas.height);\n spec.actual = canvas;\n spec.actualCellSize.width = currentWidth;\n spec.actualCellSize.height = currentHeight;\n }\n }\n\n /**\n * Lazy init for the renderer.\n */\n private _open(): void {\n this._renderService = this._terminal._core._renderService;\n this._oldSetRenderer = this._renderService.setRenderer.bind(this._renderService);\n this._renderService.setRenderer = (renderer: any) => {\n for (const key of [...this._layers.keys()]) {\n this.removeLayerFromDom(key);\n }\n this._oldSetRenderer?.call(this._renderService, renderer);\n };\n }\n\n public insertLayerToDom(layer: ImageLayer = 'top'): void {\n // make sure that the terminal is attached to a document and to DOM\n if (!this.document || !this._terminal._core.screenElement) {\n console.warn('image addon: cannot insert output canvas to DOM, missing document or screenElement');\n return;\n }\n if (this._layers.has(layer)) {\n return;\n }\n const canvas = ImageRenderer.createCanvas(\n this.document, this.dimensions?.css.canvas.width || 0,\n this.dimensions?.css.canvas.height || 0\n );\n canvas.classList.add(`xterm-image-layer-${layer}`);\n const screenElement = this._terminal._core.screenElement;\n // Use isolation to create a stacking context without overriding z-index,\n // which would conflict with integrators (e.g. VS Code) that set their\n // own z-index on the screen element.\n screenElement.style.isolation = 'isolate';\n if (layer === 'bottom') {\n // Use z-index:-1 so it paints behind non-positioned text elements.\n // The screen element needs to be a stacking context (via isolation)\n // to contain the negative z-index, otherwise it would go behind the\n // entire terminal.\n canvas.style.zIndex = '-1';\n screenElement.insertBefore(canvas, screenElement.firstChild);\n } else {\n // Explicit z-index ensures the image canvas reliably stacks above\n // the text layer (DOM renderer rows). z-index: 0 is below the\n // selection overlay (z-index: 1).\n canvas.style.zIndex = '0';\n screenElement.appendChild(canvas);\n }\n const ctx = canvas.getContext('2d', { alpha: true });\n if (!ctx) {\n canvas.remove();\n return;\n }\n this._layers.set(layer, ctx);\n this.clearAll(layer);\n }\n\n public removeLayerFromDom(layer: ImageLayer = 'top'): void {\n const ctx = this._layers.get(layer);\n if (ctx) {\n ctx.canvas.remove();\n this._layers.delete(layer);\n }\n }\n\n public hasLayer(layer: ImageLayer): boolean {\n return this._layers.has(layer);\n }\n\n private _createPlaceHolder(height: number = Constants.PLACEHOLDER_HEIGHT): void {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n\n // create blueprint to fill placeholder with\n const bWidth = 32; // must be 2^n\n const blueprint = ImageRenderer.createCanvas(this.document, bWidth, height);\n const ctx = blueprint.getContext('2d', { alpha: false });\n if (!ctx) return;\n const imgData = ImageRenderer.createImageData(ctx, bWidth, height);\n const d32 = new Uint32Array(imgData.data.buffer);\n const black = toRGBA8888(0, 0, 0);\n const white = toRGBA8888(255, 255, 255);\n d32.fill(black);\n for (let y = 0; y < height; ++y) {\n const shift = y % 2;\n const offset = y * bWidth;\n for (let x = 0; x < bWidth; x += 2) {\n d32[offset + x + shift] = white;\n }\n }\n ctx.putImageData(imgData, 0, 0);\n\n // create placeholder line, width aligned to blueprint width\n const width = (screen.width + bWidth - 1) & ~(bWidth - 1) || Constants.PLACEHOLDER_LENGTH;\n this._placeholder = ImageRenderer.createCanvas(this.document, width, height);\n const ctx2 = this._placeholder.getContext('2d', { alpha: false });\n if (!ctx2) {\n this._placeholder = undefined;\n return;\n }\n for (let i = 0; i < width; i += bWidth) {\n ctx2.drawImage(blueprint, i, 0);\n }\n const placeholder = this._placeholder;\n ImageRenderer.createImageBitmap(placeholder).then(bitmap => {\n if (this._placeholder !== placeholder) bitmap?.close();\n else this._placeholderBitmap = bitmap;\n }).catch(() => {});\n }\n\n public get document(): Document | undefined {\n return this._terminal._core._coreBrowserService?.window.document;\n }\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageRenderer } from './ImageRenderer';\nimport {\n ITerminalExt, IExtendedAttrsImage, IImageAddonOptions, IImageSpec,\n IBufferLineExt, BgFlags, Cell, Content, ICellSize, ExtFlags, Attributes,\n UnderlineStyle, IAddImageOpts\n} from './Types';\n\n\n// fallback default cell size\nexport const CELL_SIZE_DEFAULT: ICellSize = {\n width: 7,\n height: 14\n};\n\n/**\n * Extend extended attribute to also hold image tile information.\n *\n * Object definition is copied from base repo to fully mimick its behavior.\n * Image data is added as additional public properties `imageId` and `tileId`.\n */\nclass ExtendedAttrsImage implements IExtendedAttrsImage {\n private _ext: number = 0;\n public get ext(): number {\n if (this._urlId) {\n return (\n (this._ext & ~ExtFlags.UNDERLINE_STYLE) |\n (this.underlineStyle << 26)\n );\n }\n return this._ext;\n }\n public set ext(value: number) { this._ext = value; }\n\n public get underlineStyle(): UnderlineStyle {\n // Always return the URL style if it has one\n if (this._urlId) {\n return UnderlineStyle.DASHED;\n }\n return (this._ext & ExtFlags.UNDERLINE_STYLE) >> 26;\n }\n public set underlineStyle(value: UnderlineStyle) {\n this._ext &= ~ExtFlags.UNDERLINE_STYLE;\n this._ext |= (value << 26) & ExtFlags.UNDERLINE_STYLE;\n }\n\n public get underlineColor(): number {\n return this._ext & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n public set underlineColor(value: number) {\n this._ext &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n this._ext |= value & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n\n public get underlineVariantOffset(): number {\n const val = (this._ext & ExtFlags.VARIANT_OFFSET) >> 29;\n if (val < 0) {\n return val ^ 0xFFFFFFF8;\n }\n return val;\n }\n public set underlineVariantOffset(value: number) {\n this._ext &= ~ExtFlags.VARIANT_OFFSET;\n this._ext |= (value << 29) & ExtFlags.VARIANT_OFFSET;\n }\n\n private _urlId: number = 0;\n public get urlId(): number {\n return this._urlId;\n }\n public set urlId(value: number) {\n this._urlId = value;\n }\n\n constructor(\n ext: number = 0,\n urlId: number = 0,\n public imageId = -1,\n public tileId = -1\n ) {\n this._ext = ext;\n this._urlId = urlId;\n }\n\n public clone(): IExtendedAttrsImage {\n /**\n * Technically we dont need a clone variant of ExtendedAttrsImage,\n * as we never clone a cell holding image data.\n * Note: Clone is only meant to be used by the InputHandler for\n * sticky attributes, which is never the case for image data.\n * We still provide a proper clone method to reflect the full ext attr\n * state in case there are future use cases for clone.\n */\n return new ExtendedAttrsImage(this._ext, this._urlId, this.imageId, this.tileId);\n }\n\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0 && this.imageId === -1;\n }\n}\nconst EMPTY_ATTRS = new ExtendedAttrsImage();\n\n\n/**\n * ImageStorage - extension of CoreTerminal:\n * - hold image data\n * - write/read image data to/from buffer\n *\n * TODO: image composition for overwrites\n */\nexport class ImageStorage implements IDisposable {\n // storage\n private _images: Map = new Map();\n // last used id\n private _lastId = 0;\n // last evicted id\n private _lowestId = 0;\n // whether a full clear happened before\n private _fullyCleared = false;\n // whether render should do a full clear\n private _needsFullClear = false;\n // hard limit of stored pixels (fallback limit of 10 MB)\n private _pixelLimit: number = 2500000;\n\n private _viewportMetrics: { cols: number, rows: number };\n public onImageAdded: (() => void) | undefined;\n public onImageDeleted: ((storageId: number) => void) | undefined;\n\n constructor(\n private _terminal: ITerminalExt,\n private _renderer: ImageRenderer,\n private _opts: IImageAddonOptions\n ) {\n try {\n this.setLimit(this._opts.storageLimit);\n } catch (e: unknown) {\n if (e instanceof Error) {\n console.error(e.message);\n }\n console.warn(`storageLimit is set to ${this.getLimit()} MB`);\n }\n this._viewportMetrics = {\n cols: this._terminal.cols,\n rows: this._terminal.rows\n };\n }\n\n public dispose(): void {\n this.reset();\n }\n\n public reset(): void {\n for (const spec of this._images.values()) {\n spec.marker?.dispose();\n }\n // NOTE: marker.dispose above already calls ImageBitmap.close\n // therefore we can just wipe the map here\n this._images.clear();\n this._renderer.clearAll();\n }\n\n public getLimit(): number {\n return this._pixelLimit * 4 / 1000000;\n }\n\n public setLimit(value: number): void {\n if (value < 0.5 || value > 1000) {\n throw RangeError('invalid storageLimit, should be at least 0.5 MB and not exceed 1G');\n }\n this._pixelLimit = (value / 4 * 1000000) >>> 0;\n this._evictOldest(0);\n }\n\n public getUsage(): number {\n return this._getStoredPixels() * 4 / 1000000;\n }\n\n private _getStoredPixels(): number {\n let storedPixels = 0;\n for (const spec of this._images.values()) {\n if (spec.orig) {\n storedPixels += spec.orig.width * spec.orig.height;\n if (spec.actual && spec.actual !== spec.orig) {\n storedPixels += spec.actual.width * spec.actual.height;\n }\n }\n }\n return storedPixels;\n }\n\n private _delImg(id: number): void {\n const spec = this._images.get(id);\n if (!spec) return;\n this._images.delete(id);\n // FIXME: really ugly workaround to get bitmaps deallocated :(\n if (window.ImageBitmap && spec.orig instanceof ImageBitmap) {\n spec.orig.close();\n }\n this.onImageDeleted?.(id);\n }\n\n /**\n * Wipe canvas and images on alternate buffer.\n */\n public wipeAlternate(): void {\n // remove all alternate tagged images\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate') {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n // mark canvas to be wiped on next render\n this._needsFullClear = true;\n this._fullyCleared = false;\n }\n\n /**\n * Delete an image by its internal storage ID.\n * Used by protocols that support explicit deletion (e.g. Kitty a=d).\n */\n public deleteImage(id: number): void {\n const spec = this._images.get(id);\n if (spec) {\n spec.marker?.dispose();\n this._delImg(id);\n }\n }\n\n /**\n * Method to add an image to the storage.\n * @param img - The image to add (canvas or bitmap).\n * @param opts - Options for addImage:\n * - scrolling: When true, cursor advances with the image.\n * When false, image is placed at ORIGIN and cursor does not move.\n * - layer: Which canvas layer to render on ('top' or 'bottom').\n * - zIndex: Z-index for image layering within the same layer.\n * - cursorPos: 'vt340' for bottom-left, 'iip' for bottom.right.\n * @returns The internal image ID assigned to the stored image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap, opts: IAddImageOpts): number {\n // never allow storage to exceed memory limit\n this._evictOldest(img.width * img.height);\n\n // calc rows x cols needed to display the image\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const cols = Math.ceil(img.width / cellSize.width);\n const rows = Math.ceil(img.height / cellSize.height);\n\n const imageId = ++this._lastId;\n\n const buffer = this._terminal._core.buffer;\n const termCols = this._terminal.cols;\n const termRows = this._terminal.rows;\n const originX = buffer.x;\n const originY = buffer.y;\n let offset = originX;\n let tileCount = 0;\n\n if (!opts.scrolling) {\n buffer.x = 0;\n buffer.y = 0;\n offset = 0;\n }\n\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(buffer.y + buffer.ybase);\n for (let col = 0; col < cols; ++col) {\n if (offset + col >= termCols) break;\n this._writeToCell(line as IBufferLineExt, offset + col, imageId, row * cols + col);\n tileCount++;\n }\n if (opts.scrolling) {\n if (row < rows - 1) this._terminal._core._inputHandler.lineFeed();\n } else {\n if (++buffer.y >= termRows) break;\n }\n buffer.x = offset;\n }\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n\n // cursor positioning modes\n if (opts.scrolling) {\n if (opts.cursorPos === 'iip') {\n buffer.x = Math.min(offset + cols, termCols);\n } else {\n buffer.x = offset;\n }\n } else {\n buffer.x = originX;\n buffer.y = originY;\n }\n\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.tileCount < 1) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n\n // eviction marker:\n // delete the image when the marker gets disposed\n const endMarker = this._terminal.registerMarker(0);\n endMarker?.onDispose(() => {\n const spec = this._images.get(imageId);\n if (spec) {\n this._delImg(imageId);\n }\n });\n\n // since markers do not work on alternate for some reason,\n // we evict images here manually\n if (this._terminal.buffer.active.type === 'alternate') {\n this._evictOnAlternate();\n }\n\n // create storage entry\n const imgSpec: IImageSpec = {\n orig: img,\n origCellSize: cellSize,\n actual: img,\n actualCellSize: { ...cellSize }, // clone needed, since later modified\n marker: endMarker || undefined,\n tileCount,\n bufferType: this._terminal.buffer.active.type,\n layer: opts.layer,\n zIndex: opts.zIndex\n };\n\n // finally add the image\n this._images.set(imageId, imgSpec);\n this.onImageAdded?.();\n return imageId;\n }\n\n\n /**\n * Render method. Collects buffer information and triggers\n * canvas updates.\n */\n // TODO: Should we move this to the ImageRenderer?\n public render(range: { start: number, end: number }): void {\n // Determine which layers have images\n let hasTopImages = false;\n let hasBottomImages = false;\n for (const spec of this._images.values()) {\n if (spec.layer === 'bottom') {\n hasBottomImages = true;\n } else {\n hasTopImages = true;\n }\n if (hasTopImages && hasBottomImages) break;\n }\n\n // Lazily insert layers that are needed\n if (hasTopImages && !this._renderer.hasLayer('top')) {\n this._renderer.insertLayerToDom('top');\n if (!this._renderer.hasLayer('top')) return;\n }\n if (hasBottomImages && !this._renderer.hasLayer('bottom')) {\n this._renderer.insertLayerToDom('bottom');\n }\n\n // rescale if needed\n this._renderer.rescaleCanvas();\n\n // exit early if we dont have any images to test for\n if (!this._images.size) {\n if (!this._fullyCleared) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n if (this._renderer.hasLayer('top')) {\n this._renderer.removeLayerFromDom('top');\n }\n if (this._renderer.hasLayer('bottom')) {\n this._renderer.removeLayerFromDom('bottom');\n }\n return;\n }\n\n // Remove layers no longer needed\n if (!hasTopImages && this._renderer.hasLayer('top')) {\n this._renderer.clearAll('top');\n this._renderer.removeLayerFromDom('top');\n }\n if (!hasBottomImages && this._renderer.hasLayer('bottom')) {\n this._renderer.clearAll('bottom');\n this._renderer.removeLayerFromDom('bottom');\n }\n\n // buffer switches force a full clear\n if (this._needsFullClear) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n\n const { start, end } = range;\n const buffer = this._terminal._core.buffer;\n const cols = this._terminal._core.cols;\n\n // clear drawing area\n this._renderer.clearLines(start, end);\n\n // Collect draw calls so we can sort by z-index (lower z drawn first).\n const drawCalls: { imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number }[] = [];\n const placeholderCalls: { col: number, row: number, count: number }[] = [];\n\n // walk all cells in viewport and collect tiles found\n for (let row = start; row <= end; ++row) {\n const line = buffer.lines.get(row + buffer.ydisp) as IBufferLineExt;\n if (!line) return;\n for (let col = 0; col < cols; ++col) {\n if (line.getBg(col) & BgFlags.HAS_EXTENDED) {\n let e: IExtendedAttrsImage = line._extendedAttrs[col] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (e.tileId !== -1) {\n const startTile = e.tileId;\n const startCol = col;\n let count = 1;\n /**\n * merge tiles to the right into a single draw call, if:\n * - not at end of line\n * - cell has same image id\n * - cell has consecutive tile id\n */\n while (\n ++col < cols\n && (line.getBg(col) & BgFlags.HAS_EXTENDED)\n && (e = line._extendedAttrs[col] ?? EMPTY_ATTRS)\n && (e.imageId === imageId)\n && (e.tileId === startTile + count)\n ) {\n count++;\n }\n col--;\n if (imgSpec) {\n if (imgSpec.actual) {\n drawCalls.push({ imgSpec, tileId: startTile, col: startCol, row, count });\n }\n } else if (this._opts.showPlaceholder) {\n placeholderCalls.push({ col: startCol, row, count });\n }\n this._fullyCleared = false;\n }\n }\n }\n }\n\n // Sort by z-index so lower z draws first (higher z renders on top)\n drawCalls.sort((a, b) => a.imgSpec.zIndex - b.imgSpec.zIndex);\n\n // Draw placeholders first (lowest priority)\n for (const call of placeholderCalls) {\n this._renderer.drawPlaceholder(call.col, call.row, call.count);\n }\n\n // Draw images in z-index order\n for (const call of drawCalls) {\n this._renderer.draw(call.imgSpec, call.tileId, call.col, call.row, call.count);\n }\n }\n\n public viewportResize(metrics: { cols: number, rows: number }): void {\n // exit early if we have nothing in storage\n if (!this._images.size) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // handle only viewport width enlargements, exit all other cases\n // TODO: needs patch for tile counter\n if (this._viewportMetrics.cols >= metrics.cols) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // walk scrollbuffer at old col width to find all possible expansion matches\n const buffer = this._terminal._core.buffer;\n const rows = buffer.lines.length;\n const oldCol = this._viewportMetrics.cols - 1;\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(row) as IBufferLineExt;\n if (line.getBg(oldCol) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[oldCol] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (!imgSpec) {\n continue;\n }\n // found an image tile at oldCol, check if it qualifies for right exapansion\n const tilesPerRow = Math.ceil((imgSpec.actual?.width || 0) / imgSpec.actualCellSize.width);\n if ((e.tileId % tilesPerRow) + 1 >= tilesPerRow) {\n continue;\n }\n // expand only if right side is empty (nothing got wrapped from below)\n let hasData = false;\n for (let rightCol = oldCol + 1; rightCol > metrics.cols; ++rightCol) {\n if (line._data[rightCol * Cell.SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK) {\n hasData = true;\n break;\n }\n }\n if (hasData) {\n continue;\n }\n // do right expansion on terminal buffer\n const end = Math.min(metrics.cols, tilesPerRow - (e.tileId % tilesPerRow) + oldCol);\n let lastTile = e.tileId;\n for (let expandCol = oldCol + 1; expandCol < end; ++expandCol) {\n this._writeToCell(line as IBufferLineExt, expandCol, imageId, ++lastTile);\n imgSpec.tileCount++;\n }\n }\n }\n // store new viewport metrics\n this._viewportMetrics = metrics;\n }\n\n /**\n * Retrieve original canvas at buffer position.\n */\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1) {\n const orig = this._images.get(e.imageId)?.orig;\n if (window.ImageBitmap && orig instanceof ImageBitmap) {\n const canvas = ImageRenderer.createCanvas(window.document, orig.width, orig.height);\n canvas.getContext('2d')?.drawImage(orig, 0, 0, orig.width, orig.height);\n return canvas;\n }\n return orig as HTMLCanvasElement;\n }\n }\n }\n\n /**\n * Extract active single tile at buffer position.\n */\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1 && e.tileId !== -1) {\n const spec = this._images.get(e.imageId);\n if (spec) {\n return this._renderer.extractTile(spec, e.tileId);\n }\n }\n }\n }\n\n // TODO: Do we need some blob offloading tricks here to avoid early eviction?\n // also see https://stackoverflow.com/questions/28307789/is-there-any-limitation-on-javascript-max-blob-size\n private _evictOldest(room: number): number {\n const used = this._getStoredPixels();\n let current = used;\n while (this._pixelLimit < current + room && this._images.size) {\n const spec = this._images.get(++this._lowestId);\n if (spec && spec.orig) {\n current -= spec.orig.width * spec.orig.height;\n if (spec.actual && spec.orig !== spec.actual) {\n current -= spec.actual.width * spec.actual.height;\n }\n spec.marker?.dispose();\n this._delImg(this._lowestId);\n }\n }\n return used - current;\n }\n\n private _writeToCell(line: IBufferLineExt, x: number, imageId: number, tileId: number): void {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const old = line._extendedAttrs[x];\n if (old) {\n if (old.imageId !== undefined) {\n // found an old ExtendedAttrsImage, since we know that\n // they are always isolated instances (single cell usage),\n // we can re-use it and just update their id entries\n const oldSpec = this._images.get(old.imageId);\n if (oldSpec) {\n // early eviction for in-viewport overwrites\n oldSpec.tileCount--;\n }\n old.imageId = imageId;\n old.tileId = tileId;\n return;\n }\n // found a plain ExtendedAttrs instance, clone it to new entry\n line._extendedAttrs[x] = new ExtendedAttrsImage(old.ext, old.urlId, imageId, tileId);\n return;\n }\n }\n // fall-through: always create new ExtendedAttrsImage entry\n line._data[x * Cell.SIZE + Cell.BG] |= BgFlags.HAS_EXTENDED;\n line._extendedAttrs[x] = new ExtendedAttrsImage(0, 0, imageId, tileId);\n }\n\n private _evictOnAlternate(): void {\n // nullify tile count of all images on alternate buffer\n for (const spec of this._images.values()) {\n if (spec.bufferType === 'alternate') {\n spec.tileCount = 0;\n }\n }\n // re-count tiles on whole buffer\n const buffer = this._terminal._core.buffer;\n for (let y = 0; y < this._terminal.rows; ++y) {\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (!line) {\n continue;\n }\n for (let x = 0; x < this._terminal.cols; ++x) {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const imgId = line._extendedAttrs[x]?.imageId;\n if (imgId) {\n const spec = this._images.get(imgId);\n if (spec) {\n spec.tileCount++;\n }\n }\n }\n }\n }\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate' && !spec.tileCount) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n }\n}\n","/**\n * Copyright (c) 2020, 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IDcsHandler, IParams, IImageAddonOptions, ITerminalExt, AttributeData, IResetHandler, ReadonlyColorSet } from './Types';\nimport { toRGBA8888, BIG_ENDIAN, PALETTE_ANSI_256, PALETTE_VT340_COLOR } from 'sixel/lib/Colors';\nimport { RGBA8888 } from 'sixel/lib/Types';\nimport { ImageRenderer } from './ImageRenderer';\n\nimport { DecoderAsync, Decoder } from 'sixel/lib/Decoder';\nimport { LIMITS } from 'sixel/lib/wasm';\n\n// always free decoder ressources after decoding if it exceeds this limit\nconst MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB\n\n// custom default palette: VT340 (lower 16 colors) + ANSI256 (up to 256) + zeroed (up to 4096)\nconst DEFAULT_PALETTE = PALETTE_ANSI_256;\nDEFAULT_PALETTE.set(PALETTE_VT340_COLOR);\n\n// Why pooled: every decoder owns a wasm memory, and V8 caps live wasm memories\n// per process (~124 in a sandboxed renderer). Terminals borrow a decoder only\n// while a SIXEL sequence is open, so idle terminals hold none.\nconst MAX_IDLE_DECODERS = 2;\nconst idleDecoders = new Map();\nlet poolPrimed = false;\n\nfunction primeDecoderPool(memoryLimit: number): void {\n if (poolPrimed) return;\n poolPrimed = true;\n // Async compile once, off the parser's hot path; later decoders reuse the cached module.\n DecoderAsync({ memoryLimit, palette: DEFAULT_PALETTE }).then(\n d => releaseDecoder(d, memoryLimit),\n () => { poolPrimed = false; }\n );\n}\n\nfunction acquireDecoder(memoryLimit: number): Decoder {\n return idleDecoders.get(memoryLimit)?.pop() ?? new Decoder({ memoryLimit, palette: DEFAULT_PALETTE });\n}\n\nfunction releaseDecoder(dec: Decoder, memoryLimit: number): void {\n if (dec.memoryUsage > MEM_PERMA_LIMIT) {\n dec.release();\n }\n const idle = idleDecoders.get(memoryLimit) ?? [];\n if (idle.length < MAX_IDLE_DECODERS) {\n idle.push(dec);\n idleDecoders.set(memoryLimit, idle);\n }\n}\n\n\nexport class SixelHandler implements IDcsHandler, IResetHandler {\n private _size = 0;\n private _aborted = false;\n private _dec: Decoder | undefined;\n private _decMemoryLimit = 0;\n // Color registers outlive a single image, so they live here rather than in a pooled decoder.\n private readonly _palette = new Uint32Array(LIMITS.PALETTE_SIZE);\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _storage: SixelImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n this._palette.set(DEFAULT_PALETTE);\n primeDecoderPool(this._opts.pixelLimit * 4);\n }\n\n public reset(): void {\n this._returnDecoder();\n this._palette.fill(0);\n this._palette.set(DEFAULT_PALETTE);\n }\n\n public hook(params: IParams): void {\n this._size = 0;\n this._aborted = false;\n this._returnDecoder();\n const memoryLimit = this._opts.pixelLimit * 4;\n try {\n this._dec = acquireDecoder(memoryLimit);\n } catch (e) {\n // Why: exhausting wasm memory must drop this image, not throw out of the parser and wedge the write queue.\n console.warn(`SIXEL: could not allocate decoder - ${e}`);\n this._aborted = true;\n return;\n }\n this._decMemoryLimit = memoryLimit;\n const fillColor = params.params[1] === 1 ? 0 : extractActiveBg(\n this._coreTerminal._core._inputHandler._curAttrData,\n this._coreTerminal._core._themeService?.colors);\n this._dec.init(fillColor, this._palette, this._opts.sixelPaletteLimit);\n }\n\n private _returnDecoder(): void {\n const dec = this._dec;\n if (!dec) return;\n this._dec = undefined;\n this._palette.set(dec.palette);\n releaseDecoder(dec, this._decMemoryLimit);\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted || !this._dec) {\n return;\n }\n this._size += end - start;\n if (this._size > this._opts.sixelSizeLimit) {\n console.warn(`SIXEL: too much data, aborting`);\n this._aborted = true;\n this._dec.release();\n return;\n }\n try {\n this._dec.decode(data, start, end);\n } catch (e) {\n console.warn(`SIXEL: error while decoding image - ${e}`);\n this._aborted = true;\n this._dec.release();\n }\n }\n\n public unhook(success: boolean): boolean | Promise {\n try {\n return this._unhook(success);\n } finally {\n this._returnDecoder();\n }\n }\n\n private _unhook(success: boolean): boolean {\n if (this._aborted || !success || !this._dec) {\n return true;\n }\n\n const width = this._dec.width;\n const height = this._dec.height;\n\n // partial fix for https://github.com/jerch/xterm-addon-image/issues/37\n if (!width || !height) {\n if (height) {\n this._storage.advanceCursor(height);\n }\n return true;\n }\n\n const canvas = ImageRenderer.createCanvas(undefined, width, height);\n canvas.getContext('2d')?.putImageData(new ImageData(this._dec.data8 as Uint8ClampedArray, width, height), 0, 0);\n this._storage.addImage(canvas);\n return true;\n }\n}\n\n\n/**\n * Some helpers to extract current terminal colors.\n */\n\n// get currently active background color from terminal\n// also respect INVERSE setting\nfunction extractActiveBg(attr: AttributeData, colors: ReadonlyColorSet | undefined): RGBA8888 {\n let bg = 0;\n if (!colors) {\n // FIXME: theme service is prolly not available yet,\n // happens if .open() was not called yet (bug in core?)\n return bg;\n }\n if (attr.isInverse()) {\n if (attr.isFgDefault()) {\n bg = convertLe(colors.foreground.rgba);\n } else if (attr.isFgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getFgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getFgColor()].rgba);\n }\n } else {\n if (attr.isBgDefault()) {\n bg = convertLe(colors.background.rgba);\n } else if (attr.isBgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getBgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getBgColor()].rgba);\n }\n }\n return bg;\n}\n\n// rgba values on the color managers are always in BE, thus convert to LE\nfunction convertLe(color: number): RGBA8888 {\n if (BIG_ENDIAN) return color;\n return (color & 0xFF) << 24 | (color >>> 8 & 0xFF) << 16 | (color >>> 16 & 0xFF) << 8 | color >>> 24 & 0xFF;\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { IImageAddonOptions, ITerminalExt, IAddImageOpts } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\n\n/**\n * Sixel-specific image storage controller.\n *\n * Wraps the shared ImageStorage with sixel protocol semantics:\n * - Cursor behavior governed by DECSET 80 (sixelScrolling option)\n * - advanceCursor for empty sixels carrying only height\n */\nexport class SixelImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'vt340' };\n constructor(\n private readonly _storage: ImageStorage,\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _terminal: ITerminalExt\n ) {}\n\n /**\n * Add a sixel image to storage.\n * Cursor behavior depends on the sixelScrolling option (DECSET 80).\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._addImageOpts.scrolling = this._opts.sixelScrolling;\n this._storage.addImage(img, this._addImageOpts);\n }\n\n /**\n * Only advance text cursor.\n * This is an edge case from empty sixels carrying only a height but no pixels.\n * Partially fixes https://github.com/jerch/xterm-addon-image/issues/37.\n */\n public advanceCursor(height: number): void {\n if (this._opts.sixelScrolling) {\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const rows = Math.ceil(height / cellSize.height);\n for (let i = 1; i < rows; ++i) {\n this._terminal._core._inputHandler.lineFeed();\n }\n }\n }\n}\n","/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { IApcHandler, IImageAddonOptions, IResetHandler, ITerminalExt, ImageLayer } from '../Types';\nimport { ImageRenderer } from '../ImageRenderer';\nimport { CELL_SIZE_DEFAULT } from '../ImageStorage';\nimport { imageType } from '../IIPMetrics';\nimport { KittyImageStorage } from './KittyImageStorage';\nimport Base64Decoder, { type DecodeStatus } from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport {\n KittyAction,\n KittyFormat,\n KittyCompression,\n IKittyCommand,\n IPendingTransmission,\n IKittyImageData,\n KittyPixelConstants,\n parseKittyCommand\n} from './KittyGraphicsTypes';\n\nconst enum Constants {\n // Memory limit for base64 decoder (4MB, same as IIPHandler)\n DECODER_KEEP_DATA = 4194304,\n DECODER_INITIAL_DATA = 4194304, // 4MB\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n DECODER_OK = 0,\n // Maximum control data size\n MAX_CONTROL_DATA_SIZE = 512,\n // Semicolon codepoint\n SEMICOLON = 0x3B\n}\n\nconst DECODER_OK = Constants.DECODER_OK as unknown as DecodeStatus.OK;\n\n// Kitty graphics protocol handler with streaming base64 decoding.\nexport class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDisposable {\n private _aborted = false;\n private _generation = 0;\n private _decodeError = false;\n\n private _activeDecoder: Base64Decoder | null = null;\n private readonly _maxEncodedBytes: number;\n private readonly _initialEncodedBytes: number;\n\n // Streaming related states\n\n // True while receiving control data (before semicolon).\n private _inControlData = true;\n\n // Buffer for control data.\n private _controlData = new Uint32Array(Constants.MAX_CONTROL_DATA_SIZE);\n private _controlLength = 0;\n\n // Pre-calculated encoded size limit\n private _encodedSizeLimit = 0;\n private _totalEncodedSize = 0;\n\n // Parsed command. These are the control data before semicolon.\n private _parsedCommand: IKittyCommand | null = null;\n\n // Storage related states\n\n private _pendingTransmissions: Map = new Map();\n // Tracks the pending key of the most recently started chunked upload.\n // Per spec, subsequent chunks only need m= (and optionally q=), without i=.\n // When a chunk arrives with no i=, this key is used to find the pending upload.\n private _lastPendingKey: number | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _kittyStorage: KittyImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n // Convert decoded size limit -> max encoded bytes.\n this._maxEncodedBytes = Math.ceil(this._opts.kittySizeLimit * 4 / 3);\n // ensure we preallocate more than configured limit while using 4mb initial size.\n this._initialEncodedBytes = Math.min(Constants.DECODER_INITIAL_DATA, this._maxEncodedBytes);\n }\n\n public reset(): void {\n this._generation++;\n this._cleanupAllPending();\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n this._kittyStorage.reset();\n }\n\n public dispose(): void {\n this.reset();\n }\n\n private _removePendingEntry(key: number): void {\n this._pendingTransmissions.delete(key);\n if (this._lastPendingKey === key) {\n this._lastPendingKey = undefined;\n }\n }\n\n private _cleanupAllPending(): void {\n for (const pending of this._pendingTransmissions.values()) {\n pending.decoder.release();\n }\n this._pendingTransmissions.clear();\n this._lastPendingKey = undefined;\n }\n\n public start(): void {\n this._aborted = false;\n this._decodeError = false;\n this._inControlData = true;\n this._controlLength = 0;\n this._parsedCommand = null;\n // Pre-calculate encoded limit once: base64 is 4 bytes encoded → 3 bytes decoded\n this._encodedSizeLimit = this._maxEncodedBytes;\n this._totalEncodedSize = 0;\n this._activeDecoder = null;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (!this._inControlData) {\n this._streamPayload(data, start, end);\n } else {\n // Scan for semicolon\n let controlEnd = end;\n for (let i = start; i < end; i++) {\n if (data[i] === Constants.SEMICOLON) {\n this._inControlData = false;\n controlEnd = i;\n break;\n }\n }\n\n // Copy control data\n const copyLength = controlEnd - start;\n if (this._controlLength + copyLength > Constants.MAX_CONTROL_DATA_SIZE) {\n this._aborted = true;\n return;\n }\n this._controlData.set(data.subarray(start, controlEnd), this._controlLength);\n this._controlLength += copyLength;\n\n if (!this._inControlData) {\n // Found semicolon - parse control data early for validation\n this._parsedCommand = parseKittyCommand(this._parseControlDataString());\n\n // Early validation: i+I conflict\n if (this._parsedCommand.id !== undefined && this._parsedCommand.imageNumber !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'EINVAL:cannot specify both i and I keys', this._parsedCommand.quiet ?? 0);\n this._aborted = true;\n return;\n }\n\n // Delete action doesn't need payload - skip streaming\n if (this._parsedCommand.action === KittyAction.DELETE) {\n return;\n }\n\n // Stream remaining as payload\n const payloadStart = controlEnd + 1;\n if (payloadStart < end) {\n this._streamPayload(data, payloadStart, end);\n }\n }\n }\n }\n\n // Stream payload bytes into the base64 decoder.\n private _streamPayload(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n // Check size limit (compare encoded bytes against pre-calculated limit)\n // Include cumulative size from pending transmission for multi-chunk images.\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = this._parsedCommand?.id ?? this._lastPendingKey ?? 0;\n const pending = this._pendingTransmissions.get(pendingKey);\n const previousEncodedSize = pending?.totalEncodedSize ?? 0;\n this._totalEncodedSize += end - start;\n const cumulativeEncodedSize = previousEncodedSize + this._totalEncodedSize;\n if (cumulativeEncodedSize > this._encodedSizeLimit) {\n const decoderToRelease = this._activeDecoder ?? pending?.decoder;\n if (decoderToRelease) {\n decoderToRelease.release();\n }\n this._activeDecoder = null;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n this._aborted = true;\n return;\n }\n\n if (this._decodeError) return;\n\n if (pending?.decoder && !this._activeDecoder) {\n this._activeDecoder = pending.decoder;\n }\n if (!this._activeDecoder) {\n // Budget WASM capacity, including one page of decoder state and rounding.\n const decoderCapacity = this._maxEncodedBytes + 131072;\n if (decoderCapacity > this._opts.storageLimit * 1000000) {\n this._aborted = true;\n if (this._parsedCommand?.id !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'ENOMEM:pending image budget exceeded', this._parsedCommand.quiet ?? 0);\n }\n return;\n }\n const maxPending = Math.max(1, Math.floor(this._opts.storageLimit * 1000000 / decoderCapacity));\n while (this._pendingTransmissions.size >= maxPending) {\n const oldest = this._pendingTransmissions.entries().next().value;\n if (!oldest) break;\n oldest[1].decoder.release();\n this._removePendingEntry(oldest[0]);\n if (oldest[1].cmd.id !== undefined) {\n this._sendResponse(oldest[1].cmd.id, 'ENOMEM:pending image budget exceeded', oldest[1].cmd.quiet ?? 0);\n }\n }\n const decoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes);\n try {\n decoder.init();\n } catch (e) {\n // Why: wasm memory exhaustion must drop this image, not throw out of the parser and wedge the write queue.\n console.warn('KITTY: could not allocate decoder', e);\n this._aborted = true;\n if (this._parsedCommand?.id !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'ENOMEM:could not allocate decoder', this._parsedCommand.quiet ?? 0);\n }\n return;\n }\n this._activeDecoder = decoder;\n }\n\n if (this._activeDecoder.put(data.subarray(start, end)) !== DECODER_OK) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n this._decodeError = true;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted || !success) {\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n return true;\n }\n\n // No semicolon = no payload (delete, capability query)\n if (this._inControlData) {\n return this._handleNoPayloadCommand();\n }\n\n // Use command parsed early in put() - i+I already validated there\n const cmd = this._parsedCommand!;\n\n // Delete action was handled by skipping payload - just execute\n if (cmd.action === KittyAction.DELETE) {\n return this._handleDelete(cmd);\n }\n\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = cmd.id ?? this._lastPendingKey ?? 0;\n const isMoreComing = cmd.more === 1;\n const pending = this._pendingTransmissions.get(pendingKey);\n\n if (isMoreComing) {\n if (this._activeDecoder) {\n if (pending) {\n pending.totalEncodedSize += this._totalEncodedSize;\n pending.decodeError = pending.decodeError || this._decodeError;\n } else {\n this._pendingTransmissions.set(pendingKey, {\n cmd: { ...cmd },\n decoder: this._activeDecoder,\n totalEncodedSize: this._totalEncodedSize,\n decodeError: this._decodeError\n });\n }\n this._lastPendingKey = pendingKey;\n this._activeDecoder = null;\n }\n return true;\n }\n\n // Final chunk received — clear the last pending key\n if (pending) {\n this._lastPendingKey = undefined;\n }\n\n let decodeError = this._decodeError;\n let finalCmd = cmd;\n let decoder = this._activeDecoder;\n\n if (pending) {\n finalCmd = pending.cmd;\n decoder = pending.decoder;\n decodeError = decodeError || pending.decodeError;\n this._pendingTransmissions.delete(pendingKey);\n }\n\n let imageBytes = new Uint8Array(0);\n if (decoder) {\n if (decoder.end() !== DECODER_OK) {\n decodeError = true;\n }\n imageBytes = decoder.data8;\n }\n this._activeDecoder = null;\n\n // Handle command first — handlers create Blob/ImageData from imageBytes,\n // which copies the data. Only then is it safe to release the decoder's\n // wasm memory that imageBytes points into.\n const result = this._handleCommandWithBytesAndCmd(finalCmd, imageBytes, decodeError);\n if (decoder) {\n decoder.release();\n }\n return result;\n }\n\n // Command handling\n\n private _parseControlDataString(): string {\n let str = '';\n for (let i = 0; i < this._controlLength; i++) {\n str += String.fromCodePoint(this._controlData[i]);\n }\n return str;\n }\n\n private _handleNoPayloadCommand(): boolean | Promise {\n const cmd = parseKittyCommand(this._parseControlDataString());\n\n // Per spec: specifying both i and I is an error\n if (cmd.id !== undefined && cmd.imageNumber !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:cannot specify both i and I keys', cmd.quiet ?? 0);\n return true;\n }\n\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.DELETE:\n return this._handleDelete(cmd);\n case KittyAction.QUERY:\n this._sendResponse(cmd.id ?? 0, 'OK', cmd.quiet ?? 0);\n return true;\n case KittyAction.PLACEMENT:\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handleCommandWithBytesAndCmd(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.TRANSMIT: {\n const result = this._handleTransmit(cmd, bytes, decodeError);\n // Only send response when _handleTransmit didn't already respond\n // (it handles unsupported transmission medium responses internally)\n if ((cmd.transmission ?? 'd') === 'd' && cmd.id !== undefined) {\n if (decodeError) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n } else if (bytes.length > 0) {\n this._sendResponse(cmd.id, 'OK', cmd.quiet ?? 0);\n }\n }\n return result;\n }\n case KittyAction.TRANSMIT_DISPLAY:\n return this._handleTransmitDisplay(cmd, bytes, decodeError);\n case KittyAction.QUERY:\n return this._handleQuery(cmd, bytes, decodeError);\n case KittyAction.PLACEMENT:\n // a=p ignores any payload — image data was already transmitted\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handlePlacement(cmd: IKittyCommand): boolean | Promise {\n if (cmd.id === undefined) {\n return true;\n }\n const id = cmd.id;\n const image = this._kittyStorage.getImage(id);\n if (!image) {\n this._sendResponse(id, 'ENOENT:image not found', cmd.quiet ?? 0, cmd.placementId);\n return true;\n }\n const result = this._displayImage(image, cmd);\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0, cmd.placementId);\n return true;\n });\n }\n\n private _handleTransmit(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n // TODO: Support file-based transmission modes (t=f, t=t, t=s)\n // Currently only supports direct transmission (t=d, the default).\n // - t=f (file): Payload is base64-encoded file path. Terminal reads image from that path.\n // - t=t (temp file): Payload is base64-encoded path in temp directory. Terminal reads, deletes.\n // - t=s: Payload is base64-encoded POSIX shm name. Terminal reads from shared memory.\n // These modes require filesystem/IPC access not available in browsers. For Node.js/Electron:\n // 1. Check cmd.transmission (t key) before treating bytes as image data\n // 2. For t=f/t/s: decode bytes as UTF-8 string (the path/name), then read file contents\n // 3. For t=d: treat bytes as image data (current behavior)\n // When implementing, also update _handleQuery to accept these transmission mediums.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported transmission medium', cmd.quiet ?? 0);\n }\n return true;\n }\n\n if (decodeError || bytes.length === 0) return true;\n\n this._kittyStorage.storeImage(cmd.id, {\n data: new Blob([bytes as BlobPart]),\n width: cmd.width ?? 0,\n height: cmd.height ?? 0,\n format: (cmd.format ?? KittyFormat.RGBA) as 24 | 32 | 100,\n compression: cmd.compression ?? ''\n });\n return true;\n }\n\n private _handleTransmitDisplay(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n if (decodeError) {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n }\n return true;\n }\n\n this._handleTransmit(cmd, bytes, decodeError);\n\n const id = cmd.id ?? this._kittyStorage.lastImageId;\n const image = this._kittyStorage.getImage(id);\n if (image) {\n const result = this._displayImage(image, cmd);\n if (cmd.id !== undefined) {\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0);\n return true;\n });\n }\n return result.then(() => true);\n }\n return true;\n }\n\n private _handleQuery(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n const id = cmd.id ?? 0;\n const quiet = cmd.quiet ?? 0;\n\n // Per spec: reject unsupported transmission mediums (only t=d is supported atm)\n // TODO: When filesystem support is added (Node.js/Electron), update this to accept\n // t=f (file), t=t (temp file), and t=s (shared memory) and respond OK for queries.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n this._sendResponse(id, 'EINVAL:unsupported transmission medium', quiet);\n return true;\n }\n\n // Check decode error first (invalid base64)\n if (decodeError) {\n this._sendResponse(id, 'EINVAL:invalid base64 data', quiet);\n return true;\n }\n\n // Capability query (no payload) - just respond OK\n if (bytes.length === 0) {\n this._sendResponse(id, 'OK', quiet);\n return true;\n }\n\n const format = cmd.format ?? KittyFormat.RGBA;\n\n if (format === KittyFormat.PNG) {\n this._sendResponse(id, 'OK', quiet);\n } else {\n const width = cmd.width ?? 0;\n const height = cmd.height ?? 0;\n\n if (!width || !height) {\n this._sendResponse(id, 'EINVAL:width and height required for raw pixel data', quiet);\n return true;\n }\n\n const bytesPerPixel = format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n this._sendResponse(id, `EINVAL:insufficient pixel data`, quiet);\n return true;\n }\n\n this._sendResponse(id, 'OK', quiet);\n }\n return true;\n }\n\n private _handleDelete(cmd: IKittyCommand): boolean {\n // Per spec: default delete selector is 'a' (delete all visible placements)\n const selector = cmd.deleteSelector ?? 'a';\n\n // TODO: Distinguish lowercase (delete placements only) from uppercase\n // (delete placements + free stored image data). Currently both variants\n // free everything since we don't separate stored data from placements.\n switch (selector) {\n case 'a':\n case 'A':\n this._cleanupAllPending();\n this._kittyStorage.deleteAll();\n break;\n case 'i':\n case 'I':\n // TODO: When placement id tracking is implemented (see TODO in\n // KittyImageStorage), d=i with p= should delete only that\n // specific placement, while d=i without p should delete all\n // placements for the image.\n if (cmd.id !== undefined) {\n const pending = this._pendingTransmissions.get(cmd.id);\n if (pending) {\n pending.decoder.release();\n }\n this._removePendingEntry(cmd.id);\n this._kittyStorage.deleteById(cmd.id);\n }\n break;\n default:\n // Unsupported selectors (c, n, p, q, r, x, y, z, f) — ignore for now\n break;\n }\n return true;\n }\n\n private _sendResponse(id: number, message: string, quiet: number, placementId?: number): void {\n const isOk = message === 'OK';\n if (isOk && quiet >= 1) return;\n if (!isOk && quiet >= 2) return;\n\n const pPart = placementId ? `,p=${placementId}` : '';\n const response = `\\x1b_Gi=${id}${pPart};${message}\\x1b\\\\`;\n this._coreTerminal._core.coreService.triggerDataEvent(response);\n }\n\n // Image display\n\n private _displayImage(image: IKittyImageData, cmd: IKittyCommand): Promise {\n return this._decodeAndDisplay(image, cmd)\n .then(() => true)\n .catch(() => false);\n }\n\n private async _decodeAndDisplay(image: IKittyImageData, cmd: IKittyCommand): Promise {\n const generation = this._generation;\n let bitmap: ImageBitmap | undefined = await this._createBitmap(image);\n\n try {\n if (generation !== this._generation) throw new Error('image decode canceled');\n const cropX = Math.max(0, cmd.x ?? 0);\n const cropY = Math.max(0, cmd.y ?? 0);\n const cropW = cmd.sourceWidth || (bitmap.width - cropX);\n const cropH = cmd.sourceHeight || (bitmap.height - cropY);\n\n const maxCropW = Math.max(0, bitmap.width - cropX);\n const maxCropH = Math.max(0, bitmap.height - cropY);\n const finalCropW = Math.max(0, Math.min(cropW, maxCropW));\n const finalCropH = Math.max(0, Math.min(cropH, maxCropH));\n\n if (finalCropW === 0 || finalCropH === 0) {\n throw new Error('invalid source rectangle');\n }\n\n if (cropX !== 0 || cropY !== 0 || finalCropW !== bitmap.width || finalCropH !== bitmap.height) {\n const cropped = await createImageBitmap(bitmap, cropX, cropY, finalCropW, finalCropH);\n bitmap.close();\n bitmap = cropped;\n }\n\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n\n // Per spec: c/r default to image's natural cell dimensions.\n // If only one of c/r is specified, compute the other from image aspect ratio.\n let imgCols: number;\n let imgRows: number;\n if (cmd.columns !== undefined && cmd.rows !== undefined) {\n imgCols = cmd.columns;\n imgRows = cmd.rows;\n } else if (cmd.columns !== undefined) {\n imgCols = cmd.columns;\n imgRows = Math.max(1, Math.ceil((bitmap.height / bitmap.width) * (imgCols * cw) / ch));\n } else if (cmd.rows !== undefined) {\n imgRows = cmd.rows;\n imgCols = Math.max(1, Math.ceil((bitmap.width / bitmap.height) * (imgRows * ch) / cw));\n } else {\n imgCols = Math.ceil(bitmap.width / cw);\n imgRows = Math.ceil(bitmap.height / ch);\n }\n\n let w = bitmap.width;\n let h = bitmap.height;\n\n // Scale bitmap to fit placement rectangle when c/r are specified\n if (cmd.columns !== undefined || cmd.rows !== undefined) {\n w = Math.round(imgCols * cw);\n h = Math.round(imgRows * ch);\n }\n\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n\n // Save cursor position before addImage modifies it\n const buffer = this._coreTerminal._core.buffer;\n const savedX = buffer.x;\n const savedY = buffer.y;\n const savedYbase = buffer.ybase;\n\n // Determine layer based on z-index: negative = behind text, 0+ = on top.\n // When z<0 we always use the bottom layer even without allowTransparency —\n // the image will simply be hidden behind the opaque text background, which\n // is the correct behavior (client asked for \"behind text\").\n const wantsBottom = cmd.zIndex !== undefined && cmd.zIndex < 0;\n const layer: ImageLayer = wantsBottom ? 'bottom' : 'top';\n\n if (w !== bitmap.width || h !== bitmap.height) {\n const scaled = await createImageBitmap(bitmap, { resizeWidth: w, resizeHeight: h });\n bitmap.close();\n bitmap = scaled;\n }\n\n // Per spec: X/Y are pixel offsets within the first cell, so clamp to cell dimensions\n const xOffset = Math.min(Math.max(0, cmd.xOffset ?? 0), cw - 1);\n const yOffset = Math.min(Math.max(0, cmd.yOffset ?? 0), ch - 1);\n if (xOffset !== 0 || yOffset !== 0) {\n // Per spec: X/Y is not added to c/r area. When c/r are explicit, the\n // total placement area remains c*cw × r*ch pixels and the offset image\n // is clipped to fit. When c/r are unset, the padded canvas determines\n // the natural cell dimensions.\n const canvasW = (cmd.columns !== undefined) ? Math.round(imgCols * cw) : bitmap.width + xOffset;\n const canvasH = (cmd.rows !== undefined) ? Math.round(imgRows * ch) : bitmap.height + yOffset;\n const offsetCanvas = ImageRenderer.createCanvas(window.document, canvasW, canvasH);\n const offsetCtx = offsetCanvas.getContext('2d');\n if (!offsetCtx) {\n throw new Error('Failed to create offset canvas context');\n }\n offsetCtx.drawImage(bitmap, xOffset, yOffset);\n\n const offsetBitmap = await createImageBitmap(offsetCanvas);\n offsetCanvas.width = offsetCanvas.height = 0;\n bitmap.close();\n bitmap = offsetBitmap;\n w = bitmap.width;\n h = bitmap.height;\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n if (cmd.columns === undefined) {\n imgCols = Math.ceil(bitmap.width / cw);\n }\n if (cmd.rows === undefined) {\n imgRows = Math.ceil(bitmap.height / ch);\n }\n }\n\n if (generation !== this._generation) throw new Error('image decode canceled');\n const zIndex = cmd.zIndex ?? 0;\n this._kittyStorage.addImage(image.id, bitmap, true, layer, zIndex);\n bitmap = undefined; // ownership transferred to storage\n\n // Kitty cursor movement\n // Per spec: cursor placed at first column after last image column,\n // on the last row of the image. C=1 means don't move cursor.\n if (cmd.cursorMovement === 1) {\n // C=1: restore cursor to position before image was placed\n const scrolled = buffer.ybase - savedYbase;\n buffer.x = savedX;\n // Can't restore cursor to scrollback?\n buffer.y = Math.max(savedY - scrolled, 0);\n } else {\n // Default (C=0): advance cursor horizontally past the image\n // addImage already positioned cursor on the last row via lineFeeds\n buffer.x = Math.min(savedX + imgCols, this._coreTerminal.cols);\n }\n } catch (e) {\n bitmap?.close();\n throw e;\n }\n }\n\n // Create ImageBitmap from already-decoded image data.\n private async _createBitmap(image: IKittyImageData): Promise {\n let bytes: Uint8Array = new Uint8Array(await image.data.arrayBuffer());\n\n if (image.compression === KittyCompression.ZLIB) {\n bytes = await this._decompressZlib(bytes);\n }\n\n if (image.format === KittyFormat.PNG) {\n const metrics = imageType(bytes);\n // IHDR dimensions are parsed with signed shifts, so a value >= 0x80000000 comes\n // back negative and a bare `>` pixel-limit test passes it; require positive.\n if (metrics.mime !== 'image/png' || !(metrics.width > 0) || !(metrics.height > 0) || metrics.width * metrics.height > this._opts.pixelLimit) {\n throw new RangeError('PNG exceeds pixel limit or has invalid dimensions');\n }\n const blob = new Blob([bytes as BlobPart], { type: 'image/png' });\n if (!window.createImageBitmap) {\n const url = URL.createObjectURL(blob);\n const img = new Image();\n return new Promise((resolve, reject) => {\n img.addEventListener('load', () => {\n URL.revokeObjectURL(url);\n const canvas = ImageRenderer.createCanvas(window.document, img.width, img.height);\n canvas.getContext('2d')?.drawImage(img, 0, 0);\n createImageBitmap(canvas).then(resolve).catch(reject);\n });\n img.addEventListener('error', () => {\n URL.revokeObjectURL(url);\n reject(new Error('Failed to load image'));\n });\n img.src = url;\n });\n }\n return createImageBitmap(blob);\n }\n\n // Raw pixel data\n const width = image.width;\n const height = image.height;\n\n if (!width || !height) {\n throw new Error('Width and height required for raw pixel data');\n }\n\n const bytesPerPixel = image.format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n throw new Error('Insufficient pixel data');\n }\n\n const pixelCount = width * height;\n\n if (image.format === KittyFormat.RGBA) {\n // RGBA: use bytes directly — no copy needed\n return createImageBitmap(new ImageData(new Uint8ClampedArray(bytes.buffer as ArrayBuffer, bytes.byteOffset, pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA), width, height));\n }\n\n // RGB→RGBA: interleave alpha using uint32 block processing (4 pixels per iteration).\n // 3 uint32 reads + 4 uint32 writes per 4 pixels vs 28 byte reads/writes — ~6x faster.\n // Assumes little-endian (all modern browsers/Node.js).\n const data = new Uint8ClampedArray(pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA);\n const src32 = new Uint32Array(bytes.buffer, bytes.byteOffset, Math.floor(bytes.byteLength / 4));\n const dst32 = new Uint32Array(data.buffer);\n const alignedPixels = pixelCount & ~3; // round down to multiple of 4\n\n let srcOffset = 0;\n let dstOffset = 0;\n for (let i = 0; i < alignedPixels; i += 4) {\n const b0 = src32[srcOffset++];\n const b1 = src32[srcOffset++];\n const b2 = src32[srcOffset++];\n // Little-endian: pixel bytes are [R,G,B] → uint32 ABGR layout\n dst32[dstOffset++] = 0xFF000000 | b0;\n dst32[dstOffset++] = 0xFF000000 | (b0 >>> 24) | (b1 << 8);\n dst32[dstOffset++] = 0xFF000000 | (b1 >>> 16) | (b2 << 16);\n dst32[dstOffset++] = 0xFF000000 | (b2 >>> 8);\n }\n\n // Handle remaining 1–3 pixels\n let srcByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n let dstByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n for (let i = alignedPixels; i < pixelCount; i++) {\n data[dstByte] = bytes[srcByte];\n data[dstByte + 1] = bytes[srcByte + 1];\n data[dstByte + 2] = bytes[srcByte + 2];\n data[dstByte + 3] = KittyPixelConstants.ALPHA_OPAQUE;\n srcByte += KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n dstByte += KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n }\n\n return createImageBitmap(new ImageData(data, width, height));\n }\n\n private async _decompressZlib(compressed: Uint8Array): Promise {\n try {\n return await this._decompress(compressed, 'deflate');\n } catch (error) {\n if (error instanceof RangeError) throw error;\n return await this._decompress(compressed, 'deflate-raw');\n }\n }\n\n private async _decompress(compressed: Uint8Array, format: 'deflate' | 'deflate-raw'): Promise {\n const limit = Math.min(this._opts.kittySizeLimit, this._opts.pixelLimit * 4, this._opts.storageLimit * 1000000);\n let offsetIn = 0;\n // Bound inflation within one native transform before its output is budgeted.\n const source = new ReadableStream({\n pull(controller) {\n if (offsetIn >= compressed.length) {\n controller.close();\n return;\n }\n const end = Math.min(offsetIn + 4096, compressed.length);\n controller.enqueue(new Uint8Array(compressed.subarray(offsetIn, end)));\n offsetIn = end;\n }\n });\n const reader = source.pipeThrough(new DecompressionStream(format)).getReader();\n const chunks: Uint8Array[] = [];\n let totalLength = 0;\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n totalLength += value.byteLength;\n if (totalLength > limit) {\n await reader.cancel().catch(() => {});\n throw new RangeError('decompressed image exceeds byte limit');\n }\n chunks.push(value);\n }\n } finally {\n reader.releaseLock();\n }\n\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n }\n\n public get images(): ReadonlyMap {\n return this._kittyStorage.images;\n }\n\n public get _kittyIdToStorageId(): ReadonlyMap {\n return this._kittyStorage.kittyIdToStorageId;\n }\n\n public get pendingTransmissions(): ReadonlyMap {\n return this._pendingTransmissions;\n }\n}\n","/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Kitty graphics protocol types, constants, and parsing utilities.\n */\n\nimport type Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\n\n// Kitty graphics protocol action types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'a'.\nexport const enum KittyAction {\n TRANSMIT = 't',\n TRANSMIT_DISPLAY = 'T',\n QUERY = 'q',\n PLACEMENT = 'p',\n DELETE = 'd'\n}\n\n// Kitty graphics protocol format types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyFormat {\n RGB = 24,\n RGBA = 32,\n PNG = 100\n}\n\n// Kitty graphics protocol compression types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'o'.\nexport const enum KittyCompression {\n NONE = '',\n ZLIB = 'z'\n}\n\n// Kitty graphics protocol control data keys.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyKey {\n // Action to perform (t=transmit, T=transmit+display, q=query, p=placement, d=delete)\n ACTION = 'a',\n // Image format (24=RGB, 32=RGBA, 100=PNG)\n FORMAT = 'f',\n // Image ID for referencing stored images\n ID = 'i',\n // Image number (alternative to ID, terminal assigns ID)\n IMAGE_NUMBER = 'I',\n // Source image width in pixels\n WIDTH = 's',\n // Source image height in pixels\n HEIGHT = 'v',\n // The left edge (in pixels) of the image area to display\n X_OFFSET = 'x',\n // The top edge (in pixels) of the image area to display\n Y_OFFSET = 'y',\n // Width (in pixels) of the source rectangle to display\n SOURCE_WIDTH = 'w',\n // Height (in pixels) of the source rectangle to display\n SOURCE_HEIGHT = 'h',\n // Horizontal offset (in pixels) within the first cell\n X_PLACEMENT_OFFSET = 'X',\n // Vertical offset (in pixels) within the first cell\n Y_PLACEMENT_OFFSET = 'Y',\n // Number of terminal columns to display the image over\n COLUMNS = 'c',\n // Number of terminal rows to display the image over\n ROWS = 'r',\n // More data flag (1=more chunks coming, 0=final chunk)\n MORE = 'm',\n // Compression type (z=zlib). This is essential for chunking larger images.\n COMPRESSION = 'o',\n // Quiet mode (1=suppress OK responses, 2=suppress error responses)\n QUIET = 'q',\n // Cursor movement policy (0=move cursor after image, 1=don't move cursor)\n CURSOR_MOVEMENT = 'C',\n // Z-index for image layering (negative = behind text, 0+ = on top)\n Z_INDEX = 'z',\n // Transmission medium (d=direct, f=file, t=temp file, s=shared memory)\n TRANSMISSION = 't',\n // Delete selector (a/A=all, i/I=by id, c/C=at cursor, etc.) — only used when a=d\n DELETE_SELECTOR = 'd',\n // Placement ID for targeting specific placements\n PLACEMENT_ID = 'p'\n}\n\n// Pixel format constants\nexport const enum KittyPixelConstants {\n BYTES_PER_PIXEL_RGB = 3,\n BYTES_PER_PIXEL_RGBA = 4,\n ALPHA_OPAQUE = 255\n}\n\n// Parsed Kitty graphics command.\nexport interface IKittyCommand {\n action?: string;\n format?: number;\n id?: number;\n imageNumber?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n sourceWidth?: number;\n sourceHeight?: number;\n xOffset?: number;\n yOffset?: number;\n columns?: number;\n rows?: number;\n more?: number;\n quiet?: number;\n cursorMovement?: number;\n zIndex?: number;\n transmission?: string;\n deleteSelector?: string;\n placementId?: number;\n compression?: string;\n payload?: string;\n}\n\n// Pending chunked transmission state.\n// Stores metadata from the first chunk while accumulating decoded payload data.\nexport interface IPendingTransmission {\n // The parsed command from the first chunk (contains action, format, dimensions, etc.)\n cmd: IKittyCommand;\n // Decoder used across chunked payloads\n decoder: Base64Decoder;\n // Total encoded (base64) bytes received across all chunks - for size limit enforcement\n totalEncodedSize: number;\n // Whether any chunk has failed to decode\n decodeError: boolean;\n}\n\n// Stored Kitty image data.\nexport interface IKittyImageData {\n id: number;\n // Decoded image data stored as Blob (off JS heap) to avoid 2GB heap limit\n data: Blob;\n width: number;\n height: number;\n format: 24 | 32 | 100;\n compression?: string;\n}\n\n// Parses Kitty graphics control data into a command object.\nexport function parseKittyCommand(data: string): IKittyCommand {\n const cmd: IKittyCommand = {};\n const parts = data.split(',');\n\n for (const part of parts) {\n const eqIdx = part.indexOf('=');\n if (eqIdx === -1) continue;\n\n const key = part.substring(0, eqIdx);\n const value = part.substring(eqIdx + 1);\n\n // Handle string keys first\n if (key === KittyKey.ACTION) {\n cmd.action = value;\n continue;\n }\n if (key === KittyKey.COMPRESSION) {\n cmd.compression = value;\n continue;\n }\n if (key === KittyKey.TRANSMISSION) {\n cmd.transmission = value;\n continue;\n }\n if (key === KittyKey.DELETE_SELECTOR) {\n cmd.deleteSelector = value;\n continue;\n }\n const numValue = parseInt(value, 10);\n switch (key) {\n case KittyKey.FORMAT: cmd.format = numValue; break;\n case KittyKey.ID: cmd.id = numValue; break;\n case KittyKey.IMAGE_NUMBER: cmd.imageNumber = numValue; break;\n case KittyKey.WIDTH: cmd.width = numValue; break;\n case KittyKey.HEIGHT: cmd.height = numValue; break;\n case KittyKey.X_OFFSET: cmd.x = numValue; break;\n case KittyKey.Y_OFFSET: cmd.y = numValue; break;\n case KittyKey.SOURCE_WIDTH: cmd.sourceWidth = numValue; break;\n case KittyKey.SOURCE_HEIGHT: cmd.sourceHeight = numValue; break;\n case KittyKey.X_PLACEMENT_OFFSET: cmd.xOffset = numValue; break;\n case KittyKey.Y_PLACEMENT_OFFSET: cmd.yOffset = numValue; break;\n case KittyKey.COLUMNS: cmd.columns = numValue; break;\n case KittyKey.ROWS: cmd.rows = numValue; break;\n case KittyKey.MORE: cmd.more = numValue; break;\n case KittyKey.QUIET: cmd.quiet = numValue; break;\n case KittyKey.CURSOR_MOVEMENT: cmd.cursorMovement = numValue; break;\n case KittyKey.Z_INDEX: cmd.zIndex = numValue; break;\n case KittyKey.PLACEMENT_ID: cmd.placementId = numValue; break;\n }\n }\n\n return cmd;\n}\n","/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageStorage } from '../ImageStorage';\nimport { ImageLayer, IAddImageOpts } from '../Types';\nimport { IKittyImageData } from './KittyGraphicsTypes';\n\n// Kitty-specific image storage controller.\n//\n// Wraps shared ImageStorage with kitty protocol semantics:\n// - tracks transmitted image payloads by kitty image id\n// - tracks kitty image id -> shared ImageStorage id mapping for displayed images\n// - mirrors shared-storage evictions into kitty maps\n// - applies protocol-level undisplayed-image eviction policy\nexport class KittyImageStorage implements IDisposable {\n private static readonly _maxStoredImages = 256;\n\n private _nextImageId = 1;\n private readonly _images: Map = new Map();\n // TODO: Support multiple placements per image. The kitty spec identifies\n // placements by an (image id, placement id) pair — same i + different p\n // values should coexist, and same i + same p should replace the prior\n // placement. Currently we track only one storage entry per kitty image id,\n // so multiple placements of the same image overwrite each other. Fixing\n // this requires changing these maps to Map>\n // (kittyId → placementId → storageId) and updating addImage/deleteById\n // accordingly. The underlying shared ImageStorage would also need to\n // support multiple entries per logical image.\n private readonly _kittyIdToStorageId: Map = new Map();\n private readonly _storageIdToKittyId: Map = new Map();\n\n private readonly _previousOnImageDeleted: ((storageId: number) => void) | undefined;\n private readonly _wrappedOnImageDeleted: (storageId: number) => void;\n private readonly _handleStorageImageDeleted = (storageId: number): void => {\n const kittyId = this._storageIdToKittyId.get(storageId);\n if (kittyId !== undefined) {\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n this._images.delete(kittyId);\n }\n };\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n\n constructor(\n private readonly _storage: ImageStorage\n ) {\n this._previousOnImageDeleted = this._storage.onImageDeleted;\n this._wrappedOnImageDeleted = (storageId: number) => {\n this._previousOnImageDeleted?.(storageId);\n this._handleStorageImageDeleted(storageId);\n };\n this._storage.onImageDeleted = this._wrappedOnImageDeleted;\n }\n\n public reset(): void {\n this._nextImageId = 1;\n this._images.clear();\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public dispose(): void {\n this.reset();\n if (this._storage.onImageDeleted === this._wrappedOnImageDeleted) {\n this._storage.onImageDeleted = this._previousOnImageDeleted;\n }\n }\n\n public storeImage(id: number | undefined, imageData: Omit): number {\n const imageId = id ?? this._nextImageId++;\n\n const oldStorageId = this._kittyIdToStorageId.get(imageId);\n if (oldStorageId !== undefined) {\n this._storage.deleteImage(oldStorageId);\n this._kittyIdToStorageId.delete(imageId);\n this._storageIdToKittyId.delete(oldStorageId);\n }\n\n if (!this._images.has(imageId) && this._images.size >= KittyImageStorage._maxStoredImages) {\n this._evictUndisplayedImages();\n }\n\n // Encoded images awaiting placement are outside ImageStorage's pixel budget.\n // Unplaced payloads are evicted first so a new upload cannot erase a visible\n // image while abandoned blobs still hold budget; placed ones go only when\n // that is not enough, because the byte cap is a hard bound. The new image is\n // always stored, so an oversized one overshoots by at most one payload\n // (itself bounded by kittySizeLimit) rather than being dropped after an OK ack.\n const byteLimit = this._storage.getLimit() * 1000000;\n this._images.delete(imageId);\n let retainedBytes = 0;\n for (const image of this._images.values()) retainedBytes += image.data.size;\n for (const evictPlaced of [false, true]) {\n for (const [oldestId, image] of this._images) {\n if (retainedBytes + imageData.data.size <= byteLimit) break;\n if (this._kittyIdToStorageId.has(oldestId) !== evictPlaced) continue;\n retainedBytes -= image.data.size;\n this.deleteById(oldestId);\n }\n }\n\n this._images.set(imageId, {\n ...imageData,\n id: imageId\n });\n return imageId;\n }\n\n public addImage(kittyId: number, image: HTMLCanvasElement | ImageBitmap, scrolling: boolean, layer: ImageLayer, zIndex: number): void {\n // Clean up stale reverse-mapping from a previous placement of the same\n // kitty image. The old shared-storage entry is kept (it may still be\n // visible on screen) but its reverse mapping is removed so that eviction\n // of the old entry won't incorrectly delete the kitty image data.\n const oldStorageId = this._kittyIdToStorageId.get(kittyId);\n if (oldStorageId !== undefined) {\n this._storageIdToKittyId.delete(oldStorageId);\n }\n this._addImageOpts.scrolling = scrolling;\n this._addImageOpts.layer = layer;\n this._addImageOpts.zIndex = zIndex;\n const storageId = this._storage.addImage(image, this._addImageOpts);\n this._kittyIdToStorageId.set(kittyId, storageId);\n this._storageIdToKittyId.set(storageId, kittyId);\n }\n\n public getImage(kittyId: number): IKittyImageData | undefined {\n return this._images.get(kittyId);\n }\n\n public deleteById(kittyId: number): void {\n this._images.delete(kittyId);\n const storageId = this._kittyIdToStorageId.get(kittyId);\n if (storageId !== undefined) {\n this._storage.deleteImage(storageId);\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n }\n }\n\n public deleteAll(): void {\n this._images.clear();\n for (const storageId of this._kittyIdToStorageId.values()) {\n this._storage.deleteImage(storageId);\n }\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public get images(): ReadonlyMap {\n return this._images;\n }\n\n public get kittyIdToStorageId(): ReadonlyMap {\n return this._kittyIdToStorageId;\n }\n\n public get lastImageId(): number {\n return this._nextImageId - 1;\n }\n\n private _evictUndisplayedImages(): void {\n for (const [kittyId] of this._images) {\n if (this._images.size <= KittyImageStorage._maxStoredImages / 2) {\n break;\n }\n if (!this._kittyIdToStorageId.has(kittyId)) {\n this._images.delete(kittyId);\n }\n }\n }\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023, 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\n/**\n * wasm base64 decoder.\n */\nconst wasmDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#828e69684093b2c6:rdef-start:\"decode\"*/{s:1,t:0,d:'AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML'}/*inwasm#828e69684093b2c6:rdef-end:\"decode\"*/);\n// SIMD version (speedup ~1.4x, not covered by tests yet)\n/*\nconst wasmDecode = InWasm({\n name: 'decode',\n type: OutputType.INSTANCE,\n mode: OutputMode.SYNC,\n srctype: 'Clang-C',\n imports: {\n env: { memory: new WebAssembly.Memory({ initial: 1 }) }\n },\n exports: {\n dec: () => 0,\n end: () => 0\n },\n compile: {\n switches: ['-msimd128', '-Wl,-z,stack-size=0', '-Wl,--stack-first']\n },\n code: `\n #include \n typedef struct {\n unsigned int wp;\n unsigned int sp;\n unsigned int dp;\n unsigned int e_size;\n unsigned int dummy[4];\n unsigned char data[0];\n } State;\n\n unsigned int *D0 = (unsigned int *) ${P32.D0 * 4};\n unsigned int *D1 = (unsigned int *) ${P32.D1 * 4};\n unsigned int *D2 = (unsigned int *) ${P32.D2 * 4};\n unsigned int *D3 = (unsigned int *) ${P32.D3 * 4};\n State *state = (State *) ${P32.STATE * 4};\n\n #define packed_byte(x) wasm_i8x16_splat((char) x)\n #define packed_dword(x) wasm_i32x4_splat(x)\n #define masked(x, mask) wasm_v128_and(x, wasm_i32x4_splat(mask))\n\n __attribute__((noinline)) int dec() {\n unsigned int nsp = (state->wp - 1) & ~3;\n unsigned char *src = state->data + state->sp;\n unsigned char *end = state->data + nsp;\n unsigned char *dst = state->data + state->dp;\n unsigned int error = 0;\n\n v128_t err = wasm_i8x16_splat(0);\n unsigned char *end16 = state->data + (nsp & ~15);\n while (src < end16) {\n v128_t data = wasm_v128_load((v128_t *) src);\n\n // wasm-simd rewrite of http://0x80.pl/notesen/2016-01-17-sse-base64-decoding.html#vector-lookup-pshufb\n const v128_t higher_nibble = wasm_u32x4_shr(data, 4) & packed_byte(0x0f);\n const char linv = 1;\n const char hinv = 0;\n\n const v128_t lower_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n linv, linv, 0x2b, 0x30,\n 0x41, 0x50, 0x61, 0x70,\n linv, linv, linv, linv,\n linv, linv, linv, linv\n );\n const v128_t upper_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n hinv, hinv, 0x2b, 0x39,\n 0x4f, 0x5a, 0x6f, 0x7a,\n hinv, hinv, hinv, hinv,\n hinv, hinv, hinv, hinv\n );\n // the difference between the shift and lower bound\n const v128_t shift_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n 0x00, 0x00, 0x3e - 0x2b, 0x34 - 0x30,\n 0x00 - 0x41, 0x0f - 0x50, 0x1a - 0x61, 0x29 - 0x70,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00\n );\n\n const v128_t upper_bound = wasm_i8x16_swizzle(upper_bound_LUT, higher_nibble);\n const v128_t lower_bound = wasm_i8x16_swizzle(lower_bound_LUT, higher_nibble);\n\n const v128_t below = wasm_i8x16_lt(data, lower_bound);\n const v128_t above = wasm_i8x16_gt(data, upper_bound);\n const v128_t eq_2f = wasm_i8x16_eq(data, packed_byte(0x2f));\n\n // in_range = not (below or above) or eq_2f\n // outside = not in_range = below or above and not eq_2f (from deMorgan law)\n const v128_t outside = wasm_v128_andnot(eq_2f, above | below);\n err = wasm_v128_or(err, outside);\n\n const v128_t shift = wasm_i8x16_swizzle(shift_LUT, higher_nibble);\n const v128_t t0 = wasm_i8x16_add(data, shift);\n v128_t v = wasm_i8x16_add(t0, wasm_v128_and(eq_2f, packed_byte(-3)));\n\n // pack bytes\n const v128_t ca = masked(v, 0x003f003f);\n const v128_t db = masked(v, 0x3f003f00);\n const v128_t t00 = wasm_v128_or(wasm_u32x4_shr(db, 8), wasm_i32x4_shl(ca, 6));\n v128_t res = wasm_v128_or(wasm_u32x4_shr(t00, 16), wasm_i32x4_shl(t00, 12));\n res = wasm_i8x16_swizzle(res, wasm_i8x16_const(2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, 16, 16, 16, 16));\n\n wasm_v128_store((v128_t *) dst, res);\n dst += 12;\n src += 16;\n }\n //if (wasm_i8x16_bitmask(err) != 0) return -1;\n if (wasm_v128_any_true(err)) return -1;\n\n // operate on 4-byte blocks\n while (src < end) {\n error |= *((unsigned int *) dst) = D0[src[0]] | D1[src[1]] | D2[src[2]] | D3[src[3]];\n dst += 3;\n src += 4;\n }\n if (error >> 24) return -1;\n state->sp = nsp;\n state->dp = dst - state->data;\n return 0;\n }\n\n int end() {\n int rem = state->wp - state->sp;\n if (rem > 4 && dec()) return -1;\n rem = state->wp - state->sp;\n if (rem < 2) return -1;\n\n unsigned char *src = state->data + state->sp;\n if (rem == 4) {\n if (src[3] == 61) rem--;\n if (src[2] == 61) rem--;\n }\n unsigned int accu = D0[src[0]] | D1[src[1]];\n int dp = 1;\n if (rem > 2) {\n accu |= D2[src[2]];\n dp++;\n if (rem == 4) {\n accu |= D3[src[3]];\n dp++;\n }\n }\n if (accu >> 24) return -1;\n *((unsigned int *) (state->data + state->dp)) = accu;\n state->dp += dp;\n return 0;\n }\n `\n});\n*/\n// base64 map\nconst MAP = new Uint8Array('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n .split('')\n .map(el => el.charCodeAt(0)));\n// init decoder maps in LE order\nconst D = new Uint32Array(1024);\nD.fill(0xFF000000);\nfor (let i = 0; i < MAP.length; ++i)\n D[MAP[i]] = i << 2;\nfor (let i = 0; i < MAP.length; ++i)\n D[256 + MAP[i]] = i >> 4 | ((i << 4) & 0xFF) << 8;\nfor (let i = 0; i < MAP.length; ++i)\n D[512 + MAP[i]] = (i >> 2) << 8 | ((i << 6) & 0xFF) << 16;\nfor (let i = 0; i < MAP.length; ++i)\n D[768 + MAP[i]] = i << 16;\nconst EMPTY = new Uint8Array(0);\n/**\n * base64 stream decoder.\n *\n * Features / assumptions:\n * - lazy chunkwise decoding\n * - errors out on any non base64 chars (no support for NL formatted base64)\n * - decodes in wasm\n * - inplace decoding to save memory\n * - supports a keepSize for lazy memory release\n */\nclass Base64Decoder {\n /**\n * @param keepSize Keep the wasm instance below this limit when calling `release()`.\n * @param maxBytes Max allowed bytes to allocate.\n * @param initialBytes Initial bytes to allocate.\n */\n constructor(keepSize, maxBytes, initialBytes) {\n this._inst = null;\n this._ended = true;\n this._bytes = 0;\n this.keepSize = keepSize !== null && keepSize !== void 0 ? keepSize : 1048576 /* Bytes.KEEP */;\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : 4294901760 /* Bytes.MAX */;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : 32768 /* Bytes.INITIAL */;\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw new Error('invalid byte settings');\n }\n }\n /**\n * Currently decoded bytes (borrowed).\n * Must be accessed before calling `release` or `init`.\n */\n get data8() {\n return this._inst ? this._d.subarray(0, this._m32[1282 /* P32.STATE_DP */]) : EMPTY;\n }\n /**\n * Release memory conditionally based on `keepSize`.\n * If memory gets released, also the wasm instance will be freed and recreated on next `init`,\n * otherwise the instance will be reused.\n */\n release() {\n if (!this._inst)\n return;\n if (this._bytes > this.keepSize) {\n this._inst = this._m32 = this._d = this._mem = null;\n }\n else {\n this._m32[1280 /* P32.STATE_WP */] = 0;\n this._m32[1281 /* P32.STATE_SP */] = 0;\n this._m32[1282 /* P32.STATE_DP */] = 0;\n }\n }\n /**\n * Initializes the decoder for new base64 data.\n * Must be called before doing any decoding attempts.\n * The method will either spawn a new wasm instance or grow\n * the needed memory of an existing instance.\n * @param maxBytes Max allowed bytes to allocate (overwrites ctor value).\n * @param initialBytes Initial bytes to allocate (overwrites ctor value).\n */\n init(maxBytes, initialBytes) {\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : this.maxBytes;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : Math.min(this._bytes, this.maxBytes);\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw Error('invalid byte settings');\n }\n let m = this._m32;\n const bytes = this._bytes + 5152 /* Bytes._DATA_OFFSET */;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmDecode({ env: { memory: this._mem } });\n m = new Uint32Array(this._mem.buffer, 0);\n m.set(D, 256 /* P32.D0 */);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n m = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n m[1280 /* P32.STATE_WP */] = 0;\n m[1281 /* P32.STATE_SP */] = 0;\n m[1282 /* P32.STATE_DP */] = 0;\n this._m32 = m;\n this._ended = false;\n }\n /**\n * Realloc memory. Realloc only happens, if the requested\n * size doesn't fit in the current memory.\n * The new size will be capped by `maxBytes`.\n * @param requested Bytes to be stored.\n */\n _realloc(requested) {\n const needed = this._m32[1280 /* P32.STATE_WP */] + requested;\n if (this._bytes < needed) {\n if (needed > this.maxBytes) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n let newSize = this._bytes;\n while ((newSize *= 2) < needed) { }\n newSize = Math.min(newSize, this.maxBytes);\n if (newSize < needed) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n if (newSize + 5152 /* Bytes._DATA_OFFSET */ > this._mem.buffer.byteLength) {\n const addPages = Math.ceil((newSize + 5152 /* Bytes._DATA_OFFSET */ - this._mem.buffer.byteLength) / 65536);\n this._mem.grow(addPages);\n this._m32 = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n this._bytes = newSize;\n }\n return 0 /* DecodeStatus.OK */;\n }\n /**\n * Put bytes in `data` into the decoder.\n * Additionally decodes the payload, if it reached 2^17 bytes.\n * The return value indicates the type of issue.\n * @param data Bytes to be loaded.\n */\n put(data) {\n if (!this._inst || this._ended) {\n return -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n if (this._realloc(data.length)) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n const m = this._m32;\n this._d.set(data, m[1280 /* P32.STATE_WP */]);\n m[1280 /* P32.STATE_WP */] += data.length;\n // max chunk in input handler is 2^17, try to run in \"tandem mode\"\n return m[1280 /* P32.STATE_WP */] - m[1281 /* P32.STATE_SP */] >= 131072\n ? this._inst.exports.dec()\n : 0 /* DecodeStatus.OK */;\n }\n /**\n * End the current decoding.\n * Also decodes leftover payload from previous put calls.\n */\n end() {\n this._ended = true;\n return this._inst\n ? this._inst.exports.end()\n : -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n /**\n * Bytes loaded into the decoder.\n */\n get loadedBytes() {\n return this._inst\n ? this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n /**\n * Free bytes to feed to the decoder.\n */\n get freeBytes() {\n return this._inst\n ? this.maxBytes - this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n}\nexports.default = Base64Decoder;\n//# sourceMappingURL=Base64Decoder.wasm.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\nconst wasmQoiDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#459f9e1bfb80b1a8:rdef-start:\"qoi_decode\"*/{s:1,t:0,d:'AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=='}/*inwasm#459f9e1bfb80b1a8:rdef-end:\"qoi_decode\"*/);\nclass QoiDecoder {\n constructor(keepSize) {\n this.keepSize = keepSize;\n this.width = 0;\n this.height = 0;\n }\n decode(d) {\n this.width = d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7];\n this.height = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];\n const pixels = this.width * this.height;\n const ib = pixels * 4;\n const dl = d.length;\n /**\n * byte/offset calculation:\n * To save some memory we dont reserve full memory for decoded + encoded,\n * but place encoded at the end of decoded plus 50% security distance\n * to avoid reads before writes positions:\n *\n * encoded < decoded (good compression)\n * enc ####################\n * dec #######################################\n * ^ ^\n * DST_P CHUNK_P\n *\n * encoded > decoded (degenerated compression, should not happen)\n * enc ##############################\n * dec ####################\n * ^ ^\n * DST_P CHUNK_P\n *\n * There is still a chance for overlapping r/w positions in case the compressed\n * data has very different pixel progression, yet the 50% security distance\n * should deal with that, as QOI will bloat data by 25% at max (RGB -> OP byte + RGB).\n * Since we always assume RGBA at decoding stage, the possible bloat reduces to 20% at max.\n */\n const bytes = Math.max(ib, dl) + (Math.min(ib, dl) >> 1) + 4096;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmQoiDecode({ env: { memory: this._mem } });\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n this._d = null;\n }\n if (!this._d) {\n this._d = new Uint8Array(this._mem.buffer);\n }\n // put src data at the end of memory, also align to 256\n const chunkP = (this._mem.buffer.byteLength - dl) & ~0xFF;\n this._d.set(d, chunkP);\n this._inst.exports.dec(chunkP, dl, pixels);\n return this._d.subarray(1024 /* P8.DST_P */, 1024 /* P8.DST_P */ + ib);\n }\n release() {\n if (!this._inst)\n return;\n if (this._mem.buffer.byteLength > this.keepSize) {\n this._inst = this._d = this._mem = null;\n }\n }\n}\nexports.default = QoiDecoder;\n//# sourceMappingURL=QoiDecoder.wasm.js.map","\"use strict\";\n/**\n * Copyright (c) 2022, 2026 Joerg Breitbart\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InWasm = InWasm;\nlet z = (s) => {\n if (Uint8Array.fromBase64)\n return Uint8Array.fromBase64(s);\n if (typeof Buffer !== 'undefined')\n return Buffer.from(s, 'base64');\n const b = atob(s);\n const r = new Uint8Array(b.length);\n for (let i = 0; i < r.length; ++i)\n r[i] = b.charCodeAt(i);\n return r;\n};\nfunction InWasm(def) {\n if (def.d) {\n const { t, s, d } = def;\n let b;\n let m;\n const W = WebAssembly;\n if (t === 0 /* OutputType.INSTANCE */) {\n if (s)\n return (e) => new W.Instance(m || (m = new W.Module(b || (b = z(d)))), e);\n return (e) => m\n ? W.instantiate(m, e)\n : W.instantiate(b || (b = z(d)), e).then(r => (m = r.module) && r.instance);\n }\n if (t === 1 /* OutputType.MODULE */) {\n if (s)\n return () => m || (m = new W.Module(b || (b = z(d))));\n return () => m\n ? Promise.resolve(m)\n : W.compile(b || (b = z(d))).then(r => m = r);\n }\n if (s)\n return () => b || (b = z(d));\n return () => Promise.resolve(b || (b = z(d)));\n }\n if (typeof _wasmCtx === 'undefined')\n throw new Error('must run \"inwasm\"');\n _wasmCtx.add(def);\n}\n//# sourceMappingURL=index.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport type { ITerminalAddon, IDisposable } from '@xterm/xterm';\nimport type { ImageAddon as IImageApi } from '@xterm/addon-image';\nimport { Emitter, type IEvent } from 'common/Event';\nimport { IIPHandler } from './IIPHandler';\nimport { ImageRenderer } from './ImageRenderer';\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { KittyGraphicsHandler } from './kitty/KittyGraphicsHandler';\nimport { KittyImageStorage } from './kitty/KittyImageStorage';\nimport { SixelHandler } from './SixelHandler';\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { ITerminalExt, IImageAddonOptions, IResetHandler } from './Types';\n\n\n/**\n * Document VT features provided by this addon.\n *\n * @vt: #E[Supported via @xterm/addon-image.] DCS SIXEL \"SIXEL Graphics\" \"DCS Ps ; Ps ; Ps ; q Pt ST\" \"Draw SIXEL image.\"\n *\n * Sixel support is provided by the addon @xterm/addon-image with these limitations:\n * - immediate coloring (no shared palette, allows high color settings of `img2sixel`)\n * - max. palette size of 4096 colors\n * - max. pixel width of 16K\n * - max. 25 MB per sixel sequence\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] OSC 1337 \"iTerm2 Commands\" \"OSC 1337 ; Pt BEL\" \"Custom iTerm2 commands.\"\n *\n * Only the inline image protocol (IIP) is supported by the addon @xterm/addon-image with\n * the following limitations:\n * - sequence:\n * - format: `OSC 1337 ; File=inline=1 ; size= ; ... : BEL`\n * - size param must be set and payload may not exceed CEIL(size * 4 / 3)\n * - strict base64 handling as of RFC4648 §4 (standard alphabet, optional padding,\n * no separator bytes allowed)\n * - supported params: size, name, width, height, preserveAspectRatio\n * - image formats: PNG, JPEG and GIF\n * - no animation support (renders first image of a GIF)\n * - no multipart support\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image)\n * and [iTerm2 IIP docs](https://iterm2.com/documentation-images.html) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] APC KITTY_GRAPHICS \"Kitty Graphics\" \"APC G Pt ST\" \"Kitty Graphics Protocol.\"\n *\n * Kitty graphics support is provided by the addon @xterm/addon-image.\n * Note that while basic image output already works, this is still work in progress.\n */\n\n// default values of addon ctor options\nconst DEFAULT_OPTIONS: IImageAddonOptions = {\n enableSizeReports: true,\n pixelLimit: 16777216, // limit to 4096 * 4096 pixels\n sixelSupport: true,\n sixelScrolling: true,\n sixelPaletteLimit: 4096,\n sixelSizeLimit: 33554432,\n storageLimit: 128,\n showPlaceholder: true,\n iipSupport: true,\n iipSizeLimit: 33554432,\n kittySupport: true,\n kittySizeLimit: 33554432\n};\n\n// max palette size supported by the sixel lib (compile time setting)\nconst MAX_SIXEL_PALETTE_SIZE = 4096;\n\n// definitions for _xtermGraphicsAttributes sequence\nconst enum GaItem {\n COLORS = 1,\n SIXEL_GEO = 2,\n REGIS_GEO = 3\n}\nconst enum GaAction {\n READ = 1,\n SET_DEFAULT = 2,\n SET = 3,\n READ_MAX = 4\n}\nconst enum GaStatus {\n SUCCESS = 0,\n ITEM_ERROR = 1,\n ACTION_ERROR = 2,\n FAILURE = 3\n}\n\n\nexport class ImageAddon implements ITerminalAddon, IImageApi {\n private _opts: IImageAddonOptions;\n private _defaultOpts: IImageAddonOptions;\n private _storage: ImageStorage | undefined;\n private _renderer: ImageRenderer | undefined;\n private _disposables: IDisposable[] = [];\n private _terminal: ITerminalExt | undefined;\n private _handlers: Map = new Map();\n private readonly _onImageAdded = new Emitter();\n public readonly onImageAdded: IEvent = this._onImageAdded.event;\n\n constructor(opts?: Partial) {\n this._opts = Object.assign({}, DEFAULT_OPTIONS, opts);\n this._defaultOpts = Object.assign({}, DEFAULT_OPTIONS, opts);\n }\n\n public dispose(): void {\n for (const handler of this._handlers.values()) handler.reset();\n for (const obj of this._disposables) {\n obj.dispose();\n }\n this._disposables.length = 0;\n this._handlers.clear();\n this._onImageAdded.dispose();\n }\n\n private _disposeLater(...args: IDisposable[]): void {\n for (const obj of args) {\n this._disposables.push(obj);\n }\n }\n\n public activate(terminal: ITerminalExt): void {\n this._terminal = terminal;\n\n // internal data structures\n this._renderer = new ImageRenderer(terminal);\n this._storage = new ImageStorage(terminal, this._renderer, this._opts);\n this._storage.onImageAdded = () => this._onImageAdded.fire();\n\n // enable size reports\n if (this._opts.enableSizeReports) {\n const windowOps = terminal.options.windowOptions ?? {};\n windowOps.getWinSizePixels = true;\n windowOps.getCellSizePixels = true;\n windowOps.getWinSizeChars = true;\n terminal.options.windowOptions = windowOps;\n }\n\n this._disposeLater(\n this._renderer,\n this._storage,\n\n // DECSET/DECRST/DA1/XTSMGRAPHICS handlers\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'h' }, params => this._decset(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'l' }, params => this._decrst(params)),\n terminal.parser.registerCsiHandler({ final: 'c' }, params => this._da1(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'S' }, params => this._xtermGraphicsAttributes(params)),\n\n // render hook\n terminal.onRender(range => this._storage?.render(range)),\n\n /**\n * reset handlers covered:\n * - DECSTR\n * - RIS\n * - Terminal.reset()\n */\n terminal.parser.registerCsiHandler({ intermediates: '!', final: 'p' }, () => this.reset()),\n terminal.parser.registerEscHandler({ final: 'c' }, () => this.reset()),\n terminal._core._inputHandler.onRequestReset(() => this.reset()),\n\n // wipe canvas and delete alternate images on buffer switch\n terminal.buffer.onBufferChange(() => this._storage?.wipeAlternate()),\n\n // extend images to the right on resize\n terminal.onResize(metrics => this._storage?.viewportResize(metrics))\n );\n\n // SIXEL handler\n if (this._opts.sixelSupport) {\n const sixelStorage = new SixelImageStorage(this._storage!, this._opts, this._renderer!, terminal);\n const sixelHandler = new SixelHandler(this._opts, sixelStorage, terminal);\n this._handlers.set('sixel', sixelHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerDcsHandler({ final: 'q' }, sixelHandler)\n );\n }\n\n // iTerm IIP handler\n if (this._opts.iipSupport) {\n const iipStorage = new IIPImageStorage(this._storage!);\n const iipHandler = new IIPHandler(this._opts, this._renderer!, iipStorage, terminal);\n this._handlers.set('iip', iipHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerOscHandler(1337, iipHandler)\n );\n }\n\n // Kitty graphics handler\n if (this._opts.kittySupport) {\n const kittyStorage = new KittyImageStorage(this._storage!);\n const kittyHandler = new KittyGraphicsHandler(this._opts, this._renderer!, kittyStorage, terminal);\n this._handlers.set('kitty', kittyHandler);\n this._disposeLater(\n kittyStorage,\n kittyHandler,\n terminal._core._inputHandler._parser.registerApcHandler({ final: 'G' }, kittyHandler)\n );\n }\n }\n\n // Note: storageLimit is skipped here to not intoduce a surprising side effect.\n public reset(): boolean {\n // reset options customizable by sequences to defaults\n this._opts.sixelScrolling = this._defaultOpts.sixelScrolling;\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n // also clear image storage\n this._storage?.reset();\n // reset protocol handlers\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return false;\n }\n\n public get storageLimit(): number {\n return this._storage?.getLimit() || -1;\n }\n\n public set storageLimit(limit: number) {\n this._storage?.setLimit(limit);\n this._opts.storageLimit = limit;\n }\n\n public get storageUsage(): number {\n if (this._storage) {\n return this._storage.getUsage();\n }\n return -1;\n }\n\n public get showPlaceholder(): boolean {\n return this._opts.showPlaceholder;\n }\n\n public set showPlaceholder(value: boolean) {\n this._opts.showPlaceholder = value;\n this._renderer?.showPlaceholder(value);\n }\n\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.getImageAtBufferCell(x, y);\n }\n\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.extractTileAtBufferCell(x, y);\n }\n\n private _report(s: string): void {\n this._terminal?._core.input(s, false);\n }\n\n private _decset(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = false;\n break;\n }\n }\n return false;\n }\n\n private _decrst(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = true;\n break;\n }\n }\n return false;\n }\n\n // overload DA to return something more appropriate\n private _da1(params: (number | number[])[]): boolean {\n if (params[0]) {\n return true;\n }\n // reported features:\n // 62 - VT220\n // 4 - SIXEL support\n // 9 - charsets\n // 22 - ANSI colors\n if (this._opts.sixelSupport) {\n this._report(`\\x1b[?62;4;9;22c`);\n return true;\n }\n return false;\n }\n\n /**\n * Implementation of xterm's graphics attribute sequence.\n *\n * Supported features:\n * - read/change palette limits (max 4096 by sixel lib)\n * - read SIXEL canvas geometry (reports current window canvas or\n * squared pixelLimit if canvas > pixel limit)\n *\n * Everything else is deactivated.\n */\n private _xtermGraphicsAttributes(params: (number | number[])[]): boolean {\n if (params.length < 2) {\n return true;\n }\n if (params[0] === GaItem.COLORS) {\n switch (params[1]) {\n case GaAction.READ:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n return true;\n case GaAction.SET_DEFAULT:\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n // also reset protocol handlers for now\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return true;\n case GaAction.SET:\n if (params.length > 2 && !(params[2] instanceof Array) && params[2] <= MAX_SIXEL_PALETTE_SIZE) {\n this._opts.sixelPaletteLimit = params[2];\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n } else {\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n }\n return true;\n case GaAction.READ_MAX:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${MAX_SIXEL_PALETTE_SIZE}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n if (params[0] === GaItem.SIXEL_GEO) {\n switch (params[1]) {\n // we only implement read and read_max here\n case GaAction.READ:\n let width = this._renderer?.dimensions?.css.canvas.width;\n let height = this._renderer?.dimensions?.css.canvas.height;\n if (!width || !height) {\n // for some reason we have no working image renderer\n // --> fallback to default cell size\n const cellSize = CELL_SIZE_DEFAULT;\n width = (this._terminal?.cols || 80) * cellSize.width;\n height = (this._terminal?.rows || 24) * cellSize.height;\n }\n if (width * height < this._opts.pixelLimit) {\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${width.toFixed(0)};${height.toFixed(0)}S`);\n } else {\n // if we overflow pixelLimit report that squared instead\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n }\n return true;\n case GaAction.READ_MAX:\n // read_max returns pixelLimit as square area\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n // exit with error on ReGIS or any other requests\n this._report(`\\x1b[?${params[0]};${GaStatus.ITEM_ERROR}S`);\n return true;\n }\n}\n"],"names":["root","factory","exports","module","define","amd","globalThis","red","n","green","blue","toRGBA8888","r","g","b","a","clamp","low","high","value","Math","max","min","h2c","t1","t2","c","normalizeRGB","round","Object","defineProperty","DEFAULT_FOREGROUND","DEFAULT_BACKGROUND","PALETTE_ANSI_256","PALETTE_VT340_GREY","PALETTE_VT340_COLOR","normalizeHLS","nearestColorIndex","fromRGBA8888","alpha","BIG_ENDIAN","Uint8Array","Uint32Array","buffer","console","warn","color","palette","Number","MAX_SAFE_INTEGER","idx","i","length","dr","dg","db","d","h","l","s","v","HLStoRGB","p","push","decodeAsync","decode","Decoder","DecoderAsync","Colors_1","__webpack_require__","wasm_1","WASM_BYTES","Buffer","from","bytestring","atob","result","charCodeAt","decodeBase64","LIMITS","BYTES","WASM_MODULE","NULL_CANVAS","CallbackProxy","constructor","this","bandHandler","width","modeHandler","mode","handle_band","mode_parsed","DEFAULT_OPTIONS","memoryLimit","sixelColor","fillColor","paletteLimit","PALETTE_SIZE","truncate","opts","cbProxy","importObj","env","bind","WebAssembly","instantiate","then","inst","instance","_instance","_cbProxy","_PIXEL_OFFSET","MAX_WIDTH","_canvas","_bandWidths","_maxWidth","_minWidth","_lastOffset","_currentHeight","_opts","assign","Error","_handle_band","_initCanvas","Module","Instance","_wasm","_chunk","memory","get_chunk_address","CHUNK_SIZE","_states","get_state_address","_palette","get_palette_address","set","_pSrc","get_p0_address","init","_fillColor","_truncate","_rasterWidth","_rasterHeight","_width","_height","_level","_mode","_paletteLimit","pixels","height","release","_realloc","offset","additionalPixels","newCanvas","ceil","adv","remaining","subarray","current_width","current_height","memoryUsage","byteLength","properties","level","memUsage","rasterAttributes","numerator","denominator","data","start","end","decodeString","j","data32","currentWidth","fill","escape","final","finalOffset","bw","currentHeight","data8","Uint8ClampedArray","dec","async","Lifecycle_1","EventUtils","_listeners","_disposed","event","_event","listener","thisArgs","disposables","toDisposable","entry","fn","slice","indexOf","splice","Array","isArray","add","fire","call","listeners","len","dispose","forward","to","e","map","undefined","any","events","store","DisposableStore","runAndSubscribe","handler","initial","arg","_disposables","Set","_isDisposed","isDisposed","o","clear","Disposable","_store","_register","None","freeze","_value","ImageRenderer_1","ImageStorage_1","Base64Decoder_wasm_1","__importDefault","QoiDecoder_wasm_1","IIPHeaderParser_1","IIPMetrics_1","DEFAULT_HEADER","type","name","size","preserveAspectRatio","inline","_renderer","_storage","_coreTerminal","_generation","_aborted","_hp","HeaderParser","_header","_isMultipart","_abortMulti","maxEncodedBytes","iipSizeLimit","initialBytes","_dec","default","_qoiDec","reset","put","state","dataPos","parse","fields","_initDecoder","success","seqType","w","CELL_SIZE_DEFAULT","dimensions","css","canvas","cols","rows","scale","_c","_a","_core","_coreBrowserService","dpr","report","toFixed","input","cond","blob","metrics","UNSUPPORTED_TYPE","imageType","mime","pixelLimit","_resize","floor","ImageData","byteOffset","ImageRenderer","createCanvas","_b","getContext","putImageData","addImage","Blob","generation","createImageBitmap","resizeWidth","resizeHeight","bm","close","catch","cw","cell","ch","_d","rw","_dim","rh","wf","hf","f","total","cdim","endsWith","parseInt","toStr","String","fromCharCode","toInt","toSize","match","DECODERS","toString","bs","TextDecoder","FILE_MARKER","MULTIPARTFILE_MARKER","FILEPART_MARKER","FILEEND_MARKER","REPORTCELLSIZE_MARKER","MAX_FIELDCHARS","_buffer","_position","_key","k","_storeValue","pos","_storeKey","_addImageOpts","scrolling","layer","zIndex","cursorPos","img","d32","blockLength","jpgSize","dim","limit","_layers","get","localDocument","document","createElement","createImageData","ctx","imgData","Promise","resolve","_terminal","super","Map","_optionsRefresh","MutableDisposable","_oldOpen","open","parent","_open","screenElement","optionsService","onOptionChange","option","rescaleCanvas","_renderService","refreshRows","removeLayerFromDom","_oldSetRenderer","setRenderer","_placeholderBitmap","_placeholder","showPlaceholder","cellSize","_createPlaceHolder","clearLines","y","clearRect","_e","clearAll","draw","imgSpec","tileId","col","row","count","_rescaleImage","actual","sourceWidth","sourceHeight","actualCellSize","sx","sy","dx","dy","finalWidth","finalHeight","drawImage","extractTile","drawPlaceholder","values","spec","originalWidth","originalHeight","origCellSize","orig","scaledWidth","scaledHeight","renderer","key","keys","insertLayerToDom","has","classList","style","isolation","insertBefore","firstChild","appendChild","remove","delete","hasLayer","bWidth","blueprint","black","white","shift","x","screen","ctx2","placeholder","bitmap","window","ExtendedAttrsImage","ext","_urlId","_ext","underlineStyle","underlineColor","underlineVariantOffset","val","urlId","imageId","clone","isEmpty","EMPTY_ATTRS","_images","_lastId","_lowestId","_fullyCleared","_needsFullClear","_pixelLimit","setLimit","storageLimit","error","message","getLimit","_viewportMetrics","marker","RangeError","_evictOldest","getUsage","_getStoredPixels","storedPixels","_delImg","id","ImageBitmap","onImageDeleted","wipeAlternate","zero","entries","bufferType","deleteImage","termCols","termRows","originX","originY","tileCount","_inputHandler","_dirtyRowTracker","markDirty","line","lines","ybase","_writeToCell","lineFeed","endMarker","registerMarker","onDispose","active","_evictOnAlternate","onImageAdded","render","range","hasTopImages","hasBottomImages","drawCalls","placeholderCalls","ydisp","getBg","_extendedAttrs","startTile","startCol","sort","viewportResize","oldCol","tilesPerRow","hasData","rightCol","_data","lastTile","expandCol","getImageAtBufferCell","extractTileAtBufferCell","room","used","current","old","oldSpec","imgId","Decoder_1","DEFAULT_PALETTE","idleDecoders","poolPrimed","releaseDecoder","idle","convertLe","_size","_decMemoryLimit","_returnDecoder","hook","params","pop","acquireDecoder","attr","colors","bg","isInverse","isFgDefault","foreground","rgba","isFgRGB","t","toColorRGB","getFgColor","ansi","isBgDefault","background","isBgRGB","getBgColor","extractActiveBg","_curAttrData","_themeService","sixelPaletteLimit","sixelSizeLimit","unhook","_unhook","advanceCursor","sixelScrolling","KittyGraphicsTypes_1","_kittyStorage","_decodeError","_activeDecoder","_inControlData","_controlData","_controlLength","_encodedSizeLimit","_totalEncodedSize","_parsedCommand","_pendingTransmissions","_maxEncodedBytes","kittySizeLimit","_initialEncodedBytes","_cleanupAllPending","_removePendingEntry","_lastPendingKey","pending","decoder","controlEnd","copyLength","parseKittyCommand","_parseControlDataString","imageNumber","_sendResponse","quiet","action","payloadStart","_streamPayload","pendingKey","previousEncodedSize","_f","totalEncodedSize","decoderToRelease","_g","decoderCapacity","_h","maxPending","oldest","next","cmd","_j","_k","_handleNoPayloadCommand","_handleDelete","isMoreComing","more","decodeError","finalCmd","imageBytes","_handleCommandWithBytesAndCmd","str","fromCodePoint","_handlePlacement","bytes","_handleTransmit","transmission","_handleTransmitDisplay","_handleQuery","image","getImage","_displayImage","placementId","storeImage","format","compression","lastImageId","expectedBytes","deleteSelector","deleteAll","deleteById","isOk","response","coreService","triggerDataEvent","_decodeAndDisplay","_createBitmap","cropX","cropY","cropW","cropH","maxCropW","maxCropH","finalCropW","finalCropH","cropped","imgCols","imgRows","columns","savedX","savedY","savedYbase","scaled","xOffset","yOffset","canvasW","canvasH","offsetCanvas","offsetCtx","offsetBitmap","cursorMovement","scrolled","arrayBuffer","_decompressZlib","url","URL","createObjectURL","Image","reject","addEventListener","revokeObjectURL","src","pixelCount","src32","dst32","alignedPixels","srcOffset","dstOffset","b0","b1","b2","srcByte","dstByte","compressed","_decompress","offsetIn","reader","ReadableStream","pull","controller","enqueue","pipeThrough","DecompressionStream","getReader","chunks","totalLength","done","read","cancel","releaseLock","chunk","images","_kittyIdToStorageId","kittyIdToStorageId","pendingTransmissions","parts","split","part","eqIdx","substring","numValue","KittyImageStorage","_nextImageId","_storageIdToKittyId","_handleStorageImageDeleted","storageId","kittyId","_previousOnImageDeleted","_wrappedOnImageDeleted","imageData","oldStorageId","_maxStoredImages","_evictUndisplayedImages","byteLimit","retainedBytes","evictPlaced","oldestId","wasmDecode","InWasm","MAP","el","D","EMPTY","keepSize","maxBytes","_inst","_ended","_bytes","_m32","_mem","m","grow","Memory","requested","needed","newSize","addPages","loadedBytes","freeBytes","wasmQoiDecode","ib","dl","chunkP","def","W","z","compile","_wasmCtx","fromBase64","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","Event_1","IIPHandler_1","KittyGraphicsHandler_1","KittyImageStorage_1","SixelHandler_1","SixelImageStorage_1","IIPImageStorage_1","enableSizeReports","sixelSupport","iipSupport","kittySupport","_handlers","_onImageAdded","Emitter","_defaultOpts","obj","_disposeLater","args","activate","terminal","ImageStorage","windowOps","options","windowOptions","getWinSizePixels","getCellSizePixels","getWinSizeChars","parser","registerCsiHandler","prefix","_decset","_decrst","_da1","_xtermGraphicsAttributes","onRender","intermediates","registerEscHandler","onRequestReset","onBufferChange","onResize","sixelStorage","SixelImageStorage","sixelHandler","SixelHandler","_parser","registerDcsHandler","iipStorage","IIPImageStorage","iipHandler","IIPHandler","registerOscHandler","kittyStorage","kittyHandler","KittyGraphicsHandler","registerApcHandler","storageUsage","_report","sqrt"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/addon-image.mjs b/lib/addon-image.mjs -index 753a4f833c038a3f45802377dcb16a93695f2161..29c3984db57b888a058165c8aa02ccbcf8efcd2f 100644 +index 753a4f833c038a3f45802377dcb16a93695f2161..aca74ad0c769e8525bc5e4ab8cc6dda03959f760 100644 --- a/lib/addon-image.mjs +++ b/lib/addon-image.mjs @@ -14,5 +14,5 @@ @@ -26,10 +26,10 @@ index 753a4f833c038a3f45802377dcb16a93695f2161..29c3984db57b888a058165c8aa02ccbc * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var it=Object.create;var Te=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var x=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var at=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of rt(e))!nt.call(r,A)&&A!==t&&Te(r,A,{get:()=>e[A],enumerable:!(i=At(e,A))||i.enumerable});return r};var M=(r,e,t)=>(t=r!=null?it(st(r)):{},at(e||!r||!r.__esModule?Te(t,"default",{value:r,enumerable:!0}):t,r));var X=x(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.DEFAULT_FOREGROUND=_.DEFAULT_BACKGROUND=_.PALETTE_ANSI_256=_.PALETTE_VT340_GREY=_.PALETTE_VT340_COLOR=_.normalizeHLS=_.normalizeRGB=_.nearestColorIndex=_.fromRGBA8888=_.toRGBA8888=_.alpha=_.blue=_.green=_.red=_.BIG_ENDIAN=void 0;_.BIG_ENDIAN=new Uint8Array(new Uint32Array([4278190080]).buffer)[0]===255;_.BIG_ENDIAN&&console.warn("BE platform detected. This version of node-sixel works only on LE properly.");function xe(r){return r&255}_.red=xe;function Me(r){return r>>>8&255}_.green=Me;function ve(r){return r>>>16&255}_.blue=ve;function ht(r){return r>>>24&255}_.alpha=ht;function B(r,e,t,i=255){return((i&255)<<24|(t&255)<<16|(e&255)<<8|r&255)>>>0}_.toRGBA8888=B;function gt(r){return[r&255,r>>8&255,r>>16&255,r>>>24]}_.fromRGBA8888=gt;function It(r,e){let t=xe(r),i=Me(r),A=ve(r),s=Number.MAX_SAFE_INTEGER,n=-1;for(let a=0;a1&&(t-=1),t*6<1?e+(r-e)*6*t:t*2<1?r:t*3<2?e+(r-e)*(4-t*6):e}function dt(r,e,t){if(!t){let s=Math.round(e*255);return B(s,s,s)}let i=e<.5?e*(1+t):e+t-e*t,A=2*e-i;return B(ge(0,255,Math.round(Ie(i,A,r+1/3)*255)),ge(0,255,Math.round(Ie(i,A,r)*255)),ge(0,255,Math.round(Ie(i,A,r-1/3)*255)))}function m(r,e,t){return(4278190080|Math.round(t/100*255)<<16|Math.round(e/100*255)<<8|Math.round(r/100*255))>>>0}_.normalizeRGB=m;function lt(r,e,t){return dt((r+240%360)/360,e/100,t/100)}_.normalizeHLS=lt;_.PALETTE_VT340_COLOR=new Uint32Array([m(0,0,0),m(20,20,80),m(80,13,13),m(20,80,20),m(80,20,80),m(20,80,80),m(80,80,20),m(53,53,53),m(26,26,26),m(33,33,60),m(60,26,26),m(33,60,33),m(60,33,60),m(33,60,60),m(60,60,33),m(80,80,80)]);_.PALETTE_VT340_GREY=new Uint32Array([m(0,0,0),m(13,13,13),m(26,26,26),m(40,40,40),m(6,6,6),m(20,20,20),m(33,33,33),m(46,46,46),m(0,0,0),m(13,13,13),m(26,26,26),m(40,40,40),m(6,6,6),m(20,20,20),m(33,33,33),m(46,46,46)]);_.PALETTE_ANSI_256=(()=>{let r=[B(0,0,0),B(205,0,0),B(0,205,0),B(205,205,0),B(0,0,238),B(205,0,205),B(0,250,205),B(229,229,229),B(127,127,127),B(255,0,0),B(0,255,0),B(255,255,0),B(92,92,255),B(255,0,255),B(0,255,255),B(255,255,255)],e=[0,95,135,175,215,255];for(let t=0;t<6;++t)for(let i=0;i<6;++i)for(let A=0;A<6;++A)r.push(B(e[t],e[i],e[A]));for(let t=8;t<=238;t+=10)r.push(B(t,t,t));return new Uint32Array(r)})();_.DEFAULT_BACKGROUND=B(0,0,0,255);_.DEFAULT_FOREGROUND=B(255,255,255,255)});var ce=x(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.InWasm=Ct;var v=r=>{if(Uint8Array.fromBase64)return Uint8Array.fromBase64(r);if(typeof Buffer<"u")return Buffer.from(r,"base64");let e=atob(r),t=new Uint8Array(e.length);for(let i=0;inew n.Instance(s||(s=new n.Module(A||(A=v(i)))),a):a=>s?n.instantiate(s,a):n.instantiate(A||(A=v(i)),a).then(o=>(s=o.module)&&o.instance):e===1?t?()=>s||(s=new n.Module(A||(A=v(i)))):()=>s?Promise.resolve(s):n.compile(A||(A=v(i))).then(a=>s=a):t?()=>A||(A=v(i)):()=>Promise.resolve(A||(A=v(i)))}if(typeof _wasmCtx>"u")throw new Error('must run "inwasm"');_wasmCtx.add(r)}});var ue=x(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});var pt=ce(),Bt=(0,pt.InWasm)({s:1,t:0,d:"AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML"}),S=new Uint8Array("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").map(r=>r.charCodeAt(0))),R=new Uint32Array(1024);R.fill(4278190080);for(let r=0;r>4|(r<<4&255)<<8;for(let r=0;r>2<<8|(r<<6&255)<<16;for(let r=0;rthis.maxBytes||this.maxBytes>4294901760)throw new Error("invalid byte settings")}get data8(){return this._inst?this._d.subarray(0,this._m32[1282]):ft}release(){this._inst&&(this._bytes>this.keepSize?this._inst=this._m32=this._d=this._mem=null:(this._m32[1280]=0,this._m32[1281]=0,this._m32[1282]=0))}init(e,t){if(this.maxBytes=e??this.maxBytes,this._bytes=t??Math.min(this._bytes,this.maxBytes),this._bytes>this.maxBytes||this.maxBytes>4294901760)throw Error("invalid byte settings");let i=this._m32,A=this._bytes+5152;this._inst?this._mem.buffer.byteLengththis.maxBytes)return-3;let i=this._bytes;for(;(i*=2)this._mem.buffer.byteLength){let A=Math.ceil((i+5152-this._mem.buffer.byteLength)/65536);this._mem.grow(A),this._m32=new Uint32Array(this._mem.buffer,0),this._d=new Uint8Array(this._mem.buffer,5152)}this._bytes=i}return 0}put(e){if(!this._inst||this._ended)return-2;if(this._realloc(e.length))return-3;let t=this._m32;return this._d.set(e,t[1280]),t[1280]+=e.length,t[1280]-t[1281]>=131072?this._inst.exports.dec():0}end(){return this._ended=!0,this._inst?this._inst.exports.end():-2}get loadedBytes(){return this._inst?this._m32[1280]:0}get freeBytes(){return this._inst?this.maxBytes-this._m32[1280]:0}};_e.default=me});var Re=x(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});var Qt=ce(),Dt=(0,Qt.InWasm)({s:1,t:0,d:"AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=="}),Ee=class{constructor(e){this.keepSize=e,this.width=0,this.height=0}decode(e){this.width=e[4]<<24|e[5]<<16|e[6]<<8|e[7],this.height=e[8]<<24|e[9]<<16|e[10]<<8|e[11];let t=this.width*this.height,i=t*4,A=e.length,s=Math.max(i,A)+(Math.min(i,A)>>1)+4096;this._inst?this._mem.buffer.byteLengththis.keepSize&&(this._inst=this._d=this._mem=null)}};Ce.default=Ee});var Ke=x(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.LIMITS=void 0;ie.LIMITS={CHUNK_SIZE:16384,PALETTE_SIZE:4096,MAX_WIDTH:16384,BYTES:"AGFzbQEAAAABJAdgAAF/YAJ/fwBgA39/fwF/YAF/AX9gAABgBH9/f38AYAF/AAIlAgNlbnYLaGFuZGxlX2JhbmQAAwNlbnYLbW9kZV9wYXJzZWQAAwMTEgQAAAAAAQQBAQUBAAACAgAGAwQFAXABBwcFBAEBBwcGCAF/AUGAihoLB9wBDgZtZW1vcnkCABFnZXRfc3RhdGVfYWRkcmVzcwADEWdldF9jaHVua19hZGRyZXNzAAQOZ2V0X3AwX2FkZHJlc3MABRNnZXRfcGFsZXR0ZV9hZGRyZXNzAAYEaW5pdAALBmRlY29kZQAMDWN1cnJlbnRfd2lkdGgADQ5jdXJyZW50X2hlaWdodAAOGV9faW5kaXJlY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gADcDAEHYjAIgADcDAEHQjAIgADcDAEHIjAIgADcDAEHAjAIgADcDAEG4jAIgADcDAEGwjAIgADcDAEGojAIgADcDAEGgjAIgADcDAEGYjAIgADcDAEGQjAIgADcDAEGIjAIgADcDAEGAjAIgADcDAEH4iwIgADcDAEHwiwIgADcDAEHoiwIgADcDAEHgiwIgADcDAEHYiwIgADcDAEHQiwIgADcDAEHIiwIgADcDAEHAiwIgADcDAEG4iwIgADcDAEGwiwIgADcDAEGoiwIgADcDAEGgiwIgADcDAEGYiwIgADcDAEGQiwIgADcDAEGIiwIgADcDAEGAiwIgADcDAEH4igIgADcDAEHwigIgADcDAEHoigIgADcDAEHgigIgADcDAEHYigIgADcDAEHQigIgADcDAEHIigIgADcDAEHAigIgADcDAEG4igIgADcDAEGwigIgADcDAEGoigIgADcDAEGgigIgADcDAEGYigIgADcDAEGQigIgADcDAEGIigIgADcDAEGAigIgADcDAEH4iQIgADcDAEHwiQIgADcDAEHoiQIgADcDAEHgiQIgADcDAEHYiQIgADcDAEHQiQIgADcDAEHIiQIgADcDAEHAiQIgADcDAEG4iQIgADcDAEGwiQIgADcDAEGoCCgCACIEQf8AakGAAW0hCAJAIARBgQFIDQBBASEBIAhBAiAIQQJKG0EBayICQQFxIQMgBEGBAk4EQCACQX5xIQIDQCABQQl0IgdBEHJBoIkCakGwiQJBgAT8CgAAIAdBsI0CakGwiQJBgAT8CgAAIAFBAmohASACQQJrIgINAAsLIANFDQAgAUEJdEEQckGgiQJqQbCJAkGABPwKAAALAkAgBEEBSA0AIAhBASAIQQFKGyIDQQFxIQUCQCADQQFrIgdFBEBBACEBDAELIANB/v///wdxIQJBACEBA0AgAUEJdCIGQRByQbCJBmpBsIkCQYAE/AoAACAGQZAEckGwiQZqQbCJAkGABPwKAAAgAUECaiEBIAJBAmsiAg0ACwsgBQRAIAFBCXRBEHJBsIkGakGwiQJBgAT8CgAACyAEQQFIDQAgA0EBcSEFIAcEfyADQf7///8HcSECQQAhAQNAIAFBCXQi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EIdAJ/IAdDAAB/Q5RDAAAAP5IiBkMAAIBPXSAGQwAAAABgcQRAIAapDAELQQALQRB0ciABcgtBgICAeHILNwAgAEH/AWxBMmpB5ABtIAFB/wFsQTJqQeQAbUEIdHIgAkH/AWxBMmpB5ABtQRB0ckGAgIB4cgsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwsYAQBBgAgLEQEAAAACAAAAAwAAAAQAAAAF"}});var We=x(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.decodeAsync=b.decode=b.Decoder=b.DecoderAsync=void 0;var O=X(),f=Ke();function yt(r){if(typeof Buffer<"u")return Buffer.from(r,"base64");let e=atob(r),t=new Uint8Array(e.length);for(let i=0;i1,this.modeHandler=e=>1}handle_band(e){return this.bandHandler(e)}mode_parsed(e){return this.modeHandler(e)}},St={memoryLimit:2048*65536,sixelColor:O.DEFAULT_FOREGROUND,fillColor:O.DEFAULT_BACKGROUND,palette:O.PALETTE_VT340_COLOR,paletteLimit:f.LIMITS.PALETTE_SIZE,truncate:!0};function qe(r){let e=new ye,t={env:{handle_band:e.handle_band.bind(e),mode_parsed:e.mode_parsed.bind(e)}};return WebAssembly.instantiate(J||Ye,t).then(i=>(J=J||i.module,new P(r,i.instance||i,e)))}b.DecoderAsync=qe;var P=class{constructor(e,t,i){if(this._PIXEL_OFFSET=f.LIMITS.MAX_WIDTH+4,this._canvas=Ae,this._bandWidths=[],this._maxWidth=0,this._minWidth=f.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0,this._opts=Object.assign({},St,e),this._opts.paletteLimit>f.LIMITS.PALETTE_SIZE)throw new Error(`DecoderOptions.paletteLimit must not exceed ${f.LIMITS.PALETTE_SIZE}`);if(t)i.bandHandler=this._handle_band.bind(this),i.modeHandler=this._initCanvas.bind(this);else{let A=J||(J=new WebAssembly.Module(Ye));t=new WebAssembly.Instance(A,{env:{handle_band:this._handle_band.bind(this),mode_parsed:this._initCanvas.bind(this)}})}this._instance=t,this._wasm=this._instance.exports,this._chunk=new Uint8Array(this._wasm.memory.buffer,this._wasm.get_chunk_address(),f.LIMITS.CHUNK_SIZE),this._states=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_state_address(),12),this._palette=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_palette_address(),f.LIMITS.PALETTE_SIZE),this._palette.set(this._opts.palette),this._pSrc=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_p0_address()),this._wasm.init(O.DEFAULT_FOREGROUND,0,this._opts.paletteLimit,0)}get _fillColor(){return this._states[0]}get _truncate(){return this._states[8]}get _rasterWidth(){return this._states[6]}get _rasterHeight(){return this._states[7]}get _width(){return this._states[2]?this._states[2]-4:0}get _height(){return this._states[3]}get _level(){return this._states[9]}get _mode(){return this._states[10]}get _paletteLimit(){return this._states[11]}_initCanvas(e){if(e===2){let t=this.width*this.height;if(t>this._canvas.length){if(this._opts.memoryLimit&&t*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(t)}this._maxWidth=this._width}else if(e===1)if(this._level===2){let t=Math.min(this._rasterWidth,f.LIMITS.MAX_WIDTH)*this._rasterHeight;if(t>this._canvas.length){if(this._opts.memoryLimit&&t*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(t)}}else this._canvas.length<65536&&(this._canvas=new Uint32Array(65536));return 0}_realloc(e,t){let i=e+t;if(i>this._canvas.length){if(this._opts.memoryLimit&&i*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");let A=new Uint32Array(Math.ceil(i/65536)*65536);A.set(this._canvas),this._canvas=A}}_handle_band(e){let t=this._PIXEL_OFFSET,i=this._lastOffset;if(this._mode===2){let A=this.height-this._currentHeight,s=0;for(;s<6&&A>0;)this._canvas.set(this._pSrc.subarray(t*s,t*s+e),i+e*s),s++,A--;this._lastOffset+=e*s,this._currentHeight+=s}else if(this._mode===1){this._realloc(i,e*6),this._maxWidth=Math.max(this._maxWidth,e),this._minWidth=Math.min(this._minWidth,e);for(let A=0;A<6;++A)this._canvas.set(this._pSrc.subarray(t*A,t*A+e),i+e*A);this._bandWidths.push(e),this._lastOffset+=e*6,this._currentHeight+=6}return 0}get width(){return this._mode!==1?this._width:Math.max(this._maxWidth,this._wasm.current_width())}get height(){return this._mode!==1?this._height:this._wasm.current_width()?this._bandWidths.length*6+this._wasm.current_height():this._bandWidths.length*6}get palette(){return this._palette.subarray(0,this._paletteLimit)}get memoryUsage(){return this._canvas.byteLength+this._wasm.memory.buffer.byteLength+8*this._bandWidths.length}get properties(){return{width:this.width,height:this.height,mode:this._mode,level:this._level,truncate:!!this._truncate,paletteLimit:this._paletteLimit,fillColor:this._fillColor,memUsage:this.memoryUsage,rasterAttributes:{numerator:this._states[4],denominator:this._states[5],width:this._rasterWidth,height:this._rasterHeight}}}init(e=this._opts.fillColor,t=this._opts.palette,i=this._opts.paletteLimit,A=this._opts.truncate){this._wasm.init(this._opts.sixelColor,e,i,A?1:0),t&&this._palette.set(t.subarray(0,f.LIMITS.PALETTE_SIZE)),this._bandWidths.length=0,this._maxWidth=0,this._minWidth=f.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0}decode(e,t=0,i=e.length){let A=t;for(;A0){let i=this._PIXEL_OFFSET,A=this._lastOffset,s=0;for(;s<6&&t>0;)this._canvas.set(this._pSrc.subarray(i*s,i*s+e),A+e*s),s++,t--;t&&this._canvas.fill(this._fillColor,A+e*s)}return this._canvas.subarray(0,this.width*this.height)}if(this._mode===1){if(this._minWidth===this._maxWidth){let s=!1;if(e)if(e!==this._minWidth)s=!0;else{let n=this._PIXEL_OFFSET,a=this._lastOffset;this._realloc(a,e*6);for(let o=0;o<6;++o)this._canvas.set(this._pSrc.subarray(n*o,n*o+e),a+e*o)}if(!s)return this._canvas.subarray(0,this.width*this.height)}let t=new Uint32Array(this.width*this.height);t.fill(this._fillColor);let i=0,A=0;for(let s=0;s{if(this._disposed)return H(()=>{});let A={fn:e,thisArgs:t};this._listeners=this._listeners.slice(),this._listeners.push(A);let s=H(()=>{let n=this._listeners.indexOf(A);n!==-1&&(this._listeners=this._listeners.slice(),this._listeners.splice(n,1))});return i&&(Array.isArray(i)?i.push(s):i.add(s)),s},this._event)}fire(e){if(this._disposed||!this._listeners.length)return;if(this._listeners.length===1){this._listeners[0].fn.call(this._listeners[0].thisArgs,e);return}let t=this._listeners;for(let i=0,A=t.length;i{function r(s,n){return s(a=>n.fire(a))}A.forward=r;function e(s,n){return(a,o,g)=>s(h=>a.call(o,n(h)),void 0,g)}A.map=e;function t(...s){return(n,a,o)=>{let g=new N;for(let h of s)g.add(h(I=>n.call(a,I)));return o&&(Array.isArray(o)?o.push(g):o.add(g)),g}}A.any=t;function i(s,n,a){return n(a),s(o=>n(o))}A.runAndSubscribe=i})(ot||={});var de=M(X());var D=class r extends k{constructor(t){super();this._terminal=t;this._layers=new Map;this._optionsRefresh=this._register(new W);this._oldOpen=this._terminal._core.open,this._terminal._core.open=i=>{this._oldOpen?.call(this._terminal._core,i),this._open()},this._terminal._core.screenElement&&this._open(),this._optionsRefresh.value=this._terminal._core.optionsService.onOptionChange(i=>{i==="fontSize"&&(this.rescaleCanvas(),this._renderService?.refreshRows(0,this._terminal.rows))}),this._register(H(()=>{this.removeLayerFromDom(),this.removeLayerFromDom("bottom"),this._terminal._core&&this._oldOpen&&(this._terminal._core.open=this._oldOpen,this._oldOpen=void 0),this._renderService&&this._oldSetRenderer&&(this._renderService.setRenderer=this._oldSetRenderer,this._oldSetRenderer=void 0),this._renderService=void 0,this._layers.clear(),this._placeholderBitmap?.close(),this._placeholderBitmap=void 0,this._placeholder=void 0}))}get canvas(){return this._layers.get("top")?.canvas}static createCanvas(t,i,A){let s=(t??document).createElement("canvas");return s.width=i|0,s.height=A|0,s}static createImageData(t,i,A,s){if(typeof ImageData!="function"){let n=t.createImageData(i,A);return s&&n.data.set(new Uint8ClampedArray(s,0,i*A*4)),n}return s?new ImageData(new Uint8ClampedArray(s,0,i*A*4),i,A):new ImageData(i,A)}static createImageBitmap(t){return typeof createImageBitmap!="function"?Promise.resolve(void 0):createImageBitmap(t)}showPlaceholder(t){t?!this._placeholder&&this.cellSize.height!==-1&&this._createPlaceHolder(Math.max(this.cellSize.height+1,24)):(this._placeholderBitmap?.close(),this._placeholderBitmap=void 0,this._placeholder=void 0),this._renderService?.refreshRows(0,this._terminal.rows)}get dimensions(){return this._terminal.dimensions}get cellSize(){return{width:this.dimensions?.css.cell.width||-1,height:this.dimensions?.css.cell.height||-1}}clearLines(t,i,A){let s=t*(this.dimensions?.css.cell.height||0),n=this.dimensions?.css.canvas.width||0,a=(i+1-t)*(this.dimensions?.css.cell.height||0);(!A||A==="top")&&this._layers.get("top")?.clearRect(0,s,n,a),(!A||A==="bottom")&&this._layers.get("bottom")?.clearRect(0,s,n,a)}clearAll(t){if(!t||t==="top"){let i=this._layers.get("top");i?.clearRect(0,0,i.canvas.width,i.canvas.height)}if(!t||t==="bottom"){let i=this._layers.get("bottom");i?.clearRect(0,0,i.canvas.width,i.canvas.height)}}draw(t,i,A,s,n=1){let a=this._layers.get(t.layer);if(!a)return;let{width:o,height:g}=this.cellSize;if(o===-1||g===-1)return;this._rescaleImage(t,o,g);let h=t.actual,I=Math.ceil(h.width/o),d=i%I*o,c=Math.floor(i/I)*g,l=A*o,E=s*g,p=n*o+d>h.width?h.width-d:n*o,u=c+g>h.height?h.height-c:g;a.drawImage(h,Math.floor(d),Math.floor(c),Math.ceil(p),Math.ceil(u),Math.floor(l),Math.floor(E),Math.ceil(p),Math.ceil(u))}extractTile(t,i){let{width:A,height:s}=this.cellSize;if(A===-1||s===-1)return;this._rescaleImage(t,A,s);let n=t.actual,a=Math.ceil(n.width/A),o=i%a*A,g=Math.floor(i/a)*s,h=A+o>n.width?n.width-o:A,I=g+s>n.height?n.height-g:s,d=r.createCanvas(this.document,h,I),c=d.getContext("2d");if(c)return c.drawImage(n,Math.floor(o),Math.floor(g),Math.floor(h),Math.floor(I),0,0,Math.floor(h),Math.floor(I)),d}drawPlaceholder(t,i,A=1){let s=this._layers.get("top");if(s){let{width:n,height:a}=this.cellSize;if(n===-1||a===-1||(this._placeholder?a>=this._placeholder.height&&this._createPlaceHolder(a+1):this._createPlaceHolder(Math.max(a+1,24)),!this._placeholder))return;s.drawImage(this._placeholderBitmap??this._placeholder,t*n,i*a%2?0:1,n*A,a,t*n,i*a,n*A,a)}}rescaleCanvas(){let t=this.dimensions?.css.canvas.width||0,i=this.dimensions?.css.canvas.height||0;for(let A of this._layers.values())(A.canvas.width!==t||A.canvas.height!==i)&&(A.canvas.width=t,A.canvas.height=i)}_rescaleImage(t,i,A){if(i===t.actualCellSize.width&&A===t.actualCellSize.height)return;let{width:s,height:n}=t.origCellSize;if(i===s&&A===n){t.actual=t.orig,t.actualCellSize.width=s,t.actualCellSize.height=n;return}let a=r.createCanvas(this.document,Math.ceil(t.orig.width*i/s),Math.ceil(t.orig.height*A/n)),o=a.getContext("2d");o&&(o.drawImage(t.orig,0,0,a.width,a.height),t.actual=a,t.actualCellSize.width=i,t.actualCellSize.height=A)}_open(){this._renderService=this._terminal._core._renderService,this._oldSetRenderer=this._renderService.setRenderer.bind(this._renderService),this._renderService.setRenderer=t=>{for(let i of[...this._layers.keys()])this.removeLayerFromDom(i);this._oldSetRenderer?.call(this._renderService,t)}}insertLayerToDom(t="top"){if(!this.document||!this._terminal._core.screenElement){console.warn("image addon: cannot insert output canvas to DOM, missing document or screenElement");return}if(this._layers.has(t))return;let i=r.createCanvas(this.document,this.dimensions?.css.canvas.width||0,this.dimensions?.css.canvas.height||0);i.classList.add(`xterm-image-layer-${t}`);let A=this._terminal._core.screenElement;A.style.isolation="isolate",t==="bottom"?(i.style.zIndex="-1",A.insertBefore(i,A.firstChild)):(i.style.zIndex="0",A.appendChild(i));let s=i.getContext("2d",{alpha:!0});if(!s){i.remove();return}this._layers.set(t,s),this.clearAll(t)}removeLayerFromDom(t="top"){let i=this._layers.get(t);i&&(i.canvas.remove(),this._layers.delete(t))}hasLayer(t){return this._layers.has(t)}_createPlaceHolder(t=24){this._placeholderBitmap?.close(),this._placeholderBitmap=void 0;let i=32,A=r.createCanvas(this.document,i,t),s=A.getContext("2d",{alpha:!1});if(!s)return;let n=r.createImageData(s,i,t),a=new Uint32Array(n.data.buffer),o=(0,de.toRGBA8888)(0,0,0),g=(0,de.toRGBA8888)(255,255,255);a.fill(o);for(let d=0;dthis._placeholderBitmap=d)}get document(){return this._terminal._core._coreBrowserService?.window.document}};var w={width:7,height:14},G=class r{constructor(e=0,t=0,i=-1,A=-1){this.imageId=i;this.tileId=A;this._ext=0;this._urlId=0;this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new r(this._ext,this._urlId,this.imageId,this.tileId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0&&this.imageId===-1}},F=new G,Z=class{constructor(e,t,i){this._terminal=e;this._renderer=t;this._opts=i;this._images=new Map;this._lastId=0;this._lowestId=0;this._fullyCleared=!1;this._needsFullClear=!1;this._pixelLimit=25e5;try{this.setLimit(this._opts.storageLimit)}catch(A){A instanceof Error&&console.error(A.message),console.warn(`storageLimit is set to ${this.getLimit()} MB`)}this._viewportMetrics={cols:this._terminal.cols,rows:this._terminal.rows}}dispose(){this.reset()}reset(){for(let e of this._images.values())e.marker?.dispose();this._images.clear(),this._renderer.clearAll()}getLimit(){return this._pixelLimit*4/1e6}setLimit(e){if(e<.5||e>1e3)throw RangeError("invalid storageLimit, should be at least 0.5 MB and not exceed 1G");this._pixelLimit=e/4*1e6>>>0,this._evictOldest(0)}getUsage(){return this._getStoredPixels()*4/1e6}_getStoredPixels(){let e=0;for(let t of this._images.values())t.orig&&(e+=t.orig.width*t.orig.height,t.actual&&t.actual!==t.orig&&(e+=t.actual.width*t.actual.height));return e}_delImg(e){let t=this._images.get(e);t&&(this._images.delete(e),window.ImageBitmap&&t.orig instanceof ImageBitmap&&t.orig.close(),this.onImageDeleted?.(e))}wipeAlternate(){let e=[];for(let[t,i]of this._images.entries())i.bufferType==="alternate"&&(i.marker?.dispose(),e.push(t));for(let t of e)this._delImg(t);this._needsFullClear=!0,this._fullyCleared=!1}deleteImage(e){let t=this._images.get(e);t&&(t.marker?.dispose(),this._delImg(e))}addImage(e,t){this._evictOldest(e.width*e.height);let i=this._renderer.cellSize;(i.width===-1||i.height===-1)&&(i=w);let A=Math.ceil(e.width/i.width),s=Math.ceil(e.height/i.height),n=++this._lastId,a=this._terminal._core.buffer,o=this._terminal.cols,g=this._terminal.rows,h=a.x,I=a.y,d=h,c=0;t.scrolling||(a.x=0,a.y=0,d=0),this._terminal._core._inputHandler._dirtyRowTracker.markDirty(a.y);for(let u=0;u=o);++Q)this._writeToCell(C,d+Q,n,u*A+Q),c++;if(t.scrolling)u=g)break;a.x=d}this._terminal._core._inputHandler._dirtyRowTracker.markDirty(a.y),t.scrolling?t.cursorPos==="iip"?a.x=Math.min(d+A,o):a.x=d:(a.x=h,a.y=I);let l=[];for(let[u,C]of this._images.entries())C.tileCount<1&&(C.marker?.dispose(),l.push(u));for(let u of l)this._delImg(u);let E=this._terminal.registerMarker(0);E?.onDispose(()=>{this._images.get(n)&&this._delImg(n)}),this._terminal.buffer.active.type==="alternate"&&this._evictOnAlternate();let p={orig:e,origCellSize:i,actual:e,actualCellSize:{...i},marker:E||void 0,tileCount:c,bufferType:this._terminal.buffer.active.type,layer:t.layer,zIndex:t.zIndex};return this._images.set(n,p),this.onImageAdded?.(),n}render(e){let t=!1,i=!1;for(let h of this._images.values())if(h.layer==="bottom"?i=!0:t=!0,t&&i)break;if(t&&!this._renderer.hasLayer("top")&&(this._renderer.insertLayerToDom("top"),!this._renderer.hasLayer("top")))return;if(i&&!this._renderer.hasLayer("bottom")&&this._renderer.insertLayerToDom("bottom"),this._renderer.rescaleCanvas(),!this._images.size){this._fullyCleared||(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1),this._renderer.hasLayer("top")&&this._renderer.removeLayerFromDom("top"),this._renderer.hasLayer("bottom")&&this._renderer.removeLayerFromDom("bottom");return}!t&&this._renderer.hasLayer("top")&&(this._renderer.clearAll("top"),this._renderer.removeLayerFromDom("top")),!i&&this._renderer.hasLayer("bottom")&&(this._renderer.clearAll("bottom"),this._renderer.removeLayerFromDom("bottom")),this._needsFullClear&&(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1);let{start:A,end:s}=e,n=this._terminal._core.buffer,a=this._terminal._core.cols;this._renderer.clearLines(A,s);let o=[],g=[];for(let h=A;h<=s;++h){let I=n.lines.get(h+n.ydisp);if(!I)return;for(let d=0;dh.imgSpec.zIndex-I.imgSpec.zIndex);for(let h of g)this._renderer.drawPlaceholder(h.col,h.row,h.count);for(let h of o)this._renderer.draw(h.imgSpec,h.tileId,h.col,h.row,h.count)}viewportResize(e){if(!this._images.size){this._viewportMetrics=e;return}if(this._viewportMetrics.cols>=e.cols){this._viewportMetrics=e;return}let t=this._terminal._core.buffer,i=t.lines.length,A=this._viewportMetrics.cols-1;for(let s=0;s=h)continue;let I=!1;for(let l=A+1;l>e.cols;++l)if(n._data[l*3+0]&4194303){I=!0;break}if(I)continue;let d=Math.min(e.cols,h-a.tileId%h+A),c=a.tileId;for(let l=A+1;l57)throw new Error("illegal char");e=e*10+r[t]-48}return e}function ke(r){let e=j(r);if(!e.match(/^((auto)|(\d+?((px)|(%)){0,1}))$/))throw new Error("illegal size");return e}function wt(r){if(typeof Buffer<"u")return Buffer.from(j(r),"base64").toString();let e=atob(j(r)),t=new Uint8Array(e.length);for(let i=0;i14)return-1;for(let a=t;a=De)return this._a();n[s++]=o}break;case 58:return A===3&&!this._storeValue(s)?this._a():(this.state=4,a+1);default:if(s>=De)return this._a();n[s++]=o}}return this.state=A,this._position=s,-2}_a(){return this.fields.type=0,this.state=1,-1}_storeKey(e){let t=j(this._buffer.subarray(0,e));return t?(this._key=t,this.fields[t]=null,!0):!1}_storeValue(e){if(this._key){try{let t=this._buffer.slice(0,e);this.fields[this._key]=Ne[this._key]?Ne[this._key](t):t}catch{return!1}return!0}return!1}};var L={mime:"unsupported",width:0,height:0};function Ge(r){if(r.length<32)return L;let e=new Uint32Array(r.buffer,r.byteOffset,8);if(e[0]===1196314761&&e[1]===169478669&&e[3]===1380206665)return{mime:"image/png",width:r[16]<<24|r[17]<<16|r[18]<<8|r[19],height:r[20]<<24|r[21]<<16|r[22]<<8|r[23]};if(r[0]===255&&r[1]===216&&r[2]===255){let[t,i]=bt(r);return{mime:"image/jpeg",width:t,height:i}}if(e[0]===944130375&&(r[4]===55||r[4]===57)&&r[5]===97)return{mime:"image/gif",width:r[7]<<8|r[6],height:r[9]<<8|r[8]};if(e[0]===1718185841)return{mime:"image/qoi",width:r[4]<<24|r[5]<<16|r[6]<<8|r[7],height:r[8]<<24|r[9]<<16|r[10]<<8|r[11]};if(e[0]===1179011410&&e[2]===1346520407&&(e[3]&16777215)===3690582){switch(r[15]){case 88:return{mime:"image/webp",width:(r[24]|r[25]<<8|r[26]<<16)+1,height:(r[27]|r[28]<<8|r[29]<<16)+1};case 76:if(r[20]!==47)return L;let t=r[21]|r[22]<<8|r[23]<<16|r[24]<<24;return{mime:"image/webp",width:(t&16383)+1,height:(t>>>14&16383)+1};case 32:return r[23]!==157||r[24]!==1||r[25]!==42?L:{mime:"image/webp",width:(r[26]|r[27]<<8)&16383,height:(r[28]|r[29]<<8)&16383}}return L}if(e[1]===1887007846&&(e[2]===1718187617||e[2]===1936291425)){let t=-1,i=Math.min(r.length-16,1024);for(let A=8;A0&&s>0)return{mime:"image/avif",width:A,height:s}}return L}return L}function bt(r){let e=r.length,t=4,i=r[t]<<8|r[t+1];for(;;){if(t+=i,t>=e)return[0,0];if(r[t]!==255)return[0,0];if(r[t+1]===192||r[t+1]===194)return t+80){if(this._hp.fields.type===1){if(this._isMultipart&&(this._isMultipart=!1,this._abortMulti=!1,this._dec.release()),this._header=Object.assign({},we,this._hp.fields),!this._header.inline){this._aborted=!0;return}this._dec.init()}else if(this._abortMulti){this._aborted=!0;return}this._dec.put(e.subarray(A,i))!==0&&(this._dec.release(),this._aborted=!0,this._isMultipart&&(this._abortMulti=!0))}}}end(e){if(this._aborted||this._hp.state!==4&&this._hp.end())return!0;let t=this._hp.fields.type;if(t===3)return!0;if(t===5){let o=w.width,g=w.height;this._renderer.dimensions&&(o=this._renderer.dimensions.css.canvas.width/this._coreTerminal.cols,g=this._renderer.dimensions.css.canvas.height/this._coreTerminal.rows);let h=this._coreTerminal._core._coreBrowserService?.dpr??1,I=`\x1B]1337;ReportCellSize=${g.toFixed(3)};${o.toFixed(3)};${h.toFixed(3)}\x1B\\`;return this._coreTerminal.input(I,!1),!0}if(t===2)return this._header=Object.assign({},we,this._hp.fields),this._isMultipart=!0,this._abortMulti=!1,this._dec.release(),this._dec.init(),!0;if(t===4&&(!this._isMultipart||(this._isMultipart=!1,this._abortMulti||this._header.type!==2)))return!0;let i=0,A=0,s,n=L;if((s=e)&&((s=!this._dec.end())?(n=Ge(this._dec.data8),(s=n.mime!=="unsupported")?(i=n.width,A=n.height,(s=i&&A&&i*A(this._storage.addImage(o),!0)).catch(o=>(console.warn(`IIP: decoding error ${n.mime} ${n.width}x${n.height}`,o),!0))}_resize(e,t){let i=this._renderer.dimensions?.css.cell.width||w.width,A=this._renderer.dimensions?.css.cell.height||w.height,s=this._renderer.dimensions?.css.canvas.width||i*this._coreTerminal.cols,n=this._renderer.dimensions?.css.canvas.height||A*this._coreTerminal.rows,a=this._dim(this._header.width,s,i),o=this._dim(this._header.height,n,A);if(!a&&!o){let g=s/e,h=(n-A)/t,I=Math.min(g,h);return I<1?[e*I,t*I]:[e,t]}return a?this._header.preserveAspectRatio||!a||!o?[a,t*a/e]:[a,o]:[e*o/t,o]}_dim(e,t,i){return e==="auto"?0:e.endsWith("%")?parseInt(e.slice(0,-1),10)*t/100:e.endsWith("px")?parseInt(e.slice(0,-2),10):parseInt(e,10)*i}};var Pe=M(ue());function be(r){let e={},t=r.split(",");for(let i of t){let A=i.indexOf("=");if(A===-1)continue;let s=i.substring(0,A),n=i.substring(A+1);if(s==="a"){e.action=n;continue}if(s==="o"){e.compression=n;continue}if(s==="t"){e.transmission=n;continue}if(s==="d"){e.deleteSelector=n;continue}let a=parseInt(n,10);switch(s){case"f":e.format=a;break;case"i":e.id=a;break;case"I":e.imageNumber=a;break;case"s":e.width=a;break;case"v":e.height=a;break;case"x":e.x=a;break;case"y":e.y=a;break;case"w":e.sourceWidth=a;break;case"h":e.sourceHeight=a;break;case"X":e.xOffset=a;break;case"Y":e.yOffset=a;break;case"c":e.columns=a;break;case"r":e.rows=a;break;case"m":e.more=a;break;case"q":e.quiet=a;break;case"C":e.cursorMovement=a;break;case"z":e.zIndex=a;break;case"p":e.placementId=a;break}}return e}var Je=0,ee=class{constructor(e,t,i,A){this._opts=e;this._renderer=t;this._kittyStorage=i;this._coreTerminal=A;this._aborted=!1;this._decodeError=!1;this._activeDecoder=null;this._inControlData=!0;this._controlData=new Uint32Array(512);this._controlLength=0;this._encodedSizeLimit=0;this._totalEncodedSize=0;this._parsedCommand=null;this._pendingTransmissions=new Map;this._maxEncodedBytes=Math.ceil(this._opts.kittySizeLimit*4/3),this._initialEncodedBytes=Math.min(4194304,this._maxEncodedBytes)}reset(){this._cleanupAllPending(),this._activeDecoder&&(this._activeDecoder.release(),this._activeDecoder=null),this._kittyStorage.reset()}dispose(){this.reset()}_removePendingEntry(e){this._pendingTransmissions.delete(e),this._lastPendingKey===e&&(this._lastPendingKey=void 0)}_cleanupAllPending(){for(let e of this._pendingTransmissions.values())e.decoder.release();this._pendingTransmissions.clear(),this._lastPendingKey=void 0}start(){this._aborted=!1,this._decodeError=!1,this._inControlData=!0,this._controlLength=0,this._parsedCommand=null,this._encodedSizeLimit=this._maxEncodedBytes,this._totalEncodedSize=0,this._activeDecoder=null}put(e,t,i){if(!this._aborted)if(!this._inControlData)this._streamPayload(e,t,i);else{let A=i;for(let n=t;n512){this._aborted=!0;return}if(this._controlData.set(e.subarray(t,A),this._controlLength),this._controlLength+=s,!this._inControlData){if(this._parsedCommand=be(this._parseControlDataString()),this._parsedCommand.id!==void 0&&this._parsedCommand.imageNumber!==void 0){this._sendResponse(this._parsedCommand.id,"EINVAL:cannot specify both i and I keys",this._parsedCommand.quiet??0),this._aborted=!0;return}if(this._parsedCommand.action==="d")return;let n=A+1;nthis._encodedSizeLimit){let o=this._activeDecoder??s?.decoder;o&&o.release(),this._activeDecoder=null,s&&this._removePendingEntry(A),this._aborted=!0;return}this._decodeError||(s?.decoder&&!this._activeDecoder&&(this._activeDecoder=s.decoder),this._activeDecoder||(this._activeDecoder=new Pe.default(4194304,this._maxEncodedBytes,this._initialEncodedBytes),this._activeDecoder.init()),this._activeDecoder.put(e.subarray(t,i))!==Je&&(this._activeDecoder.release(),this._activeDecoder=null,this._decodeError=!0,s&&this._removePendingEntry(A)))}end(e){if(this._aborted||!e)return this._activeDecoder&&(this._activeDecoder.release(),this._activeDecoder=null),!0;if(this._inControlData)return this._handleNoPayloadCommand();let t=this._parsedCommand;if(t.action==="d")return this._handleDelete(t);let i=t.id??this._lastPendingKey??0,A=t.more===1,s=this._pendingTransmissions.get(i);if(A)return this._activeDecoder&&(s?(s.totalEncodedSize+=this._totalEncodedSize,s.decodeError=s.decodeError||this._decodeError):this._pendingTransmissions.set(i,{cmd:{...t},decoder:this._activeDecoder,totalEncodedSize:this._totalEncodedSize,decodeError:this._decodeError}),this._lastPendingKey=i,this._activeDecoder=null),!0;s&&(this._lastPendingKey=void 0);let n=this._decodeError,a=t,o=this._activeDecoder;s&&(a=s.cmd,o=s.decoder,n=n||s.decodeError,this._pendingTransmissions.delete(i));let g=new Uint8Array(0);o&&(o.end()!==Je&&(n=!0),g=o.data8),this._activeDecoder=null;let h=this._handleCommandWithBytesAndCmd(a,g,n);return o&&o.release(),h}_parseControlDataString(){let e="";for(let t=0;t0&&this._sendResponse(e.id,"OK",e.quiet??0)),s}case"T":return this._handleTransmitDisplay(e,t,i);case"q":return this._handleQuery(e,t,i);case"p":return this._handlePlacement(e);default:return e.id!==void 0&&this._sendResponse(e.id,"EINVAL:unsupported action",e.quiet??0),!0}}_handlePlacement(e){if(e.id===void 0)return!0;let t=e.id,i=this._kittyStorage.getImage(t);return i?this._displayImage(i,e).then(s=>(this._sendResponse(t,s?"OK":"EINVAL:image rendering failed",e.quiet??0,e.placementId),!0)):(this._sendResponse(t,"ENOENT:image not found",e.quiet??0,e.placementId),!0)}_handleTransmit(e,t,i){return(e.transmission??"d")!=="d"?(e.id!==void 0&&this._sendResponse(e.id,"EINVAL:unsupported transmission medium",e.quiet??0),!0):(i||t.length===0||this._kittyStorage.storeImage(e.id,{data:new Blob([t]),width:e.width??0,height:e.height??0,format:e.format??32,compression:e.compression??""}),!0)}_handleTransmitDisplay(e,t,i){if(i)return e.id!==void 0&&this._sendResponse(e.id,"EINVAL:invalid base64 data",e.quiet??0),!0;this._handleTransmit(e,t,i);let A=e.id??this._kittyStorage.lastImageId,s=this._kittyStorage.getImage(A);if(s){let n=this._displayImage(s,e);return e.id!==void 0?n.then(a=>(this._sendResponse(A,a?"OK":"EINVAL:image rendering failed",e.quiet??0),!0)):n.then(()=>!0)}return!0}_handleQuery(e,t,i){let A=e.id??0,s=e.quiet??0;if((e.transmission??"d")!=="d")return this._sendResponse(A,"EINVAL:unsupported transmission medium",s),!0;if(i)return this._sendResponse(A,"EINVAL:invalid base64 data",s),!0;if(t.length===0)return this._sendResponse(A,"OK",s),!0;let a=e.format??32;if(a===100)this._sendResponse(A,"OK",s);else{let o=e.width??0,g=e.height??0;if(!o||!g)return this._sendResponse(A,"EINVAL:width and height required for raw pixel data",s),!0;let h=a===32?4:3,I=o*g*h;if(t.length=1||!s&&i>=2)return;let n=A?`,p=${A}`:"",a=`\x1B_Gi=${e}${n};${t}\x1B\\`;this._coreTerminal._core.coreService.triggerDataEvent(a)}_displayImage(e,t){return this._decodeAndDisplay(e,t).then(()=>!0).catch(()=>!1)}async _decodeAndDisplay(e,t){let i=await this._createBitmap(e);try{let A=Math.max(0,t.x??0),s=Math.max(0,t.y??0),n=t.sourceWidth||i.width-A,a=t.sourceHeight||i.height-s,o=Math.max(0,i.width-A),g=Math.max(0,i.height-s),h=Math.max(0,Math.min(n,o)),I=Math.max(0,Math.min(a,g));if(h===0||I===0)throw new Error("invalid source rectangle");if(A!==0||s!==0||h!==i.width||I!==i.height){let T=await createImageBitmap(i,A,s,h,I);i.close(),i=T}let d=this._renderer.dimensions?.css.cell.width||w.width,c=this._renderer.dimensions?.css.cell.height||w.height,l,E;t.columns!==void 0&&t.rows!==void 0?(l=t.columns,E=t.rows):t.columns!==void 0?(l=t.columns,E=Math.max(1,Math.ceil(i.height/i.width*(l*d)/c))):t.rows!==void 0?(E=t.rows,l=Math.max(1,Math.ceil(i.width/i.height*(E*c)/d))):(l=Math.ceil(i.width/d),E=Math.ceil(i.height/c));let p=i.width,u=i.height;if((t.columns!==void 0||t.rows!==void 0)&&(p=Math.round(l*d),u=Math.round(E*c)),p*u>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");let C=this._coreTerminal._core.buffer,Q=C.x,K=C.y,Y=C.ybase,Ve=t.zIndex!==void 0&&t.zIndex<0?"bottom":"top";if(p!==i.width||u!==i.height){let T=await createImageBitmap(i,{resizeWidth:p,resizeHeight:u});i.close(),i=T}let oe=Math.min(Math.max(0,t.xOffset??0),d-1),he=Math.min(Math.max(0,t.yOffset??0),c-1);if(oe!==0||he!==0){let T=t.columns!==void 0?Math.round(l*d):i.width+oe,et=t.rows!==void 0?Math.round(E*c):i.height+he,q=D.createCanvas(window.document,T,et),Le=q.getContext("2d");if(!Le)throw new Error("Failed to create offset canvas context");Le.drawImage(i,oe,he);let tt=await createImageBitmap(q);if(q.width=q.height=0,i.close(),i=tt,p=i.width,u=i.height,p*u>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");t.columns===void 0&&(l=Math.ceil(i.width/d)),t.rows===void 0&&(E=Math.ceil(i.height/c))}let $e=t.zIndex??0;if(this._kittyStorage.addImage(e.id,i,!0,Ve,$e),i=void 0,t.cursorMovement===1){let T=C.ybase-Y;C.x=Q,C.y=Math.max(K-T,0)}else C.x=Math.min(Q+l,this._coreTerminal.cols)}catch(A){throw i?.close(),A}}async _createBitmap(e){let t=new Uint8Array(await e.data.arrayBuffer());if(e.compression==="z"&&(t=await this._decompressZlib(t)),e.format===100){let p=new Blob([t],{type:"image/png"});if(!window.createImageBitmap){let u=URL.createObjectURL(p),C=new Image;return new Promise((Q,K)=>{C.addEventListener("load",()=>{URL.revokeObjectURL(u);let Y=D.createCanvas(window.document,C.width,C.height);Y.getContext("2d")?.drawImage(C,0,0),createImageBitmap(Y).then(Q).catch(K)}),C.addEventListener("error",()=>{URL.revokeObjectURL(u),K(new Error("Failed to load image"))}),C.src=u})}return createImageBitmap(p)}let i=e.width,A=e.height;if(!i||!A)throw new Error("Width and height required for raw pixel data");let s=e.format===32?4:3,n=i*A*s;if(t.length>>24|C<<8,h[c++]=4278190080|C>>>16|Q<<16,h[c++]=4278190080|Q>>>8}let l=I*3,E=I*4;for(let p=I;ph+I.length,0),o=new Uint8Array(a),g=0;for(let h of s)o.set(h,g),g+=h.length;return o}get images(){return this._kittyStorage.images}get _kittyIdToStorageId(){return this._kittyStorage.kittyIdToStorageId}get pendingTransmissions(){return this._pendingTransmissions}};var U=class U{constructor(e){this._storage=e;this._nextImageId=1;this._images=new Map;this._kittyIdToStorageId=new Map;this._storageIdToKittyId=new Map;this._handleStorageImageDeleted=e=>{let t=this._storageIdToKittyId.get(e);t!==void 0&&(this._kittyIdToStorageId.delete(t),this._storageIdToKittyId.delete(e),this._images.delete(t))};this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"iip"};this._previousOnImageDeleted=this._storage.onImageDeleted,this._wrappedOnImageDeleted=t=>{this._previousOnImageDeleted?.(t),this._handleStorageImageDeleted(t)},this._storage.onImageDeleted=this._wrappedOnImageDeleted}reset(){this._nextImageId=1,this._images.clear(),this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}dispose(){this.reset(),this._storage.onImageDeleted===this._wrappedOnImageDeleted&&(this._storage.onImageDeleted=this._previousOnImageDeleted)}storeImage(e,t){let i=e??this._nextImageId++,A=this._kittyIdToStorageId.get(i);return A!==void 0&&(this._storage.deleteImage(A),this._kittyIdToStorageId.delete(i),this._storageIdToKittyId.delete(A)),!this._images.has(i)&&this._images.size>=U._maxStoredImages&&this._evictUndisplayedImages(),this._images.set(i,{...t,id:i}),i}addImage(e,t,i,A,s){let n=this._kittyIdToStorageId.get(e);n!==void 0&&this._storageIdToKittyId.delete(n),this._addImageOpts.scrolling=i,this._addImageOpts.layer=A,this._addImageOpts.zIndex=s;let a=this._storage.addImage(t,this._addImageOpts);this._kittyIdToStorageId.set(e,a),this._storageIdToKittyId.set(a,e)}getImage(e){return this._images.get(e)}deleteById(e){this._images.delete(e);let t=this._kittyIdToStorageId.get(e);t!==void 0&&(this._storage.deleteImage(t),this._kittyIdToStorageId.delete(e),this._storageIdToKittyId.delete(t))}deleteAll(){this._images.clear();for(let e of this._kittyIdToStorageId.values())this._storage.deleteImage(e);this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}get images(){return this._images}get kittyIdToStorageId(){return this._kittyIdToStorageId}get lastImageId(){return this._nextImageId-1}_evictUndisplayedImages(){for(let[e]of this._images){if(this._images.size<=U._maxStoredImages/2)break;this._kittyIdToStorageId.has(e)||this._images.delete(e)}}};U._maxStoredImages=256;var te=U;var y=M(X());var ze=M(We());var xt=4194304,Se=y.PALETTE_ANSI_256;Se.set(y.PALETTE_VT340_COLOR);var se=class{constructor(e,t,i){this._opts=e;this._storage=t;this._coreTerminal=i;this._size=0;this._aborted=!1;(0,ze.DecoderAsync)({memoryLimit:this._opts.pixelLimit*4,palette:Se,paletteLimit:this._opts.sixelPaletteLimit}).then(A=>this._dec=A)}reset(){this._dec&&(this._dec.release(),this._dec._palette.fill(0),this._dec.init(0,Se,this._opts.sixelPaletteLimit))}hook(e){if(this._size=0,this._aborted=!1,this._dec){let t=e.params[1]===1?0:Mt(this._coreTerminal._core._inputHandler._curAttrData,this._coreTerminal._core._themeService?.colors);this._dec.init(t,null,this._opts.sixelPaletteLimit)}}put(e,t,i){if(!(this._aborted||!this._dec)){if(this._size+=i-t,this._size>this._opts.sixelSizeLimit){console.warn("SIXEL: too much data, aborting"),this._aborted=!0,this._dec.release();return}try{this._dec.decode(e,t,i)}catch(A){console.warn(`SIXEL: error while decoding image - ${A}`),this._aborted=!0,this._dec.release()}}}unhook(e){if(this._aborted||!e||!this._dec)return!0;let t=this._dec.width,i=this._dec.height;if(!t||!i)return i&&this._storage.advanceCursor(i),!0;let A=D.createCanvas(void 0,t,i);return A.getContext("2d")?.putImageData(new ImageData(this._dec.data8,t,i),0,0),this._dec.memoryUsage>xt&&this._dec.release(),this._storage.addImage(A),!0}};function Mt(r,e){let t=0;if(!e)return t;if(r.isInverse())if(r.isFgDefault())t=re(e.foreground.rgba);else if(r.isFgRGB()){let i=r.constructor.toColorRGB(r.getFgColor());t=(0,y.toRGBA8888)(...i)}else t=re(e.ansi[r.getFgColor()].rgba);else if(r.isBgDefault())t=re(e.background.rgba);else if(r.isBgRGB()){let i=r.constructor.toColorRGB(r.getBgColor());t=(0,y.toRGBA8888)(...i)}else t=re(e.ansi[r.getBgColor()].rgba);return t}function re(r){return y.BIG_ENDIAN?r:(r&255)<<24|(r>>>8&255)<<16|(r>>>16&255)<<8|r>>>24&255}var ne=class{constructor(e,t,i,A){this._storage=e;this._opts=t;this._renderer=i;this._terminal=A;this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"vt340"}}addImage(e){this._addImageOpts.scrolling=this._opts.sixelScrolling,this._storage.addImage(e,this._addImageOpts)}advanceCursor(e){if(this._opts.sixelScrolling){let t=this._renderer.cellSize;(t.width===-1||t.height===-1)&&(t=w);let i=Math.ceil(e/t.height);for(let A=1;Athis._onImageAdded.fire(),this._opts.enableSizeReports){let t=e.options.windowOptions??{};t.getWinSizePixels=!0,t.getCellSizePixels=!0,t.getWinSizeChars=!0,e.options.windowOptions=t}if(this._disposeLater(this._renderer,this._storage,e.parser.registerCsiHandler({prefix:"?",final:"h"},t=>this._decset(t)),e.parser.registerCsiHandler({prefix:"?",final:"l"},t=>this._decrst(t)),e.parser.registerCsiHandler({final:"c"},t=>this._da1(t)),e.parser.registerCsiHandler({prefix:"?",final:"S"},t=>this._xtermGraphicsAttributes(t)),e.onRender(t=>this._storage?.render(t)),e.parser.registerCsiHandler({intermediates:"!",final:"p"},()=>this.reset()),e.parser.registerEscHandler({final:"c"},()=>this.reset()),e._core._inputHandler.onRequestReset(()=>this.reset()),e.buffer.onBufferChange(()=>this._storage?.wipeAlternate()),e.onResize(t=>this._storage?.viewportResize(t))),this._opts.sixelSupport){let t=new ne(this._storage,this._opts,this._renderer,e),i=new se(this._opts,t,e);this._handlers.set("sixel",i),this._disposeLater(e._core._inputHandler._parser.registerDcsHandler({final:"q"},i))}if(this._opts.iipSupport){let t=new ae(this._storage),i=new $(this._opts,this._renderer,t,e);this._handlers.set("iip",i),this._disposeLater(e._core._inputHandler._parser.registerOscHandler(1337,i))}if(this._opts.kittySupport){let t=new te(this._storage),i=new ee(this._opts,this._renderer,t,e);this._handlers.set("kitty",i),this._disposeLater(t,i,e._core._inputHandler._parser.registerApcHandler({final:"G"},i))}}reset(){this._opts.sixelScrolling=this._defaultOpts.sixelScrolling,this._opts.sixelPaletteLimit=this._defaultOpts.sixelPaletteLimit,this._storage?.reset();for(let e of this._handlers.values())e.reset();return!1}get storageLimit(){return this._storage?.getLimit()||-1}set storageLimit(e){this._storage?.setLimit(e),this._opts.storageLimit=e}get storageUsage(){return this._storage?this._storage.getUsage():-1}get showPlaceholder(){return this._opts.showPlaceholder}set showPlaceholder(e){this._opts.showPlaceholder=e,this._renderer?.showPlaceholder(e)}getImageAtBufferCell(e,t){return this._storage?.getImageAtBufferCell(e,t)}extractTileAtBufferCell(e,t){return this._storage?.extractTileAtBufferCell(e,t)}_report(e){this._terminal?._core.input(e,!1)}_decset(e){for(let t=0;t2&&!(e[2]instanceof Array)&&e[2]<=Ze?(this._opts.sixelPaletteLimit=e[2],this._report(`\x1B[?${e[0]};0;${this._opts.sixelPaletteLimit}S`)):this._report(`\x1B[?${e[0]};2S`),!0;case 4:return this._report(`\x1B[?${e[0]};0;${Ze}S`),!0;default:return this._report(`\x1B[?${e[0]};2S`),!0}if(e[0]===2)switch(e[1]){case 1:let t=this._renderer?.dimensions?.css.canvas.width,i=this._renderer?.dimensions?.css.canvas.height;if(!t||!i){let s=w;t=(this._terminal?.cols||80)*s.width,i=(this._terminal?.rows||24)*s.height}if(t*i()=>{try{return e||s((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var ot=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of rt(e))!at.call(s,A)&&A!==t&&Me(s,A,{get:()=>e[A],enumerable:!(i=st(e,A))||i.enumerable});return s};var M=(s,e,t)=>(t=s!=null?At(nt(s)):{},ot(e||!s||!s.__esModule?Me(t,"default",{value:s,enumerable:!0}):t,s));var Z=x(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.DEFAULT_FOREGROUND=_.DEFAULT_BACKGROUND=_.PALETTE_ANSI_256=_.PALETTE_VT340_GREY=_.PALETTE_VT340_COLOR=_.normalizeHLS=_.normalizeRGB=_.nearestColorIndex=_.fromRGBA8888=_.toRGBA8888=_.alpha=_.blue=_.green=_.red=_.BIG_ENDIAN=void 0;_.BIG_ENDIAN=new Uint8Array(new Uint32Array([4278190080]).buffer)[0]===255;_.BIG_ENDIAN&&console.warn("BE platform detected. This version of node-sixel works only on LE properly.");function ve(s){return s&255}_.red=ve;function Re(s){return s>>>8&255}_.green=Re;function ke(s){return s>>>16&255}_.blue=ke;function gt(s){return s>>>24&255}_.alpha=gt;function f(s,e,t,i=255){return((i&255)<<24|(t&255)<<16|(e&255)<<8|s&255)>>>0}_.toRGBA8888=f;function dt(s){return[s&255,s>>8&255,s>>16&255,s>>>24]}_.fromRGBA8888=dt;function It(s,e){let t=ve(s),i=Re(s),A=ke(s),r=Number.MAX_SAFE_INTEGER,n=-1;for(let a=0;a1&&(t-=1),t*6<1?e+(s-e)*6*t:t*2<1?s:t*3<2?e+(s-e)*(4-t*6):e}function lt(s,e,t){if(!t){let r=Math.round(e*255);return f(r,r,r)}let i=e<.5?e*(1+t):e+t-e*t,A=2*e-i;return f(Ie(0,255,Math.round(le(i,A,s+1/3)*255)),Ie(0,255,Math.round(le(i,A,s)*255)),Ie(0,255,Math.round(le(i,A,s-1/3)*255)))}function m(s,e,t){return(4278190080|Math.round(t/100*255)<<16|Math.round(e/100*255)<<8|Math.round(s/100*255))>>>0}_.normalizeRGB=m;function ct(s,e,t){return lt((s+240%360)/360,e/100,t/100)}_.normalizeHLS=ct;_.PALETTE_VT340_COLOR=new Uint32Array([m(0,0,0),m(20,20,80),m(80,13,13),m(20,80,20),m(80,20,80),m(20,80,80),m(80,80,20),m(53,53,53),m(26,26,26),m(33,33,60),m(60,26,26),m(33,60,33),m(60,33,60),m(33,60,60),m(60,60,33),m(80,80,80)]);_.PALETTE_VT340_GREY=new Uint32Array([m(0,0,0),m(13,13,13),m(26,26,26),m(40,40,40),m(6,6,6),m(20,20,20),m(33,33,33),m(46,46,46),m(0,0,0),m(13,13,13),m(26,26,26),m(40,40,40),m(6,6,6),m(20,20,20),m(33,33,33),m(46,46,46)]);_.PALETTE_ANSI_256=(()=>{let s=[f(0,0,0),f(205,0,0),f(0,205,0),f(205,205,0),f(0,0,238),f(205,0,205),f(0,250,205),f(229,229,229),f(127,127,127),f(255,0,0),f(0,255,0),f(255,255,0),f(92,92,255),f(255,0,255),f(0,255,255),f(255,255,255)],e=[0,95,135,175,215,255];for(let t=0;t<6;++t)for(let i=0;i<6;++i)for(let A=0;A<6;++A)s.push(f(e[t],e[i],e[A]));for(let t=8;t<=238;t+=10)s.push(f(t,t,t));return new Uint32Array(s)})();_.DEFAULT_BACKGROUND=f(0,0,0,255);_.DEFAULT_FOREGROUND=f(255,255,255,255)});var _e=x(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.InWasm=pt;var v=s=>{if(Uint8Array.fromBase64)return Uint8Array.fromBase64(s);if(typeof Buffer<"u")return Buffer.from(s,"base64");let e=atob(s),t=new Uint8Array(e.length);for(let i=0;inew n.Instance(r||(r=new n.Module(A||(A=v(i)))),a):a=>r?n.instantiate(r,a):n.instantiate(A||(A=v(i)),a).then(o=>(r=o.module)&&o.instance):e===1?t?()=>r||(r=new n.Module(A||(A=v(i)))):()=>r?Promise.resolve(r):n.compile(A||(A=v(i))).then(a=>r=a):t?()=>A||(A=v(i)):()=>Promise.resolve(A||(A=v(i)))}if(typeof _wasmCtx>"u")throw new Error('must run "inwasm"');_wasmCtx.add(s)}});var Ce=x(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});var Bt=_e(),ft=(0,Bt.InWasm)({s:1,t:0,d:"AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML"}),S=new Uint8Array("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").map(s=>s.charCodeAt(0))),R=new Uint32Array(1024);R.fill(4278190080);for(let s=0;s>4|(s<<4&255)<<8;for(let s=0;s>2<<8|(s<<6&255)<<16;for(let s=0;sthis.maxBytes||this.maxBytes>4294901760)throw new Error("invalid byte settings")}get data8(){return this._inst?this._d.subarray(0,this._m32[1282]):Qt}release(){this._inst&&(this._bytes>this.keepSize?this._inst=this._m32=this._d=this._mem=null:(this._m32[1280]=0,this._m32[1281]=0,this._m32[1282]=0))}init(e,t){if(this.maxBytes=e??this.maxBytes,this._bytes=t??Math.min(this._bytes,this.maxBytes),this._bytes>this.maxBytes||this.maxBytes>4294901760)throw Error("invalid byte settings");let i=this._m32,A=this._bytes+5152;this._inst?this._mem.buffer.byteLengththis.maxBytes)return-3;let i=this._bytes;for(;(i*=2)this._mem.buffer.byteLength){let A=Math.ceil((i+5152-this._mem.buffer.byteLength)/65536);this._mem.grow(A),this._m32=new Uint32Array(this._mem.buffer,0),this._d=new Uint8Array(this._mem.buffer,5152)}this._bytes=i}return 0}put(e){if(!this._inst||this._ended)return-2;if(this._realloc(e.length))return-3;let t=this._m32;return this._d.set(e,t[1280]),t[1280]+=e.length,t[1280]-t[1281]>=131072?this._inst.exports.dec():0}end(){return this._ended=!0,this._inst?this._inst.exports.end():-2}get loadedBytes(){return this._inst?this._m32[1280]:0}get freeBytes(){return this._inst?this.maxBytes-this._m32[1280]:0}};Ee.default=ue});var Ne=x(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});var Dt=_e(),wt=(0,Dt.InWasm)({s:1,t:0,d:"AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=="}),pe=class{constructor(e){this.keepSize=e,this.width=0,this.height=0}decode(e){this.width=e[4]<<24|e[5]<<16|e[6]<<8|e[7],this.height=e[8]<<24|e[9]<<16|e[10]<<8|e[11];let t=this.width*this.height,i=t*4,A=e.length,r=Math.max(i,A)+(Math.min(i,A)>>1)+4096;this._inst?this._mem.buffer.byteLengththis.keepSize&&(this._inst=this._d=this._mem=null)}};Be.default=pe});var Ye=x(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.LIMITS=void 0;se.LIMITS={CHUNK_SIZE:16384,PALETTE_SIZE:4096,MAX_WIDTH:16384,BYTES:"AGFzbQEAAAABJAdgAAF/YAJ/fwBgA39/fwF/YAF/AX9gAABgBH9/f38AYAF/AAIlAgNlbnYLaGFuZGxlX2JhbmQAAwNlbnYLbW9kZV9wYXJzZWQAAwMTEgQAAAAAAQQBAQUBAAACAgAGAwQFAXABBwcFBAEBBwcGCAF/AUGAihoLB9wBDgZtZW1vcnkCABFnZXRfc3RhdGVfYWRkcmVzcwADEWdldF9jaHVua19hZGRyZXNzAAQOZ2V0X3AwX2FkZHJlc3MABRNnZXRfcGFsZXR0ZV9hZGRyZXNzAAYEaW5pdAALBmRlY29kZQAMDWN1cnJlbnRfd2lkdGgADQ5jdXJyZW50X2hl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cDAEHojAIgADcDAEHgjAIgADcDAEHYjAIgADcDAEHQjAIgADcDAEHIjAIgADcDAEHAjAIgADcDAEG4jAIgADcDAEGwjAIgADcDAEGojAIgADcDAEGgjAIgADcDAEGYjAIgADcDAEGQjAIgADcDAEGIjAIgADcDAEGAjAIgADcDAEH4iwIgADcDAEHwiwIgADcDAEHoiwIgADcDAEHgiwIgADcDAEHYiwIgADcDAEHQiwIgADcDAEHIiwIgADcDAEHAiwIgADcDAEG4iwIgADcDAEGwiwIgADcDAEGoiwIgADcDAEGgiwIgADcDAEGYiwIgADcDAEGQiwIgADcDAEGIiwIgADcDAEGAiwIgADcDAEH4igIgADcDAEHwigIgADcDAEHoigIgADcDAEHgigIgADcDAEHYigIgADcDAEHQigIgADcDAEHIigIgADcDAEHAigIgADcDAEG4igIgADcDAEGwigIgADcDAEGoigIgADcDAEGgigIgADcDAEGYigIgADcDAEGQigIgADcDAEGIigIgADcDAEGAigIgADcDAEH4iQIgADcDAEHwiQIgADcDAEHoiQIgADcDAEHgiQIgADcDAEHYiQIgADcDAEHQiQIgADcDAEHIiQIgADcDAEHAiQIgADcDAEG4iQIgADcDAEGwiQIgADcDAEGoCCgCACIEQf8AakGAAW0hCAJAIARBgQFIDQBBASEBIAhBAiAIQQJKG0EBayICQQFxIQMgBEGBAk4EQCACQX5xIQIDQCABQQl0IgdBEHJBoIkCakGwiQJBgAT8CgAAIAdBsI0CakGwiQJBgAT8CgAAIAFBAmohASACQQJrIgINAAsLIANFDQAgAUEJdEEQckGgiQJqQbCJAkGABPwKAAALAkAgBEEBSA0AIAhBASAIQQFKGyIDQQFxIQUCQCADQQFrIgdFBEBBACEBDAELIANB/v///wdxIQJBACEBA0AgAUEJdCIGQRByQbCJBmpBsIkCQYAE/AoAACAGQZAEckGwiQZqQbCJAkGABPwKAAAgAUECaiEBIAJBAmsiAg0ACwsgBQRAIAFBCXRBEHJBsIkGakGwiQJBgAT8CgAACyAEQQFIDQAgA0EBcSEFIAcEfyADQf7///8H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CUQwAAgECSlJIhBwsgAEEIdAJ/IAdDAAB/Q5RDAAAAP5IiBkMAAIBPXSAGQwAAAABgcQRAIAapDAELQQALQRB0ciABcgtBgICAeHILNwAgAEH/AWxBMmpB5ABtIAFB/wFsQTJqQeQAbUEIdHIgAkH/AWxBMmpB5ABtQRB0ckGAgIB4cgsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwsYAQBBgAgLEQEAAAACAAAAAwAAAAQAAAAF"}});var We=x(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.decodeAsync=b.decode=b.Decoder=b.DecoderAsync=void 0;var O=Z(),Q=Ye();function St(s){if(typeof Buffer<"u")return Buffer.from(s,"base64");let e=atob(s),t=new Uint8Array(e.length);for(let i=0;i1,this.modeHandler=e=>1}handle_band(e){return this.bandHandler(e)}mode_parsed(e){return this.modeHandler(e)}},Lt={memoryLimit:2048*65536,sixelColor:O.DEFAULT_FOREGROUND,fillColor:O.DEFAULT_BACKGROUND,palette:O.PALETTE_VT340_COLOR,paletteLimit:Q.LIMITS.PALETTE_SIZE,truncate:!0};function ze(s){let e=new Le,t={env:{handle_band:e.handle_band.bind(e),mode_parsed:e.mode_parsed.bind(e)}};return WebAssembly.instantiate(J||qe,t).then(i=>(J=J||i.module,new P(s,i.instance||i,e)))}b.DecoderAsync=ze;var P=class{constructor(e,t,i){if(this._PIXEL_OFFSET=Q.LIMITS.MAX_WIDTH+4,this._canvas=re,this._bandWidths=[],this._maxWidth=0,this._minWidth=Q.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0,this._opts=Object.assign({},Lt,e),this._opts.paletteLimit>Q.LIMITS.PALETTE_SIZE)throw new Error(`DecoderOptions.paletteLimit must not exceed ${Q.LIMITS.PALETTE_SIZE}`);if(t)i.bandHandler=this._handle_band.bind(this),i.modeHandler=this._initCanvas.bind(this);else{let A=J||(J=new WebAssembly.Module(qe));t=new WebAssembly.Instance(A,{env:{handle_band:this._handle_band.bind(this),mode_parsed:this._initCanvas.bind(this)}})}this._instance=t,this._wasm=this._instance.exports,this._chunk=new Uint8Array(this._wasm.memory.buffer,this._wasm.get_chunk_address(),Q.LIMITS.CHUNK_SIZE),this._states=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_state_address(),12),this._palette=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_palette_address(),Q.LIMITS.PALETTE_SIZE),this._palette.set(this._opts.palette),this._pSrc=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_p0_address()),this._wasm.init(O.DEFAULT_FOREGROUND,0,this._opts.paletteLimit,0)}get _fillColor(){return this._states[0]}get _truncate(){return this._states[8]}get _rasterWidth(){return this._states[6]}get _rasterHeight(){return this._states[7]}get _width(){return this._states[2]?this._states[2]-4:0}get _height(){return this._states[3]}get _level(){return this._states[9]}get _mode(){return this._states[10]}get _paletteLimit(){return this._states[11]}_initCanvas(e){if(e===2){let t=this.width*this.height;if(t>this._canvas.length){if(this._opts.memoryLimit&&t*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(t)}this._maxWidth=this._width}else if(e===1)if(this._level===2){let t=Math.min(this._rasterWidth,Q.LIMITS.MAX_WIDTH)*this._rasterHeight;if(t>this._canvas.length){if(this._opts.memoryLimit&&t*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(t)}}else this._canvas.length<65536&&(this._canvas=new Uint32Array(65536));return 0}_realloc(e,t){let i=e+t;if(i>this._canvas.length){if(this._opts.memoryLimit&&i*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");let A=new Uint32Array(Math.ceil(i/65536)*65536);A.set(this._canvas),this._canvas=A}}_handle_band(e){let t=this._PIXEL_OFFSET,i=this._lastOffset;if(this._mode===2){let A=this.height-this._currentHeight,r=0;for(;r<6&&A>0;)this._canvas.set(this._pSrc.subarray(t*r,t*r+e),i+e*r),r++,A--;this._lastOffset+=e*r,this._currentHeight+=r}else if(this._mode===1){this._realloc(i,e*6),this._maxWidth=Math.max(this._maxWidth,e),this._minWidth=Math.min(this._minWidth,e);for(let A=0;A<6;++A)this._canvas.set(this._pSrc.subarray(t*A,t*A+e),i+e*A);this._bandWidths.push(e),this._lastOffset+=e*6,this._currentHeight+=6}return 0}get width(){return this._mode!==1?this._width:Math.max(this._maxWidth,this._wasm.current_width())}get height(){return this._mode!==1?this._height:this._wasm.current_width()?this._bandWidths.length*6+this._wasm.current_height():this._bandWidths.length*6}get palette(){return this._palette.subarray(0,this._paletteLimit)}get memoryUsage(){return this._canvas.byteLength+this._wasm.memory.buffer.byteLength+8*this._bandWidths.length}get properties(){return{width:this.width,height:this.height,mode:this._mode,level:this._level,truncate:!!this._truncate,paletteLimit:this._paletteLimit,fillColor:this._fillColor,memUsage:this.memoryUsage,rasterAttributes:{numerator:this._states[4],denominator:this._states[5],width:this._rasterWidth,height:this._rasterHeight}}}init(e=this._opts.fillColor,t=this._opts.palette,i=this._opts.paletteLimit,A=this._opts.truncate){this._wasm.init(this._opts.sixelColor,e,i,A?1:0),t&&this._palette.set(t.subarray(0,Q.LIMITS.PALETTE_SIZE)),this._bandWidths.length=0,this._maxWidth=0,this._minWidth=Q.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0}decode(e,t=0,i=e.length){let A=t;for(;A0){let i=this._PIXEL_OFFSET,A=this._lastOffset,r=0;for(;r<6&&t>0;)this._canvas.set(this._pSrc.subarray(i*r,i*r+e),A+e*r),r++,t--;t&&this._canvas.fill(this._fillColor,A+e*r)}return this._canvas.subarray(0,this.width*this.height)}if(this._mode===1){if(this._minWidth===this._maxWidth){let r=!1;if(e)if(e!==this._minWidth)r=!0;else{let n=this._PIXEL_OFFSET,a=this._lastOffset;this._realloc(a,e*6);for(let o=0;o<6;++o)this._canvas.set(this._pSrc.subarray(n*o,n*o+e),a+e*o)}if(!r)return this._canvas.subarray(0,this.width*this.height)}let t=new Uint32Array(this.width*this.height);t.fill(this._fillColor);let i=0,A=0;for(let r=0;r{if(this._disposed)return H(()=>{});let A={fn:e,thisArgs:t};this._listeners=this._listeners.slice(),this._listeners.push(A);let r=H(()=>{let n=this._listeners.indexOf(A);n!==-1&&(this._listeners=this._listeners.slice(),this._listeners.splice(n,1))});return i&&(Array.isArray(i)?i.push(r):i.add(r)),r},this._event)}fire(e){if(this._disposed||!this._listeners.length)return;if(this._listeners.length===1){this._listeners[0].fn.call(this._listeners[0].thisArgs,e);return}let t=this._listeners;for(let i=0,A=t.length;i{function s(r,n){return r(a=>n.fire(a))}A.forward=s;function e(r,n){return(a,o,h)=>r(g=>a.call(o,n(g)),void 0,h)}A.map=e;function t(...r){return(n,a,o)=>{let h=new N;for(let g of r)h.add(g(d=>n.call(a,d)));return o&&(Array.isArray(o)?o.push(h):o.add(h)),h}}A.any=t;function i(r,n,a){return n(a),r(o=>n(o))}A.runAndSubscribe=i})(ht||={});var ce=M(Z());var D=class s extends k{constructor(t){super();this._terminal=t;this._layers=new Map;this._optionsRefresh=this._register(new W);this._oldOpen=this._terminal._core.open,this._terminal._core.open=i=>{this._oldOpen?.call(this._terminal._core,i),this._open()},this._terminal._core.screenElement&&this._open(),this._optionsRefresh.value=this._terminal._core.optionsService.onOptionChange(i=>{i==="fontSize"&&(this.rescaleCanvas(),this._renderService?.refreshRows(0,this._terminal.rows))}),this._register(H(()=>{this.removeLayerFromDom(),this.removeLayerFromDom("bottom"),this._terminal._core&&this._oldOpen&&(this._terminal._core.open=this._oldOpen,this._oldOpen=void 0),this._renderService&&this._oldSetRenderer&&(this._renderService.setRenderer=this._oldSetRenderer,this._oldSetRenderer=void 0),this._renderService=void 0,this._layers.clear(),this._placeholderBitmap?.close(),this._placeholderBitmap=void 0,this._placeholder=void 0}))}get canvas(){return this._layers.get("top")?.canvas}static createCanvas(t,i,A){let r=(t??document).createElement("canvas");return r.width=i|0,r.height=A|0,r}static createImageData(t,i,A,r){if(typeof ImageData!="function"){let n=t.createImageData(i,A);return r&&n.data.set(new Uint8ClampedArray(r,0,i*A*4)),n}return r?new ImageData(new Uint8ClampedArray(r,0,i*A*4),i,A):new ImageData(i,A)}static createImageBitmap(t){return typeof createImageBitmap!="function"?Promise.resolve(void 0):createImageBitmap(t)}showPlaceholder(t){t?!this._placeholder&&this.cellSize.height!==-1&&this._createPlaceHolder(Math.max(this.cellSize.height+1,24)):(this._placeholderBitmap?.close(),this._placeholderBitmap=void 0,this._placeholder=void 0),this._renderService?.refreshRows(0,this._terminal.rows)}get dimensions(){return this._terminal.dimensions}get cellSize(){return{width:this.dimensions?.css.cell.width||-1,height:this.dimensions?.css.cell.height||-1}}clearLines(t,i,A){let r=t*(this.dimensions?.css.cell.height||0),n=this.dimensions?.css.canvas.width||0,a=(i+1-t)*(this.dimensions?.css.cell.height||0);(!A||A==="top")&&this._layers.get("top")?.clearRect(0,r,n,a),(!A||A==="bottom")&&this._layers.get("bottom")?.clearRect(0,r,n,a)}clearAll(t){if(!t||t==="top"){let i=this._layers.get("top");i?.clearRect(0,0,i.canvas.width,i.canvas.height)}if(!t||t==="bottom"){let i=this._layers.get("bottom");i?.clearRect(0,0,i.canvas.width,i.canvas.height)}}draw(t,i,A,r,n=1){let a=this._layers.get(t.layer);if(!a)return;let{width:o,height:h}=this.cellSize;if(o===-1||h===-1)return;this._rescaleImage(t,o,h);let g=t.actual,{width:d,height:I}=t.actualCellSize,l=Math.ceil(g.width/d),c=i%l*d,u=Math.floor(i/l)*I,E=A*o,C=r*h,p=n*d+c>g.width?g.width-c:n*d,B=u+I>g.height?g.height-u:I;a.drawImage(g,Math.floor(c),Math.floor(u),Math.ceil(p),Math.ceil(B),Math.floor(E),Math.floor(C),Math.ceil(p*o/d),Math.ceil(B*h/I))}extractTile(t,i){let{width:A,height:r}=this.cellSize;if(A===-1||r===-1)return;this._rescaleImage(t,A,r);let n=t.actual,{width:a,height:o}=t.actualCellSize,h=Math.ceil(n.width/a),g=i%h*a,d=Math.floor(i/h)*o,I=a+g>n.width?n.width-g:a,l=d+o>n.height?n.height-d:o,c=s.createCanvas(this.document,Math.ceil(I*A/a),Math.ceil(l*r/o)),u=c.getContext("2d");if(u)return u.drawImage(n,Math.floor(g),Math.floor(d),Math.floor(I),Math.floor(l),0,0,c.width,c.height),c}drawPlaceholder(t,i,A=1){let r=this._layers.get("top");if(r){let{width:n,height:a}=this.cellSize;if(n===-1||a===-1||(this._placeholder?a>=this._placeholder.height&&this._createPlaceHolder(a+1):this._createPlaceHolder(Math.max(a+1,24)),!this._placeholder))return;r.drawImage(this._placeholderBitmap??this._placeholder,t*n,i*a%2?0:1,n*A,a,t*n,i*a,n*A,a)}}rescaleCanvas(){let t=this.dimensions?.css.canvas.width||0,i=this.dimensions?.css.canvas.height||0;for(let A of this._layers.values())(A.canvas.width!==t||A.canvas.height!==i)&&(A.canvas.width=t,A.canvas.height=i)}_rescaleImage(t,i,A){if(i===t.actualCellSize.width&&A===t.actualCellSize.height)return;let{width:r,height:n}=t.origCellSize;if(i===r&&A===n){t.actual=t.orig,t.actualCellSize.width=r,t.actualCellSize.height=n;return}let a=Math.ceil(t.orig.width*i/r),o=Math.ceil(t.orig.height*A/n);if(a*o>t.orig.width*t.orig.height){t.actual=t.orig,t.actualCellSize.width=r,t.actualCellSize.height=n;return}let h=s.createCanvas(this.document,a,o),g=h.getContext("2d");g&&(g.drawImage(t.orig,0,0,h.width,h.height),t.actual=h,t.actualCellSize.width=i,t.actualCellSize.height=A)}_open(){this._renderService=this._terminal._core._renderService,this._oldSetRenderer=this._renderService.setRenderer.bind(this._renderService),this._renderService.setRenderer=t=>{for(let i of[...this._layers.keys()])this.removeLayerFromDom(i);this._oldSetRenderer?.call(this._renderService,t)}}insertLayerToDom(t="top"){if(!this.document||!this._terminal._core.screenElement){console.warn("image addon: cannot insert output canvas to DOM, missing document or screenElement");return}if(this._layers.has(t))return;let i=s.createCanvas(this.document,this.dimensions?.css.canvas.width||0,this.dimensions?.css.canvas.height||0);i.classList.add(`xterm-image-layer-${t}`);let A=this._terminal._core.screenElement;A.style.isolation="isolate",t==="bottom"?(i.style.zIndex="-1",A.insertBefore(i,A.firstChild)):(i.style.zIndex="0",A.appendChild(i));let r=i.getContext("2d",{alpha:!0});if(!r){i.remove();return}this._layers.set(t,r),this.clearAll(t)}removeLayerFromDom(t="top"){let i=this._layers.get(t);i&&(i.canvas.remove(),this._layers.delete(t))}hasLayer(t){return this._layers.has(t)}_createPlaceHolder(t=24){this._placeholderBitmap?.close(),this._placeholderBitmap=void 0;let i=32,A=s.createCanvas(this.document,i,t),r=A.getContext("2d",{alpha:!1});if(!r)return;let n=s.createImageData(r,i,t),a=new Uint32Array(n.data.buffer),o=(0,ce.toRGBA8888)(0,0,0),h=(0,ce.toRGBA8888)(255,255,255);a.fill(o);for(let l=0;l{this._placeholder!==I?l?.close():this._placeholderBitmap=l}).catch(()=>{})}get document(){return this._terminal._core._coreBrowserService?.window.document}};var w={width:7,height:14},G=class s{constructor(e=0,t=0,i=-1,A=-1){this.imageId=i;this.tileId=A;this._ext=0;this._urlId=0;this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new s(this._ext,this._urlId,this.imageId,this.tileId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0&&this.imageId===-1}},F=new G,j=class{constructor(e,t,i){this._terminal=e;this._renderer=t;this._opts=i;this._images=new Map;this._lastId=0;this._lowestId=0;this._fullyCleared=!1;this._needsFullClear=!1;this._pixelLimit=25e5;try{this.setLimit(this._opts.storageLimit)}catch(A){A instanceof Error&&console.error(A.message),console.warn(`storageLimit is set to ${this.getLimit()} MB`)}this._viewportMetrics={cols:this._terminal.cols,rows:this._terminal.rows}}dispose(){this.reset()}reset(){for(let e of this._images.values())e.marker?.dispose();this._images.clear(),this._renderer.clearAll()}getLimit(){return this._pixelLimit*4/1e6}setLimit(e){if(e<.5||e>1e3)throw RangeError("invalid storageLimit, should be at least 0.5 MB and not exceed 1G");this._pixelLimit=e/4*1e6>>>0,this._evictOldest(0)}getUsage(){return this._getStoredPixels()*4/1e6}_getStoredPixels(){let e=0;for(let t of this._images.values())t.orig&&(e+=t.orig.width*t.orig.height,t.actual&&t.actual!==t.orig&&(e+=t.actual.width*t.actual.height));return e}_delImg(e){let t=this._images.get(e);t&&(this._images.delete(e),window.ImageBitmap&&t.orig instanceof ImageBitmap&&t.orig.close(),this.onImageDeleted?.(e))}wipeAlternate(){let e=[];for(let[t,i]of this._images.entries())i.bufferType==="alternate"&&(i.marker?.dispose(),e.push(t));for(let t of e)this._delImg(t);this._needsFullClear=!0,this._fullyCleared=!1}deleteImage(e){let t=this._images.get(e);t&&(t.marker?.dispose(),this._delImg(e))}addImage(e,t){this._evictOldest(e.width*e.height);let i=this._renderer.cellSize;(i.width===-1||i.height===-1)&&(i=w);let A=Math.ceil(e.width/i.width),r=Math.ceil(e.height/i.height),n=++this._lastId,a=this._terminal._core.buffer,o=this._terminal.cols,h=this._terminal.rows,g=a.x,d=a.y,I=g,l=0;t.scrolling||(a.x=0,a.y=0,I=0),this._terminal._core._inputHandler._dirtyRowTracker.markDirty(a.y);for(let C=0;C=o);++B)this._writeToCell(p,I+B,n,C*A+B),l++;if(t.scrolling)C=h)break;a.x=I}this._terminal._core._inputHandler._dirtyRowTracker.markDirty(a.y),t.scrolling?t.cursorPos==="iip"?a.x=Math.min(I+A,o):a.x=I:(a.x=g,a.y=d);let c=[];for(let[C,p]of this._images.entries())p.tileCount<1&&(p.marker?.dispose(),c.push(C));for(let C of c)this._delImg(C);let u=this._terminal.registerMarker(0);u?.onDispose(()=>{this._images.get(n)&&this._delImg(n)}),this._terminal.buffer.active.type==="alternate"&&this._evictOnAlternate();let E={orig:e,origCellSize:i,actual:e,actualCellSize:{...i},marker:u||void 0,tileCount:l,bufferType:this._terminal.buffer.active.type,layer:t.layer,zIndex:t.zIndex};return this._images.set(n,E),this.onImageAdded?.(),n}render(e){let t=!1,i=!1;for(let g of this._images.values())if(g.layer==="bottom"?i=!0:t=!0,t&&i)break;if(t&&!this._renderer.hasLayer("top")&&(this._renderer.insertLayerToDom("top"),!this._renderer.hasLayer("top")))return;if(i&&!this._renderer.hasLayer("bottom")&&this._renderer.insertLayerToDom("bottom"),this._renderer.rescaleCanvas(),!this._images.size){this._fullyCleared||(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1),this._renderer.hasLayer("top")&&this._renderer.removeLayerFromDom("top"),this._renderer.hasLayer("bottom")&&this._renderer.removeLayerFromDom("bottom");return}!t&&this._renderer.hasLayer("top")&&(this._renderer.clearAll("top"),this._renderer.removeLayerFromDom("top")),!i&&this._renderer.hasLayer("bottom")&&(this._renderer.clearAll("bottom"),this._renderer.removeLayerFromDom("bottom")),this._needsFullClear&&(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1);let{start:A,end:r}=e,n=this._terminal._core.buffer,a=this._terminal._core.cols;this._renderer.clearLines(A,r);let o=[],h=[];for(let g=A;g<=r;++g){let d=n.lines.get(g+n.ydisp);if(!d)return;for(let I=0;Ig.imgSpec.zIndex-d.imgSpec.zIndex);for(let g of h)this._renderer.drawPlaceholder(g.col,g.row,g.count);for(let g of o)this._renderer.draw(g.imgSpec,g.tileId,g.col,g.row,g.count)}viewportResize(e){if(!this._images.size){this._viewportMetrics=e;return}if(this._viewportMetrics.cols>=e.cols){this._viewportMetrics=e;return}let t=this._terminal._core.buffer,i=t.lines.length,A=this._viewportMetrics.cols-1;for(let r=0;r=g)continue;let d=!1;for(let c=A+1;c>e.cols;++c)if(n._data[c*3+0]&4194303){d=!0;break}if(d)continue;let I=Math.min(e.cols,g-a.tileId%g+A),l=a.tileId;for(let c=A+1;c57)throw new Error("illegal char");e=e*10+s[t]-48}return e}function He(s){let e=V(s);if(!e.match(/^((auto)|(\d+?((px)|(%)){0,1}))$/))throw new Error("illegal size");return e}function bt(s){if(typeof Buffer<"u")return Buffer.from(V(s),"base64").toString();let e=atob(V(s)),t=new Uint8Array(e.length);for(let i=0;i14)return-1;for(let a=t;a=be)return this._a();n[r++]=o}break;case 58:return A===3&&!this._storeValue(r)?this._a():(this.state=4,a+1);default:if(r>=be)return this._a();n[r++]=o}}return this.state=A,this._position=r,-2}_a(){return this.fields.type=0,this.state=1,-1}_storeKey(e){let t=V(this._buffer.subarray(0,e));return t?(this._key=t,this.fields[t]=null,!0):!1}_storeValue(e){if(this._key){try{let t=this._buffer.slice(0,e);this.fields[this._key]=Fe[this._key]?Fe[this._key](t):t}catch{return!1}return!0}return!1}};var L={mime:"unsupported",width:0,height:0};function ee(s){if(s.length<32)return L;let e=new Uint32Array(s.buffer,s.byteOffset,8);if(e[0]===1196314761&&e[1]===169478669&&e[3]===1380206665)return{mime:"image/png",width:s[16]<<24|s[17]<<16|s[18]<<8|s[19],height:s[20]<<24|s[21]<<16|s[22]<<8|s[23]};if(s[0]===255&&s[1]===216&&s[2]===255){let[t,i]=yt(s);return{mime:"image/jpeg",width:t,height:i}}if(e[0]===944130375&&(s[4]===55||s[4]===57)&&s[5]===97)return{mime:"image/gif",width:s[7]<<8|s[6],height:s[9]<<8|s[8]};if(e[0]===1718185841)return{mime:"image/qoi",width:s[4]<<24|s[5]<<16|s[6]<<8|s[7],height:s[8]<<24|s[9]<<16|s[10]<<8|s[11]};if(e[0]===1179011410&&e[2]===1346520407&&(e[3]&16777215)===3690582){switch(s[15]){case 88:return{mime:"image/webp",width:(s[24]|s[25]<<8|s[26]<<16)+1,height:(s[27]|s[28]<<8|s[29]<<16)+1};case 76:if(s[20]!==47)return L;let t=s[21]|s[22]<<8|s[23]<<16|s[24]<<24;return{mime:"image/webp",width:(t&16383)+1,height:(t>>>14&16383)+1};case 32:return s[23]!==157||s[24]!==1||s[25]!==42?L:{mime:"image/webp",width:(s[26]|s[27]<<8)&16383,height:(s[28]|s[29]<<8)&16383}}return L}if(e[1]===1887007846&&(e[2]===1718187617||e[2]===1936291425)){let t=-1,i=Math.min(s.length-16,1024);for(let A=8;A0&&r>0)return{mime:"image/avif",width:A,height:r}}return L}return L}function yt(s){let e=s.length,t=4,i=s[t]<<8|s[t+1];for(;;){if(t+=i,t>=e)return[0,0];if(s[t]!==255)return[0,0];if(s[t+1]===192||s[t+1]===194)return t+80){if(this._hp.fields.type===1){if(this._isMultipart&&(this._isMultipart=!1,this._abortMulti=!1,this._dec.release()),this._header=Object.assign({},ye,this._hp.fields),!this._header.inline){this._aborted=!0;return}this._dec.init()}else if(this._abortMulti){this._aborted=!0;return}this._dec.put(e.subarray(A,i))!==0&&(this._dec.release(),this._aborted=!0,this._isMultipart&&(this._abortMulti=!0))}}}end(e){if(this._aborted||this._hp.state!==4&&this._hp.end())return!0;let t=this._hp.fields.type;if(t===3)return!0;if(t===5){let h=w.width,g=w.height;this._renderer.dimensions&&(h=this._renderer.dimensions.css.canvas.width/this._coreTerminal.cols,g=this._renderer.dimensions.css.canvas.height/this._coreTerminal.rows);let d=this._coreTerminal._core._coreBrowserService?.dpr??1,I=`\x1B]1337;ReportCellSize=${g.toFixed(3)};${h.toFixed(3)};${d.toFixed(3)}\x1B\\`;return this._coreTerminal.input(I,!1),!0}if(t===2)return this._header=Object.assign({},ye,this._hp.fields),this._isMultipart=!0,this._abortMulti=!1,this._dec.release(),this._dec.init(),!0;if(t===4&&(!this._isMultipart||(this._isMultipart=!1,this._abortMulti||this._header.type!==2)))return!0;let i=0,A=0,r,n=L;if((r=e)&&((r=!this._dec.end())?(n=ee(this._dec.data8),(r=n.mime!=="unsupported")?(i=n.width,A=n.height,(r=i&&A&&i*Ao!==this._generation?(h.close(),!0):(this._storage.addImage(h),!0)).catch(h=>(console.warn(`IIP: decoding error ${n.mime} ${n.width}x${n.height}`,h),!0))}_resize(e,t){let i=this._renderer.dimensions?.css.cell.width||w.width,A=this._renderer.dimensions?.css.cell.height||w.height,r=this._renderer.dimensions?.css.canvas.width||i*this._coreTerminal.cols,n=this._renderer.dimensions?.css.canvas.height||A*this._coreTerminal.rows,a=this._dim(this._header.width,r,i),o=this._dim(this._header.height,n,A);if(!a&&!o){let h=r/e,g=(n-A)/t,d=Math.min(h,g);return d<1?[e*d,t*d]:[e,t]}return a?this._header.preserveAspectRatio||!a||!o?[a,t*a/e]:[a,o]:[e*o/t,o]}_dim(e,t,i){return e==="auto"?0:e.endsWith("%")?parseInt(e.slice(0,-1),10)*t/100:e.endsWith("px")?parseInt(e.slice(0,-2),10):parseInt(e,10)*i}};var Ke=M(Ce());function Se(s){let e={},t=s.split(",");for(let i of t){let A=i.indexOf("=");if(A===-1)continue;let r=i.substring(0,A),n=i.substring(A+1);if(r==="a"){e.action=n;continue}if(r==="o"){e.compression=n;continue}if(r==="t"){e.transmission=n;continue}if(r==="d"){e.deleteSelector=n;continue}let a=parseInt(n,10);switch(r){case"f":e.format=a;break;case"i":e.id=a;break;case"I":e.imageNumber=a;break;case"s":e.width=a;break;case"v":e.height=a;break;case"x":e.x=a;break;case"y":e.y=a;break;case"w":e.sourceWidth=a;break;case"h":e.sourceHeight=a;break;case"X":e.xOffset=a;break;case"Y":e.yOffset=a;break;case"c":e.columns=a;break;case"r":e.rows=a;break;case"m":e.more=a;break;case"q":e.quiet=a;break;case"C":e.cursorMovement=a;break;case"z":e.zIndex=a;break;case"p":e.placementId=a;break}}return e}var Pe=0,ie=class{constructor(e,t,i,A){this._opts=e;this._renderer=t;this._kittyStorage=i;this._coreTerminal=A;this._aborted=!1;this._generation=0;this._decodeError=!1;this._activeDecoder=null;this._inControlData=!0;this._controlData=new Uint32Array(512);this._controlLength=0;this._encodedSizeLimit=0;this._totalEncodedSize=0;this._parsedCommand=null;this._pendingTransmissions=new Map;this._maxEncodedBytes=Math.ceil(this._opts.kittySizeLimit*4/3),this._initialEncodedBytes=Math.min(4194304,this._maxEncodedBytes)}reset(){this._generation++,this._cleanupAllPending(),this._activeDecoder&&(this._activeDecoder.release(),this._activeDecoder=null),this._kittyStorage.reset()}dispose(){this.reset()}_removePendingEntry(e){this._pendingTransmissions.delete(e),this._lastPendingKey===e&&(this._lastPendingKey=void 0)}_cleanupAllPending(){for(let e of this._pendingTransmissions.values())e.decoder.release();this._pendingTransmissions.clear(),this._lastPendingKey=void 0}start(){this._aborted=!1,this._decodeError=!1,this._inControlData=!0,this._controlLength=0,this._parsedCommand=null,this._encodedSizeLimit=this._maxEncodedBytes,this._totalEncodedSize=0,this._activeDecoder=null}put(e,t,i){if(!this._aborted)if(!this._inControlData)this._streamPayload(e,t,i);else{let A=i;for(let n=t;n512){this._aborted=!0;return}if(this._controlData.set(e.subarray(t,A),this._controlLength),this._controlLength+=r,!this._inControlData){if(this._parsedCommand=Se(this._parseControlDataString()),this._parsedCommand.id!==void 0&&this._parsedCommand.imageNumber!==void 0){this._sendResponse(this._parsedCommand.id,"EINVAL:cannot specify both i and I keys",this._parsedCommand.quiet??0),this._aborted=!0;return}if(this._parsedCommand.action==="d")return;let n=A+1;nthis._encodedSizeLimit){let o=this._activeDecoder??r?.decoder;o&&o.release(),this._activeDecoder=null,r&&this._removePendingEntry(A),this._aborted=!0;return}if(!this._decodeError){if(r?.decoder&&!this._activeDecoder&&(this._activeDecoder=r.decoder),!this._activeDecoder){let o=this._maxEncodedBytes+131072;if(o>this._opts.storageLimit*1e6){this._aborted=!0,this._parsedCommand?.id!==void 0&&this._sendResponse(this._parsedCommand.id,"ENOMEM:pending image budget exceeded",this._parsedCommand.quiet??0);return}let h=Math.max(1,Math.floor(this._opts.storageLimit*1e6/o));for(;this._pendingTransmissions.size>=h;){let g=this._pendingTransmissions.entries().next().value;if(!g)break;g[1].decoder.release(),this._removePendingEntry(g[0]),g[1].cmd.id!==void 0&&this._sendResponse(g[1].cmd.id,"ENOMEM:pending image budget exceeded",g[1].cmd.quiet??0)}this._activeDecoder=new Ke.default(4194304,this._maxEncodedBytes,this._initialEncodedBytes),this._activeDecoder.init()}this._activeDecoder.put(e.subarray(t,i))!==Pe&&(this._activeDecoder.release(),this._activeDecoder=null,this._decodeError=!0,r&&this._removePendingEntry(A))}}end(e){if(this._aborted||!e)return this._activeDecoder&&(this._activeDecoder.release(),this._activeDecoder=null),!0;if(this._inControlData)return this._handleNoPayloadCommand();let t=this._parsedCommand;if(t.action==="d")return this._handleDelete(t);let i=t.id??this._lastPendingKey??0,A=t.more===1,r=this._pendingTransmissions.get(i);if(A)return this._activeDecoder&&(r?(r.totalEncodedSize+=this._totalEncodedSize,r.decodeError=r.decodeError||this._decodeError):this._pendingTransmissions.set(i,{cmd:{...t},decoder:this._activeDecoder,totalEncodedSize:this._totalEncodedSize,decodeError:this._decodeError}),this._lastPendingKey=i,this._activeDecoder=null),!0;r&&(this._lastPendingKey=void 0);let n=this._decodeError,a=t,o=this._activeDecoder;r&&(a=r.cmd,o=r.decoder,n=n||r.decodeError,this._pendingTransmissions.delete(i));let h=new Uint8Array(0);o&&(o.end()!==Pe&&(n=!0),h=o.data8),this._activeDecoder=null;let g=this._handleCommandWithBytesAndCmd(a,h,n);return o&&o.release(),g}_parseControlDataString(){let e="";for(let t=0;t0&&this._sendResponse(e.id,"OK",e.quiet??0)),r}case"T":return this._handleTransmitDisplay(e,t,i);case"q":return this._handleQuery(e,t,i);case"p":return this._handlePlacement(e);default:return e.id!==void 0&&this._sendResponse(e.id,"EINVAL:unsupported action",e.quiet??0),!0}}_handlePlacement(e){if(e.id===void 0)return!0;let t=e.id,i=this._kittyStorage.getImage(t);return i?this._displayImage(i,e).then(r=>(this._sendResponse(t,r?"OK":"EINVAL:image rendering failed",e.quiet??0,e.placementId),!0)):(this._sendResponse(t,"ENOENT:image not found",e.quiet??0,e.placementId),!0)}_handleTransmit(e,t,i){return(e.transmission??"d")!=="d"?(e.id!==void 0&&this._sendResponse(e.id,"EINVAL:unsupported transmission medium",e.quiet??0),!0):(i||t.length===0||this._kittyStorage.storeImage(e.id,{data:new Blob([t]),width:e.width??0,height:e.height??0,format:e.format??32,compression:e.compression??""}),!0)}_handleTransmitDisplay(e,t,i){if(i)return e.id!==void 0&&this._sendResponse(e.id,"EINVAL:invalid base64 data",e.quiet??0),!0;this._handleTransmit(e,t,i);let A=e.id??this._kittyStorage.lastImageId,r=this._kittyStorage.getImage(A);if(r){let n=this._displayImage(r,e);return e.id!==void 0?n.then(a=>(this._sendResponse(A,a?"OK":"EINVAL:image rendering failed",e.quiet??0),!0)):n.then(()=>!0)}return!0}_handleQuery(e,t,i){let A=e.id??0,r=e.quiet??0;if((e.transmission??"d")!=="d")return this._sendResponse(A,"EINVAL:unsupported transmission medium",r),!0;if(i)return this._sendResponse(A,"EINVAL:invalid base64 data",r),!0;if(t.length===0)return this._sendResponse(A,"OK",r),!0;let a=e.format??32;if(a===100)this._sendResponse(A,"OK",r);else{let o=e.width??0,h=e.height??0;if(!o||!h)return this._sendResponse(A,"EINVAL:width and height required for raw pixel data",r),!0;let g=a===32?4:3,d=o*h*g;if(t.length=1||!r&&i>=2)return;let n=A?`,p=${A}`:"",a=`\x1B_Gi=${e}${n};${t}\x1B\\`;this._coreTerminal._core.coreService.triggerDataEvent(a)}_displayImage(e,t){return this._decodeAndDisplay(e,t).then(()=>!0).catch(()=>!1)}async _decodeAndDisplay(e,t){let i=this._generation,A=await this._createBitmap(e);try{if(i!==this._generation)throw new Error("image decode canceled");let r=Math.max(0,t.x??0),n=Math.max(0,t.y??0),a=t.sourceWidth||A.width-r,o=t.sourceHeight||A.height-n,h=Math.max(0,A.width-r),g=Math.max(0,A.height-n),d=Math.max(0,Math.min(a,h)),I=Math.max(0,Math.min(o,g));if(d===0||I===0)throw new Error("invalid source rectangle");if(r!==0||n!==0||d!==A.width||I!==A.height){let T=await createImageBitmap(A,r,n,d,I);A.close(),A=T}let l=this._renderer.dimensions?.css.cell.width||w.width,c=this._renderer.dimensions?.css.cell.height||w.height,u,E;t.columns!==void 0&&t.rows!==void 0?(u=t.columns,E=t.rows):t.columns!==void 0?(u=t.columns,E=Math.max(1,Math.ceil(A.height/A.width*(u*l)/c))):t.rows!==void 0?(E=t.rows,u=Math.max(1,Math.ceil(A.width/A.height*(E*c)/l))):(u=Math.ceil(A.width/l),E=Math.ceil(A.height/c));let C=A.width,p=A.height;if((t.columns!==void 0||t.rows!==void 0)&&(C=Math.round(u*l),p=Math.round(E*c)),C*p>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");let B=this._coreTerminal._core.buffer,K=B.x,Y=B.y,q=B.ybase,$e=t.zIndex!==void 0&&t.zIndex<0?"bottom":"top";if(C!==A.width||p!==A.height){let T=await createImageBitmap(A,{resizeWidth:C,resizeHeight:p});A.close(),A=T}let ge=Math.min(Math.max(0,t.xOffset??0),l-1),de=Math.min(Math.max(0,t.yOffset??0),c-1);if(ge!==0||de!==0){let T=t.columns!==void 0?Math.round(u*l):A.width+ge,tt=t.rows!==void 0?Math.round(E*c):A.height+de,z=D.createCanvas(window.document,T,tt),xe=z.getContext("2d");if(!xe)throw new Error("Failed to create offset canvas context");xe.drawImage(A,ge,de);let it=await createImageBitmap(z);if(z.width=z.height=0,A.close(),A=it,C=A.width,p=A.height,C*p>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");t.columns===void 0&&(u=Math.ceil(A.width/l)),t.rows===void 0&&(E=Math.ceil(A.height/c))}if(i!==this._generation)throw new Error("image decode canceled");let et=t.zIndex??0;if(this._kittyStorage.addImage(e.id,A,!0,$e,et),A=void 0,t.cursorMovement===1){let T=B.ybase-q;B.x=K,B.y=Math.max(Y-T,0)}else B.x=Math.min(K+u,this._coreTerminal.cols)}catch(r){throw A?.close(),r}}async _createBitmap(e){let t=new Uint8Array(await e.data.arrayBuffer());if(e.compression==="z"&&(t=await this._decompressZlib(t)),e.format===100){let E=ee(t);if(E.mime!=="image/png"||!(E.width>0)||!(E.height>0)||E.width*E.height>this._opts.pixelLimit)throw new RangeError("PNG exceeds pixel limit or has invalid dimensions");let C=new Blob([t],{type:"image/png"});if(!window.createImageBitmap){let p=URL.createObjectURL(C),B=new Image;return new Promise((K,Y)=>{B.addEventListener("load",()=>{URL.revokeObjectURL(p);let q=D.createCanvas(window.document,B.width,B.height);q.getContext("2d")?.drawImage(B,0,0),createImageBitmap(q).then(K).catch(Y)}),B.addEventListener("error",()=>{URL.revokeObjectURL(p),Y(new Error("Failed to load image"))}),B.src=p})}return createImageBitmap(C)}let i=e.width,A=e.height;if(!i||!A)throw new Error("Width and height required for raw pixel data");let r=e.format===32?4:3,n=i*A*r;if(t.length>>24|p<<8,g[l++]=4278190080|p>>>16|B<<16,g[l++]=4278190080|B>>>8}let c=d*3,u=d*4;for(let E=d;E=e.length){d.close();return}let I=Math.min(A+4096,e.length);d.enqueue(new Uint8Array(e.subarray(A,I))),A=I}}).pipeThrough(new DecompressionStream(t)).getReader(),a=[],o=0;try{for(;;){let{done:d,value:I}=await n.read();if(d)break;if(o+=I.byteLength,o>i)throw await n.cancel().catch(()=>{}),new RangeError("decompressed image exceeds byte limit");a.push(I)}}finally{n.releaseLock()}let h=new Uint8Array(o),g=0;for(let d of a)h.set(d,g),g+=d.length;return h}get images(){return this._kittyStorage.images}get _kittyIdToStorageId(){return this._kittyStorage.kittyIdToStorageId}get pendingTransmissions(){return this._pendingTransmissions}};var U=class U{constructor(e){this._storage=e;this._nextImageId=1;this._images=new Map;this._kittyIdToStorageId=new Map;this._storageIdToKittyId=new Map;this._handleStorageImageDeleted=e=>{let t=this._storageIdToKittyId.get(e);t!==void 0&&(this._kittyIdToStorageId.delete(t),this._storageIdToKittyId.delete(e),this._images.delete(t))};this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"iip"};this._previousOnImageDeleted=this._storage.onImageDeleted,this._wrappedOnImageDeleted=t=>{this._previousOnImageDeleted?.(t),this._handleStorageImageDeleted(t)},this._storage.onImageDeleted=this._wrappedOnImageDeleted}reset(){this._nextImageId=1,this._images.clear(),this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}dispose(){this.reset(),this._storage.onImageDeleted===this._wrappedOnImageDeleted&&(this._storage.onImageDeleted=this._previousOnImageDeleted)}storeImage(e,t){let i=e??this._nextImageId++,A=this._kittyIdToStorageId.get(i);A!==void 0&&(this._storage.deleteImage(A),this._kittyIdToStorageId.delete(i),this._storageIdToKittyId.delete(A)),!this._images.has(i)&&this._images.size>=U._maxStoredImages&&this._evictUndisplayedImages();let r=this._storage.getLimit()*1e6;this._images.delete(i);let n=0;for(let a of this._images.values())n+=a.data.size;for(let a of[!1,!0])for(let[o,h]of this._images){if(n+t.data.size<=r)break;this._kittyIdToStorageId.has(o)===a&&(n-=h.data.size,this.deleteById(o))}return this._images.set(i,{...t,id:i}),i}addImage(e,t,i,A,r){let n=this._kittyIdToStorageId.get(e);n!==void 0&&this._storageIdToKittyId.delete(n),this._addImageOpts.scrolling=i,this._addImageOpts.layer=A,this._addImageOpts.zIndex=r;let a=this._storage.addImage(t,this._addImageOpts);this._kittyIdToStorageId.set(e,a),this._storageIdToKittyId.set(a,e)}getImage(e){return this._images.get(e)}deleteById(e){this._images.delete(e);let t=this._kittyIdToStorageId.get(e);t!==void 0&&(this._storage.deleteImage(t),this._kittyIdToStorageId.delete(e),this._storageIdToKittyId.delete(t))}deleteAll(){this._images.clear();for(let e of this._kittyIdToStorageId.values())this._storage.deleteImage(e);this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}get images(){return this._images}get kittyIdToStorageId(){return this._kittyIdToStorageId}get lastImageId(){return this._nextImageId-1}_evictUndisplayedImages(){for(let[e]of this._images){if(this._images.size<=U._maxStoredImages/2)break;this._kittyIdToStorageId.has(e)||this._images.delete(e)}}};U._maxStoredImages=256;var Ae=U;var y=M(Z());var Xe=M(We());var Mt=4194304,Te=y.PALETTE_ANSI_256;Te.set(y.PALETTE_VT340_COLOR);var ae=class{constructor(e,t,i){this._opts=e;this._storage=t;this._coreTerminal=i;this._size=0;this._aborted=!1;(0,Xe.DecoderAsync)({memoryLimit:this._opts.pixelLimit*4,palette:Te,paletteLimit:this._opts.sixelPaletteLimit}).then(A=>this._dec=A)}reset(){this._dec&&(this._dec.release(),this._dec._palette.fill(0),this._dec.init(0,Te,this._opts.sixelPaletteLimit))}hook(e){if(this._size=0,this._aborted=!1,this._dec){let t=e.params[1]===1?0:vt(this._coreTerminal._core._inputHandler._curAttrData,this._coreTerminal._core._themeService?.colors);this._dec.init(t,null,this._opts.sixelPaletteLimit)}}put(e,t,i){if(!(this._aborted||!this._dec)){if(this._size+=i-t,this._size>this._opts.sixelSizeLimit){console.warn("SIXEL: too much data, aborting"),this._aborted=!0,this._dec.release();return}try{this._dec.decode(e,t,i)}catch(A){console.warn(`SIXEL: error while decoding image - ${A}`),this._aborted=!0,this._dec.release()}}}unhook(e){if(this._aborted||!e||!this._dec)return!0;let t=this._dec.width,i=this._dec.height;if(!t||!i)return i&&this._storage.advanceCursor(i),!0;let A=D.createCanvas(void 0,t,i);return A.getContext("2d")?.putImageData(new ImageData(this._dec.data8,t,i),0,0),this._dec.memoryUsage>Mt&&this._dec.release(),this._storage.addImage(A),!0}};function vt(s,e){let t=0;if(!e)return t;if(s.isInverse())if(s.isFgDefault())t=ne(e.foreground.rgba);else if(s.isFgRGB()){let i=s.constructor.toColorRGB(s.getFgColor());t=(0,y.toRGBA8888)(...i)}else t=ne(e.ansi[s.getFgColor()].rgba);else if(s.isBgDefault())t=ne(e.background.rgba);else if(s.isBgRGB()){let i=s.constructor.toColorRGB(s.getBgColor());t=(0,y.toRGBA8888)(...i)}else t=ne(e.ansi[s.getBgColor()].rgba);return t}function ne(s){return y.BIG_ENDIAN?s:(s&255)<<24|(s>>>8&255)<<16|(s>>>16&255)<<8|s>>>24&255}var oe=class{constructor(e,t,i,A){this._storage=e;this._opts=t;this._renderer=i;this._terminal=A;this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"vt340"}}addImage(e){this._addImageOpts.scrolling=this._opts.sixelScrolling,this._storage.addImage(e,this._addImageOpts)}advanceCursor(e){if(this._opts.sixelScrolling){let t=this._renderer.cellSize;(t.width===-1||t.height===-1)&&(t=w);let i=Math.ceil(e/t.height);for(let A=1;Athis._onImageAdded.fire(),this._opts.enableSizeReports){let t=e.options.windowOptions??{};t.getWinSizePixels=!0,t.getCellSizePixels=!0,t.getWinSizeChars=!0,e.options.windowOptions=t}if(this._disposeLater(this._renderer,this._storage,e.parser.registerCsiHandler({prefix:"?",final:"h"},t=>this._decset(t)),e.parser.registerCsiHandler({prefix:"?",final:"l"},t=>this._decrst(t)),e.parser.registerCsiHandler({final:"c"},t=>this._da1(t)),e.parser.registerCsiHandler({prefix:"?",final:"S"},t=>this._xtermGraphicsAttributes(t)),e.onRender(t=>this._storage?.render(t)),e.parser.registerCsiHandler({intermediates:"!",final:"p"},()=>this.reset()),e.parser.registerEscHandler({final:"c"},()=>this.reset()),e._core._inputHandler.onRequestReset(()=>this.reset()),e.buffer.onBufferChange(()=>this._storage?.wipeAlternate()),e.onResize(t=>this._storage?.viewportResize(t))),this._opts.sixelSupport){let t=new oe(this._storage,this._opts,this._renderer,e),i=new ae(this._opts,t,e);this._handlers.set("sixel",i),this._disposeLater(e._core._inputHandler._parser.registerDcsHandler({final:"q"},i))}if(this._opts.iipSupport){let t=new he(this._storage),i=new te(this._opts,this._renderer,t,e);this._handlers.set("iip",i),this._disposeLater(e._core._inputHandler._parser.registerOscHandler(1337,i))}if(this._opts.kittySupport){let t=new Ae(this._storage),i=new ie(this._opts,this._renderer,t,e);this._handlers.set("kitty",i),this._disposeLater(t,i,e._core._inputHandler._parser.registerApcHandler({final:"G"},i))}}reset(){this._opts.sixelScrolling=this._defaultOpts.sixelScrolling,this._opts.sixelPaletteLimit=this._defaultOpts.sixelPaletteLimit,this._storage?.reset();for(let e of this._handlers.values())e.reset();return!1}get storageLimit(){return this._storage?.getLimit()||-1}set storageLimit(e){this._storage?.setLimit(e),this._opts.storageLimit=e}get storageUsage(){return this._storage?this._storage.getUsage():-1}get showPlaceholder(){return this._opts.showPlaceholder}set showPlaceholder(e){this._opts.showPlaceholder=e,this._renderer?.showPlaceholder(e)}getImageAtBufferCell(e,t){return this._storage?.getImageAtBufferCell(e,t)}extractTileAtBufferCell(e,t){return this._storage?.extractTileAtBufferCell(e,t)}_report(e){this._terminal?._core.input(e,!1)}_decset(e){for(let t=0;t2&&!(e[2]instanceof Array)&&e[2]<=je?(this._opts.sixelPaletteLimit=e[2],this._report(`\x1B[?${e[0]};0;${this._opts.sixelPaletteLimit}S`)):this._report(`\x1B[?${e[0]};2S`),!0;case 4:return this._report(`\x1B[?${e[0]};0;${je}S`),!0;default:return this._report(`\x1B[?${e[0]};2S`),!0}if(e[0]===2)switch(e[1]){case 1:let t=this._renderer?.dimensions?.css.canvas.width,i=this._renderer?.dimensions?.css.canvas.height;if(!t||!i){let r=w;t=(this._terminal?.cols||80)*r.width,i=(this._terminal?.rows||24)*r.height}if(t*i()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var It=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let A of ht(e))!gt.call(r,A)&&A!==t&&Ne(r,A,{get:()=>e[A],enumerable:!(i=ot(e,A))||i.enumerable});return r};var x=(r,e,t)=>(t=r!=null?at(dt(r)):{},It(e||!r||!r.__esModule?Ne(t,"default",{value:r,enumerable:!0}):t,r));var j=M(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.DEFAULT_FOREGROUND=_.DEFAULT_BACKGROUND=_.PALETTE_ANSI_256=_.PALETTE_VT340_GREY=_.PALETTE_VT340_COLOR=_.normalizeHLS=_.normalizeRGB=_.nearestColorIndex=_.fromRGBA8888=_.toRGBA8888=_.alpha=_.blue=_.green=_.red=_.BIG_ENDIAN=void 0;_.BIG_ENDIAN=new Uint8Array(new Uint32Array([4278190080]).buffer)[0]===255;_.BIG_ENDIAN&&console.warn("BE platform detected. This version of node-sixel works only on LE properly.");function He(r){return r&255}_.red=He;function Fe(r){return r>>>8&255}_.green=Fe;function Ge(r){return r>>>16&255}_.blue=Ge;function ct(r){return r>>>24&255}_.alpha=ct;function f(r,e,t,i=255){return((i&255)<<24|(t&255)<<16|(e&255)<<8|r&255)>>>0}_.toRGBA8888=f;function mt(r){return[r&255,r>>8&255,r>>16&255,r>>>24]}_.fromRGBA8888=mt;function _t(r,e){let t=He(r),i=Fe(r),A=Ge(r),s=Number.MAX_SAFE_INTEGER,n=-1;for(let a=0;a1&&(t-=1),t*6<1?e+(r-e)*6*t:t*2<1?r:t*3<2?e+(r-e)*(4-t*6):e}function ut(r,e,t){if(!t){let s=Math.round(e*255);return f(s,s,s)}let i=e<.5?e*(1+t):e+t-e*t,A=2*e-i;return f(ce(0,255,Math.round(me(i,A,r+1/3)*255)),ce(0,255,Math.round(me(i,A,r)*255)),ce(0,255,Math.round(me(i,A,r-1/3)*255)))}function m(r,e,t){return(4278190080|Math.round(t/100*255)<<16|Math.round(e/100*255)<<8|Math.round(r/100*255))>>>0}_.normalizeRGB=m;function Et(r,e,t){return ut((r+240%360)/360,e/100,t/100)}_.normalizeHLS=Et;_.PALETTE_VT340_COLOR=new Uint32Array([m(0,0,0),m(20,20,80),m(80,13,13),m(20,80,20),m(80,20,80),m(20,80,80),m(80,80,20),m(53,53,53),m(26,26,26),m(33,33,60),m(60,26,26),m(33,60,33),m(60,33,60),m(33,60,60),m(60,60,33),m(80,80,80)]);_.PALETTE_VT340_GREY=new Uint32Array([m(0,0,0),m(13,13,13),m(26,26,26),m(40,40,40),m(6,6,6),m(20,20,20),m(33,33,33),m(46,46,46),m(0,0,0),m(13,13,13),m(26,26,26),m(40,40,40),m(6,6,6),m(20,20,20),m(33,33,33),m(46,46,46)]);_.PALETTE_ANSI_256=(()=>{let r=[f(0,0,0),f(205,0,0),f(0,205,0),f(205,205,0),f(0,0,238),f(205,0,205),f(0,250,205),f(229,229,229),f(127,127,127),f(255,0,0),f(0,255,0),f(255,255,0),f(92,92,255),f(255,0,255),f(0,255,255),f(255,255,255)],e=[0,95,135,175,215,255];for(let t=0;t<6;++t)for(let i=0;i<6;++i)for(let A=0;A<6;++A)r.push(f(e[t],e[i],e[A]));for(let t=8;t<=238;t+=10)r.push(f(t,t,t));return new Uint32Array(r)})();_.DEFAULT_BACKGROUND=f(0,0,0,255);_.DEFAULT_FOREGROUND=f(255,255,255,255)});var Ee=M(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.InWasm=Dt;var v=r=>{if(Uint8Array.fromBase64)return Uint8Array.fromBase64(r);if(typeof Buffer<"u")return Buffer.from(r,"base64");let e=atob(r),t=new Uint8Array(e.length);for(let i=0;inew n.Instance(s||(s=new n.Module(A||(A=v(i)))),a):a=>s?n.instantiate(s,a):n.instantiate(A||(A=v(i)),a).then(o=>(s=o.module)&&o.instance):e===1?t?()=>s||(s=new n.Module(A||(A=v(i)))):()=>s?Promise.resolve(s):n.compile(A||(A=v(i))).then(a=>s=a):t?()=>A||(A=v(i)):()=>Promise.resolve(A||(A=v(i)))}if(typeof _wasmCtx>"u")throw new Error('must run "inwasm"');_wasmCtx.add(r)}});var Be=M(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});var wt=Ee(),bt=(0,wt.InWasm)({s:1,t:0,d:"AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML"}),S=new Uint8Array("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").map(r=>r.charCodeAt(0))),R=new Uint32Array(1024);R.fill(4278190080);for(let r=0;r>4|(r<<4&255)<<8;for(let r=0;r>2<<8|(r<<6&255)<<16;for(let r=0;rthis.maxBytes||this.maxBytes>4294901760)throw new Error("invalid byte settings")}get data8(){return this._inst?this._d.subarray(0,this._m32[1282]):yt}release(){this._inst&&(this._bytes>this.keepSize?this._inst=this._m32=this._d=this._mem=null:(this._m32[1280]=0,this._m32[1281]=0,this._m32[1282]=0))}init(e,t){if(this.maxBytes=e??this.maxBytes,this._bytes=t??Math.min(this._bytes,this.maxBytes),this._bytes>this.maxBytes||this.maxBytes>4294901760)throw Error("invalid byte settings");let i=this._m32,A=this._bytes+5152;this._inst?this._mem.buffer.byteLengththis.maxBytes)return-3;let i=this._bytes;for(;(i*=2)this._mem.buffer.byteLength){let A=Math.ceil((i+5152-this._mem.buffer.byteLength)/65536);this._mem.grow(A),this._m32=new Uint32Array(this._mem.buffer,0),this._d=new Uint8Array(this._mem.buffer,5152)}this._bytes=i}return 0}put(e){if(!this._inst||this._ended)return-2;if(this._realloc(e.length))return-3;let t=this._m32;return this._d.set(e,t[1280]),t[1280]+=e.length,t[1280]-t[1281]>=131072?this._inst.exports.dec():0}end(){return this._ended=!0,this._inst?this._inst.exports.end():-2}get loadedBytes(){return this._inst?this._m32[1280]:0}get freeBytes(){return this._inst?this.maxBytes-this._m32[1280]:0}};pe.default=Ce});var Ue=M(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});var St=Ee(),Lt=(0,St.InWasm)({s:1,t:0,d:"AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=="}),fe=class{constructor(e){this.keepSize=e,this.width=0,this.height=0}decode(e){this.width=e[4]<<24|e[5]<<16|e[6]<<8|e[7],this.height=e[8]<<24|e[9]<<16|e[10]<<8|e[11];let t=this.width*this.height,i=t*4,A=e.length,s=Math.max(i,A)+(Math.min(i,A)>>1)+4096;this._inst?this._mem.buffer.byteLengththis.keepSize&&(this._inst=this._d=this._mem=null)}};Qe.default=fe});var xe=M(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.LIMITS=void 0;se.LIMITS={CHUNK_SIZE:16384,PALETTE_SIZE:4096,MAX_WIDTH:16384,BYTES:"AGFzbQEAAAABJAdgAAF/YAJ/fwBgA39/fwF/YAF/AX9gAABgBH9/f38AYAF/AAIlAgNlbnYLaGFuZGxlX2JhbmQAAwNlbnYLbW9kZV9wYXJzZWQAAwMTEgQAAAAAAQQBAQUBAAACAgAGAwQFAXABBwcFBAEBBwcGCAF/AUGAihoLB9wBDgZtZW1vcnkCABFnZXRfc3RhdGVfYWRkcmVzcwADEWdldF9jaHVua19hZGRyZXNzAAQOZ2V0X3AwX2FkZHJlc3MABRNnZXRfcGFsZXR0ZV9hZGRyZXNzAAYEaW5pdAALBmRlY29kZQAMDWN1cnJlbnRfd2lkdGgADQ5jdXJyZW50X2hlaWdodAAOGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtfaW5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IjAIgADcDAEHAjAIgADcDAEG4jAIgADcDAEGwjAIgADcDAEGojAIgADcDAEGgjAIgADcDAEGYjAIgADcDAEGQjAIgADcDAEGIjAIgADcDAEGAjAIgADcDAEH4iwIgADcDAEHwiwIgADcDAEHoiwIgADcDAEHgiwIgADcDAEHYiwIgADcDAEHQiwIgADcDAEHIiwIgADcDAEHAiwIgADcDAEG4iwIgADcDAEGwiwIgADcDAEGoiwIgADcDAEGgiwIgADcDAEGYiwIgADcDAEGQiwIgADcDAEGIiwIgADcDAEGAiwIgADcDAEH4igIgADcDAEHwigIgADcDAEHoigIgADcDAEHgigIgADcDAEHYigIgADcDAEHQigIgADcDAEHIigIgADcDAEHAigIgADcDAEG4igIgADcDAEGwigIgADcDAEGoigIgADcDAEGgigIgADcDAEGYigIgADcDAEGQigIgADcDAEGIigIgADcDAEGAigIgADcDAEH4iQIgADcDAEHwiQIgADcDAEHoiQIgADcDAEHgiQIgADcDAEHYiQIgADcDAEHQiQIgADcDAEHIiQIgADcDAEHAiQIgADcDAEG4iQIgADcDAEGwiQIgADcDAEGoCCgCACIEQf8AakGAAW0hCAJAIARBgQFIDQBBASEBIAhBAiAIQQJKG0EBayICQQFxIQMgBEGBAk4EQCACQX5xIQIDQCABQQl0IgdBEHJBoIkCakGwiQJBgAT8CgAAIAdBsI0CakGwiQJBgAT8CgAAIAFBAmohASACQQJrIgINAAsLIANFDQAgAUEJdEEQckGgiQJqQbCJAkGABPwKAAALAkAgBEEBSA0AIAhBASAIQQFKGyIDQQFxIQUCQCADQQFrIgdFBEBBACEBDAELIANB/v///wdxIQJBACEBA0AgAUEJdCIGQRByQbCJBmpBsIkCQYAE/AoAACAGQZAEckGwiQZqQbCJAkGABPwKAAAgAUECaiEBIAJBAmsiAg0ACwsgBQRAIAFBCXRBEHJBsIkGakGwiQJBgAT8CgAACyAEQQFIDQAgA0EBcSEFIAcEfyADQf7///8HcSECQQAhAQNAIAFBCXQiBkEQckHAiQpqQbCJAkGABPwKAAAgBkG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kMAAIBPXSAGQwAAAABgcQRAIAapDAELQQALQRB0ciABcgtBgICAeHILNwAgAEH/AWxBMmpB5ABtIAFB/wFsQTJqQeQAbUEIdHIgAkH/AWxBMmpB5ABtQRB0ckGAgIB4cgsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwsYAQBBgAgLEQEAAAACAAAAAwAAAAQAAAAF"}});var je=M(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.decodeAsync=b.decode=b.Decoder=b.DecoderAsync=void 0;var O=j(),Q=xe();function Mt(r){if(typeof Buffer<"u")return Buffer.from(r,"base64");let e=atob(r),t=new Uint8Array(e.length);for(let i=0;i1,this.modeHandler=e=>1}handle_band(e){return this.bandHandler(e)}mode_parsed(e){return this.modeHandler(e)}},vt={memoryLimit:2048*65536,sixelColor:O.DEFAULT_FOREGROUND,fillColor:O.DEFAULT_BACKGROUND,palette:O.PALETTE_VT340_COLOR,paletteLimit:Q.LIMITS.PALETTE_SIZE,truncate:!0};function Ze(r){let e=new Me,t={env:{handle_band:e.handle_band.bind(e),mode_parsed:e.mode_parsed.bind(e)}};return WebAssembly.instantiate(J||Xe,t).then(i=>(J=J||i.module,new P(r,i.instance||i,e)))}b.DecoderAsync=Ze;var P=class{constructor(e,t,i){if(this._PIXEL_OFFSET=Q.LIMITS.MAX_WIDTH+4,this._canvas=ne,this._bandWidths=[],this._maxWidth=0,this._minWidth=Q.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0,this._opts=Object.assign({},vt,e),this._opts.paletteLimit>Q.LIMITS.PALETTE_SIZE)throw new Error(`DecoderOptions.paletteLimit must not exceed ${Q.LIMITS.PALETTE_SIZE}`);if(t)i.bandHandler=this._handle_band.bind(this),i.modeHandler=this._initCanvas.bind(this);else{let A=J||(J=new WebAssembly.Module(Xe));t=new WebAssembly.Instance(A,{env:{handle_band:this._handle_band.bind(this),mode_parsed:this._initCanvas.bind(this)}})}this._instance=t,this._wasm=this._instance.exports,this._chunk=new Uint8Array(this._wasm.memory.buffer,this._wasm.get_chunk_address(),Q.LIMITS.CHUNK_SIZE),this._states=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_state_address(),12),this._palette=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_palette_address(),Q.LIMITS.PALETTE_SIZE),this._palette.set(this._opts.palette),this._pSrc=new Uint32Array(this._wasm.memory.buffer,this._wasm.get_p0_address()),this._wasm.init(O.DEFAULT_FOREGROUND,0,this._opts.paletteLimit,0)}get _fillColor(){return this._states[0]}get _truncate(){return this._states[8]}get _rasterWidth(){return this._states[6]}get _rasterHeight(){return this._states[7]}get _width(){return this._states[2]?this._states[2]-4:0}get _height(){return this._states[3]}get _level(){return this._states[9]}get _mode(){return this._states[10]}get _paletteLimit(){return this._states[11]}_initCanvas(e){if(e===2){let t=this.width*this.height;if(t>this._canvas.length){if(this._opts.memoryLimit&&t*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(t)}this._maxWidth=this._width}else if(e===1)if(this._level===2){let t=Math.min(this._rasterWidth,Q.LIMITS.MAX_WIDTH)*this._rasterHeight;if(t>this._canvas.length){if(this._opts.memoryLimit&&t*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");this._canvas=new Uint32Array(t)}}else this._canvas.length<65536&&(this._canvas=new Uint32Array(65536));return 0}_realloc(e,t){let i=e+t;if(i>this._canvas.length){if(this._opts.memoryLimit&&i*4>this._opts.memoryLimit)throw this.release(),new Error("image exceeds memory limit");let A=new Uint32Array(Math.ceil(i/65536)*65536);A.set(this._canvas),this._canvas=A}}_handle_band(e){let t=this._PIXEL_OFFSET,i=this._lastOffset;if(this._mode===2){let A=this.height-this._currentHeight,s=0;for(;s<6&&A>0;)this._canvas.set(this._pSrc.subarray(t*s,t*s+e),i+e*s),s++,A--;this._lastOffset+=e*s,this._currentHeight+=s}else if(this._mode===1){this._realloc(i,e*6),this._maxWidth=Math.max(this._maxWidth,e),this._minWidth=Math.min(this._minWidth,e);for(let A=0;A<6;++A)this._canvas.set(this._pSrc.subarray(t*A,t*A+e),i+e*A);this._bandWidths.push(e),this._lastOffset+=e*6,this._currentHeight+=6}return 0}get width(){return this._mode!==1?this._width:Math.max(this._maxWidth,this._wasm.current_width())}get height(){return this._mode!==1?this._height:this._wasm.current_width()?this._bandWidths.length*6+this._wasm.current_height():this._bandWidths.length*6}get palette(){return this._palette.subarray(0,this._paletteLimit)}get memoryUsage(){return this._canvas.byteLength+this._wasm.memory.buffer.byteLength+8*this._bandWidths.length}get properties(){return{width:this.width,height:this.height,mode:this._mode,level:this._level,truncate:!!this._truncate,paletteLimit:this._paletteLimit,fillColor:this._fillColor,memUsage:this.memoryUsage,rasterAttributes:{numerator:this._states[4],denominator:this._states[5],width:this._rasterWidth,height:this._rasterHeight}}}init(e=this._opts.fillColor,t=this._opts.palette,i=this._opts.paletteLimit,A=this._opts.truncate){this._wasm.init(this._opts.sixelColor,e,i,A?1:0),t&&this._palette.set(t.subarray(0,Q.LIMITS.PALETTE_SIZE)),this._bandWidths.length=0,this._maxWidth=0,this._minWidth=Q.LIMITS.MAX_WIDTH,this._lastOffset=0,this._currentHeight=0}decode(e,t=0,i=e.length){let A=t;for(;A0){let i=this._PIXEL_OFFSET,A=this._lastOffset,s=0;for(;s<6&&t>0;)this._canvas.set(this._pSrc.subarray(i*s,i*s+e),A+e*s),s++,t--;t&&this._canvas.fill(this._fillColor,A+e*s)}return this._canvas.subarray(0,this.width*this.height)}if(this._mode===1){if(this._minWidth===this._maxWidth){let s=!1;if(e)if(e!==this._minWidth)s=!0;else{let n=this._PIXEL_OFFSET,a=this._lastOffset;this._realloc(a,e*6);for(let o=0;o<6;++o)this._canvas.set(this._pSrc.subarray(n*o,n*o+e),a+e*o)}if(!s)return this._canvas.subarray(0,this.width*this.height)}let t=new Uint32Array(this.width*this.height);t.fill(this._fillColor);let i=0,A=0;for(let s=0;s{if(this._disposed)return H(()=>{});let A={fn:e,thisArgs:t};this._listeners=this._listeners.slice(),this._listeners.push(A);let s=H(()=>{let n=this._listeners.indexOf(A);n!==-1&&(this._listeners=this._listeners.slice(),this._listeners.splice(n,1))});return i&&(Array.isArray(i)?i.push(s):i.add(s)),s},this._event)}fire(e){if(this._disposed||!this._listeners.length)return;if(this._listeners.length===1){this._listeners[0].fn.call(this._listeners[0].thisArgs,e);return}let t=this._listeners;for(let i=0,A=t.length;i{function r(s,n){return s(a=>n.fire(a))}A.forward=r;function e(s,n){return(a,o,h)=>s(d=>a.call(o,n(d)),void 0,h)}A.map=e;function t(...s){return(n,a,o)=>{let h=new N;for(let d of s)h.add(d(g=>n.call(a,g)));return o&&(Array.isArray(o)?o.push(h):o.add(h)),h}}A.any=t;function i(s,n,a){return n(a),s(o=>n(o))}A.runAndSubscribe=i})(lt||={});var _e=x(j());var D=class r extends k{constructor(t){super();this._terminal=t;this._layers=new Map;this._optionsRefresh=this._register(new X);this._oldOpen=this._terminal._core.open,this._terminal._core.open=i=>{this._oldOpen?.call(this._terminal._core,i),this._open()},this._terminal._core.screenElement&&this._open(),this._optionsRefresh.value=this._terminal._core.optionsService.onOptionChange(i=>{i==="fontSize"&&(this.rescaleCanvas(),this._renderService?.refreshRows(0,this._terminal.rows))}),this._register(H(()=>{this.removeLayerFromDom(),this.removeLayerFromDom("bottom"),this._terminal._core&&this._oldOpen&&(this._terminal._core.open=this._oldOpen,this._oldOpen=void 0),this._renderService&&this._oldSetRenderer&&(this._renderService.setRenderer=this._oldSetRenderer,this._oldSetRenderer=void 0),this._renderService=void 0,this._layers.clear(),this._placeholderBitmap?.close(),this._placeholderBitmap=void 0,this._placeholder=void 0}))}get canvas(){return this._layers.get("top")?.canvas}static createCanvas(t,i,A){let s=(t??document).createElement("canvas");return s.width=i|0,s.height=A|0,s}static createImageData(t,i,A,s){if(typeof ImageData!="function"){let n=t.createImageData(i,A);return s&&n.data.set(new Uint8ClampedArray(s,0,i*A*4)),n}return s?new ImageData(new Uint8ClampedArray(s,0,i*A*4),i,A):new ImageData(i,A)}static createImageBitmap(t){return typeof createImageBitmap!="function"?Promise.resolve(void 0):createImageBitmap(t)}showPlaceholder(t){t?!this._placeholder&&this.cellSize.height!==-1&&this._createPlaceHolder(Math.max(this.cellSize.height+1,24)):(this._placeholderBitmap?.close(),this._placeholderBitmap=void 0,this._placeholder=void 0),this._renderService?.refreshRows(0,this._terminal.rows)}get dimensions(){return this._terminal.dimensions}get cellSize(){return{width:this.dimensions?.css.cell.width||-1,height:this.dimensions?.css.cell.height||-1}}clearLines(t,i,A){let s=t*(this.dimensions?.css.cell.height||0),n=this.dimensions?.css.canvas.width||0,a=(i+1-t)*(this.dimensions?.css.cell.height||0);(!A||A==="top")&&this._layers.get("top")?.clearRect(0,s,n,a),(!A||A==="bottom")&&this._layers.get("bottom")?.clearRect(0,s,n,a)}clearAll(t){if(!t||t==="top"){let i=this._layers.get("top");i?.clearRect(0,0,i.canvas.width,i.canvas.height)}if(!t||t==="bottom"){let i=this._layers.get("bottom");i?.clearRect(0,0,i.canvas.width,i.canvas.height)}}draw(t,i,A,s,n=1){let a=this._layers.get(t.layer);if(!a)return;let{width:o,height:h}=this.cellSize;if(o===-1||h===-1)return;this._rescaleImage(t,o,h);let d=t.actual,{width:g,height:I}=t.actualCellSize,l=Math.ceil(d.width/g),c=i%l*g,u=Math.floor(i/l)*I,E=A*o,C=s*h,p=n*g+c>d.width?d.width-c:n*g,B=u+I>d.height?d.height-u:I;a.drawImage(d,Math.floor(c),Math.floor(u),Math.ceil(p),Math.ceil(B),Math.floor(E),Math.floor(C),Math.ceil(p*o/g),Math.ceil(B*h/I))}extractTile(t,i){let{width:A,height:s}=this.cellSize;if(A===-1||s===-1)return;this._rescaleImage(t,A,s);let n=t.actual,{width:a,height:o}=t.actualCellSize,h=Math.ceil(n.width/a),d=i%h*a,g=Math.floor(i/h)*o,I=a+d>n.width?n.width-d:a,l=g+o>n.height?n.height-g:o,c=r.createCanvas(this.document,Math.ceil(I*A/a),Math.ceil(l*s/o)),u=c.getContext("2d");if(u)return u.drawImage(n,Math.floor(d),Math.floor(g),Math.floor(I),Math.floor(l),0,0,c.width,c.height),c}drawPlaceholder(t,i,A=1){let s=this._layers.get("top");if(s){let{width:n,height:a}=this.cellSize;if(n===-1||a===-1||(this._placeholder?a>=this._placeholder.height&&this._createPlaceHolder(a+1):this._createPlaceHolder(Math.max(a+1,24)),!this._placeholder))return;s.drawImage(this._placeholderBitmap??this._placeholder,t*n,i*a%2?0:1,n*A,a,t*n,i*a,n*A,a)}}rescaleCanvas(){let t=this.dimensions?.css.canvas.width||0,i=this.dimensions?.css.canvas.height||0;for(let A of this._layers.values())(A.canvas.width!==t||A.canvas.height!==i)&&(A.canvas.width=t,A.canvas.height=i)}_rescaleImage(t,i,A){if(i===t.actualCellSize.width&&A===t.actualCellSize.height)return;let{width:s,height:n}=t.origCellSize;if(i===s&&A===n){t.actual=t.orig,t.actualCellSize.width=s,t.actualCellSize.height=n;return}let a=Math.ceil(t.orig.width*i/s),o=Math.ceil(t.orig.height*A/n);if(a*o>t.orig.width*t.orig.height){t.actual=t.orig,t.actualCellSize.width=s,t.actualCellSize.height=n;return}let h=r.createCanvas(this.document,a,o),d=h.getContext("2d");d&&(d.drawImage(t.orig,0,0,h.width,h.height),t.actual=h,t.actualCellSize.width=i,t.actualCellSize.height=A)}_open(){this._renderService=this._terminal._core._renderService,this._oldSetRenderer=this._renderService.setRenderer.bind(this._renderService),this._renderService.setRenderer=t=>{for(let i of[...this._layers.keys()])this.removeLayerFromDom(i);this._oldSetRenderer?.call(this._renderService,t)}}insertLayerToDom(t="top"){if(!this.document||!this._terminal._core.screenElement){console.warn("image addon: cannot insert output canvas to DOM, missing document or screenElement");return}if(this._layers.has(t))return;let i=r.createCanvas(this.document,this.dimensions?.css.canvas.width||0,this.dimensions?.css.canvas.height||0);i.classList.add(`xterm-image-layer-${t}`);let A=this._terminal._core.screenElement;A.style.isolation="isolate",t==="bottom"?(i.style.zIndex="-1",A.insertBefore(i,A.firstChild)):(i.style.zIndex="0",A.appendChild(i));let s=i.getContext("2d",{alpha:!0});if(!s){i.remove();return}this._layers.set(t,s),this.clearAll(t)}removeLayerFromDom(t="top"){let i=this._layers.get(t);i&&(i.canvas.remove(),this._layers.delete(t))}hasLayer(t){return this._layers.has(t)}_createPlaceHolder(t=24){this._placeholderBitmap?.close(),this._placeholderBitmap=void 0;let i=32,A=r.createCanvas(this.document,i,t),s=A.getContext("2d",{alpha:!1});if(!s)return;let n=r.createImageData(s,i,t),a=new Uint32Array(n.data.buffer),o=(0,_e.toRGBA8888)(0,0,0),h=(0,_e.toRGBA8888)(255,255,255);a.fill(o);for(let l=0;l{this._placeholder!==I?l?.close():this._placeholderBitmap=l}).catch(()=>{})}get document(){return this._terminal._core._coreBrowserService?.window.document}};var w={width:7,height:14},G=class r{constructor(e=0,t=0,i=-1,A=-1){this.imageId=i;this.tileId=A;this._ext=0;this._urlId=0;this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new r(this._ext,this._urlId,this.imageId,this.tileId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0&&this.imageId===-1}},F=new G,V=class{constructor(e,t,i){this._terminal=e;this._renderer=t;this._opts=i;this._images=new Map;this._lastId=0;this._lowestId=0;this._fullyCleared=!1;this._needsFullClear=!1;this._pixelLimit=25e5;try{this.setLimit(this._opts.storageLimit)}catch(A){A instanceof Error&&console.error(A.message),console.warn(`storageLimit is set to ${this.getLimit()} MB`)}this._viewportMetrics={cols:this._terminal.cols,rows:this._terminal.rows}}dispose(){this.reset()}reset(){for(let e of this._images.values())e.marker?.dispose();this._images.clear(),this._renderer.clearAll()}getLimit(){return this._pixelLimit*4/1e6}setLimit(e){if(e<.5||e>1e3)throw RangeError("invalid storageLimit, should be at least 0.5 MB and not exceed 1G");this._pixelLimit=e/4*1e6>>>0,this._evictOldest(0)}getUsage(){return this._getStoredPixels()*4/1e6}_getStoredPixels(){let e=0;for(let t of this._images.values())t.orig&&(e+=t.orig.width*t.orig.height,t.actual&&t.actual!==t.orig&&(e+=t.actual.width*t.actual.height));return e}_delImg(e){let t=this._images.get(e);t&&(this._images.delete(e),window.ImageBitmap&&t.orig instanceof ImageBitmap&&t.orig.close(),this.onImageDeleted?.(e))}wipeAlternate(){let e=[];for(let[t,i]of this._images.entries())i.bufferType==="alternate"&&(i.marker?.dispose(),e.push(t));for(let t of e)this._delImg(t);this._needsFullClear=!0,this._fullyCleared=!1}deleteImage(e){let t=this._images.get(e);t&&(t.marker?.dispose(),this._delImg(e))}addImage(e,t){this._evictOldest(e.width*e.height);let i=this._renderer.cellSize;(i.width===-1||i.height===-1)&&(i=w);let A=Math.ceil(e.width/i.width),s=Math.ceil(e.height/i.height),n=++this._lastId,a=this._terminal._core.buffer,o=this._terminal.cols,h=this._terminal.rows,d=a.x,g=a.y,I=d,l=0;t.scrolling||(a.x=0,a.y=0,I=0),this._terminal._core._inputHandler._dirtyRowTracker.markDirty(a.y);for(let C=0;C=o);++B)this._writeToCell(p,I+B,n,C*A+B),l++;if(t.scrolling)C=h)break;a.x=I}this._terminal._core._inputHandler._dirtyRowTracker.markDirty(a.y),t.scrolling?t.cursorPos==="iip"?a.x=Math.min(I+A,o):a.x=I:(a.x=d,a.y=g);let c=[];for(let[C,p]of this._images.entries())p.tileCount<1&&(p.marker?.dispose(),c.push(C));for(let C of c)this._delImg(C);let u=this._terminal.registerMarker(0);u?.onDispose(()=>{this._images.get(n)&&this._delImg(n)}),this._terminal.buffer.active.type==="alternate"&&this._evictOnAlternate();let E={orig:e,origCellSize:i,actual:e,actualCellSize:{...i},marker:u||void 0,tileCount:l,bufferType:this._terminal.buffer.active.type,layer:t.layer,zIndex:t.zIndex};return this._images.set(n,E),this.onImageAdded?.(),n}render(e){let t=!1,i=!1;for(let d of this._images.values())if(d.layer==="bottom"?i=!0:t=!0,t&&i)break;if(t&&!this._renderer.hasLayer("top")&&(this._renderer.insertLayerToDom("top"),!this._renderer.hasLayer("top")))return;if(i&&!this._renderer.hasLayer("bottom")&&this._renderer.insertLayerToDom("bottom"),this._renderer.rescaleCanvas(),!this._images.size){this._fullyCleared||(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1),this._renderer.hasLayer("top")&&this._renderer.removeLayerFromDom("top"),this._renderer.hasLayer("bottom")&&this._renderer.removeLayerFromDom("bottom");return}!t&&this._renderer.hasLayer("top")&&(this._renderer.clearAll("top"),this._renderer.removeLayerFromDom("top")),!i&&this._renderer.hasLayer("bottom")&&(this._renderer.clearAll("bottom"),this._renderer.removeLayerFromDom("bottom")),this._needsFullClear&&(this._renderer.clearAll(),this._fullyCleared=!0,this._needsFullClear=!1);let{start:A,end:s}=e,n=this._terminal._core.buffer,a=this._terminal._core.cols;this._renderer.clearLines(A,s);let o=[],h=[];for(let d=A;d<=s;++d){let g=n.lines.get(d+n.ydisp);if(!g)return;for(let I=0;Id.imgSpec.zIndex-g.imgSpec.zIndex);for(let d of h)this._renderer.drawPlaceholder(d.col,d.row,d.count);for(let d of o)this._renderer.draw(d.imgSpec,d.tileId,d.col,d.row,d.count)}viewportResize(e){if(!this._images.size){this._viewportMetrics=e;return}if(this._viewportMetrics.cols>=e.cols){this._viewportMetrics=e;return}let t=this._terminal._core.buffer,i=t.lines.length,A=this._viewportMetrics.cols-1;for(let s=0;s=d)continue;let g=!1;for(let c=A+1;c>e.cols;++c)if(n._data[c*3+0]&4194303){g=!0;break}if(g)continue;let I=Math.min(e.cols,d-a.tileId%d+A),l=a.tileId;for(let c=A+1;c57)throw new Error("illegal char");e=e*10+r[t]-48}return e}function Oe(r){let e=$(r);if(!e.match(/^((auto)|(\d+?((px)|(%)){0,1}))$/))throw new Error("illegal size");return e}function Tt(r){if(typeof Buffer<"u")return Buffer.from($(r),"base64").toString();let e=atob($(r)),t=new Uint8Array(e.length);for(let i=0;i14)return-1;for(let a=t;a=Se)return this._a();n[s++]=o}break;case 58:return A===3&&!this._storeValue(s)?this._a():(this.state=4,a+1);default:if(s>=Se)return this._a();n[s++]=o}}return this.state=A,this._position=s,-2}_a(){return this.fields.type=0,this.state=1,-1}_storeKey(e){let t=$(this._buffer.subarray(0,e));return t?(this._key=t,this.fields[t]=null,!0):!1}_storeValue(e){if(this._key){try{let t=this._buffer.slice(0,e);this.fields[this._key]=Je[this._key]?Je[this._key](t):t}catch{return!1}return!0}return!1}};var L={mime:"unsupported",width:0,height:0};function te(r){if(r.length<32)return L;let e=new Uint32Array(r.buffer,r.byteOffset,8);if(e[0]===1196314761&&e[1]===169478669&&e[3]===1380206665)return{mime:"image/png",width:r[16]<<24|r[17]<<16|r[18]<<8|r[19],height:r[20]<<24|r[21]<<16|r[22]<<8|r[23]};if(r[0]===255&&r[1]===216&&r[2]===255){let[t,i]=xt(r);return{mime:"image/jpeg",width:t,height:i}}if(e[0]===944130375&&(r[4]===55||r[4]===57)&&r[5]===97)return{mime:"image/gif",width:r[7]<<8|r[6],height:r[9]<<8|r[8]};if(e[0]===1718185841)return{mime:"image/qoi",width:r[4]<<24|r[5]<<16|r[6]<<8|r[7],height:r[8]<<24|r[9]<<16|r[10]<<8|r[11]};if(e[0]===1179011410&&e[2]===1346520407&&(e[3]&16777215)===3690582){switch(r[15]){case 88:return{mime:"image/webp",width:(r[24]|r[25]<<8|r[26]<<16)+1,height:(r[27]|r[28]<<8|r[29]<<16)+1};case 76:if(r[20]!==47)return L;let t=r[21]|r[22]<<8|r[23]<<16|r[24]<<24;return{mime:"image/webp",width:(t&16383)+1,height:(t>>>14&16383)+1};case 32:return r[23]!==157||r[24]!==1||r[25]!==42?L:{mime:"image/webp",width:(r[26]|r[27]<<8)&16383,height:(r[28]|r[29]<<8)&16383}}return L}if(e[1]===1887007846&&(e[2]===1718187617||e[2]===1936291425)){let t=-1,i=Math.min(r.length-16,1024);for(let A=8;A0&&s>0)return{mime:"image/avif",width:A,height:s}}return L}return L}function xt(r){let e=r.length,t=4,i=r[t]<<8|r[t+1];for(;;){if(t+=i,t>=e)return[0,0];if(r[t]!==255)return[0,0];if(r[t+1]===192||r[t+1]===194)return t+80){if(this._hp.fields.type===1){if(this._isMultipart&&(this._isMultipart=!1,this._abortMulti=!1,this._dec.release()),this._header=Object.assign({},Le,this._hp.fields),!this._header.inline){this._aborted=!0;return}if(!this._initDecoder()){this._aborted=!0;return}}else if(this._abortMulti){this._aborted=!0;return}this._dec.put(e.subarray(A,i))!==0&&(this._dec.release(),this._aborted=!0,this._isMultipart&&(this._abortMulti=!0))}}}end(e){if(this._aborted||this._hp.state!==4&&this._hp.end())return!0;let t=this._hp.fields.type;if(t===3)return!0;if(t===5){let h=w.width,d=w.height;this._renderer.dimensions&&(h=this._renderer.dimensions.css.canvas.width/this._coreTerminal.cols,d=this._renderer.dimensions.css.canvas.height/this._coreTerminal.rows);let g=this._coreTerminal._core._coreBrowserService?.dpr??1,I=`\x1B]1337;ReportCellSize=${d.toFixed(3)};${h.toFixed(3)};${g.toFixed(3)}\x1B\\`;return this._coreTerminal.input(I,!1),!0}if(t===2)return this._header=Object.assign({},Le,this._hp.fields),this._isMultipart=!0,this._abortMulti=!1,this._dec.release(),this._initDecoder()||(this._abortMulti=!0),!0;if(t===4&&(!this._isMultipart||(this._isMultipart=!1,this._abortMulti||this._header.type!==2)))return!0;let i=0,A=0,s,n=L;if((s=e)&&((s=!this._dec.end())?(n=te(this._dec.data8),(s=n.mime!=="unsupported")?(i=n.width,A=n.height,(s=i&&A&&i*Ao!==this._generation?(h.close(),!0):(this._storage.addImage(h),!0)).catch(h=>(console.warn(`IIP: decoding error ${n.mime} ${n.width}x${n.height}`,h),!0))}_initDecoder(){try{return this._dec.init(),!0}catch(e){return console.warn("IIP: could not allocate decoder",e),this._dec.release(),!1}}_resize(e,t){let i=this._renderer.dimensions?.css.cell.width||w.width,A=this._renderer.dimensions?.css.cell.height||w.height,s=this._renderer.dimensions?.css.canvas.width||i*this._coreTerminal.cols,n=this._renderer.dimensions?.css.canvas.height||A*this._coreTerminal.rows,a=this._dim(this._header.width,s,i),o=this._dim(this._header.height,n,A);if(!a&&!o){let h=s/e,d=(n-A)/t,g=Math.min(h,d);return g<1?[e*g,t*g]:[e,t]}return a?this._header.preserveAspectRatio||!a||!o?[a,t*a/e]:[a,o]:[e*o/t,o]}_dim(e,t,i){return e==="auto"?0:e.endsWith("%")?parseInt(e.slice(0,-1),10)*t/100:e.endsWith("px")?parseInt(e.slice(0,-2),10):parseInt(e,10)*i}};var We=x(Be());function Te(r){let e={},t=r.split(",");for(let i of t){let A=i.indexOf("=");if(A===-1)continue;let s=i.substring(0,A),n=i.substring(A+1);if(s==="a"){e.action=n;continue}if(s==="o"){e.compression=n;continue}if(s==="t"){e.transmission=n;continue}if(s==="d"){e.deleteSelector=n;continue}let a=parseInt(n,10);switch(s){case"f":e.format=a;break;case"i":e.id=a;break;case"I":e.imageNumber=a;break;case"s":e.width=a;break;case"v":e.height=a;break;case"x":e.x=a;break;case"y":e.y=a;break;case"w":e.sourceWidth=a;break;case"h":e.sourceHeight=a;break;case"X":e.xOffset=a;break;case"Y":e.yOffset=a;break;case"c":e.columns=a;break;case"r":e.rows=a;break;case"m":e.more=a;break;case"q":e.quiet=a;break;case"C":e.cursorMovement=a;break;case"z":e.zIndex=a;break;case"p":e.placementId=a;break}}return e}var ze=0,Ae=class{constructor(e,t,i,A){this._opts=e;this._renderer=t;this._kittyStorage=i;this._coreTerminal=A;this._aborted=!1;this._generation=0;this._decodeError=!1;this._activeDecoder=null;this._inControlData=!0;this._controlData=new Uint32Array(512);this._controlLength=0;this._encodedSizeLimit=0;this._totalEncodedSize=0;this._parsedCommand=null;this._pendingTransmissions=new Map;this._maxEncodedBytes=Math.ceil(this._opts.kittySizeLimit*4/3),this._initialEncodedBytes=Math.min(4194304,this._maxEncodedBytes)}reset(){this._generation++,this._cleanupAllPending(),this._activeDecoder&&(this._activeDecoder.release(),this._activeDecoder=null),this._kittyStorage.reset()}dispose(){this.reset()}_removePendingEntry(e){this._pendingTransmissions.delete(e),this._lastPendingKey===e&&(this._lastPendingKey=void 0)}_cleanupAllPending(){for(let e of this._pendingTransmissions.values())e.decoder.release();this._pendingTransmissions.clear(),this._lastPendingKey=void 0}start(){this._aborted=!1,this._decodeError=!1,this._inControlData=!0,this._controlLength=0,this._parsedCommand=null,this._encodedSizeLimit=this._maxEncodedBytes,this._totalEncodedSize=0,this._activeDecoder=null}put(e,t,i){if(!this._aborted)if(!this._inControlData)this._streamPayload(e,t,i);else{let A=i;for(let n=t;n512){this._aborted=!0;return}if(this._controlData.set(e.subarray(t,A),this._controlLength),this._controlLength+=s,!this._inControlData){if(this._parsedCommand=Te(this._parseControlDataString()),this._parsedCommand.id!==void 0&&this._parsedCommand.imageNumber!==void 0){this._sendResponse(this._parsedCommand.id,"EINVAL:cannot specify both i and I keys",this._parsedCommand.quiet??0),this._aborted=!0;return}if(this._parsedCommand.action==="d")return;let n=A+1;nthis._encodedSizeLimit){let o=this._activeDecoder??s?.decoder;o&&o.release(),this._activeDecoder=null,s&&this._removePendingEntry(A),this._aborted=!0;return}if(!this._decodeError){if(s?.decoder&&!this._activeDecoder&&(this._activeDecoder=s.decoder),!this._activeDecoder){let o=this._maxEncodedBytes+131072;if(o>this._opts.storageLimit*1e6){this._aborted=!0,this._parsedCommand?.id!==void 0&&this._sendResponse(this._parsedCommand.id,"ENOMEM:pending image budget exceeded",this._parsedCommand.quiet??0);return}let h=Math.max(1,Math.floor(this._opts.storageLimit*1e6/o));for(;this._pendingTransmissions.size>=h;){let g=this._pendingTransmissions.entries().next().value;if(!g)break;g[1].decoder.release(),this._removePendingEntry(g[0]),g[1].cmd.id!==void 0&&this._sendResponse(g[1].cmd.id,"ENOMEM:pending image budget exceeded",g[1].cmd.quiet??0)}let d=new We.default(4194304,this._maxEncodedBytes,this._initialEncodedBytes);try{d.init()}catch(g){console.warn("KITTY: could not allocate decoder",g),this._aborted=!0,this._parsedCommand?.id!==void 0&&this._sendResponse(this._parsedCommand.id,"ENOMEM:could not allocate decoder",this._parsedCommand.quiet??0);return}this._activeDecoder=d}this._activeDecoder.put(e.subarray(t,i))!==ze&&(this._activeDecoder.release(),this._activeDecoder=null,this._decodeError=!0,s&&this._removePendingEntry(A))}}end(e){if(this._aborted||!e)return this._activeDecoder&&(this._activeDecoder.release(),this._activeDecoder=null),!0;if(this._inControlData)return this._handleNoPayloadCommand();let t=this._parsedCommand;if(t.action==="d")return this._handleDelete(t);let i=t.id??this._lastPendingKey??0,A=t.more===1,s=this._pendingTransmissions.get(i);if(A)return this._activeDecoder&&(s?(s.totalEncodedSize+=this._totalEncodedSize,s.decodeError=s.decodeError||this._decodeError):this._pendingTransmissions.set(i,{cmd:{...t},decoder:this._activeDecoder,totalEncodedSize:this._totalEncodedSize,decodeError:this._decodeError}),this._lastPendingKey=i,this._activeDecoder=null),!0;s&&(this._lastPendingKey=void 0);let n=this._decodeError,a=t,o=this._activeDecoder;s&&(a=s.cmd,o=s.decoder,n=n||s.decodeError,this._pendingTransmissions.delete(i));let h=new Uint8Array(0);o&&(o.end()!==ze&&(n=!0),h=o.data8),this._activeDecoder=null;let d=this._handleCommandWithBytesAndCmd(a,h,n);return o&&o.release(),d}_parseControlDataString(){let e="";for(let t=0;t0&&this._sendResponse(e.id,"OK",e.quiet??0)),s}case"T":return this._handleTransmitDisplay(e,t,i);case"q":return this._handleQuery(e,t,i);case"p":return this._handlePlacement(e);default:return e.id!==void 0&&this._sendResponse(e.id,"EINVAL:unsupported action",e.quiet??0),!0}}_handlePlacement(e){if(e.id===void 0)return!0;let t=e.id,i=this._kittyStorage.getImage(t);return i?this._displayImage(i,e).then(s=>(this._sendResponse(t,s?"OK":"EINVAL:image rendering failed",e.quiet??0,e.placementId),!0)):(this._sendResponse(t,"ENOENT:image not found",e.quiet??0,e.placementId),!0)}_handleTransmit(e,t,i){return(e.transmission??"d")!=="d"?(e.id!==void 0&&this._sendResponse(e.id,"EINVAL:unsupported transmission medium",e.quiet??0),!0):(i||t.length===0||this._kittyStorage.storeImage(e.id,{data:new Blob([t]),width:e.width??0,height:e.height??0,format:e.format??32,compression:e.compression??""}),!0)}_handleTransmitDisplay(e,t,i){if(i)return e.id!==void 0&&this._sendResponse(e.id,"EINVAL:invalid base64 data",e.quiet??0),!0;this._handleTransmit(e,t,i);let A=e.id??this._kittyStorage.lastImageId,s=this._kittyStorage.getImage(A);if(s){let n=this._displayImage(s,e);return e.id!==void 0?n.then(a=>(this._sendResponse(A,a?"OK":"EINVAL:image rendering failed",e.quiet??0),!0)):n.then(()=>!0)}return!0}_handleQuery(e,t,i){let A=e.id??0,s=e.quiet??0;if((e.transmission??"d")!=="d")return this._sendResponse(A,"EINVAL:unsupported transmission medium",s),!0;if(i)return this._sendResponse(A,"EINVAL:invalid base64 data",s),!0;if(t.length===0)return this._sendResponse(A,"OK",s),!0;let a=e.format??32;if(a===100)this._sendResponse(A,"OK",s);else{let o=e.width??0,h=e.height??0;if(!o||!h)return this._sendResponse(A,"EINVAL:width and height required for raw pixel data",s),!0;let d=a===32?4:3,g=o*h*d;if(t.length=1||!s&&i>=2)return;let n=A?`,p=${A}`:"",a=`\x1B_Gi=${e}${n};${t}\x1B\\`;this._coreTerminal._core.coreService.triggerDataEvent(a)}_displayImage(e,t){return this._decodeAndDisplay(e,t).then(()=>!0).catch(()=>!1)}async _decodeAndDisplay(e,t){let i=this._generation,A=await this._createBitmap(e);try{if(i!==this._generation)throw new Error("image decode canceled");let s=Math.max(0,t.x??0),n=Math.max(0,t.y??0),a=t.sourceWidth||A.width-s,o=t.sourceHeight||A.height-n,h=Math.max(0,A.width-s),d=Math.max(0,A.height-n),g=Math.max(0,Math.min(a,h)),I=Math.max(0,Math.min(o,d));if(g===0||I===0)throw new Error("invalid source rectangle");if(s!==0||n!==0||g!==A.width||I!==A.height){let T=await createImageBitmap(A,s,n,g,I);A.close(),A=T}let l=this._renderer.dimensions?.css.cell.width||w.width,c=this._renderer.dimensions?.css.cell.height||w.height,u,E;t.columns!==void 0&&t.rows!==void 0?(u=t.columns,E=t.rows):t.columns!==void 0?(u=t.columns,E=Math.max(1,Math.ceil(A.height/A.width*(u*l)/c))):t.rows!==void 0?(E=t.rows,u=Math.max(1,Math.ceil(A.width/A.height*(E*c)/l))):(u=Math.ceil(A.width/l),E=Math.ceil(A.height/c));let C=A.width,p=A.height;if((t.columns!==void 0||t.rows!==void 0)&&(C=Math.round(u*l),p=Math.round(E*c)),C*p>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");let B=this._coreTerminal._core.buffer,Y=B.x,q=B.y,z=B.ybase,At=t.zIndex!==void 0&&t.zIndex<0?"bottom":"top";if(C!==A.width||p!==A.height){let T=await createImageBitmap(A,{resizeWidth:C,resizeHeight:p});A.close(),A=T}let Ie=Math.min(Math.max(0,t.xOffset??0),l-1),le=Math.min(Math.max(0,t.yOffset??0),c-1);if(Ie!==0||le!==0){let T=t.columns!==void 0?Math.round(u*l):A.width+Ie,st=t.rows!==void 0?Math.round(E*c):A.height+le,W=D.createCanvas(window.document,T,st),ke=W.getContext("2d");if(!ke)throw new Error("Failed to create offset canvas context");ke.drawImage(A,Ie,le);let nt=await createImageBitmap(W);if(W.width=W.height=0,A.close(),A=nt,C=A.width,p=A.height,C*p>this._opts.pixelLimit)throw new Error("image exceeds pixel limit");t.columns===void 0&&(u=Math.ceil(A.width/l)),t.rows===void 0&&(E=Math.ceil(A.height/c))}if(i!==this._generation)throw new Error("image decode canceled");let rt=t.zIndex??0;if(this._kittyStorage.addImage(e.id,A,!0,At,rt),A=void 0,t.cursorMovement===1){let T=B.ybase-z;B.x=Y,B.y=Math.max(q-T,0)}else B.x=Math.min(Y+u,this._coreTerminal.cols)}catch(s){throw A?.close(),s}}async _createBitmap(e){let t=new Uint8Array(await e.data.arrayBuffer());if(e.compression==="z"&&(t=await this._decompressZlib(t)),e.format===100){let E=te(t);if(E.mime!=="image/png"||!(E.width>0)||!(E.height>0)||E.width*E.height>this._opts.pixelLimit)throw new RangeError("PNG exceeds pixel limit or has invalid dimensions");let C=new Blob([t],{type:"image/png"});if(!window.createImageBitmap){let p=URL.createObjectURL(C),B=new Image;return new Promise((Y,q)=>{B.addEventListener("load",()=>{URL.revokeObjectURL(p);let z=D.createCanvas(window.document,B.width,B.height);z.getContext("2d")?.drawImage(B,0,0),createImageBitmap(z).then(Y).catch(q)}),B.addEventListener("error",()=>{URL.revokeObjectURL(p),q(new Error("Failed to load image"))}),B.src=p})}return createImageBitmap(C)}let i=e.width,A=e.height;if(!i||!A)throw new Error("Width and height required for raw pixel data");let s=e.format===32?4:3,n=i*A*s;if(t.length>>24|p<<8,d[l++]=4278190080|p>>>16|B<<16,d[l++]=4278190080|B>>>8}let c=g*3,u=g*4;for(let E=g;E=e.length){g.close();return}let I=Math.min(A+4096,e.length);g.enqueue(new Uint8Array(e.subarray(A,I))),A=I}}).pipeThrough(new DecompressionStream(t)).getReader(),a=[],o=0;try{for(;;){let{done:g,value:I}=await n.read();if(g)break;if(o+=I.byteLength,o>i)throw await n.cancel().catch(()=>{}),new RangeError("decompressed image exceeds byte limit");a.push(I)}}finally{n.releaseLock()}let h=new Uint8Array(o),d=0;for(let g of a)h.set(g,d),d+=g.length;return h}get images(){return this._kittyStorage.images}get _kittyIdToStorageId(){return this._kittyStorage.kittyIdToStorageId}get pendingTransmissions(){return this._pendingTransmissions}};var U=class U{constructor(e){this._storage=e;this._nextImageId=1;this._images=new Map;this._kittyIdToStorageId=new Map;this._storageIdToKittyId=new Map;this._handleStorageImageDeleted=e=>{let t=this._storageIdToKittyId.get(e);t!==void 0&&(this._kittyIdToStorageId.delete(t),this._storageIdToKittyId.delete(e),this._images.delete(t))};this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"iip"};this._previousOnImageDeleted=this._storage.onImageDeleted,this._wrappedOnImageDeleted=t=>{this._previousOnImageDeleted?.(t),this._handleStorageImageDeleted(t)},this._storage.onImageDeleted=this._wrappedOnImageDeleted}reset(){this._nextImageId=1,this._images.clear(),this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}dispose(){this.reset(),this._storage.onImageDeleted===this._wrappedOnImageDeleted&&(this._storage.onImageDeleted=this._previousOnImageDeleted)}storeImage(e,t){let i=e??this._nextImageId++,A=this._kittyIdToStorageId.get(i);A!==void 0&&(this._storage.deleteImage(A),this._kittyIdToStorageId.delete(i),this._storageIdToKittyId.delete(A)),!this._images.has(i)&&this._images.size>=U._maxStoredImages&&this._evictUndisplayedImages();let s=this._storage.getLimit()*1e6;this._images.delete(i);let n=0;for(let a of this._images.values())n+=a.data.size;for(let a of[!1,!0])for(let[o,h]of this._images){if(n+t.data.size<=s)break;this._kittyIdToStorageId.has(o)===a&&(n-=h.data.size,this.deleteById(o))}return this._images.set(i,{...t,id:i}),i}addImage(e,t,i,A,s){let n=this._kittyIdToStorageId.get(e);n!==void 0&&this._storageIdToKittyId.delete(n),this._addImageOpts.scrolling=i,this._addImageOpts.layer=A,this._addImageOpts.zIndex=s;let a=this._storage.addImage(t,this._addImageOpts);this._kittyIdToStorageId.set(e,a),this._storageIdToKittyId.set(a,e)}getImage(e){return this._images.get(e)}deleteById(e){this._images.delete(e);let t=this._kittyIdToStorageId.get(e);t!==void 0&&(this._storage.deleteImage(t),this._kittyIdToStorageId.delete(e),this._storageIdToKittyId.delete(t))}deleteAll(){this._images.clear();for(let e of this._kittyIdToStorageId.values())this._storage.deleteImage(e);this._kittyIdToStorageId.clear(),this._storageIdToKittyId.clear()}get images(){return this._images}get kittyIdToStorageId(){return this._kittyIdToStorageId}get lastImageId(){return this._nextImageId-1}_evictUndisplayedImages(){for(let[e]of this._images){if(this._images.size<=U._maxStoredImages/2)break;this._kittyIdToStorageId.has(e)||this._images.delete(e)}}};U._maxStoredImages=256;var re=U;var y=x(j());var he=x(je()),Ve=x(xe());var Nt=4194304,K=y.PALETTE_ANSI_256;K.set(y.PALETTE_VT340_COLOR);var Ht=2,Re=new Map,ve=!1;function Ft(r){ve||(ve=!0,(0,he.DecoderAsync)({memoryLimit:r,palette:K}).then(e=>$e(e,r),()=>{ve=!1}))}function Gt(r){return Re.get(r)?.pop()??new he.Decoder({memoryLimit:r,palette:K})}function $e(r,e){r.memoryUsage>Nt&&r.release();let t=Re.get(e)??[];t.lengththis._opts.sixelSizeLimit){console.warn("SIXEL: too much data, aborting"),this._aborted=!0,this._dec.release();return}try{this._dec.decode(e,t,i)}catch(A){console.warn(`SIXEL: error while decoding image - ${A}`),this._aborted=!0,this._dec.release()}}}unhook(e){try{return this._unhook(e)}finally{this._returnDecoder()}}_unhook(e){if(this._aborted||!e||!this._dec)return!0;let t=this._dec.width,i=this._dec.height;if(!t||!i)return i&&this._storage.advanceCursor(i),!0;let A=D.createCanvas(void 0,t,i);return A.getContext("2d")?.putImageData(new ImageData(this._dec.data8,t,i),0,0),this._storage.addImage(A),!0}};function Ut(r,e){let t=0;if(!e)return t;if(r.isInverse())if(r.isFgDefault())t=ae(e.foreground.rgba);else if(r.isFgRGB()){let i=r.constructor.toColorRGB(r.getFgColor());t=(0,y.toRGBA8888)(...i)}else t=ae(e.ansi[r.getFgColor()].rgba);else if(r.isBgDefault())t=ae(e.background.rgba);else if(r.isBgRGB()){let i=r.constructor.toColorRGB(r.getBgColor());t=(0,y.toRGBA8888)(...i)}else t=ae(e.ansi[r.getBgColor()].rgba);return t}function ae(r){return y.BIG_ENDIAN?r:(r&255)<<24|(r>>>8&255)<<16|(r>>>16&255)<<8|r>>>24&255}var de=class{constructor(e,t,i,A){this._storage=e;this._opts=t;this._renderer=i;this._terminal=A;this._addImageOpts={scrolling:!0,layer:"top",zIndex:0,cursorPos:"vt340"}}addImage(e){this._addImageOpts.scrolling=this._opts.sixelScrolling,this._storage.addImage(e,this._addImageOpts)}advanceCursor(e){if(this._opts.sixelScrolling){let t=this._renderer.cellSize;(t.width===-1||t.height===-1)&&(t=w);let i=Math.ceil(e/t.height);for(let A=1;Athis._onImageAdded.fire(),this._opts.enableSizeReports){let t=e.options.windowOptions??{};t.getWinSizePixels=!0,t.getCellSizePixels=!0,t.getWinSizeChars=!0,e.options.windowOptions=t}if(this._disposeLater(this._renderer,this._storage,e.parser.registerCsiHandler({prefix:"?",final:"h"},t=>this._decset(t)),e.parser.registerCsiHandler({prefix:"?",final:"l"},t=>this._decrst(t)),e.parser.registerCsiHandler({final:"c"},t=>this._da1(t)),e.parser.registerCsiHandler({prefix:"?",final:"S"},t=>this._xtermGraphicsAttributes(t)),e.onRender(t=>this._storage?.render(t)),e.parser.registerCsiHandler({intermediates:"!",final:"p"},()=>this.reset()),e.parser.registerEscHandler({final:"c"},()=>this.reset()),e._core._inputHandler.onRequestReset(()=>this.reset()),e.buffer.onBufferChange(()=>this._storage?.wipeAlternate()),e.onResize(t=>this._storage?.viewportResize(t))),this._opts.sixelSupport){let t=new de(this._storage,this._opts,this._renderer,e),i=new oe(this._opts,t,e);this._handlers.set("sixel",i),this._disposeLater(e._core._inputHandler._parser.registerDcsHandler({final:"q"},i))}if(this._opts.iipSupport){let t=new ge(this._storage),i=new ie(this._opts,this._renderer,t,e);this._handlers.set("iip",i),this._disposeLater(e._core._inputHandler._parser.registerOscHandler(1337,i))}if(this._opts.kittySupport){let t=new re(this._storage),i=new Ae(this._opts,this._renderer,t,e);this._handlers.set("kitty",i),this._disposeLater(t,i,e._core._inputHandler._parser.registerApcHandler({final:"G"},i))}}reset(){this._opts.sixelScrolling=this._defaultOpts.sixelScrolling,this._opts.sixelPaletteLimit=this._defaultOpts.sixelPaletteLimit,this._storage?.reset();for(let e of this._handlers.values())e.reset();return!1}get storageLimit(){return this._storage?.getLimit()||-1}set storageLimit(e){this._storage?.setLimit(e),this._opts.storageLimit=e}get storageUsage(){return this._storage?this._storage.getUsage():-1}get showPlaceholder(){return this._opts.showPlaceholder}set showPlaceholder(e){this._opts.showPlaceholder=e,this._renderer?.showPlaceholder(e)}getImageAtBufferCell(e,t){return this._storage?.getImageAtBufferCell(e,t)}extractTileAtBufferCell(e,t){return this._storage?.extractTileAtBufferCell(e,t)}_report(e){this._terminal?._core.input(e,!1)}_decset(e){for(let t=0;t2&&!(e[2]instanceof Array)&&e[2]<=tt?(this._opts.sixelPaletteLimit=e[2],this._report(`\x1B[?${e[0]};0;${this._opts.sixelPaletteLimit}S`)):this._report(`\x1B[?${e[0]};2S`),!0;case 4:return this._report(`\x1B[?${e[0]};0;${tt}S`),!0;default:return this._report(`\x1B[?${e[0]};2S`),!0}if(e[0]===2)switch(e[1]){case 1:let t=this._renderer?.dimensions?.css.canvas.width,i=this._renderer?.dimensions?.css.canvas.height;if(!t||!i){let s=w;t=(this._terminal?.cols||80)*s.width,i=(this._terminal?.rows||24)*s.height}if(t*i {\n if (Uint8Array.fromBase64)\n return Uint8Array.fromBase64(s);\n if (typeof Buffer !== 'undefined')\n return Buffer.from(s, 'base64');\n const b = atob(s);\n const r = new Uint8Array(b.length);\n for (let i = 0; i < r.length; ++i)\n r[i] = b.charCodeAt(i);\n return r;\n};\nfunction InWasm(def) {\n if (def.d) {\n const { t, s, d } = def;\n let b;\n let m;\n const W = WebAssembly;\n if (t === 0 /* OutputType.INSTANCE */) {\n if (s)\n return (e) => new W.Instance(m || (m = new W.Module(b || (b = z(d)))), e);\n return (e) => m\n ? W.instantiate(m, e)\n : W.instantiate(b || (b = z(d)), e).then(r => (m = r.module) && r.instance);\n }\n if (t === 1 /* OutputType.MODULE */) {\n if (s)\n return () => m || (m = new W.Module(b || (b = z(d))));\n return () => m\n ? Promise.resolve(m)\n : W.compile(b || (b = z(d))).then(r => m = r);\n }\n if (s)\n return () => b || (b = z(d));\n return () => Promise.resolve(b || (b = z(d)));\n }\n if (typeof _wasmCtx === 'undefined')\n throw new Error('must run \"inwasm\"');\n _wasmCtx.add(def);\n}\n//# sourceMappingURL=index.js.map", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023, 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\n/**\n * wasm base64 decoder.\n */\nconst wasmDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#828e69684093b2c6:rdef-start:\"decode\"*/{s:1,t:0,d:'AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML'}/*inwasm#828e69684093b2c6:rdef-end:\"decode\"*/);\n// SIMD version (speedup ~1.4x, not covered by tests yet)\n/*\nconst wasmDecode = InWasm({\n name: 'decode',\n type: OutputType.INSTANCE,\n mode: OutputMode.SYNC,\n srctype: 'Clang-C',\n imports: {\n env: { memory: new WebAssembly.Memory({ initial: 1 }) }\n },\n exports: {\n dec: () => 0,\n end: () => 0\n },\n compile: {\n switches: ['-msimd128', '-Wl,-z,stack-size=0', '-Wl,--stack-first']\n },\n code: `\n #include \n typedef struct {\n unsigned int wp;\n unsigned int sp;\n unsigned int dp;\n unsigned int e_size;\n unsigned int dummy[4];\n unsigned char data[0];\n } State;\n\n unsigned int *D0 = (unsigned int *) ${P32.D0 * 4};\n unsigned int *D1 = (unsigned int *) ${P32.D1 * 4};\n unsigned int *D2 = (unsigned int *) ${P32.D2 * 4};\n unsigned int *D3 = (unsigned int *) ${P32.D3 * 4};\n State *state = (State *) ${P32.STATE * 4};\n\n #define packed_byte(x) wasm_i8x16_splat((char) x)\n #define packed_dword(x) wasm_i32x4_splat(x)\n #define masked(x, mask) wasm_v128_and(x, wasm_i32x4_splat(mask))\n\n __attribute__((noinline)) int dec() {\n unsigned int nsp = (state->wp - 1) & ~3;\n unsigned char *src = state->data + state->sp;\n unsigned char *end = state->data + nsp;\n unsigned char *dst = state->data + state->dp;\n unsigned int error = 0;\n\n v128_t err = wasm_i8x16_splat(0);\n unsigned char *end16 = state->data + (nsp & ~15);\n while (src < end16) {\n v128_t data = wasm_v128_load((v128_t *) src);\n\n // wasm-simd rewrite of http://0x80.pl/notesen/2016-01-17-sse-base64-decoding.html#vector-lookup-pshufb\n const v128_t higher_nibble = wasm_u32x4_shr(data, 4) & packed_byte(0x0f);\n const char linv = 1;\n const char hinv = 0;\n\n const v128_t lower_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n linv, linv, 0x2b, 0x30,\n 0x41, 0x50, 0x61, 0x70,\n linv, linv, linv, linv,\n linv, linv, linv, linv\n );\n const v128_t upper_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n hinv, hinv, 0x2b, 0x39,\n 0x4f, 0x5a, 0x6f, 0x7a,\n hinv, hinv, hinv, hinv,\n hinv, hinv, hinv, hinv\n );\n // the difference between the shift and lower bound\n const v128_t shift_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n 0x00, 0x00, 0x3e - 0x2b, 0x34 - 0x30,\n 0x00 - 0x41, 0x0f - 0x50, 0x1a - 0x61, 0x29 - 0x70,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00\n );\n\n const v128_t upper_bound = wasm_i8x16_swizzle(upper_bound_LUT, higher_nibble);\n const v128_t lower_bound = wasm_i8x16_swizzle(lower_bound_LUT, higher_nibble);\n\n const v128_t below = wasm_i8x16_lt(data, lower_bound);\n const v128_t above = wasm_i8x16_gt(data, upper_bound);\n const v128_t eq_2f = wasm_i8x16_eq(data, packed_byte(0x2f));\n\n // in_range = not (below or above) or eq_2f\n // outside = not in_range = below or above and not eq_2f (from deMorgan law)\n const v128_t outside = wasm_v128_andnot(eq_2f, above | below);\n err = wasm_v128_or(err, outside);\n\n const v128_t shift = wasm_i8x16_swizzle(shift_LUT, higher_nibble);\n const v128_t t0 = wasm_i8x16_add(data, shift);\n v128_t v = wasm_i8x16_add(t0, wasm_v128_and(eq_2f, packed_byte(-3)));\n\n // pack bytes\n const v128_t ca = masked(v, 0x003f003f);\n const v128_t db = masked(v, 0x3f003f00);\n const v128_t t00 = wasm_v128_or(wasm_u32x4_shr(db, 8), wasm_i32x4_shl(ca, 6));\n v128_t res = wasm_v128_or(wasm_u32x4_shr(t00, 16), wasm_i32x4_shl(t00, 12));\n res = wasm_i8x16_swizzle(res, wasm_i8x16_const(2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, 16, 16, 16, 16));\n\n wasm_v128_store((v128_t *) dst, res);\n dst += 12;\n src += 16;\n }\n //if (wasm_i8x16_bitmask(err) != 0) return -1;\n if (wasm_v128_any_true(err)) return -1;\n\n // operate on 4-byte blocks\n while (src < end) {\n error |= *((unsigned int *) dst) = D0[src[0]] | D1[src[1]] | D2[src[2]] | D3[src[3]];\n dst += 3;\n src += 4;\n }\n if (error >> 24) return -1;\n state->sp = nsp;\n state->dp = dst - state->data;\n return 0;\n }\n\n int end() {\n int rem = state->wp - state->sp;\n if (rem > 4 && dec()) return -1;\n rem = state->wp - state->sp;\n if (rem < 2) return -1;\n\n unsigned char *src = state->data + state->sp;\n if (rem == 4) {\n if (src[3] == 61) rem--;\n if (src[2] == 61) rem--;\n }\n unsigned int accu = D0[src[0]] | D1[src[1]];\n int dp = 1;\n if (rem > 2) {\n accu |= D2[src[2]];\n dp++;\n if (rem == 4) {\n accu |= D3[src[3]];\n dp++;\n }\n }\n if (accu >> 24) return -1;\n *((unsigned int *) (state->data + state->dp)) = accu;\n state->dp += dp;\n return 0;\n }\n `\n});\n*/\n// base64 map\nconst MAP = new Uint8Array('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n .split('')\n .map(el => el.charCodeAt(0)));\n// init decoder maps in LE order\nconst D = new Uint32Array(1024);\nD.fill(0xFF000000);\nfor (let i = 0; i < MAP.length; ++i)\n D[MAP[i]] = i << 2;\nfor (let i = 0; i < MAP.length; ++i)\n D[256 + MAP[i]] = i >> 4 | ((i << 4) & 0xFF) << 8;\nfor (let i = 0; i < MAP.length; ++i)\n D[512 + MAP[i]] = (i >> 2) << 8 | ((i << 6) & 0xFF) << 16;\nfor (let i = 0; i < MAP.length; ++i)\n D[768 + MAP[i]] = i << 16;\nconst EMPTY = new Uint8Array(0);\n/**\n * base64 stream decoder.\n *\n * Features / assumptions:\n * - lazy chunkwise decoding\n * - errors out on any non base64 chars (no support for NL formatted base64)\n * - decodes in wasm\n * - inplace decoding to save memory\n * - supports a keepSize for lazy memory release\n */\nclass Base64Decoder {\n /**\n * @param keepSize Keep the wasm instance below this limit when calling `release()`.\n * @param maxBytes Max allowed bytes to allocate.\n * @param initialBytes Initial bytes to allocate.\n */\n constructor(keepSize, maxBytes, initialBytes) {\n this._inst = null;\n this._ended = true;\n this._bytes = 0;\n this.keepSize = keepSize !== null && keepSize !== void 0 ? keepSize : 1048576 /* Bytes.KEEP */;\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : 4294901760 /* Bytes.MAX */;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : 32768 /* Bytes.INITIAL */;\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw new Error('invalid byte settings');\n }\n }\n /**\n * Currently decoded bytes (borrowed).\n * Must be accessed before calling `release` or `init`.\n */\n get data8() {\n return this._inst ? this._d.subarray(0, this._m32[1282 /* P32.STATE_DP */]) : EMPTY;\n }\n /**\n * Release memory conditionally based on `keepSize`.\n * If memory gets released, also the wasm instance will be freed and recreated on next `init`,\n * otherwise the instance will be reused.\n */\n release() {\n if (!this._inst)\n return;\n if (this._bytes > this.keepSize) {\n this._inst = this._m32 = this._d = this._mem = null;\n }\n else {\n this._m32[1280 /* P32.STATE_WP */] = 0;\n this._m32[1281 /* P32.STATE_SP */] = 0;\n this._m32[1282 /* P32.STATE_DP */] = 0;\n }\n }\n /**\n * Initializes the decoder for new base64 data.\n * Must be called before doing any decoding attempts.\n * The method will either spawn a new wasm instance or grow\n * the needed memory of an existing instance.\n * @param maxBytes Max allowed bytes to allocate (overwrites ctor value).\n * @param initialBytes Initial bytes to allocate (overwrites ctor value).\n */\n init(maxBytes, initialBytes) {\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : this.maxBytes;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : Math.min(this._bytes, this.maxBytes);\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw Error('invalid byte settings');\n }\n let m = this._m32;\n const bytes = this._bytes + 5152 /* Bytes._DATA_OFFSET */;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmDecode({ env: { memory: this._mem } });\n m = new Uint32Array(this._mem.buffer, 0);\n m.set(D, 256 /* P32.D0 */);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n m = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n m[1280 /* P32.STATE_WP */] = 0;\n m[1281 /* P32.STATE_SP */] = 0;\n m[1282 /* P32.STATE_DP */] = 0;\n this._m32 = m;\n this._ended = false;\n }\n /**\n * Realloc memory. Realloc only happens, if the requested\n * size doesn't fit in the current memory.\n * The new size will be capped by `maxBytes`.\n * @param requested Bytes to be stored.\n */\n _realloc(requested) {\n const needed = this._m32[1280 /* P32.STATE_WP */] + requested;\n if (this._bytes < needed) {\n if (needed > this.maxBytes) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n let newSize = this._bytes;\n while ((newSize *= 2) < needed) { }\n newSize = Math.min(newSize, this.maxBytes);\n if (newSize < needed) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n if (newSize + 5152 /* Bytes._DATA_OFFSET */ > this._mem.buffer.byteLength) {\n const addPages = Math.ceil((newSize + 5152 /* Bytes._DATA_OFFSET */ - this._mem.buffer.byteLength) / 65536);\n this._mem.grow(addPages);\n this._m32 = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n this._bytes = newSize;\n }\n return 0 /* DecodeStatus.OK */;\n }\n /**\n * Put bytes in `data` into the decoder.\n * Additionally decodes the payload, if it reached 2^17 bytes.\n * The return value indicates the type of issue.\n * @param data Bytes to be loaded.\n */\n put(data) {\n if (!this._inst || this._ended) {\n return -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n if (this._realloc(data.length)) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n const m = this._m32;\n this._d.set(data, m[1280 /* P32.STATE_WP */]);\n m[1280 /* P32.STATE_WP */] += data.length;\n // max chunk in input handler is 2^17, try to run in \"tandem mode\"\n return m[1280 /* P32.STATE_WP */] - m[1281 /* P32.STATE_SP */] >= 131072\n ? this._inst.exports.dec()\n : 0 /* DecodeStatus.OK */;\n }\n /**\n * End the current decoding.\n * Also decodes leftover payload from previous put calls.\n */\n end() {\n this._ended = true;\n return this._inst\n ? this._inst.exports.end()\n : -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n /**\n * Bytes loaded into the decoder.\n */\n get loadedBytes() {\n return this._inst\n ? this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n /**\n * Free bytes to feed to the decoder.\n */\n get freeBytes() {\n return this._inst\n ? this.maxBytes - this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n}\nexports.default = Base64Decoder;\n//# sourceMappingURL=Base64Decoder.wasm.js.map", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\nconst wasmQoiDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#459f9e1bfb80b1a8:rdef-start:\"qoi_decode\"*/{s:1,t:0,d:'AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=='}/*inwasm#459f9e1bfb80b1a8:rdef-end:\"qoi_decode\"*/);\nclass QoiDecoder {\n constructor(keepSize) {\n this.keepSize = keepSize;\n this.width = 0;\n this.height = 0;\n }\n decode(d) {\n this.width = d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7];\n this.height = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];\n const pixels = this.width * this.height;\n const ib = pixels * 4;\n const dl = d.length;\n /**\n * byte/offset calculation:\n * To save some memory we dont reserve full memory for decoded + encoded,\n * but place encoded at the end of decoded plus 50% security distance\n * to avoid reads before writes positions:\n *\n * encoded < decoded (good compression)\n * enc ####################\n * dec #######################################\n * ^ ^\n * DST_P CHUNK_P\n *\n * encoded > decoded (degenerated compression, should not happen)\n * enc ##############################\n * dec ####################\n * ^ ^\n * DST_P CHUNK_P\n *\n * There is still a chance for overlapping r/w positions in case the compressed\n * data has very different pixel progression, yet the 50% security distance\n * should deal with that, as QOI will bloat data by 25% at max (RGB -> OP byte + RGB).\n * Since we always assume RGBA at decoding stage, the possible bloat reduces to 20% at max.\n */\n const bytes = Math.max(ib, dl) + (Math.min(ib, dl) >> 1) + 4096;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmQoiDecode({ env: { memory: this._mem } });\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n this._d = null;\n }\n if (!this._d) {\n this._d = new Uint8Array(this._mem.buffer);\n }\n // put src data at the end of memory, also align to 256\n const chunkP = (this._mem.buffer.byteLength - dl) & ~0xFF;\n this._d.set(d, chunkP);\n this._inst.exports.dec(chunkP, dl, pixels);\n return this._d.subarray(1024 /* P8.DST_P */, 1024 /* P8.DST_P */ + ib);\n }\n release() {\n if (!this._inst)\n return;\n if (this._mem.buffer.byteLength > this.keepSize) {\n this._inst = this._d = this._mem = null;\n }\n }\n}\nexports.default = QoiDecoder;\n//# sourceMappingURL=QoiDecoder.wasm.js.map", null, null, "/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal lifecycle utilities for xterm.js core.\n * Simplified from VS Code's lifecycle.ts - no tracking/leak detection.\n */\n\nexport interface IDisposable {\n dispose(): void;\n}\n\nexport function toDisposable(fn: () => void): IDisposable {\n return { dispose: fn };\n}\n\nexport function dispose(disposable: T): T;\nexport function dispose(disposable: T | undefined): T | undefined;\nexport function dispose(disposables: T[]): T[];\nexport function dispose(arg: T | T[] | undefined): T | T[] | undefined {\n if (!arg) {\n return arg;\n }\n if (Array.isArray(arg)) {\n for (const d of arg) {\n d.dispose();\n }\n return [];\n }\n arg.dispose();\n return arg;\n}\n\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n return toDisposable(() => dispose(disposables));\n}\n\nexport class DisposableStore implements IDisposable {\n private readonly _disposables = new Set();\n private _isDisposed = false;\n\n public get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n public add(o: T): T {\n if (this._isDisposed) {\n o.dispose();\n } else {\n this._disposables.add(o);\n }\n return o;\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n\n public clear(): void {\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n}\n\nexport abstract class Disposable implements IDisposable {\n public static readonly None: IDisposable = Object.freeze({ dispose() { } });\n\n protected readonly _store = new DisposableStore();\n\n public dispose(): void {\n this._store.dispose();\n }\n\n protected _register(o: T): T {\n return this._store.add(o);\n }\n}\n\nexport class MutableDisposable implements IDisposable {\n private _value: T | undefined;\n private _isDisposed = false;\n\n public get value(): T | undefined {\n return this._isDisposed ? undefined : this._value;\n }\n\n public set value(value: T | undefined) {\n if (this._isDisposed || value === this._value) {\n return;\n }\n this._value?.dispose();\n this._value = value;\n }\n\n public clear(): void {\n this.value = undefined;\n }\n\n public dispose(): void {\n this._isDisposed = true;\n this._value?.dispose();\n this._value = undefined;\n }\n}\n", "/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal event utilities for xterm.js core.\n * Simplified from VS Code's event.ts - no leak detection/profiling.\n */\n\nimport { IDisposable, DisposableStore, toDisposable } from './Lifecycle';\n\nexport interface IEvent {\n (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\n}\n\nexport class Emitter {\n private _listeners: { fn: (e: T) => any, thisArgs: any }[] = [];\n private _disposed = false;\n private _event: IEvent | undefined;\n\n public get event(): IEvent {\n if (this._event) {\n return this._event;\n }\n this._event = (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n if (this._disposed) {\n return toDisposable(() => {});\n }\n\n const entry = { fn: listener, thisArgs };\n this._listeners = this._listeners.slice();\n this._listeners.push(entry);\n\n const result = toDisposable(() => {\n const idx = this._listeners.indexOf(entry);\n if (idx !== -1) {\n this._listeners = this._listeners.slice();\n this._listeners.splice(idx, 1);\n }\n });\n\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(result);\n } else {\n disposables.add(result);\n }\n }\n\n return result;\n };\n return this._event;\n }\n\n public fire(event: T): void {\n if (this._disposed || !this._listeners.length) {\n return;\n }\n if (this._listeners.length === 1) {\n this._listeners[0].fn.call(this._listeners[0].thisArgs, event);\n return;\n }\n const listeners = this._listeners;\n for (let i = 0, len = listeners.length; i < len; ++i) {\n listeners[i].fn.call(listeners[i].thisArgs, event);\n }\n }\n\n public dispose(): void {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n this._listeners.length = 0;\n }\n}\n\nexport namespace EventUtils {\n export function forward(from: IEvent, to: Emitter): IDisposable {\n return from(e => to.fire(e));\n }\n\n export function map(event: IEvent, map: (i: I) => O): IEvent {\n return (listener: (e: O) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n return event(i => listener.call(thisArgs, map(i)), undefined, disposables);\n };\n }\n\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent {\n return (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n const store = new DisposableStore();\n for (const event of events) {\n store.add(event(e => listener.call(thisArgs, e)));\n }\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(store);\n } else {\n disposables.add(store);\n }\n }\n return store;\n };\n }\n\n export function runAndSubscribe(event: IEvent, handler: (e: T) => void, initial: T): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void, initial?: T): IDisposable {\n handler(initial);\n return event(e => handler(e));\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { toRGBA8888 } from 'sixel/lib/Colors';\nimport { IDisposable } from '@xterm/xterm';\nimport { ICellSize, ImageLayer, ITerminalExt, IImageSpec, IRenderDimensions, IRenderService } from './Types';\nimport { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';\n\nconst enum Constants {\n PLACEHOLDER_LENGTH = 4096,\n PLACEHOLDER_HEIGHT = 24\n}\n\n/**\n * ImageRenderer - terminal frontend extension:\n * - provide primitives for canvas, ImageData, Bitmap (static)\n * - add canvas layer to DOM (browser only for now)\n * - draw image tiles onRender\n */\nexport class ImageRenderer extends Disposable implements IDisposable {\n /** @deprecated Kept for backward compat \u2014 points to top layer canvas. */\n public get canvas(): HTMLCanvasElement | undefined { return this._layers.get('top')?.canvas; }\n private _layers = new Map();\n private _placeholder: HTMLCanvasElement | undefined;\n private _placeholderBitmap: ImageBitmap | undefined;\n private _optionsRefresh = this._register(new MutableDisposable());\n private _oldOpen: ((parent: HTMLElement) => void) | undefined;\n private _renderService: IRenderService | undefined;\n private _oldSetRenderer: ((renderer: any) => void) | undefined;\n\n // drawing primitive - canvas\n public static createCanvas(localDocument: Document | undefined, width: number, height: number): HTMLCanvasElement {\n /**\n * NOTE: We normally dont care, from which document the canvas\n * gets created, so we can fall back to global document,\n * if the terminal has no document associated yet.\n * This way early image loads before calling .open keep working\n * (still discouraged though, as the metrics will be screwed up).\n * Only the DOM output canvas should be on the terminal's document,\n * which gets explicitly checked in `insertLayerToDom`.\n */\n const canvas = (localDocument ?? document).createElement('canvas');\n canvas.width = width | 0;\n canvas.height = height | 0;\n return canvas;\n }\n\n // drawing primitive - ImageData with optional buffer\n public static createImageData(ctx: CanvasRenderingContext2D, width: number, height: number, buffer?: ArrayBuffer): ImageData {\n if (typeof ImageData !== 'function') {\n const imgData = ctx.createImageData(width, height);\n if (buffer) {\n imgData.data.set(new Uint8ClampedArray(buffer, 0, width * height * 4));\n }\n return imgData;\n }\n return buffer\n ? new ImageData(new Uint8ClampedArray(buffer, 0, width * height * 4), width, height)\n : new ImageData(width, height);\n }\n\n // drawing primitive - ImageBitmap\n public static createImageBitmap(img: ImageBitmapSource): Promise {\n if (typeof createImageBitmap !== 'function') {\n return Promise.resolve(undefined);\n }\n return createImageBitmap(img);\n }\n\n\n constructor(private _terminal: ITerminalExt) {\n super();\n this._oldOpen = this._terminal._core.open;\n this._terminal._core.open = (parent: HTMLElement): void => {\n this._oldOpen?.call(this._terminal._core, parent);\n this._open();\n };\n if (this._terminal._core.screenElement) {\n this._open();\n }\n // hack to spot fontSize changes\n this._optionsRefresh.value = this._terminal._core.optionsService.onOptionChange(option => {\n if (option === 'fontSize') {\n this.rescaleCanvas();\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n });\n this._register(toDisposable(() => {\n this.removeLayerFromDom();\n this.removeLayerFromDom('bottom');\n if (this._terminal._core && this._oldOpen) {\n this._terminal._core.open = this._oldOpen;\n this._oldOpen = undefined;\n }\n if (this._renderService && this._oldSetRenderer) {\n this._renderService.setRenderer = this._oldSetRenderer;\n this._oldSetRenderer = undefined;\n }\n this._renderService = undefined;\n this._layers.clear();\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }));\n }\n\n /**\n * Enable the placeholder.\n */\n public showPlaceholder(value: boolean): void {\n if (value) {\n if (!this._placeholder && this.cellSize.height !== -1) {\n this._createPlaceHolder(Math.max(this.cellSize.height + 1, Constants.PLACEHOLDER_HEIGHT));\n }\n } else {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n\n /**\n * Dimensions of the terminal.\n * Forwarded from internal render service.\n */\n public get dimensions(): IRenderDimensions | undefined {\n return this._terminal.dimensions;\n }\n\n /**\n * Current cell size (float).\n */\n public get cellSize(): ICellSize {\n return {\n width: this.dimensions?.css.cell.width || -1,\n height: this.dimensions?.css.cell.height || -1\n };\n }\n\n /**\n * Clear a region of the image layer canvas.\n */\n public clearLines(start: number, end: number, layer?: ImageLayer): void {\n const y = start * (this.dimensions?.css.cell.height || 0);\n const w = this.dimensions?.css.canvas.width || 0;\n const h = (end + 1 - start) * (this.dimensions?.css.cell.height || 0);\n if (!layer || layer === 'top') {\n this._layers.get('top')?.clearRect(0, y, w, h);\n }\n if (!layer || layer === 'bottom') {\n this._layers.get('bottom')?.clearRect(0, y, w, h);\n }\n }\n\n /**\n * Clear whole image canvas.\n */\n public clearAll(layer?: ImageLayer): void {\n if (!layer || layer === 'top') {\n const ctx = this._layers.get('top');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n if (!layer || layer === 'bottom') {\n const ctx = this._layers.get('bottom');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n }\n\n /**\n * Draw neighboring tiles on the image layer canvas.\n */\n public draw(imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get(imgSpec.layer);\n if (!ctx) {\n return;\n }\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const cols = Math.ceil(img.width / width);\n\n const sx = (tileId % cols) * width;\n const sy = Math.floor(tileId / cols) * height;\n const dx = col * width;\n const dy = row * height;\n\n // safari bug: never access image source out of bounds\n const finalWidth = count * width + sx > img.width ? img.width - sx : count * width;\n const finalHeight = sy + height > img.height ? img.height - sy : height;\n\n // Floor all pixel offsets to get stable tile mapping without any overflows.\n // Note: For not pixel perfect aligned cells like in the DOM renderer\n // this will move a tile slightly to the top/left (subpixel range, thus ignore it).\n // FIX #34: avoid striping on displays with pixelDeviceRatio != 1 by ceiling height and width\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.ceil(finalWidth), Math.ceil(finalHeight),\n Math.floor(dx), Math.floor(dy), Math.ceil(finalWidth), Math.ceil(finalHeight)\n );\n }\n\n /**\n * Extract a single tile from an image.\n */\n public extractTile(imgSpec: IImageSpec, tileId: number): HTMLCanvasElement | undefined {\n const { width, height } = this.cellSize;\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const cols = Math.ceil(img.width / width);\n const sx = (tileId % cols) * width;\n const sy = Math.floor(tileId / cols) * height;\n const finalWidth = width + sx > img.width ? img.width - sx : width;\n const finalHeight = sy + height > img.height ? img.height - sy : height;\n\n const canvas = ImageRenderer.createCanvas(this.document, finalWidth, finalHeight);\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.floor(finalWidth), Math.floor(finalHeight),\n 0, 0, Math.floor(finalWidth), Math.floor(finalHeight)\n );\n return canvas;\n }\n }\n\n /**\n * Draw a line with placeholder on the image layer canvas.\n */\n public drawPlaceholder(col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get('top');\n if (ctx) {\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n if (!this._placeholder) {\n this._createPlaceHolder(Math.max(height + 1, Constants.PLACEHOLDER_HEIGHT));\n } else if (height >= this._placeholder!.height) {\n this._createPlaceHolder(height + 1);\n }\n if (!this._placeholder) return;\n ctx.drawImage(\n this._placeholderBitmap ?? this._placeholder!,\n col * width,\n (row * height) % 2 ? 0 : 1, // needs %2 offset correction\n width * count,\n height,\n col * width,\n row * height,\n width * count,\n height\n );\n }\n }\n\n /**\n * Rescale image layer canvas if needed.\n * Checked once from `ImageStorage.render`.\n */\n public rescaleCanvas(): void {\n const w = this.dimensions?.css.canvas.width || 0;\n const h = this.dimensions?.css.canvas.height || 0;\n for (const ctx of this._layers.values()) {\n if (ctx.canvas.width !== w || ctx.canvas.height !== h) {\n ctx.canvas.width = w;\n ctx.canvas.height = h;\n }\n }\n }\n\n /**\n * Rescale image in storage if needed.\n */\n private _rescaleImage(spec: IImageSpec, currentWidth: number, currentHeight: number): void {\n if (currentWidth === spec.actualCellSize.width && currentHeight === spec.actualCellSize.height) {\n return;\n }\n const { width: originalWidth, height: originalHeight } = spec.origCellSize;\n if (currentWidth === originalWidth && currentHeight === originalHeight) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const canvas = ImageRenderer.createCanvas(\n this.document,\n Math.ceil(spec.orig!.width * currentWidth / originalWidth),\n Math.ceil(spec.orig!.height * currentHeight / originalHeight)\n );\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(spec.orig!, 0, 0, canvas.width, canvas.height);\n spec.actual = canvas;\n spec.actualCellSize.width = currentWidth;\n spec.actualCellSize.height = currentHeight;\n }\n }\n\n /**\n * Lazy init for the renderer.\n */\n private _open(): void {\n this._renderService = this._terminal._core._renderService;\n this._oldSetRenderer = this._renderService.setRenderer.bind(this._renderService);\n this._renderService.setRenderer = (renderer: any) => {\n for (const key of [...this._layers.keys()]) {\n this.removeLayerFromDom(key);\n }\n this._oldSetRenderer?.call(this._renderService, renderer);\n };\n }\n\n public insertLayerToDom(layer: ImageLayer = 'top'): void {\n // make sure that the terminal is attached to a document and to DOM\n if (!this.document || !this._terminal._core.screenElement) {\n console.warn('image addon: cannot insert output canvas to DOM, missing document or screenElement');\n return;\n }\n if (this._layers.has(layer)) {\n return;\n }\n const canvas = ImageRenderer.createCanvas(\n this.document, this.dimensions?.css.canvas.width || 0,\n this.dimensions?.css.canvas.height || 0\n );\n canvas.classList.add(`xterm-image-layer-${layer}`);\n const screenElement = this._terminal._core.screenElement;\n // Use isolation to create a stacking context without overriding z-index,\n // which would conflict with integrators (e.g. VS Code) that set their\n // own z-index on the screen element.\n screenElement.style.isolation = 'isolate';\n if (layer === 'bottom') {\n // Use z-index:-1 so it paints behind non-positioned text elements.\n // The screen element needs to be a stacking context (via isolation)\n // to contain the negative z-index, otherwise it would go behind the\n // entire terminal.\n canvas.style.zIndex = '-1';\n screenElement.insertBefore(canvas, screenElement.firstChild);\n } else {\n // Explicit z-index ensures the image canvas reliably stacks above\n // the text layer (DOM renderer rows). z-index: 0 is below the\n // selection overlay (z-index: 1).\n canvas.style.zIndex = '0';\n screenElement.appendChild(canvas);\n }\n const ctx = canvas.getContext('2d', { alpha: true });\n if (!ctx) {\n canvas.remove();\n return;\n }\n this._layers.set(layer, ctx);\n this.clearAll(layer);\n }\n\n public removeLayerFromDom(layer: ImageLayer = 'top'): void {\n const ctx = this._layers.get(layer);\n if (ctx) {\n ctx.canvas.remove();\n this._layers.delete(layer);\n }\n }\n\n public hasLayer(layer: ImageLayer): boolean {\n return this._layers.has(layer);\n }\n\n private _createPlaceHolder(height: number = Constants.PLACEHOLDER_HEIGHT): void {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n\n // create blueprint to fill placeholder with\n const bWidth = 32; // must be 2^n\n const blueprint = ImageRenderer.createCanvas(this.document, bWidth, height);\n const ctx = blueprint.getContext('2d', { alpha: false });\n if (!ctx) return;\n const imgData = ImageRenderer.createImageData(ctx, bWidth, height);\n const d32 = new Uint32Array(imgData.data.buffer);\n const black = toRGBA8888(0, 0, 0);\n const white = toRGBA8888(255, 255, 255);\n d32.fill(black);\n for (let y = 0; y < height; ++y) {\n const shift = y % 2;\n const offset = y * bWidth;\n for (let x = 0; x < bWidth; x += 2) {\n d32[offset + x + shift] = white;\n }\n }\n ctx.putImageData(imgData, 0, 0);\n\n // create placeholder line, width aligned to blueprint width\n const width = (screen.width + bWidth - 1) & ~(bWidth - 1) || Constants.PLACEHOLDER_LENGTH;\n this._placeholder = ImageRenderer.createCanvas(this.document, width, height);\n const ctx2 = this._placeholder.getContext('2d', { alpha: false });\n if (!ctx2) {\n this._placeholder = undefined;\n return;\n }\n for (let i = 0; i < width; i += bWidth) {\n ctx2.drawImage(blueprint, i, 0);\n }\n ImageRenderer.createImageBitmap(this._placeholder).then(bitmap => this._placeholderBitmap = bitmap);\n }\n\n public get document(): Document | undefined {\n return this._terminal._core._coreBrowserService?.window.document;\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageRenderer } from './ImageRenderer';\nimport {\n ITerminalExt, IExtendedAttrsImage, IImageAddonOptions, IImageSpec,\n IBufferLineExt, BgFlags, Cell, Content, ICellSize, ExtFlags, Attributes,\n UnderlineStyle, IAddImageOpts\n} from './Types';\n\n\n// fallback default cell size\nexport const CELL_SIZE_DEFAULT: ICellSize = {\n width: 7,\n height: 14\n};\n\n/**\n * Extend extended attribute to also hold image tile information.\n *\n * Object definition is copied from base repo to fully mimick its behavior.\n * Image data is added as additional public properties `imageId` and `tileId`.\n */\nclass ExtendedAttrsImage implements IExtendedAttrsImage {\n private _ext: number = 0;\n public get ext(): number {\n if (this._urlId) {\n return (\n (this._ext & ~ExtFlags.UNDERLINE_STYLE) |\n (this.underlineStyle << 26)\n );\n }\n return this._ext;\n }\n public set ext(value: number) { this._ext = value; }\n\n public get underlineStyle(): UnderlineStyle {\n // Always return the URL style if it has one\n if (this._urlId) {\n return UnderlineStyle.DASHED;\n }\n return (this._ext & ExtFlags.UNDERLINE_STYLE) >> 26;\n }\n public set underlineStyle(value: UnderlineStyle) {\n this._ext &= ~ExtFlags.UNDERLINE_STYLE;\n this._ext |= (value << 26) & ExtFlags.UNDERLINE_STYLE;\n }\n\n public get underlineColor(): number {\n return this._ext & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n public set underlineColor(value: number) {\n this._ext &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n this._ext |= value & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n\n public get underlineVariantOffset(): number {\n const val = (this._ext & ExtFlags.VARIANT_OFFSET) >> 29;\n if (val < 0) {\n return val ^ 0xFFFFFFF8;\n }\n return val;\n }\n public set underlineVariantOffset(value: number) {\n this._ext &= ~ExtFlags.VARIANT_OFFSET;\n this._ext |= (value << 29) & ExtFlags.VARIANT_OFFSET;\n }\n\n private _urlId: number = 0;\n public get urlId(): number {\n return this._urlId;\n }\n public set urlId(value: number) {\n this._urlId = value;\n }\n\n constructor(\n ext: number = 0,\n urlId: number = 0,\n public imageId = -1,\n public tileId = -1\n ) {\n this._ext = ext;\n this._urlId = urlId;\n }\n\n public clone(): IExtendedAttrsImage {\n /**\n * Technically we dont need a clone variant of ExtendedAttrsImage,\n * as we never clone a cell holding image data.\n * Note: Clone is only meant to be used by the InputHandler for\n * sticky attributes, which is never the case for image data.\n * We still provide a proper clone method to reflect the full ext attr\n * state in case there are future use cases for clone.\n */\n return new ExtendedAttrsImage(this._ext, this._urlId, this.imageId, this.tileId);\n }\n\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0 && this.imageId === -1;\n }\n}\nconst EMPTY_ATTRS = new ExtendedAttrsImage();\n\n\n/**\n * ImageStorage - extension of CoreTerminal:\n * - hold image data\n * - write/read image data to/from buffer\n *\n * TODO: image composition for overwrites\n */\nexport class ImageStorage implements IDisposable {\n // storage\n private _images: Map = new Map();\n // last used id\n private _lastId = 0;\n // last evicted id\n private _lowestId = 0;\n // whether a full clear happened before\n private _fullyCleared = false;\n // whether render should do a full clear\n private _needsFullClear = false;\n // hard limit of stored pixels (fallback limit of 10 MB)\n private _pixelLimit: number = 2500000;\n\n private _viewportMetrics: { cols: number, rows: number };\n public onImageAdded: (() => void) | undefined;\n public onImageDeleted: ((storageId: number) => void) | undefined;\n\n constructor(\n private _terminal: ITerminalExt,\n private _renderer: ImageRenderer,\n private _opts: IImageAddonOptions\n ) {\n try {\n this.setLimit(this._opts.storageLimit);\n } catch (e: unknown) {\n if (e instanceof Error) {\n console.error(e.message);\n }\n console.warn(`storageLimit is set to ${this.getLimit()} MB`);\n }\n this._viewportMetrics = {\n cols: this._terminal.cols,\n rows: this._terminal.rows\n };\n }\n\n public dispose(): void {\n this.reset();\n }\n\n public reset(): void {\n for (const spec of this._images.values()) {\n spec.marker?.dispose();\n }\n // NOTE: marker.dispose above already calls ImageBitmap.close\n // therefore we can just wipe the map here\n this._images.clear();\n this._renderer.clearAll();\n }\n\n public getLimit(): number {\n return this._pixelLimit * 4 / 1000000;\n }\n\n public setLimit(value: number): void {\n if (value < 0.5 || value > 1000) {\n throw RangeError('invalid storageLimit, should be at least 0.5 MB and not exceed 1G');\n }\n this._pixelLimit = (value / 4 * 1000000) >>> 0;\n this._evictOldest(0);\n }\n\n public getUsage(): number {\n return this._getStoredPixels() * 4 / 1000000;\n }\n\n private _getStoredPixels(): number {\n let storedPixels = 0;\n for (const spec of this._images.values()) {\n if (spec.orig) {\n storedPixels += spec.orig.width * spec.orig.height;\n if (spec.actual && spec.actual !== spec.orig) {\n storedPixels += spec.actual.width * spec.actual.height;\n }\n }\n }\n return storedPixels;\n }\n\n private _delImg(id: number): void {\n const spec = this._images.get(id);\n if (!spec) return;\n this._images.delete(id);\n // FIXME: really ugly workaround to get bitmaps deallocated :(\n if (window.ImageBitmap && spec.orig instanceof ImageBitmap) {\n spec.orig.close();\n }\n this.onImageDeleted?.(id);\n }\n\n /**\n * Wipe canvas and images on alternate buffer.\n */\n public wipeAlternate(): void {\n // remove all alternate tagged images\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate') {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n // mark canvas to be wiped on next render\n this._needsFullClear = true;\n this._fullyCleared = false;\n }\n\n /**\n * Delete an image by its internal storage ID.\n * Used by protocols that support explicit deletion (e.g. Kitty a=d).\n */\n public deleteImage(id: number): void {\n const spec = this._images.get(id);\n if (spec) {\n spec.marker?.dispose();\n this._delImg(id);\n }\n }\n\n /**\n * Method to add an image to the storage.\n * @param img - The image to add (canvas or bitmap).\n * @param opts - Options for addImage:\n * - scrolling: When true, cursor advances with the image.\n * When false, image is placed at ORIGIN and cursor does not move.\n * - layer: Which canvas layer to render on ('top' or 'bottom').\n * - zIndex: Z-index for image layering within the same layer.\n * - cursorPos: 'vt340' for bottom-left, 'iip' for bottom.right.\n * @returns The internal image ID assigned to the stored image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap, opts: IAddImageOpts): number {\n // never allow storage to exceed memory limit\n this._evictOldest(img.width * img.height);\n\n // calc rows x cols needed to display the image\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const cols = Math.ceil(img.width / cellSize.width);\n const rows = Math.ceil(img.height / cellSize.height);\n\n const imageId = ++this._lastId;\n\n const buffer = this._terminal._core.buffer;\n const termCols = this._terminal.cols;\n const termRows = this._terminal.rows;\n const originX = buffer.x;\n const originY = buffer.y;\n let offset = originX;\n let tileCount = 0;\n\n if (!opts.scrolling) {\n buffer.x = 0;\n buffer.y = 0;\n offset = 0;\n }\n\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(buffer.y + buffer.ybase);\n for (let col = 0; col < cols; ++col) {\n if (offset + col >= termCols) break;\n this._writeToCell(line as IBufferLineExt, offset + col, imageId, row * cols + col);\n tileCount++;\n }\n if (opts.scrolling) {\n if (row < rows - 1) this._terminal._core._inputHandler.lineFeed();\n } else {\n if (++buffer.y >= termRows) break;\n }\n buffer.x = offset;\n }\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n\n // cursor positioning modes\n if (opts.scrolling) {\n if (opts.cursorPos === 'iip') {\n buffer.x = Math.min(offset + cols, termCols);\n } else {\n buffer.x = offset;\n }\n } else {\n buffer.x = originX;\n buffer.y = originY;\n }\n\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.tileCount < 1) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n\n // eviction marker:\n // delete the image when the marker gets disposed\n const endMarker = this._terminal.registerMarker(0);\n endMarker?.onDispose(() => {\n const spec = this._images.get(imageId);\n if (spec) {\n this._delImg(imageId);\n }\n });\n\n // since markers do not work on alternate for some reason,\n // we evict images here manually\n if (this._terminal.buffer.active.type === 'alternate') {\n this._evictOnAlternate();\n }\n\n // create storage entry\n const imgSpec: IImageSpec = {\n orig: img,\n origCellSize: cellSize,\n actual: img,\n actualCellSize: { ...cellSize }, // clone needed, since later modified\n marker: endMarker || undefined,\n tileCount,\n bufferType: this._terminal.buffer.active.type,\n layer: opts.layer,\n zIndex: opts.zIndex\n };\n\n // finally add the image\n this._images.set(imageId, imgSpec);\n this.onImageAdded?.();\n return imageId;\n }\n\n\n /**\n * Render method. Collects buffer information and triggers\n * canvas updates.\n */\n // TODO: Should we move this to the ImageRenderer?\n public render(range: { start: number, end: number }): void {\n // Determine which layers have images\n let hasTopImages = false;\n let hasBottomImages = false;\n for (const spec of this._images.values()) {\n if (spec.layer === 'bottom') {\n hasBottomImages = true;\n } else {\n hasTopImages = true;\n }\n if (hasTopImages && hasBottomImages) break;\n }\n\n // Lazily insert layers that are needed\n if (hasTopImages && !this._renderer.hasLayer('top')) {\n this._renderer.insertLayerToDom('top');\n if (!this._renderer.hasLayer('top')) return;\n }\n if (hasBottomImages && !this._renderer.hasLayer('bottom')) {\n this._renderer.insertLayerToDom('bottom');\n }\n\n // rescale if needed\n this._renderer.rescaleCanvas();\n\n // exit early if we dont have any images to test for\n if (!this._images.size) {\n if (!this._fullyCleared) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n if (this._renderer.hasLayer('top')) {\n this._renderer.removeLayerFromDom('top');\n }\n if (this._renderer.hasLayer('bottom')) {\n this._renderer.removeLayerFromDom('bottom');\n }\n return;\n }\n\n // Remove layers no longer needed\n if (!hasTopImages && this._renderer.hasLayer('top')) {\n this._renderer.clearAll('top');\n this._renderer.removeLayerFromDom('top');\n }\n if (!hasBottomImages && this._renderer.hasLayer('bottom')) {\n this._renderer.clearAll('bottom');\n this._renderer.removeLayerFromDom('bottom');\n }\n\n // buffer switches force a full clear\n if (this._needsFullClear) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n\n const { start, end } = range;\n const buffer = this._terminal._core.buffer;\n const cols = this._terminal._core.cols;\n\n // clear drawing area\n this._renderer.clearLines(start, end);\n\n // Collect draw calls so we can sort by z-index (lower z drawn first).\n const drawCalls: { imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number }[] = [];\n const placeholderCalls: { col: number, row: number, count: number }[] = [];\n\n // walk all cells in viewport and collect tiles found\n for (let row = start; row <= end; ++row) {\n const line = buffer.lines.get(row + buffer.ydisp) as IBufferLineExt;\n if (!line) return;\n for (let col = 0; col < cols; ++col) {\n if (line.getBg(col) & BgFlags.HAS_EXTENDED) {\n let e: IExtendedAttrsImage = line._extendedAttrs[col] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (e.tileId !== -1) {\n const startTile = e.tileId;\n const startCol = col;\n let count = 1;\n /**\n * merge tiles to the right into a single draw call, if:\n * - not at end of line\n * - cell has same image id\n * - cell has consecutive tile id\n */\n while (\n ++col < cols\n && (line.getBg(col) & BgFlags.HAS_EXTENDED)\n && (e = line._extendedAttrs[col] ?? EMPTY_ATTRS)\n && (e.imageId === imageId)\n && (e.tileId === startTile + count)\n ) {\n count++;\n }\n col--;\n if (imgSpec) {\n if (imgSpec.actual) {\n drawCalls.push({ imgSpec, tileId: startTile, col: startCol, row, count });\n }\n } else if (this._opts.showPlaceholder) {\n placeholderCalls.push({ col: startCol, row, count });\n }\n this._fullyCleared = false;\n }\n }\n }\n }\n\n // Sort by z-index so lower z draws first (higher z renders on top)\n drawCalls.sort((a, b) => a.imgSpec.zIndex - b.imgSpec.zIndex);\n\n // Draw placeholders first (lowest priority)\n for (const call of placeholderCalls) {\n this._renderer.drawPlaceholder(call.col, call.row, call.count);\n }\n\n // Draw images in z-index order\n for (const call of drawCalls) {\n this._renderer.draw(call.imgSpec, call.tileId, call.col, call.row, call.count);\n }\n }\n\n public viewportResize(metrics: { cols: number, rows: number }): void {\n // exit early if we have nothing in storage\n if (!this._images.size) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // handle only viewport width enlargements, exit all other cases\n // TODO: needs patch for tile counter\n if (this._viewportMetrics.cols >= metrics.cols) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // walk scrollbuffer at old col width to find all possible expansion matches\n const buffer = this._terminal._core.buffer;\n const rows = buffer.lines.length;\n const oldCol = this._viewportMetrics.cols - 1;\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(row) as IBufferLineExt;\n if (line.getBg(oldCol) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[oldCol] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (!imgSpec) {\n continue;\n }\n // found an image tile at oldCol, check if it qualifies for right exapansion\n const tilesPerRow = Math.ceil((imgSpec.actual?.width || 0) / imgSpec.actualCellSize.width);\n if ((e.tileId % tilesPerRow) + 1 >= tilesPerRow) {\n continue;\n }\n // expand only if right side is empty (nothing got wrapped from below)\n let hasData = false;\n for (let rightCol = oldCol + 1; rightCol > metrics.cols; ++rightCol) {\n if (line._data[rightCol * Cell.SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK) {\n hasData = true;\n break;\n }\n }\n if (hasData) {\n continue;\n }\n // do right expansion on terminal buffer\n const end = Math.min(metrics.cols, tilesPerRow - (e.tileId % tilesPerRow) + oldCol);\n let lastTile = e.tileId;\n for (let expandCol = oldCol + 1; expandCol < end; ++expandCol) {\n this._writeToCell(line as IBufferLineExt, expandCol, imageId, ++lastTile);\n imgSpec.tileCount++;\n }\n }\n }\n // store new viewport metrics\n this._viewportMetrics = metrics;\n }\n\n /**\n * Retrieve original canvas at buffer position.\n */\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1) {\n const orig = this._images.get(e.imageId)?.orig;\n if (window.ImageBitmap && orig instanceof ImageBitmap) {\n const canvas = ImageRenderer.createCanvas(window.document, orig.width, orig.height);\n canvas.getContext('2d')?.drawImage(orig, 0, 0, orig.width, orig.height);\n return canvas;\n }\n return orig as HTMLCanvasElement;\n }\n }\n }\n\n /**\n * Extract active single tile at buffer position.\n */\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1 && e.tileId !== -1) {\n const spec = this._images.get(e.imageId);\n if (spec) {\n return this._renderer.extractTile(spec, e.tileId);\n }\n }\n }\n }\n\n // TODO: Do we need some blob offloading tricks here to avoid early eviction?\n // also see https://stackoverflow.com/questions/28307789/is-there-any-limitation-on-javascript-max-blob-size\n private _evictOldest(room: number): number {\n const used = this._getStoredPixels();\n let current = used;\n while (this._pixelLimit < current + room && this._images.size) {\n const spec = this._images.get(++this._lowestId);\n if (spec && spec.orig) {\n current -= spec.orig.width * spec.orig.height;\n if (spec.actual && spec.orig !== spec.actual) {\n current -= spec.actual.width * spec.actual.height;\n }\n spec.marker?.dispose();\n this._delImg(this._lowestId);\n }\n }\n return used - current;\n }\n\n private _writeToCell(line: IBufferLineExt, x: number, imageId: number, tileId: number): void {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const old = line._extendedAttrs[x];\n if (old) {\n if (old.imageId !== undefined) {\n // found an old ExtendedAttrsImage, since we know that\n // they are always isolated instances (single cell usage),\n // we can re-use it and just update their id entries\n const oldSpec = this._images.get(old.imageId);\n if (oldSpec) {\n // early eviction for in-viewport overwrites\n oldSpec.tileCount--;\n }\n old.imageId = imageId;\n old.tileId = tileId;\n return;\n }\n // found a plain ExtendedAttrs instance, clone it to new entry\n line._extendedAttrs[x] = new ExtendedAttrsImage(old.ext, old.urlId, imageId, tileId);\n return;\n }\n }\n // fall-through: always create new ExtendedAttrsImage entry\n line._data[x * Cell.SIZE + Cell.BG] |= BgFlags.HAS_EXTENDED;\n line._extendedAttrs[x] = new ExtendedAttrsImage(0, 0, imageId, tileId);\n }\n\n private _evictOnAlternate(): void {\n // nullify tile count of all images on alternate buffer\n for (const spec of this._images.values()) {\n if (spec.bufferType === 'alternate') {\n spec.tileCount = 0;\n }\n }\n // re-count tiles on whole buffer\n const buffer = this._terminal._core.buffer;\n for (let y = 0; y < this._terminal.rows; ++y) {\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (!line) {\n continue;\n }\n for (let x = 0; x < this._terminal.cols; ++x) {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const imgId = line._extendedAttrs[x]?.imageId;\n if (imgId) {\n const spec = this._images.get(imgId);\n if (spec) {\n spec.tileCount++;\n }\n }\n }\n }\n }\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate' && !spec.tileCount) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IImageAddonOptions, IOscHandler, IResetHandler, ITerminalExt } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { CELL_SIZE_DEFAULT } from './ImageStorage';\nimport Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport QoiDecoder from 'xterm-wasm-parts/lib/qoi/QoiDecoder.wasm';\nimport { HeaderParser, IHeaderFields, HeaderState, SequenceType } from './IIPHeaderParser';\nimport { imageType, UNSUPPORTED_TYPE } from './IIPMetrics';\n\n// Local const enum mirror - esbuild can't inline const enums from external packages\nconst enum DecoderConst {\n // Limit held memory in base64 decoder (encoded bytes).\n KEEP_DATA = 4194304,\n // Initial buffer allocation for the decoder.\n INITIAL_DATA = 1048576,\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n OK = 0\n}\n\n// default IIP header values\nconst DEFAULT_HEADER: IHeaderFields = {\n type: SequenceType.INVALID,\n name: 'Unnamed file',\n size: 0,\n width: 'auto',\n height: 'auto',\n preserveAspectRatio: 1,\n inline: 0\n};\n\n\nexport class IIPHandler implements IOscHandler, IResetHandler {\n private _aborted = false;\n private _hp = new HeaderParser();\n private _header: IHeaderFields = DEFAULT_HEADER;\n private _dec: Base64Decoder;\n private _qoiDec: QoiDecoder;\n private _isMultipart = false;\n private _abortMulti = false;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _storage: IIPImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n const maxEncodedBytes = Math.ceil(this._opts.iipSizeLimit * 4 / 3);\n const initialBytes = Math.min(DecoderConst.INITIAL_DATA, maxEncodedBytes);\n this._dec = new Base64Decoder(DecoderConst.KEEP_DATA, maxEncodedBytes, initialBytes);\n this._qoiDec = new QoiDecoder(DecoderConst.KEEP_DATA);\n }\n\n public reset(): void {\n this._hp.reset();\n this._dec.release();\n this._qoiDec.release();\n }\n\n public start(): void {\n this._aborted = false;\n this._hp.reset();\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (this._hp.state === HeaderState.END) {\n if ((this._dec.put(data.subarray(start, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n }\n } else {\n const dataPos = this._hp.parse(data, start, end);\n if (dataPos === -1) {\n this._aborted = true;\n return;\n }\n if (dataPos > 0) {\n const seqType = this._hp.fields.type;\n if (seqType === SequenceType.FILE) {\n if (this._isMultipart) {\n this._isMultipart = false;\n this._abortMulti = false;\n this._dec.release();\n }\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n if (!this._header.inline) {\n this._aborted = true;\n return;\n }\n this._dec.init();\n } else if (this._abortMulti) {\n this._aborted = true;\n return;\n }\n if ((this._dec.put(data.subarray(dataPos, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n if (this._isMultipart) this._abortMulti = true;\n }\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted) return true;\n\n if (this._hp.state !== HeaderState.END) {\n if (this._hp.end()) return true;\n }\n const seqType = this._hp.fields.type;\n\n if (seqType === SequenceType.FILEPART) return true;\n\n if (seqType === SequenceType.REPORTCELLSIZE) {\n // OSC 1337 ; ReportCellSize=[height];[width];[scale] ST\n let w = CELL_SIZE_DEFAULT.width;\n let h = CELL_SIZE_DEFAULT.height;\n if (this._renderer.dimensions) {\n w = this._renderer.dimensions.css.canvas.width / this._coreTerminal.cols;\n h = this._renderer.dimensions.css.canvas.height / this._coreTerminal.rows;\n }\n const scale = this._coreTerminal._core._coreBrowserService?.dpr ?? 1;\n const report = `\\x1b]1337;ReportCellSize=${h.toFixed(3)};${w.toFixed(3)};${scale.toFixed(3)}\\x1b\\\\`;\n this._coreTerminal.input(report, false);\n return true;\n }\n\n if (seqType === SequenceType.MULTIPARTFILE) {\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n this._isMultipart = true;\n this._abortMulti = false;\n this._dec.release();\n this._dec.init();\n return true;\n }\n\n if (seqType === SequenceType.FILEEND) {\n if (!this._isMultipart) return true;\n this._isMultipart = false;\n if (this._abortMulti || this._header.type !== SequenceType.MULTIPARTFILE) return true;\n }\n\n // fallthrough for SequenceType.FILE & SequenceType.FILEEND\n\n let w = 0;\n let h = 0;\n\n // early exit condition chain\n let cond: number | boolean;\n let metrics = UNSUPPORTED_TYPE;\n if (cond = success) {\n if (cond = !this._dec.end()) {\n metrics = imageType(this._dec.data8);\n if (cond = metrics.mime !== 'unsupported') {\n w = metrics.width;\n h = metrics.height;\n if (cond = w && h && w * h < this._opts.pixelLimit) {\n [w, h] = this._resize(w, h).map(Math.floor);\n cond = w && h && w * h < this._opts.pixelLimit;\n } else {\n console.warn(`IIP: image dimension issue ${metrics.width}x${metrics.height}`);\n }\n } else {\n console.warn('IIP: unsupported image type');\n }\n } else {\n console.warn('IIP: error during BASE64 decoding');\n }\n }\n if (!cond) {\n this._dec.release();\n return true;\n }\n\n let blob: Blob | ImageData;\n if (metrics.mime === 'image/qoi') {\n const data = this._qoiDec.decode(this._dec.data8);\n blob = new ImageData(\n new Uint8ClampedArray(data.buffer, data.byteOffset, data.byteLength),\n this._qoiDec.width,\n this._qoiDec.height\n );\n this._qoiDec.release();\n if (w === this._qoiDec.width && h === this._qoiDec.height) {\n // use fast-path if we don't need to rescale\n this._dec.release();\n const canvas = ImageRenderer.createCanvas(undefined, this._qoiDec.width, this._qoiDec.height);\n canvas.getContext('2d')?.putImageData(blob, 0, 0);\n this._storage.addImage(canvas);\n return true;\n }\n } else {\n blob = new Blob([this._dec.data8], { type: metrics.mime });\n }\n this._dec.release();\n return createImageBitmap(blob, { resizeWidth: w, resizeHeight: h })\n .then(bm => {\n this._storage.addImage(bm);\n return true;\n })\n .catch(e => {\n console.warn(`IIP: decoding error ${metrics.mime} ${metrics.width}x${metrics.height}`, e);\n return true;\n });\n }\n\n private _resize(w: number, h: number): [number, number] {\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n const width = this._renderer.dimensions?.css.canvas.width || cw * this._coreTerminal.cols;\n const height = this._renderer.dimensions?.css.canvas.height || ch * this._coreTerminal.rows;\n\n const rw = this._dim(this._header.width!, width, cw);\n const rh = this._dim(this._header.height!, height, ch);\n if (!rw && !rh) {\n const wf = width / w; // TODO: should this respect initial cursor offset?\n const hf = (height - ch) / h; // TODO: fix offset issues from float cell height\n const f = Math.min(wf, hf);\n return f < 1 ? [w * f, h * f] : [w, h];\n }\n return !rw\n ? [w * rh / h, rh]\n : this._header.preserveAspectRatio || !rw || !rh\n ? [rw, h * rw / w] : [rw, rh];\n }\n\n private _dim(s: string, total: number, cdim: number): number {\n if (s === 'auto') return 0;\n if (s.endsWith('%')) return parseInt(s.slice(0, -1), 10) * total / 100;\n if (s.endsWith('px')) return parseInt(s.slice(0, -2), 10);\n return parseInt(s, 10) * cdim;\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// eslint-disable-next-line\ndeclare const Buffer: any;\n\nexport const enum HeaderState {\n START = 0,\n ABORT = 1,\n KEY = 2,\n VALUE = 3,\n END = 4\n}\n\nexport const enum SequenceType {\n INVALID = 0,\n FILE = 1,\n MULTIPARTFILE = 2,\n FILEPART = 3,\n FILEEND = 4,\n REPORTCELLSIZE = 5\n}\n\nexport interface IHeaderFields {\n [key: string]: number | string | Uint32Array | null | undefined;\n // sequence type\n type: SequenceType;\n // base-64 encoded filename. Defaults to \"Unnamed file\".\n name: string;\n // File size in bytes. The file transfer will be canceled if this size is exceeded.\n size: number;\n /**\n * Optional width and height to render:\n * - N: N character cells.\n * - Npx: N pixels.\n * - N%: N percent of the session's width or height.\n * - auto: The image's inherent size will be used to determine an appropriate dimension.\n */\n width?: string;\n height?: string;\n // Optional, defaults to 1 respecting aspect ratio (width takes precedence).\n preserveAspectRatio?: number;\n // Optional, defaults to 0. If set to 1, the file will be displayed inline, else downloaded\n // (download not supported).\n inline?: number;\n}\n\n// field value decoders\n\n// ASCII bytes to string\nfunction toStr(data: Uint32Array): string {\n let s = '';\n for (let i = 0; i < data.length; ++i) {\n s += String.fromCharCode(data[i]);\n }\n return s;\n}\n\n// digits to integer\nfunction toInt(data: Uint32Array): number {\n let v = 0;\n for (let i = 0; i < data.length; ++i) {\n if (data[i] < 48 || data[i] > 57) {\n throw new Error('illegal char');\n }\n v = v * 10 + data[i] - 48;\n }\n return v;\n}\n\n// check for correct size entry\nfunction toSize(data: Uint32Array): string {\n const v = toStr(data);\n if (!v.match(/^((auto)|(\\d+?((px)|(%)){0,1}))$/)) {\n throw new Error('illegal size');\n }\n return v;\n}\n\n// name is base64 encoded utf-8\nfunction toName(data: Uint32Array): string {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(toStr(data), 'base64').toString();\n }\n const bs = atob(toStr(data));\n const b = new Uint8Array(bs.length);\n for (let i = 0; i < b.length; ++i) {\n b[i] = bs.charCodeAt(i);\n }\n return new TextDecoder().decode(b);\n}\n\nconst DECODERS: {[key: string]: (v: Uint32Array) => number | string} = {\n inline: toInt,\n size: toInt,\n name: toName,\n width: toSize,\n height: toSize,\n preserveAspectRatio: toInt\n};\n\n\n// sequence type markers\n// File\nconst FILE_MARKER = [70, 105, 108, 101];\n// MultipartFile\nconst MULTIPARTFILE_MARKER = [77, 117, 108, 116, 105, 112, 97, 114, 116, 70, 105, 108, 101];\n// FilePart\nconst FILEPART_MARKER = [70, 105, 108, 101, 80, 97, 114, 116];\n// FileEnd\nconst FILEEND_MARKER = [70, 105, 108, 101, 69, 110, 100];\n// ReportCellSize\nconst REPORTCELLSIZE_MARKER = [82, 101, 112, 111, 114, 116, 67, 101, 108, 108, 83, 105, 122, 101];\n\n// max allowed chars for sequence header\nconst MAX_FIELDCHARS = 1024;\n\n\nexport class HeaderParser {\n public state: HeaderState = HeaderState.START;\n private _buffer = new Uint32Array(MAX_FIELDCHARS);\n private _position = 0;\n private _key = '';\n public fields: {[key: string]: number | string | Uint32Array | null | undefined} = {};\n\n public reset(): void {\n this._buffer.fill(0);\n this.state = HeaderState.START;\n this._position = 0;\n this.fields = {};\n this._key = '';\n }\n\n public end(): number {\n if (this.state === HeaderState.START) {\n if (this._position === FILEEND_MARKER.length) {\n for (let k = 0; k < FILEEND_MARKER.length; ++k) {\n if (this._buffer[k] !== FILEEND_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEEND;\n this.state = HeaderState.END;\n return 0;\n }\n if (this._position === REPORTCELLSIZE_MARKER.length) {\n for (let k = 0; k < REPORTCELLSIZE_MARKER.length; ++k) {\n if (this._buffer[k] !== REPORTCELLSIZE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.REPORTCELLSIZE;\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n if (this.state === HeaderState.END) return 0;\n if (this.state === HeaderState.VALUE\n && this.fields.type === SequenceType.MULTIPARTFILE\n ) {\n if (!this._storeValue(this._position)) return this._a();\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n\n public parse(data: Uint32Array, start: number, end: number): number {\n let state = this.state;\n let pos = this._position;\n const buffer = this._buffer;\n if (state === HeaderState.ABORT || state === HeaderState.END) return -1;\n if (state === HeaderState.START && pos > 14) return -1;\n for (let i = start; i < end; ++i) {\n const c = data[i];\n switch (c) {\n case 59: // ;\n if (!this._storeValue(pos)) return this._a();\n state = HeaderState.KEY;\n pos = 0;\n break;\n case 61: // =\n if (state === HeaderState.START) {\n if (buffer[0] === 70) {\n // 'File' or 'FilePart'\n let k = 0;\n for (; k < FILE_MARKER.length; ++k) {\n if (buffer[k] !== FILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILE;\n if (pos === FILEPART_MARKER.length) {\n for (; k < FILEPART_MARKER.length; ++k) {\n if (buffer[k] !== FILEPART_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEPART;\n this.state = HeaderState.END;\n return i + 1;\n }\n } else if (buffer[0] === 77) {\n // 'MultipartFile'\n for (let k = 0; k < MULTIPARTFILE_MARKER.length; ++k) {\n if (buffer[k] !== MULTIPARTFILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.MULTIPARTFILE;\n } else {\n return this._a();\n }\n state = HeaderState.KEY;\n pos = 0;\n } else if (state === HeaderState.KEY) {\n if (!this._storeKey(pos)) return this._a();\n state = HeaderState.VALUE;\n pos = 0;\n } else if (state === HeaderState.VALUE) {\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n break;\n case 58: // :\n if (state === HeaderState.VALUE) {\n if (!this._storeValue(pos)) return this._a();\n }\n this.state = HeaderState.END;\n return i + 1;\n default:\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n }\n this.state = state;\n this._position = pos;\n return -2;\n }\n\n private _a(): number {\n this.fields.type = SequenceType.INVALID;\n this.state = HeaderState.ABORT;\n return -1;\n }\n\n private _storeKey(pos: number): boolean {\n const k = toStr(this._buffer.subarray(0, pos));\n if (k) {\n this._key = k;\n this.fields[k] = null;\n return true;\n }\n return false;\n }\n\n private _storeValue(pos: number): boolean {\n if (this._key) {\n try {\n const v = this._buffer.slice(0, pos);\n this.fields[this._key] = DECODERS[this._key] ? DECODERS[this._key](v) : v;\n } catch {\n return false;\n }\n return true;\n }\n return false;\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n\nexport type ImageType = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/qoi' | 'image/webp' | 'image/avif' | 'unsupported' | '';\n\nexport interface IMetrics {\n mime: ImageType;\n width: number;\n height: number;\n}\n\nexport const UNSUPPORTED_TYPE: IMetrics = {\n mime: 'unsupported',\n width: 0,\n height: 0\n};\n\nexport function imageType(d: Uint8Array): IMetrics {\n if (d.length < 32) {\n return UNSUPPORTED_TYPE;\n }\n const d32 = new Uint32Array(d.buffer, d.byteOffset, 8);\n // PNG: 89 50 4E 47 0D 0A 1A 0A (8 first bytes == magic number for PNG)\n // + first chunk must be IHDR\n if (d32[0] === 0x474E5089 && d32[1] === 0x0A1A0A0D && d32[3] === 0x52444849) {\n return {\n mime: 'image/png',\n width: d[16] << 24 | d[17] << 16 | d[18] << 8 | d[19],\n height: d[20] << 24 | d[21] << 16 | d[22] << 8 | d[23]\n };\n }\n // JPEG: FF D8 FF\n if (d[0] === 0xFF && d[1] === 0xD8 && d[2] === 0xFF) {\n const [width, height] = jpgSize(d);\n return { mime: 'image/jpeg', width, height };\n }\n // GIF: GIF87a or GIF89a\n if (d32[0] === 0x38464947 && (d[4] === 0x37 || d[4] === 0x39) && d[5] === 0x61) {\n return {\n mime: 'image/gif',\n width: d[7] << 8 | d[6],\n height: d[9] << 8 | d[8]\n };\n }\n // QOI: qoif\n if (d32[0] === 0x66696F71) {\n return {\n mime: 'image/qoi',\n width: d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7],\n height: d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11]\n };\n }\n // WEBP: RIFF | xxxx | WEBP | VP8x\n if (d32[0] === 0x46464952 && d32[2] === 0x50424557 && (d32[3] & 0xFFFFFF) === 0x385056) {\n switch (d[15]) {\n case 0x58: // Extended WebP VP8X --> \"X\"\n return {\n mime: 'image/webp',\n width: (d[24] | d[25] << 8 | d[26] << 16) + 1,\n height: (d[27] | d[28] << 8 | d[29] << 16) + 1\n };\n case 0x4C: // Lossless WebP VP8L --> \"L\"\n if (d[20] !== 0x2f) return UNSUPPORTED_TYPE;\n const dim = d[21] | d[22] << 8 | d[23] << 16 | d[24] << 24;\n return {\n mime: 'image/webp',\n width: (dim & 0x3FFF) + 1,\n height: (dim >>> 14 & 0x3FFF) + 1\n };\n case 0x20: // Lossy WebP VP8 --> \" \"\n if (d[23] !== 0x9d || d[24] !== 0x01 || d[25] !== 0x2a) return UNSUPPORTED_TYPE;\n return {\n mime: 'image/webp',\n width: (d[26] | d[27] << 8) & 0x3FFF,\n height: (d[28] | d[29] << 8) & 0x3FFF\n };\n }\n return UNSUPPORTED_TYPE;\n }\n // AVIF: Box size | ftyp | avif/avis\n if (d32[1] === 0x70797466 && (d32[2] === 0x66697661 || d32[2] === 0x73697661)) {\n let pos = -1;\n // search for ispe box within first 1024 bytes\n const limit = Math.min(d.length - 16, 1024);\n for (let i = 8; i < limit; i++) {\n // scan for ispe\n if (d[i] === 0x69 && d[i + 1] === 0x73 && d[i + 2] === 0x70 && d[i + 3] === 0x65) {\n pos = i;\n break;\n }\n }\n if (pos !== -1) {\n // dimensions are in BE at +8 (width) at +12 (height)\n const width =\n d[pos + 8] << 24 |\n d[pos + 9] << 16 |\n d[pos + 10] << 8 |\n d[pos + 11];\n const height =\n d[pos + 12] << 24 |\n d[pos + 13] << 16 |\n d[pos + 14] << 8 |\n d[pos + 15];\n if (width > 0 && height > 0) {\n return { mime: 'image/avif', width, height };\n }\n }\n return UNSUPPORTED_TYPE;\n }\n return UNSUPPORTED_TYPE;\n}\n\n\nfunction jpgSize(d: Uint8Array): [number, number] {\n const len = d.length;\n let i = 4;\n let blockLength = d[i] << 8 | d[i + 1];\n while (true) {\n i += blockLength;\n if (i >= len) {\n // exhausted without size info\n return [0, 0];\n }\n if (d[i] !== 0xFF) {\n return [0, 0];\n }\n if (d[i + 1] === 0xC0 || d[i + 1] === 0xC2) {\n if (i + 8 < len) {\n return [\n d[i + 7] << 8 | d[i + 8],\n d[i + 5] << 8 | d[i + 6]\n ];\n }\n return [0, 0];\n }\n i += 2;\n blockLength = d[i] << 8 | d[i + 1];\n }\n}\n", "/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { IApcHandler, IImageAddonOptions, IResetHandler, ITerminalExt, ImageLayer } from '../Types';\nimport { ImageRenderer } from '../ImageRenderer';\nimport { CELL_SIZE_DEFAULT } from '../ImageStorage';\nimport { KittyImageStorage } from './KittyImageStorage';\nimport Base64Decoder, { type DecodeStatus } from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport {\n KittyAction,\n KittyFormat,\n KittyCompression,\n IKittyCommand,\n IPendingTransmission,\n IKittyImageData,\n KittyPixelConstants,\n parseKittyCommand\n} from './KittyGraphicsTypes';\n\nconst enum Constants {\n // Memory limit for base64 decoder (4MB, same as IIPHandler)\n DECODER_KEEP_DATA = 4194304,\n DECODER_INITIAL_DATA = 4194304, // 4MB\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n DECODER_OK = 0,\n // Maximum control data size\n MAX_CONTROL_DATA_SIZE = 512,\n // Semicolon codepoint\n SEMICOLON = 0x3B\n}\n\nconst DECODER_OK = Constants.DECODER_OK as unknown as DecodeStatus.OK;\n\n// Kitty graphics protocol handler with streaming base64 decoding.\nexport class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDisposable {\n private _aborted = false;\n private _decodeError = false;\n\n private _activeDecoder: Base64Decoder | null = null;\n private readonly _maxEncodedBytes: number;\n private readonly _initialEncodedBytes: number;\n\n // Streaming related states\n\n // True while receiving control data (before semicolon).\n private _inControlData = true;\n\n // Buffer for control data.\n private _controlData = new Uint32Array(Constants.MAX_CONTROL_DATA_SIZE);\n private _controlLength = 0;\n\n // Pre-calculated encoded size limit\n private _encodedSizeLimit = 0;\n private _totalEncodedSize = 0;\n\n // Parsed command. These are the control data before semicolon.\n private _parsedCommand: IKittyCommand | null = null;\n\n // Storage related states\n\n private _pendingTransmissions: Map = new Map();\n // Tracks the pending key of the most recently started chunked upload.\n // Per spec, subsequent chunks only need m= (and optionally q=), without i=.\n // When a chunk arrives with no i=, this key is used to find the pending upload.\n private _lastPendingKey: number | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _kittyStorage: KittyImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n // Convert decoded size limit -> max encoded bytes.\n this._maxEncodedBytes = Math.ceil(this._opts.kittySizeLimit * 4 / 3);\n // ensure we preallocate more than configured limit while using 4mb initial size.\n this._initialEncodedBytes = Math.min(Constants.DECODER_INITIAL_DATA, this._maxEncodedBytes);\n }\n\n public reset(): void {\n this._cleanupAllPending();\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n this._kittyStorage.reset();\n }\n\n public dispose(): void {\n this.reset();\n }\n\n private _removePendingEntry(key: number): void {\n this._pendingTransmissions.delete(key);\n if (this._lastPendingKey === key) {\n this._lastPendingKey = undefined;\n }\n }\n\n private _cleanupAllPending(): void {\n for (const pending of this._pendingTransmissions.values()) {\n pending.decoder.release();\n }\n this._pendingTransmissions.clear();\n this._lastPendingKey = undefined;\n }\n\n public start(): void {\n this._aborted = false;\n this._decodeError = false;\n this._inControlData = true;\n this._controlLength = 0;\n this._parsedCommand = null;\n // Pre-calculate encoded limit once: base64 is 4 bytes encoded \u2192 3 bytes decoded\n this._encodedSizeLimit = this._maxEncodedBytes;\n this._totalEncodedSize = 0;\n this._activeDecoder = null;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (!this._inControlData) {\n this._streamPayload(data, start, end);\n } else {\n // Scan for semicolon\n let controlEnd = end;\n for (let i = start; i < end; i++) {\n if (data[i] === Constants.SEMICOLON) {\n this._inControlData = false;\n controlEnd = i;\n break;\n }\n }\n\n // Copy control data\n const copyLength = controlEnd - start;\n if (this._controlLength + copyLength > Constants.MAX_CONTROL_DATA_SIZE) {\n this._aborted = true;\n return;\n }\n this._controlData.set(data.subarray(start, controlEnd), this._controlLength);\n this._controlLength += copyLength;\n\n if (!this._inControlData) {\n // Found semicolon - parse control data early for validation\n this._parsedCommand = parseKittyCommand(this._parseControlDataString());\n\n // Early validation: i+I conflict\n if (this._parsedCommand.id !== undefined && this._parsedCommand.imageNumber !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'EINVAL:cannot specify both i and I keys', this._parsedCommand.quiet ?? 0);\n this._aborted = true;\n return;\n }\n\n // Delete action doesn't need payload - skip streaming\n if (this._parsedCommand.action === KittyAction.DELETE) {\n return;\n }\n\n // Stream remaining as payload\n const payloadStart = controlEnd + 1;\n if (payloadStart < end) {\n this._streamPayload(data, payloadStart, end);\n }\n }\n }\n }\n\n // Stream payload bytes into the base64 decoder.\n private _streamPayload(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n // Check size limit (compare encoded bytes against pre-calculated limit)\n // Include cumulative size from pending transmission for multi-chunk images.\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = this._parsedCommand?.id ?? this._lastPendingKey ?? 0;\n const pending = this._pendingTransmissions.get(pendingKey);\n const previousEncodedSize = pending?.totalEncodedSize ?? 0;\n this._totalEncodedSize += end - start;\n const cumulativeEncodedSize = previousEncodedSize + this._totalEncodedSize;\n if (cumulativeEncodedSize > this._encodedSizeLimit) {\n const decoderToRelease = this._activeDecoder ?? pending?.decoder;\n if (decoderToRelease) {\n decoderToRelease.release();\n }\n this._activeDecoder = null;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n this._aborted = true;\n return;\n }\n\n if (this._decodeError) return;\n\n if (pending?.decoder && !this._activeDecoder) {\n this._activeDecoder = pending.decoder;\n }\n if (!this._activeDecoder) {\n this._activeDecoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes);\n this._activeDecoder.init();\n }\n\n if (this._activeDecoder.put(data.subarray(start, end)) !== DECODER_OK) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n this._decodeError = true;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted || !success) {\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n return true;\n }\n\n // No semicolon = no payload (delete, capability query)\n if (this._inControlData) {\n return this._handleNoPayloadCommand();\n }\n\n // Use command parsed early in put() - i+I already validated there\n const cmd = this._parsedCommand!;\n\n // Delete action was handled by skipping payload - just execute\n if (cmd.action === KittyAction.DELETE) {\n return this._handleDelete(cmd);\n }\n\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = cmd.id ?? this._lastPendingKey ?? 0;\n const isMoreComing = cmd.more === 1;\n const pending = this._pendingTransmissions.get(pendingKey);\n\n if (isMoreComing) {\n if (this._activeDecoder) {\n if (pending) {\n pending.totalEncodedSize += this._totalEncodedSize;\n pending.decodeError = pending.decodeError || this._decodeError;\n } else {\n this._pendingTransmissions.set(pendingKey, {\n cmd: { ...cmd },\n decoder: this._activeDecoder,\n totalEncodedSize: this._totalEncodedSize,\n decodeError: this._decodeError\n });\n }\n this._lastPendingKey = pendingKey;\n this._activeDecoder = null;\n }\n return true;\n }\n\n // Final chunk received \u2014 clear the last pending key\n if (pending) {\n this._lastPendingKey = undefined;\n }\n\n let decodeError = this._decodeError;\n let finalCmd = cmd;\n let decoder = this._activeDecoder;\n\n if (pending) {\n finalCmd = pending.cmd;\n decoder = pending.decoder;\n decodeError = decodeError || pending.decodeError;\n this._pendingTransmissions.delete(pendingKey);\n }\n\n let imageBytes = new Uint8Array(0);\n if (decoder) {\n if (decoder.end() !== DECODER_OK) {\n decodeError = true;\n }\n imageBytes = decoder.data8;\n }\n this._activeDecoder = null;\n\n // Handle command first \u2014 handlers create Blob/ImageData from imageBytes,\n // which copies the data. Only then is it safe to release the decoder's\n // wasm memory that imageBytes points into.\n const result = this._handleCommandWithBytesAndCmd(finalCmd, imageBytes, decodeError);\n if (decoder) {\n decoder.release();\n }\n return result;\n }\n\n // Command handling\n\n private _parseControlDataString(): string {\n let str = '';\n for (let i = 0; i < this._controlLength; i++) {\n str += String.fromCodePoint(this._controlData[i]);\n }\n return str;\n }\n\n private _handleNoPayloadCommand(): boolean | Promise {\n const cmd = parseKittyCommand(this._parseControlDataString());\n\n // Per spec: specifying both i and I is an error\n if (cmd.id !== undefined && cmd.imageNumber !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:cannot specify both i and I keys', cmd.quiet ?? 0);\n return true;\n }\n\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.DELETE:\n return this._handleDelete(cmd);\n case KittyAction.QUERY:\n this._sendResponse(cmd.id ?? 0, 'OK', cmd.quiet ?? 0);\n return true;\n case KittyAction.PLACEMENT:\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handleCommandWithBytesAndCmd(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.TRANSMIT: {\n const result = this._handleTransmit(cmd, bytes, decodeError);\n // Only send response when _handleTransmit didn't already respond\n // (it handles unsupported transmission medium responses internally)\n if ((cmd.transmission ?? 'd') === 'd' && cmd.id !== undefined) {\n if (decodeError) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n } else if (bytes.length > 0) {\n this._sendResponse(cmd.id, 'OK', cmd.quiet ?? 0);\n }\n }\n return result;\n }\n case KittyAction.TRANSMIT_DISPLAY:\n return this._handleTransmitDisplay(cmd, bytes, decodeError);\n case KittyAction.QUERY:\n return this._handleQuery(cmd, bytes, decodeError);\n case KittyAction.PLACEMENT:\n // a=p ignores any payload \u2014 image data was already transmitted\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handlePlacement(cmd: IKittyCommand): boolean | Promise {\n if (cmd.id === undefined) {\n return true;\n }\n const id = cmd.id;\n const image = this._kittyStorage.getImage(id);\n if (!image) {\n this._sendResponse(id, 'ENOENT:image not found', cmd.quiet ?? 0, cmd.placementId);\n return true;\n }\n const result = this._displayImage(image, cmd);\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0, cmd.placementId);\n return true;\n });\n }\n\n private _handleTransmit(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n // TODO: Support file-based transmission modes (t=f, t=t, t=s)\n // Currently only supports direct transmission (t=d, the default).\n // - t=f (file): Payload is base64-encoded file path. Terminal reads image from that path.\n // - t=t (temp file): Payload is base64-encoded path in temp directory. Terminal reads, deletes.\n // - t=s: Payload is base64-encoded POSIX shm name. Terminal reads from shared memory.\n // These modes require filesystem/IPC access not available in browsers. For Node.js/Electron:\n // 1. Check cmd.transmission (t key) before treating bytes as image data\n // 2. For t=f/t/s: decode bytes as UTF-8 string (the path/name), then read file contents\n // 3. For t=d: treat bytes as image data (current behavior)\n // When implementing, also update _handleQuery to accept these transmission mediums.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported transmission medium', cmd.quiet ?? 0);\n }\n return true;\n }\n\n if (decodeError || bytes.length === 0) return true;\n\n this._kittyStorage.storeImage(cmd.id, {\n data: new Blob([bytes as BlobPart]),\n width: cmd.width ?? 0,\n height: cmd.height ?? 0,\n format: (cmd.format ?? KittyFormat.RGBA) as 24 | 32 | 100,\n compression: cmd.compression ?? ''\n });\n return true;\n }\n\n private _handleTransmitDisplay(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n if (decodeError) {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n }\n return true;\n }\n\n this._handleTransmit(cmd, bytes, decodeError);\n\n const id = cmd.id ?? this._kittyStorage.lastImageId;\n const image = this._kittyStorage.getImage(id);\n if (image) {\n const result = this._displayImage(image, cmd);\n if (cmd.id !== undefined) {\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0);\n return true;\n });\n }\n return result.then(() => true);\n }\n return true;\n }\n\n private _handleQuery(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n const id = cmd.id ?? 0;\n const quiet = cmd.quiet ?? 0;\n\n // Per spec: reject unsupported transmission mediums (only t=d is supported atm)\n // TODO: When filesystem support is added (Node.js/Electron), update this to accept\n // t=f (file), t=t (temp file), and t=s (shared memory) and respond OK for queries.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n this._sendResponse(id, 'EINVAL:unsupported transmission medium', quiet);\n return true;\n }\n\n // Check decode error first (invalid base64)\n if (decodeError) {\n this._sendResponse(id, 'EINVAL:invalid base64 data', quiet);\n return true;\n }\n\n // Capability query (no payload) - just respond OK\n if (bytes.length === 0) {\n this._sendResponse(id, 'OK', quiet);\n return true;\n }\n\n const format = cmd.format ?? KittyFormat.RGBA;\n\n if (format === KittyFormat.PNG) {\n this._sendResponse(id, 'OK', quiet);\n } else {\n const width = cmd.width ?? 0;\n const height = cmd.height ?? 0;\n\n if (!width || !height) {\n this._sendResponse(id, 'EINVAL:width and height required for raw pixel data', quiet);\n return true;\n }\n\n const bytesPerPixel = format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n this._sendResponse(id, `EINVAL:insufficient pixel data`, quiet);\n return true;\n }\n\n this._sendResponse(id, 'OK', quiet);\n }\n return true;\n }\n\n private _handleDelete(cmd: IKittyCommand): boolean {\n // Per spec: default delete selector is 'a' (delete all visible placements)\n const selector = cmd.deleteSelector ?? 'a';\n\n // TODO: Distinguish lowercase (delete placements only) from uppercase\n // (delete placements + free stored image data). Currently both variants\n // free everything since we don't separate stored data from placements.\n switch (selector) {\n case 'a':\n case 'A':\n this._cleanupAllPending();\n this._kittyStorage.deleteAll();\n break;\n case 'i':\n case 'I':\n // TODO: When placement id tracking is implemented (see TODO in\n // KittyImageStorage), d=i with p= should delete only that\n // specific placement, while d=i without p should delete all\n // placements for the image.\n if (cmd.id !== undefined) {\n const pending = this._pendingTransmissions.get(cmd.id);\n if (pending) {\n pending.decoder.release();\n }\n this._removePendingEntry(cmd.id);\n this._kittyStorage.deleteById(cmd.id);\n }\n break;\n default:\n // Unsupported selectors (c, n, p, q, r, x, y, z, f) \u2014 ignore for now\n break;\n }\n return true;\n }\n\n private _sendResponse(id: number, message: string, quiet: number, placementId?: number): void {\n const isOk = message === 'OK';\n if (isOk && quiet >= 1) return;\n if (!isOk && quiet >= 2) return;\n\n const pPart = placementId ? `,p=${placementId}` : '';\n const response = `\\x1b_Gi=${id}${pPart};${message}\\x1b\\\\`;\n this._coreTerminal._core.coreService.triggerDataEvent(response);\n }\n\n // Image display\n\n private _displayImage(image: IKittyImageData, cmd: IKittyCommand): Promise {\n return this._decodeAndDisplay(image, cmd)\n .then(() => true)\n .catch(() => false);\n }\n\n private async _decodeAndDisplay(image: IKittyImageData, cmd: IKittyCommand): Promise {\n let bitmap: ImageBitmap | undefined = await this._createBitmap(image);\n\n try {\n const cropX = Math.max(0, cmd.x ?? 0);\n const cropY = Math.max(0, cmd.y ?? 0);\n const cropW = cmd.sourceWidth || (bitmap.width - cropX);\n const cropH = cmd.sourceHeight || (bitmap.height - cropY);\n\n const maxCropW = Math.max(0, bitmap.width - cropX);\n const maxCropH = Math.max(0, bitmap.height - cropY);\n const finalCropW = Math.max(0, Math.min(cropW, maxCropW));\n const finalCropH = Math.max(0, Math.min(cropH, maxCropH));\n\n if (finalCropW === 0 || finalCropH === 0) {\n throw new Error('invalid source rectangle');\n }\n\n if (cropX !== 0 || cropY !== 0 || finalCropW !== bitmap.width || finalCropH !== bitmap.height) {\n const cropped = await createImageBitmap(bitmap, cropX, cropY, finalCropW, finalCropH);\n bitmap.close();\n bitmap = cropped;\n }\n\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n\n // Per spec: c/r default to image's natural cell dimensions.\n // If only one of c/r is specified, compute the other from image aspect ratio.\n let imgCols: number;\n let imgRows: number;\n if (cmd.columns !== undefined && cmd.rows !== undefined) {\n imgCols = cmd.columns;\n imgRows = cmd.rows;\n } else if (cmd.columns !== undefined) {\n imgCols = cmd.columns;\n imgRows = Math.max(1, Math.ceil((bitmap.height / bitmap.width) * (imgCols * cw) / ch));\n } else if (cmd.rows !== undefined) {\n imgRows = cmd.rows;\n imgCols = Math.max(1, Math.ceil((bitmap.width / bitmap.height) * (imgRows * ch) / cw));\n } else {\n imgCols = Math.ceil(bitmap.width / cw);\n imgRows = Math.ceil(bitmap.height / ch);\n }\n\n let w = bitmap.width;\n let h = bitmap.height;\n\n // Scale bitmap to fit placement rectangle when c/r are specified\n if (cmd.columns !== undefined || cmd.rows !== undefined) {\n w = Math.round(imgCols * cw);\n h = Math.round(imgRows * ch);\n }\n\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n\n // Save cursor position before addImage modifies it\n const buffer = this._coreTerminal._core.buffer;\n const savedX = buffer.x;\n const savedY = buffer.y;\n const savedYbase = buffer.ybase;\n\n // Determine layer based on z-index: negative = behind text, 0+ = on top.\n // When z<0 we always use the bottom layer even without allowTransparency \u2014\n // the image will simply be hidden behind the opaque text background, which\n // is the correct behavior (client asked for \"behind text\").\n const wantsBottom = cmd.zIndex !== undefined && cmd.zIndex < 0;\n const layer: ImageLayer = wantsBottom ? 'bottom' : 'top';\n\n if (w !== bitmap.width || h !== bitmap.height) {\n const scaled = await createImageBitmap(bitmap, { resizeWidth: w, resizeHeight: h });\n bitmap.close();\n bitmap = scaled;\n }\n\n // Per spec: X/Y are pixel offsets within the first cell, so clamp to cell dimensions\n const xOffset = Math.min(Math.max(0, cmd.xOffset ?? 0), cw - 1);\n const yOffset = Math.min(Math.max(0, cmd.yOffset ?? 0), ch - 1);\n if (xOffset !== 0 || yOffset !== 0) {\n // Per spec: X/Y is not added to c/r area. When c/r are explicit, the\n // total placement area remains c*cw \u00D7 r*ch pixels and the offset image\n // is clipped to fit. When c/r are unset, the padded canvas determines\n // the natural cell dimensions.\n const canvasW = (cmd.columns !== undefined) ? Math.round(imgCols * cw) : bitmap.width + xOffset;\n const canvasH = (cmd.rows !== undefined) ? Math.round(imgRows * ch) : bitmap.height + yOffset;\n const offsetCanvas = ImageRenderer.createCanvas(window.document, canvasW, canvasH);\n const offsetCtx = offsetCanvas.getContext('2d');\n if (!offsetCtx) {\n throw new Error('Failed to create offset canvas context');\n }\n offsetCtx.drawImage(bitmap, xOffset, yOffset);\n\n const offsetBitmap = await createImageBitmap(offsetCanvas);\n offsetCanvas.width = offsetCanvas.height = 0;\n bitmap.close();\n bitmap = offsetBitmap;\n w = bitmap.width;\n h = bitmap.height;\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n if (cmd.columns === undefined) {\n imgCols = Math.ceil(bitmap.width / cw);\n }\n if (cmd.rows === undefined) {\n imgRows = Math.ceil(bitmap.height / ch);\n }\n }\n\n const zIndex = cmd.zIndex ?? 0;\n this._kittyStorage.addImage(image.id, bitmap, true, layer, zIndex);\n bitmap = undefined; // ownership transferred to storage\n\n // Kitty cursor movement\n // Per spec: cursor placed at first column after last image column,\n // on the last row of the image. C=1 means don't move cursor.\n if (cmd.cursorMovement === 1) {\n // C=1: restore cursor to position before image was placed\n const scrolled = buffer.ybase - savedYbase;\n buffer.x = savedX;\n // Can't restore cursor to scrollback?\n buffer.y = Math.max(savedY - scrolled, 0);\n } else {\n // Default (C=0): advance cursor horizontally past the image\n // addImage already positioned cursor on the last row via lineFeeds\n buffer.x = Math.min(savedX + imgCols, this._coreTerminal.cols);\n }\n } catch (e) {\n bitmap?.close();\n throw e;\n }\n }\n\n // Create ImageBitmap from already-decoded image data.\n private async _createBitmap(image: IKittyImageData): Promise {\n let bytes: Uint8Array = new Uint8Array(await image.data.arrayBuffer());\n\n if (image.compression === KittyCompression.ZLIB) {\n bytes = await this._decompressZlib(bytes);\n }\n\n if (image.format === KittyFormat.PNG) {\n const blob = new Blob([bytes as BlobPart], { type: 'image/png' });\n if (!window.createImageBitmap) {\n const url = URL.createObjectURL(blob);\n const img = new Image();\n return new Promise((resolve, reject) => {\n img.addEventListener('load', () => {\n URL.revokeObjectURL(url);\n const canvas = ImageRenderer.createCanvas(window.document, img.width, img.height);\n canvas.getContext('2d')?.drawImage(img, 0, 0);\n createImageBitmap(canvas).then(resolve).catch(reject);\n });\n img.addEventListener('error', () => {\n URL.revokeObjectURL(url);\n reject(new Error('Failed to load image'));\n });\n img.src = url;\n });\n }\n return createImageBitmap(blob);\n }\n\n // Raw pixel data\n const width = image.width;\n const height = image.height;\n\n if (!width || !height) {\n throw new Error('Width and height required for raw pixel data');\n }\n\n const bytesPerPixel = image.format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n throw new Error('Insufficient pixel data');\n }\n\n const pixelCount = width * height;\n\n if (image.format === KittyFormat.RGBA) {\n // RGBA: use bytes directly \u2014 no copy needed\n return createImageBitmap(new ImageData(new Uint8ClampedArray(bytes.buffer as ArrayBuffer, bytes.byteOffset, pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA), width, height));\n }\n\n // RGB\u2192RGBA: interleave alpha using uint32 block processing (4 pixels per iteration).\n // 3 uint32 reads + 4 uint32 writes per 4 pixels vs 28 byte reads/writes \u2014 ~6x faster.\n // Assumes little-endian (all modern browsers/Node.js).\n const data = new Uint8ClampedArray(pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA);\n const src32 = new Uint32Array(bytes.buffer, bytes.byteOffset, Math.floor(bytes.byteLength / 4));\n const dst32 = new Uint32Array(data.buffer);\n const alignedPixels = pixelCount & ~3; // round down to multiple of 4\n\n let srcOffset = 0;\n let dstOffset = 0;\n for (let i = 0; i < alignedPixels; i += 4) {\n const b0 = src32[srcOffset++];\n const b1 = src32[srcOffset++];\n const b2 = src32[srcOffset++];\n // Little-endian: pixel bytes are [R,G,B] \u2192 uint32 ABGR layout\n dst32[dstOffset++] = 0xFF000000 | b0;\n dst32[dstOffset++] = 0xFF000000 | (b0 >>> 24) | (b1 << 8);\n dst32[dstOffset++] = 0xFF000000 | (b1 >>> 16) | (b2 << 16);\n dst32[dstOffset++] = 0xFF000000 | (b2 >>> 8);\n }\n\n // Handle remaining 1\u20133 pixels\n let srcByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n let dstByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n for (let i = alignedPixels; i < pixelCount; i++) {\n data[dstByte] = bytes[srcByte];\n data[dstByte + 1] = bytes[srcByte + 1];\n data[dstByte + 2] = bytes[srcByte + 2];\n data[dstByte + 3] = KittyPixelConstants.ALPHA_OPAQUE;\n srcByte += KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n dstByte += KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n }\n\n return createImageBitmap(new ImageData(data, width, height));\n }\n\n private async _decompressZlib(compressed: Uint8Array): Promise {\n try {\n return await this._decompress(compressed, 'deflate');\n } catch {\n return await this._decompress(compressed, 'deflate-raw');\n }\n }\n\n private async _decompress(compressed: Uint8Array, format: 'deflate' | 'deflate-raw'): Promise {\n const ds = new DecompressionStream(format);\n const writer = ds.writable.getWriter();\n writer.write(compressed as BufferSource);\n writer.close();\n\n const chunks: Uint8Array[] = [];\n const reader = ds.readable.getReader();\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n chunks.push(value);\n }\n\n const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n }\n\n public get images(): ReadonlyMap {\n return this._kittyStorage.images;\n }\n\n public get _kittyIdToStorageId(): ReadonlyMap {\n return this._kittyStorage.kittyIdToStorageId;\n }\n\n public get pendingTransmissions(): ReadonlyMap {\n return this._pendingTransmissions;\n }\n}\n", "/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Kitty graphics protocol types, constants, and parsing utilities.\n */\n\nimport type Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\n\n// Kitty graphics protocol action types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'a'.\nexport const enum KittyAction {\n TRANSMIT = 't',\n TRANSMIT_DISPLAY = 'T',\n QUERY = 'q',\n PLACEMENT = 'p',\n DELETE = 'd'\n}\n\n// Kitty graphics protocol format types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyFormat {\n RGB = 24,\n RGBA = 32,\n PNG = 100\n}\n\n// Kitty graphics protocol compression types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'o'.\nexport const enum KittyCompression {\n NONE = '',\n ZLIB = 'z'\n}\n\n// Kitty graphics protocol control data keys.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyKey {\n // Action to perform (t=transmit, T=transmit+display, q=query, p=placement, d=delete)\n ACTION = 'a',\n // Image format (24=RGB, 32=RGBA, 100=PNG)\n FORMAT = 'f',\n // Image ID for referencing stored images\n ID = 'i',\n // Image number (alternative to ID, terminal assigns ID)\n IMAGE_NUMBER = 'I',\n // Source image width in pixels\n WIDTH = 's',\n // Source image height in pixels\n HEIGHT = 'v',\n // The left edge (in pixels) of the image area to display\n X_OFFSET = 'x',\n // The top edge (in pixels) of the image area to display\n Y_OFFSET = 'y',\n // Width (in pixels) of the source rectangle to display\n SOURCE_WIDTH = 'w',\n // Height (in pixels) of the source rectangle to display\n SOURCE_HEIGHT = 'h',\n // Horizontal offset (in pixels) within the first cell\n X_PLACEMENT_OFFSET = 'X',\n // Vertical offset (in pixels) within the first cell\n Y_PLACEMENT_OFFSET = 'Y',\n // Number of terminal columns to display the image over\n COLUMNS = 'c',\n // Number of terminal rows to display the image over\n ROWS = 'r',\n // More data flag (1=more chunks coming, 0=final chunk)\n MORE = 'm',\n // Compression type (z=zlib). This is essential for chunking larger images.\n COMPRESSION = 'o',\n // Quiet mode (1=suppress OK responses, 2=suppress error responses)\n QUIET = 'q',\n // Cursor movement policy (0=move cursor after image, 1=don't move cursor)\n CURSOR_MOVEMENT = 'C',\n // Z-index for image layering (negative = behind text, 0+ = on top)\n Z_INDEX = 'z',\n // Transmission medium (d=direct, f=file, t=temp file, s=shared memory)\n TRANSMISSION = 't',\n // Delete selector (a/A=all, i/I=by id, c/C=at cursor, etc.) \u2014 only used when a=d\n DELETE_SELECTOR = 'd',\n // Placement ID for targeting specific placements\n PLACEMENT_ID = 'p'\n}\n\n// Pixel format constants\nexport const enum KittyPixelConstants {\n BYTES_PER_PIXEL_RGB = 3,\n BYTES_PER_PIXEL_RGBA = 4,\n ALPHA_OPAQUE = 255\n}\n\n// Parsed Kitty graphics command.\nexport interface IKittyCommand {\n action?: string;\n format?: number;\n id?: number;\n imageNumber?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n sourceWidth?: number;\n sourceHeight?: number;\n xOffset?: number;\n yOffset?: number;\n columns?: number;\n rows?: number;\n more?: number;\n quiet?: number;\n cursorMovement?: number;\n zIndex?: number;\n transmission?: string;\n deleteSelector?: string;\n placementId?: number;\n compression?: string;\n payload?: string;\n}\n\n// Pending chunked transmission state.\n// Stores metadata from the first chunk while accumulating decoded payload data.\nexport interface IPendingTransmission {\n // The parsed command from the first chunk (contains action, format, dimensions, etc.)\n cmd: IKittyCommand;\n // Decoder used across chunked payloads\n decoder: Base64Decoder;\n // Total encoded (base64) bytes received across all chunks - for size limit enforcement\n totalEncodedSize: number;\n // Whether any chunk has failed to decode\n decodeError: boolean;\n}\n\n// Stored Kitty image data.\nexport interface IKittyImageData {\n id: number;\n // Decoded image data stored as Blob (off JS heap) to avoid 2GB heap limit\n data: Blob;\n width: number;\n height: number;\n format: 24 | 32 | 100;\n compression?: string;\n}\n\n// Parses Kitty graphics control data into a command object.\nexport function parseKittyCommand(data: string): IKittyCommand {\n const cmd: IKittyCommand = {};\n const parts = data.split(',');\n\n for (const part of parts) {\n const eqIdx = part.indexOf('=');\n if (eqIdx === -1) continue;\n\n const key = part.substring(0, eqIdx);\n const value = part.substring(eqIdx + 1);\n\n // Handle string keys first\n if (key === KittyKey.ACTION) {\n cmd.action = value;\n continue;\n }\n if (key === KittyKey.COMPRESSION) {\n cmd.compression = value;\n continue;\n }\n if (key === KittyKey.TRANSMISSION) {\n cmd.transmission = value;\n continue;\n }\n if (key === KittyKey.DELETE_SELECTOR) {\n cmd.deleteSelector = value;\n continue;\n }\n const numValue = parseInt(value, 10);\n switch (key) {\n case KittyKey.FORMAT: cmd.format = numValue; break;\n case KittyKey.ID: cmd.id = numValue; break;\n case KittyKey.IMAGE_NUMBER: cmd.imageNumber = numValue; break;\n case KittyKey.WIDTH: cmd.width = numValue; break;\n case KittyKey.HEIGHT: cmd.height = numValue; break;\n case KittyKey.X_OFFSET: cmd.x = numValue; break;\n case KittyKey.Y_OFFSET: cmd.y = numValue; break;\n case KittyKey.SOURCE_WIDTH: cmd.sourceWidth = numValue; break;\n case KittyKey.SOURCE_HEIGHT: cmd.sourceHeight = numValue; break;\n case KittyKey.X_PLACEMENT_OFFSET: cmd.xOffset = numValue; break;\n case KittyKey.Y_PLACEMENT_OFFSET: cmd.yOffset = numValue; break;\n case KittyKey.COLUMNS: cmd.columns = numValue; break;\n case KittyKey.ROWS: cmd.rows = numValue; break;\n case KittyKey.MORE: cmd.more = numValue; break;\n case KittyKey.QUIET: cmd.quiet = numValue; break;\n case KittyKey.CURSOR_MOVEMENT: cmd.cursorMovement = numValue; break;\n case KittyKey.Z_INDEX: cmd.zIndex = numValue; break;\n case KittyKey.PLACEMENT_ID: cmd.placementId = numValue; break;\n }\n }\n\n return cmd;\n}\n", "/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageStorage } from '../ImageStorage';\nimport { ImageLayer, IAddImageOpts } from '../Types';\nimport { IKittyImageData } from './KittyGraphicsTypes';\n\n// Kitty-specific image storage controller.\n//\n// Wraps shared ImageStorage with kitty protocol semantics:\n// - tracks transmitted image payloads by kitty image id\n// - tracks kitty image id -> shared ImageStorage id mapping for displayed images\n// - mirrors shared-storage evictions into kitty maps\n// - applies protocol-level undisplayed-image eviction policy\nexport class KittyImageStorage implements IDisposable {\n private static readonly _maxStoredImages = 256;\n\n private _nextImageId = 1;\n private readonly _images: Map = new Map();\n // TODO: Support multiple placements per image. The kitty spec identifies\n // placements by an (image id, placement id) pair \u2014 same i + different p\n // values should coexist, and same i + same p should replace the prior\n // placement. Currently we track only one storage entry per kitty image id,\n // so multiple placements of the same image overwrite each other. Fixing\n // this requires changing these maps to Map>\n // (kittyId \u2192 placementId \u2192 storageId) and updating addImage/deleteById\n // accordingly. The underlying shared ImageStorage would also need to\n // support multiple entries per logical image.\n private readonly _kittyIdToStorageId: Map = new Map();\n private readonly _storageIdToKittyId: Map = new Map();\n\n private readonly _previousOnImageDeleted: ((storageId: number) => void) | undefined;\n private readonly _wrappedOnImageDeleted: (storageId: number) => void;\n private readonly _handleStorageImageDeleted = (storageId: number): void => {\n const kittyId = this._storageIdToKittyId.get(storageId);\n if (kittyId !== undefined) {\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n this._images.delete(kittyId);\n }\n };\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n\n constructor(\n private readonly _storage: ImageStorage\n ) {\n this._previousOnImageDeleted = this._storage.onImageDeleted;\n this._wrappedOnImageDeleted = (storageId: number) => {\n this._previousOnImageDeleted?.(storageId);\n this._handleStorageImageDeleted(storageId);\n };\n this._storage.onImageDeleted = this._wrappedOnImageDeleted;\n }\n\n public reset(): void {\n this._nextImageId = 1;\n this._images.clear();\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public dispose(): void {\n this.reset();\n if (this._storage.onImageDeleted === this._wrappedOnImageDeleted) {\n this._storage.onImageDeleted = this._previousOnImageDeleted;\n }\n }\n\n public storeImage(id: number | undefined, imageData: Omit): number {\n const imageId = id ?? this._nextImageId++;\n\n const oldStorageId = this._kittyIdToStorageId.get(imageId);\n if (oldStorageId !== undefined) {\n this._storage.deleteImage(oldStorageId);\n this._kittyIdToStorageId.delete(imageId);\n this._storageIdToKittyId.delete(oldStorageId);\n }\n\n if (!this._images.has(imageId) && this._images.size >= KittyImageStorage._maxStoredImages) {\n this._evictUndisplayedImages();\n }\n\n this._images.set(imageId, {\n ...imageData,\n id: imageId\n });\n return imageId;\n }\n\n public addImage(kittyId: number, image: HTMLCanvasElement | ImageBitmap, scrolling: boolean, layer: ImageLayer, zIndex: number): void {\n // Clean up stale reverse-mapping from a previous placement of the same\n // kitty image. The old shared-storage entry is kept (it may still be\n // visible on screen) but its reverse mapping is removed so that eviction\n // of the old entry won't incorrectly delete the kitty image data.\n const oldStorageId = this._kittyIdToStorageId.get(kittyId);\n if (oldStorageId !== undefined) {\n this._storageIdToKittyId.delete(oldStorageId);\n }\n this._addImageOpts.scrolling = scrolling;\n this._addImageOpts.layer = layer;\n this._addImageOpts.zIndex = zIndex;\n const storageId = this._storage.addImage(image, this._addImageOpts);\n this._kittyIdToStorageId.set(kittyId, storageId);\n this._storageIdToKittyId.set(storageId, kittyId);\n }\n\n public getImage(kittyId: number): IKittyImageData | undefined {\n return this._images.get(kittyId);\n }\n\n public deleteById(kittyId: number): void {\n this._images.delete(kittyId);\n const storageId = this._kittyIdToStorageId.get(kittyId);\n if (storageId !== undefined) {\n this._storage.deleteImage(storageId);\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n }\n }\n\n public deleteAll(): void {\n this._images.clear();\n for (const storageId of this._kittyIdToStorageId.values()) {\n this._storage.deleteImage(storageId);\n }\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public get images(): ReadonlyMap {\n return this._images;\n }\n\n public get kittyIdToStorageId(): ReadonlyMap {\n return this._kittyIdToStorageId;\n }\n\n public get lastImageId(): number {\n return this._nextImageId - 1;\n }\n\n private _evictUndisplayedImages(): void {\n for (const [kittyId] of this._images) {\n if (this._images.size <= KittyImageStorage._maxStoredImages / 2) {\n break;\n }\n if (!this._kittyIdToStorageId.has(kittyId)) {\n this._images.delete(kittyId);\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2020, 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IDcsHandler, IParams, IImageAddonOptions, ITerminalExt, AttributeData, IResetHandler, ReadonlyColorSet } from './Types';\nimport { toRGBA8888, BIG_ENDIAN, PALETTE_ANSI_256, PALETTE_VT340_COLOR } from 'sixel/lib/Colors';\nimport { RGBA8888 } from 'sixel/lib/Types';\nimport { ImageRenderer } from './ImageRenderer';\n\nimport { DecoderAsync, Decoder } from 'sixel/lib/Decoder';\n\n// always free decoder ressources after decoding if it exceeds this limit\nconst MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB\n\n// custom default palette: VT340 (lower 16 colors) + ANSI256 (up to 256) + zeroed (up to 4096)\nconst DEFAULT_PALETTE = PALETTE_ANSI_256;\nDEFAULT_PALETTE.set(PALETTE_VT340_COLOR);\n\n\nexport class SixelHandler implements IDcsHandler, IResetHandler {\n private _size = 0;\n private _aborted = false;\n private _dec: Decoder | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _storage: SixelImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n DecoderAsync({\n memoryLimit: this._opts.pixelLimit * 4,\n palette: DEFAULT_PALETTE,\n paletteLimit: this._opts.sixelPaletteLimit\n }).then(d => this._dec = d);\n }\n\n public reset(): void {\n /**\n * reset sixel decoder to defaults:\n * - release all memory\n * - nullify palette (4096)\n * - apply default palette (256)\n */\n if (this._dec) {\n this._dec.release();\n // FIXME: missing interface on decoder to nullify full palette\n (this._dec as any)._palette.fill(0);\n this._dec.init(0, DEFAULT_PALETTE, this._opts.sixelPaletteLimit);\n }\n }\n\n public hook(params: IParams): void {\n this._size = 0;\n this._aborted = false;\n if (this._dec) {\n const fillColor = params.params[1] === 1 ? 0 : extractActiveBg(\n this._coreTerminal._core._inputHandler._curAttrData,\n this._coreTerminal._core._themeService?.colors);\n this._dec.init(fillColor, null, this._opts.sixelPaletteLimit);\n }\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted || !this._dec) {\n return;\n }\n this._size += end - start;\n if (this._size > this._opts.sixelSizeLimit) {\n console.warn(`SIXEL: too much data, aborting`);\n this._aborted = true;\n this._dec.release();\n return;\n }\n try {\n this._dec.decode(data, start, end);\n } catch (e) {\n console.warn(`SIXEL: error while decoding image - ${e}`);\n this._aborted = true;\n this._dec.release();\n }\n }\n\n public unhook(success: boolean): boolean | Promise {\n if (this._aborted || !success || !this._dec) {\n return true;\n }\n\n const width = this._dec.width;\n const height = this._dec.height;\n\n // partial fix for https://github.com/jerch/xterm-addon-image/issues/37\n if (!width || !height) {\n if (height) {\n this._storage.advanceCursor(height);\n }\n return true;\n }\n\n const canvas = ImageRenderer.createCanvas(undefined, width, height);\n canvas.getContext('2d')?.putImageData(new ImageData(this._dec.data8 as Uint8ClampedArray, width, height), 0, 0);\n if (this._dec.memoryUsage > MEM_PERMA_LIMIT) {\n this._dec.release();\n }\n this._storage.addImage(canvas);\n return true;\n }\n}\n\n\n/**\n * Some helpers to extract current terminal colors.\n */\n\n// get currently active background color from terminal\n// also respect INVERSE setting\nfunction extractActiveBg(attr: AttributeData, colors: ReadonlyColorSet | undefined): RGBA8888 {\n let bg = 0;\n if (!colors) {\n // FIXME: theme service is prolly not available yet,\n // happens if .open() was not called yet (bug in core?)\n return bg;\n }\n if (attr.isInverse()) {\n if (attr.isFgDefault()) {\n bg = convertLe(colors.foreground.rgba);\n } else if (attr.isFgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getFgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getFgColor()].rgba);\n }\n } else {\n if (attr.isBgDefault()) {\n bg = convertLe(colors.background.rgba);\n } else if (attr.isBgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getBgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getBgColor()].rgba);\n }\n }\n return bg;\n}\n\n// rgba values on the color managers are always in BE, thus convert to LE\nfunction convertLe(color: number): RGBA8888 {\n if (BIG_ENDIAN) return color;\n return (color & 0xFF) << 24 | (color >>> 8 & 0xFF) << 16 | (color >>> 16 & 0xFF) << 8 | color >>> 24 & 0xFF;\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { IImageAddonOptions, ITerminalExt, IAddImageOpts } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\n\n/**\n * Sixel-specific image storage controller.\n *\n * Wraps the shared ImageStorage with sixel protocol semantics:\n * - Cursor behavior governed by DECSET 80 (sixelScrolling option)\n * - advanceCursor for empty sixels carrying only height\n */\nexport class SixelImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'vt340' };\n constructor(\n private readonly _storage: ImageStorage,\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _terminal: ITerminalExt\n ) {}\n\n /**\n * Add a sixel image to storage.\n * Cursor behavior depends on the sixelScrolling option (DECSET 80).\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._addImageOpts.scrolling = this._opts.sixelScrolling;\n this._storage.addImage(img, this._addImageOpts);\n }\n\n /**\n * Only advance text cursor.\n * This is an edge case from empty sixels carrying only a height but no pixels.\n * Partially fixes https://github.com/jerch/xterm-addon-image/issues/37.\n */\n public advanceCursor(height: number): void {\n if (this._opts.sixelScrolling) {\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const rows = Math.ceil(height / cellSize.height);\n for (let i = 1; i < rows; ++i) {\n this._terminal._core._inputHandler.lineFeed();\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAddImageOpts } from './Types';\nimport { ImageStorage } from './ImageStorage';\n\n/**\n * IIP (iTerm Image Protocol) specific image storage controller.\n *\n * Wraps the shared ImageStorage with IIP protocol semantics:\n * - Always uses scrolling mode (cursor advances with image)\n */\nexport class IIPImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n constructor(\n private readonly _storage: ImageStorage\n ) {}\n\n /**\n * Add an IIP image to storage.\n * Always uses scrolling mode \u2014 cursor advances past the image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._storage.addImage(img, this._addImageOpts);\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport type { ITerminalAddon, IDisposable } from '@xterm/xterm';\nimport type { ImageAddon as IImageApi } from '@xterm/addon-image';\nimport { Emitter, type IEvent } from 'common/Event';\nimport { IIPHandler } from './IIPHandler';\nimport { ImageRenderer } from './ImageRenderer';\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { KittyGraphicsHandler } from './kitty/KittyGraphicsHandler';\nimport { KittyImageStorage } from './kitty/KittyImageStorage';\nimport { SixelHandler } from './SixelHandler';\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { ITerminalExt, IImageAddonOptions, IResetHandler } from './Types';\n\n\n/**\n * Document VT features provided by this addon.\n *\n * @vt: #E[Supported via @xterm/addon-image.] DCS SIXEL \"SIXEL Graphics\" \"DCS Ps ; Ps ; Ps ; q Pt ST\" \"Draw SIXEL image.\"\n *\n * Sixel support is provided by the addon @xterm/addon-image with these limitations:\n * - immediate coloring (no shared palette, allows high color settings of `img2sixel`)\n * - max. palette size of 4096 colors\n * - max. pixel width of 16K\n * - max. 25 MB per sixel sequence\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] OSC 1337 \"iTerm2 Commands\" \"OSC 1337 ; Pt BEL\" \"Custom iTerm2 commands.\"\n *\n * Only the inline image protocol (IIP) is supported by the addon @xterm/addon-image with\n * the following limitations:\n * - sequence:\n * - format: `OSC 1337 ; File=inline=1 ; size= ; ... : BEL`\n * - size param must be set and payload may not exceed CEIL(size * 4 / 3)\n * - strict base64 handling as of RFC4648 \u00A74 (standard alphabet, optional padding,\n * no separator bytes allowed)\n * - supported params: size, name, width, height, preserveAspectRatio\n * - image formats: PNG, JPEG and GIF\n * - no animation support (renders first image of a GIF)\n * - no multipart support\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image)\n * and [iTerm2 IIP docs](https://iterm2.com/documentation-images.html) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] APC KITTY_GRAPHICS \"Kitty Graphics\" \"APC G Pt ST\" \"Kitty Graphics Protocol.\"\n *\n * Kitty graphics support is provided by the addon @xterm/addon-image.\n * Note that while basic image output already works, this is still work in progress.\n */\n\n// default values of addon ctor options\nconst DEFAULT_OPTIONS: IImageAddonOptions = {\n enableSizeReports: true,\n pixelLimit: 16777216, // limit to 4096 * 4096 pixels\n sixelSupport: true,\n sixelScrolling: true,\n sixelPaletteLimit: 4096,\n sixelSizeLimit: 33554432,\n storageLimit: 128,\n showPlaceholder: true,\n iipSupport: true,\n iipSizeLimit: 33554432,\n kittySupport: true,\n kittySizeLimit: 33554432\n};\n\n// max palette size supported by the sixel lib (compile time setting)\nconst MAX_SIXEL_PALETTE_SIZE = 4096;\n\n// definitions for _xtermGraphicsAttributes sequence\nconst enum GaItem {\n COLORS = 1,\n SIXEL_GEO = 2,\n REGIS_GEO = 3\n}\nconst enum GaAction {\n READ = 1,\n SET_DEFAULT = 2,\n SET = 3,\n READ_MAX = 4\n}\nconst enum GaStatus {\n SUCCESS = 0,\n ITEM_ERROR = 1,\n ACTION_ERROR = 2,\n FAILURE = 3\n}\n\n\nexport class ImageAddon implements ITerminalAddon, IImageApi {\n private _opts: IImageAddonOptions;\n private _defaultOpts: IImageAddonOptions;\n private _storage: ImageStorage | undefined;\n private _renderer: ImageRenderer | undefined;\n private _disposables: IDisposable[] = [];\n private _terminal: ITerminalExt | undefined;\n private _handlers: Map = new Map();\n private readonly _onImageAdded = new Emitter();\n public readonly onImageAdded: IEvent = this._onImageAdded.event;\n\n constructor(opts?: Partial) {\n this._opts = Object.assign({}, DEFAULT_OPTIONS, opts);\n this._defaultOpts = Object.assign({}, DEFAULT_OPTIONS, opts);\n }\n\n public dispose(): void {\n for (const obj of this._disposables) {\n obj.dispose();\n }\n this._disposables.length = 0;\n this._handlers.clear();\n this._onImageAdded.dispose();\n }\n\n private _disposeLater(...args: IDisposable[]): void {\n for (const obj of args) {\n this._disposables.push(obj);\n }\n }\n\n public activate(terminal: ITerminalExt): void {\n this._terminal = terminal;\n\n // internal data structures\n this._renderer = new ImageRenderer(terminal);\n this._storage = new ImageStorage(terminal, this._renderer, this._opts);\n this._storage.onImageAdded = () => this._onImageAdded.fire();\n\n // enable size reports\n if (this._opts.enableSizeReports) {\n const windowOps = terminal.options.windowOptions ?? {};\n windowOps.getWinSizePixels = true;\n windowOps.getCellSizePixels = true;\n windowOps.getWinSizeChars = true;\n terminal.options.windowOptions = windowOps;\n }\n\n this._disposeLater(\n this._renderer,\n this._storage,\n\n // DECSET/DECRST/DA1/XTSMGRAPHICS handlers\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'h' }, params => this._decset(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'l' }, params => this._decrst(params)),\n terminal.parser.registerCsiHandler({ final: 'c' }, params => this._da1(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'S' }, params => this._xtermGraphicsAttributes(params)),\n\n // render hook\n terminal.onRender(range => this._storage?.render(range)),\n\n /**\n * reset handlers covered:\n * - DECSTR\n * - RIS\n * - Terminal.reset()\n */\n terminal.parser.registerCsiHandler({ intermediates: '!', final: 'p' }, () => this.reset()),\n terminal.parser.registerEscHandler({ final: 'c' }, () => this.reset()),\n terminal._core._inputHandler.onRequestReset(() => this.reset()),\n\n // wipe canvas and delete alternate images on buffer switch\n terminal.buffer.onBufferChange(() => this._storage?.wipeAlternate()),\n\n // extend images to the right on resize\n terminal.onResize(metrics => this._storage?.viewportResize(metrics))\n );\n\n // SIXEL handler\n if (this._opts.sixelSupport) {\n const sixelStorage = new SixelImageStorage(this._storage!, this._opts, this._renderer!, terminal);\n const sixelHandler = new SixelHandler(this._opts, sixelStorage, terminal);\n this._handlers.set('sixel', sixelHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerDcsHandler({ final: 'q' }, sixelHandler)\n );\n }\n\n // iTerm IIP handler\n if (this._opts.iipSupport) {\n const iipStorage = new IIPImageStorage(this._storage!);\n const iipHandler = new IIPHandler(this._opts, this._renderer!, iipStorage, terminal);\n this._handlers.set('iip', iipHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerOscHandler(1337, iipHandler)\n );\n }\n\n // Kitty graphics handler\n if (this._opts.kittySupport) {\n const kittyStorage = new KittyImageStorage(this._storage!);\n const kittyHandler = new KittyGraphicsHandler(this._opts, this._renderer!, kittyStorage, terminal);\n this._handlers.set('kitty', kittyHandler);\n this._disposeLater(\n kittyStorage,\n kittyHandler,\n terminal._core._inputHandler._parser.registerApcHandler({ final: 'G' }, kittyHandler)\n );\n }\n }\n\n // Note: storageLimit is skipped here to not intoduce a surprising side effect.\n public reset(): boolean {\n // reset options customizable by sequences to defaults\n this._opts.sixelScrolling = this._defaultOpts.sixelScrolling;\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n // also clear image storage\n this._storage?.reset();\n // reset protocol handlers\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return false;\n }\n\n public get storageLimit(): number {\n return this._storage?.getLimit() || -1;\n }\n\n public set storageLimit(limit: number) {\n this._storage?.setLimit(limit);\n this._opts.storageLimit = limit;\n }\n\n public get storageUsage(): number {\n if (this._storage) {\n return this._storage.getUsage();\n }\n return -1;\n }\n\n public get showPlaceholder(): boolean {\n return this._opts.showPlaceholder;\n }\n\n public set showPlaceholder(value: boolean) {\n this._opts.showPlaceholder = value;\n this._renderer?.showPlaceholder(value);\n }\n\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.getImageAtBufferCell(x, y);\n }\n\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.extractTileAtBufferCell(x, y);\n }\n\n private _report(s: string): void {\n this._terminal?._core.input(s, false);\n }\n\n private _decset(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = false;\n break;\n }\n }\n return false;\n }\n\n private _decrst(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = true;\n break;\n }\n }\n return false;\n }\n\n // overload DA to return something more appropriate\n private _da1(params: (number | number[])[]): boolean {\n if (params[0]) {\n return true;\n }\n // reported features:\n // 62 - VT220\n // 4 - SIXEL support\n // 9 - charsets\n // 22 - ANSI colors\n if (this._opts.sixelSupport) {\n this._report(`\\x1b[?62;4;9;22c`);\n return true;\n }\n return false;\n }\n\n /**\n * Implementation of xterm's graphics attribute sequence.\n *\n * Supported features:\n * - read/change palette limits (max 4096 by sixel lib)\n * - read SIXEL canvas geometry (reports current window canvas or\n * squared pixelLimit if canvas > pixel limit)\n *\n * Everything else is deactivated.\n */\n private _xtermGraphicsAttributes(params: (number | number[])[]): boolean {\n if (params.length < 2) {\n return true;\n }\n if (params[0] === GaItem.COLORS) {\n switch (params[1]) {\n case GaAction.READ:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n return true;\n case GaAction.SET_DEFAULT:\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n // also reset protocol handlers for now\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return true;\n case GaAction.SET:\n if (params.length > 2 && !(params[2] instanceof Array) && params[2] <= MAX_SIXEL_PALETTE_SIZE) {\n this._opts.sixelPaletteLimit = params[2];\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n } else {\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n }\n return true;\n case GaAction.READ_MAX:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${MAX_SIXEL_PALETTE_SIZE}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n if (params[0] === GaItem.SIXEL_GEO) {\n switch (params[1]) {\n // we only implement read and read_max here\n case GaAction.READ:\n let width = this._renderer?.dimensions?.css.canvas.width;\n let height = this._renderer?.dimensions?.css.canvas.height;\n if (!width || !height) {\n // for some reason we have no working image renderer\n // --> fallback to default cell size\n const cellSize = CELL_SIZE_DEFAULT;\n width = (this._terminal?.cols || 80) * cellSize.width;\n height = (this._terminal?.rows || 24) * cellSize.height;\n }\n if (width * height < this._opts.pixelLimit) {\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${width.toFixed(0)};${height.toFixed(0)}S`);\n } else {\n // if we overflow pixelLimit report that squared instead\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n }\n return true;\n case GaAction.READ_MAX:\n // read_max returns pixelLimit as square area\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n // exit with error on ReGIS or any other requests\n this._report(`\\x1b[?${params[0]};${GaStatus.ITEM_ERROR}S`);\n return true;\n }\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;02BAYaA,EAAA,WAAa,IAAI,WAAW,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,IAAM,IAClFA,EAAA,YACF,QAAQ,KAAK,6EAA6E,EAI5F,SAAgBC,GAAIC,EAAW,CAC7B,OAAOA,EAAI,GACb,CAFAF,EAAA,IAAAC,GAIA,SAAgBE,GAAMD,EAAW,CAC/B,OAAQA,IAAM,EAAK,GACrB,CAFAF,EAAA,MAAAG,GAIA,SAAgBC,GAAKF,EAAW,CAC9B,OAAQA,IAAM,GAAM,GACtB,CAFA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lB,EAAO,CAAC,CAAC,MAAwBkB,CAAC,IAAIA,CAAC,GAAG,CAClE,CACA,MAAO,GACT,IAAK,GAEH,IAAMA,EAAI,KAAK,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC,EACrD,YAAK,QAAQ,SAASlB,EAAO,CAAC,CAAC,MAAwBkB,CAAC,IAAIA,CAAC,GAAG,EACzD,GACT,QACE,YAAK,QAAQ,SAASlB,EAAO,CAAC,CAAC,KAA4B,EACpD,EACX,CAGF,YAAK,QAAQ,SAASA,EAAO,CAAC,CAAC,KAA0B,EAClD,EACT,CACF", - "names": ["exports", "red", "n", "green", "blue", "alpha", "toRGBA8888", "g", "b", "a", "fromRGBA8888", "color", "nearestColorIndex", "palette", "r", "min", "idx", "i", "dr", "dg", "db", "d", "clamp", "low", "high", "value", "h2c", "t1", "t2", "c", "HLStoRGB", "h", "l", "s", "v", "normalizeRGB", "normalizeHLS", "p", "require_lib", "__commonJSMin", "exports", "InWasm", "z", "s", "b", "r", "def", "t", "d", "m", "W", "e", "require_Base64Decoder_wasm", "__commonJSMin", "exports", "inwasm_runtime_1", "wasmDecode", "MAP", "el", "D", "i", "EMPTY", "Base64Decoder", "keepSize", "maxBytes", "initialBytes", "m", "bytes", "requested", "needed", "newSize", "addPages", "data", "require_QoiDecoder_wasm", "__commonJSMin", "exports", "inwasm_runtime_1", "wasmQoiDecode", "QoiDecoder", "keepSize", "d", "pixels", "ib", "dl", "bytes", "chunkP", "exports", "Colors_1", "wasm_1", "decodeBase64", "s", "bytestring", "result", "WASM_BYTES", "WASM_MODULE", "NULL_CANVAS", "CallbackProxy", "width", "mode", "DEFAULT_OPTIONS", "DecoderAsync", "opts", "cbProxy", "importObj", "inst", "Decoder", "exports", "_instance", "_cbProxy", "module", "pixels", "offset", "additionalPixels", "newCanvas", "adv", "remaining", "c", "i", "fillColor", "palette", "paletteLimit", "truncate", "data", "start", "end", "p", "length", "j", "currentWidth", "escape", "final", "finalOffset", "bw", "currentHeight", "decode", "dec", "decodeAsync", "toDisposable", "fn", "DisposableStore", "o", "d", "Disposable", "MutableDisposable", "value", "Emitter", "listener", "thisArgs", "disposables", "toDisposable", "entry", "result", "idx", "event", "listeners", "len", "EventUtils", "forward", "from", "to", "e", "map", "i", "any", "events", "store", "DisposableStore", "runAndSubscribe", "handler", "initial", "import_Colors", "ImageRenderer", "_ImageRenderer", "Disposable", "_terminal", "MutableDisposable", "parent", "option", "toDisposable", "localDocument", "width", "height", "canvas", "ctx", "buffer", "imgData", "img", "value", "start", "end", "layer", "y", "w", "h", "imgSpec", "tileId", "col", "row", "count", "cols", "sx", "sy", "dx", "dy", "finalWidth", "finalHeight", "spec", "currentWidth", "currentHeight", "originalWidth", "originalHeight", "renderer", "key", "screenElement", "bWidth", "blueprint", "d32", "black", "white", "shift", "offset", "x", "ctx2", "i", "bitmap", "CELL_SIZE_DEFAULT", "ExtendedAttrsImage", "_ExtendedAttrsImage", "ext", "urlId", "imageId", "tileId", "value", "val", "EMPTY_ATTRS", "ImageStorage", "_terminal", "_renderer", "_opts", "e", "spec", "storedPixels", "id", "zero", "img", "opts", "cellSize", "cols", "rows", "buffer", "termCols", "termRows", "originX", "originY", "offset", "tileCount", "row", "line", "col", "endMarker", "imgSpec", "range", "hasTopImages", "hasBottomImages", "start", "end", "drawCalls", "placeholderCalls", "startTile", "startCol", "count", "a", "b", "call", "metrics", "oldCol", "tilesPerRow", "hasData", "rightCol", "lastTile", "expandCol", "x", "y", "orig", "canvas", "ImageRenderer", "room", "used", "current", "old", "oldSpec", "imgId", "import_Base64Decoder", "import_QoiDecoder", "toStr", "data", "s", "i", "toInt", "v", "toSize", "toName", "bs", "b", "DECODERS", "FILE_MARKER", "MULTIPARTFILE_MARKER", "FILEPART_MARKER", "FILEEND_MARKER", "REPORTCELLSIZE_MARKER", "MAX_FIELDCHARS", "HeaderParser", "k", "start", "end", "state", "pos", "buffer", "c", "UNSUPPORTED_TYPE", "imageType", "d", "d32", "width", "height", "jpgSize", "dim", "pos", "limit", "i", "len", "blockLength", "DEFAULT_HEADER", "IIPHandler", "_opts", "_renderer", "_storage", "_coreTerminal", "HeaderParser", "maxEncodedBytes", "initialBytes", "Base64Decoder", "QoiDecoder", "data", "start", "end", "dataPos", "success", "seqType", "w", "CELL_SIZE_DEFAULT", "h", "scale", "report", "cond", "metrics", "UNSUPPORTED_TYPE", "imageType", "blob", "canvas", "ImageRenderer", "bm", "e", "cw", "ch", "width", "height", "rw", "rh", "wf", "hf", "f", "s", "total", "cdim", "import_Base64Decoder", "parseKittyCommand", "data", "cmd", "parts", "part", "eqIdx", "key", "value", "numValue", "DECODER_OK", "KittyGraphicsHandler", "_opts", "_renderer", "_kittyStorage", "_coreTerminal", "key", "pending", "data", "start", "end", "controlEnd", "i", "copyLength", "parseKittyCommand", "payloadStart", "pendingKey", "previousEncodedSize", "decoderToRelease", "Base64Decoder", "success", "cmd", "isMoreComing", "decodeError", "finalCmd", "decoder", "imageBytes", "result", "str", "bytes", "id", "image", "quiet", "format", "width", "height", "bytesPerPixel", "expectedBytes", "message", "placementId", "isOk", "pPart", "response", "bitmap", "cropX", "cropY", "cropW", "cropH", "maxCropW", "maxCropH", "finalCropW", "finalCropH", "cropped", "cw", "CELL_SIZE_DEFAULT", "ch", "imgCols", "imgRows", "w", "h", "buffer", "savedX", "savedY", "savedYbase", "layer", "scaled", "xOffset", "yOffset", "canvasW", "canvasH", "offsetCanvas", "ImageRenderer", "offsetCtx", "offsetBitmap", "zIndex", "scrolled", "e", "blob", "url", "img", "resolve", "reject", "canvas", "pixelCount", "src32", "dst32", "alignedPixels", "srcOffset", "dstOffset", "b0", "b1", "b2", "srcByte", "dstByte", "compressed", "ds", "writer", "chunks", "reader", "done", "value", "totalLength", "sum", "chunk", "offset", "_KittyImageStorage", "_storage", "storageId", "kittyId", "id", "imageData", "imageId", "oldStorageId", "image", "scrolling", "layer", "zIndex", "KittyImageStorage", "import_Colors", "import_Decoder", "MEM_PERMA_LIMIT", "DEFAULT_PALETTE", "SixelHandler", "_opts", "_storage", "_coreTerminal", "d", "params", "fillColor", "extractActiveBg", "data", "start", "end", "e", "success", "width", "height", "canvas", "ImageRenderer", "attr", "colors", "bg", "convertLe", "t", "color", "SixelImageStorage", "_storage", "_opts", "_renderer", "_terminal", "img", "height", "cellSize", "CELL_SIZE_DEFAULT", "rows", "i", "IIPImageStorage", "_storage", "img", "DEFAULT_OPTIONS", "MAX_SIXEL_PALETTE_SIZE", "ImageAddon", "opts", "Emitter", "DEFAULT_OPTIONS", "obj", "args", "terminal", "ImageRenderer", "ImageStorage", "windowOps", "params", "range", "metrics", "sixelStorage", "SixelImageStorage", "sixelHandler", "SixelHandler", "iipStorage", "IIPImageStorage", "iipHandler", "IIPHandler", "kittyStorage", "KittyImageStorage", "kittyHandler", "KittyGraphicsHandler", "handler", "limit", "value", "x", "y", "s", "i", "MAX_SIXEL_PALETTE_SIZE", "width", "height", "cellSize", "CELL_SIZE_DEFAULT"] -+ "sourcesContent": [null, "\"use strict\";\n/**\n * Copyright (c) 2022, 2026 Joerg Breitbart\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InWasm = InWasm;\nlet z = (s) => {\n if (Uint8Array.fromBase64)\n return Uint8Array.fromBase64(s);\n if (typeof Buffer !== 'undefined')\n return Buffer.from(s, 'base64');\n const b = atob(s);\n const r = new Uint8Array(b.length);\n for (let i = 0; i < r.length; ++i)\n r[i] = b.charCodeAt(i);\n return r;\n};\nfunction InWasm(def) {\n if (def.d) {\n const { t, s, d } = def;\n let b;\n let m;\n const W = WebAssembly;\n if (t === 0 /* OutputType.INSTANCE */) {\n if (s)\n return (e) => new W.Instance(m || (m = new W.Module(b || (b = z(d)))), e);\n return (e) => m\n ? W.instantiate(m, e)\n : W.instantiate(b || (b = z(d)), e).then(r => (m = r.module) && r.instance);\n }\n if (t === 1 /* OutputType.MODULE */) {\n if (s)\n return () => m || (m = new W.Module(b || (b = z(d))));\n return () => m\n ? Promise.resolve(m)\n : W.compile(b || (b = z(d))).then(r => m = r);\n }\n if (s)\n return () => b || (b = z(d));\n return () => Promise.resolve(b || (b = z(d)));\n }\n if (typeof _wasmCtx === 'undefined')\n throw new Error('must run \"inwasm\"');\n _wasmCtx.add(def);\n}\n//# sourceMappingURL=index.js.map", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023, 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\n/**\n * wasm base64 decoder.\n */\nconst wasmDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#828e69684093b2c6:rdef-start:\"decode\"*/{s:1,t:0,d:'AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML'}/*inwasm#828e69684093b2c6:rdef-end:\"decode\"*/);\n// SIMD version (speedup ~1.4x, not covered by tests yet)\n/*\nconst wasmDecode = InWasm({\n name: 'decode',\n type: OutputType.INSTANCE,\n mode: OutputMode.SYNC,\n srctype: 'Clang-C',\n imports: {\n env: { memory: new WebAssembly.Memory({ initial: 1 }) }\n },\n exports: {\n dec: () => 0,\n end: () => 0\n },\n compile: {\n switches: ['-msimd128', '-Wl,-z,stack-size=0', '-Wl,--stack-first']\n },\n code: `\n #include \n typedef struct {\n unsigned int wp;\n unsigned int sp;\n unsigned int dp;\n unsigned int e_size;\n unsigned int dummy[4];\n unsigned char data[0];\n } State;\n\n unsigned int *D0 = (unsigned int *) ${P32.D0 * 4};\n unsigned int *D1 = (unsigned int *) ${P32.D1 * 4};\n unsigned int *D2 = (unsigned int *) ${P32.D2 * 4};\n unsigned int *D3 = (unsigned int *) ${P32.D3 * 4};\n State *state = (State *) ${P32.STATE * 4};\n\n #define packed_byte(x) wasm_i8x16_splat((char) x)\n #define packed_dword(x) wasm_i32x4_splat(x)\n #define masked(x, mask) wasm_v128_and(x, wasm_i32x4_splat(mask))\n\n __attribute__((noinline)) int dec() {\n unsigned int nsp = (state->wp - 1) & ~3;\n unsigned char *src = state->data + state->sp;\n unsigned char *end = state->data + nsp;\n unsigned char *dst = state->data + state->dp;\n unsigned int error = 0;\n\n v128_t err = wasm_i8x16_splat(0);\n unsigned char *end16 = state->data + (nsp & ~15);\n while (src < end16) {\n v128_t data = wasm_v128_load((v128_t *) src);\n\n // wasm-simd rewrite of http://0x80.pl/notesen/2016-01-17-sse-base64-decoding.html#vector-lookup-pshufb\n const v128_t higher_nibble = wasm_u32x4_shr(data, 4) & packed_byte(0x0f);\n const char linv = 1;\n const char hinv = 0;\n\n const v128_t lower_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n linv, linv, 0x2b, 0x30,\n 0x41, 0x50, 0x61, 0x70,\n linv, linv, linv, linv,\n linv, linv, linv, linv\n );\n const v128_t upper_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n hinv, hinv, 0x2b, 0x39,\n 0x4f, 0x5a, 0x6f, 0x7a,\n hinv, hinv, hinv, hinv,\n hinv, hinv, hinv, hinv\n );\n // the difference between the shift and lower bound\n const v128_t shift_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n 0x00, 0x00, 0x3e - 0x2b, 0x34 - 0x30,\n 0x00 - 0x41, 0x0f - 0x50, 0x1a - 0x61, 0x29 - 0x70,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00\n );\n\n const v128_t upper_bound = wasm_i8x16_swizzle(upper_bound_LUT, higher_nibble);\n const v128_t lower_bound = wasm_i8x16_swizzle(lower_bound_LUT, higher_nibble);\n\n const v128_t below = wasm_i8x16_lt(data, lower_bound);\n const v128_t above = wasm_i8x16_gt(data, upper_bound);\n const v128_t eq_2f = wasm_i8x16_eq(data, packed_byte(0x2f));\n\n // in_range = not (below or above) or eq_2f\n // outside = not in_range = below or above and not eq_2f (from deMorgan law)\n const v128_t outside = wasm_v128_andnot(eq_2f, above | below);\n err = wasm_v128_or(err, outside);\n\n const v128_t shift = wasm_i8x16_swizzle(shift_LUT, higher_nibble);\n const v128_t t0 = wasm_i8x16_add(data, shift);\n v128_t v = wasm_i8x16_add(t0, wasm_v128_and(eq_2f, packed_byte(-3)));\n\n // pack bytes\n const v128_t ca = masked(v, 0x003f003f);\n const v128_t db = masked(v, 0x3f003f00);\n const v128_t t00 = wasm_v128_or(wasm_u32x4_shr(db, 8), wasm_i32x4_shl(ca, 6));\n v128_t res = wasm_v128_or(wasm_u32x4_shr(t00, 16), wasm_i32x4_shl(t00, 12));\n res = wasm_i8x16_swizzle(res, wasm_i8x16_const(2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, 16, 16, 16, 16));\n\n wasm_v128_store((v128_t *) dst, res);\n dst += 12;\n src += 16;\n }\n //if (wasm_i8x16_bitmask(err) != 0) return -1;\n if (wasm_v128_any_true(err)) return -1;\n\n // operate on 4-byte blocks\n while (src < end) {\n error |= *((unsigned int *) dst) = D0[src[0]] | D1[src[1]] | D2[src[2]] | D3[src[3]];\n dst += 3;\n src += 4;\n }\n if (error >> 24) return -1;\n state->sp = nsp;\n state->dp = dst - state->data;\n return 0;\n }\n\n int end() {\n int rem = state->wp - state->sp;\n if (rem > 4 && dec()) return -1;\n rem = state->wp - state->sp;\n if (rem < 2) return -1;\n\n unsigned char *src = state->data + state->sp;\n if (rem == 4) {\n if (src[3] == 61) rem--;\n if (src[2] == 61) rem--;\n }\n unsigned int accu = D0[src[0]] | D1[src[1]];\n int dp = 1;\n if (rem > 2) {\n accu |= D2[src[2]];\n dp++;\n if (rem == 4) {\n accu |= D3[src[3]];\n dp++;\n }\n }\n if (accu >> 24) return -1;\n *((unsigned int *) (state->data + state->dp)) = accu;\n state->dp += dp;\n return 0;\n }\n `\n});\n*/\n// base64 map\nconst MAP = new Uint8Array('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n .split('')\n .map(el => el.charCodeAt(0)));\n// init decoder maps in LE order\nconst D = new Uint32Array(1024);\nD.fill(0xFF000000);\nfor (let i = 0; i < MAP.length; ++i)\n D[MAP[i]] = i << 2;\nfor (let i = 0; i < MAP.length; ++i)\n D[256 + MAP[i]] = i >> 4 | ((i << 4) & 0xFF) << 8;\nfor (let i = 0; i < MAP.length; ++i)\n D[512 + MAP[i]] = (i >> 2) << 8 | ((i << 6) & 0xFF) << 16;\nfor (let i = 0; i < MAP.length; ++i)\n D[768 + MAP[i]] = i << 16;\nconst EMPTY = new Uint8Array(0);\n/**\n * base64 stream decoder.\n *\n * Features / assumptions:\n * - lazy chunkwise decoding\n * - errors out on any non base64 chars (no support for NL formatted base64)\n * - decodes in wasm\n * - inplace decoding to save memory\n * - supports a keepSize for lazy memory release\n */\nclass Base64Decoder {\n /**\n * @param keepSize Keep the wasm instance below this limit when calling `release()`.\n * @param maxBytes Max allowed bytes to allocate.\n * @param initialBytes Initial bytes to allocate.\n */\n constructor(keepSize, maxBytes, initialBytes) {\n this._inst = null;\n this._ended = true;\n this._bytes = 0;\n this.keepSize = keepSize !== null && keepSize !== void 0 ? keepSize : 1048576 /* Bytes.KEEP */;\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : 4294901760 /* Bytes.MAX */;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : 32768 /* Bytes.INITIAL */;\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw new Error('invalid byte settings');\n }\n }\n /**\n * Currently decoded bytes (borrowed).\n * Must be accessed before calling `release` or `init`.\n */\n get data8() {\n return this._inst ? this._d.subarray(0, this._m32[1282 /* P32.STATE_DP */]) : EMPTY;\n }\n /**\n * Release memory conditionally based on `keepSize`.\n * If memory gets released, also the wasm instance will be freed and recreated on next `init`,\n * otherwise the instance will be reused.\n */\n release() {\n if (!this._inst)\n return;\n if (this._bytes > this.keepSize) {\n this._inst = this._m32 = this._d = this._mem = null;\n }\n else {\n this._m32[1280 /* P32.STATE_WP */] = 0;\n this._m32[1281 /* P32.STATE_SP */] = 0;\n this._m32[1282 /* P32.STATE_DP */] = 0;\n }\n }\n /**\n * Initializes the decoder for new base64 data.\n * Must be called before doing any decoding attempts.\n * The method will either spawn a new wasm instance or grow\n * the needed memory of an existing instance.\n * @param maxBytes Max allowed bytes to allocate (overwrites ctor value).\n * @param initialBytes Initial bytes to allocate (overwrites ctor value).\n */\n init(maxBytes, initialBytes) {\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : this.maxBytes;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : Math.min(this._bytes, this.maxBytes);\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw Error('invalid byte settings');\n }\n let m = this._m32;\n const bytes = this._bytes + 5152 /* Bytes._DATA_OFFSET */;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmDecode({ env: { memory: this._mem } });\n m = new Uint32Array(this._mem.buffer, 0);\n m.set(D, 256 /* P32.D0 */);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n m = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n m[1280 /* P32.STATE_WP */] = 0;\n m[1281 /* P32.STATE_SP */] = 0;\n m[1282 /* P32.STATE_DP */] = 0;\n this._m32 = m;\n this._ended = false;\n }\n /**\n * Realloc memory. Realloc only happens, if the requested\n * size doesn't fit in the current memory.\n * The new size will be capped by `maxBytes`.\n * @param requested Bytes to be stored.\n */\n _realloc(requested) {\n const needed = this._m32[1280 /* P32.STATE_WP */] + requested;\n if (this._bytes < needed) {\n if (needed > this.maxBytes) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n let newSize = this._bytes;\n while ((newSize *= 2) < needed) { }\n newSize = Math.min(newSize, this.maxBytes);\n if (newSize < needed) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n if (newSize + 5152 /* Bytes._DATA_OFFSET */ > this._mem.buffer.byteLength) {\n const addPages = Math.ceil((newSize + 5152 /* Bytes._DATA_OFFSET */ - this._mem.buffer.byteLength) / 65536);\n this._mem.grow(addPages);\n this._m32 = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n this._bytes = newSize;\n }\n return 0 /* DecodeStatus.OK */;\n }\n /**\n * Put bytes in `data` into the decoder.\n * Additionally decodes the payload, if it reached 2^17 bytes.\n * The return value indicates the type of issue.\n * @param data Bytes to be loaded.\n */\n put(data) {\n if (!this._inst || this._ended) {\n return -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n if (this._realloc(data.length)) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n const m = this._m32;\n this._d.set(data, m[1280 /* P32.STATE_WP */]);\n m[1280 /* P32.STATE_WP */] += data.length;\n // max chunk in input handler is 2^17, try to run in \"tandem mode\"\n return m[1280 /* P32.STATE_WP */] - m[1281 /* P32.STATE_SP */] >= 131072\n ? this._inst.exports.dec()\n : 0 /* DecodeStatus.OK */;\n }\n /**\n * End the current decoding.\n * Also decodes leftover payload from previous put calls.\n */\n end() {\n this._ended = true;\n return this._inst\n ? this._inst.exports.end()\n : -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n /**\n * Bytes loaded into the decoder.\n */\n get loadedBytes() {\n return this._inst\n ? this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n /**\n * Free bytes to feed to the decoder.\n */\n get freeBytes() {\n return this._inst\n ? this.maxBytes - this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n}\nexports.default = Base64Decoder;\n//# sourceMappingURL=Base64Decoder.wasm.js.map", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\nconst wasmQoiDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#459f9e1bfb80b1a8:rdef-start:\"qoi_decode\"*/{s:1,t:0,d:'AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=='}/*inwasm#459f9e1bfb80b1a8:rdef-end:\"qoi_decode\"*/);\nclass QoiDecoder {\n constructor(keepSize) {\n this.keepSize = keepSize;\n this.width = 0;\n this.height = 0;\n }\n decode(d) {\n this.width = d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7];\n this.height = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];\n const pixels = this.width * this.height;\n const ib = pixels * 4;\n const dl = d.length;\n /**\n * byte/offset calculation:\n * To save some memory we dont reserve full memory for decoded + encoded,\n * but place encoded at the end of decoded plus 50% security distance\n * to avoid reads before writes positions:\n *\n * encoded < decoded (good compression)\n * enc ####################\n * dec #######################################\n * ^ ^\n * DST_P CHUNK_P\n *\n * encoded > decoded (degenerated compression, should not happen)\n * enc ##############################\n * dec ####################\n * ^ ^\n * DST_P CHUNK_P\n *\n * There is still a chance for overlapping r/w positions in case the compressed\n * data has very different pixel progression, yet the 50% security distance\n * should deal with that, as QOI will bloat data by 25% at max (RGB -> OP byte + RGB).\n * Since we always assume RGBA at decoding stage, the possible bloat reduces to 20% at max.\n */\n const bytes = Math.max(ib, dl) + (Math.min(ib, dl) >> 1) + 4096;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmQoiDecode({ env: { memory: this._mem } });\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n this._d = null;\n }\n if (!this._d) {\n this._d = new Uint8Array(this._mem.buffer);\n }\n // put src data at the end of memory, also align to 256\n const chunkP = (this._mem.buffer.byteLength - dl) & ~0xFF;\n this._d.set(d, chunkP);\n this._inst.exports.dec(chunkP, dl, pixels);\n return this._d.subarray(1024 /* P8.DST_P */, 1024 /* P8.DST_P */ + ib);\n }\n release() {\n if (!this._inst)\n return;\n if (this._mem.buffer.byteLength > this.keepSize) {\n this._inst = this._d = this._mem = null;\n }\n }\n}\nexports.default = QoiDecoder;\n//# sourceMappingURL=QoiDecoder.wasm.js.map", null, null, "/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal lifecycle utilities for xterm.js core.\n * Simplified from VS Code's lifecycle.ts - no tracking/leak detection.\n */\n\nexport interface IDisposable {\n dispose(): void;\n}\n\nexport function toDisposable(fn: () => void): IDisposable {\n return { dispose: fn };\n}\n\nexport function dispose(disposable: T): T;\nexport function dispose(disposable: T | undefined): T | undefined;\nexport function dispose(disposables: T[]): T[];\nexport function dispose(arg: T | T[] | undefined): T | T[] | undefined {\n if (!arg) {\n return arg;\n }\n if (Array.isArray(arg)) {\n for (const d of arg) {\n d.dispose();\n }\n return [];\n }\n arg.dispose();\n return arg;\n}\n\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n return toDisposable(() => dispose(disposables));\n}\n\nexport class DisposableStore implements IDisposable {\n private readonly _disposables = new Set();\n private _isDisposed = false;\n\n public get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n public add(o: T): T {\n if (this._isDisposed) {\n o.dispose();\n } else {\n this._disposables.add(o);\n }\n return o;\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n\n public clear(): void {\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n}\n\nexport abstract class Disposable implements IDisposable {\n public static readonly None: IDisposable = Object.freeze({ dispose() { } });\n\n protected readonly _store = new DisposableStore();\n\n public dispose(): void {\n this._store.dispose();\n }\n\n protected _register(o: T): T {\n return this._store.add(o);\n }\n}\n\nexport class MutableDisposable implements IDisposable {\n private _value: T | undefined;\n private _isDisposed = false;\n\n public get value(): T | undefined {\n return this._isDisposed ? undefined : this._value;\n }\n\n public set value(value: T | undefined) {\n if (this._isDisposed || value === this._value) {\n return;\n }\n this._value?.dispose();\n this._value = value;\n }\n\n public clear(): void {\n this.value = undefined;\n }\n\n public dispose(): void {\n this._isDisposed = true;\n this._value?.dispose();\n this._value = undefined;\n }\n}\n", "/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal event utilities for xterm.js core.\n * Simplified from VS Code's event.ts - no leak detection/profiling.\n */\n\nimport { IDisposable, DisposableStore, toDisposable } from './Lifecycle';\n\nexport interface IEvent {\n (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\n}\n\nexport class Emitter {\n private _listeners: { fn: (e: T) => any, thisArgs: any }[] = [];\n private _disposed = false;\n private _event: IEvent | undefined;\n\n public get event(): IEvent {\n if (this._event) {\n return this._event;\n }\n this._event = (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n if (this._disposed) {\n return toDisposable(() => {});\n }\n\n const entry = { fn: listener, thisArgs };\n this._listeners = this._listeners.slice();\n this._listeners.push(entry);\n\n const result = toDisposable(() => {\n const idx = this._listeners.indexOf(entry);\n if (idx !== -1) {\n this._listeners = this._listeners.slice();\n this._listeners.splice(idx, 1);\n }\n });\n\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(result);\n } else {\n disposables.add(result);\n }\n }\n\n return result;\n };\n return this._event;\n }\n\n public fire(event: T): void {\n if (this._disposed || !this._listeners.length) {\n return;\n }\n if (this._listeners.length === 1) {\n this._listeners[0].fn.call(this._listeners[0].thisArgs, event);\n return;\n }\n const listeners = this._listeners;\n for (let i = 0, len = listeners.length; i < len; ++i) {\n listeners[i].fn.call(listeners[i].thisArgs, event);\n }\n }\n\n public dispose(): void {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n this._listeners.length = 0;\n }\n}\n\nexport namespace EventUtils {\n export function forward(from: IEvent, to: Emitter): IDisposable {\n return from(e => to.fire(e));\n }\n\n export function map(event: IEvent, map: (i: I) => O): IEvent {\n return (listener: (e: O) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n return event(i => listener.call(thisArgs, map(i)), undefined, disposables);\n };\n }\n\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent {\n return (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n const store = new DisposableStore();\n for (const event of events) {\n store.add(event(e => listener.call(thisArgs, e)));\n }\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(store);\n } else {\n disposables.add(store);\n }\n }\n return store;\n };\n }\n\n export function runAndSubscribe(event: IEvent, handler: (e: T) => void, initial: T): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void, initial?: T): IDisposable {\n handler(initial);\n return event(e => handler(e));\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { toRGBA8888 } from 'sixel/lib/Colors';\nimport { IDisposable } from '@xterm/xterm';\nimport { ICellSize, ImageLayer, ITerminalExt, IImageSpec, IRenderDimensions, IRenderService } from './Types';\nimport { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';\n\nconst enum Constants {\n PLACEHOLDER_LENGTH = 4096,\n PLACEHOLDER_HEIGHT = 24\n}\n\n/**\n * ImageRenderer - terminal frontend extension:\n * - provide primitives for canvas, ImageData, Bitmap (static)\n * - add canvas layer to DOM (browser only for now)\n * - draw image tiles onRender\n */\nexport class ImageRenderer extends Disposable implements IDisposable {\n /** @deprecated Kept for backward compat \u2014 points to top layer canvas. */\n public get canvas(): HTMLCanvasElement | undefined { return this._layers.get('top')?.canvas; }\n private _layers = new Map();\n private _placeholder: HTMLCanvasElement | undefined;\n private _placeholderBitmap: ImageBitmap | undefined;\n private _optionsRefresh = this._register(new MutableDisposable());\n private _oldOpen: ((parent: HTMLElement) => void) | undefined;\n private _renderService: IRenderService | undefined;\n private _oldSetRenderer: ((renderer: any) => void) | undefined;\n\n // drawing primitive - canvas\n public static createCanvas(localDocument: Document | undefined, width: number, height: number): HTMLCanvasElement {\n /**\n * NOTE: We normally dont care, from which document the canvas\n * gets created, so we can fall back to global document,\n * if the terminal has no document associated yet.\n * This way early image loads before calling .open keep working\n * (still discouraged though, as the metrics will be screwed up).\n * Only the DOM output canvas should be on the terminal's document,\n * which gets explicitly checked in `insertLayerToDom`.\n */\n const canvas = (localDocument ?? document).createElement('canvas');\n canvas.width = width | 0;\n canvas.height = height | 0;\n return canvas;\n }\n\n // drawing primitive - ImageData with optional buffer\n public static createImageData(ctx: CanvasRenderingContext2D, width: number, height: number, buffer?: ArrayBuffer): ImageData {\n if (typeof ImageData !== 'function') {\n const imgData = ctx.createImageData(width, height);\n if (buffer) {\n imgData.data.set(new Uint8ClampedArray(buffer, 0, width * height * 4));\n }\n return imgData;\n }\n return buffer\n ? new ImageData(new Uint8ClampedArray(buffer, 0, width * height * 4), width, height)\n : new ImageData(width, height);\n }\n\n // drawing primitive - ImageBitmap\n public static createImageBitmap(img: ImageBitmapSource): Promise {\n if (typeof createImageBitmap !== 'function') {\n return Promise.resolve(undefined);\n }\n return createImageBitmap(img);\n }\n\n\n constructor(private _terminal: ITerminalExt) {\n super();\n this._oldOpen = this._terminal._core.open;\n this._terminal._core.open = (parent: HTMLElement): void => {\n this._oldOpen?.call(this._terminal._core, parent);\n this._open();\n };\n if (this._terminal._core.screenElement) {\n this._open();\n }\n // hack to spot fontSize changes\n this._optionsRefresh.value = this._terminal._core.optionsService.onOptionChange(option => {\n if (option === 'fontSize') {\n this.rescaleCanvas();\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n });\n this._register(toDisposable(() => {\n this.removeLayerFromDom();\n this.removeLayerFromDom('bottom');\n if (this._terminal._core && this._oldOpen) {\n this._terminal._core.open = this._oldOpen;\n this._oldOpen = undefined;\n }\n if (this._renderService && this._oldSetRenderer) {\n this._renderService.setRenderer = this._oldSetRenderer;\n this._oldSetRenderer = undefined;\n }\n this._renderService = undefined;\n this._layers.clear();\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }));\n }\n\n /**\n * Enable the placeholder.\n */\n public showPlaceholder(value: boolean): void {\n if (value) {\n if (!this._placeholder && this.cellSize.height !== -1) {\n this._createPlaceHolder(Math.max(this.cellSize.height + 1, Constants.PLACEHOLDER_HEIGHT));\n }\n } else {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n\n /**\n * Dimensions of the terminal.\n * Forwarded from internal render service.\n */\n public get dimensions(): IRenderDimensions | undefined {\n return this._terminal.dimensions;\n }\n\n /**\n * Current cell size (float).\n */\n public get cellSize(): ICellSize {\n return {\n width: this.dimensions?.css.cell.width || -1,\n height: this.dimensions?.css.cell.height || -1\n };\n }\n\n /**\n * Clear a region of the image layer canvas.\n */\n public clearLines(start: number, end: number, layer?: ImageLayer): void {\n const y = start * (this.dimensions?.css.cell.height || 0);\n const w = this.dimensions?.css.canvas.width || 0;\n const h = (end + 1 - start) * (this.dimensions?.css.cell.height || 0);\n if (!layer || layer === 'top') {\n this._layers.get('top')?.clearRect(0, y, w, h);\n }\n if (!layer || layer === 'bottom') {\n this._layers.get('bottom')?.clearRect(0, y, w, h);\n }\n }\n\n /**\n * Clear whole image canvas.\n */\n public clearAll(layer?: ImageLayer): void {\n if (!layer || layer === 'top') {\n const ctx = this._layers.get('top');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n if (!layer || layer === 'bottom') {\n const ctx = this._layers.get('bottom');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n }\n\n /**\n * Draw neighboring tiles on the image layer canvas.\n */\n public draw(imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get(imgSpec.layer);\n if (!ctx) {\n return;\n }\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const { width: sourceWidth, height: sourceHeight } = imgSpec.actualCellSize;\n const cols = Math.ceil(img.width / sourceWidth);\n\n const sx = (tileId % cols) * sourceWidth;\n const sy = Math.floor(tileId / cols) * sourceHeight;\n const dx = col * width;\n const dy = row * height;\n\n // safari bug: never access image source out of bounds\n const finalWidth = count * sourceWidth + sx > img.width ? img.width - sx : count * sourceWidth;\n const finalHeight = sy + sourceHeight > img.height ? img.height - sy : sourceHeight;\n\n // Floor all pixel offsets to get stable tile mapping without any overflows.\n // Note: For not pixel perfect aligned cells like in the DOM renderer\n // this will move a tile slightly to the top/left (subpixel range, thus ignore it).\n // FIX #34: avoid striping on displays with pixelDeviceRatio != 1 by ceiling height and width\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.ceil(finalWidth), Math.ceil(finalHeight),\n Math.floor(dx), Math.floor(dy), Math.ceil(finalWidth * width / sourceWidth), Math.ceil(finalHeight * height / sourceHeight)\n );\n }\n\n /**\n * Extract a single tile from an image.\n */\n public extractTile(imgSpec: IImageSpec, tileId: number): HTMLCanvasElement | undefined {\n const { width, height } = this.cellSize;\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const { width: sourceWidth, height: sourceHeight } = imgSpec.actualCellSize;\n const cols = Math.ceil(img.width / sourceWidth);\n const sx = (tileId % cols) * sourceWidth;\n const sy = Math.floor(tileId / cols) * sourceHeight;\n const finalWidth = sourceWidth + sx > img.width ? img.width - sx : sourceWidth;\n const finalHeight = sy + sourceHeight > img.height ? img.height - sy : sourceHeight;\n\n const canvas = ImageRenderer.createCanvas(this.document, Math.ceil(finalWidth * width / sourceWidth), Math.ceil(finalHeight * height / sourceHeight));\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.floor(finalWidth), Math.floor(finalHeight),\n 0, 0, canvas.width, canvas.height\n );\n return canvas;\n }\n }\n\n /**\n * Draw a line with placeholder on the image layer canvas.\n */\n public drawPlaceholder(col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get('top');\n if (ctx) {\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n if (!this._placeholder) {\n this._createPlaceHolder(Math.max(height + 1, Constants.PLACEHOLDER_HEIGHT));\n } else if (height >= this._placeholder!.height) {\n this._createPlaceHolder(height + 1);\n }\n if (!this._placeholder) return;\n ctx.drawImage(\n this._placeholderBitmap ?? this._placeholder!,\n col * width,\n (row * height) % 2 ? 0 : 1, // needs %2 offset correction\n width * count,\n height,\n col * width,\n row * height,\n width * count,\n height\n );\n }\n }\n\n /**\n * Rescale image layer canvas if needed.\n * Checked once from `ImageStorage.render`.\n */\n public rescaleCanvas(): void {\n const w = this.dimensions?.css.canvas.width || 0;\n const h = this.dimensions?.css.canvas.height || 0;\n for (const ctx of this._layers.values()) {\n if (ctx.canvas.width !== w || ctx.canvas.height !== h) {\n ctx.canvas.width = w;\n ctx.canvas.height = h;\n }\n }\n }\n\n /**\n * Rescale image in storage if needed.\n */\n private _rescaleImage(spec: IImageSpec, currentWidth: number, currentHeight: number): void {\n if (currentWidth === spec.actualCellSize.width && currentHeight === spec.actualCellSize.height) {\n return;\n }\n const { width: originalWidth, height: originalHeight } = spec.origCellSize;\n if (currentWidth === originalWidth && currentHeight === originalHeight) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const scaledWidth = Math.ceil(spec.orig!.width * currentWidth / originalWidth);\n const scaledHeight = Math.ceil(spec.orig!.height * currentHeight / originalHeight);\n // Upscale visible tiles directly; a full zoomed copy can dwarf the image budget.\n if (scaledWidth * scaledHeight > spec.orig!.width * spec.orig!.height) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const canvas = ImageRenderer.createCanvas(this.document, scaledWidth, scaledHeight);\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(spec.orig!, 0, 0, canvas.width, canvas.height);\n spec.actual = canvas;\n spec.actualCellSize.width = currentWidth;\n spec.actualCellSize.height = currentHeight;\n }\n }\n\n /**\n * Lazy init for the renderer.\n */\n private _open(): void {\n this._renderService = this._terminal._core._renderService;\n this._oldSetRenderer = this._renderService.setRenderer.bind(this._renderService);\n this._renderService.setRenderer = (renderer: any) => {\n for (const key of [...this._layers.keys()]) {\n this.removeLayerFromDom(key);\n }\n this._oldSetRenderer?.call(this._renderService, renderer);\n };\n }\n\n public insertLayerToDom(layer: ImageLayer = 'top'): void {\n // make sure that the terminal is attached to a document and to DOM\n if (!this.document || !this._terminal._core.screenElement) {\n console.warn('image addon: cannot insert output canvas to DOM, missing document or screenElement');\n return;\n }\n if (this._layers.has(layer)) {\n return;\n }\n const canvas = ImageRenderer.createCanvas(\n this.document, this.dimensions?.css.canvas.width || 0,\n this.dimensions?.css.canvas.height || 0\n );\n canvas.classList.add(`xterm-image-layer-${layer}`);\n const screenElement = this._terminal._core.screenElement;\n // Use isolation to create a stacking context without overriding z-index,\n // which would conflict with integrators (e.g. VS Code) that set their\n // own z-index on the screen element.\n screenElement.style.isolation = 'isolate';\n if (layer === 'bottom') {\n // Use z-index:-1 so it paints behind non-positioned text elements.\n // The screen element needs to be a stacking context (via isolation)\n // to contain the negative z-index, otherwise it would go behind the\n // entire terminal.\n canvas.style.zIndex = '-1';\n screenElement.insertBefore(canvas, screenElement.firstChild);\n } else {\n // Explicit z-index ensures the image canvas reliably stacks above\n // the text layer (DOM renderer rows). z-index: 0 is below the\n // selection overlay (z-index: 1).\n canvas.style.zIndex = '0';\n screenElement.appendChild(canvas);\n }\n const ctx = canvas.getContext('2d', { alpha: true });\n if (!ctx) {\n canvas.remove();\n return;\n }\n this._layers.set(layer, ctx);\n this.clearAll(layer);\n }\n\n public removeLayerFromDom(layer: ImageLayer = 'top'): void {\n const ctx = this._layers.get(layer);\n if (ctx) {\n ctx.canvas.remove();\n this._layers.delete(layer);\n }\n }\n\n public hasLayer(layer: ImageLayer): boolean {\n return this._layers.has(layer);\n }\n\n private _createPlaceHolder(height: number = Constants.PLACEHOLDER_HEIGHT): void {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n\n // create blueprint to fill placeholder with\n const bWidth = 32; // must be 2^n\n const blueprint = ImageRenderer.createCanvas(this.document, bWidth, height);\n const ctx = blueprint.getContext('2d', { alpha: false });\n if (!ctx) return;\n const imgData = ImageRenderer.createImageData(ctx, bWidth, height);\n const d32 = new Uint32Array(imgData.data.buffer);\n const black = toRGBA8888(0, 0, 0);\n const white = toRGBA8888(255, 255, 255);\n d32.fill(black);\n for (let y = 0; y < height; ++y) {\n const shift = y % 2;\n const offset = y * bWidth;\n for (let x = 0; x < bWidth; x += 2) {\n d32[offset + x + shift] = white;\n }\n }\n ctx.putImageData(imgData, 0, 0);\n\n // create placeholder line, width aligned to blueprint width\n const width = (screen.width + bWidth - 1) & ~(bWidth - 1) || Constants.PLACEHOLDER_LENGTH;\n this._placeholder = ImageRenderer.createCanvas(this.document, width, height);\n const ctx2 = this._placeholder.getContext('2d', { alpha: false });\n if (!ctx2) {\n this._placeholder = undefined;\n return;\n }\n for (let i = 0; i < width; i += bWidth) {\n ctx2.drawImage(blueprint, i, 0);\n }\n const placeholder = this._placeholder;\n ImageRenderer.createImageBitmap(placeholder).then(bitmap => {\n if (this._placeholder !== placeholder) bitmap?.close();\n else this._placeholderBitmap = bitmap;\n }).catch(() => {});\n }\n\n public get document(): Document | undefined {\n return this._terminal._core._coreBrowserService?.window.document;\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageRenderer } from './ImageRenderer';\nimport {\n ITerminalExt, IExtendedAttrsImage, IImageAddonOptions, IImageSpec,\n IBufferLineExt, BgFlags, Cell, Content, ICellSize, ExtFlags, Attributes,\n UnderlineStyle, IAddImageOpts\n} from './Types';\n\n\n// fallback default cell size\nexport const CELL_SIZE_DEFAULT: ICellSize = {\n width: 7,\n height: 14\n};\n\n/**\n * Extend extended attribute to also hold image tile information.\n *\n * Object definition is copied from base repo to fully mimick its behavior.\n * Image data is added as additional public properties `imageId` and `tileId`.\n */\nclass ExtendedAttrsImage implements IExtendedAttrsImage {\n private _ext: number = 0;\n public get ext(): number {\n if (this._urlId) {\n return (\n (this._ext & ~ExtFlags.UNDERLINE_STYLE) |\n (this.underlineStyle << 26)\n );\n }\n return this._ext;\n }\n public set ext(value: number) { this._ext = value; }\n\n public get underlineStyle(): UnderlineStyle {\n // Always return the URL style if it has one\n if (this._urlId) {\n return UnderlineStyle.DASHED;\n }\n return (this._ext & ExtFlags.UNDERLINE_STYLE) >> 26;\n }\n public set underlineStyle(value: UnderlineStyle) {\n this._ext &= ~ExtFlags.UNDERLINE_STYLE;\n this._ext |= (value << 26) & ExtFlags.UNDERLINE_STYLE;\n }\n\n public get underlineColor(): number {\n return this._ext & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n public set underlineColor(value: number) {\n this._ext &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n this._ext |= value & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n\n public get underlineVariantOffset(): number {\n const val = (this._ext & ExtFlags.VARIANT_OFFSET) >> 29;\n if (val < 0) {\n return val ^ 0xFFFFFFF8;\n }\n return val;\n }\n public set underlineVariantOffset(value: number) {\n this._ext &= ~ExtFlags.VARIANT_OFFSET;\n this._ext |= (value << 29) & ExtFlags.VARIANT_OFFSET;\n }\n\n private _urlId: number = 0;\n public get urlId(): number {\n return this._urlId;\n }\n public set urlId(value: number) {\n this._urlId = value;\n }\n\n constructor(\n ext: number = 0,\n urlId: number = 0,\n public imageId = -1,\n public tileId = -1\n ) {\n this._ext = ext;\n this._urlId = urlId;\n }\n\n public clone(): IExtendedAttrsImage {\n /**\n * Technically we dont need a clone variant of ExtendedAttrsImage,\n * as we never clone a cell holding image data.\n * Note: Clone is only meant to be used by the InputHandler for\n * sticky attributes, which is never the case for image data.\n * We still provide a proper clone method to reflect the full ext attr\n * state in case there are future use cases for clone.\n */\n return new ExtendedAttrsImage(this._ext, this._urlId, this.imageId, this.tileId);\n }\n\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0 && this.imageId === -1;\n }\n}\nconst EMPTY_ATTRS = new ExtendedAttrsImage();\n\n\n/**\n * ImageStorage - extension of CoreTerminal:\n * - hold image data\n * - write/read image data to/from buffer\n *\n * TODO: image composition for overwrites\n */\nexport class ImageStorage implements IDisposable {\n // storage\n private _images: Map = new Map();\n // last used id\n private _lastId = 0;\n // last evicted id\n private _lowestId = 0;\n // whether a full clear happened before\n private _fullyCleared = false;\n // whether render should do a full clear\n private _needsFullClear = false;\n // hard limit of stored pixels (fallback limit of 10 MB)\n private _pixelLimit: number = 2500000;\n\n private _viewportMetrics: { cols: number, rows: number };\n public onImageAdded: (() => void) | undefined;\n public onImageDeleted: ((storageId: number) => void) | undefined;\n\n constructor(\n private _terminal: ITerminalExt,\n private _renderer: ImageRenderer,\n private _opts: IImageAddonOptions\n ) {\n try {\n this.setLimit(this._opts.storageLimit);\n } catch (e: unknown) {\n if (e instanceof Error) {\n console.error(e.message);\n }\n console.warn(`storageLimit is set to ${this.getLimit()} MB`);\n }\n this._viewportMetrics = {\n cols: this._terminal.cols,\n rows: this._terminal.rows\n };\n }\n\n public dispose(): void {\n this.reset();\n }\n\n public reset(): void {\n for (const spec of this._images.values()) {\n spec.marker?.dispose();\n }\n // NOTE: marker.dispose above already calls ImageBitmap.close\n // therefore we can just wipe the map here\n this._images.clear();\n this._renderer.clearAll();\n }\n\n public getLimit(): number {\n return this._pixelLimit * 4 / 1000000;\n }\n\n public setLimit(value: number): void {\n if (value < 0.5 || value > 1000) {\n throw RangeError('invalid storageLimit, should be at least 0.5 MB and not exceed 1G');\n }\n this._pixelLimit = (value / 4 * 1000000) >>> 0;\n this._evictOldest(0);\n }\n\n public getUsage(): number {\n return this._getStoredPixels() * 4 / 1000000;\n }\n\n private _getStoredPixels(): number {\n let storedPixels = 0;\n for (const spec of this._images.values()) {\n if (spec.orig) {\n storedPixels += spec.orig.width * spec.orig.height;\n if (spec.actual && spec.actual !== spec.orig) {\n storedPixels += spec.actual.width * spec.actual.height;\n }\n }\n }\n return storedPixels;\n }\n\n private _delImg(id: number): void {\n const spec = this._images.get(id);\n if (!spec) return;\n this._images.delete(id);\n // FIXME: really ugly workaround to get bitmaps deallocated :(\n if (window.ImageBitmap && spec.orig instanceof ImageBitmap) {\n spec.orig.close();\n }\n this.onImageDeleted?.(id);\n }\n\n /**\n * Wipe canvas and images on alternate buffer.\n */\n public wipeAlternate(): void {\n // remove all alternate tagged images\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate') {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n // mark canvas to be wiped on next render\n this._needsFullClear = true;\n this._fullyCleared = false;\n }\n\n /**\n * Delete an image by its internal storage ID.\n * Used by protocols that support explicit deletion (e.g. Kitty a=d).\n */\n public deleteImage(id: number): void {\n const spec = this._images.get(id);\n if (spec) {\n spec.marker?.dispose();\n this._delImg(id);\n }\n }\n\n /**\n * Method to add an image to the storage.\n * @param img - The image to add (canvas or bitmap).\n * @param opts - Options for addImage:\n * - scrolling: When true, cursor advances with the image.\n * When false, image is placed at ORIGIN and cursor does not move.\n * - layer: Which canvas layer to render on ('top' or 'bottom').\n * - zIndex: Z-index for image layering within the same layer.\n * - cursorPos: 'vt340' for bottom-left, 'iip' for bottom.right.\n * @returns The internal image ID assigned to the stored image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap, opts: IAddImageOpts): number {\n // never allow storage to exceed memory limit\n this._evictOldest(img.width * img.height);\n\n // calc rows x cols needed to display the image\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const cols = Math.ceil(img.width / cellSize.width);\n const rows = Math.ceil(img.height / cellSize.height);\n\n const imageId = ++this._lastId;\n\n const buffer = this._terminal._core.buffer;\n const termCols = this._terminal.cols;\n const termRows = this._terminal.rows;\n const originX = buffer.x;\n const originY = buffer.y;\n let offset = originX;\n let tileCount = 0;\n\n if (!opts.scrolling) {\n buffer.x = 0;\n buffer.y = 0;\n offset = 0;\n }\n\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(buffer.y + buffer.ybase);\n for (let col = 0; col < cols; ++col) {\n if (offset + col >= termCols) break;\n this._writeToCell(line as IBufferLineExt, offset + col, imageId, row * cols + col);\n tileCount++;\n }\n if (opts.scrolling) {\n if (row < rows - 1) this._terminal._core._inputHandler.lineFeed();\n } else {\n if (++buffer.y >= termRows) break;\n }\n buffer.x = offset;\n }\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n\n // cursor positioning modes\n if (opts.scrolling) {\n if (opts.cursorPos === 'iip') {\n buffer.x = Math.min(offset + cols, termCols);\n } else {\n buffer.x = offset;\n }\n } else {\n buffer.x = originX;\n buffer.y = originY;\n }\n\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.tileCount < 1) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n\n // eviction marker:\n // delete the image when the marker gets disposed\n const endMarker = this._terminal.registerMarker(0);\n endMarker?.onDispose(() => {\n const spec = this._images.get(imageId);\n if (spec) {\n this._delImg(imageId);\n }\n });\n\n // since markers do not work on alternate for some reason,\n // we evict images here manually\n if (this._terminal.buffer.active.type === 'alternate') {\n this._evictOnAlternate();\n }\n\n // create storage entry\n const imgSpec: IImageSpec = {\n orig: img,\n origCellSize: cellSize,\n actual: img,\n actualCellSize: { ...cellSize }, // clone needed, since later modified\n marker: endMarker || undefined,\n tileCount,\n bufferType: this._terminal.buffer.active.type,\n layer: opts.layer,\n zIndex: opts.zIndex\n };\n\n // finally add the image\n this._images.set(imageId, imgSpec);\n this.onImageAdded?.();\n return imageId;\n }\n\n\n /**\n * Render method. Collects buffer information and triggers\n * canvas updates.\n */\n // TODO: Should we move this to the ImageRenderer?\n public render(range: { start: number, end: number }): void {\n // Determine which layers have images\n let hasTopImages = false;\n let hasBottomImages = false;\n for (const spec of this._images.values()) {\n if (spec.layer === 'bottom') {\n hasBottomImages = true;\n } else {\n hasTopImages = true;\n }\n if (hasTopImages && hasBottomImages) break;\n }\n\n // Lazily insert layers that are needed\n if (hasTopImages && !this._renderer.hasLayer('top')) {\n this._renderer.insertLayerToDom('top');\n if (!this._renderer.hasLayer('top')) return;\n }\n if (hasBottomImages && !this._renderer.hasLayer('bottom')) {\n this._renderer.insertLayerToDom('bottom');\n }\n\n // rescale if needed\n this._renderer.rescaleCanvas();\n\n // exit early if we dont have any images to test for\n if (!this._images.size) {\n if (!this._fullyCleared) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n if (this._renderer.hasLayer('top')) {\n this._renderer.removeLayerFromDom('top');\n }\n if (this._renderer.hasLayer('bottom')) {\n this._renderer.removeLayerFromDom('bottom');\n }\n return;\n }\n\n // Remove layers no longer needed\n if (!hasTopImages && this._renderer.hasLayer('top')) {\n this._renderer.clearAll('top');\n this._renderer.removeLayerFromDom('top');\n }\n if (!hasBottomImages && this._renderer.hasLayer('bottom')) {\n this._renderer.clearAll('bottom');\n this._renderer.removeLayerFromDom('bottom');\n }\n\n // buffer switches force a full clear\n if (this._needsFullClear) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n\n const { start, end } = range;\n const buffer = this._terminal._core.buffer;\n const cols = this._terminal._core.cols;\n\n // clear drawing area\n this._renderer.clearLines(start, end);\n\n // Collect draw calls so we can sort by z-index (lower z drawn first).\n const drawCalls: { imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number }[] = [];\n const placeholderCalls: { col: number, row: number, count: number }[] = [];\n\n // walk all cells in viewport and collect tiles found\n for (let row = start; row <= end; ++row) {\n const line = buffer.lines.get(row + buffer.ydisp) as IBufferLineExt;\n if (!line) return;\n for (let col = 0; col < cols; ++col) {\n if (line.getBg(col) & BgFlags.HAS_EXTENDED) {\n let e: IExtendedAttrsImage = line._extendedAttrs[col] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (e.tileId !== -1) {\n const startTile = e.tileId;\n const startCol = col;\n let count = 1;\n /**\n * merge tiles to the right into a single draw call, if:\n * - not at end of line\n * - cell has same image id\n * - cell has consecutive tile id\n */\n while (\n ++col < cols\n && (line.getBg(col) & BgFlags.HAS_EXTENDED)\n && (e = line._extendedAttrs[col] ?? EMPTY_ATTRS)\n && (e.imageId === imageId)\n && (e.tileId === startTile + count)\n ) {\n count++;\n }\n col--;\n if (imgSpec) {\n if (imgSpec.actual) {\n drawCalls.push({ imgSpec, tileId: startTile, col: startCol, row, count });\n }\n } else if (this._opts.showPlaceholder) {\n placeholderCalls.push({ col: startCol, row, count });\n }\n this._fullyCleared = false;\n }\n }\n }\n }\n\n // Sort by z-index so lower z draws first (higher z renders on top)\n drawCalls.sort((a, b) => a.imgSpec.zIndex - b.imgSpec.zIndex);\n\n // Draw placeholders first (lowest priority)\n for (const call of placeholderCalls) {\n this._renderer.drawPlaceholder(call.col, call.row, call.count);\n }\n\n // Draw images in z-index order\n for (const call of drawCalls) {\n this._renderer.draw(call.imgSpec, call.tileId, call.col, call.row, call.count);\n }\n }\n\n public viewportResize(metrics: { cols: number, rows: number }): void {\n // exit early if we have nothing in storage\n if (!this._images.size) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // handle only viewport width enlargements, exit all other cases\n // TODO: needs patch for tile counter\n if (this._viewportMetrics.cols >= metrics.cols) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // walk scrollbuffer at old col width to find all possible expansion matches\n const buffer = this._terminal._core.buffer;\n const rows = buffer.lines.length;\n const oldCol = this._viewportMetrics.cols - 1;\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(row) as IBufferLineExt;\n if (line.getBg(oldCol) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[oldCol] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (!imgSpec) {\n continue;\n }\n // found an image tile at oldCol, check if it qualifies for right exapansion\n const tilesPerRow = Math.ceil((imgSpec.actual?.width || 0) / imgSpec.actualCellSize.width);\n if ((e.tileId % tilesPerRow) + 1 >= tilesPerRow) {\n continue;\n }\n // expand only if right side is empty (nothing got wrapped from below)\n let hasData = false;\n for (let rightCol = oldCol + 1; rightCol > metrics.cols; ++rightCol) {\n if (line._data[rightCol * Cell.SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK) {\n hasData = true;\n break;\n }\n }\n if (hasData) {\n continue;\n }\n // do right expansion on terminal buffer\n const end = Math.min(metrics.cols, tilesPerRow - (e.tileId % tilesPerRow) + oldCol);\n let lastTile = e.tileId;\n for (let expandCol = oldCol + 1; expandCol < end; ++expandCol) {\n this._writeToCell(line as IBufferLineExt, expandCol, imageId, ++lastTile);\n imgSpec.tileCount++;\n }\n }\n }\n // store new viewport metrics\n this._viewportMetrics = metrics;\n }\n\n /**\n * Retrieve original canvas at buffer position.\n */\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1) {\n const orig = this._images.get(e.imageId)?.orig;\n if (window.ImageBitmap && orig instanceof ImageBitmap) {\n const canvas = ImageRenderer.createCanvas(window.document, orig.width, orig.height);\n canvas.getContext('2d')?.drawImage(orig, 0, 0, orig.width, orig.height);\n return canvas;\n }\n return orig as HTMLCanvasElement;\n }\n }\n }\n\n /**\n * Extract active single tile at buffer position.\n */\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1 && e.tileId !== -1) {\n const spec = this._images.get(e.imageId);\n if (spec) {\n return this._renderer.extractTile(spec, e.tileId);\n }\n }\n }\n }\n\n // TODO: Do we need some blob offloading tricks here to avoid early eviction?\n // also see https://stackoverflow.com/questions/28307789/is-there-any-limitation-on-javascript-max-blob-size\n private _evictOldest(room: number): number {\n const used = this._getStoredPixels();\n let current = used;\n while (this._pixelLimit < current + room && this._images.size) {\n const spec = this._images.get(++this._lowestId);\n if (spec && spec.orig) {\n current -= spec.orig.width * spec.orig.height;\n if (spec.actual && spec.orig !== spec.actual) {\n current -= spec.actual.width * spec.actual.height;\n }\n spec.marker?.dispose();\n this._delImg(this._lowestId);\n }\n }\n return used - current;\n }\n\n private _writeToCell(line: IBufferLineExt, x: number, imageId: number, tileId: number): void {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const old = line._extendedAttrs[x];\n if (old) {\n if (old.imageId !== undefined) {\n // found an old ExtendedAttrsImage, since we know that\n // they are always isolated instances (single cell usage),\n // we can re-use it and just update their id entries\n const oldSpec = this._images.get(old.imageId);\n if (oldSpec) {\n // early eviction for in-viewport overwrites\n oldSpec.tileCount--;\n }\n old.imageId = imageId;\n old.tileId = tileId;\n return;\n }\n // found a plain ExtendedAttrs instance, clone it to new entry\n line._extendedAttrs[x] = new ExtendedAttrsImage(old.ext, old.urlId, imageId, tileId);\n return;\n }\n }\n // fall-through: always create new ExtendedAttrsImage entry\n line._data[x * Cell.SIZE + Cell.BG] |= BgFlags.HAS_EXTENDED;\n line._extendedAttrs[x] = new ExtendedAttrsImage(0, 0, imageId, tileId);\n }\n\n private _evictOnAlternate(): void {\n // nullify tile count of all images on alternate buffer\n for (const spec of this._images.values()) {\n if (spec.bufferType === 'alternate') {\n spec.tileCount = 0;\n }\n }\n // re-count tiles on whole buffer\n const buffer = this._terminal._core.buffer;\n for (let y = 0; y < this._terminal.rows; ++y) {\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (!line) {\n continue;\n }\n for (let x = 0; x < this._terminal.cols; ++x) {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const imgId = line._extendedAttrs[x]?.imageId;\n if (imgId) {\n const spec = this._images.get(imgId);\n if (spec) {\n spec.tileCount++;\n }\n }\n }\n }\n }\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate' && !spec.tileCount) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IImageAddonOptions, IOscHandler, IResetHandler, ITerminalExt } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { CELL_SIZE_DEFAULT } from './ImageStorage';\nimport Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport QoiDecoder from 'xterm-wasm-parts/lib/qoi/QoiDecoder.wasm';\nimport { HeaderParser, IHeaderFields, HeaderState, SequenceType } from './IIPHeaderParser';\nimport { imageType, UNSUPPORTED_TYPE } from './IIPMetrics';\n\n// Local const enum mirror - esbuild can't inline const enums from external packages\nconst enum DecoderConst {\n // Limit held memory in base64 decoder (encoded bytes).\n KEEP_DATA = 4194304,\n // Initial buffer allocation for the decoder.\n INITIAL_DATA = 1048576,\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n OK = 0\n}\n\n// default IIP header values\nconst DEFAULT_HEADER: IHeaderFields = {\n type: SequenceType.INVALID,\n name: 'Unnamed file',\n size: 0,\n width: 'auto',\n height: 'auto',\n preserveAspectRatio: 1,\n inline: 0\n};\n\n\nexport class IIPHandler implements IOscHandler, IResetHandler {\n private _generation = 0;\n private _aborted = false;\n private _hp = new HeaderParser();\n private _header: IHeaderFields = DEFAULT_HEADER;\n private _dec: Base64Decoder;\n private _qoiDec: QoiDecoder;\n private _isMultipart = false;\n private _abortMulti = false;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _storage: IIPImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n const maxEncodedBytes = Math.ceil(this._opts.iipSizeLimit * 4 / 3);\n const initialBytes = Math.min(DecoderConst.INITIAL_DATA, maxEncodedBytes);\n this._dec = new Base64Decoder(DecoderConst.KEEP_DATA, maxEncodedBytes, initialBytes);\n this._qoiDec = new QoiDecoder(DecoderConst.KEEP_DATA);\n }\n\n public reset(): void {\n this._generation++;\n this._hp.reset();\n this._dec.release();\n this._qoiDec.release();\n }\n\n public start(): void {\n this._aborted = false;\n this._hp.reset();\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (this._hp.state === HeaderState.END) {\n if ((this._dec.put(data.subarray(start, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n }\n } else {\n const dataPos = this._hp.parse(data, start, end);\n if (dataPos === -1) {\n this._aborted = true;\n return;\n }\n if (dataPos > 0) {\n const seqType = this._hp.fields.type;\n if (seqType === SequenceType.FILE) {\n if (this._isMultipart) {\n this._isMultipart = false;\n this._abortMulti = false;\n this._dec.release();\n }\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n if (!this._header.inline) {\n this._aborted = true;\n return;\n }\n this._dec.init();\n } else if (this._abortMulti) {\n this._aborted = true;\n return;\n }\n if ((this._dec.put(data.subarray(dataPos, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n if (this._isMultipart) this._abortMulti = true;\n }\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted) return true;\n\n if (this._hp.state !== HeaderState.END) {\n if (this._hp.end()) return true;\n }\n const seqType = this._hp.fields.type;\n\n if (seqType === SequenceType.FILEPART) return true;\n\n if (seqType === SequenceType.REPORTCELLSIZE) {\n // OSC 1337 ; ReportCellSize=[height];[width];[scale] ST\n let w = CELL_SIZE_DEFAULT.width;\n let h = CELL_SIZE_DEFAULT.height;\n if (this._renderer.dimensions) {\n w = this._renderer.dimensions.css.canvas.width / this._coreTerminal.cols;\n h = this._renderer.dimensions.css.canvas.height / this._coreTerminal.rows;\n }\n const scale = this._coreTerminal._core._coreBrowserService?.dpr ?? 1;\n const report = `\\x1b]1337;ReportCellSize=${h.toFixed(3)};${w.toFixed(3)};${scale.toFixed(3)}\\x1b\\\\`;\n this._coreTerminal.input(report, false);\n return true;\n }\n\n if (seqType === SequenceType.MULTIPARTFILE) {\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n this._isMultipart = true;\n this._abortMulti = false;\n this._dec.release();\n this._dec.init();\n return true;\n }\n\n if (seqType === SequenceType.FILEEND) {\n if (!this._isMultipart) return true;\n this._isMultipart = false;\n if (this._abortMulti || this._header.type !== SequenceType.MULTIPARTFILE) return true;\n }\n\n // fallthrough for SequenceType.FILE & SequenceType.FILEEND\n\n let w = 0;\n let h = 0;\n\n // early exit condition chain\n let cond: number | boolean;\n let metrics = UNSUPPORTED_TYPE;\n if (cond = success) {\n if (cond = !this._dec.end()) {\n metrics = imageType(this._dec.data8);\n if (cond = metrics.mime !== 'unsupported') {\n w = metrics.width;\n h = metrics.height;\n if (cond = w && h && w * h < this._opts.pixelLimit) {\n [w, h] = this._resize(w, h).map(Math.floor);\n cond = w && h && w * h < this._opts.pixelLimit;\n } else {\n console.warn(`IIP: image dimension issue ${metrics.width}x${metrics.height}`);\n }\n } else {\n console.warn('IIP: unsupported image type');\n }\n } else {\n console.warn('IIP: error during BASE64 decoding');\n }\n }\n if (!cond) {\n this._dec.release();\n return true;\n }\n\n let blob: Blob | ImageData;\n if (metrics.mime === 'image/qoi') {\n const data = this._qoiDec.decode(this._dec.data8);\n blob = new ImageData(\n new Uint8ClampedArray(data.buffer, data.byteOffset, data.byteLength),\n this._qoiDec.width,\n this._qoiDec.height\n );\n this._qoiDec.release();\n if (w === this._qoiDec.width && h === this._qoiDec.height) {\n // use fast-path if we don't need to rescale\n this._dec.release();\n const canvas = ImageRenderer.createCanvas(undefined, this._qoiDec.width, this._qoiDec.height);\n canvas.getContext('2d')?.putImageData(blob, 0, 0);\n this._storage.addImage(canvas);\n return true;\n }\n } else {\n blob = new Blob([this._dec.data8], { type: metrics.mime });\n }\n this._dec.release();\n const generation = this._generation;\n return createImageBitmap(blob, { resizeWidth: w, resizeHeight: h })\n .then(bm => {\n if (generation !== this._generation) {\n bm.close();\n return true;\n }\n this._storage.addImage(bm);\n return true;\n })\n .catch(e => {\n console.warn(`IIP: decoding error ${metrics.mime} ${metrics.width}x${metrics.height}`, e);\n return true;\n });\n }\n\n private _resize(w: number, h: number): [number, number] {\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n const width = this._renderer.dimensions?.css.canvas.width || cw * this._coreTerminal.cols;\n const height = this._renderer.dimensions?.css.canvas.height || ch * this._coreTerminal.rows;\n\n const rw = this._dim(this._header.width!, width, cw);\n const rh = this._dim(this._header.height!, height, ch);\n if (!rw && !rh) {\n const wf = width / w; // TODO: should this respect initial cursor offset?\n const hf = (height - ch) / h; // TODO: fix offset issues from float cell height\n const f = Math.min(wf, hf);\n return f < 1 ? [w * f, h * f] : [w, h];\n }\n return !rw\n ? [w * rh / h, rh]\n : this._header.preserveAspectRatio || !rw || !rh\n ? [rw, h * rw / w] : [rw, rh];\n }\n\n private _dim(s: string, total: number, cdim: number): number {\n if (s === 'auto') return 0;\n if (s.endsWith('%')) return parseInt(s.slice(0, -1), 10) * total / 100;\n if (s.endsWith('px')) return parseInt(s.slice(0, -2), 10);\n return parseInt(s, 10) * cdim;\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// eslint-disable-next-line\ndeclare const Buffer: any;\n\nexport const enum HeaderState {\n START = 0,\n ABORT = 1,\n KEY = 2,\n VALUE = 3,\n END = 4\n}\n\nexport const enum SequenceType {\n INVALID = 0,\n FILE = 1,\n MULTIPARTFILE = 2,\n FILEPART = 3,\n FILEEND = 4,\n REPORTCELLSIZE = 5\n}\n\nexport interface IHeaderFields {\n [key: string]: number | string | Uint32Array | null | undefined;\n // sequence type\n type: SequenceType;\n // base-64 encoded filename. Defaults to \"Unnamed file\".\n name: string;\n // File size in bytes. The file transfer will be canceled if this size is exceeded.\n size: number;\n /**\n * Optional width and height to render:\n * - N: N character cells.\n * - Npx: N pixels.\n * - N%: N percent of the session's width or height.\n * - auto: The image's inherent size will be used to determine an appropriate dimension.\n */\n width?: string;\n height?: string;\n // Optional, defaults to 1 respecting aspect ratio (width takes precedence).\n preserveAspectRatio?: number;\n // Optional, defaults to 0. If set to 1, the file will be displayed inline, else downloaded\n // (download not supported).\n inline?: number;\n}\n\n// field value decoders\n\n// ASCII bytes to string\nfunction toStr(data: Uint32Array): string {\n let s = '';\n for (let i = 0; i < data.length; ++i) {\n s += String.fromCharCode(data[i]);\n }\n return s;\n}\n\n// digits to integer\nfunction toInt(data: Uint32Array): number {\n let v = 0;\n for (let i = 0; i < data.length; ++i) {\n if (data[i] < 48 || data[i] > 57) {\n throw new Error('illegal char');\n }\n v = v * 10 + data[i] - 48;\n }\n return v;\n}\n\n// check for correct size entry\nfunction toSize(data: Uint32Array): string {\n const v = toStr(data);\n if (!v.match(/^((auto)|(\\d+?((px)|(%)){0,1}))$/)) {\n throw new Error('illegal size');\n }\n return v;\n}\n\n// name is base64 encoded utf-8\nfunction toName(data: Uint32Array): string {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(toStr(data), 'base64').toString();\n }\n const bs = atob(toStr(data));\n const b = new Uint8Array(bs.length);\n for (let i = 0; i < b.length; ++i) {\n b[i] = bs.charCodeAt(i);\n }\n return new TextDecoder().decode(b);\n}\n\nconst DECODERS: {[key: string]: (v: Uint32Array) => number | string} = {\n inline: toInt,\n size: toInt,\n name: toName,\n width: toSize,\n height: toSize,\n preserveAspectRatio: toInt\n};\n\n\n// sequence type markers\n// File\nconst FILE_MARKER = [70, 105, 108, 101];\n// MultipartFile\nconst MULTIPARTFILE_MARKER = [77, 117, 108, 116, 105, 112, 97, 114, 116, 70, 105, 108, 101];\n// FilePart\nconst FILEPART_MARKER = [70, 105, 108, 101, 80, 97, 114, 116];\n// FileEnd\nconst FILEEND_MARKER = [70, 105, 108, 101, 69, 110, 100];\n// ReportCellSize\nconst REPORTCELLSIZE_MARKER = [82, 101, 112, 111, 114, 116, 67, 101, 108, 108, 83, 105, 122, 101];\n\n// max allowed chars for sequence header\nconst MAX_FIELDCHARS = 1024;\n\n\nexport class HeaderParser {\n public state: HeaderState = HeaderState.START;\n private _buffer = new Uint32Array(MAX_FIELDCHARS);\n private _position = 0;\n private _key = '';\n public fields: {[key: string]: number | string | Uint32Array | null | undefined} = {};\n\n public reset(): void {\n this._buffer.fill(0);\n this.state = HeaderState.START;\n this._position = 0;\n this.fields = {};\n this._key = '';\n }\n\n public end(): number {\n if (this.state === HeaderState.START) {\n if (this._position === FILEEND_MARKER.length) {\n for (let k = 0; k < FILEEND_MARKER.length; ++k) {\n if (this._buffer[k] !== FILEEND_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEEND;\n this.state = HeaderState.END;\n return 0;\n }\n if (this._position === REPORTCELLSIZE_MARKER.length) {\n for (let k = 0; k < REPORTCELLSIZE_MARKER.length; ++k) {\n if (this._buffer[k] !== REPORTCELLSIZE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.REPORTCELLSIZE;\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n if (this.state === HeaderState.END) return 0;\n if (this.state === HeaderState.VALUE\n && this.fields.type === SequenceType.MULTIPARTFILE\n ) {\n if (!this._storeValue(this._position)) return this._a();\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n\n public parse(data: Uint32Array, start: number, end: number): number {\n let state = this.state;\n let pos = this._position;\n const buffer = this._buffer;\n if (state === HeaderState.ABORT || state === HeaderState.END) return -1;\n if (state === HeaderState.START && pos > 14) return -1;\n for (let i = start; i < end; ++i) {\n const c = data[i];\n switch (c) {\n case 59: // ;\n if (!this._storeValue(pos)) return this._a();\n state = HeaderState.KEY;\n pos = 0;\n break;\n case 61: // =\n if (state === HeaderState.START) {\n if (buffer[0] === 70) {\n // 'File' or 'FilePart'\n let k = 0;\n for (; k < FILE_MARKER.length; ++k) {\n if (buffer[k] !== FILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILE;\n if (pos === FILEPART_MARKER.length) {\n for (; k < FILEPART_MARKER.length; ++k) {\n if (buffer[k] !== FILEPART_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEPART;\n this.state = HeaderState.END;\n return i + 1;\n }\n } else if (buffer[0] === 77) {\n // 'MultipartFile'\n for (let k = 0; k < MULTIPARTFILE_MARKER.length; ++k) {\n if (buffer[k] !== MULTIPARTFILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.MULTIPARTFILE;\n } else {\n return this._a();\n }\n state = HeaderState.KEY;\n pos = 0;\n } else if (state === HeaderState.KEY) {\n if (!this._storeKey(pos)) return this._a();\n state = HeaderState.VALUE;\n pos = 0;\n } else if (state === HeaderState.VALUE) {\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n break;\n case 58: // :\n if (state === HeaderState.VALUE) {\n if (!this._storeValue(pos)) return this._a();\n }\n this.state = HeaderState.END;\n return i + 1;\n default:\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n }\n this.state = state;\n this._position = pos;\n return -2;\n }\n\n private _a(): number {\n this.fields.type = SequenceType.INVALID;\n this.state = HeaderState.ABORT;\n return -1;\n }\n\n private _storeKey(pos: number): boolean {\n const k = toStr(this._buffer.subarray(0, pos));\n if (k) {\n this._key = k;\n this.fields[k] = null;\n return true;\n }\n return false;\n }\n\n private _storeValue(pos: number): boolean {\n if (this._key) {\n try {\n const v = this._buffer.slice(0, pos);\n this.fields[this._key] = DECODERS[this._key] ? DECODERS[this._key](v) : v;\n } catch {\n return false;\n }\n return true;\n }\n return false;\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n\nexport type ImageType = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/qoi' | 'image/webp' | 'image/avif' | 'unsupported' | '';\n\nexport interface IMetrics {\n mime: ImageType;\n width: number;\n height: number;\n}\n\nexport const UNSUPPORTED_TYPE: IMetrics = {\n mime: 'unsupported',\n width: 0,\n height: 0\n};\n\nexport function imageType(d: Uint8Array): IMetrics {\n if (d.length < 32) {\n return UNSUPPORTED_TYPE;\n }\n const d32 = new Uint32Array(d.buffer, d.byteOffset, 8);\n // PNG: 89 50 4E 47 0D 0A 1A 0A (8 first bytes == magic number for PNG)\n // + first chunk must be IHDR\n if (d32[0] === 0x474E5089 && d32[1] === 0x0A1A0A0D && d32[3] === 0x52444849) {\n return {\n mime: 'image/png',\n width: d[16] << 24 | d[17] << 16 | d[18] << 8 | d[19],\n height: d[20] << 24 | d[21] << 16 | d[22] << 8 | d[23]\n };\n }\n // JPEG: FF D8 FF\n if (d[0] === 0xFF && d[1] === 0xD8 && d[2] === 0xFF) {\n const [width, height] = jpgSize(d);\n return { mime: 'image/jpeg', width, height };\n }\n // GIF: GIF87a or GIF89a\n if (d32[0] === 0x38464947 && (d[4] === 0x37 || d[4] === 0x39) && d[5] === 0x61) {\n return {\n mime: 'image/gif',\n width: d[7] << 8 | d[6],\n height: d[9] << 8 | d[8]\n };\n }\n // QOI: qoif\n if (d32[0] === 0x66696F71) {\n return {\n mime: 'image/qoi',\n width: d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7],\n height: d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11]\n };\n }\n // WEBP: RIFF | xxxx | WEBP | VP8x\n if (d32[0] === 0x46464952 && d32[2] === 0x50424557 && (d32[3] & 0xFFFFFF) === 0x385056) {\n switch (d[15]) {\n case 0x58: // Extended WebP VP8X --> \"X\"\n return {\n mime: 'image/webp',\n width: (d[24] | d[25] << 8 | d[26] << 16) + 1,\n height: (d[27] | d[28] << 8 | d[29] << 16) + 1\n };\n case 0x4C: // Lossless WebP VP8L --> \"L\"\n if (d[20] !== 0x2f) return UNSUPPORTED_TYPE;\n const dim = d[21] | d[22] << 8 | d[23] << 16 | d[24] << 24;\n return {\n mime: 'image/webp',\n width: (dim & 0x3FFF) + 1,\n height: (dim >>> 14 & 0x3FFF) + 1\n };\n case 0x20: // Lossy WebP VP8 --> \" \"\n if (d[23] !== 0x9d || d[24] !== 0x01 || d[25] !== 0x2a) return UNSUPPORTED_TYPE;\n return {\n mime: 'image/webp',\n width: (d[26] | d[27] << 8) & 0x3FFF,\n height: (d[28] | d[29] << 8) & 0x3FFF\n };\n }\n return UNSUPPORTED_TYPE;\n }\n // AVIF: Box size | ftyp | avif/avis\n if (d32[1] === 0x70797466 && (d32[2] === 0x66697661 || d32[2] === 0x73697661)) {\n let pos = -1;\n // search for ispe box within first 1024 bytes\n const limit = Math.min(d.length - 16, 1024);\n for (let i = 8; i < limit; i++) {\n // scan for ispe\n if (d[i] === 0x69 && d[i + 1] === 0x73 && d[i + 2] === 0x70 && d[i + 3] === 0x65) {\n pos = i;\n break;\n }\n }\n if (pos !== -1) {\n // dimensions are in BE at +8 (width) at +12 (height)\n const width =\n d[pos + 8] << 24 |\n d[pos + 9] << 16 |\n d[pos + 10] << 8 |\n d[pos + 11];\n const height =\n d[pos + 12] << 24 |\n d[pos + 13] << 16 |\n d[pos + 14] << 8 |\n d[pos + 15];\n if (width > 0 && height > 0) {\n return { mime: 'image/avif', width, height };\n }\n }\n return UNSUPPORTED_TYPE;\n }\n return UNSUPPORTED_TYPE;\n}\n\n\nfunction jpgSize(d: Uint8Array): [number, number] {\n const len = d.length;\n let i = 4;\n let blockLength = d[i] << 8 | d[i + 1];\n while (true) {\n i += blockLength;\n if (i >= len) {\n // exhausted without size info\n return [0, 0];\n }\n if (d[i] !== 0xFF) {\n return [0, 0];\n }\n if (d[i + 1] === 0xC0 || d[i + 1] === 0xC2) {\n if (i + 8 < len) {\n return [\n d[i + 7] << 8 | d[i + 8],\n d[i + 5] << 8 | d[i + 6]\n ];\n }\n return [0, 0];\n }\n i += 2;\n blockLength = d[i] << 8 | d[i + 1];\n }\n}\n", "/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { IApcHandler, IImageAddonOptions, IResetHandler, ITerminalExt, ImageLayer } from '../Types';\nimport { ImageRenderer } from '../ImageRenderer';\nimport { CELL_SIZE_DEFAULT } from '../ImageStorage';\nimport { imageType } from '../IIPMetrics';\nimport { KittyImageStorage } from './KittyImageStorage';\nimport Base64Decoder, { type DecodeStatus } from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport {\n KittyAction,\n KittyFormat,\n KittyCompression,\n IKittyCommand,\n IPendingTransmission,\n IKittyImageData,\n KittyPixelConstants,\n parseKittyCommand\n} from './KittyGraphicsTypes';\n\nconst enum Constants {\n // Memory limit for base64 decoder (4MB, same as IIPHandler)\n DECODER_KEEP_DATA = 4194304,\n DECODER_INITIAL_DATA = 4194304, // 4MB\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n DECODER_OK = 0,\n // Maximum control data size\n MAX_CONTROL_DATA_SIZE = 512,\n // Semicolon codepoint\n SEMICOLON = 0x3B\n}\n\nconst DECODER_OK = Constants.DECODER_OK as unknown as DecodeStatus.OK;\n\n// Kitty graphics protocol handler with streaming base64 decoding.\nexport class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDisposable {\n private _aborted = false;\n private _generation = 0;\n private _decodeError = false;\n\n private _activeDecoder: Base64Decoder | null = null;\n private readonly _maxEncodedBytes: number;\n private readonly _initialEncodedBytes: number;\n\n // Streaming related states\n\n // True while receiving control data (before semicolon).\n private _inControlData = true;\n\n // Buffer for control data.\n private _controlData = new Uint32Array(Constants.MAX_CONTROL_DATA_SIZE);\n private _controlLength = 0;\n\n // Pre-calculated encoded size limit\n private _encodedSizeLimit = 0;\n private _totalEncodedSize = 0;\n\n // Parsed command. These are the control data before semicolon.\n private _parsedCommand: IKittyCommand | null = null;\n\n // Storage related states\n\n private _pendingTransmissions: Map = new Map();\n // Tracks the pending key of the most recently started chunked upload.\n // Per spec, subsequent chunks only need m= (and optionally q=), without i=.\n // When a chunk arrives with no i=, this key is used to find the pending upload.\n private _lastPendingKey: number | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _kittyStorage: KittyImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n // Convert decoded size limit -> max encoded bytes.\n this._maxEncodedBytes = Math.ceil(this._opts.kittySizeLimit * 4 / 3);\n // ensure we preallocate more than configured limit while using 4mb initial size.\n this._initialEncodedBytes = Math.min(Constants.DECODER_INITIAL_DATA, this._maxEncodedBytes);\n }\n\n public reset(): void {\n this._generation++;\n this._cleanupAllPending();\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n this._kittyStorage.reset();\n }\n\n public dispose(): void {\n this.reset();\n }\n\n private _removePendingEntry(key: number): void {\n this._pendingTransmissions.delete(key);\n if (this._lastPendingKey === key) {\n this._lastPendingKey = undefined;\n }\n }\n\n private _cleanupAllPending(): void {\n for (const pending of this._pendingTransmissions.values()) {\n pending.decoder.release();\n }\n this._pendingTransmissions.clear();\n this._lastPendingKey = undefined;\n }\n\n public start(): void {\n this._aborted = false;\n this._decodeError = false;\n this._inControlData = true;\n this._controlLength = 0;\n this._parsedCommand = null;\n // Pre-calculate encoded limit once: base64 is 4 bytes encoded \u2192 3 bytes decoded\n this._encodedSizeLimit = this._maxEncodedBytes;\n this._totalEncodedSize = 0;\n this._activeDecoder = null;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (!this._inControlData) {\n this._streamPayload(data, start, end);\n } else {\n // Scan for semicolon\n let controlEnd = end;\n for (let i = start; i < end; i++) {\n if (data[i] === Constants.SEMICOLON) {\n this._inControlData = false;\n controlEnd = i;\n break;\n }\n }\n\n // Copy control data\n const copyLength = controlEnd - start;\n if (this._controlLength + copyLength > Constants.MAX_CONTROL_DATA_SIZE) {\n this._aborted = true;\n return;\n }\n this._controlData.set(data.subarray(start, controlEnd), this._controlLength);\n this._controlLength += copyLength;\n\n if (!this._inControlData) {\n // Found semicolon - parse control data early for validation\n this._parsedCommand = parseKittyCommand(this._parseControlDataString());\n\n // Early validation: i+I conflict\n if (this._parsedCommand.id !== undefined && this._parsedCommand.imageNumber !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'EINVAL:cannot specify both i and I keys', this._parsedCommand.quiet ?? 0);\n this._aborted = true;\n return;\n }\n\n // Delete action doesn't need payload - skip streaming\n if (this._parsedCommand.action === KittyAction.DELETE) {\n return;\n }\n\n // Stream remaining as payload\n const payloadStart = controlEnd + 1;\n if (payloadStart < end) {\n this._streamPayload(data, payloadStart, end);\n }\n }\n }\n }\n\n // Stream payload bytes into the base64 decoder.\n private _streamPayload(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n // Check size limit (compare encoded bytes against pre-calculated limit)\n // Include cumulative size from pending transmission for multi-chunk images.\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = this._parsedCommand?.id ?? this._lastPendingKey ?? 0;\n const pending = this._pendingTransmissions.get(pendingKey);\n const previousEncodedSize = pending?.totalEncodedSize ?? 0;\n this._totalEncodedSize += end - start;\n const cumulativeEncodedSize = previousEncodedSize + this._totalEncodedSize;\n if (cumulativeEncodedSize > this._encodedSizeLimit) {\n const decoderToRelease = this._activeDecoder ?? pending?.decoder;\n if (decoderToRelease) {\n decoderToRelease.release();\n }\n this._activeDecoder = null;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n this._aborted = true;\n return;\n }\n\n if (this._decodeError) return;\n\n if (pending?.decoder && !this._activeDecoder) {\n this._activeDecoder = pending.decoder;\n }\n if (!this._activeDecoder) {\n // Budget WASM capacity, including one page of decoder state and rounding.\n const decoderCapacity = this._maxEncodedBytes + 131072;\n if (decoderCapacity > this._opts.storageLimit * 1000000) {\n this._aborted = true;\n if (this._parsedCommand?.id !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'ENOMEM:pending image budget exceeded', this._parsedCommand.quiet ?? 0);\n }\n return;\n }\n const maxPending = Math.max(1, Math.floor(this._opts.storageLimit * 1000000 / decoderCapacity));\n while (this._pendingTransmissions.size >= maxPending) {\n const oldest = this._pendingTransmissions.entries().next().value;\n if (!oldest) break;\n oldest[1].decoder.release();\n this._removePendingEntry(oldest[0]);\n if (oldest[1].cmd.id !== undefined) {\n this._sendResponse(oldest[1].cmd.id, 'ENOMEM:pending image budget exceeded', oldest[1].cmd.quiet ?? 0);\n }\n }\n this._activeDecoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes);\n this._activeDecoder.init();\n }\n\n if (this._activeDecoder.put(data.subarray(start, end)) !== DECODER_OK) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n this._decodeError = true;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted || !success) {\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n return true;\n }\n\n // No semicolon = no payload (delete, capability query)\n if (this._inControlData) {\n return this._handleNoPayloadCommand();\n }\n\n // Use command parsed early in put() - i+I already validated there\n const cmd = this._parsedCommand!;\n\n // Delete action was handled by skipping payload - just execute\n if (cmd.action === KittyAction.DELETE) {\n return this._handleDelete(cmd);\n }\n\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = cmd.id ?? this._lastPendingKey ?? 0;\n const isMoreComing = cmd.more === 1;\n const pending = this._pendingTransmissions.get(pendingKey);\n\n if (isMoreComing) {\n if (this._activeDecoder) {\n if (pending) {\n pending.totalEncodedSize += this._totalEncodedSize;\n pending.decodeError = pending.decodeError || this._decodeError;\n } else {\n this._pendingTransmissions.set(pendingKey, {\n cmd: { ...cmd },\n decoder: this._activeDecoder,\n totalEncodedSize: this._totalEncodedSize,\n decodeError: this._decodeError\n });\n }\n this._lastPendingKey = pendingKey;\n this._activeDecoder = null;\n }\n return true;\n }\n\n // Final chunk received \u2014 clear the last pending key\n if (pending) {\n this._lastPendingKey = undefined;\n }\n\n let decodeError = this._decodeError;\n let finalCmd = cmd;\n let decoder = this._activeDecoder;\n\n if (pending) {\n finalCmd = pending.cmd;\n decoder = pending.decoder;\n decodeError = decodeError || pending.decodeError;\n this._pendingTransmissions.delete(pendingKey);\n }\n\n let imageBytes = new Uint8Array(0);\n if (decoder) {\n if (decoder.end() !== DECODER_OK) {\n decodeError = true;\n }\n imageBytes = decoder.data8;\n }\n this._activeDecoder = null;\n\n // Handle command first \u2014 handlers create Blob/ImageData from imageBytes,\n // which copies the data. Only then is it safe to release the decoder's\n // wasm memory that imageBytes points into.\n const result = this._handleCommandWithBytesAndCmd(finalCmd, imageBytes, decodeError);\n if (decoder) {\n decoder.release();\n }\n return result;\n }\n\n // Command handling\n\n private _parseControlDataString(): string {\n let str = '';\n for (let i = 0; i < this._controlLength; i++) {\n str += String.fromCodePoint(this._controlData[i]);\n }\n return str;\n }\n\n private _handleNoPayloadCommand(): boolean | Promise {\n const cmd = parseKittyCommand(this._parseControlDataString());\n\n // Per spec: specifying both i and I is an error\n if (cmd.id !== undefined && cmd.imageNumber !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:cannot specify both i and I keys', cmd.quiet ?? 0);\n return true;\n }\n\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.DELETE:\n return this._handleDelete(cmd);\n case KittyAction.QUERY:\n this._sendResponse(cmd.id ?? 0, 'OK', cmd.quiet ?? 0);\n return true;\n case KittyAction.PLACEMENT:\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handleCommandWithBytesAndCmd(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.TRANSMIT: {\n const result = this._handleTransmit(cmd, bytes, decodeError);\n // Only send response when _handleTransmit didn't already respond\n // (it handles unsupported transmission medium responses internally)\n if ((cmd.transmission ?? 'd') === 'd' && cmd.id !== undefined) {\n if (decodeError) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n } else if (bytes.length > 0) {\n this._sendResponse(cmd.id, 'OK', cmd.quiet ?? 0);\n }\n }\n return result;\n }\n case KittyAction.TRANSMIT_DISPLAY:\n return this._handleTransmitDisplay(cmd, bytes, decodeError);\n case KittyAction.QUERY:\n return this._handleQuery(cmd, bytes, decodeError);\n case KittyAction.PLACEMENT:\n // a=p ignores any payload \u2014 image data was already transmitted\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handlePlacement(cmd: IKittyCommand): boolean | Promise {\n if (cmd.id === undefined) {\n return true;\n }\n const id = cmd.id;\n const image = this._kittyStorage.getImage(id);\n if (!image) {\n this._sendResponse(id, 'ENOENT:image not found', cmd.quiet ?? 0, cmd.placementId);\n return true;\n }\n const result = this._displayImage(image, cmd);\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0, cmd.placementId);\n return true;\n });\n }\n\n private _handleTransmit(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n // TODO: Support file-based transmission modes (t=f, t=t, t=s)\n // Currently only supports direct transmission (t=d, the default).\n // - t=f (file): Payload is base64-encoded file path. Terminal reads image from that path.\n // - t=t (temp file): Payload is base64-encoded path in temp directory. Terminal reads, deletes.\n // - t=s: Payload is base64-encoded POSIX shm name. Terminal reads from shared memory.\n // These modes require filesystem/IPC access not available in browsers. For Node.js/Electron:\n // 1. Check cmd.transmission (t key) before treating bytes as image data\n // 2. For t=f/t/s: decode bytes as UTF-8 string (the path/name), then read file contents\n // 3. For t=d: treat bytes as image data (current behavior)\n // When implementing, also update _handleQuery to accept these transmission mediums.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported transmission medium', cmd.quiet ?? 0);\n }\n return true;\n }\n\n if (decodeError || bytes.length === 0) return true;\n\n this._kittyStorage.storeImage(cmd.id, {\n data: new Blob([bytes as BlobPart]),\n width: cmd.width ?? 0,\n height: cmd.height ?? 0,\n format: (cmd.format ?? KittyFormat.RGBA) as 24 | 32 | 100,\n compression: cmd.compression ?? ''\n });\n return true;\n }\n\n private _handleTransmitDisplay(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n if (decodeError) {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n }\n return true;\n }\n\n this._handleTransmit(cmd, bytes, decodeError);\n\n const id = cmd.id ?? this._kittyStorage.lastImageId;\n const image = this._kittyStorage.getImage(id);\n if (image) {\n const result = this._displayImage(image, cmd);\n if (cmd.id !== undefined) {\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0);\n return true;\n });\n }\n return result.then(() => true);\n }\n return true;\n }\n\n private _handleQuery(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n const id = cmd.id ?? 0;\n const quiet = cmd.quiet ?? 0;\n\n // Per spec: reject unsupported transmission mediums (only t=d is supported atm)\n // TODO: When filesystem support is added (Node.js/Electron), update this to accept\n // t=f (file), t=t (temp file), and t=s (shared memory) and respond OK for queries.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n this._sendResponse(id, 'EINVAL:unsupported transmission medium', quiet);\n return true;\n }\n\n // Check decode error first (invalid base64)\n if (decodeError) {\n this._sendResponse(id, 'EINVAL:invalid base64 data', quiet);\n return true;\n }\n\n // Capability query (no payload) - just respond OK\n if (bytes.length === 0) {\n this._sendResponse(id, 'OK', quiet);\n return true;\n }\n\n const format = cmd.format ?? KittyFormat.RGBA;\n\n if (format === KittyFormat.PNG) {\n this._sendResponse(id, 'OK', quiet);\n } else {\n const width = cmd.width ?? 0;\n const height = cmd.height ?? 0;\n\n if (!width || !height) {\n this._sendResponse(id, 'EINVAL:width and height required for raw pixel data', quiet);\n return true;\n }\n\n const bytesPerPixel = format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n this._sendResponse(id, `EINVAL:insufficient pixel data`, quiet);\n return true;\n }\n\n this._sendResponse(id, 'OK', quiet);\n }\n return true;\n }\n\n private _handleDelete(cmd: IKittyCommand): boolean {\n // Per spec: default delete selector is 'a' (delete all visible placements)\n const selector = cmd.deleteSelector ?? 'a';\n\n // TODO: Distinguish lowercase (delete placements only) from uppercase\n // (delete placements + free stored image data). Currently both variants\n // free everything since we don't separate stored data from placements.\n switch (selector) {\n case 'a':\n case 'A':\n this._cleanupAllPending();\n this._kittyStorage.deleteAll();\n break;\n case 'i':\n case 'I':\n // TODO: When placement id tracking is implemented (see TODO in\n // KittyImageStorage), d=i with p= should delete only that\n // specific placement, while d=i without p should delete all\n // placements for the image.\n if (cmd.id !== undefined) {\n const pending = this._pendingTransmissions.get(cmd.id);\n if (pending) {\n pending.decoder.release();\n }\n this._removePendingEntry(cmd.id);\n this._kittyStorage.deleteById(cmd.id);\n }\n break;\n default:\n // Unsupported selectors (c, n, p, q, r, x, y, z, f) \u2014 ignore for now\n break;\n }\n return true;\n }\n\n private _sendResponse(id: number, message: string, quiet: number, placementId?: number): void {\n const isOk = message === 'OK';\n if (isOk && quiet >= 1) return;\n if (!isOk && quiet >= 2) return;\n\n const pPart = placementId ? `,p=${placementId}` : '';\n const response = `\\x1b_Gi=${id}${pPart};${message}\\x1b\\\\`;\n this._coreTerminal._core.coreService.triggerDataEvent(response);\n }\n\n // Image display\n\n private _displayImage(image: IKittyImageData, cmd: IKittyCommand): Promise {\n return this._decodeAndDisplay(image, cmd)\n .then(() => true)\n .catch(() => false);\n }\n\n private async _decodeAndDisplay(image: IKittyImageData, cmd: IKittyCommand): Promise {\n const generation = this._generation;\n let bitmap: ImageBitmap | undefined = await this._createBitmap(image);\n\n try {\n if (generation !== this._generation) throw new Error('image decode canceled');\n const cropX = Math.max(0, cmd.x ?? 0);\n const cropY = Math.max(0, cmd.y ?? 0);\n const cropW = cmd.sourceWidth || (bitmap.width - cropX);\n const cropH = cmd.sourceHeight || (bitmap.height - cropY);\n\n const maxCropW = Math.max(0, bitmap.width - cropX);\n const maxCropH = Math.max(0, bitmap.height - cropY);\n const finalCropW = Math.max(0, Math.min(cropW, maxCropW));\n const finalCropH = Math.max(0, Math.min(cropH, maxCropH));\n\n if (finalCropW === 0 || finalCropH === 0) {\n throw new Error('invalid source rectangle');\n }\n\n if (cropX !== 0 || cropY !== 0 || finalCropW !== bitmap.width || finalCropH !== bitmap.height) {\n const cropped = await createImageBitmap(bitmap, cropX, cropY, finalCropW, finalCropH);\n bitmap.close();\n bitmap = cropped;\n }\n\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n\n // Per spec: c/r default to image's natural cell dimensions.\n // If only one of c/r is specified, compute the other from image aspect ratio.\n let imgCols: number;\n let imgRows: number;\n if (cmd.columns !== undefined && cmd.rows !== undefined) {\n imgCols = cmd.columns;\n imgRows = cmd.rows;\n } else if (cmd.columns !== undefined) {\n imgCols = cmd.columns;\n imgRows = Math.max(1, Math.ceil((bitmap.height / bitmap.width) * (imgCols * cw) / ch));\n } else if (cmd.rows !== undefined) {\n imgRows = cmd.rows;\n imgCols = Math.max(1, Math.ceil((bitmap.width / bitmap.height) * (imgRows * ch) / cw));\n } else {\n imgCols = Math.ceil(bitmap.width / cw);\n imgRows = Math.ceil(bitmap.height / ch);\n }\n\n let w = bitmap.width;\n let h = bitmap.height;\n\n // Scale bitmap to fit placement rectangle when c/r are specified\n if (cmd.columns !== undefined || cmd.rows !== undefined) {\n w = Math.round(imgCols * cw);\n h = Math.round(imgRows * ch);\n }\n\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n\n // Save cursor position before addImage modifies it\n const buffer = this._coreTerminal._core.buffer;\n const savedX = buffer.x;\n const savedY = buffer.y;\n const savedYbase = buffer.ybase;\n\n // Determine layer based on z-index: negative = behind text, 0+ = on top.\n // When z<0 we always use the bottom layer even without allowTransparency \u2014\n // the image will simply be hidden behind the opaque text background, which\n // is the correct behavior (client asked for \"behind text\").\n const wantsBottom = cmd.zIndex !== undefined && cmd.zIndex < 0;\n const layer: ImageLayer = wantsBottom ? 'bottom' : 'top';\n\n if (w !== bitmap.width || h !== bitmap.height) {\n const scaled = await createImageBitmap(bitmap, { resizeWidth: w, resizeHeight: h });\n bitmap.close();\n bitmap = scaled;\n }\n\n // Per spec: X/Y are pixel offsets within the first cell, so clamp to cell dimensions\n const xOffset = Math.min(Math.max(0, cmd.xOffset ?? 0), cw - 1);\n const yOffset = Math.min(Math.max(0, cmd.yOffset ?? 0), ch - 1);\n if (xOffset !== 0 || yOffset !== 0) {\n // Per spec: X/Y is not added to c/r area. When c/r are explicit, the\n // total placement area remains c*cw \u00D7 r*ch pixels and the offset image\n // is clipped to fit. When c/r are unset, the padded canvas determines\n // the natural cell dimensions.\n const canvasW = (cmd.columns !== undefined) ? Math.round(imgCols * cw) : bitmap.width + xOffset;\n const canvasH = (cmd.rows !== undefined) ? Math.round(imgRows * ch) : bitmap.height + yOffset;\n const offsetCanvas = ImageRenderer.createCanvas(window.document, canvasW, canvasH);\n const offsetCtx = offsetCanvas.getContext('2d');\n if (!offsetCtx) {\n throw new Error('Failed to create offset canvas context');\n }\n offsetCtx.drawImage(bitmap, xOffset, yOffset);\n\n const offsetBitmap = await createImageBitmap(offsetCanvas);\n offsetCanvas.width = offsetCanvas.height = 0;\n bitmap.close();\n bitmap = offsetBitmap;\n w = bitmap.width;\n h = bitmap.height;\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n if (cmd.columns === undefined) {\n imgCols = Math.ceil(bitmap.width / cw);\n }\n if (cmd.rows === undefined) {\n imgRows = Math.ceil(bitmap.height / ch);\n }\n }\n\n if (generation !== this._generation) throw new Error('image decode canceled');\n const zIndex = cmd.zIndex ?? 0;\n this._kittyStorage.addImage(image.id, bitmap, true, layer, zIndex);\n bitmap = undefined; // ownership transferred to storage\n\n // Kitty cursor movement\n // Per spec: cursor placed at first column after last image column,\n // on the last row of the image. C=1 means don't move cursor.\n if (cmd.cursorMovement === 1) {\n // C=1: restore cursor to position before image was placed\n const scrolled = buffer.ybase - savedYbase;\n buffer.x = savedX;\n // Can't restore cursor to scrollback?\n buffer.y = Math.max(savedY - scrolled, 0);\n } else {\n // Default (C=0): advance cursor horizontally past the image\n // addImage already positioned cursor on the last row via lineFeeds\n buffer.x = Math.min(savedX + imgCols, this._coreTerminal.cols);\n }\n } catch (e) {\n bitmap?.close();\n throw e;\n }\n }\n\n // Create ImageBitmap from already-decoded image data.\n private async _createBitmap(image: IKittyImageData): Promise {\n let bytes: Uint8Array = new Uint8Array(await image.data.arrayBuffer());\n\n if (image.compression === KittyCompression.ZLIB) {\n bytes = await this._decompressZlib(bytes);\n }\n\n if (image.format === KittyFormat.PNG) {\n const metrics = imageType(bytes);\n // IHDR dimensions are parsed with signed shifts, so a value >= 0x80000000 comes\n // back negative and a bare `>` pixel-limit test passes it; require positive.\n if (metrics.mime !== 'image/png' || !(metrics.width > 0) || !(metrics.height > 0) || metrics.width * metrics.height > this._opts.pixelLimit) {\n throw new RangeError('PNG exceeds pixel limit or has invalid dimensions');\n }\n const blob = new Blob([bytes as BlobPart], { type: 'image/png' });\n if (!window.createImageBitmap) {\n const url = URL.createObjectURL(blob);\n const img = new Image();\n return new Promise((resolve, reject) => {\n img.addEventListener('load', () => {\n URL.revokeObjectURL(url);\n const canvas = ImageRenderer.createCanvas(window.document, img.width, img.height);\n canvas.getContext('2d')?.drawImage(img, 0, 0);\n createImageBitmap(canvas).then(resolve).catch(reject);\n });\n img.addEventListener('error', () => {\n URL.revokeObjectURL(url);\n reject(new Error('Failed to load image'));\n });\n img.src = url;\n });\n }\n return createImageBitmap(blob);\n }\n\n // Raw pixel data\n const width = image.width;\n const height = image.height;\n\n if (!width || !height) {\n throw new Error('Width and height required for raw pixel data');\n }\n\n const bytesPerPixel = image.format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n throw new Error('Insufficient pixel data');\n }\n\n const pixelCount = width * height;\n\n if (image.format === KittyFormat.RGBA) {\n // RGBA: use bytes directly \u2014 no copy needed\n return createImageBitmap(new ImageData(new Uint8ClampedArray(bytes.buffer as ArrayBuffer, bytes.byteOffset, pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA), width, height));\n }\n\n // RGB\u2192RGBA: interleave alpha using uint32 block processing (4 pixels per iteration).\n // 3 uint32 reads + 4 uint32 writes per 4 pixels vs 28 byte reads/writes \u2014 ~6x faster.\n // Assumes little-endian (all modern browsers/Node.js).\n const data = new Uint8ClampedArray(pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA);\n const src32 = new Uint32Array(bytes.buffer, bytes.byteOffset, Math.floor(bytes.byteLength / 4));\n const dst32 = new Uint32Array(data.buffer);\n const alignedPixels = pixelCount & ~3; // round down to multiple of 4\n\n let srcOffset = 0;\n let dstOffset = 0;\n for (let i = 0; i < alignedPixels; i += 4) {\n const b0 = src32[srcOffset++];\n const b1 = src32[srcOffset++];\n const b2 = src32[srcOffset++];\n // Little-endian: pixel bytes are [R,G,B] \u2192 uint32 ABGR layout\n dst32[dstOffset++] = 0xFF000000 | b0;\n dst32[dstOffset++] = 0xFF000000 | (b0 >>> 24) | (b1 << 8);\n dst32[dstOffset++] = 0xFF000000 | (b1 >>> 16) | (b2 << 16);\n dst32[dstOffset++] = 0xFF000000 | (b2 >>> 8);\n }\n\n // Handle remaining 1\u20133 pixels\n let srcByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n let dstByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n for (let i = alignedPixels; i < pixelCount; i++) {\n data[dstByte] = bytes[srcByte];\n data[dstByte + 1] = bytes[srcByte + 1];\n data[dstByte + 2] = bytes[srcByte + 2];\n data[dstByte + 3] = KittyPixelConstants.ALPHA_OPAQUE;\n srcByte += KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n dstByte += KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n }\n\n return createImageBitmap(new ImageData(data, width, height));\n }\n\n private async _decompressZlib(compressed: Uint8Array): Promise {\n try {\n return await this._decompress(compressed, 'deflate');\n } catch (error) {\n if (error instanceof RangeError) throw error;\n return await this._decompress(compressed, 'deflate-raw');\n }\n }\n\n private async _decompress(compressed: Uint8Array, format: 'deflate' | 'deflate-raw'): Promise {\n const limit = Math.min(this._opts.kittySizeLimit, this._opts.pixelLimit * 4, this._opts.storageLimit * 1000000);\n let offsetIn = 0;\n // Bound inflation within one native transform before its output is budgeted.\n const source = new ReadableStream({\n pull(controller) {\n if (offsetIn >= compressed.length) {\n controller.close();\n return;\n }\n const end = Math.min(offsetIn + 4096, compressed.length);\n controller.enqueue(new Uint8Array(compressed.subarray(offsetIn, end)));\n offsetIn = end;\n }\n });\n const reader = source.pipeThrough(new DecompressionStream(format)).getReader();\n const chunks: Uint8Array[] = [];\n let totalLength = 0;\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n totalLength += value.byteLength;\n if (totalLength > limit) {\n await reader.cancel().catch(() => {});\n throw new RangeError('decompressed image exceeds byte limit');\n }\n chunks.push(value);\n }\n } finally {\n reader.releaseLock();\n }\n\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n }\n\n public get images(): ReadonlyMap {\n return this._kittyStorage.images;\n }\n\n public get _kittyIdToStorageId(): ReadonlyMap {\n return this._kittyStorage.kittyIdToStorageId;\n }\n\n public get pendingTransmissions(): ReadonlyMap {\n return this._pendingTransmissions;\n }\n}\n", "/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Kitty graphics protocol types, constants, and parsing utilities.\n */\n\nimport type Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\n\n// Kitty graphics protocol action types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'a'.\nexport const enum KittyAction {\n TRANSMIT = 't',\n TRANSMIT_DISPLAY = 'T',\n QUERY = 'q',\n PLACEMENT = 'p',\n DELETE = 'd'\n}\n\n// Kitty graphics protocol format types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyFormat {\n RGB = 24,\n RGBA = 32,\n PNG = 100\n}\n\n// Kitty graphics protocol compression types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'o'.\nexport const enum KittyCompression {\n NONE = '',\n ZLIB = 'z'\n}\n\n// Kitty graphics protocol control data keys.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyKey {\n // Action to perform (t=transmit, T=transmit+display, q=query, p=placement, d=delete)\n ACTION = 'a',\n // Image format (24=RGB, 32=RGBA, 100=PNG)\n FORMAT = 'f',\n // Image ID for referencing stored images\n ID = 'i',\n // Image number (alternative to ID, terminal assigns ID)\n IMAGE_NUMBER = 'I',\n // Source image width in pixels\n WIDTH = 's',\n // Source image height in pixels\n HEIGHT = 'v',\n // The left edge (in pixels) of the image area to display\n X_OFFSET = 'x',\n // The top edge (in pixels) of the image area to display\n Y_OFFSET = 'y',\n // Width (in pixels) of the source rectangle to display\n SOURCE_WIDTH = 'w',\n // Height (in pixels) of the source rectangle to display\n SOURCE_HEIGHT = 'h',\n // Horizontal offset (in pixels) within the first cell\n X_PLACEMENT_OFFSET = 'X',\n // Vertical offset (in pixels) within the first cell\n Y_PLACEMENT_OFFSET = 'Y',\n // Number of terminal columns to display the image over\n COLUMNS = 'c',\n // Number of terminal rows to display the image over\n ROWS = 'r',\n // More data flag (1=more chunks coming, 0=final chunk)\n MORE = 'm',\n // Compression type (z=zlib). This is essential for chunking larger images.\n COMPRESSION = 'o',\n // Quiet mode (1=suppress OK responses, 2=suppress error responses)\n QUIET = 'q',\n // Cursor movement policy (0=move cursor after image, 1=don't move cursor)\n CURSOR_MOVEMENT = 'C',\n // Z-index for image layering (negative = behind text, 0+ = on top)\n Z_INDEX = 'z',\n // Transmission medium (d=direct, f=file, t=temp file, s=shared memory)\n TRANSMISSION = 't',\n // Delete selector (a/A=all, i/I=by id, c/C=at cursor, etc.) \u2014 only used when a=d\n DELETE_SELECTOR = 'd',\n // Placement ID for targeting specific placements\n PLACEMENT_ID = 'p'\n}\n\n// Pixel format constants\nexport const enum KittyPixelConstants {\n BYTES_PER_PIXEL_RGB = 3,\n BYTES_PER_PIXEL_RGBA = 4,\n ALPHA_OPAQUE = 255\n}\n\n// Parsed Kitty graphics command.\nexport interface IKittyCommand {\n action?: string;\n format?: number;\n id?: number;\n imageNumber?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n sourceWidth?: number;\n sourceHeight?: number;\n xOffset?: number;\n yOffset?: number;\n columns?: number;\n rows?: number;\n more?: number;\n quiet?: number;\n cursorMovement?: number;\n zIndex?: number;\n transmission?: string;\n deleteSelector?: string;\n placementId?: number;\n compression?: string;\n payload?: string;\n}\n\n// Pending chunked transmission state.\n// Stores metadata from the first chunk while accumulating decoded payload data.\nexport interface IPendingTransmission {\n // The parsed command from the first chunk (contains action, format, dimensions, etc.)\n cmd: IKittyCommand;\n // Decoder used across chunked payloads\n decoder: Base64Decoder;\n // Total encoded (base64) bytes received across all chunks - for size limit enforcement\n totalEncodedSize: number;\n // Whether any chunk has failed to decode\n decodeError: boolean;\n}\n\n// Stored Kitty image data.\nexport interface IKittyImageData {\n id: number;\n // Decoded image data stored as Blob (off JS heap) to avoid 2GB heap limit\n data: Blob;\n width: number;\n height: number;\n format: 24 | 32 | 100;\n compression?: string;\n}\n\n// Parses Kitty graphics control data into a command object.\nexport function parseKittyCommand(data: string): IKittyCommand {\n const cmd: IKittyCommand = {};\n const parts = data.split(',');\n\n for (const part of parts) {\n const eqIdx = part.indexOf('=');\n if (eqIdx === -1) continue;\n\n const key = part.substring(0, eqIdx);\n const value = part.substring(eqIdx + 1);\n\n // Handle string keys first\n if (key === KittyKey.ACTION) {\n cmd.action = value;\n continue;\n }\n if (key === KittyKey.COMPRESSION) {\n cmd.compression = value;\n continue;\n }\n if (key === KittyKey.TRANSMISSION) {\n cmd.transmission = value;\n continue;\n }\n if (key === KittyKey.DELETE_SELECTOR) {\n cmd.deleteSelector = value;\n continue;\n }\n const numValue = parseInt(value, 10);\n switch (key) {\n case KittyKey.FORMAT: cmd.format = numValue; break;\n case KittyKey.ID: cmd.id = numValue; break;\n case KittyKey.IMAGE_NUMBER: cmd.imageNumber = numValue; break;\n case KittyKey.WIDTH: cmd.width = numValue; break;\n case KittyKey.HEIGHT: cmd.height = numValue; break;\n case KittyKey.X_OFFSET: cmd.x = numValue; break;\n case KittyKey.Y_OFFSET: cmd.y = numValue; break;\n case KittyKey.SOURCE_WIDTH: cmd.sourceWidth = numValue; break;\n case KittyKey.SOURCE_HEIGHT: cmd.sourceHeight = numValue; break;\n case KittyKey.X_PLACEMENT_OFFSET: cmd.xOffset = numValue; break;\n case KittyKey.Y_PLACEMENT_OFFSET: cmd.yOffset = numValue; break;\n case KittyKey.COLUMNS: cmd.columns = numValue; break;\n case KittyKey.ROWS: cmd.rows = numValue; break;\n case KittyKey.MORE: cmd.more = numValue; break;\n case KittyKey.QUIET: cmd.quiet = numValue; break;\n case KittyKey.CURSOR_MOVEMENT: cmd.cursorMovement = numValue; break;\n case KittyKey.Z_INDEX: cmd.zIndex = numValue; break;\n case KittyKey.PLACEMENT_ID: cmd.placementId = numValue; break;\n }\n }\n\n return cmd;\n}\n", "/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageStorage } from '../ImageStorage';\nimport { ImageLayer, IAddImageOpts } from '../Types';\nimport { IKittyImageData } from './KittyGraphicsTypes';\n\n// Kitty-specific image storage controller.\n//\n// Wraps shared ImageStorage with kitty protocol semantics:\n// - tracks transmitted image payloads by kitty image id\n// - tracks kitty image id -> shared ImageStorage id mapping for displayed images\n// - mirrors shared-storage evictions into kitty maps\n// - applies protocol-level undisplayed-image eviction policy\nexport class KittyImageStorage implements IDisposable {\n private static readonly _maxStoredImages = 256;\n\n private _nextImageId = 1;\n private readonly _images: Map = new Map();\n // TODO: Support multiple placements per image. The kitty spec identifies\n // placements by an (image id, placement id) pair \u2014 same i + different p\n // values should coexist, and same i + same p should replace the prior\n // placement. Currently we track only one storage entry per kitty image id,\n // so multiple placements of the same image overwrite each other. Fixing\n // this requires changing these maps to Map>\n // (kittyId \u2192 placementId \u2192 storageId) and updating addImage/deleteById\n // accordingly. The underlying shared ImageStorage would also need to\n // support multiple entries per logical image.\n private readonly _kittyIdToStorageId: Map = new Map();\n private readonly _storageIdToKittyId: Map = new Map();\n\n private readonly _previousOnImageDeleted: ((storageId: number) => void) | undefined;\n private readonly _wrappedOnImageDeleted: (storageId: number) => void;\n private readonly _handleStorageImageDeleted = (storageId: number): void => {\n const kittyId = this._storageIdToKittyId.get(storageId);\n if (kittyId !== undefined) {\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n this._images.delete(kittyId);\n }\n };\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n\n constructor(\n private readonly _storage: ImageStorage\n ) {\n this._previousOnImageDeleted = this._storage.onImageDeleted;\n this._wrappedOnImageDeleted = (storageId: number) => {\n this._previousOnImageDeleted?.(storageId);\n this._handleStorageImageDeleted(storageId);\n };\n this._storage.onImageDeleted = this._wrappedOnImageDeleted;\n }\n\n public reset(): void {\n this._nextImageId = 1;\n this._images.clear();\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public dispose(): void {\n this.reset();\n if (this._storage.onImageDeleted === this._wrappedOnImageDeleted) {\n this._storage.onImageDeleted = this._previousOnImageDeleted;\n }\n }\n\n public storeImage(id: number | undefined, imageData: Omit): number {\n const imageId = id ?? this._nextImageId++;\n\n const oldStorageId = this._kittyIdToStorageId.get(imageId);\n if (oldStorageId !== undefined) {\n this._storage.deleteImage(oldStorageId);\n this._kittyIdToStorageId.delete(imageId);\n this._storageIdToKittyId.delete(oldStorageId);\n }\n\n if (!this._images.has(imageId) && this._images.size >= KittyImageStorage._maxStoredImages) {\n this._evictUndisplayedImages();\n }\n\n // Encoded images awaiting placement are outside ImageStorage's pixel budget.\n // Unplaced payloads are evicted first so a new upload cannot erase a visible\n // image while abandoned blobs still hold budget; placed ones go only when\n // that is not enough, because the byte cap is a hard bound. The new image is\n // always stored, so an oversized one overshoots by at most one payload\n // (itself bounded by kittySizeLimit) rather than being dropped after an OK ack.\n const byteLimit = this._storage.getLimit() * 1000000;\n this._images.delete(imageId);\n let retainedBytes = 0;\n for (const image of this._images.values()) retainedBytes += image.data.size;\n for (const evictPlaced of [false, true]) {\n for (const [oldestId, image] of this._images) {\n if (retainedBytes + imageData.data.size <= byteLimit) break;\n if (this._kittyIdToStorageId.has(oldestId) !== evictPlaced) continue;\n retainedBytes -= image.data.size;\n this.deleteById(oldestId);\n }\n }\n\n this._images.set(imageId, {\n ...imageData,\n id: imageId\n });\n return imageId;\n }\n\n public addImage(kittyId: number, image: HTMLCanvasElement | ImageBitmap, scrolling: boolean, layer: ImageLayer, zIndex: number): void {\n // Clean up stale reverse-mapping from a previous placement of the same\n // kitty image. The old shared-storage entry is kept (it may still be\n // visible on screen) but its reverse mapping is removed so that eviction\n // of the old entry won't incorrectly delete the kitty image data.\n const oldStorageId = this._kittyIdToStorageId.get(kittyId);\n if (oldStorageId !== undefined) {\n this._storageIdToKittyId.delete(oldStorageId);\n }\n this._addImageOpts.scrolling = scrolling;\n this._addImageOpts.layer = layer;\n this._addImageOpts.zIndex = zIndex;\n const storageId = this._storage.addImage(image, this._addImageOpts);\n this._kittyIdToStorageId.set(kittyId, storageId);\n this._storageIdToKittyId.set(storageId, kittyId);\n }\n\n public getImage(kittyId: number): IKittyImageData | undefined {\n return this._images.get(kittyId);\n }\n\n public deleteById(kittyId: number): void {\n this._images.delete(kittyId);\n const storageId = this._kittyIdToStorageId.get(kittyId);\n if (storageId !== undefined) {\n this._storage.deleteImage(storageId);\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n }\n }\n\n public deleteAll(): void {\n this._images.clear();\n for (const storageId of this._kittyIdToStorageId.values()) {\n this._storage.deleteImage(storageId);\n }\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public get images(): ReadonlyMap {\n return this._images;\n }\n\n public get kittyIdToStorageId(): ReadonlyMap {\n return this._kittyIdToStorageId;\n }\n\n public get lastImageId(): number {\n return this._nextImageId - 1;\n }\n\n private _evictUndisplayedImages(): void {\n for (const [kittyId] of this._images) {\n if (this._images.size <= KittyImageStorage._maxStoredImages / 2) {\n break;\n }\n if (!this._kittyIdToStorageId.has(kittyId)) {\n this._images.delete(kittyId);\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2020, 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IDcsHandler, IParams, IImageAddonOptions, ITerminalExt, AttributeData, IResetHandler, ReadonlyColorSet } from './Types';\nimport { toRGBA8888, BIG_ENDIAN, PALETTE_ANSI_256, PALETTE_VT340_COLOR } from 'sixel/lib/Colors';\nimport { RGBA8888 } from 'sixel/lib/Types';\nimport { ImageRenderer } from './ImageRenderer';\n\nimport { DecoderAsync, Decoder } from 'sixel/lib/Decoder';\n\n// always free decoder ressources after decoding if it exceeds this limit\nconst MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB\n\n// custom default palette: VT340 (lower 16 colors) + ANSI256 (up to 256) + zeroed (up to 4096)\nconst DEFAULT_PALETTE = PALETTE_ANSI_256;\nDEFAULT_PALETTE.set(PALETTE_VT340_COLOR);\n\n\nexport class SixelHandler implements IDcsHandler, IResetHandler {\n private _size = 0;\n private _aborted = false;\n private _dec: Decoder | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _storage: SixelImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n DecoderAsync({\n memoryLimit: this._opts.pixelLimit * 4,\n palette: DEFAULT_PALETTE,\n paletteLimit: this._opts.sixelPaletteLimit\n }).then(d => this._dec = d);\n }\n\n public reset(): void {\n /**\n * reset sixel decoder to defaults:\n * - release all memory\n * - nullify palette (4096)\n * - apply default palette (256)\n */\n if (this._dec) {\n this._dec.release();\n // FIXME: missing interface on decoder to nullify full palette\n (this._dec as any)._palette.fill(0);\n this._dec.init(0, DEFAULT_PALETTE, this._opts.sixelPaletteLimit);\n }\n }\n\n public hook(params: IParams): void {\n this._size = 0;\n this._aborted = false;\n if (this._dec) {\n const fillColor = params.params[1] === 1 ? 0 : extractActiveBg(\n this._coreTerminal._core._inputHandler._curAttrData,\n this._coreTerminal._core._themeService?.colors);\n this._dec.init(fillColor, null, this._opts.sixelPaletteLimit);\n }\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted || !this._dec) {\n return;\n }\n this._size += end - start;\n if (this._size > this._opts.sixelSizeLimit) {\n console.warn(`SIXEL: too much data, aborting`);\n this._aborted = true;\n this._dec.release();\n return;\n }\n try {\n this._dec.decode(data, start, end);\n } catch (e) {\n console.warn(`SIXEL: error while decoding image - ${e}`);\n this._aborted = true;\n this._dec.release();\n }\n }\n\n public unhook(success: boolean): boolean | Promise {\n if (this._aborted || !success || !this._dec) {\n return true;\n }\n\n const width = this._dec.width;\n const height = this._dec.height;\n\n // partial fix for https://github.com/jerch/xterm-addon-image/issues/37\n if (!width || !height) {\n if (height) {\n this._storage.advanceCursor(height);\n }\n return true;\n }\n\n const canvas = ImageRenderer.createCanvas(undefined, width, height);\n canvas.getContext('2d')?.putImageData(new ImageData(this._dec.data8 as Uint8ClampedArray, width, height), 0, 0);\n if (this._dec.memoryUsage > MEM_PERMA_LIMIT) {\n this._dec.release();\n }\n this._storage.addImage(canvas);\n return true;\n }\n}\n\n\n/**\n * Some helpers to extract current terminal colors.\n */\n\n// get currently active background color from terminal\n// also respect INVERSE setting\nfunction extractActiveBg(attr: AttributeData, colors: ReadonlyColorSet | undefined): RGBA8888 {\n let bg = 0;\n if (!colors) {\n // FIXME: theme service is prolly not available yet,\n // happens if .open() was not called yet (bug in core?)\n return bg;\n }\n if (attr.isInverse()) {\n if (attr.isFgDefault()) {\n bg = convertLe(colors.foreground.rgba);\n } else if (attr.isFgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getFgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getFgColor()].rgba);\n }\n } else {\n if (attr.isBgDefault()) {\n bg = convertLe(colors.background.rgba);\n } else if (attr.isBgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getBgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getBgColor()].rgba);\n }\n }\n return bg;\n}\n\n// rgba values on the color managers are always in BE, thus convert to LE\nfunction convertLe(color: number): RGBA8888 {\n if (BIG_ENDIAN) return color;\n return (color & 0xFF) << 24 | (color >>> 8 & 0xFF) << 16 | (color >>> 16 & 0xFF) << 8 | color >>> 24 & 0xFF;\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { IImageAddonOptions, ITerminalExt, IAddImageOpts } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\n\n/**\n * Sixel-specific image storage controller.\n *\n * Wraps the shared ImageStorage with sixel protocol semantics:\n * - Cursor behavior governed by DECSET 80 (sixelScrolling option)\n * - advanceCursor for empty sixels carrying only height\n */\nexport class SixelImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'vt340' };\n constructor(\n private readonly _storage: ImageStorage,\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _terminal: ITerminalExt\n ) {}\n\n /**\n * Add a sixel image to storage.\n * Cursor behavior depends on the sixelScrolling option (DECSET 80).\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._addImageOpts.scrolling = this._opts.sixelScrolling;\n this._storage.addImage(img, this._addImageOpts);\n }\n\n /**\n * Only advance text cursor.\n * This is an edge case from empty sixels carrying only a height but no pixels.\n * Partially fixes https://github.com/jerch/xterm-addon-image/issues/37.\n */\n public advanceCursor(height: number): void {\n if (this._opts.sixelScrolling) {\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const rows = Math.ceil(height / cellSize.height);\n for (let i = 1; i < rows; ++i) {\n this._terminal._core._inputHandler.lineFeed();\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAddImageOpts } from './Types';\nimport { ImageStorage } from './ImageStorage';\n\n/**\n * IIP (iTerm Image Protocol) specific image storage controller.\n *\n * Wraps the shared ImageStorage with IIP protocol semantics:\n * - Always uses scrolling mode (cursor advances with image)\n */\nexport class IIPImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n constructor(\n private readonly _storage: ImageStorage\n ) {}\n\n /**\n * Add an IIP image to storage.\n * Always uses scrolling mode \u2014 cursor advances past the image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._storage.addImage(img, this._addImageOpts);\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport type { ITerminalAddon, IDisposable } from '@xterm/xterm';\nimport type { ImageAddon as IImageApi } from '@xterm/addon-image';\nimport { Emitter, type IEvent } from 'common/Event';\nimport { IIPHandler } from './IIPHandler';\nimport { ImageRenderer } from './ImageRenderer';\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { KittyGraphicsHandler } from './kitty/KittyGraphicsHandler';\nimport { KittyImageStorage } from './kitty/KittyImageStorage';\nimport { SixelHandler } from './SixelHandler';\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { ITerminalExt, IImageAddonOptions, IResetHandler } from './Types';\n\n\n/**\n * Document VT features provided by this addon.\n *\n * @vt: #E[Supported via @xterm/addon-image.] DCS SIXEL \"SIXEL Graphics\" \"DCS Ps ; Ps ; Ps ; q Pt ST\" \"Draw SIXEL image.\"\n *\n * Sixel support is provided by the addon @xterm/addon-image with these limitations:\n * - immediate coloring (no shared palette, allows high color settings of `img2sixel`)\n * - max. palette size of 4096 colors\n * - max. pixel width of 16K\n * - max. 25 MB per sixel sequence\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] OSC 1337 \"iTerm2 Commands\" \"OSC 1337 ; Pt BEL\" \"Custom iTerm2 commands.\"\n *\n * Only the inline image protocol (IIP) is supported by the addon @xterm/addon-image with\n * the following limitations:\n * - sequence:\n * - format: `OSC 1337 ; File=inline=1 ; size= ; ... : BEL`\n * - size param must be set and payload may not exceed CEIL(size * 4 / 3)\n * - strict base64 handling as of RFC4648 \u00A74 (standard alphabet, optional padding,\n * no separator bytes allowed)\n * - supported params: size, name, width, height, preserveAspectRatio\n * - image formats: PNG, JPEG and GIF\n * - no animation support (renders first image of a GIF)\n * - no multipart support\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image)\n * and [iTerm2 IIP docs](https://iterm2.com/documentation-images.html) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] APC KITTY_GRAPHICS \"Kitty Graphics\" \"APC G Pt ST\" \"Kitty Graphics Protocol.\"\n *\n * Kitty graphics support is provided by the addon @xterm/addon-image.\n * Note that while basic image output already works, this is still work in progress.\n */\n\n// default values of addon ctor options\nconst DEFAULT_OPTIONS: IImageAddonOptions = {\n enableSizeReports: true,\n pixelLimit: 16777216, // limit to 4096 * 4096 pixels\n sixelSupport: true,\n sixelScrolling: true,\n sixelPaletteLimit: 4096,\n sixelSizeLimit: 33554432,\n storageLimit: 128,\n showPlaceholder: true,\n iipSupport: true,\n iipSizeLimit: 33554432,\n kittySupport: true,\n kittySizeLimit: 33554432\n};\n\n// max palette size supported by the sixel lib (compile time setting)\nconst MAX_SIXEL_PALETTE_SIZE = 4096;\n\n// definitions for _xtermGraphicsAttributes sequence\nconst enum GaItem {\n COLORS = 1,\n SIXEL_GEO = 2,\n REGIS_GEO = 3\n}\nconst enum GaAction {\n READ = 1,\n SET_DEFAULT = 2,\n SET = 3,\n READ_MAX = 4\n}\nconst enum GaStatus {\n SUCCESS = 0,\n ITEM_ERROR = 1,\n ACTION_ERROR = 2,\n FAILURE = 3\n}\n\n\nexport class ImageAddon implements ITerminalAddon, IImageApi {\n private _opts: IImageAddonOptions;\n private _defaultOpts: IImageAddonOptions;\n private _storage: ImageStorage | undefined;\n private _renderer: ImageRenderer | undefined;\n private _disposables: IDisposable[] = [];\n private _terminal: ITerminalExt | undefined;\n private _handlers: Map = new Map();\n private readonly _onImageAdded = new Emitter();\n public readonly onImageAdded: IEvent = this._onImageAdded.event;\n\n constructor(opts?: Partial) {\n this._opts = Object.assign({}, DEFAULT_OPTIONS, opts);\n this._defaultOpts = Object.assign({}, DEFAULT_OPTIONS, opts);\n }\n\n public dispose(): void {\n for (const handler of this._handlers.values()) handler.reset();\n for (const obj of this._disposables) {\n obj.dispose();\n }\n this._disposables.length = 0;\n this._handlers.clear();\n this._onImageAdded.dispose();\n }\n\n private _disposeLater(...args: IDisposable[]): void {\n for (const obj of args) {\n this._disposables.push(obj);\n }\n }\n\n public activate(terminal: ITerminalExt): void {\n this._terminal = terminal;\n\n // internal data structures\n this._renderer = new ImageRenderer(terminal);\n this._storage = new ImageStorage(terminal, this._renderer, this._opts);\n this._storage.onImageAdded = () => this._onImageAdded.fire();\n\n // enable size reports\n if (this._opts.enableSizeReports) {\n const windowOps = terminal.options.windowOptions ?? {};\n windowOps.getWinSizePixels = true;\n windowOps.getCellSizePixels = true;\n windowOps.getWinSizeChars = true;\n terminal.options.windowOptions = windowOps;\n }\n\n this._disposeLater(\n this._renderer,\n this._storage,\n\n // DECSET/DECRST/DA1/XTSMGRAPHICS handlers\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'h' }, params => this._decset(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'l' }, params => this._decrst(params)),\n terminal.parser.registerCsiHandler({ final: 'c' }, params => this._da1(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'S' }, params => this._xtermGraphicsAttributes(params)),\n\n // render hook\n terminal.onRender(range => this._storage?.render(range)),\n\n /**\n * reset handlers covered:\n * - DECSTR\n * - RIS\n * - Terminal.reset()\n */\n terminal.parser.registerCsiHandler({ intermediates: '!', final: 'p' }, () => this.reset()),\n terminal.parser.registerEscHandler({ final: 'c' }, () => this.reset()),\n terminal._core._inputHandler.onRequestReset(() => this.reset()),\n\n // wipe canvas and delete alternate images on buffer switch\n terminal.buffer.onBufferChange(() => this._storage?.wipeAlternate()),\n\n // extend images to the right on resize\n terminal.onResize(metrics => this._storage?.viewportResize(metrics))\n );\n\n // SIXEL handler\n if (this._opts.sixelSupport) {\n const sixelStorage = new SixelImageStorage(this._storage!, this._opts, this._renderer!, terminal);\n const sixelHandler = new SixelHandler(this._opts, sixelStorage, terminal);\n this._handlers.set('sixel', sixelHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerDcsHandler({ final: 'q' }, sixelHandler)\n );\n }\n\n // iTerm IIP handler\n if (this._opts.iipSupport) {\n const iipStorage = new IIPImageStorage(this._storage!);\n const iipHandler = new IIPHandler(this._opts, this._renderer!, iipStorage, terminal);\n this._handlers.set('iip', iipHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerOscHandler(1337, iipHandler)\n );\n }\n\n // Kitty graphics handler\n if (this._opts.kittySupport) {\n const kittyStorage = new KittyImageStorage(this._storage!);\n const kittyHandler = new KittyGraphicsHandler(this._opts, this._renderer!, kittyStorage, terminal);\n this._handlers.set('kitty', kittyHandler);\n this._disposeLater(\n kittyStorage,\n kittyHandler,\n terminal._core._inputHandler._parser.registerApcHandler({ final: 'G' }, kittyHandler)\n );\n }\n }\n\n // Note: storageLimit is skipped here to not intoduce a surprising side effect.\n public reset(): boolean {\n // reset options customizable by sequences to defaults\n this._opts.sixelScrolling = this._defaultOpts.sixelScrolling;\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n // also clear image storage\n this._storage?.reset();\n // reset protocol handlers\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return false;\n }\n\n public get storageLimit(): number {\n return this._storage?.getLimit() || -1;\n }\n\n public set storageLimit(limit: number) {\n this._storage?.setLimit(limit);\n this._opts.storageLimit = limit;\n }\n\n public get storageUsage(): number {\n if (this._storage) {\n return this._storage.getUsage();\n }\n return -1;\n }\n\n public get showPlaceholder(): boolean {\n return this._opts.showPlaceholder;\n }\n\n public set showPlaceholder(value: boolean) {\n this._opts.showPlaceholder = value;\n this._renderer?.showPlaceholder(value);\n }\n\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.getImageAtBufferCell(x, y);\n }\n\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.extractTileAtBufferCell(x, y);\n }\n\n private _report(s: string): void {\n this._terminal?._core.input(s, false);\n }\n\n private _decset(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = false;\n break;\n }\n }\n return false;\n }\n\n private _decrst(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = true;\n break;\n }\n }\n return false;\n }\n\n // overload DA to return something more appropriate\n private _da1(params: (number | number[])[]): boolean {\n if (params[0]) {\n return true;\n }\n // reported features:\n // 62 - VT220\n // 4 - SIXEL support\n // 9 - charsets\n // 22 - ANSI colors\n if (this._opts.sixelSupport) {\n this._report(`\\x1b[?62;4;9;22c`);\n return true;\n }\n return false;\n }\n\n /**\n * Implementation of xterm's graphics attribute sequence.\n *\n * Supported features:\n * - read/change palette limits (max 4096 by sixel lib)\n * - read SIXEL canvas geometry (reports current window canvas or\n * squared pixelLimit if canvas > pixel limit)\n *\n * Everything else is deactivated.\n */\n private _xtermGraphicsAttributes(params: (number | number[])[]): boolean {\n if (params.length < 2) {\n return true;\n }\n if (params[0] === GaItem.COLORS) {\n switch (params[1]) {\n case GaAction.READ:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n return true;\n case GaAction.SET_DEFAULT:\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n // also reset protocol handlers for now\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return true;\n case GaAction.SET:\n if (params.length > 2 && !(params[2] instanceof Array) && params[2] <= MAX_SIXEL_PALETTE_SIZE) {\n this._opts.sixelPaletteLimit = params[2];\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n } else {\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n }\n return true;\n case GaAction.READ_MAX:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${MAX_SIXEL_PALETTE_SIZE}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n if (params[0] === GaItem.SIXEL_GEO) {\n switch (params[1]) {\n // we only implement read and read_max here\n case GaAction.READ:\n let width = this._renderer?.dimensions?.css.canvas.width;\n let height = this._renderer?.dimensions?.css.canvas.height;\n if (!width || !height) {\n // for some reason we have no working image renderer\n // --> fallback to default cell size\n const cellSize = CELL_SIZE_DEFAULT;\n width = (this._terminal?.cols || 80) * cellSize.width;\n height = (this._terminal?.rows || 24) * cellSize.height;\n }\n if (width * height < this._opts.pixelLimit) {\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${width.toFixed(0)};${height.toFixed(0)}S`);\n } else {\n // if we overflow pixelLimit report that squared instead\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n }\n return true;\n case GaAction.READ_MAX:\n // read_max returns pixelLimit as square area\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n // exit with error on ReGIS or any other requests\n this._report(`\\x1b[?${params[0]};${GaStatus.ITEM_ERROR}S`);\n return true;\n }\n}\n"], -+ "mappings": ";;;;;;;;;;;;;;;;02BAYaA,EAAA,WAAa,IAAI,WAAW,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,IAAM,IAClFA,EAAA,YACF,QAAQ,KAAK,6EAA6E,EAI5F,SAAgBC,GAAIC,EAAW,CAC7B,OAAOA,EAAI,GACb,CAFAF,EAAA,IAAAC,GAIA,SAAgBE,GAAMD,EAAW,CAC/B,OAAQA,IAAM,EAAK,GACrB,CAFAF,EAAA,MAAAG,GAIA,SAAgBC,GAAKF,EAAW,CAC9B,OAAQA,IAAM,GAAM,GACtB,CAFAF,EAAA,KAAAI,GAIA,SAAgBC,GAAMH,EAAW,CAC/B,OAAQA,IAAM,GAAM,GACtB,CAFAF,EAAA,MAAAK,GAQA,SAAgBC,EAAWC,EAAWC,EAAWC,EAAWC,EAA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K,KAAK,KAAK,MAAM,UAAU,CAAC,EACrD,YAAK,QAAQ,SAASjB,EAAO,CAAC,CAAC,MAAwBiB,CAAC,IAAIA,CAAC,GAAG,EACzD,GACT,QACE,YAAK,QAAQ,SAASjB,EAAO,CAAC,CAAC,KAA4B,EACpD,EACX,CAGF,YAAK,QAAQ,SAASA,EAAO,CAAC,CAAC,KAA0B,EAClD,EACT,CACF", -+ "names": ["exports", "red", "n", "green", "blue", "alpha", "toRGBA8888", "r", "g", "b", "a", "fromRGBA8888", "color", "nearestColorIndex", "palette", "min", "idx", "i", "dr", "dg", "db", "clamp", "low", "high", "value", "h2c", "t1", "t2", "c", "HLStoRGB", "h", "l", "s", "v", "normalizeRGB", "normalizeHLS", "p", "d", "require_lib", "__commonJSMin", "exports", "InWasm", "z", "b", "r", "def", "t", "s", "d", "m", "W", "e", "require_Base64Decoder_wasm", "__commonJSMin", "exports", "inwasm_runtime_1", "wasmDecode", "MAP", "el", "D", "i", "EMPTY", "Base64Decoder", "keepSize", "maxBytes", "initialBytes", "m", "bytes", "requested", "needed", "newSize", "addPages", "data", "require_QoiDecoder_wasm", "__commonJSMin", "exports", "inwasm_runtime_1", "wasmQoiDecode", "QoiDecoder", "keepSize", "d", "pixels", "ib", "dl", "bytes", "chunkP", "exports", "Colors_1", "wasm_1", "decodeBase64", "bytestring", "result", "WASM_BYTES", "WASM_MODULE", "NULL_CANVAS", "CallbackProxy", "width", "mode", "DEFAULT_OPTIONS", "DecoderAsync", "opts", "cbProxy", "importObj", "inst", "Decoder", "exports", "_instance", "_cbProxy", "module", "pixels", "offset", "additionalPixels", "newCanvas", "adv", "remaining", "c", "i", "fillColor", "palette", "paletteLimit", "truncate", "data", "start", "end", "p", "length", "j", "currentWidth", "escape", "final", "finalOffset", "bw", "currentHeight", "decode", "dec", "decodeAsync", "toDisposable", "fn", "DisposableStore", "o", "d", "Disposable", "MutableDisposable", "value", "Emitter", "listener", "thisArgs", "disposables", "toDisposable", "entry", "result", "idx", "event", "listeners", "len", "EventUtils", "forward", "from", "to", "e", "map", "i", "any", "events", "store", "DisposableStore", "runAndSubscribe", "handler", "initial", "import_Colors", "ImageRenderer", "_ImageRenderer", "Disposable", "_terminal", "MutableDisposable", "parent", "option", "toDisposable", "localDocument", "width", "height", "canvas", "ctx", "buffer", "imgData", "img", "value", "start", "end", "layer", "y", "w", "h", "imgSpec", "tileId", "col", "row", "count", "sourceWidth", "sourceHeight", "cols", "sx", "sy", "dx", "dy", "finalWidth", "finalHeight", "spec", "currentWidth", "currentHeight", "originalWidth", "originalHeight", "scaledWidth", "scaledHeight", "renderer", "key", "screenElement", "bWidth", "blueprint", "d32", "black", "white", "shift", "offset", "x", "ctx2", "i", "placeholder", "bitmap", "CELL_SIZE_DEFAULT", "ExtendedAttrsImage", "_ExtendedAttrsImage", "ext", "urlId", "imageId", "tileId", "value", "val", "EMPTY_ATTRS", "ImageStorage", "_terminal", "_renderer", "_opts", "e", "spec", "storedPixels", "id", "zero", "img", "opts", "cellSize", "cols", "rows", "buffer", "termCols", "termRows", "originX", "originY", "offset", "tileCount", "row", "line", "col", "endMarker", "imgSpec", "range", "hasTopImages", "hasBottomImages", "start", "end", "drawCalls", "placeholderCalls", "startTile", "startCol", "count", "a", "b", "call", "metrics", "oldCol", "tilesPerRow", "hasData", "rightCol", "lastTile", "expandCol", "x", "y", "orig", "canvas", "ImageRenderer", "room", "used", "current", "old", "oldSpec", "imgId", "import_Base64Decoder", "import_QoiDecoder", "toStr", "data", "s", "i", "toInt", "v", "toSize", "toName", "bs", "b", "DECODERS", "FILE_MARKER", "MULTIPARTFILE_MARKER", "FILEPART_MARKER", "FILEEND_MARKER", "REPORTCELLSIZE_MARKER", "MAX_FIELDCHARS", "HeaderParser", "k", "start", "end", "state", "pos", "buffer", "c", "UNSUPPORTED_TYPE", "imageType", "d", "d32", "width", "height", "jpgSize", "dim", "pos", "limit", "i", "len", "blockLength", "DEFAULT_HEADER", "IIPHandler", "_opts", "_renderer", "_storage", "_coreTerminal", "HeaderParser", "maxEncodedBytes", "initialBytes", "Base64Decoder", "QoiDecoder", "data", "start", "end", "dataPos", "success", "seqType", "w", "CELL_SIZE_DEFAULT", "h", "scale", "report", "cond", "metrics", "UNSUPPORTED_TYPE", "imageType", "blob", "canvas", "ImageRenderer", "generation", "bm", "e", "cw", "ch", "width", "height", "rw", "rh", "wf", "hf", "f", "s", "total", "cdim", "import_Base64Decoder", "parseKittyCommand", "data", "cmd", "parts", "part", "eqIdx", "key", "value", "numValue", "DECODER_OK", "KittyGraphicsHandler", "_opts", "_renderer", "_kittyStorage", "_coreTerminal", "key", "pending", "data", "start", "end", "controlEnd", "i", "copyLength", "parseKittyCommand", "payloadStart", "pendingKey", "previousEncodedSize", "decoderToRelease", "decoderCapacity", "maxPending", "oldest", "Base64Decoder", "success", "cmd", "isMoreComing", "decodeError", "finalCmd", "decoder", "imageBytes", "result", "str", "bytes", "id", "image", "quiet", "format", "width", "height", "bytesPerPixel", "expectedBytes", "message", "placementId", "isOk", "pPart", "response", "generation", "bitmap", "cropX", "cropY", "cropW", "cropH", "maxCropW", "maxCropH", "finalCropW", "finalCropH", "cropped", "cw", "CELL_SIZE_DEFAULT", "ch", "imgCols", "imgRows", "w", "h", "buffer", "savedX", "savedY", "savedYbase", "layer", "scaled", "xOffset", "yOffset", "canvasW", "canvasH", "offsetCanvas", "ImageRenderer", "offsetCtx", "offsetBitmap", "zIndex", "scrolled", "e", "metrics", "imageType", "blob", "url", "img", "resolve", "reject", "canvas", "pixelCount", "src32", "dst32", "alignedPixels", "srcOffset", "dstOffset", "b0", "b1", "b2", "srcByte", "dstByte", "compressed", "error", "limit", "offsetIn", "reader", "controller", "chunks", "totalLength", "done", "value", "offset", "chunk", "_KittyImageStorage", "_storage", "storageId", "kittyId", "id", "imageData", "imageId", "oldStorageId", "byteLimit", "retainedBytes", "image", "evictPlaced", "oldestId", "scrolling", "layer", "zIndex", "KittyImageStorage", "import_Colors", "import_Decoder", "MEM_PERMA_LIMIT", "DEFAULT_PALETTE", "SixelHandler", "_opts", "_storage", "_coreTerminal", "d", "params", "fillColor", "extractActiveBg", "data", "start", "end", "e", "success", "width", "height", "canvas", "ImageRenderer", "attr", "colors", "bg", "convertLe", "t", "color", "SixelImageStorage", "_storage", "_opts", "_renderer", "_terminal", "img", "height", "cellSize", "CELL_SIZE_DEFAULT", "rows", "i", "IIPImageStorage", "_storage", "img", "DEFAULT_OPTIONS", "MAX_SIXEL_PALETTE_SIZE", "ImageAddon", "opts", "Emitter", "DEFAULT_OPTIONS", "handler", "obj", "args", "terminal", "ImageRenderer", "ImageStorage", "windowOps", "params", "range", "metrics", "sixelStorage", "SixelImageStorage", "sixelHandler", "SixelHandler", "iipStorage", "IIPImageStorage", "iipHandler", "IIPHandler", "kittyStorage", "KittyImageStorage", "kittyHandler", "KittyGraphicsHandler", "limit", "value", "x", "y", "s", "i", "MAX_SIXEL_PALETTE_SIZE", "width", "height", "cellSize", "CELL_SIZE_DEFAULT"] ++ "sourcesContent": [null, "\"use strict\";\n/**\n * Copyright (c) 2022, 2026 Joerg Breitbart\n * @license MIT\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InWasm = InWasm;\nlet z = (s) => {\n if (Uint8Array.fromBase64)\n return Uint8Array.fromBase64(s);\n if (typeof Buffer !== 'undefined')\n return Buffer.from(s, 'base64');\n const b = atob(s);\n const r = new Uint8Array(b.length);\n for (let i = 0; i < r.length; ++i)\n r[i] = b.charCodeAt(i);\n return r;\n};\nfunction InWasm(def) {\n if (def.d) {\n const { t, s, d } = def;\n let b;\n let m;\n const W = WebAssembly;\n if (t === 0 /* OutputType.INSTANCE */) {\n if (s)\n return (e) => new W.Instance(m || (m = new W.Module(b || (b = z(d)))), e);\n return (e) => m\n ? W.instantiate(m, e)\n : W.instantiate(b || (b = z(d)), e).then(r => (m = r.module) && r.instance);\n }\n if (t === 1 /* OutputType.MODULE */) {\n if (s)\n return () => m || (m = new W.Module(b || (b = z(d))));\n return () => m\n ? Promise.resolve(m)\n : W.compile(b || (b = z(d))).then(r => m = r);\n }\n if (s)\n return () => b || (b = z(d));\n return () => Promise.resolve(b || (b = z(d)));\n }\n if (typeof _wasmCtx === 'undefined')\n throw new Error('must run \"inwasm\"');\n _wasmCtx.add(def);\n}\n//# sourceMappingURL=index.js.map", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023, 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\n/**\n * wasm base64 decoder.\n */\nconst wasmDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#828e69684093b2c6:rdef-start:\"decode\"*/{s:1,t:0,d:'AGFzbQEAAAABBQFgAAF/Ag8BA2VudgZtZW1vcnkCAAEDAwIAAAcNAgNkZWMAAANlbmQAAQqLBgKZBAEKf0GIKCgCAEGgKGohAUGEKCgCACIDQaAoaiEAQYAoKAIAQQFrQXxxIgRBoChqIQUgBEEQayADSgRAIARBkChqIQMDQCABIABBA2otAABBAnQoAoAgIABBAmotAABBAnQoAoAYIABBAWotAABBAnQoAoAQIAAtAABBAnQoAoAIcnJyIgY2AgAgAUEDaiAAQQdqLQAAQQJ0KAKAICAAQQZqLQAAQQJ0KAKAGCAAQQVqLQAAQQJ0KAKAECAAQQRqLQAAQQJ0KAKACHJyciIHNgIAIAFBBmogAEELai0AAEECdCgCgCAgAEEKai0AAEECdCgCgBggAEEJai0AAEECdCgCgBAgAEEIai0AAEECdCgCgAhycnIiCDYCACABQQlqIABBD2otAABBAnQoAoAgIABBDmotAABBAnQoAoAYIABBDWotAABBAnQoAoAQIABBDGotAABBAnQoAoAIcnJyIgk2AgAgAiAGciAHciAIciAJciECIAFBDGohASAAQRBqIgAgA0kNAAsLIAAgBUkEQANAIAEgAEEDai0AAEECdCgCgCAgAEECai0AAEECdCgCgBggAEEBai0AAEECdCgCgBAgAC0AAEECdCgCgAhycnIiAzYCACACIANyIQIgAUEDaiEBIABBBGoiACAFSQ0ACwtBfyEAIAJB////B00Ef0GEKCAENgIAQYgoIAFBoChrNgIAQQAFQX8LC+0BAQR/AkBBgCgoAgAiAUGEKCgCACIAa0EFTgRAQX8hAxAADQFBgCgoAgAhAUGEKCgCACEAC0F/IQMgASAAayIBQQJIDQAgAC0AoShBAnQoAoAQIAAtAKAoQQJ0KAKACHIhAgJ/IAFBBEYEQEEDQQQgAC0AoyhBPUYbIAAtAKIoQT1GayEBC0EBIAFBA0kNABogAC0AoihBAnQoAoAYIAJyIQJBAiABQQRHDQAaIAAtAKMoQQJ0KAKAICACciECQQMLIQEgAkH///8HSw0AQQAhA0GIKCgCACIAIAI2AKAoQYgoIAAgAWo2AgALIAML'}/*inwasm#828e69684093b2c6:rdef-end:\"decode\"*/);\n// SIMD version (speedup ~1.4x, not covered by tests yet)\n/*\nconst wasmDecode = InWasm({\n name: 'decode',\n type: OutputType.INSTANCE,\n mode: OutputMode.SYNC,\n srctype: 'Clang-C',\n imports: {\n env: { memory: new WebAssembly.Memory({ initial: 1 }) }\n },\n exports: {\n dec: () => 0,\n end: () => 0\n },\n compile: {\n switches: ['-msimd128', '-Wl,-z,stack-size=0', '-Wl,--stack-first']\n },\n code: `\n #include \n typedef struct {\n unsigned int wp;\n unsigned int sp;\n unsigned int dp;\n unsigned int e_size;\n unsigned int dummy[4];\n unsigned char data[0];\n } State;\n\n unsigned int *D0 = (unsigned int *) ${P32.D0 * 4};\n unsigned int *D1 = (unsigned int *) ${P32.D1 * 4};\n unsigned int *D2 = (unsigned int *) ${P32.D2 * 4};\n unsigned int *D3 = (unsigned int *) ${P32.D3 * 4};\n State *state = (State *) ${P32.STATE * 4};\n\n #define packed_byte(x) wasm_i8x16_splat((char) x)\n #define packed_dword(x) wasm_i32x4_splat(x)\n #define masked(x, mask) wasm_v128_and(x, wasm_i32x4_splat(mask))\n\n __attribute__((noinline)) int dec() {\n unsigned int nsp = (state->wp - 1) & ~3;\n unsigned char *src = state->data + state->sp;\n unsigned char *end = state->data + nsp;\n unsigned char *dst = state->data + state->dp;\n unsigned int error = 0;\n\n v128_t err = wasm_i8x16_splat(0);\n unsigned char *end16 = state->data + (nsp & ~15);\n while (src < end16) {\n v128_t data = wasm_v128_load((v128_t *) src);\n\n // wasm-simd rewrite of http://0x80.pl/notesen/2016-01-17-sse-base64-decoding.html#vector-lookup-pshufb\n const v128_t higher_nibble = wasm_u32x4_shr(data, 4) & packed_byte(0x0f);\n const char linv = 1;\n const char hinv = 0;\n\n const v128_t lower_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n linv, linv, 0x2b, 0x30,\n 0x41, 0x50, 0x61, 0x70,\n linv, linv, linv, linv,\n linv, linv, linv, linv\n );\n const v128_t upper_bound_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n hinv, hinv, 0x2b, 0x39,\n 0x4f, 0x5a, 0x6f, 0x7a,\n hinv, hinv, hinv, hinv,\n hinv, hinv, hinv, hinv\n );\n // the difference between the shift and lower bound\n const v128_t shift_LUT = wasm_i8x16_const(\n // order: 0 1 2 3 4 5 6 7 8 9 a b c d e f\n 0x00, 0x00, 0x3e - 0x2b, 0x34 - 0x30,\n 0x00 - 0x41, 0x0f - 0x50, 0x1a - 0x61, 0x29 - 0x70,\n 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00\n );\n\n const v128_t upper_bound = wasm_i8x16_swizzle(upper_bound_LUT, higher_nibble);\n const v128_t lower_bound = wasm_i8x16_swizzle(lower_bound_LUT, higher_nibble);\n\n const v128_t below = wasm_i8x16_lt(data, lower_bound);\n const v128_t above = wasm_i8x16_gt(data, upper_bound);\n const v128_t eq_2f = wasm_i8x16_eq(data, packed_byte(0x2f));\n\n // in_range = not (below or above) or eq_2f\n // outside = not in_range = below or above and not eq_2f (from deMorgan law)\n const v128_t outside = wasm_v128_andnot(eq_2f, above | below);\n err = wasm_v128_or(err, outside);\n\n const v128_t shift = wasm_i8x16_swizzle(shift_LUT, higher_nibble);\n const v128_t t0 = wasm_i8x16_add(data, shift);\n v128_t v = wasm_i8x16_add(t0, wasm_v128_and(eq_2f, packed_byte(-3)));\n\n // pack bytes\n const v128_t ca = masked(v, 0x003f003f);\n const v128_t db = masked(v, 0x3f003f00);\n const v128_t t00 = wasm_v128_or(wasm_u32x4_shr(db, 8), wasm_i32x4_shl(ca, 6));\n v128_t res = wasm_v128_or(wasm_u32x4_shr(t00, 16), wasm_i32x4_shl(t00, 12));\n res = wasm_i8x16_swizzle(res, wasm_i8x16_const(2, 1, 0, 6, 5, 4, 10, 9, 8, 14, 13, 12, 16, 16, 16, 16));\n\n wasm_v128_store((v128_t *) dst, res);\n dst += 12;\n src += 16;\n }\n //if (wasm_i8x16_bitmask(err) != 0) return -1;\n if (wasm_v128_any_true(err)) return -1;\n\n // operate on 4-byte blocks\n while (src < end) {\n error |= *((unsigned int *) dst) = D0[src[0]] | D1[src[1]] | D2[src[2]] | D3[src[3]];\n dst += 3;\n src += 4;\n }\n if (error >> 24) return -1;\n state->sp = nsp;\n state->dp = dst - state->data;\n return 0;\n }\n\n int end() {\n int rem = state->wp - state->sp;\n if (rem > 4 && dec()) return -1;\n rem = state->wp - state->sp;\n if (rem < 2) return -1;\n\n unsigned char *src = state->data + state->sp;\n if (rem == 4) {\n if (src[3] == 61) rem--;\n if (src[2] == 61) rem--;\n }\n unsigned int accu = D0[src[0]] | D1[src[1]];\n int dp = 1;\n if (rem > 2) {\n accu |= D2[src[2]];\n dp++;\n if (rem == 4) {\n accu |= D3[src[3]];\n dp++;\n }\n }\n if (accu >> 24) return -1;\n *((unsigned int *) (state->data + state->dp)) = accu;\n state->dp += dp;\n return 0;\n }\n `\n});\n*/\n// base64 map\nconst MAP = new Uint8Array('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n .split('')\n .map(el => el.charCodeAt(0)));\n// init decoder maps in LE order\nconst D = new Uint32Array(1024);\nD.fill(0xFF000000);\nfor (let i = 0; i < MAP.length; ++i)\n D[MAP[i]] = i << 2;\nfor (let i = 0; i < MAP.length; ++i)\n D[256 + MAP[i]] = i >> 4 | ((i << 4) & 0xFF) << 8;\nfor (let i = 0; i < MAP.length; ++i)\n D[512 + MAP[i]] = (i >> 2) << 8 | ((i << 6) & 0xFF) << 16;\nfor (let i = 0; i < MAP.length; ++i)\n D[768 + MAP[i]] = i << 16;\nconst EMPTY = new Uint8Array(0);\n/**\n * base64 stream decoder.\n *\n * Features / assumptions:\n * - lazy chunkwise decoding\n * - errors out on any non base64 chars (no support for NL formatted base64)\n * - decodes in wasm\n * - inplace decoding to save memory\n * - supports a keepSize for lazy memory release\n */\nclass Base64Decoder {\n /**\n * @param keepSize Keep the wasm instance below this limit when calling `release()`.\n * @param maxBytes Max allowed bytes to allocate.\n * @param initialBytes Initial bytes to allocate.\n */\n constructor(keepSize, maxBytes, initialBytes) {\n this._inst = null;\n this._ended = true;\n this._bytes = 0;\n this.keepSize = keepSize !== null && keepSize !== void 0 ? keepSize : 1048576 /* Bytes.KEEP */;\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : 4294901760 /* Bytes.MAX */;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : 32768 /* Bytes.INITIAL */;\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw new Error('invalid byte settings');\n }\n }\n /**\n * Currently decoded bytes (borrowed).\n * Must be accessed before calling `release` or `init`.\n */\n get data8() {\n return this._inst ? this._d.subarray(0, this._m32[1282 /* P32.STATE_DP */]) : EMPTY;\n }\n /**\n * Release memory conditionally based on `keepSize`.\n * If memory gets released, also the wasm instance will be freed and recreated on next `init`,\n * otherwise the instance will be reused.\n */\n release() {\n if (!this._inst)\n return;\n if (this._bytes > this.keepSize) {\n this._inst = this._m32 = this._d = this._mem = null;\n }\n else {\n this._m32[1280 /* P32.STATE_WP */] = 0;\n this._m32[1281 /* P32.STATE_SP */] = 0;\n this._m32[1282 /* P32.STATE_DP */] = 0;\n }\n }\n /**\n * Initializes the decoder for new base64 data.\n * Must be called before doing any decoding attempts.\n * The method will either spawn a new wasm instance or grow\n * the needed memory of an existing instance.\n * @param maxBytes Max allowed bytes to allocate (overwrites ctor value).\n * @param initialBytes Initial bytes to allocate (overwrites ctor value).\n */\n init(maxBytes, initialBytes) {\n this.maxBytes = maxBytes !== null && maxBytes !== void 0 ? maxBytes : this.maxBytes;\n this._bytes = initialBytes !== null && initialBytes !== void 0 ? initialBytes : Math.min(this._bytes, this.maxBytes);\n if (this._bytes > this.maxBytes || this.maxBytes > 4294901760 /* Bytes.MAX */) {\n throw Error('invalid byte settings');\n }\n let m = this._m32;\n const bytes = this._bytes + 5152 /* Bytes._DATA_OFFSET */;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmDecode({ env: { memory: this._mem } });\n m = new Uint32Array(this._mem.buffer, 0);\n m.set(D, 256 /* P32.D0 */);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n m = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n m[1280 /* P32.STATE_WP */] = 0;\n m[1281 /* P32.STATE_SP */] = 0;\n m[1282 /* P32.STATE_DP */] = 0;\n this._m32 = m;\n this._ended = false;\n }\n /**\n * Realloc memory. Realloc only happens, if the requested\n * size doesn't fit in the current memory.\n * The new size will be capped by `maxBytes`.\n * @param requested Bytes to be stored.\n */\n _realloc(requested) {\n const needed = this._m32[1280 /* P32.STATE_WP */] + requested;\n if (this._bytes < needed) {\n if (needed > this.maxBytes) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n let newSize = this._bytes;\n while ((newSize *= 2) < needed) { }\n newSize = Math.min(newSize, this.maxBytes);\n if (newSize < needed) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n if (newSize + 5152 /* Bytes._DATA_OFFSET */ > this._mem.buffer.byteLength) {\n const addPages = Math.ceil((newSize + 5152 /* Bytes._DATA_OFFSET */ - this._mem.buffer.byteLength) / 65536);\n this._mem.grow(addPages);\n this._m32 = new Uint32Array(this._mem.buffer, 0);\n this._d = new Uint8Array(this._mem.buffer, 5152 /* Bytes._DATA_OFFSET */);\n }\n this._bytes = newSize;\n }\n return 0 /* DecodeStatus.OK */;\n }\n /**\n * Put bytes in `data` into the decoder.\n * Additionally decodes the payload, if it reached 2^17 bytes.\n * The return value indicates the type of issue.\n * @param data Bytes to be loaded.\n */\n put(data) {\n if (!this._inst || this._ended) {\n return -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n if (this._realloc(data.length)) {\n return -3 /* DecodeStatus.SIZE_EXCEEDED */;\n }\n const m = this._m32;\n this._d.set(data, m[1280 /* P32.STATE_WP */]);\n m[1280 /* P32.STATE_WP */] += data.length;\n // max chunk in input handler is 2^17, try to run in \"tandem mode\"\n return m[1280 /* P32.STATE_WP */] - m[1281 /* P32.STATE_SP */] >= 131072\n ? this._inst.exports.dec()\n : 0 /* DecodeStatus.OK */;\n }\n /**\n * End the current decoding.\n * Also decodes leftover payload from previous put calls.\n */\n end() {\n this._ended = true;\n return this._inst\n ? this._inst.exports.end()\n : -2 /* DecodeStatus.NOT_INITIALIZED */;\n }\n /**\n * Bytes loaded into the decoder.\n */\n get loadedBytes() {\n return this._inst\n ? this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n /**\n * Free bytes to feed to the decoder.\n */\n get freeBytes() {\n return this._inst\n ? this.maxBytes - this._m32[1280 /* P32.STATE_WP */]\n : 0;\n }\n}\nexports.default = Base64Decoder;\n//# sourceMappingURL=Base64Decoder.wasm.js.map", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nconst inwasm_runtime_1 = require(\"inwasm-runtime\");\nconst wasmQoiDecode = (0, inwasm_runtime_1.InWasm)(/*inwasm#459f9e1bfb80b1a8:rdef-start:\"qoi_decode\"*/{s:1,t:0,d:'AGFzbQEAAAABCgJgAABgA39/fwACDwEDZW52Bm1lbW9yeQIAAQMDAgABBwcBA2RlYwABCAEACu4EAgwAQQBBAEGAAvwLAAveBAEJf0EAQQBBgAL8CwAgAUEXTgRAIAAgAWpBCGshCkGACCEBIAJBAnRBgAhqIQsgAEEOaiEDQf8BIQZBACECA0AgA0EBaiEHIAMtAAAiCEE/cSEAAkACQCAIQcABcSIJRQRAIABBAnQiAC0AAyEGIAAtAAIhBCAALQABIQUgAC0AACECIAchAwwBCwJAIAhB/QFLDQAgCUHAAUcNACAFQQVsIAJBA2xqIARBB2xqIAZBC2xqQT9xQQJ0IgMgBDoAAiADIAU6AAEgAyACOgAAIANBA2ogBjoAAANAIAEgAjoAACABQQNqIAY6AAAgAUECaiAEOgAAIAFBAWogBToAACABQQRqIQEgAEUEQCAHIQMMBAsgAEEBayEAIAEgC0kNAAsgByEDDAILAn8CQAJAAkAgCEH+AWsOAgABAgsgAy0AAyEEIAMtAAIhBSADLQABIQIgA0EEagwCCyADKAIBIgJBGHYhBiACQRB2IQQgAkEIdiEFIANBBWoMAQsgCUGAAUcEQCAHIAlBwABHDQEaIAQgCEEDcWpBAmshBCACIABBBHZqQQJrIQIgBSAIQQJ2QQNxakECayEFIAcMAQsgBCAAQShrIgkgAy0AASIHQQ9xamohBCACIAdBBHYgCWpqIQIgACAFakEgayEFIANBAmoLIQMgBUEFbCACQQNsaiAEQQdsaiAGQQtsakE/cUECdCIAIAQ6AAIgACAFOgABIAAgAjoAACAAQQNqIAY6AAALIAEgBjoAAyABIAQ6AAIgASAFOgABIAEgAjoAACABQQRqIQELIAMgCkkNAAsLCw=='}/*inwasm#459f9e1bfb80b1a8:rdef-end:\"qoi_decode\"*/);\nclass QoiDecoder {\n constructor(keepSize) {\n this.keepSize = keepSize;\n this.width = 0;\n this.height = 0;\n }\n decode(d) {\n this.width = d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7];\n this.height = d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11];\n const pixels = this.width * this.height;\n const ib = pixels * 4;\n const dl = d.length;\n /**\n * byte/offset calculation:\n * To save some memory we dont reserve full memory for decoded + encoded,\n * but place encoded at the end of decoded plus 50% security distance\n * to avoid reads before writes positions:\n *\n * encoded < decoded (good compression)\n * enc ####################\n * dec #######################################\n * ^ ^\n * DST_P CHUNK_P\n *\n * encoded > decoded (degenerated compression, should not happen)\n * enc ##############################\n * dec ####################\n * ^ ^\n * DST_P CHUNK_P\n *\n * There is still a chance for overlapping r/w positions in case the compressed\n * data has very different pixel progression, yet the 50% security distance\n * should deal with that, as QOI will bloat data by 25% at max (RGB -> OP byte + RGB).\n * Since we always assume RGBA at decoding stage, the possible bloat reduces to 20% at max.\n */\n const bytes = Math.max(ib, dl) + (Math.min(ib, dl) >> 1) + 4096;\n if (!this._inst) {\n this._mem = new WebAssembly.Memory({ initial: Math.ceil(bytes / 65536) });\n this._inst = wasmQoiDecode({ env: { memory: this._mem } });\n }\n else if (this._mem.buffer.byteLength < bytes) {\n this._mem.grow(Math.ceil((bytes - this._mem.buffer.byteLength) / 65536));\n this._d = null;\n }\n if (!this._d) {\n this._d = new Uint8Array(this._mem.buffer);\n }\n // put src data at the end of memory, also align to 256\n const chunkP = (this._mem.buffer.byteLength - dl) & ~0xFF;\n this._d.set(d, chunkP);\n this._inst.exports.dec(chunkP, dl, pixels);\n return this._d.subarray(1024 /* P8.DST_P */, 1024 /* P8.DST_P */ + ib);\n }\n release() {\n if (!this._inst)\n return;\n if (this._mem.buffer.byteLength > this.keepSize) {\n this._inst = this._d = this._mem = null;\n }\n }\n}\nexports.default = QoiDecoder;\n//# sourceMappingURL=QoiDecoder.wasm.js.map", null, null, "/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal lifecycle utilities for xterm.js core.\n * Simplified from VS Code's lifecycle.ts - no tracking/leak detection.\n */\n\nexport interface IDisposable {\n dispose(): void;\n}\n\nexport function toDisposable(fn: () => void): IDisposable {\n return { dispose: fn };\n}\n\nexport function dispose(disposable: T): T;\nexport function dispose(disposable: T | undefined): T | undefined;\nexport function dispose(disposables: T[]): T[];\nexport function dispose(arg: T | T[] | undefined): T | T[] | undefined {\n if (!arg) {\n return arg;\n }\n if (Array.isArray(arg)) {\n for (const d of arg) {\n d.dispose();\n }\n return [];\n }\n arg.dispose();\n return arg;\n}\n\nexport function combinedDisposable(...disposables: IDisposable[]): IDisposable {\n return toDisposable(() => dispose(disposables));\n}\n\nexport class DisposableStore implements IDisposable {\n private readonly _disposables = new Set();\n private _isDisposed = false;\n\n public get isDisposed(): boolean {\n return this._isDisposed;\n }\n\n public add(o: T): T {\n if (this._isDisposed) {\n o.dispose();\n } else {\n this._disposables.add(o);\n }\n return o;\n }\n\n public dispose(): void {\n if (this._isDisposed) {\n return;\n }\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n\n public clear(): void {\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.clear();\n }\n}\n\nexport abstract class Disposable implements IDisposable {\n public static readonly None: IDisposable = Object.freeze({ dispose() { } });\n\n protected readonly _store = new DisposableStore();\n\n public dispose(): void {\n this._store.dispose();\n }\n\n protected _register(o: T): T {\n return this._store.add(o);\n }\n}\n\nexport class MutableDisposable implements IDisposable {\n private _value: T | undefined;\n private _isDisposed = false;\n\n public get value(): T | undefined {\n return this._isDisposed ? undefined : this._value;\n }\n\n public set value(value: T | undefined) {\n if (this._isDisposed || value === this._value) {\n return;\n }\n this._value?.dispose();\n this._value = value;\n }\n\n public clear(): void {\n this.value = undefined;\n }\n\n public dispose(): void {\n this._isDisposed = true;\n this._value?.dispose();\n this._value = undefined;\n }\n}\n", "/**\n * Copyright (c) 2024-2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Minimal event utilities for xterm.js core.\n * Simplified from VS Code's event.ts - no leak detection/profiling.\n */\n\nimport { IDisposable, DisposableStore, toDisposable } from './Lifecycle';\n\nexport interface IEvent {\n (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore): IDisposable;\n}\n\nexport class Emitter {\n private _listeners: { fn: (e: T) => any, thisArgs: any }[] = [];\n private _disposed = false;\n private _event: IEvent | undefined;\n\n public get event(): IEvent {\n if (this._event) {\n return this._event;\n }\n this._event = (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n if (this._disposed) {\n return toDisposable(() => {});\n }\n\n const entry = { fn: listener, thisArgs };\n this._listeners = this._listeners.slice();\n this._listeners.push(entry);\n\n const result = toDisposable(() => {\n const idx = this._listeners.indexOf(entry);\n if (idx !== -1) {\n this._listeners = this._listeners.slice();\n this._listeners.splice(idx, 1);\n }\n });\n\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(result);\n } else {\n disposables.add(result);\n }\n }\n\n return result;\n };\n return this._event;\n }\n\n public fire(event: T): void {\n if (this._disposed || !this._listeners.length) {\n return;\n }\n if (this._listeners.length === 1) {\n this._listeners[0].fn.call(this._listeners[0].thisArgs, event);\n return;\n }\n const listeners = this._listeners;\n for (let i = 0, len = listeners.length; i < len; ++i) {\n listeners[i].fn.call(listeners[i].thisArgs, event);\n }\n }\n\n public dispose(): void {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n this._listeners.length = 0;\n }\n}\n\nexport namespace EventUtils {\n export function forward(from: IEvent, to: Emitter): IDisposable {\n return from(e => to.fire(e));\n }\n\n export function map(event: IEvent, map: (i: I) => O): IEvent {\n return (listener: (e: O) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n return event(i => listener.call(thisArgs, map(i)), undefined, disposables);\n };\n }\n\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent;\n export function any(...events: IEvent[]): IEvent {\n return (listener: (e: T) => any, thisArgs?: any, disposables?: IDisposable[] | DisposableStore) => {\n const store = new DisposableStore();\n for (const event of events) {\n store.add(event(e => listener.call(thisArgs, e)));\n }\n if (disposables) {\n if (Array.isArray(disposables)) {\n disposables.push(store);\n } else {\n disposables.add(store);\n }\n }\n return store;\n };\n }\n\n export function runAndSubscribe(event: IEvent, handler: (e: T) => void, initial: T): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void): IDisposable;\n export function runAndSubscribe(event: IEvent, handler: (e: T | undefined) => void, initial?: T): IDisposable {\n handler(initial);\n return event(e => handler(e));\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { toRGBA8888 } from 'sixel/lib/Colors';\nimport { IDisposable } from '@xterm/xterm';\nimport { ICellSize, ImageLayer, ITerminalExt, IImageSpec, IRenderDimensions, IRenderService } from './Types';\nimport { Disposable, MutableDisposable, toDisposable } from 'common/Lifecycle';\n\nconst enum Constants {\n PLACEHOLDER_LENGTH = 4096,\n PLACEHOLDER_HEIGHT = 24\n}\n\n/**\n * ImageRenderer - terminal frontend extension:\n * - provide primitives for canvas, ImageData, Bitmap (static)\n * - add canvas layer to DOM (browser only for now)\n * - draw image tiles onRender\n */\nexport class ImageRenderer extends Disposable implements IDisposable {\n /** @deprecated Kept for backward compat \u2014 points to top layer canvas. */\n public get canvas(): HTMLCanvasElement | undefined { return this._layers.get('top')?.canvas; }\n private _layers = new Map();\n private _placeholder: HTMLCanvasElement | undefined;\n private _placeholderBitmap: ImageBitmap | undefined;\n private _optionsRefresh = this._register(new MutableDisposable());\n private _oldOpen: ((parent: HTMLElement) => void) | undefined;\n private _renderService: IRenderService | undefined;\n private _oldSetRenderer: ((renderer: any) => void) | undefined;\n\n // drawing primitive - canvas\n public static createCanvas(localDocument: Document | undefined, width: number, height: number): HTMLCanvasElement {\n /**\n * NOTE: We normally dont care, from which document the canvas\n * gets created, so we can fall back to global document,\n * if the terminal has no document associated yet.\n * This way early image loads before calling .open keep working\n * (still discouraged though, as the metrics will be screwed up).\n * Only the DOM output canvas should be on the terminal's document,\n * which gets explicitly checked in `insertLayerToDom`.\n */\n const canvas = (localDocument ?? document).createElement('canvas');\n canvas.width = width | 0;\n canvas.height = height | 0;\n return canvas;\n }\n\n // drawing primitive - ImageData with optional buffer\n public static createImageData(ctx: CanvasRenderingContext2D, width: number, height: number, buffer?: ArrayBuffer): ImageData {\n if (typeof ImageData !== 'function') {\n const imgData = ctx.createImageData(width, height);\n if (buffer) {\n imgData.data.set(new Uint8ClampedArray(buffer, 0, width * height * 4));\n }\n return imgData;\n }\n return buffer\n ? new ImageData(new Uint8ClampedArray(buffer, 0, width * height * 4), width, height)\n : new ImageData(width, height);\n }\n\n // drawing primitive - ImageBitmap\n public static createImageBitmap(img: ImageBitmapSource): Promise {\n if (typeof createImageBitmap !== 'function') {\n return Promise.resolve(undefined);\n }\n return createImageBitmap(img);\n }\n\n\n constructor(private _terminal: ITerminalExt) {\n super();\n this._oldOpen = this._terminal._core.open;\n this._terminal._core.open = (parent: HTMLElement): void => {\n this._oldOpen?.call(this._terminal._core, parent);\n this._open();\n };\n if (this._terminal._core.screenElement) {\n this._open();\n }\n // hack to spot fontSize changes\n this._optionsRefresh.value = this._terminal._core.optionsService.onOptionChange(option => {\n if (option === 'fontSize') {\n this.rescaleCanvas();\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n });\n this._register(toDisposable(() => {\n this.removeLayerFromDom();\n this.removeLayerFromDom('bottom');\n if (this._terminal._core && this._oldOpen) {\n this._terminal._core.open = this._oldOpen;\n this._oldOpen = undefined;\n }\n if (this._renderService && this._oldSetRenderer) {\n this._renderService.setRenderer = this._oldSetRenderer;\n this._oldSetRenderer = undefined;\n }\n this._renderService = undefined;\n this._layers.clear();\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }));\n }\n\n /**\n * Enable the placeholder.\n */\n public showPlaceholder(value: boolean): void {\n if (value) {\n if (!this._placeholder && this.cellSize.height !== -1) {\n this._createPlaceHolder(Math.max(this.cellSize.height + 1, Constants.PLACEHOLDER_HEIGHT));\n }\n } else {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n this._placeholder = undefined;\n }\n this._renderService?.refreshRows(0, this._terminal.rows);\n }\n\n /**\n * Dimensions of the terminal.\n * Forwarded from internal render service.\n */\n public get dimensions(): IRenderDimensions | undefined {\n return this._terminal.dimensions;\n }\n\n /**\n * Current cell size (float).\n */\n public get cellSize(): ICellSize {\n return {\n width: this.dimensions?.css.cell.width || -1,\n height: this.dimensions?.css.cell.height || -1\n };\n }\n\n /**\n * Clear a region of the image layer canvas.\n */\n public clearLines(start: number, end: number, layer?: ImageLayer): void {\n const y = start * (this.dimensions?.css.cell.height || 0);\n const w = this.dimensions?.css.canvas.width || 0;\n const h = (end + 1 - start) * (this.dimensions?.css.cell.height || 0);\n if (!layer || layer === 'top') {\n this._layers.get('top')?.clearRect(0, y, w, h);\n }\n if (!layer || layer === 'bottom') {\n this._layers.get('bottom')?.clearRect(0, y, w, h);\n }\n }\n\n /**\n * Clear whole image canvas.\n */\n public clearAll(layer?: ImageLayer): void {\n if (!layer || layer === 'top') {\n const ctx = this._layers.get('top');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n if (!layer || layer === 'bottom') {\n const ctx = this._layers.get('bottom');\n ctx?.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);\n }\n }\n\n /**\n * Draw neighboring tiles on the image layer canvas.\n */\n public draw(imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get(imgSpec.layer);\n if (!ctx) {\n return;\n }\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const { width: sourceWidth, height: sourceHeight } = imgSpec.actualCellSize;\n const cols = Math.ceil(img.width / sourceWidth);\n\n const sx = (tileId % cols) * sourceWidth;\n const sy = Math.floor(tileId / cols) * sourceHeight;\n const dx = col * width;\n const dy = row * height;\n\n // safari bug: never access image source out of bounds\n const finalWidth = count * sourceWidth + sx > img.width ? img.width - sx : count * sourceWidth;\n const finalHeight = sy + sourceHeight > img.height ? img.height - sy : sourceHeight;\n\n // Floor all pixel offsets to get stable tile mapping without any overflows.\n // Note: For not pixel perfect aligned cells like in the DOM renderer\n // this will move a tile slightly to the top/left (subpixel range, thus ignore it).\n // FIX #34: avoid striping on displays with pixelDeviceRatio != 1 by ceiling height and width\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.ceil(finalWidth), Math.ceil(finalHeight),\n Math.floor(dx), Math.floor(dy), Math.ceil(finalWidth * width / sourceWidth), Math.ceil(finalHeight * height / sourceHeight)\n );\n }\n\n /**\n * Extract a single tile from an image.\n */\n public extractTile(imgSpec: IImageSpec, tileId: number): HTMLCanvasElement | undefined {\n const { width, height } = this.cellSize;\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n this._rescaleImage(imgSpec, width, height);\n const img = imgSpec.actual!;\n const { width: sourceWidth, height: sourceHeight } = imgSpec.actualCellSize;\n const cols = Math.ceil(img.width / sourceWidth);\n const sx = (tileId % cols) * sourceWidth;\n const sy = Math.floor(tileId / cols) * sourceHeight;\n const finalWidth = sourceWidth + sx > img.width ? img.width - sx : sourceWidth;\n const finalHeight = sy + sourceHeight > img.height ? img.height - sy : sourceHeight;\n\n const canvas = ImageRenderer.createCanvas(this.document, Math.ceil(finalWidth * width / sourceWidth), Math.ceil(finalHeight * height / sourceHeight));\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(\n img,\n Math.floor(sx), Math.floor(sy), Math.floor(finalWidth), Math.floor(finalHeight),\n 0, 0, canvas.width, canvas.height\n );\n return canvas;\n }\n }\n\n /**\n * Draw a line with placeholder on the image layer canvas.\n */\n public drawPlaceholder(col: number, row: number, count: number = 1): void {\n const ctx = this._layers.get('top');\n if (ctx) {\n const { width, height } = this.cellSize;\n\n // Don't try to draw anything, if we cannot get valid renderer metrics.\n if (width === -1 || height === -1) {\n return;\n }\n\n if (!this._placeholder) {\n this._createPlaceHolder(Math.max(height + 1, Constants.PLACEHOLDER_HEIGHT));\n } else if (height >= this._placeholder!.height) {\n this._createPlaceHolder(height + 1);\n }\n if (!this._placeholder) return;\n ctx.drawImage(\n this._placeholderBitmap ?? this._placeholder!,\n col * width,\n (row * height) % 2 ? 0 : 1, // needs %2 offset correction\n width * count,\n height,\n col * width,\n row * height,\n width * count,\n height\n );\n }\n }\n\n /**\n * Rescale image layer canvas if needed.\n * Checked once from `ImageStorage.render`.\n */\n public rescaleCanvas(): void {\n const w = this.dimensions?.css.canvas.width || 0;\n const h = this.dimensions?.css.canvas.height || 0;\n for (const ctx of this._layers.values()) {\n if (ctx.canvas.width !== w || ctx.canvas.height !== h) {\n ctx.canvas.width = w;\n ctx.canvas.height = h;\n }\n }\n }\n\n /**\n * Rescale image in storage if needed.\n */\n private _rescaleImage(spec: IImageSpec, currentWidth: number, currentHeight: number): void {\n if (currentWidth === spec.actualCellSize.width && currentHeight === spec.actualCellSize.height) {\n return;\n }\n const { width: originalWidth, height: originalHeight } = spec.origCellSize;\n if (currentWidth === originalWidth && currentHeight === originalHeight) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const scaledWidth = Math.ceil(spec.orig!.width * currentWidth / originalWidth);\n const scaledHeight = Math.ceil(spec.orig!.height * currentHeight / originalHeight);\n // Upscale visible tiles directly; a full zoomed copy can dwarf the image budget.\n if (scaledWidth * scaledHeight > spec.orig!.width * spec.orig!.height) {\n spec.actual = spec.orig;\n spec.actualCellSize.width = originalWidth;\n spec.actualCellSize.height = originalHeight;\n return;\n }\n const canvas = ImageRenderer.createCanvas(this.document, scaledWidth, scaledHeight);\n const ctx = canvas.getContext('2d');\n if (ctx) {\n ctx.drawImage(spec.orig!, 0, 0, canvas.width, canvas.height);\n spec.actual = canvas;\n spec.actualCellSize.width = currentWidth;\n spec.actualCellSize.height = currentHeight;\n }\n }\n\n /**\n * Lazy init for the renderer.\n */\n private _open(): void {\n this._renderService = this._terminal._core._renderService;\n this._oldSetRenderer = this._renderService.setRenderer.bind(this._renderService);\n this._renderService.setRenderer = (renderer: any) => {\n for (const key of [...this._layers.keys()]) {\n this.removeLayerFromDom(key);\n }\n this._oldSetRenderer?.call(this._renderService, renderer);\n };\n }\n\n public insertLayerToDom(layer: ImageLayer = 'top'): void {\n // make sure that the terminal is attached to a document and to DOM\n if (!this.document || !this._terminal._core.screenElement) {\n console.warn('image addon: cannot insert output canvas to DOM, missing document or screenElement');\n return;\n }\n if (this._layers.has(layer)) {\n return;\n }\n const canvas = ImageRenderer.createCanvas(\n this.document, this.dimensions?.css.canvas.width || 0,\n this.dimensions?.css.canvas.height || 0\n );\n canvas.classList.add(`xterm-image-layer-${layer}`);\n const screenElement = this._terminal._core.screenElement;\n // Use isolation to create a stacking context without overriding z-index,\n // which would conflict with integrators (e.g. VS Code) that set their\n // own z-index on the screen element.\n screenElement.style.isolation = 'isolate';\n if (layer === 'bottom') {\n // Use z-index:-1 so it paints behind non-positioned text elements.\n // The screen element needs to be a stacking context (via isolation)\n // to contain the negative z-index, otherwise it would go behind the\n // entire terminal.\n canvas.style.zIndex = '-1';\n screenElement.insertBefore(canvas, screenElement.firstChild);\n } else {\n // Explicit z-index ensures the image canvas reliably stacks above\n // the text layer (DOM renderer rows). z-index: 0 is below the\n // selection overlay (z-index: 1).\n canvas.style.zIndex = '0';\n screenElement.appendChild(canvas);\n }\n const ctx = canvas.getContext('2d', { alpha: true });\n if (!ctx) {\n canvas.remove();\n return;\n }\n this._layers.set(layer, ctx);\n this.clearAll(layer);\n }\n\n public removeLayerFromDom(layer: ImageLayer = 'top'): void {\n const ctx = this._layers.get(layer);\n if (ctx) {\n ctx.canvas.remove();\n this._layers.delete(layer);\n }\n }\n\n public hasLayer(layer: ImageLayer): boolean {\n return this._layers.has(layer);\n }\n\n private _createPlaceHolder(height: number = Constants.PLACEHOLDER_HEIGHT): void {\n this._placeholderBitmap?.close();\n this._placeholderBitmap = undefined;\n\n // create blueprint to fill placeholder with\n const bWidth = 32; // must be 2^n\n const blueprint = ImageRenderer.createCanvas(this.document, bWidth, height);\n const ctx = blueprint.getContext('2d', { alpha: false });\n if (!ctx) return;\n const imgData = ImageRenderer.createImageData(ctx, bWidth, height);\n const d32 = new Uint32Array(imgData.data.buffer);\n const black = toRGBA8888(0, 0, 0);\n const white = toRGBA8888(255, 255, 255);\n d32.fill(black);\n for (let y = 0; y < height; ++y) {\n const shift = y % 2;\n const offset = y * bWidth;\n for (let x = 0; x < bWidth; x += 2) {\n d32[offset + x + shift] = white;\n }\n }\n ctx.putImageData(imgData, 0, 0);\n\n // create placeholder line, width aligned to blueprint width\n const width = (screen.width + bWidth - 1) & ~(bWidth - 1) || Constants.PLACEHOLDER_LENGTH;\n this._placeholder = ImageRenderer.createCanvas(this.document, width, height);\n const ctx2 = this._placeholder.getContext('2d', { alpha: false });\n if (!ctx2) {\n this._placeholder = undefined;\n return;\n }\n for (let i = 0; i < width; i += bWidth) {\n ctx2.drawImage(blueprint, i, 0);\n }\n const placeholder = this._placeholder;\n ImageRenderer.createImageBitmap(placeholder).then(bitmap => {\n if (this._placeholder !== placeholder) bitmap?.close();\n else this._placeholderBitmap = bitmap;\n }).catch(() => {});\n }\n\n public get document(): Document | undefined {\n return this._terminal._core._coreBrowserService?.window.document;\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageRenderer } from './ImageRenderer';\nimport {\n ITerminalExt, IExtendedAttrsImage, IImageAddonOptions, IImageSpec,\n IBufferLineExt, BgFlags, Cell, Content, ICellSize, ExtFlags, Attributes,\n UnderlineStyle, IAddImageOpts\n} from './Types';\n\n\n// fallback default cell size\nexport const CELL_SIZE_DEFAULT: ICellSize = {\n width: 7,\n height: 14\n};\n\n/**\n * Extend extended attribute to also hold image tile information.\n *\n * Object definition is copied from base repo to fully mimick its behavior.\n * Image data is added as additional public properties `imageId` and `tileId`.\n */\nclass ExtendedAttrsImage implements IExtendedAttrsImage {\n private _ext: number = 0;\n public get ext(): number {\n if (this._urlId) {\n return (\n (this._ext & ~ExtFlags.UNDERLINE_STYLE) |\n (this.underlineStyle << 26)\n );\n }\n return this._ext;\n }\n public set ext(value: number) { this._ext = value; }\n\n public get underlineStyle(): UnderlineStyle {\n // Always return the URL style if it has one\n if (this._urlId) {\n return UnderlineStyle.DASHED;\n }\n return (this._ext & ExtFlags.UNDERLINE_STYLE) >> 26;\n }\n public set underlineStyle(value: UnderlineStyle) {\n this._ext &= ~ExtFlags.UNDERLINE_STYLE;\n this._ext |= (value << 26) & ExtFlags.UNDERLINE_STYLE;\n }\n\n public get underlineColor(): number {\n return this._ext & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n public set underlineColor(value: number) {\n this._ext &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n this._ext |= value & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n\n public get underlineVariantOffset(): number {\n const val = (this._ext & ExtFlags.VARIANT_OFFSET) >> 29;\n if (val < 0) {\n return val ^ 0xFFFFFFF8;\n }\n return val;\n }\n public set underlineVariantOffset(value: number) {\n this._ext &= ~ExtFlags.VARIANT_OFFSET;\n this._ext |= (value << 29) & ExtFlags.VARIANT_OFFSET;\n }\n\n private _urlId: number = 0;\n public get urlId(): number {\n return this._urlId;\n }\n public set urlId(value: number) {\n this._urlId = value;\n }\n\n constructor(\n ext: number = 0,\n urlId: number = 0,\n public imageId = -1,\n public tileId = -1\n ) {\n this._ext = ext;\n this._urlId = urlId;\n }\n\n public clone(): IExtendedAttrsImage {\n /**\n * Technically we dont need a clone variant of ExtendedAttrsImage,\n * as we never clone a cell holding image data.\n * Note: Clone is only meant to be used by the InputHandler for\n * sticky attributes, which is never the case for image data.\n * We still provide a proper clone method to reflect the full ext attr\n * state in case there are future use cases for clone.\n */\n return new ExtendedAttrsImage(this._ext, this._urlId, this.imageId, this.tileId);\n }\n\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0 && this.imageId === -1;\n }\n}\nconst EMPTY_ATTRS = new ExtendedAttrsImage();\n\n\n/**\n * ImageStorage - extension of CoreTerminal:\n * - hold image data\n * - write/read image data to/from buffer\n *\n * TODO: image composition for overwrites\n */\nexport class ImageStorage implements IDisposable {\n // storage\n private _images: Map = new Map();\n // last used id\n private _lastId = 0;\n // last evicted id\n private _lowestId = 0;\n // whether a full clear happened before\n private _fullyCleared = false;\n // whether render should do a full clear\n private _needsFullClear = false;\n // hard limit of stored pixels (fallback limit of 10 MB)\n private _pixelLimit: number = 2500000;\n\n private _viewportMetrics: { cols: number, rows: number };\n public onImageAdded: (() => void) | undefined;\n public onImageDeleted: ((storageId: number) => void) | undefined;\n\n constructor(\n private _terminal: ITerminalExt,\n private _renderer: ImageRenderer,\n private _opts: IImageAddonOptions\n ) {\n try {\n this.setLimit(this._opts.storageLimit);\n } catch (e: unknown) {\n if (e instanceof Error) {\n console.error(e.message);\n }\n console.warn(`storageLimit is set to ${this.getLimit()} MB`);\n }\n this._viewportMetrics = {\n cols: this._terminal.cols,\n rows: this._terminal.rows\n };\n }\n\n public dispose(): void {\n this.reset();\n }\n\n public reset(): void {\n for (const spec of this._images.values()) {\n spec.marker?.dispose();\n }\n // NOTE: marker.dispose above already calls ImageBitmap.close\n // therefore we can just wipe the map here\n this._images.clear();\n this._renderer.clearAll();\n }\n\n public getLimit(): number {\n return this._pixelLimit * 4 / 1000000;\n }\n\n public setLimit(value: number): void {\n if (value < 0.5 || value > 1000) {\n throw RangeError('invalid storageLimit, should be at least 0.5 MB and not exceed 1G');\n }\n this._pixelLimit = (value / 4 * 1000000) >>> 0;\n this._evictOldest(0);\n }\n\n public getUsage(): number {\n return this._getStoredPixels() * 4 / 1000000;\n }\n\n private _getStoredPixels(): number {\n let storedPixels = 0;\n for (const spec of this._images.values()) {\n if (spec.orig) {\n storedPixels += spec.orig.width * spec.orig.height;\n if (spec.actual && spec.actual !== spec.orig) {\n storedPixels += spec.actual.width * spec.actual.height;\n }\n }\n }\n return storedPixels;\n }\n\n private _delImg(id: number): void {\n const spec = this._images.get(id);\n if (!spec) return;\n this._images.delete(id);\n // FIXME: really ugly workaround to get bitmaps deallocated :(\n if (window.ImageBitmap && spec.orig instanceof ImageBitmap) {\n spec.orig.close();\n }\n this.onImageDeleted?.(id);\n }\n\n /**\n * Wipe canvas and images on alternate buffer.\n */\n public wipeAlternate(): void {\n // remove all alternate tagged images\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate') {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n // mark canvas to be wiped on next render\n this._needsFullClear = true;\n this._fullyCleared = false;\n }\n\n /**\n * Delete an image by its internal storage ID.\n * Used by protocols that support explicit deletion (e.g. Kitty a=d).\n */\n public deleteImage(id: number): void {\n const spec = this._images.get(id);\n if (spec) {\n spec.marker?.dispose();\n this._delImg(id);\n }\n }\n\n /**\n * Method to add an image to the storage.\n * @param img - The image to add (canvas or bitmap).\n * @param opts - Options for addImage:\n * - scrolling: When true, cursor advances with the image.\n * When false, image is placed at ORIGIN and cursor does not move.\n * - layer: Which canvas layer to render on ('top' or 'bottom').\n * - zIndex: Z-index for image layering within the same layer.\n * - cursorPos: 'vt340' for bottom-left, 'iip' for bottom.right.\n * @returns The internal image ID assigned to the stored image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap, opts: IAddImageOpts): number {\n // never allow storage to exceed memory limit\n this._evictOldest(img.width * img.height);\n\n // calc rows x cols needed to display the image\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const cols = Math.ceil(img.width / cellSize.width);\n const rows = Math.ceil(img.height / cellSize.height);\n\n const imageId = ++this._lastId;\n\n const buffer = this._terminal._core.buffer;\n const termCols = this._terminal.cols;\n const termRows = this._terminal.rows;\n const originX = buffer.x;\n const originY = buffer.y;\n let offset = originX;\n let tileCount = 0;\n\n if (!opts.scrolling) {\n buffer.x = 0;\n buffer.y = 0;\n offset = 0;\n }\n\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(buffer.y + buffer.ybase);\n for (let col = 0; col < cols; ++col) {\n if (offset + col >= termCols) break;\n this._writeToCell(line as IBufferLineExt, offset + col, imageId, row * cols + col);\n tileCount++;\n }\n if (opts.scrolling) {\n if (row < rows - 1) this._terminal._core._inputHandler.lineFeed();\n } else {\n if (++buffer.y >= termRows) break;\n }\n buffer.x = offset;\n }\n this._terminal._core._inputHandler._dirtyRowTracker.markDirty(buffer.y);\n\n // cursor positioning modes\n if (opts.scrolling) {\n if (opts.cursorPos === 'iip') {\n buffer.x = Math.min(offset + cols, termCols);\n } else {\n buffer.x = offset;\n }\n } else {\n buffer.x = originX;\n buffer.y = originY;\n }\n\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.tileCount < 1) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n\n // eviction marker:\n // delete the image when the marker gets disposed\n const endMarker = this._terminal.registerMarker(0);\n endMarker?.onDispose(() => {\n const spec = this._images.get(imageId);\n if (spec) {\n this._delImg(imageId);\n }\n });\n\n // since markers do not work on alternate for some reason,\n // we evict images here manually\n if (this._terminal.buffer.active.type === 'alternate') {\n this._evictOnAlternate();\n }\n\n // create storage entry\n const imgSpec: IImageSpec = {\n orig: img,\n origCellSize: cellSize,\n actual: img,\n actualCellSize: { ...cellSize }, // clone needed, since later modified\n marker: endMarker || undefined,\n tileCount,\n bufferType: this._terminal.buffer.active.type,\n layer: opts.layer,\n zIndex: opts.zIndex\n };\n\n // finally add the image\n this._images.set(imageId, imgSpec);\n this.onImageAdded?.();\n return imageId;\n }\n\n\n /**\n * Render method. Collects buffer information and triggers\n * canvas updates.\n */\n // TODO: Should we move this to the ImageRenderer?\n public render(range: { start: number, end: number }): void {\n // Determine which layers have images\n let hasTopImages = false;\n let hasBottomImages = false;\n for (const spec of this._images.values()) {\n if (spec.layer === 'bottom') {\n hasBottomImages = true;\n } else {\n hasTopImages = true;\n }\n if (hasTopImages && hasBottomImages) break;\n }\n\n // Lazily insert layers that are needed\n if (hasTopImages && !this._renderer.hasLayer('top')) {\n this._renderer.insertLayerToDom('top');\n if (!this._renderer.hasLayer('top')) return;\n }\n if (hasBottomImages && !this._renderer.hasLayer('bottom')) {\n this._renderer.insertLayerToDom('bottom');\n }\n\n // rescale if needed\n this._renderer.rescaleCanvas();\n\n // exit early if we dont have any images to test for\n if (!this._images.size) {\n if (!this._fullyCleared) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n if (this._renderer.hasLayer('top')) {\n this._renderer.removeLayerFromDom('top');\n }\n if (this._renderer.hasLayer('bottom')) {\n this._renderer.removeLayerFromDom('bottom');\n }\n return;\n }\n\n // Remove layers no longer needed\n if (!hasTopImages && this._renderer.hasLayer('top')) {\n this._renderer.clearAll('top');\n this._renderer.removeLayerFromDom('top');\n }\n if (!hasBottomImages && this._renderer.hasLayer('bottom')) {\n this._renderer.clearAll('bottom');\n this._renderer.removeLayerFromDom('bottom');\n }\n\n // buffer switches force a full clear\n if (this._needsFullClear) {\n this._renderer.clearAll();\n this._fullyCleared = true;\n this._needsFullClear = false;\n }\n\n const { start, end } = range;\n const buffer = this._terminal._core.buffer;\n const cols = this._terminal._core.cols;\n\n // clear drawing area\n this._renderer.clearLines(start, end);\n\n // Collect draw calls so we can sort by z-index (lower z drawn first).\n const drawCalls: { imgSpec: IImageSpec, tileId: number, col: number, row: number, count: number }[] = [];\n const placeholderCalls: { col: number, row: number, count: number }[] = [];\n\n // walk all cells in viewport and collect tiles found\n for (let row = start; row <= end; ++row) {\n const line = buffer.lines.get(row + buffer.ydisp) as IBufferLineExt;\n if (!line) return;\n for (let col = 0; col < cols; ++col) {\n if (line.getBg(col) & BgFlags.HAS_EXTENDED) {\n let e: IExtendedAttrsImage = line._extendedAttrs[col] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (e.tileId !== -1) {\n const startTile = e.tileId;\n const startCol = col;\n let count = 1;\n /**\n * merge tiles to the right into a single draw call, if:\n * - not at end of line\n * - cell has same image id\n * - cell has consecutive tile id\n */\n while (\n ++col < cols\n && (line.getBg(col) & BgFlags.HAS_EXTENDED)\n && (e = line._extendedAttrs[col] ?? EMPTY_ATTRS)\n && (e.imageId === imageId)\n && (e.tileId === startTile + count)\n ) {\n count++;\n }\n col--;\n if (imgSpec) {\n if (imgSpec.actual) {\n drawCalls.push({ imgSpec, tileId: startTile, col: startCol, row, count });\n }\n } else if (this._opts.showPlaceholder) {\n placeholderCalls.push({ col: startCol, row, count });\n }\n this._fullyCleared = false;\n }\n }\n }\n }\n\n // Sort by z-index so lower z draws first (higher z renders on top)\n drawCalls.sort((a, b) => a.imgSpec.zIndex - b.imgSpec.zIndex);\n\n // Draw placeholders first (lowest priority)\n for (const call of placeholderCalls) {\n this._renderer.drawPlaceholder(call.col, call.row, call.count);\n }\n\n // Draw images in z-index order\n for (const call of drawCalls) {\n this._renderer.draw(call.imgSpec, call.tileId, call.col, call.row, call.count);\n }\n }\n\n public viewportResize(metrics: { cols: number, rows: number }): void {\n // exit early if we have nothing in storage\n if (!this._images.size) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // handle only viewport width enlargements, exit all other cases\n // TODO: needs patch for tile counter\n if (this._viewportMetrics.cols >= metrics.cols) {\n this._viewportMetrics = metrics;\n return;\n }\n\n // walk scrollbuffer at old col width to find all possible expansion matches\n const buffer = this._terminal._core.buffer;\n const rows = buffer.lines.length;\n const oldCol = this._viewportMetrics.cols - 1;\n for (let row = 0; row < rows; ++row) {\n const line = buffer.lines.get(row) as IBufferLineExt;\n if (line.getBg(oldCol) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[oldCol] ?? EMPTY_ATTRS;\n const imageId = e.imageId;\n if (imageId === undefined || imageId === -1) {\n continue;\n }\n const imgSpec = this._images.get(imageId);\n if (!imgSpec) {\n continue;\n }\n // found an image tile at oldCol, check if it qualifies for right exapansion\n const tilesPerRow = Math.ceil((imgSpec.actual?.width || 0) / imgSpec.actualCellSize.width);\n if ((e.tileId % tilesPerRow) + 1 >= tilesPerRow) {\n continue;\n }\n // expand only if right side is empty (nothing got wrapped from below)\n let hasData = false;\n for (let rightCol = oldCol + 1; rightCol > metrics.cols; ++rightCol) {\n if (line._data[rightCol * Cell.SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK) {\n hasData = true;\n break;\n }\n }\n if (hasData) {\n continue;\n }\n // do right expansion on terminal buffer\n const end = Math.min(metrics.cols, tilesPerRow - (e.tileId % tilesPerRow) + oldCol);\n let lastTile = e.tileId;\n for (let expandCol = oldCol + 1; expandCol < end; ++expandCol) {\n this._writeToCell(line as IBufferLineExt, expandCol, imageId, ++lastTile);\n imgSpec.tileCount++;\n }\n }\n }\n // store new viewport metrics\n this._viewportMetrics = metrics;\n }\n\n /**\n * Retrieve original canvas at buffer position.\n */\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1) {\n const orig = this._images.get(e.imageId)?.orig;\n if (window.ImageBitmap && orig instanceof ImageBitmap) {\n const canvas = ImageRenderer.createCanvas(window.document, orig.width, orig.height);\n canvas.getContext('2d')?.drawImage(orig, 0, 0, orig.width, orig.height);\n return canvas;\n }\n return orig as HTMLCanvasElement;\n }\n }\n }\n\n /**\n * Extract active single tile at buffer position.\n */\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n const buffer = this._terminal._core.buffer;\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (line && line.getBg(x) & BgFlags.HAS_EXTENDED) {\n const e: IExtendedAttrsImage = line._extendedAttrs[x] ?? EMPTY_ATTRS;\n if (e.imageId && e.imageId !== -1 && e.tileId !== -1) {\n const spec = this._images.get(e.imageId);\n if (spec) {\n return this._renderer.extractTile(spec, e.tileId);\n }\n }\n }\n }\n\n // TODO: Do we need some blob offloading tricks here to avoid early eviction?\n // also see https://stackoverflow.com/questions/28307789/is-there-any-limitation-on-javascript-max-blob-size\n private _evictOldest(room: number): number {\n const used = this._getStoredPixels();\n let current = used;\n while (this._pixelLimit < current + room && this._images.size) {\n const spec = this._images.get(++this._lowestId);\n if (spec && spec.orig) {\n current -= spec.orig.width * spec.orig.height;\n if (spec.actual && spec.orig !== spec.actual) {\n current -= spec.actual.width * spec.actual.height;\n }\n spec.marker?.dispose();\n this._delImg(this._lowestId);\n }\n }\n return used - current;\n }\n\n private _writeToCell(line: IBufferLineExt, x: number, imageId: number, tileId: number): void {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const old = line._extendedAttrs[x];\n if (old) {\n if (old.imageId !== undefined) {\n // found an old ExtendedAttrsImage, since we know that\n // they are always isolated instances (single cell usage),\n // we can re-use it and just update their id entries\n const oldSpec = this._images.get(old.imageId);\n if (oldSpec) {\n // early eviction for in-viewport overwrites\n oldSpec.tileCount--;\n }\n old.imageId = imageId;\n old.tileId = tileId;\n return;\n }\n // found a plain ExtendedAttrs instance, clone it to new entry\n line._extendedAttrs[x] = new ExtendedAttrsImage(old.ext, old.urlId, imageId, tileId);\n return;\n }\n }\n // fall-through: always create new ExtendedAttrsImage entry\n line._data[x * Cell.SIZE + Cell.BG] |= BgFlags.HAS_EXTENDED;\n line._extendedAttrs[x] = new ExtendedAttrsImage(0, 0, imageId, tileId);\n }\n\n private _evictOnAlternate(): void {\n // nullify tile count of all images on alternate buffer\n for (const spec of this._images.values()) {\n if (spec.bufferType === 'alternate') {\n spec.tileCount = 0;\n }\n }\n // re-count tiles on whole buffer\n const buffer = this._terminal._core.buffer;\n for (let y = 0; y < this._terminal.rows; ++y) {\n const line = buffer.lines.get(y) as IBufferLineExt;\n if (!line) {\n continue;\n }\n for (let x = 0; x < this._terminal.cols; ++x) {\n if (line._data[x * Cell.SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n const imgId = line._extendedAttrs[x]?.imageId;\n if (imgId) {\n const spec = this._images.get(imgId);\n if (spec) {\n spec.tileCount++;\n }\n }\n }\n }\n }\n // deleted images with zero tile count\n const zero = [];\n for (const [id, spec] of this._images.entries()) {\n if (spec.bufferType === 'alternate' && !spec.tileCount) {\n spec.marker?.dispose();\n zero.push(id);\n }\n }\n for (const id of zero) {\n this._delImg(id);\n }\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IImageAddonOptions, IOscHandler, IResetHandler, ITerminalExt } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { CELL_SIZE_DEFAULT } from './ImageStorage';\nimport Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport QoiDecoder from 'xterm-wasm-parts/lib/qoi/QoiDecoder.wasm';\nimport { HeaderParser, IHeaderFields, HeaderState, SequenceType } from './IIPHeaderParser';\nimport { imageType, UNSUPPORTED_TYPE } from './IIPMetrics';\n\n// Local const enum mirror - esbuild can't inline const enums from external packages\nconst enum DecoderConst {\n // Held memory in base64/QOI decoders between images. Zero because each kept\n // decoder pins a wasm memory, and V8 caps those per process (~124 in a\n // sandboxed renderer), so idle terminals must not hold one.\n KEEP_DATA = 0,\n // Initial buffer allocation for the decoder.\n INITIAL_DATA = 1048576,\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n OK = 0\n}\n\n// default IIP header values\nconst DEFAULT_HEADER: IHeaderFields = {\n type: SequenceType.INVALID,\n name: 'Unnamed file',\n size: 0,\n width: 'auto',\n height: 'auto',\n preserveAspectRatio: 1,\n inline: 0\n};\n\n\nexport class IIPHandler implements IOscHandler, IResetHandler {\n private _generation = 0;\n private _aborted = false;\n private _hp = new HeaderParser();\n private _header: IHeaderFields = DEFAULT_HEADER;\n private _dec: Base64Decoder;\n private _qoiDec: QoiDecoder;\n private _isMultipart = false;\n private _abortMulti = false;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _storage: IIPImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n const maxEncodedBytes = Math.ceil(this._opts.iipSizeLimit * 4 / 3);\n const initialBytes = Math.min(DecoderConst.INITIAL_DATA, maxEncodedBytes);\n this._dec = new Base64Decoder(DecoderConst.KEEP_DATA, maxEncodedBytes, initialBytes);\n this._qoiDec = new QoiDecoder(DecoderConst.KEEP_DATA);\n }\n\n public reset(): void {\n this._generation++;\n this._hp.reset();\n this._dec.release();\n this._qoiDec.release();\n }\n\n public start(): void {\n this._aborted = false;\n this._hp.reset();\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (this._hp.state === HeaderState.END) {\n if ((this._dec.put(data.subarray(start, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n }\n } else {\n const dataPos = this._hp.parse(data, start, end);\n if (dataPos === -1) {\n this._aborted = true;\n return;\n }\n if (dataPos > 0) {\n const seqType = this._hp.fields.type;\n if (seqType === SequenceType.FILE) {\n if (this._isMultipart) {\n this._isMultipart = false;\n this._abortMulti = false;\n this._dec.release();\n }\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n if (!this._header.inline) {\n this._aborted = true;\n return;\n }\n if (!this._initDecoder()) {\n this._aborted = true;\n return;\n }\n } else if (this._abortMulti) {\n this._aborted = true;\n return;\n }\n if ((this._dec.put(data.subarray(dataPos, end)) as number) !== DecoderConst.OK) {\n this._dec.release();\n this._aborted = true;\n if (this._isMultipart) this._abortMulti = true;\n }\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted) return true;\n\n if (this._hp.state !== HeaderState.END) {\n if (this._hp.end()) return true;\n }\n const seqType = this._hp.fields.type;\n\n if (seqType === SequenceType.FILEPART) return true;\n\n if (seqType === SequenceType.REPORTCELLSIZE) {\n // OSC 1337 ; ReportCellSize=[height];[width];[scale] ST\n let w = CELL_SIZE_DEFAULT.width;\n let h = CELL_SIZE_DEFAULT.height;\n if (this._renderer.dimensions) {\n w = this._renderer.dimensions.css.canvas.width / this._coreTerminal.cols;\n h = this._renderer.dimensions.css.canvas.height / this._coreTerminal.rows;\n }\n const scale = this._coreTerminal._core._coreBrowserService?.dpr ?? 1;\n const report = `\\x1b]1337;ReportCellSize=${h.toFixed(3)};${w.toFixed(3)};${scale.toFixed(3)}\\x1b\\\\`;\n this._coreTerminal.input(report, false);\n return true;\n }\n\n if (seqType === SequenceType.MULTIPARTFILE) {\n this._header = Object.assign({}, DEFAULT_HEADER, this._hp.fields);\n this._isMultipart = true;\n this._abortMulti = false;\n this._dec.release();\n if (!this._initDecoder()) {\n this._abortMulti = true;\n }\n return true;\n }\n\n if (seqType === SequenceType.FILEEND) {\n if (!this._isMultipart) return true;\n this._isMultipart = false;\n if (this._abortMulti || this._header.type !== SequenceType.MULTIPARTFILE) return true;\n }\n\n // fallthrough for SequenceType.FILE & SequenceType.FILEEND\n\n let w = 0;\n let h = 0;\n\n // early exit condition chain\n let cond: number | boolean;\n let metrics = UNSUPPORTED_TYPE;\n if (cond = success) {\n if (cond = !this._dec.end()) {\n metrics = imageType(this._dec.data8);\n if (cond = metrics.mime !== 'unsupported') {\n w = metrics.width;\n h = metrics.height;\n if (cond = w && h && w * h < this._opts.pixelLimit) {\n [w, h] = this._resize(w, h).map(Math.floor);\n cond = w && h && w * h < this._opts.pixelLimit;\n } else {\n console.warn(`IIP: image dimension issue ${metrics.width}x${metrics.height}`);\n }\n } else {\n console.warn('IIP: unsupported image type');\n }\n } else {\n console.warn('IIP: error during BASE64 decoding');\n }\n }\n if (!cond) {\n this._dec.release();\n return true;\n }\n\n let blob: Blob | ImageData;\n if (metrics.mime === 'image/qoi') {\n let data: Uint8Array;\n try {\n data = this._qoiDec.decode(this._dec.data8);\n } catch (e) {\n console.warn('IIP: could not decode QOI image', e);\n this._dec.release();\n this._qoiDec.release();\n return true;\n }\n blob = new ImageData(\n new Uint8ClampedArray(data.buffer, data.byteOffset, data.byteLength),\n this._qoiDec.width,\n this._qoiDec.height\n );\n this._qoiDec.release();\n if (w === this._qoiDec.width && h === this._qoiDec.height) {\n // use fast-path if we don't need to rescale\n this._dec.release();\n const canvas = ImageRenderer.createCanvas(undefined, this._qoiDec.width, this._qoiDec.height);\n canvas.getContext('2d')?.putImageData(blob, 0, 0);\n this._storage.addImage(canvas);\n return true;\n }\n } else {\n blob = new Blob([this._dec.data8], { type: metrics.mime });\n }\n this._dec.release();\n const generation = this._generation;\n return createImageBitmap(blob, { resizeWidth: w, resizeHeight: h })\n .then(bm => {\n if (generation !== this._generation) {\n bm.close();\n return true;\n }\n this._storage.addImage(bm);\n return true;\n })\n .catch(e => {\n console.warn(`IIP: decoding error ${metrics.mime} ${metrics.width}x${metrics.height}`, e);\n return true;\n });\n }\n\n // Why: wasm memory exhaustion must drop this image, not throw out of the parser and wedge the write queue.\n private _initDecoder(): boolean {\n try {\n this._dec.init();\n return true;\n } catch (e) {\n console.warn('IIP: could not allocate decoder', e);\n this._dec.release();\n return false;\n }\n }\n\n private _resize(w: number, h: number): [number, number] {\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n const width = this._renderer.dimensions?.css.canvas.width || cw * this._coreTerminal.cols;\n const height = this._renderer.dimensions?.css.canvas.height || ch * this._coreTerminal.rows;\n\n const rw = this._dim(this._header.width!, width, cw);\n const rh = this._dim(this._header.height!, height, ch);\n if (!rw && !rh) {\n const wf = width / w; // TODO: should this respect initial cursor offset?\n const hf = (height - ch) / h; // TODO: fix offset issues from float cell height\n const f = Math.min(wf, hf);\n return f < 1 ? [w * f, h * f] : [w, h];\n }\n return !rw\n ? [w * rh / h, rh]\n : this._header.preserveAspectRatio || !rw || !rh\n ? [rw, h * rw / w] : [rw, rh];\n }\n\n private _dim(s: string, total: number, cdim: number): number {\n if (s === 'auto') return 0;\n if (s.endsWith('%')) return parseInt(s.slice(0, -1), 10) * total / 100;\n if (s.endsWith('px')) return parseInt(s.slice(0, -2), 10);\n return parseInt(s, 10) * cdim;\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// eslint-disable-next-line\ndeclare const Buffer: any;\n\nexport const enum HeaderState {\n START = 0,\n ABORT = 1,\n KEY = 2,\n VALUE = 3,\n END = 4\n}\n\nexport const enum SequenceType {\n INVALID = 0,\n FILE = 1,\n MULTIPARTFILE = 2,\n FILEPART = 3,\n FILEEND = 4,\n REPORTCELLSIZE = 5\n}\n\nexport interface IHeaderFields {\n [key: string]: number | string | Uint32Array | null | undefined;\n // sequence type\n type: SequenceType;\n // base-64 encoded filename. Defaults to \"Unnamed file\".\n name: string;\n // File size in bytes. The file transfer will be canceled if this size is exceeded.\n size: number;\n /**\n * Optional width and height to render:\n * - N: N character cells.\n * - Npx: N pixels.\n * - N%: N percent of the session's width or height.\n * - auto: The image's inherent size will be used to determine an appropriate dimension.\n */\n width?: string;\n height?: string;\n // Optional, defaults to 1 respecting aspect ratio (width takes precedence).\n preserveAspectRatio?: number;\n // Optional, defaults to 0. If set to 1, the file will be displayed inline, else downloaded\n // (download not supported).\n inline?: number;\n}\n\n// field value decoders\n\n// ASCII bytes to string\nfunction toStr(data: Uint32Array): string {\n let s = '';\n for (let i = 0; i < data.length; ++i) {\n s += String.fromCharCode(data[i]);\n }\n return s;\n}\n\n// digits to integer\nfunction toInt(data: Uint32Array): number {\n let v = 0;\n for (let i = 0; i < data.length; ++i) {\n if (data[i] < 48 || data[i] > 57) {\n throw new Error('illegal char');\n }\n v = v * 10 + data[i] - 48;\n }\n return v;\n}\n\n// check for correct size entry\nfunction toSize(data: Uint32Array): string {\n const v = toStr(data);\n if (!v.match(/^((auto)|(\\d+?((px)|(%)){0,1}))$/)) {\n throw new Error('illegal size');\n }\n return v;\n}\n\n// name is base64 encoded utf-8\nfunction toName(data: Uint32Array): string {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(toStr(data), 'base64').toString();\n }\n const bs = atob(toStr(data));\n const b = new Uint8Array(bs.length);\n for (let i = 0; i < b.length; ++i) {\n b[i] = bs.charCodeAt(i);\n }\n return new TextDecoder().decode(b);\n}\n\nconst DECODERS: {[key: string]: (v: Uint32Array) => number | string} = {\n inline: toInt,\n size: toInt,\n name: toName,\n width: toSize,\n height: toSize,\n preserveAspectRatio: toInt\n};\n\n\n// sequence type markers\n// File\nconst FILE_MARKER = [70, 105, 108, 101];\n// MultipartFile\nconst MULTIPARTFILE_MARKER = [77, 117, 108, 116, 105, 112, 97, 114, 116, 70, 105, 108, 101];\n// FilePart\nconst FILEPART_MARKER = [70, 105, 108, 101, 80, 97, 114, 116];\n// FileEnd\nconst FILEEND_MARKER = [70, 105, 108, 101, 69, 110, 100];\n// ReportCellSize\nconst REPORTCELLSIZE_MARKER = [82, 101, 112, 111, 114, 116, 67, 101, 108, 108, 83, 105, 122, 101];\n\n// max allowed chars for sequence header\nconst MAX_FIELDCHARS = 1024;\n\n\nexport class HeaderParser {\n public state: HeaderState = HeaderState.START;\n private _buffer = new Uint32Array(MAX_FIELDCHARS);\n private _position = 0;\n private _key = '';\n public fields: {[key: string]: number | string | Uint32Array | null | undefined} = {};\n\n public reset(): void {\n this._buffer.fill(0);\n this.state = HeaderState.START;\n this._position = 0;\n this.fields = {};\n this._key = '';\n }\n\n public end(): number {\n if (this.state === HeaderState.START) {\n if (this._position === FILEEND_MARKER.length) {\n for (let k = 0; k < FILEEND_MARKER.length; ++k) {\n if (this._buffer[k] !== FILEEND_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEEND;\n this.state = HeaderState.END;\n return 0;\n }\n if (this._position === REPORTCELLSIZE_MARKER.length) {\n for (let k = 0; k < REPORTCELLSIZE_MARKER.length; ++k) {\n if (this._buffer[k] !== REPORTCELLSIZE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.REPORTCELLSIZE;\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n if (this.state === HeaderState.END) return 0;\n if (this.state === HeaderState.VALUE\n && this.fields.type === SequenceType.MULTIPARTFILE\n ) {\n if (!this._storeValue(this._position)) return this._a();\n this.state = HeaderState.END;\n return 0;\n }\n return this._a();\n }\n\n public parse(data: Uint32Array, start: number, end: number): number {\n let state = this.state;\n let pos = this._position;\n const buffer = this._buffer;\n if (state === HeaderState.ABORT || state === HeaderState.END) return -1;\n if (state === HeaderState.START && pos > 14) return -1;\n for (let i = start; i < end; ++i) {\n const c = data[i];\n switch (c) {\n case 59: // ;\n if (!this._storeValue(pos)) return this._a();\n state = HeaderState.KEY;\n pos = 0;\n break;\n case 61: // =\n if (state === HeaderState.START) {\n if (buffer[0] === 70) {\n // 'File' or 'FilePart'\n let k = 0;\n for (; k < FILE_MARKER.length; ++k) {\n if (buffer[k] !== FILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILE;\n if (pos === FILEPART_MARKER.length) {\n for (; k < FILEPART_MARKER.length; ++k) {\n if (buffer[k] !== FILEPART_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.FILEPART;\n this.state = HeaderState.END;\n return i + 1;\n }\n } else if (buffer[0] === 77) {\n // 'MultipartFile'\n for (let k = 0; k < MULTIPARTFILE_MARKER.length; ++k) {\n if (buffer[k] !== MULTIPARTFILE_MARKER[k]) return this._a();\n }\n this.fields['type'] = SequenceType.MULTIPARTFILE;\n } else {\n return this._a();\n }\n state = HeaderState.KEY;\n pos = 0;\n } else if (state === HeaderState.KEY) {\n if (!this._storeKey(pos)) return this._a();\n state = HeaderState.VALUE;\n pos = 0;\n } else if (state === HeaderState.VALUE) {\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n break;\n case 58: // :\n if (state === HeaderState.VALUE) {\n if (!this._storeValue(pos)) return this._a();\n }\n this.state = HeaderState.END;\n return i + 1;\n default:\n if (pos >= MAX_FIELDCHARS) return this._a();\n buffer[pos++] = c;\n }\n }\n this.state = state;\n this._position = pos;\n return -2;\n }\n\n private _a(): number {\n this.fields.type = SequenceType.INVALID;\n this.state = HeaderState.ABORT;\n return -1;\n }\n\n private _storeKey(pos: number): boolean {\n const k = toStr(this._buffer.subarray(0, pos));\n if (k) {\n this._key = k;\n this.fields[k] = null;\n return true;\n }\n return false;\n }\n\n private _storeValue(pos: number): boolean {\n if (this._key) {\n try {\n const v = this._buffer.slice(0, pos);\n this.fields[this._key] = DECODERS[this._key] ? DECODERS[this._key](v) : v;\n } catch {\n return false;\n }\n return true;\n }\n return false;\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n\nexport type ImageType = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/qoi' | 'image/webp' | 'image/avif' | 'unsupported' | '';\n\nexport interface IMetrics {\n mime: ImageType;\n width: number;\n height: number;\n}\n\nexport const UNSUPPORTED_TYPE: IMetrics = {\n mime: 'unsupported',\n width: 0,\n height: 0\n};\n\nexport function imageType(d: Uint8Array): IMetrics {\n if (d.length < 32) {\n return UNSUPPORTED_TYPE;\n }\n const d32 = new Uint32Array(d.buffer, d.byteOffset, 8);\n // PNG: 89 50 4E 47 0D 0A 1A 0A (8 first bytes == magic number for PNG)\n // + first chunk must be IHDR\n if (d32[0] === 0x474E5089 && d32[1] === 0x0A1A0A0D && d32[3] === 0x52444849) {\n return {\n mime: 'image/png',\n width: d[16] << 24 | d[17] << 16 | d[18] << 8 | d[19],\n height: d[20] << 24 | d[21] << 16 | d[22] << 8 | d[23]\n };\n }\n // JPEG: FF D8 FF\n if (d[0] === 0xFF && d[1] === 0xD8 && d[2] === 0xFF) {\n const [width, height] = jpgSize(d);\n return { mime: 'image/jpeg', width, height };\n }\n // GIF: GIF87a or GIF89a\n if (d32[0] === 0x38464947 && (d[4] === 0x37 || d[4] === 0x39) && d[5] === 0x61) {\n return {\n mime: 'image/gif',\n width: d[7] << 8 | d[6],\n height: d[9] << 8 | d[8]\n };\n }\n // QOI: qoif\n if (d32[0] === 0x66696F71) {\n return {\n mime: 'image/qoi',\n width: d[4] << 24 | d[5] << 16 | d[6] << 8 | d[7],\n height: d[8] << 24 | d[9] << 16 | d[10] << 8 | d[11]\n };\n }\n // WEBP: RIFF | xxxx | WEBP | VP8x\n if (d32[0] === 0x46464952 && d32[2] === 0x50424557 && (d32[3] & 0xFFFFFF) === 0x385056) {\n switch (d[15]) {\n case 0x58: // Extended WebP VP8X --> \"X\"\n return {\n mime: 'image/webp',\n width: (d[24] | d[25] << 8 | d[26] << 16) + 1,\n height: (d[27] | d[28] << 8 | d[29] << 16) + 1\n };\n case 0x4C: // Lossless WebP VP8L --> \"L\"\n if (d[20] !== 0x2f) return UNSUPPORTED_TYPE;\n const dim = d[21] | d[22] << 8 | d[23] << 16 | d[24] << 24;\n return {\n mime: 'image/webp',\n width: (dim & 0x3FFF) + 1,\n height: (dim >>> 14 & 0x3FFF) + 1\n };\n case 0x20: // Lossy WebP VP8 --> \" \"\n if (d[23] !== 0x9d || d[24] !== 0x01 || d[25] !== 0x2a) return UNSUPPORTED_TYPE;\n return {\n mime: 'image/webp',\n width: (d[26] | d[27] << 8) & 0x3FFF,\n height: (d[28] | d[29] << 8) & 0x3FFF\n };\n }\n return UNSUPPORTED_TYPE;\n }\n // AVIF: Box size | ftyp | avif/avis\n if (d32[1] === 0x70797466 && (d32[2] === 0x66697661 || d32[2] === 0x73697661)) {\n let pos = -1;\n // search for ispe box within first 1024 bytes\n const limit = Math.min(d.length - 16, 1024);\n for (let i = 8; i < limit; i++) {\n // scan for ispe\n if (d[i] === 0x69 && d[i + 1] === 0x73 && d[i + 2] === 0x70 && d[i + 3] === 0x65) {\n pos = i;\n break;\n }\n }\n if (pos !== -1) {\n // dimensions are in BE at +8 (width) at +12 (height)\n const width =\n d[pos + 8] << 24 |\n d[pos + 9] << 16 |\n d[pos + 10] << 8 |\n d[pos + 11];\n const height =\n d[pos + 12] << 24 |\n d[pos + 13] << 16 |\n d[pos + 14] << 8 |\n d[pos + 15];\n if (width > 0 && height > 0) {\n return { mime: 'image/avif', width, height };\n }\n }\n return UNSUPPORTED_TYPE;\n }\n return UNSUPPORTED_TYPE;\n}\n\n\nfunction jpgSize(d: Uint8Array): [number, number] {\n const len = d.length;\n let i = 4;\n let blockLength = d[i] << 8 | d[i + 1];\n while (true) {\n i += blockLength;\n if (i >= len) {\n // exhausted without size info\n return [0, 0];\n }\n if (d[i] !== 0xFF) {\n return [0, 0];\n }\n if (d[i + 1] === 0xC0 || d[i + 1] === 0xC2) {\n if (i + 8 < len) {\n return [\n d[i + 7] << 8 | d[i + 8],\n d[i + 5] << 8 | d[i + 6]\n ];\n }\n return [0, 0];\n }\n i += 2;\n blockLength = d[i] << 8 | d[i + 1];\n }\n}\n", "/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { IApcHandler, IImageAddonOptions, IResetHandler, ITerminalExt, ImageLayer } from '../Types';\nimport { ImageRenderer } from '../ImageRenderer';\nimport { CELL_SIZE_DEFAULT } from '../ImageStorage';\nimport { imageType } from '../IIPMetrics';\nimport { KittyImageStorage } from './KittyImageStorage';\nimport Base64Decoder, { type DecodeStatus } from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\nimport {\n KittyAction,\n KittyFormat,\n KittyCompression,\n IKittyCommand,\n IPendingTransmission,\n IKittyImageData,\n KittyPixelConstants,\n parseKittyCommand\n} from './KittyGraphicsTypes';\n\nconst enum Constants {\n // Memory limit for base64 decoder (4MB, same as IIPHandler)\n DECODER_KEEP_DATA = 4194304,\n DECODER_INITIAL_DATA = 4194304, // 4MB\n // Local mirror of const enum (esbuild can't inline const enums from external packages)\n DECODER_OK = 0,\n // Maximum control data size\n MAX_CONTROL_DATA_SIZE = 512,\n // Semicolon codepoint\n SEMICOLON = 0x3B\n}\n\nconst DECODER_OK = Constants.DECODER_OK as unknown as DecodeStatus.OK;\n\n// Kitty graphics protocol handler with streaming base64 decoding.\nexport class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDisposable {\n private _aborted = false;\n private _generation = 0;\n private _decodeError = false;\n\n private _activeDecoder: Base64Decoder | null = null;\n private readonly _maxEncodedBytes: number;\n private readonly _initialEncodedBytes: number;\n\n // Streaming related states\n\n // True while receiving control data (before semicolon).\n private _inControlData = true;\n\n // Buffer for control data.\n private _controlData = new Uint32Array(Constants.MAX_CONTROL_DATA_SIZE);\n private _controlLength = 0;\n\n // Pre-calculated encoded size limit\n private _encodedSizeLimit = 0;\n private _totalEncodedSize = 0;\n\n // Parsed command. These are the control data before semicolon.\n private _parsedCommand: IKittyCommand | null = null;\n\n // Storage related states\n\n private _pendingTransmissions: Map = new Map();\n // Tracks the pending key of the most recently started chunked upload.\n // Per spec, subsequent chunks only need m= (and optionally q=), without i=.\n // When a chunk arrives with no i=, this key is used to find the pending upload.\n private _lastPendingKey: number | undefined;\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _kittyStorage: KittyImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n // Convert decoded size limit -> max encoded bytes.\n this._maxEncodedBytes = Math.ceil(this._opts.kittySizeLimit * 4 / 3);\n // ensure we preallocate more than configured limit while using 4mb initial size.\n this._initialEncodedBytes = Math.min(Constants.DECODER_INITIAL_DATA, this._maxEncodedBytes);\n }\n\n public reset(): void {\n this._generation++;\n this._cleanupAllPending();\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n this._kittyStorage.reset();\n }\n\n public dispose(): void {\n this.reset();\n }\n\n private _removePendingEntry(key: number): void {\n this._pendingTransmissions.delete(key);\n if (this._lastPendingKey === key) {\n this._lastPendingKey = undefined;\n }\n }\n\n private _cleanupAllPending(): void {\n for (const pending of this._pendingTransmissions.values()) {\n pending.decoder.release();\n }\n this._pendingTransmissions.clear();\n this._lastPendingKey = undefined;\n }\n\n public start(): void {\n this._aborted = false;\n this._decodeError = false;\n this._inControlData = true;\n this._controlLength = 0;\n this._parsedCommand = null;\n // Pre-calculate encoded limit once: base64 is 4 bytes encoded \u2192 3 bytes decoded\n this._encodedSizeLimit = this._maxEncodedBytes;\n this._totalEncodedSize = 0;\n this._activeDecoder = null;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n if (!this._inControlData) {\n this._streamPayload(data, start, end);\n } else {\n // Scan for semicolon\n let controlEnd = end;\n for (let i = start; i < end; i++) {\n if (data[i] === Constants.SEMICOLON) {\n this._inControlData = false;\n controlEnd = i;\n break;\n }\n }\n\n // Copy control data\n const copyLength = controlEnd - start;\n if (this._controlLength + copyLength > Constants.MAX_CONTROL_DATA_SIZE) {\n this._aborted = true;\n return;\n }\n this._controlData.set(data.subarray(start, controlEnd), this._controlLength);\n this._controlLength += copyLength;\n\n if (!this._inControlData) {\n // Found semicolon - parse control data early for validation\n this._parsedCommand = parseKittyCommand(this._parseControlDataString());\n\n // Early validation: i+I conflict\n if (this._parsedCommand.id !== undefined && this._parsedCommand.imageNumber !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'EINVAL:cannot specify both i and I keys', this._parsedCommand.quiet ?? 0);\n this._aborted = true;\n return;\n }\n\n // Delete action doesn't need payload - skip streaming\n if (this._parsedCommand.action === KittyAction.DELETE) {\n return;\n }\n\n // Stream remaining as payload\n const payloadStart = controlEnd + 1;\n if (payloadStart < end) {\n this._streamPayload(data, payloadStart, end);\n }\n }\n }\n }\n\n // Stream payload bytes into the base64 decoder.\n private _streamPayload(data: Uint32Array, start: number, end: number): void {\n if (this._aborted) return;\n\n // Check size limit (compare encoded bytes against pre-calculated limit)\n // Include cumulative size from pending transmission for multi-chunk images.\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = this._parsedCommand?.id ?? this._lastPendingKey ?? 0;\n const pending = this._pendingTransmissions.get(pendingKey);\n const previousEncodedSize = pending?.totalEncodedSize ?? 0;\n this._totalEncodedSize += end - start;\n const cumulativeEncodedSize = previousEncodedSize + this._totalEncodedSize;\n if (cumulativeEncodedSize > this._encodedSizeLimit) {\n const decoderToRelease = this._activeDecoder ?? pending?.decoder;\n if (decoderToRelease) {\n decoderToRelease.release();\n }\n this._activeDecoder = null;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n this._aborted = true;\n return;\n }\n\n if (this._decodeError) return;\n\n if (pending?.decoder && !this._activeDecoder) {\n this._activeDecoder = pending.decoder;\n }\n if (!this._activeDecoder) {\n // Budget WASM capacity, including one page of decoder state and rounding.\n const decoderCapacity = this._maxEncodedBytes + 131072;\n if (decoderCapacity > this._opts.storageLimit * 1000000) {\n this._aborted = true;\n if (this._parsedCommand?.id !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'ENOMEM:pending image budget exceeded', this._parsedCommand.quiet ?? 0);\n }\n return;\n }\n const maxPending = Math.max(1, Math.floor(this._opts.storageLimit * 1000000 / decoderCapacity));\n while (this._pendingTransmissions.size >= maxPending) {\n const oldest = this._pendingTransmissions.entries().next().value;\n if (!oldest) break;\n oldest[1].decoder.release();\n this._removePendingEntry(oldest[0]);\n if (oldest[1].cmd.id !== undefined) {\n this._sendResponse(oldest[1].cmd.id, 'ENOMEM:pending image budget exceeded', oldest[1].cmd.quiet ?? 0);\n }\n }\n const decoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes);\n try {\n decoder.init();\n } catch (e) {\n // Why: wasm memory exhaustion must drop this image, not throw out of the parser and wedge the write queue.\n console.warn('KITTY: could not allocate decoder', e);\n this._aborted = true;\n if (this._parsedCommand?.id !== undefined) {\n this._sendResponse(this._parsedCommand.id, 'ENOMEM:could not allocate decoder', this._parsedCommand.quiet ?? 0);\n }\n return;\n }\n this._activeDecoder = decoder;\n }\n\n if (this._activeDecoder.put(data.subarray(start, end)) !== DECODER_OK) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n this._decodeError = true;\n if (pending) {\n this._removePendingEntry(pendingKey);\n }\n }\n }\n\n public end(success: boolean): boolean | Promise {\n if (this._aborted || !success) {\n if (this._activeDecoder) {\n this._activeDecoder.release();\n this._activeDecoder = null;\n }\n return true;\n }\n\n // No semicolon = no payload (delete, capability query)\n if (this._inControlData) {\n return this._handleNoPayloadCommand();\n }\n\n // Use command parsed early in put() - i+I already validated there\n const cmd = this._parsedCommand!;\n\n // Delete action was handled by skipping payload - just execute\n if (cmd.action === KittyAction.DELETE) {\n return this._handleDelete(cmd);\n }\n\n // Per spec, subsequent chunks may omit i=, so fall back to _lastPendingKey.\n const pendingKey = cmd.id ?? this._lastPendingKey ?? 0;\n const isMoreComing = cmd.more === 1;\n const pending = this._pendingTransmissions.get(pendingKey);\n\n if (isMoreComing) {\n if (this._activeDecoder) {\n if (pending) {\n pending.totalEncodedSize += this._totalEncodedSize;\n pending.decodeError = pending.decodeError || this._decodeError;\n } else {\n this._pendingTransmissions.set(pendingKey, {\n cmd: { ...cmd },\n decoder: this._activeDecoder,\n totalEncodedSize: this._totalEncodedSize,\n decodeError: this._decodeError\n });\n }\n this._lastPendingKey = pendingKey;\n this._activeDecoder = null;\n }\n return true;\n }\n\n // Final chunk received \u2014 clear the last pending key\n if (pending) {\n this._lastPendingKey = undefined;\n }\n\n let decodeError = this._decodeError;\n let finalCmd = cmd;\n let decoder = this._activeDecoder;\n\n if (pending) {\n finalCmd = pending.cmd;\n decoder = pending.decoder;\n decodeError = decodeError || pending.decodeError;\n this._pendingTransmissions.delete(pendingKey);\n }\n\n let imageBytes = new Uint8Array(0);\n if (decoder) {\n if (decoder.end() !== DECODER_OK) {\n decodeError = true;\n }\n imageBytes = decoder.data8;\n }\n this._activeDecoder = null;\n\n // Handle command first \u2014 handlers create Blob/ImageData from imageBytes,\n // which copies the data. Only then is it safe to release the decoder's\n // wasm memory that imageBytes points into.\n const result = this._handleCommandWithBytesAndCmd(finalCmd, imageBytes, decodeError);\n if (decoder) {\n decoder.release();\n }\n return result;\n }\n\n // Command handling\n\n private _parseControlDataString(): string {\n let str = '';\n for (let i = 0; i < this._controlLength; i++) {\n str += String.fromCodePoint(this._controlData[i]);\n }\n return str;\n }\n\n private _handleNoPayloadCommand(): boolean | Promise {\n const cmd = parseKittyCommand(this._parseControlDataString());\n\n // Per spec: specifying both i and I is an error\n if (cmd.id !== undefined && cmd.imageNumber !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:cannot specify both i and I keys', cmd.quiet ?? 0);\n return true;\n }\n\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.DELETE:\n return this._handleDelete(cmd);\n case KittyAction.QUERY:\n this._sendResponse(cmd.id ?? 0, 'OK', cmd.quiet ?? 0);\n return true;\n case KittyAction.PLACEMENT:\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handleCommandWithBytesAndCmd(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n const action = cmd.action ?? 't';\n\n switch (action) {\n case KittyAction.TRANSMIT: {\n const result = this._handleTransmit(cmd, bytes, decodeError);\n // Only send response when _handleTransmit didn't already respond\n // (it handles unsupported transmission medium responses internally)\n if ((cmd.transmission ?? 'd') === 'd' && cmd.id !== undefined) {\n if (decodeError) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n } else if (bytes.length > 0) {\n this._sendResponse(cmd.id, 'OK', cmd.quiet ?? 0);\n }\n }\n return result;\n }\n case KittyAction.TRANSMIT_DISPLAY:\n return this._handleTransmitDisplay(cmd, bytes, decodeError);\n case KittyAction.QUERY:\n return this._handleQuery(cmd, bytes, decodeError);\n case KittyAction.PLACEMENT:\n // a=p ignores any payload \u2014 image data was already transmitted\n return this._handlePlacement(cmd);\n default:\n // TODO: Implement remaining actions when needed:\n // - a=f (frame): animation frame operations\n // - a=a (animation): animation control\n // - a=c (compose): compose images\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported action', cmd.quiet ?? 0);\n }\n return true;\n }\n }\n\n private _handlePlacement(cmd: IKittyCommand): boolean | Promise {\n if (cmd.id === undefined) {\n return true;\n }\n const id = cmd.id;\n const image = this._kittyStorage.getImage(id);\n if (!image) {\n this._sendResponse(id, 'ENOENT:image not found', cmd.quiet ?? 0, cmd.placementId);\n return true;\n }\n const result = this._displayImage(image, cmd);\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0, cmd.placementId);\n return true;\n });\n }\n\n private _handleTransmit(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n // TODO: Support file-based transmission modes (t=f, t=t, t=s)\n // Currently only supports direct transmission (t=d, the default).\n // - t=f (file): Payload is base64-encoded file path. Terminal reads image from that path.\n // - t=t (temp file): Payload is base64-encoded path in temp directory. Terminal reads, deletes.\n // - t=s: Payload is base64-encoded POSIX shm name. Terminal reads from shared memory.\n // These modes require filesystem/IPC access not available in browsers. For Node.js/Electron:\n // 1. Check cmd.transmission (t key) before treating bytes as image data\n // 2. For t=f/t/s: decode bytes as UTF-8 string (the path/name), then read file contents\n // 3. For t=d: treat bytes as image data (current behavior)\n // When implementing, also update _handleQuery to accept these transmission mediums.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:unsupported transmission medium', cmd.quiet ?? 0);\n }\n return true;\n }\n\n if (decodeError || bytes.length === 0) return true;\n\n this._kittyStorage.storeImage(cmd.id, {\n data: new Blob([bytes as BlobPart]),\n width: cmd.width ?? 0,\n height: cmd.height ?? 0,\n format: (cmd.format ?? KittyFormat.RGBA) as 24 | 32 | 100,\n compression: cmd.compression ?? ''\n });\n return true;\n }\n\n private _handleTransmitDisplay(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean | Promise {\n if (decodeError) {\n if (cmd.id !== undefined) {\n this._sendResponse(cmd.id, 'EINVAL:invalid base64 data', cmd.quiet ?? 0);\n }\n return true;\n }\n\n this._handleTransmit(cmd, bytes, decodeError);\n\n const id = cmd.id ?? this._kittyStorage.lastImageId;\n const image = this._kittyStorage.getImage(id);\n if (image) {\n const result = this._displayImage(image, cmd);\n if (cmd.id !== undefined) {\n return result.then(success => {\n this._sendResponse(id, success ? 'OK' : 'EINVAL:image rendering failed', cmd.quiet ?? 0);\n return true;\n });\n }\n return result.then(() => true);\n }\n return true;\n }\n\n private _handleQuery(cmd: IKittyCommand, bytes: Uint8Array, decodeError: boolean): boolean {\n const id = cmd.id ?? 0;\n const quiet = cmd.quiet ?? 0;\n\n // Per spec: reject unsupported transmission mediums (only t=d is supported atm)\n // TODO: When filesystem support is added (Node.js/Electron), update this to accept\n // t=f (file), t=t (temp file), and t=s (shared memory) and respond OK for queries.\n const transmission = cmd.transmission ?? 'd';\n if (transmission !== 'd') {\n this._sendResponse(id, 'EINVAL:unsupported transmission medium', quiet);\n return true;\n }\n\n // Check decode error first (invalid base64)\n if (decodeError) {\n this._sendResponse(id, 'EINVAL:invalid base64 data', quiet);\n return true;\n }\n\n // Capability query (no payload) - just respond OK\n if (bytes.length === 0) {\n this._sendResponse(id, 'OK', quiet);\n return true;\n }\n\n const format = cmd.format ?? KittyFormat.RGBA;\n\n if (format === KittyFormat.PNG) {\n this._sendResponse(id, 'OK', quiet);\n } else {\n const width = cmd.width ?? 0;\n const height = cmd.height ?? 0;\n\n if (!width || !height) {\n this._sendResponse(id, 'EINVAL:width and height required for raw pixel data', quiet);\n return true;\n }\n\n const bytesPerPixel = format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n this._sendResponse(id, `EINVAL:insufficient pixel data`, quiet);\n return true;\n }\n\n this._sendResponse(id, 'OK', quiet);\n }\n return true;\n }\n\n private _handleDelete(cmd: IKittyCommand): boolean {\n // Per spec: default delete selector is 'a' (delete all visible placements)\n const selector = cmd.deleteSelector ?? 'a';\n\n // TODO: Distinguish lowercase (delete placements only) from uppercase\n // (delete placements + free stored image data). Currently both variants\n // free everything since we don't separate stored data from placements.\n switch (selector) {\n case 'a':\n case 'A':\n this._cleanupAllPending();\n this._kittyStorage.deleteAll();\n break;\n case 'i':\n case 'I':\n // TODO: When placement id tracking is implemented (see TODO in\n // KittyImageStorage), d=i with p= should delete only that\n // specific placement, while d=i without p should delete all\n // placements for the image.\n if (cmd.id !== undefined) {\n const pending = this._pendingTransmissions.get(cmd.id);\n if (pending) {\n pending.decoder.release();\n }\n this._removePendingEntry(cmd.id);\n this._kittyStorage.deleteById(cmd.id);\n }\n break;\n default:\n // Unsupported selectors (c, n, p, q, r, x, y, z, f) \u2014 ignore for now\n break;\n }\n return true;\n }\n\n private _sendResponse(id: number, message: string, quiet: number, placementId?: number): void {\n const isOk = message === 'OK';\n if (isOk && quiet >= 1) return;\n if (!isOk && quiet >= 2) return;\n\n const pPart = placementId ? `,p=${placementId}` : '';\n const response = `\\x1b_Gi=${id}${pPart};${message}\\x1b\\\\`;\n this._coreTerminal._core.coreService.triggerDataEvent(response);\n }\n\n // Image display\n\n private _displayImage(image: IKittyImageData, cmd: IKittyCommand): Promise {\n return this._decodeAndDisplay(image, cmd)\n .then(() => true)\n .catch(() => false);\n }\n\n private async _decodeAndDisplay(image: IKittyImageData, cmd: IKittyCommand): Promise {\n const generation = this._generation;\n let bitmap: ImageBitmap | undefined = await this._createBitmap(image);\n\n try {\n if (generation !== this._generation) throw new Error('image decode canceled');\n const cropX = Math.max(0, cmd.x ?? 0);\n const cropY = Math.max(0, cmd.y ?? 0);\n const cropW = cmd.sourceWidth || (bitmap.width - cropX);\n const cropH = cmd.sourceHeight || (bitmap.height - cropY);\n\n const maxCropW = Math.max(0, bitmap.width - cropX);\n const maxCropH = Math.max(0, bitmap.height - cropY);\n const finalCropW = Math.max(0, Math.min(cropW, maxCropW));\n const finalCropH = Math.max(0, Math.min(cropH, maxCropH));\n\n if (finalCropW === 0 || finalCropH === 0) {\n throw new Error('invalid source rectangle');\n }\n\n if (cropX !== 0 || cropY !== 0 || finalCropW !== bitmap.width || finalCropH !== bitmap.height) {\n const cropped = await createImageBitmap(bitmap, cropX, cropY, finalCropW, finalCropH);\n bitmap.close();\n bitmap = cropped;\n }\n\n const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width;\n const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height;\n\n // Per spec: c/r default to image's natural cell dimensions.\n // If only one of c/r is specified, compute the other from image aspect ratio.\n let imgCols: number;\n let imgRows: number;\n if (cmd.columns !== undefined && cmd.rows !== undefined) {\n imgCols = cmd.columns;\n imgRows = cmd.rows;\n } else if (cmd.columns !== undefined) {\n imgCols = cmd.columns;\n imgRows = Math.max(1, Math.ceil((bitmap.height / bitmap.width) * (imgCols * cw) / ch));\n } else if (cmd.rows !== undefined) {\n imgRows = cmd.rows;\n imgCols = Math.max(1, Math.ceil((bitmap.width / bitmap.height) * (imgRows * ch) / cw));\n } else {\n imgCols = Math.ceil(bitmap.width / cw);\n imgRows = Math.ceil(bitmap.height / ch);\n }\n\n let w = bitmap.width;\n let h = bitmap.height;\n\n // Scale bitmap to fit placement rectangle when c/r are specified\n if (cmd.columns !== undefined || cmd.rows !== undefined) {\n w = Math.round(imgCols * cw);\n h = Math.round(imgRows * ch);\n }\n\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n\n // Save cursor position before addImage modifies it\n const buffer = this._coreTerminal._core.buffer;\n const savedX = buffer.x;\n const savedY = buffer.y;\n const savedYbase = buffer.ybase;\n\n // Determine layer based on z-index: negative = behind text, 0+ = on top.\n // When z<0 we always use the bottom layer even without allowTransparency \u2014\n // the image will simply be hidden behind the opaque text background, which\n // is the correct behavior (client asked for \"behind text\").\n const wantsBottom = cmd.zIndex !== undefined && cmd.zIndex < 0;\n const layer: ImageLayer = wantsBottom ? 'bottom' : 'top';\n\n if (w !== bitmap.width || h !== bitmap.height) {\n const scaled = await createImageBitmap(bitmap, { resizeWidth: w, resizeHeight: h });\n bitmap.close();\n bitmap = scaled;\n }\n\n // Per spec: X/Y are pixel offsets within the first cell, so clamp to cell dimensions\n const xOffset = Math.min(Math.max(0, cmd.xOffset ?? 0), cw - 1);\n const yOffset = Math.min(Math.max(0, cmd.yOffset ?? 0), ch - 1);\n if (xOffset !== 0 || yOffset !== 0) {\n // Per spec: X/Y is not added to c/r area. When c/r are explicit, the\n // total placement area remains c*cw \u00D7 r*ch pixels and the offset image\n // is clipped to fit. When c/r are unset, the padded canvas determines\n // the natural cell dimensions.\n const canvasW = (cmd.columns !== undefined) ? Math.round(imgCols * cw) : bitmap.width + xOffset;\n const canvasH = (cmd.rows !== undefined) ? Math.round(imgRows * ch) : bitmap.height + yOffset;\n const offsetCanvas = ImageRenderer.createCanvas(window.document, canvasW, canvasH);\n const offsetCtx = offsetCanvas.getContext('2d');\n if (!offsetCtx) {\n throw new Error('Failed to create offset canvas context');\n }\n offsetCtx.drawImage(bitmap, xOffset, yOffset);\n\n const offsetBitmap = await createImageBitmap(offsetCanvas);\n offsetCanvas.width = offsetCanvas.height = 0;\n bitmap.close();\n bitmap = offsetBitmap;\n w = bitmap.width;\n h = bitmap.height;\n if (w * h > this._opts.pixelLimit) {\n throw new Error('image exceeds pixel limit');\n }\n if (cmd.columns === undefined) {\n imgCols = Math.ceil(bitmap.width / cw);\n }\n if (cmd.rows === undefined) {\n imgRows = Math.ceil(bitmap.height / ch);\n }\n }\n\n if (generation !== this._generation) throw new Error('image decode canceled');\n const zIndex = cmd.zIndex ?? 0;\n this._kittyStorage.addImage(image.id, bitmap, true, layer, zIndex);\n bitmap = undefined; // ownership transferred to storage\n\n // Kitty cursor movement\n // Per spec: cursor placed at first column after last image column,\n // on the last row of the image. C=1 means don't move cursor.\n if (cmd.cursorMovement === 1) {\n // C=1: restore cursor to position before image was placed\n const scrolled = buffer.ybase - savedYbase;\n buffer.x = savedX;\n // Can't restore cursor to scrollback?\n buffer.y = Math.max(savedY - scrolled, 0);\n } else {\n // Default (C=0): advance cursor horizontally past the image\n // addImage already positioned cursor on the last row via lineFeeds\n buffer.x = Math.min(savedX + imgCols, this._coreTerminal.cols);\n }\n } catch (e) {\n bitmap?.close();\n throw e;\n }\n }\n\n // Create ImageBitmap from already-decoded image data.\n private async _createBitmap(image: IKittyImageData): Promise {\n let bytes: Uint8Array = new Uint8Array(await image.data.arrayBuffer());\n\n if (image.compression === KittyCompression.ZLIB) {\n bytes = await this._decompressZlib(bytes);\n }\n\n if (image.format === KittyFormat.PNG) {\n const metrics = imageType(bytes);\n // IHDR dimensions are parsed with signed shifts, so a value >= 0x80000000 comes\n // back negative and a bare `>` pixel-limit test passes it; require positive.\n if (metrics.mime !== 'image/png' || !(metrics.width > 0) || !(metrics.height > 0) || metrics.width * metrics.height > this._opts.pixelLimit) {\n throw new RangeError('PNG exceeds pixel limit or has invalid dimensions');\n }\n const blob = new Blob([bytes as BlobPart], { type: 'image/png' });\n if (!window.createImageBitmap) {\n const url = URL.createObjectURL(blob);\n const img = new Image();\n return new Promise((resolve, reject) => {\n img.addEventListener('load', () => {\n URL.revokeObjectURL(url);\n const canvas = ImageRenderer.createCanvas(window.document, img.width, img.height);\n canvas.getContext('2d')?.drawImage(img, 0, 0);\n createImageBitmap(canvas).then(resolve).catch(reject);\n });\n img.addEventListener('error', () => {\n URL.revokeObjectURL(url);\n reject(new Error('Failed to load image'));\n });\n img.src = url;\n });\n }\n return createImageBitmap(blob);\n }\n\n // Raw pixel data\n const width = image.width;\n const height = image.height;\n\n if (!width || !height) {\n throw new Error('Width and height required for raw pixel data');\n }\n\n const bytesPerPixel = image.format === KittyFormat.RGBA ? KittyPixelConstants.BYTES_PER_PIXEL_RGBA : KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n const expectedBytes = width * height * bytesPerPixel;\n\n if (bytes.length < expectedBytes) {\n throw new Error('Insufficient pixel data');\n }\n\n const pixelCount = width * height;\n\n if (image.format === KittyFormat.RGBA) {\n // RGBA: use bytes directly \u2014 no copy needed\n return createImageBitmap(new ImageData(new Uint8ClampedArray(bytes.buffer as ArrayBuffer, bytes.byteOffset, pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA), width, height));\n }\n\n // RGB\u2192RGBA: interleave alpha using uint32 block processing (4 pixels per iteration).\n // 3 uint32 reads + 4 uint32 writes per 4 pixels vs 28 byte reads/writes \u2014 ~6x faster.\n // Assumes little-endian (all modern browsers/Node.js).\n const data = new Uint8ClampedArray(pixelCount * KittyPixelConstants.BYTES_PER_PIXEL_RGBA);\n const src32 = new Uint32Array(bytes.buffer, bytes.byteOffset, Math.floor(bytes.byteLength / 4));\n const dst32 = new Uint32Array(data.buffer);\n const alignedPixels = pixelCount & ~3; // round down to multiple of 4\n\n let srcOffset = 0;\n let dstOffset = 0;\n for (let i = 0; i < alignedPixels; i += 4) {\n const b0 = src32[srcOffset++];\n const b1 = src32[srcOffset++];\n const b2 = src32[srcOffset++];\n // Little-endian: pixel bytes are [R,G,B] \u2192 uint32 ABGR layout\n dst32[dstOffset++] = 0xFF000000 | b0;\n dst32[dstOffset++] = 0xFF000000 | (b0 >>> 24) | (b1 << 8);\n dst32[dstOffset++] = 0xFF000000 | (b1 >>> 16) | (b2 << 16);\n dst32[dstOffset++] = 0xFF000000 | (b2 >>> 8);\n }\n\n // Handle remaining 1\u20133 pixels\n let srcByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n let dstByte = alignedPixels * KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n for (let i = alignedPixels; i < pixelCount; i++) {\n data[dstByte] = bytes[srcByte];\n data[dstByte + 1] = bytes[srcByte + 1];\n data[dstByte + 2] = bytes[srcByte + 2];\n data[dstByte + 3] = KittyPixelConstants.ALPHA_OPAQUE;\n srcByte += KittyPixelConstants.BYTES_PER_PIXEL_RGB;\n dstByte += KittyPixelConstants.BYTES_PER_PIXEL_RGBA;\n }\n\n return createImageBitmap(new ImageData(data, width, height));\n }\n\n private async _decompressZlib(compressed: Uint8Array): Promise {\n try {\n return await this._decompress(compressed, 'deflate');\n } catch (error) {\n if (error instanceof RangeError) throw error;\n return await this._decompress(compressed, 'deflate-raw');\n }\n }\n\n private async _decompress(compressed: Uint8Array, format: 'deflate' | 'deflate-raw'): Promise {\n const limit = Math.min(this._opts.kittySizeLimit, this._opts.pixelLimit * 4, this._opts.storageLimit * 1000000);\n let offsetIn = 0;\n // Bound inflation within one native transform before its output is budgeted.\n const source = new ReadableStream({\n pull(controller) {\n if (offsetIn >= compressed.length) {\n controller.close();\n return;\n }\n const end = Math.min(offsetIn + 4096, compressed.length);\n controller.enqueue(new Uint8Array(compressed.subarray(offsetIn, end)));\n offsetIn = end;\n }\n });\n const reader = source.pipeThrough(new DecompressionStream(format)).getReader();\n const chunks: Uint8Array[] = [];\n let totalLength = 0;\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n totalLength += value.byteLength;\n if (totalLength > limit) {\n await reader.cancel().catch(() => {});\n throw new RangeError('decompressed image exceeds byte limit');\n }\n chunks.push(value);\n }\n } finally {\n reader.releaseLock();\n }\n\n const result = new Uint8Array(totalLength);\n let offset = 0;\n for (const chunk of chunks) {\n result.set(chunk, offset);\n offset += chunk.length;\n }\n return result;\n }\n\n public get images(): ReadonlyMap {\n return this._kittyStorage.images;\n }\n\n public get _kittyIdToStorageId(): ReadonlyMap {\n return this._kittyStorage.kittyIdToStorageId;\n }\n\n public get pendingTransmissions(): ReadonlyMap {\n return this._pendingTransmissions;\n }\n}\n", "/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * Kitty graphics protocol types, constants, and parsing utilities.\n */\n\nimport type Base64Decoder from 'xterm-wasm-parts/lib/base64/Base64Decoder.wasm';\n\n// Kitty graphics protocol action types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'a'.\nexport const enum KittyAction {\n TRANSMIT = 't',\n TRANSMIT_DISPLAY = 'T',\n QUERY = 'q',\n PLACEMENT = 'p',\n DELETE = 'd'\n}\n\n// Kitty graphics protocol format types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyFormat {\n RGB = 24,\n RGBA = 32,\n PNG = 100\n}\n\n// Kitty graphics protocol compression types.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference under key 'o'.\nexport const enum KittyCompression {\n NONE = '',\n ZLIB = 'z'\n}\n\n// Kitty graphics protocol control data keys.\n// See: https://sw.kovidgoyal.net/kitty/graphics-protocol/#control-data-reference\nexport const enum KittyKey {\n // Action to perform (t=transmit, T=transmit+display, q=query, p=placement, d=delete)\n ACTION = 'a',\n // Image format (24=RGB, 32=RGBA, 100=PNG)\n FORMAT = 'f',\n // Image ID for referencing stored images\n ID = 'i',\n // Image number (alternative to ID, terminal assigns ID)\n IMAGE_NUMBER = 'I',\n // Source image width in pixels\n WIDTH = 's',\n // Source image height in pixels\n HEIGHT = 'v',\n // The left edge (in pixels) of the image area to display\n X_OFFSET = 'x',\n // The top edge (in pixels) of the image area to display\n Y_OFFSET = 'y',\n // Width (in pixels) of the source rectangle to display\n SOURCE_WIDTH = 'w',\n // Height (in pixels) of the source rectangle to display\n SOURCE_HEIGHT = 'h',\n // Horizontal offset (in pixels) within the first cell\n X_PLACEMENT_OFFSET = 'X',\n // Vertical offset (in pixels) within the first cell\n Y_PLACEMENT_OFFSET = 'Y',\n // Number of terminal columns to display the image over\n COLUMNS = 'c',\n // Number of terminal rows to display the image over\n ROWS = 'r',\n // More data flag (1=more chunks coming, 0=final chunk)\n MORE = 'm',\n // Compression type (z=zlib). This is essential for chunking larger images.\n COMPRESSION = 'o',\n // Quiet mode (1=suppress OK responses, 2=suppress error responses)\n QUIET = 'q',\n // Cursor movement policy (0=move cursor after image, 1=don't move cursor)\n CURSOR_MOVEMENT = 'C',\n // Z-index for image layering (negative = behind text, 0+ = on top)\n Z_INDEX = 'z',\n // Transmission medium (d=direct, f=file, t=temp file, s=shared memory)\n TRANSMISSION = 't',\n // Delete selector (a/A=all, i/I=by id, c/C=at cursor, etc.) \u2014 only used when a=d\n DELETE_SELECTOR = 'd',\n // Placement ID for targeting specific placements\n PLACEMENT_ID = 'p'\n}\n\n// Pixel format constants\nexport const enum KittyPixelConstants {\n BYTES_PER_PIXEL_RGB = 3,\n BYTES_PER_PIXEL_RGBA = 4,\n ALPHA_OPAQUE = 255\n}\n\n// Parsed Kitty graphics command.\nexport interface IKittyCommand {\n action?: string;\n format?: number;\n id?: number;\n imageNumber?: number;\n width?: number;\n height?: number;\n x?: number;\n y?: number;\n sourceWidth?: number;\n sourceHeight?: number;\n xOffset?: number;\n yOffset?: number;\n columns?: number;\n rows?: number;\n more?: number;\n quiet?: number;\n cursorMovement?: number;\n zIndex?: number;\n transmission?: string;\n deleteSelector?: string;\n placementId?: number;\n compression?: string;\n payload?: string;\n}\n\n// Pending chunked transmission state.\n// Stores metadata from the first chunk while accumulating decoded payload data.\nexport interface IPendingTransmission {\n // The parsed command from the first chunk (contains action, format, dimensions, etc.)\n cmd: IKittyCommand;\n // Decoder used across chunked payloads\n decoder: Base64Decoder;\n // Total encoded (base64) bytes received across all chunks - for size limit enforcement\n totalEncodedSize: number;\n // Whether any chunk has failed to decode\n decodeError: boolean;\n}\n\n// Stored Kitty image data.\nexport interface IKittyImageData {\n id: number;\n // Decoded image data stored as Blob (off JS heap) to avoid 2GB heap limit\n data: Blob;\n width: number;\n height: number;\n format: 24 | 32 | 100;\n compression?: string;\n}\n\n// Parses Kitty graphics control data into a command object.\nexport function parseKittyCommand(data: string): IKittyCommand {\n const cmd: IKittyCommand = {};\n const parts = data.split(',');\n\n for (const part of parts) {\n const eqIdx = part.indexOf('=');\n if (eqIdx === -1) continue;\n\n const key = part.substring(0, eqIdx);\n const value = part.substring(eqIdx + 1);\n\n // Handle string keys first\n if (key === KittyKey.ACTION) {\n cmd.action = value;\n continue;\n }\n if (key === KittyKey.COMPRESSION) {\n cmd.compression = value;\n continue;\n }\n if (key === KittyKey.TRANSMISSION) {\n cmd.transmission = value;\n continue;\n }\n if (key === KittyKey.DELETE_SELECTOR) {\n cmd.deleteSelector = value;\n continue;\n }\n const numValue = parseInt(value, 10);\n switch (key) {\n case KittyKey.FORMAT: cmd.format = numValue; break;\n case KittyKey.ID: cmd.id = numValue; break;\n case KittyKey.IMAGE_NUMBER: cmd.imageNumber = numValue; break;\n case KittyKey.WIDTH: cmd.width = numValue; break;\n case KittyKey.HEIGHT: cmd.height = numValue; break;\n case KittyKey.X_OFFSET: cmd.x = numValue; break;\n case KittyKey.Y_OFFSET: cmd.y = numValue; break;\n case KittyKey.SOURCE_WIDTH: cmd.sourceWidth = numValue; break;\n case KittyKey.SOURCE_HEIGHT: cmd.sourceHeight = numValue; break;\n case KittyKey.X_PLACEMENT_OFFSET: cmd.xOffset = numValue; break;\n case KittyKey.Y_PLACEMENT_OFFSET: cmd.yOffset = numValue; break;\n case KittyKey.COLUMNS: cmd.columns = numValue; break;\n case KittyKey.ROWS: cmd.rows = numValue; break;\n case KittyKey.MORE: cmd.more = numValue; break;\n case KittyKey.QUIET: cmd.quiet = numValue; break;\n case KittyKey.CURSOR_MOVEMENT: cmd.cursorMovement = numValue; break;\n case KittyKey.Z_INDEX: cmd.zIndex = numValue; break;\n case KittyKey.PLACEMENT_ID: cmd.placementId = numValue; break;\n }\n }\n\n return cmd;\n}\n", "/**\n * Copyright (c) 2026 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from '@xterm/xterm';\nimport { ImageStorage } from '../ImageStorage';\nimport { ImageLayer, IAddImageOpts } from '../Types';\nimport { IKittyImageData } from './KittyGraphicsTypes';\n\n// Kitty-specific image storage controller.\n//\n// Wraps shared ImageStorage with kitty protocol semantics:\n// - tracks transmitted image payloads by kitty image id\n// - tracks kitty image id -> shared ImageStorage id mapping for displayed images\n// - mirrors shared-storage evictions into kitty maps\n// - applies protocol-level undisplayed-image eviction policy\nexport class KittyImageStorage implements IDisposable {\n private static readonly _maxStoredImages = 256;\n\n private _nextImageId = 1;\n private readonly _images: Map = new Map();\n // TODO: Support multiple placements per image. The kitty spec identifies\n // placements by an (image id, placement id) pair \u2014 same i + different p\n // values should coexist, and same i + same p should replace the prior\n // placement. Currently we track only one storage entry per kitty image id,\n // so multiple placements of the same image overwrite each other. Fixing\n // this requires changing these maps to Map>\n // (kittyId \u2192 placementId \u2192 storageId) and updating addImage/deleteById\n // accordingly. The underlying shared ImageStorage would also need to\n // support multiple entries per logical image.\n private readonly _kittyIdToStorageId: Map = new Map();\n private readonly _storageIdToKittyId: Map = new Map();\n\n private readonly _previousOnImageDeleted: ((storageId: number) => void) | undefined;\n private readonly _wrappedOnImageDeleted: (storageId: number) => void;\n private readonly _handleStorageImageDeleted = (storageId: number): void => {\n const kittyId = this._storageIdToKittyId.get(storageId);\n if (kittyId !== undefined) {\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n this._images.delete(kittyId);\n }\n };\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n\n constructor(\n private readonly _storage: ImageStorage\n ) {\n this._previousOnImageDeleted = this._storage.onImageDeleted;\n this._wrappedOnImageDeleted = (storageId: number) => {\n this._previousOnImageDeleted?.(storageId);\n this._handleStorageImageDeleted(storageId);\n };\n this._storage.onImageDeleted = this._wrappedOnImageDeleted;\n }\n\n public reset(): void {\n this._nextImageId = 1;\n this._images.clear();\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public dispose(): void {\n this.reset();\n if (this._storage.onImageDeleted === this._wrappedOnImageDeleted) {\n this._storage.onImageDeleted = this._previousOnImageDeleted;\n }\n }\n\n public storeImage(id: number | undefined, imageData: Omit): number {\n const imageId = id ?? this._nextImageId++;\n\n const oldStorageId = this._kittyIdToStorageId.get(imageId);\n if (oldStorageId !== undefined) {\n this._storage.deleteImage(oldStorageId);\n this._kittyIdToStorageId.delete(imageId);\n this._storageIdToKittyId.delete(oldStorageId);\n }\n\n if (!this._images.has(imageId) && this._images.size >= KittyImageStorage._maxStoredImages) {\n this._evictUndisplayedImages();\n }\n\n // Encoded images awaiting placement are outside ImageStorage's pixel budget.\n // Unplaced payloads are evicted first so a new upload cannot erase a visible\n // image while abandoned blobs still hold budget; placed ones go only when\n // that is not enough, because the byte cap is a hard bound. The new image is\n // always stored, so an oversized one overshoots by at most one payload\n // (itself bounded by kittySizeLimit) rather than being dropped after an OK ack.\n const byteLimit = this._storage.getLimit() * 1000000;\n this._images.delete(imageId);\n let retainedBytes = 0;\n for (const image of this._images.values()) retainedBytes += image.data.size;\n for (const evictPlaced of [false, true]) {\n for (const [oldestId, image] of this._images) {\n if (retainedBytes + imageData.data.size <= byteLimit) break;\n if (this._kittyIdToStorageId.has(oldestId) !== evictPlaced) continue;\n retainedBytes -= image.data.size;\n this.deleteById(oldestId);\n }\n }\n\n this._images.set(imageId, {\n ...imageData,\n id: imageId\n });\n return imageId;\n }\n\n public addImage(kittyId: number, image: HTMLCanvasElement | ImageBitmap, scrolling: boolean, layer: ImageLayer, zIndex: number): void {\n // Clean up stale reverse-mapping from a previous placement of the same\n // kitty image. The old shared-storage entry is kept (it may still be\n // visible on screen) but its reverse mapping is removed so that eviction\n // of the old entry won't incorrectly delete the kitty image data.\n const oldStorageId = this._kittyIdToStorageId.get(kittyId);\n if (oldStorageId !== undefined) {\n this._storageIdToKittyId.delete(oldStorageId);\n }\n this._addImageOpts.scrolling = scrolling;\n this._addImageOpts.layer = layer;\n this._addImageOpts.zIndex = zIndex;\n const storageId = this._storage.addImage(image, this._addImageOpts);\n this._kittyIdToStorageId.set(kittyId, storageId);\n this._storageIdToKittyId.set(storageId, kittyId);\n }\n\n public getImage(kittyId: number): IKittyImageData | undefined {\n return this._images.get(kittyId);\n }\n\n public deleteById(kittyId: number): void {\n this._images.delete(kittyId);\n const storageId = this._kittyIdToStorageId.get(kittyId);\n if (storageId !== undefined) {\n this._storage.deleteImage(storageId);\n this._kittyIdToStorageId.delete(kittyId);\n this._storageIdToKittyId.delete(storageId);\n }\n }\n\n public deleteAll(): void {\n this._images.clear();\n for (const storageId of this._kittyIdToStorageId.values()) {\n this._storage.deleteImage(storageId);\n }\n this._kittyIdToStorageId.clear();\n this._storageIdToKittyId.clear();\n }\n\n public get images(): ReadonlyMap {\n return this._images;\n }\n\n public get kittyIdToStorageId(): ReadonlyMap {\n return this._kittyIdToStorageId;\n }\n\n public get lastImageId(): number {\n return this._nextImageId - 1;\n }\n\n private _evictUndisplayedImages(): void {\n for (const [kittyId] of this._images) {\n if (this._images.size <= KittyImageStorage._maxStoredImages / 2) {\n break;\n }\n if (!this._kittyIdToStorageId.has(kittyId)) {\n this._images.delete(kittyId);\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2020, 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IDcsHandler, IParams, IImageAddonOptions, ITerminalExt, AttributeData, IResetHandler, ReadonlyColorSet } from './Types';\nimport { toRGBA8888, BIG_ENDIAN, PALETTE_ANSI_256, PALETTE_VT340_COLOR } from 'sixel/lib/Colors';\nimport { RGBA8888 } from 'sixel/lib/Types';\nimport { ImageRenderer } from './ImageRenderer';\n\nimport { DecoderAsync, Decoder } from 'sixel/lib/Decoder';\nimport { LIMITS } from 'sixel/lib/wasm';\n\n// always free decoder ressources after decoding if it exceeds this limit\nconst MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB\n\n// custom default palette: VT340 (lower 16 colors) + ANSI256 (up to 256) + zeroed (up to 4096)\nconst DEFAULT_PALETTE = PALETTE_ANSI_256;\nDEFAULT_PALETTE.set(PALETTE_VT340_COLOR);\n\n// Why pooled: every decoder owns a wasm memory, and V8 caps live wasm memories\n// per process (~124 in a sandboxed renderer). Terminals borrow a decoder only\n// while a SIXEL sequence is open, so idle terminals hold none.\nconst MAX_IDLE_DECODERS = 2;\nconst idleDecoders = new Map();\nlet poolPrimed = false;\n\nfunction primeDecoderPool(memoryLimit: number): void {\n if (poolPrimed) return;\n poolPrimed = true;\n // Async compile once, off the parser's hot path; later decoders reuse the cached module.\n DecoderAsync({ memoryLimit, palette: DEFAULT_PALETTE }).then(\n d => releaseDecoder(d, memoryLimit),\n () => { poolPrimed = false; }\n );\n}\n\nfunction acquireDecoder(memoryLimit: number): Decoder {\n return idleDecoders.get(memoryLimit)?.pop() ?? new Decoder({ memoryLimit, palette: DEFAULT_PALETTE });\n}\n\nfunction releaseDecoder(dec: Decoder, memoryLimit: number): void {\n if (dec.memoryUsage > MEM_PERMA_LIMIT) {\n dec.release();\n }\n const idle = idleDecoders.get(memoryLimit) ?? [];\n if (idle.length < MAX_IDLE_DECODERS) {\n idle.push(dec);\n idleDecoders.set(memoryLimit, idle);\n }\n}\n\n\nexport class SixelHandler implements IDcsHandler, IResetHandler {\n private _size = 0;\n private _aborted = false;\n private _dec: Decoder | undefined;\n private _decMemoryLimit = 0;\n // Color registers outlive a single image, so they live here rather than in a pooled decoder.\n private readonly _palette = new Uint32Array(LIMITS.PALETTE_SIZE);\n\n constructor(\n private readonly _opts: IImageAddonOptions,\n private readonly _storage: SixelImageStorage,\n private readonly _coreTerminal: ITerminalExt\n ) {\n this._palette.set(DEFAULT_PALETTE);\n primeDecoderPool(this._opts.pixelLimit * 4);\n }\n\n public reset(): void {\n this._returnDecoder();\n this._palette.fill(0);\n this._palette.set(DEFAULT_PALETTE);\n }\n\n public hook(params: IParams): void {\n this._size = 0;\n this._aborted = false;\n this._returnDecoder();\n const memoryLimit = this._opts.pixelLimit * 4;\n try {\n this._dec = acquireDecoder(memoryLimit);\n } catch (e) {\n // Why: exhausting wasm memory must drop this image, not throw out of the parser and wedge the write queue.\n console.warn(`SIXEL: could not allocate decoder - ${e}`);\n this._aborted = true;\n return;\n }\n this._decMemoryLimit = memoryLimit;\n const fillColor = params.params[1] === 1 ? 0 : extractActiveBg(\n this._coreTerminal._core._inputHandler._curAttrData,\n this._coreTerminal._core._themeService?.colors);\n this._dec.init(fillColor, this._palette, this._opts.sixelPaletteLimit);\n }\n\n private _returnDecoder(): void {\n const dec = this._dec;\n if (!dec) return;\n this._dec = undefined;\n this._palette.set(dec.palette);\n releaseDecoder(dec, this._decMemoryLimit);\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._aborted || !this._dec) {\n return;\n }\n this._size += end - start;\n if (this._size > this._opts.sixelSizeLimit) {\n console.warn(`SIXEL: too much data, aborting`);\n this._aborted = true;\n this._dec.release();\n return;\n }\n try {\n this._dec.decode(data, start, end);\n } catch (e) {\n console.warn(`SIXEL: error while decoding image - ${e}`);\n this._aborted = true;\n this._dec.release();\n }\n }\n\n public unhook(success: boolean): boolean | Promise {\n try {\n return this._unhook(success);\n } finally {\n this._returnDecoder();\n }\n }\n\n private _unhook(success: boolean): boolean {\n if (this._aborted || !success || !this._dec) {\n return true;\n }\n\n const width = this._dec.width;\n const height = this._dec.height;\n\n // partial fix for https://github.com/jerch/xterm-addon-image/issues/37\n if (!width || !height) {\n if (height) {\n this._storage.advanceCursor(height);\n }\n return true;\n }\n\n const canvas = ImageRenderer.createCanvas(undefined, width, height);\n canvas.getContext('2d')?.putImageData(new ImageData(this._dec.data8 as Uint8ClampedArray, width, height), 0, 0);\n this._storage.addImage(canvas);\n return true;\n }\n}\n\n\n/**\n * Some helpers to extract current terminal colors.\n */\n\n// get currently active background color from terminal\n// also respect INVERSE setting\nfunction extractActiveBg(attr: AttributeData, colors: ReadonlyColorSet | undefined): RGBA8888 {\n let bg = 0;\n if (!colors) {\n // FIXME: theme service is prolly not available yet,\n // happens if .open() was not called yet (bug in core?)\n return bg;\n }\n if (attr.isInverse()) {\n if (attr.isFgDefault()) {\n bg = convertLe(colors.foreground.rgba);\n } else if (attr.isFgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getFgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getFgColor()].rgba);\n }\n } else {\n if (attr.isBgDefault()) {\n bg = convertLe(colors.background.rgba);\n } else if (attr.isBgRGB()) {\n const t = (attr.constructor as typeof AttributeData).toColorRGB(attr.getBgColor());\n bg = toRGBA8888(...t);\n } else {\n bg = convertLe(colors.ansi[attr.getBgColor()].rgba);\n }\n }\n return bg;\n}\n\n// rgba values on the color managers are always in BE, thus convert to LE\nfunction convertLe(color: number): RGBA8888 {\n if (BIG_ENDIAN) return color;\n return (color & 0xFF) << 24 | (color >>> 8 & 0xFF) << 16 | (color >>> 16 & 0xFF) << 8 | color >>> 24 & 0xFF;\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { IImageAddonOptions, ITerminalExt, IAddImageOpts } from './Types';\nimport { ImageRenderer } from './ImageRenderer';\n\n/**\n * Sixel-specific image storage controller.\n *\n * Wraps the shared ImageStorage with sixel protocol semantics:\n * - Cursor behavior governed by DECSET 80 (sixelScrolling option)\n * - advanceCursor for empty sixels carrying only height\n */\nexport class SixelImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'vt340' };\n constructor(\n private readonly _storage: ImageStorage,\n private readonly _opts: IImageAddonOptions,\n private readonly _renderer: ImageRenderer,\n private readonly _terminal: ITerminalExt\n ) {}\n\n /**\n * Add a sixel image to storage.\n * Cursor behavior depends on the sixelScrolling option (DECSET 80).\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._addImageOpts.scrolling = this._opts.sixelScrolling;\n this._storage.addImage(img, this._addImageOpts);\n }\n\n /**\n * Only advance text cursor.\n * This is an edge case from empty sixels carrying only a height but no pixels.\n * Partially fixes https://github.com/jerch/xterm-addon-image/issues/37.\n */\n public advanceCursor(height: number): void {\n if (this._opts.sixelScrolling) {\n let cellSize = this._renderer.cellSize;\n if (cellSize.width === -1 || cellSize.height === -1) {\n cellSize = CELL_SIZE_DEFAULT;\n }\n const rows = Math.ceil(height / cellSize.height);\n for (let i = 1; i < rows; ++i) {\n this._terminal._core._inputHandler.lineFeed();\n }\n }\n }\n}\n", "/**\n * Copyright (c) 2023 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAddImageOpts } from './Types';\nimport { ImageStorage } from './ImageStorage';\n\n/**\n * IIP (iTerm Image Protocol) specific image storage controller.\n *\n * Wraps the shared ImageStorage with IIP protocol semantics:\n * - Always uses scrolling mode (cursor advances with image)\n */\nexport class IIPImageStorage {\n private _addImageOpts: IAddImageOpts = { scrolling: true, layer: 'top', zIndex: 0, cursorPos: 'iip' };\n constructor(\n private readonly _storage: ImageStorage\n ) {}\n\n /**\n * Add an IIP image to storage.\n * Always uses scrolling mode \u2014 cursor advances past the image.\n */\n public addImage(img: HTMLCanvasElement | ImageBitmap): void {\n this._storage.addImage(img, this._addImageOpts);\n }\n}\n", "/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport type { ITerminalAddon, IDisposable } from '@xterm/xterm';\nimport type { ImageAddon as IImageApi } from '@xterm/addon-image';\nimport { Emitter, type IEvent } from 'common/Event';\nimport { IIPHandler } from './IIPHandler';\nimport { ImageRenderer } from './ImageRenderer';\nimport { ImageStorage, CELL_SIZE_DEFAULT } from './ImageStorage';\nimport { KittyGraphicsHandler } from './kitty/KittyGraphicsHandler';\nimport { KittyImageStorage } from './kitty/KittyImageStorage';\nimport { SixelHandler } from './SixelHandler';\nimport { SixelImageStorage } from './SixelImageStorage';\nimport { IIPImageStorage } from './IIPImageStorage';\nimport { ITerminalExt, IImageAddonOptions, IResetHandler } from './Types';\n\n\n/**\n * Document VT features provided by this addon.\n *\n * @vt: #E[Supported via @xterm/addon-image.] DCS SIXEL \"SIXEL Graphics\" \"DCS Ps ; Ps ; Ps ; q Pt ST\" \"Draw SIXEL image.\"\n *\n * Sixel support is provided by the addon @xterm/addon-image with these limitations:\n * - immediate coloring (no shared palette, allows high color settings of `img2sixel`)\n * - max. palette size of 4096 colors\n * - max. pixel width of 16K\n * - max. 25 MB per sixel sequence\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] OSC 1337 \"iTerm2 Commands\" \"OSC 1337 ; Pt BEL\" \"Custom iTerm2 commands.\"\n *\n * Only the inline image protocol (IIP) is supported by the addon @xterm/addon-image with\n * the following limitations:\n * - sequence:\n * - format: `OSC 1337 ; File=inline=1 ; size= ; ... : BEL`\n * - size param must be set and payload may not exceed CEIL(size * 4 / 3)\n * - strict base64 handling as of RFC4648 \u00A74 (standard alphabet, optional padding,\n * no separator bytes allowed)\n * - supported params: size, name, width, height, preserveAspectRatio\n * - image formats: PNG, JPEG and GIF\n * - no animation support (renders first image of a GIF)\n * - no multipart support\n * - VT340 cursor positioning (begin of last sixel data row)\n *\n * See [addon readme](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image)\n * and [iTerm2 IIP docs](https://iterm2.com/documentation-images.html) for more details.\n *\n *\n * @vt: #E[Supported via @xterm/addon-image.] APC KITTY_GRAPHICS \"Kitty Graphics\" \"APC G Pt ST\" \"Kitty Graphics Protocol.\"\n *\n * Kitty graphics support is provided by the addon @xterm/addon-image.\n * Note that while basic image output already works, this is still work in progress.\n */\n\n// default values of addon ctor options\nconst DEFAULT_OPTIONS: IImageAddonOptions = {\n enableSizeReports: true,\n pixelLimit: 16777216, // limit to 4096 * 4096 pixels\n sixelSupport: true,\n sixelScrolling: true,\n sixelPaletteLimit: 4096,\n sixelSizeLimit: 33554432,\n storageLimit: 128,\n showPlaceholder: true,\n iipSupport: true,\n iipSizeLimit: 33554432,\n kittySupport: true,\n kittySizeLimit: 33554432\n};\n\n// max palette size supported by the sixel lib (compile time setting)\nconst MAX_SIXEL_PALETTE_SIZE = 4096;\n\n// definitions for _xtermGraphicsAttributes sequence\nconst enum GaItem {\n COLORS = 1,\n SIXEL_GEO = 2,\n REGIS_GEO = 3\n}\nconst enum GaAction {\n READ = 1,\n SET_DEFAULT = 2,\n SET = 3,\n READ_MAX = 4\n}\nconst enum GaStatus {\n SUCCESS = 0,\n ITEM_ERROR = 1,\n ACTION_ERROR = 2,\n FAILURE = 3\n}\n\n\nexport class ImageAddon implements ITerminalAddon, IImageApi {\n private _opts: IImageAddonOptions;\n private _defaultOpts: IImageAddonOptions;\n private _storage: ImageStorage | undefined;\n private _renderer: ImageRenderer | undefined;\n private _disposables: IDisposable[] = [];\n private _terminal: ITerminalExt | undefined;\n private _handlers: Map = new Map();\n private readonly _onImageAdded = new Emitter();\n public readonly onImageAdded: IEvent = this._onImageAdded.event;\n\n constructor(opts?: Partial) {\n this._opts = Object.assign({}, DEFAULT_OPTIONS, opts);\n this._defaultOpts = Object.assign({}, DEFAULT_OPTIONS, opts);\n }\n\n public dispose(): void {\n for (const handler of this._handlers.values()) handler.reset();\n for (const obj of this._disposables) {\n obj.dispose();\n }\n this._disposables.length = 0;\n this._handlers.clear();\n this._onImageAdded.dispose();\n }\n\n private _disposeLater(...args: IDisposable[]): void {\n for (const obj of args) {\n this._disposables.push(obj);\n }\n }\n\n public activate(terminal: ITerminalExt): void {\n this._terminal = terminal;\n\n // internal data structures\n this._renderer = new ImageRenderer(terminal);\n this._storage = new ImageStorage(terminal, this._renderer, this._opts);\n this._storage.onImageAdded = () => this._onImageAdded.fire();\n\n // enable size reports\n if (this._opts.enableSizeReports) {\n const windowOps = terminal.options.windowOptions ?? {};\n windowOps.getWinSizePixels = true;\n windowOps.getCellSizePixels = true;\n windowOps.getWinSizeChars = true;\n terminal.options.windowOptions = windowOps;\n }\n\n this._disposeLater(\n this._renderer,\n this._storage,\n\n // DECSET/DECRST/DA1/XTSMGRAPHICS handlers\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'h' }, params => this._decset(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'l' }, params => this._decrst(params)),\n terminal.parser.registerCsiHandler({ final: 'c' }, params => this._da1(params)),\n terminal.parser.registerCsiHandler({ prefix: '?', final: 'S' }, params => this._xtermGraphicsAttributes(params)),\n\n // render hook\n terminal.onRender(range => this._storage?.render(range)),\n\n /**\n * reset handlers covered:\n * - DECSTR\n * - RIS\n * - Terminal.reset()\n */\n terminal.parser.registerCsiHandler({ intermediates: '!', final: 'p' }, () => this.reset()),\n terminal.parser.registerEscHandler({ final: 'c' }, () => this.reset()),\n terminal._core._inputHandler.onRequestReset(() => this.reset()),\n\n // wipe canvas and delete alternate images on buffer switch\n terminal.buffer.onBufferChange(() => this._storage?.wipeAlternate()),\n\n // extend images to the right on resize\n terminal.onResize(metrics => this._storage?.viewportResize(metrics))\n );\n\n // SIXEL handler\n if (this._opts.sixelSupport) {\n const sixelStorage = new SixelImageStorage(this._storage!, this._opts, this._renderer!, terminal);\n const sixelHandler = new SixelHandler(this._opts, sixelStorage, terminal);\n this._handlers.set('sixel', sixelHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerDcsHandler({ final: 'q' }, sixelHandler)\n );\n }\n\n // iTerm IIP handler\n if (this._opts.iipSupport) {\n const iipStorage = new IIPImageStorage(this._storage!);\n const iipHandler = new IIPHandler(this._opts, this._renderer!, iipStorage, terminal);\n this._handlers.set('iip', iipHandler);\n this._disposeLater(\n terminal._core._inputHandler._parser.registerOscHandler(1337, iipHandler)\n );\n }\n\n // Kitty graphics handler\n if (this._opts.kittySupport) {\n const kittyStorage = new KittyImageStorage(this._storage!);\n const kittyHandler = new KittyGraphicsHandler(this._opts, this._renderer!, kittyStorage, terminal);\n this._handlers.set('kitty', kittyHandler);\n this._disposeLater(\n kittyStorage,\n kittyHandler,\n terminal._core._inputHandler._parser.registerApcHandler({ final: 'G' }, kittyHandler)\n );\n }\n }\n\n // Note: storageLimit is skipped here to not intoduce a surprising side effect.\n public reset(): boolean {\n // reset options customizable by sequences to defaults\n this._opts.sixelScrolling = this._defaultOpts.sixelScrolling;\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n // also clear image storage\n this._storage?.reset();\n // reset protocol handlers\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return false;\n }\n\n public get storageLimit(): number {\n return this._storage?.getLimit() || -1;\n }\n\n public set storageLimit(limit: number) {\n this._storage?.setLimit(limit);\n this._opts.storageLimit = limit;\n }\n\n public get storageUsage(): number {\n if (this._storage) {\n return this._storage.getUsage();\n }\n return -1;\n }\n\n public get showPlaceholder(): boolean {\n return this._opts.showPlaceholder;\n }\n\n public set showPlaceholder(value: boolean) {\n this._opts.showPlaceholder = value;\n this._renderer?.showPlaceholder(value);\n }\n\n public getImageAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.getImageAtBufferCell(x, y);\n }\n\n public extractTileAtBufferCell(x: number, y: number): HTMLCanvasElement | undefined {\n return this._storage?.extractTileAtBufferCell(x, y);\n }\n\n private _report(s: string): void {\n this._terminal?._core.input(s, false);\n }\n\n private _decset(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = false;\n break;\n }\n }\n return false;\n }\n\n private _decrst(params: (number | number[])[]): boolean {\n for (let i = 0; i < params.length; ++i) {\n switch (params[i]) {\n case 80:\n this._opts.sixelScrolling = true;\n break;\n }\n }\n return false;\n }\n\n // overload DA to return something more appropriate\n private _da1(params: (number | number[])[]): boolean {\n if (params[0]) {\n return true;\n }\n // reported features:\n // 62 - VT220\n // 4 - SIXEL support\n // 9 - charsets\n // 22 - ANSI colors\n if (this._opts.sixelSupport) {\n this._report(`\\x1b[?62;4;9;22c`);\n return true;\n }\n return false;\n }\n\n /**\n * Implementation of xterm's graphics attribute sequence.\n *\n * Supported features:\n * - read/change palette limits (max 4096 by sixel lib)\n * - read SIXEL canvas geometry (reports current window canvas or\n * squared pixelLimit if canvas > pixel limit)\n *\n * Everything else is deactivated.\n */\n private _xtermGraphicsAttributes(params: (number | number[])[]): boolean {\n if (params.length < 2) {\n return true;\n }\n if (params[0] === GaItem.COLORS) {\n switch (params[1]) {\n case GaAction.READ:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n return true;\n case GaAction.SET_DEFAULT:\n this._opts.sixelPaletteLimit = this._defaultOpts.sixelPaletteLimit;\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n // also reset protocol handlers for now\n for (const handler of this._handlers.values()) {\n handler.reset();\n }\n return true;\n case GaAction.SET:\n if (params.length > 2 && !(params[2] instanceof Array) && params[2] <= MAX_SIXEL_PALETTE_SIZE) {\n this._opts.sixelPaletteLimit = params[2];\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${this._opts.sixelPaletteLimit}S`);\n } else {\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n }\n return true;\n case GaAction.READ_MAX:\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${MAX_SIXEL_PALETTE_SIZE}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n if (params[0] === GaItem.SIXEL_GEO) {\n switch (params[1]) {\n // we only implement read and read_max here\n case GaAction.READ:\n let width = this._renderer?.dimensions?.css.canvas.width;\n let height = this._renderer?.dimensions?.css.canvas.height;\n if (!width || !height) {\n // for some reason we have no working image renderer\n // --> fallback to default cell size\n const cellSize = CELL_SIZE_DEFAULT;\n width = (this._terminal?.cols || 80) * cellSize.width;\n height = (this._terminal?.rows || 24) * cellSize.height;\n }\n if (width * height < this._opts.pixelLimit) {\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${width.toFixed(0)};${height.toFixed(0)}S`);\n } else {\n // if we overflow pixelLimit report that squared instead\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n }\n return true;\n case GaAction.READ_MAX:\n // read_max returns pixelLimit as square area\n const x = Math.floor(Math.sqrt(this._opts.pixelLimit));\n this._report(`\\x1b[?${params[0]};${GaStatus.SUCCESS};${x};${x}S`);\n return true;\n default:\n this._report(`\\x1b[?${params[0]};${GaStatus.ACTION_ERROR}S`);\n return true;\n }\n }\n // exit with error on ReGIS or any other requests\n this._report(`\\x1b[?${params[0]};${GaStatus.ITEM_ERROR}S`);\n return true;\n }\n}\n"], ++ "mappings": ";;;;;;;;;;;;;;;;02BAYaA,EAAA,WAAa,IAAI,WAAW,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,IAAM,IAClFA,EAAA,YACF,QAAQ,KAAK,6EAA6E,EAI5F,SAAgBC,GAAIC,EAAW,CAC7B,OAAOA,EAAI,GACb,CAFAF,EAAA,IAAAC,G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,OACpD,GAAI,CAACD,GAAS,CAACC,EAAQ,CAGrB,IAAMC,EAAWC,EACjBH,GAAS,KAAK,WAAW,MAAQ,IAAME,EAAS,MAChDD,GAAU,KAAK,WAAW,MAAQ,IAAMC,EAAS,MACnD,CACA,GAAIF,EAAQC,EAAS,KAAK,MAAM,WAC9B,KAAK,QAAQ,SAASvB,EAAO,CAAC,CAAC,MAAwBsB,EAAM,QAAQ,CAAC,CAAC,IAAIC,EAAO,QAAQ,CAAC,CAAC,GAAG,MAC1F,CAEL,IAAMN,EAAI,KAAK,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC,EACrD,KAAK,QAAQ,SAASjB,EAAO,CAAC,CAAC,MAAwBiB,CAAC,IAAIA,CAAC,GAAG,CAClE,CACA,MAAO,GACT,IAAK,GAEH,IAAMA,EAAI,KAAK,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU,CAAC,EACrD,YAAK,QAAQ,SAASjB,EAAO,CAAC,CAAC,MAAwBiB,CAAC,IAAIA,CAAC,GAAG,EACzD,GACT,QACE,YAAK,QAAQ,SAASjB,EAAO,CAAC,CAAC,KAA4B,EACpD,EACX,CAGF,YAAK,QAAQ,SAASA,EAAO,CAAC,CAAC,KAA0B,EAClD,EACT,CACF", ++ "names": ["exports", "red", "n", "green", "blue", "alpha", "toRGBA8888", "g", "b", "a", "fromRGBA8888", "color", "nearestColorIndex", "palette", "r", "min", "idx", "i", "dr", "dg", "db", "d", "clamp", "low", "high", "value", "h2c", "t1", "t2", "c", "HLStoRGB", "h", "l", "s", "v", "normalizeRGB", "normalizeHLS", "p", "require_lib", "__commonJSMin", "exports", "InWasm", "z", "s", "b", "r", "def", "t", "d", "m", "W", "e", "require_Base64Decoder_wasm", "__commonJSMin", "exports", "inwasm_runtime_1", "wasmDecode", "MAP", "el", "D", "i", "EMPTY", "Base64Decoder", "keepSize", "maxBytes", "initialBytes", "m", "bytes", "requested", "needed", "newSize", "addPages", "data", "require_QoiDecoder_wasm", "__commonJSMin", "exports", "inwasm_runtime_1", "wasmQoiDecode", "QoiDecoder", "keepSize", "d", "pixels", "ib", "dl", "bytes", "chunkP", "exports", "Colors_1", "wasm_1", "decodeBase64", "s", "bytestring", "result", "WASM_BYTES", "WASM_MODULE", "NULL_CANVAS", "CallbackProxy", "width", "mode", "DEFAULT_OPTIONS", "DecoderAsync", "opts", "cbProxy", "importObj", "inst", "Decoder", "exports", "_instance", "_cbProxy", "module", "pixels", "offset", "additionalPixels", "newCanvas", "adv", "remaining", "c", "i", "fillColor", "palette", "paletteLimit", "truncate", "data", "start", "end", "p", "length", "j", "currentWidth", "escape", "final", "finalOffset", "bw", "currentHeight", "decode", "dec", "decodeAsync", "toDisposable", "fn", "DisposableStore", "o", "d", "Disposable", "MutableDisposable", "value", "Emitter", "listener", "thisArgs", "disposables", "toDisposable", "entry", "result", "idx", "event", "listeners", "len", "EventUtils", "forward", "from", "to", "e", "map", "i", "any", "events", "store", "DisposableStore", "runAndSubscribe", "handler", "initial", "import_Colors", "ImageRenderer", "_ImageRenderer", "Disposable", "_terminal", "MutableDisposable", "parent", "option", "toDisposable", "localDocument", "width", "height", "canvas", "ctx", "buffer", "imgData", "img", "value", "start", "end", "layer", "y", "w", "h", "imgSpec", "tileId", "col", "row", "count", "sourceWidth", "sourceHeight", "cols", "sx", "sy", "dx", "dy", "finalWidth", "finalHeight", "spec", "currentWidth", "currentHeight", "originalWidth", "originalHeight", "scaledWidth", "scaledHeight", "renderer", "key", "screenElement", "bWidth", "blueprint", "d32", "black", "white", "shift", "offset", "x", "ctx2", "i", "placeholder", "bitmap", "CELL_SIZE_DEFAULT", "ExtendedAttrsImage", "_ExtendedAttrsImage", "ext", "urlId", "imageId", "tileId", "value", "val", "EMPTY_ATTRS", "ImageStorage", "_terminal", "_renderer", "_opts", "e", "spec", "storedPixels", "id", "zero", "img", "opts", "cellSize", "cols", "rows", "buffer", "termCols", "termRows", "originX", "originY", "offset", "tileCount", "row", "line", "col", "endMarker", "imgSpec", "range", "hasTopImages", "hasBottomImages", "start", "end", "drawCalls", "placeholderCalls", "startTile", "startCol", "count", "a", "b", "call", "metrics", "oldCol", "tilesPerRow", "hasData", "rightCol", "lastTile", "expandCol", "x", "y", "orig", "canvas", "ImageRenderer", "room", "used", "current", "old", "oldSpec", "imgId", "import_Base64Decoder", "import_QoiDecoder", "toStr", "data", "s", "i", "toInt", "v", "toSize", "toName", "bs", "b", "DECODERS", "FILE_MARKER", "MULTIPARTFILE_MARKER", "FILEPART_MARKER", "FILEEND_MARKER", "REPORTCELLSIZE_MARKER", "MAX_FIELDCHARS", "HeaderParser", "k", "start", "end", "state", "pos", "buffer", "c", "UNSUPPORTED_TYPE", "imageType", "d", "d32", "width", "height", "jpgSize", "dim", "pos", "limit", "i", "len", "blockLength", "DEFAULT_HEADER", "IIPHandler", "_opts", "_renderer", "_storage", "_coreTerminal", "HeaderParser", "maxEncodedBytes", "initialBytes", "Base64Decoder", "QoiDecoder", "data", "start", "end", "dataPos", "success", "seqType", "w", "CELL_SIZE_DEFAULT", "h", "scale", "report", "cond", "metrics", "UNSUPPORTED_TYPE", "imageType", "blob", "e", "canvas", "ImageRenderer", "generation", "bm", "cw", "ch", "width", "height", "rw", "rh", "wf", "hf", "f", "s", "total", "cdim", "import_Base64Decoder", "parseKittyCommand", "data", "cmd", "parts", "part", "eqIdx", "key", "value", "numValue", "DECODER_OK", "KittyGraphicsHandler", "_opts", "_renderer", "_kittyStorage", "_coreTerminal", "key", "pending", "data", "start", "end", "controlEnd", "i", "copyLength", "parseKittyCommand", "payloadStart", "pendingKey", "previousEncodedSize", "decoderToRelease", "decoderCapacity", "maxPending", "oldest", "decoder", "Base64Decoder", "e", "success", "cmd", "isMoreComing", "decodeError", "finalCmd", "imageBytes", "result", "str", "bytes", "id", "image", "quiet", "format", "width", "height", "bytesPerPixel", "expectedBytes", "message", "placementId", "isOk", "pPart", "response", "generation", "bitmap", "cropX", "cropY", "cropW", "cropH", "maxCropW", "maxCropH", "finalCropW", "finalCropH", "cropped", "cw", "CELL_SIZE_DEFAULT", "ch", "imgCols", "imgRows", "w", "h", "buffer", "savedX", "savedY", "savedYbase", "layer", "scaled", "xOffset", "yOffset", "canvasW", "canvasH", "offsetCanvas", "ImageRenderer", "offsetCtx", "offsetBitmap", "zIndex", "scrolled", "metrics", "imageType", "blob", "url", "img", "resolve", "reject", "canvas", "pixelCount", "src32", "dst32", "alignedPixels", "srcOffset", "dstOffset", "b0", "b1", "b2", "srcByte", "dstByte", "compressed", "error", "limit", "offsetIn", "reader", "controller", "chunks", "totalLength", "done", "value", "offset", "chunk", "_KittyImageStorage", "_storage", "storageId", "kittyId", "id", "imageData", "imageId", "oldStorageId", "byteLimit", "retainedBytes", "image", "evictPlaced", "oldestId", "scrolling", "layer", "zIndex", "KittyImageStorage", "import_Colors", "import_Decoder", "import_wasm", "MEM_PERMA_LIMIT", "DEFAULT_PALETTE", "MAX_IDLE_DECODERS", "idleDecoders", "poolPrimed", "primeDecoderPool", "memoryLimit", "d", "releaseDecoder", "acquireDecoder", "dec", "idle", "SixelHandler", "_opts", "_storage", "_coreTerminal", "params", "e", "fillColor", "extractActiveBg", "data", "start", "end", "success", "width", "height", "canvas", "ImageRenderer", "attr", "colors", "bg", "convertLe", "t", "color", "SixelImageStorage", "_storage", "_opts", "_renderer", "_terminal", "img", "height", "cellSize", "CELL_SIZE_DEFAULT", "rows", "i", "IIPImageStorage", "_storage", "img", "DEFAULT_OPTIONS", "MAX_SIXEL_PALETTE_SIZE", "ImageAddon", "opts", "Emitter", "DEFAULT_OPTIONS", "handler", "obj", "args", "terminal", "ImageRenderer", "ImageStorage", "windowOps", "params", "range", "metrics", "sixelStorage", "SixelImageStorage", "sixelHandler", "SixelHandler", "iipStorage", "IIPImageStorage", "iipHandler", "IIPHandler", "kittyStorage", "KittyImageStorage", "kittyHandler", "KittyGraphicsHandler", "limit", "value", "x", "y", "s", "i", "MAX_SIXEL_PALETTE_SIZE", "width", "height", "cellSize", "CELL_SIZE_DEFAULT"] } diff --git a/src/IIPHandler.ts b/src/IIPHandler.ts -index 559b907416eb38318f439d060d7f89311ed34c7e..8541b4b0ea0d6b451aaae49007d69df64c5bd088 100644 +index 559b907416eb38318f439d060d7f89311ed34c7e..73cedbe99f831bffd202697cc8ba80a46a39cb99 100644 --- a/src/IIPHandler.ts +++ b/src/IIPHandler.ts -@@ -34,6 +34,7 @@ const DEFAULT_HEADER: IHeaderFields = { +@@ -13,8 +13,10 @@ import { imageType, UNSUPPORTED_TYPE } from './IIPMetrics'; + + // Local const enum mirror - esbuild can't inline const enums from external packages + const enum DecoderConst { +- // Limit held memory in base64 decoder (encoded bytes). +- KEEP_DATA = 4194304, ++ // Held memory in base64/QOI decoders between images. Zero because each kept ++ // decoder pins a wasm memory, and V8 caps those per process (~124 in a ++ // sandboxed renderer), so idle terminals must not hold one. ++ KEEP_DATA = 0, + // Initial buffer allocation for the decoder. + INITIAL_DATA = 1048576, + // Local mirror of const enum (esbuild can't inline const enums from external packages) +@@ -34,6 +36,7 @@ const DEFAULT_HEADER: IHeaderFields = { export class IIPHandler implements IOscHandler, IResetHandler { @@ -55,7 +68,7 @@ index 559b907416eb38318f439d060d7f89311ed34c7e..8541b4b0ea0d6b451aaae49007d69df6 private _aborted = false; private _hp = new HeaderParser(); private _header: IHeaderFields = DEFAULT_HEADER; -@@ -55,6 +56,7 @@ export class IIPHandler implements IOscHandler, IResetHandler { +@@ -55,6 +58,7 @@ export class IIPHandler implements IOscHandler, IResetHandler { } public reset(): void { @@ -63,7 +76,47 @@ index 559b907416eb38318f439d060d7f89311ed34c7e..8541b4b0ea0d6b451aaae49007d69df6 this._hp.reset(); this._dec.release(); this._qoiDec.release(); -@@ -198,8 +200,13 @@ export class IIPHandler implements IOscHandler, IResetHandler { +@@ -92,7 +96,10 @@ export class IIPHandler implements IOscHandler, IResetHandler { + this._aborted = true; + return; + } +- this._dec.init(); ++ if (!this._initDecoder()) { ++ this._aborted = true; ++ return; ++ } + } else if (this._abortMulti) { + this._aborted = true; + return; +@@ -135,7 +142,9 @@ export class IIPHandler implements IOscHandler, IResetHandler { + this._isMultipart = true; + this._abortMulti = false; + this._dec.release(); +- this._dec.init(); ++ if (!this._initDecoder()) { ++ this._abortMulti = true; ++ } + return true; + } + +@@ -179,7 +188,15 @@ export class IIPHandler implements IOscHandler, IResetHandler { + + let blob: Blob | ImageData; + if (metrics.mime === 'image/qoi') { +- const data = this._qoiDec.decode(this._dec.data8); ++ let data: Uint8Array; ++ try { ++ data = this._qoiDec.decode(this._dec.data8); ++ } catch (e) { ++ console.warn('IIP: could not decode QOI image', e); ++ this._dec.release(); ++ this._qoiDec.release(); ++ return true; ++ } + blob = new ImageData( + new Uint8ClampedArray(data.buffer, data.byteOffset, data.byteLength), + this._qoiDec.width, +@@ -198,8 +215,13 @@ export class IIPHandler implements IOscHandler, IResetHandler { blob = new Blob([this._dec.data8], { type: metrics.mime }); } this._dec.release(); @@ -77,6 +130,25 @@ index 559b907416eb38318f439d060d7f89311ed34c7e..8541b4b0ea0d6b451aaae49007d69df6 this._storage.addImage(bm); return true; }) +@@ -209,6 +231,18 @@ export class IIPHandler implements IOscHandler, IResetHandler { + }); + } + ++ // Why: wasm memory exhaustion must drop this image, not throw out of the parser and wedge the write queue. ++ private _initDecoder(): boolean { ++ try { ++ this._dec.init(); ++ return true; ++ } catch (e) { ++ console.warn('IIP: could not allocate decoder', e); ++ this._dec.release(); ++ return false; ++ } ++ } ++ + private _resize(w: number, h: number): [number, number] { + const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width; + const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height; diff --git a/src/ImageAddon.ts b/src/ImageAddon.ts index 8fd39543118cd420e36c1614c1af370b6c7bbfbb..0c44d2a81642113417bf8dc10a4faa76d7cc5864 100644 --- a/src/ImageAddon.ts @@ -189,8 +261,156 @@ index 5854efaec1fdf9dfcb886023542998a563b6d2f2..3afaf9bd63ffd7a4cdf32bf0ac24cf33 } public get document(): Document | undefined { +diff --git a/src/SixelHandler.ts b/src/SixelHandler.ts +index 1af2d85bcdd541ed60b1e707f6186a91f1bbf1b2..0711a122ea43d5212a2851add9e744b65550ec85 100644 +--- a/src/SixelHandler.ts ++++ b/src/SixelHandler.ts +@@ -10,6 +10,7 @@ import { RGBA8888 } from 'sixel/lib/Types'; + import { ImageRenderer } from './ImageRenderer'; + + import { DecoderAsync, Decoder } from 'sixel/lib/Decoder'; ++import { LIMITS } from 'sixel/lib/wasm'; + + // always free decoder ressources after decoding if it exceeds this limit + const MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB +@@ -18,48 +19,88 @@ const MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB + const DEFAULT_PALETTE = PALETTE_ANSI_256; + DEFAULT_PALETTE.set(PALETTE_VT340_COLOR); + ++// Why pooled: every decoder owns a wasm memory, and V8 caps live wasm memories ++// per process (~124 in a sandboxed renderer). Terminals borrow a decoder only ++// while a SIXEL sequence is open, so idle terminals hold none. ++const MAX_IDLE_DECODERS = 2; ++const idleDecoders = new Map(); ++let poolPrimed = false; ++ ++function primeDecoderPool(memoryLimit: number): void { ++ if (poolPrimed) return; ++ poolPrimed = true; ++ // Async compile once, off the parser's hot path; later decoders reuse the cached module. ++ DecoderAsync({ memoryLimit, palette: DEFAULT_PALETTE }).then( ++ d => releaseDecoder(d, memoryLimit), ++ () => { poolPrimed = false; } ++ ); ++} ++ ++function acquireDecoder(memoryLimit: number): Decoder { ++ return idleDecoders.get(memoryLimit)?.pop() ?? new Decoder({ memoryLimit, palette: DEFAULT_PALETTE }); ++} ++ ++function releaseDecoder(dec: Decoder, memoryLimit: number): void { ++ if (dec.memoryUsage > MEM_PERMA_LIMIT) { ++ dec.release(); ++ } ++ const idle = idleDecoders.get(memoryLimit) ?? []; ++ if (idle.length < MAX_IDLE_DECODERS) { ++ idle.push(dec); ++ idleDecoders.set(memoryLimit, idle); ++ } ++} ++ + + export class SixelHandler implements IDcsHandler, IResetHandler { + private _size = 0; + private _aborted = false; + private _dec: Decoder | undefined; ++ private _decMemoryLimit = 0; ++ // Color registers outlive a single image, so they live here rather than in a pooled decoder. ++ private readonly _palette = new Uint32Array(LIMITS.PALETTE_SIZE); + + constructor( + private readonly _opts: IImageAddonOptions, + private readonly _storage: SixelImageStorage, + private readonly _coreTerminal: ITerminalExt + ) { +- DecoderAsync({ +- memoryLimit: this._opts.pixelLimit * 4, +- palette: DEFAULT_PALETTE, +- paletteLimit: this._opts.sixelPaletteLimit +- }).then(d => this._dec = d); ++ this._palette.set(DEFAULT_PALETTE); ++ primeDecoderPool(this._opts.pixelLimit * 4); + } + + public reset(): void { +- /** +- * reset sixel decoder to defaults: +- * - release all memory +- * - nullify palette (4096) +- * - apply default palette (256) +- */ +- if (this._dec) { +- this._dec.release(); +- // FIXME: missing interface on decoder to nullify full palette +- (this._dec as any)._palette.fill(0); +- this._dec.init(0, DEFAULT_PALETTE, this._opts.sixelPaletteLimit); +- } ++ this._returnDecoder(); ++ this._palette.fill(0); ++ this._palette.set(DEFAULT_PALETTE); + } + + public hook(params: IParams): void { + this._size = 0; + this._aborted = false; +- if (this._dec) { +- const fillColor = params.params[1] === 1 ? 0 : extractActiveBg( +- this._coreTerminal._core._inputHandler._curAttrData, +- this._coreTerminal._core._themeService?.colors); +- this._dec.init(fillColor, null, this._opts.sixelPaletteLimit); ++ this._returnDecoder(); ++ const memoryLimit = this._opts.pixelLimit * 4; ++ try { ++ this._dec = acquireDecoder(memoryLimit); ++ } catch (e) { ++ // Why: exhausting wasm memory must drop this image, not throw out of the parser and wedge the write queue. ++ console.warn(`SIXEL: could not allocate decoder - ${e}`); ++ this._aborted = true; ++ return; + } ++ this._decMemoryLimit = memoryLimit; ++ const fillColor = params.params[1] === 1 ? 0 : extractActiveBg( ++ this._coreTerminal._core._inputHandler._curAttrData, ++ this._coreTerminal._core._themeService?.colors); ++ this._dec.init(fillColor, this._palette, this._opts.sixelPaletteLimit); ++ } ++ ++ private _returnDecoder(): void { ++ const dec = this._dec; ++ if (!dec) return; ++ this._dec = undefined; ++ this._palette.set(dec.palette); ++ releaseDecoder(dec, this._decMemoryLimit); + } + + public put(data: Uint32Array, start: number, end: number): void { +@@ -83,6 +124,14 @@ export class SixelHandler implements IDcsHandler, IResetHandler { + } + + public unhook(success: boolean): boolean | Promise { ++ try { ++ return this._unhook(success); ++ } finally { ++ this._returnDecoder(); ++ } ++ } ++ ++ private _unhook(success: boolean): boolean { + if (this._aborted || !success || !this._dec) { + return true; + } +@@ -100,9 +149,6 @@ export class SixelHandler implements IDcsHandler, IResetHandler { + + const canvas = ImageRenderer.createCanvas(undefined, width, height); + canvas.getContext('2d')?.putImageData(new ImageData(this._dec.data8 as Uint8ClampedArray, width, height), 0, 0); +- if (this._dec.memoryUsage > MEM_PERMA_LIMIT) { +- this._dec.release(); +- } + this._storage.addImage(canvas); + return true; + } diff --git a/src/kitty/KittyGraphicsHandler.ts b/src/kitty/KittyGraphicsHandler.ts -index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1fa320c4f8 100644 +index de889dfff75d9ecc8ab47a025e6989ffe75bb202..cf66e5b75c78645b1641e53d1425d88201134f78 100644 --- a/src/kitty/KittyGraphicsHandler.ts +++ b/src/kitty/KittyGraphicsHandler.ts @@ -7,6 +7,7 @@ import { IDisposable } from '@xterm/xterm'; @@ -217,10 +437,12 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f this._cleanupAllPending(); if (this._activeDecoder) { this._activeDecoder.release(); -@@ -200,6 +203,25 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos +@@ -200,8 +203,38 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos this._activeDecoder = pending.decoder; } if (!this._activeDecoder) { +- this._activeDecoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes); +- this._activeDecoder.init(); + // Budget WASM capacity, including one page of decoder state and rounding. + const decoderCapacity = this._maxEncodedBytes + 131072; + if (decoderCapacity > this._opts.storageLimit * 1000000) { @@ -240,10 +462,23 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f + this._sendResponse(oldest[1].cmd.id, 'ENOMEM:pending image budget exceeded', oldest[1].cmd.quiet ?? 0); + } + } - this._activeDecoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes); - this._activeDecoder.init(); ++ const decoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes); ++ try { ++ decoder.init(); ++ } catch (e) { ++ // Why: wasm memory exhaustion must drop this image, not throw out of the parser and wedge the write queue. ++ console.warn('KITTY: could not allocate decoder', e); ++ this._aborted = true; ++ if (this._parsedCommand?.id !== undefined) { ++ this._sendResponse(this._parsedCommand.id, 'ENOMEM:could not allocate decoder', this._parsedCommand.quiet ?? 0); ++ } ++ return; ++ } ++ this._activeDecoder = decoder; } -@@ -550,9 +572,11 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos + + if (this._activeDecoder.put(data.subarray(start, end)) !== DECODER_OK) { +@@ -550,9 +583,11 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos } private async _decodeAndDisplay(image: IKittyImageData, cmd: IKittyCommand): Promise { @@ -255,7 +490,7 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f const cropX = Math.max(0, cmd.x ?? 0); const cropY = Math.max(0, cmd.y ?? 0); const cropW = cmd.sourceWidth || (bitmap.width - cropX); -@@ -660,6 +684,7 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos +@@ -660,6 +695,7 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos } } @@ -263,7 +498,7 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f const zIndex = cmd.zIndex ?? 0; this._kittyStorage.addImage(image.id, bitmap, true, layer, zIndex); bitmap = undefined; // ownership transferred to storage -@@ -693,6 +718,12 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos +@@ -693,6 +729,12 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos } if (image.format === KittyFormat.PNG) { @@ -276,7 +511,7 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f const blob = new Blob([bytes as BlobPart], { type: 'image/png' }); if (!window.createImageBitmap) { const url = URL.createObjectURL(blob); -@@ -775,27 +806,45 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos +@@ -775,27 +817,45 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos private async _decompressZlib(compressed: Uint8Array): Promise { try { return await this._decompress(compressed, 'deflate'); diff --git a/config/patches/xterm-src/@xterm__addon-image@0.10.0-beta.300.src.patch b/config/patches/xterm-src/@xterm__addon-image@0.10.0-beta.300.src.patch index 2c5aa15fac15..3b581c30477d 100644 --- a/config/patches/xterm-src/@xterm__addon-image@0.10.0-beta.300.src.patch +++ b/config/patches/xterm-src/@xterm__addon-image@0.10.0-beta.300.src.patch @@ -1,8 +1,21 @@ diff --git a/src/IIPHandler.ts b/src/IIPHandler.ts -index 559b907416eb38318f439d060d7f89311ed34c7e..8541b4b0ea0d6b451aaae49007d69df64c5bd088 100644 +index 559b907416eb38318f439d060d7f89311ed34c7e..73cedbe99f831bffd202697cc8ba80a46a39cb99 100644 --- a/src/IIPHandler.ts +++ b/src/IIPHandler.ts -@@ -34,6 +34,7 @@ const DEFAULT_HEADER: IHeaderFields = { +@@ -13,8 +13,10 @@ import { imageType, UNSUPPORTED_TYPE } from './IIPMetrics'; + + // Local const enum mirror - esbuild can't inline const enums from external packages + const enum DecoderConst { +- // Limit held memory in base64 decoder (encoded bytes). +- KEEP_DATA = 4194304, ++ // Held memory in base64/QOI decoders between images. Zero because each kept ++ // decoder pins a wasm memory, and V8 caps those per process (~124 in a ++ // sandboxed renderer), so idle terminals must not hold one. ++ KEEP_DATA = 0, + // Initial buffer allocation for the decoder. + INITIAL_DATA = 1048576, + // Local mirror of const enum (esbuild can't inline const enums from external packages) +@@ -34,6 +36,7 @@ const DEFAULT_HEADER: IHeaderFields = { export class IIPHandler implements IOscHandler, IResetHandler { @@ -10,7 +23,7 @@ index 559b907416eb38318f439d060d7f89311ed34c7e..8541b4b0ea0d6b451aaae49007d69df6 private _aborted = false; private _hp = new HeaderParser(); private _header: IHeaderFields = DEFAULT_HEADER; -@@ -55,6 +56,7 @@ export class IIPHandler implements IOscHandler, IResetHandler { +@@ -55,6 +58,7 @@ export class IIPHandler implements IOscHandler, IResetHandler { } public reset(): void { @@ -18,7 +31,47 @@ index 559b907416eb38318f439d060d7f89311ed34c7e..8541b4b0ea0d6b451aaae49007d69df6 this._hp.reset(); this._dec.release(); this._qoiDec.release(); -@@ -198,8 +200,13 @@ export class IIPHandler implements IOscHandler, IResetHandler { +@@ -92,7 +96,10 @@ export class IIPHandler implements IOscHandler, IResetHandler { + this._aborted = true; + return; + } +- this._dec.init(); ++ if (!this._initDecoder()) { ++ this._aborted = true; ++ return; ++ } + } else if (this._abortMulti) { + this._aborted = true; + return; +@@ -135,7 +142,9 @@ export class IIPHandler implements IOscHandler, IResetHandler { + this._isMultipart = true; + this._abortMulti = false; + this._dec.release(); +- this._dec.init(); ++ if (!this._initDecoder()) { ++ this._abortMulti = true; ++ } + return true; + } + +@@ -179,7 +188,15 @@ export class IIPHandler implements IOscHandler, IResetHandler { + + let blob: Blob | ImageData; + if (metrics.mime === 'image/qoi') { +- const data = this._qoiDec.decode(this._dec.data8); ++ let data: Uint8Array; ++ try { ++ data = this._qoiDec.decode(this._dec.data8); ++ } catch (e) { ++ console.warn('IIP: could not decode QOI image', e); ++ this._dec.release(); ++ this._qoiDec.release(); ++ return true; ++ } + blob = new ImageData( + new Uint8ClampedArray(data.buffer, data.byteOffset, data.byteLength), + this._qoiDec.width, +@@ -198,8 +215,13 @@ export class IIPHandler implements IOscHandler, IResetHandler { blob = new Blob([this._dec.data8], { type: metrics.mime }); } this._dec.release(); @@ -32,6 +85,25 @@ index 559b907416eb38318f439d060d7f89311ed34c7e..8541b4b0ea0d6b451aaae49007d69df6 this._storage.addImage(bm); return true; }) +@@ -209,6 +231,18 @@ export class IIPHandler implements IOscHandler, IResetHandler { + }); + } + ++ // Why: wasm memory exhaustion must drop this image, not throw out of the parser and wedge the write queue. ++ private _initDecoder(): boolean { ++ try { ++ this._dec.init(); ++ return true; ++ } catch (e) { ++ console.warn('IIP: could not allocate decoder', e); ++ this._dec.release(); ++ return false; ++ } ++ } ++ + private _resize(w: number, h: number): [number, number] { + const cw = this._renderer.dimensions?.css.cell.width || CELL_SIZE_DEFAULT.width; + const ch = this._renderer.dimensions?.css.cell.height || CELL_SIZE_DEFAULT.height; diff --git a/src/ImageAddon.ts b/src/ImageAddon.ts index 8fd39543118cd420e36c1614c1af370b6c7bbfbb..0c44d2a81642113417bf8dc10a4faa76d7cc5864 100644 --- a/src/ImageAddon.ts @@ -144,8 +216,156 @@ index 5854efaec1fdf9dfcb886023542998a563b6d2f2..3afaf9bd63ffd7a4cdf32bf0ac24cf33 } public get document(): Document | undefined { +diff --git a/src/SixelHandler.ts b/src/SixelHandler.ts +index 1af2d85bcdd541ed60b1e707f6186a91f1bbf1b2..0711a122ea43d5212a2851add9e744b65550ec85 100644 +--- a/src/SixelHandler.ts ++++ b/src/SixelHandler.ts +@@ -10,6 +10,7 @@ import { RGBA8888 } from 'sixel/lib/Types'; + import { ImageRenderer } from './ImageRenderer'; + + import { DecoderAsync, Decoder } from 'sixel/lib/Decoder'; ++import { LIMITS } from 'sixel/lib/wasm'; + + // always free decoder ressources after decoding if it exceeds this limit + const MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB +@@ -18,48 +19,88 @@ const MEM_PERMA_LIMIT = 4194304; // 1024 pixels * 1024 pixels * 4 channels = 4MB + const DEFAULT_PALETTE = PALETTE_ANSI_256; + DEFAULT_PALETTE.set(PALETTE_VT340_COLOR); + ++// Why pooled: every decoder owns a wasm memory, and V8 caps live wasm memories ++// per process (~124 in a sandboxed renderer). Terminals borrow a decoder only ++// while a SIXEL sequence is open, so idle terminals hold none. ++const MAX_IDLE_DECODERS = 2; ++const idleDecoders = new Map(); ++let poolPrimed = false; ++ ++function primeDecoderPool(memoryLimit: number): void { ++ if (poolPrimed) return; ++ poolPrimed = true; ++ // Async compile once, off the parser's hot path; later decoders reuse the cached module. ++ DecoderAsync({ memoryLimit, palette: DEFAULT_PALETTE }).then( ++ d => releaseDecoder(d, memoryLimit), ++ () => { poolPrimed = false; } ++ ); ++} ++ ++function acquireDecoder(memoryLimit: number): Decoder { ++ return idleDecoders.get(memoryLimit)?.pop() ?? new Decoder({ memoryLimit, palette: DEFAULT_PALETTE }); ++} ++ ++function releaseDecoder(dec: Decoder, memoryLimit: number): void { ++ if (dec.memoryUsage > MEM_PERMA_LIMIT) { ++ dec.release(); ++ } ++ const idle = idleDecoders.get(memoryLimit) ?? []; ++ if (idle.length < MAX_IDLE_DECODERS) { ++ idle.push(dec); ++ idleDecoders.set(memoryLimit, idle); ++ } ++} ++ + + export class SixelHandler implements IDcsHandler, IResetHandler { + private _size = 0; + private _aborted = false; + private _dec: Decoder | undefined; ++ private _decMemoryLimit = 0; ++ // Color registers outlive a single image, so they live here rather than in a pooled decoder. ++ private readonly _palette = new Uint32Array(LIMITS.PALETTE_SIZE); + + constructor( + private readonly _opts: IImageAddonOptions, + private readonly _storage: SixelImageStorage, + private readonly _coreTerminal: ITerminalExt + ) { +- DecoderAsync({ +- memoryLimit: this._opts.pixelLimit * 4, +- palette: DEFAULT_PALETTE, +- paletteLimit: this._opts.sixelPaletteLimit +- }).then(d => this._dec = d); ++ this._palette.set(DEFAULT_PALETTE); ++ primeDecoderPool(this._opts.pixelLimit * 4); + } + + public reset(): void { +- /** +- * reset sixel decoder to defaults: +- * - release all memory +- * - nullify palette (4096) +- * - apply default palette (256) +- */ +- if (this._dec) { +- this._dec.release(); +- // FIXME: missing interface on decoder to nullify full palette +- (this._dec as any)._palette.fill(0); +- this._dec.init(0, DEFAULT_PALETTE, this._opts.sixelPaletteLimit); +- } ++ this._returnDecoder(); ++ this._palette.fill(0); ++ this._palette.set(DEFAULT_PALETTE); + } + + public hook(params: IParams): void { + this._size = 0; + this._aborted = false; +- if (this._dec) { +- const fillColor = params.params[1] === 1 ? 0 : extractActiveBg( +- this._coreTerminal._core._inputHandler._curAttrData, +- this._coreTerminal._core._themeService?.colors); +- this._dec.init(fillColor, null, this._opts.sixelPaletteLimit); ++ this._returnDecoder(); ++ const memoryLimit = this._opts.pixelLimit * 4; ++ try { ++ this._dec = acquireDecoder(memoryLimit); ++ } catch (e) { ++ // Why: exhausting wasm memory must drop this image, not throw out of the parser and wedge the write queue. ++ console.warn(`SIXEL: could not allocate decoder - ${e}`); ++ this._aborted = true; ++ return; + } ++ this._decMemoryLimit = memoryLimit; ++ const fillColor = params.params[1] === 1 ? 0 : extractActiveBg( ++ this._coreTerminal._core._inputHandler._curAttrData, ++ this._coreTerminal._core._themeService?.colors); ++ this._dec.init(fillColor, this._palette, this._opts.sixelPaletteLimit); ++ } ++ ++ private _returnDecoder(): void { ++ const dec = this._dec; ++ if (!dec) return; ++ this._dec = undefined; ++ this._palette.set(dec.palette); ++ releaseDecoder(dec, this._decMemoryLimit); + } + + public put(data: Uint32Array, start: number, end: number): void { +@@ -83,6 +124,14 @@ export class SixelHandler implements IDcsHandler, IResetHandler { + } + + public unhook(success: boolean): boolean | Promise { ++ try { ++ return this._unhook(success); ++ } finally { ++ this._returnDecoder(); ++ } ++ } ++ ++ private _unhook(success: boolean): boolean { + if (this._aborted || !success || !this._dec) { + return true; + } +@@ -100,9 +149,6 @@ export class SixelHandler implements IDcsHandler, IResetHandler { + + const canvas = ImageRenderer.createCanvas(undefined, width, height); + canvas.getContext('2d')?.putImageData(new ImageData(this._dec.data8 as Uint8ClampedArray, width, height), 0, 0); +- if (this._dec.memoryUsage > MEM_PERMA_LIMIT) { +- this._dec.release(); +- } + this._storage.addImage(canvas); + return true; + } diff --git a/src/kitty/KittyGraphicsHandler.ts b/src/kitty/KittyGraphicsHandler.ts -index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1fa320c4f8 100644 +index de889dfff75d9ecc8ab47a025e6989ffe75bb202..cf66e5b75c78645b1641e53d1425d88201134f78 100644 --- a/src/kitty/KittyGraphicsHandler.ts +++ b/src/kitty/KittyGraphicsHandler.ts @@ -7,6 +7,7 @@ import { IDisposable } from '@xterm/xterm'; @@ -172,10 +392,12 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f this._cleanupAllPending(); if (this._activeDecoder) { this._activeDecoder.release(); -@@ -200,6 +203,25 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos +@@ -200,8 +203,38 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos this._activeDecoder = pending.decoder; } if (!this._activeDecoder) { +- this._activeDecoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes); +- this._activeDecoder.init(); + // Budget WASM capacity, including one page of decoder state and rounding. + const decoderCapacity = this._maxEncodedBytes + 131072; + if (decoderCapacity > this._opts.storageLimit * 1000000) { @@ -195,10 +417,23 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f + this._sendResponse(oldest[1].cmd.id, 'ENOMEM:pending image budget exceeded', oldest[1].cmd.quiet ?? 0); + } + } - this._activeDecoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes); - this._activeDecoder.init(); ++ const decoder = new Base64Decoder(Constants.DECODER_KEEP_DATA, this._maxEncodedBytes, this._initialEncodedBytes); ++ try { ++ decoder.init(); ++ } catch (e) { ++ // Why: wasm memory exhaustion must drop this image, not throw out of the parser and wedge the write queue. ++ console.warn('KITTY: could not allocate decoder', e); ++ this._aborted = true; ++ if (this._parsedCommand?.id !== undefined) { ++ this._sendResponse(this._parsedCommand.id, 'ENOMEM:could not allocate decoder', this._parsedCommand.quiet ?? 0); ++ } ++ return; ++ } ++ this._activeDecoder = decoder; } -@@ -550,9 +572,11 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos + + if (this._activeDecoder.put(data.subarray(start, end)) !== DECODER_OK) { +@@ -550,9 +583,11 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos } private async _decodeAndDisplay(image: IKittyImageData, cmd: IKittyCommand): Promise { @@ -210,7 +445,7 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f const cropX = Math.max(0, cmd.x ?? 0); const cropY = Math.max(0, cmd.y ?? 0); const cropW = cmd.sourceWidth || (bitmap.width - cropX); -@@ -660,6 +684,7 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos +@@ -660,6 +695,7 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos } } @@ -218,7 +453,7 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f const zIndex = cmd.zIndex ?? 0; this._kittyStorage.addImage(image.id, bitmap, true, layer, zIndex); bitmap = undefined; // ownership transferred to storage -@@ -693,6 +718,12 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos +@@ -693,6 +729,12 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos } if (image.format === KittyFormat.PNG) { @@ -231,7 +466,7 @@ index de889dfff75d9ecc8ab47a025e6989ffe75bb202..54ebea9c061e5bb92b187cab7a53bc1f const blob = new Blob([bytes as BlobPart], { type: 'image/png' }); if (!window.createImageBitmap) { const url = URL.createObjectURL(blob); -@@ -775,27 +806,45 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos +@@ -775,27 +817,45 @@ export class KittyGraphicsHandler implements IApcHandler, IResetHandler, IDispos private async _decompressZlib(compressed: Uint8Array): Promise { try { return await this._decompress(compressed, 'deflate'); diff --git a/config/scripts/xterm-image-wasm-budget-contract.test.mjs b/config/scripts/xterm-image-wasm-budget-contract.test.mjs new file mode 100644 index 000000000000..9ec5f4fc7509 --- /dev/null +++ b/config/scripts/xterm-image-wasm-budget-contract.test.mjs @@ -0,0 +1,160 @@ +import { createRequire } from 'node:module' +import { afterEach, describe, expect, it, vi } from 'vitest' + +const require = createRequire(import.meta.url) +const { Terminal } = require('@xterm/xterm') +const { ImageAddon } = require('@xterm/addon-image') + +// V8 caps live wasm memories per renderer (~124 under Electron's sandbox), so +// these contracts pin that idle terminals hold none and that exhaustion drops +// an image instead of wedging the terminal's write queue. + +const SIXEL_RED_REGISTER_1 = '\x1bPq#1;2;100;0;0#1~\x1b\\' +const SIXEL_USE_REGISTER_1 = '\x1bPq#1~\x1b\\' +const PNG_1X1 = + 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==' +const IIP_PNG = `\x1b]1337;File=inline=1;size=${Buffer.from(PNG_1X1, 'base64').length}:${PNG_1X1}\x07` + +class TrackedBitmap { + width = 1 + height = 1 + close = vi.fn() +} + +function stubCanvasGlobals() { + const painted = [] + vi.stubGlobal('ImageBitmap', TrackedBitmap) + vi.stubGlobal('window', { ImageBitmap: TrackedBitmap }) + vi.stubGlobal('createImageBitmap', async () => new TrackedBitmap()) + vi.stubGlobal( + 'ImageData', + class { + constructor(data, width, height) { + Object.assign(this, { data: new Uint8ClampedArray(data), width, height }) + } + } + ) + vi.stubGlobal('document', { + createElement: () => ({ + width: 0, + height: 0, + getContext: () => ({ putImageData: (image) => painted.push(image) }) + }) + }) + return painted +} + +function createTerminal(options = {}) { + const terminal = new Terminal({ allowProposedApi: true }) + const addon = new ImageAddon({ + enableSizeReports: false, + storageLimit: 32, + kittySizeLimit: 8 * 1024 * 1024, + ...options + }) + terminal.loadAddon(addon) + return { + terminal, + addon, + sixel: addon._handlers.get('sixel'), + iip: addon._handlers.get('iip') + } +} + +function write(terminal, data) { + return new Promise((resolve) => terminal.write(data, resolve)) +} + +// A throw out of a handler leaves xterm's write queue waiting forever. +function writeOrWedge(terminal, data) { + return Promise.race([ + write(terminal, data).then(() => 'parsed'), + new Promise((resolve) => setTimeout(() => resolve('wedged'), 2000)) + ]) +} + +function firstPixel(image) { + return Array.from(image.data.subarray(0, 4)) +} + +afterEach(() => vi.unstubAllGlobals()) + +describe('xterm image wasm budget', () => { + it('keeps idle terminals free of wasm decoders', async () => { + const panes = Array.from({ length: 300 }, () => createTerminal()) + try { + // Let any asynchronous decoder instantiation settle. + await new Promise((resolve) => setTimeout(resolve, 100)) + for (const { sixel, iip } of panes) { + expect(sixel._dec).toBeUndefined() + expect(iip._dec._inst).toBeNull() + expect(iip._qoiDec._inst).toBeFalsy() + } + } finally { + for (const { terminal } of panes) { + terminal.dispose() + } + } + }) + + it('returns decoders after each SIXEL and IIP image', async () => { + const painted = stubCanvasGlobals() + const { terminal, addon, sixel, iip } = createTerminal() + let added = 0 + addon.onImageAdded(() => added++) + try { + await write(terminal, SIXEL_RED_REGISTER_1) + expect(painted).toHaveLength(1) + expect(sixel._dec).toBeUndefined() + + await write(terminal, IIP_PNG) + await new Promise((resolve) => setTimeout(resolve, 0)) + expect(iip._dec._inst).toBeNull() + expect(added).toBe(2) + } finally { + terminal.dispose() + } + }) + + it('keeps SIXEL color registers across images until a terminal reset', async () => { + const painted = stubCanvasGlobals() + const { terminal } = createTerminal() + try { + await write(terminal, SIXEL_RED_REGISTER_1) + await write(terminal, SIXEL_USE_REGISTER_1) + expect(firstPixel(painted[1])).toEqual([255, 0, 0, 255]) + + await write(terminal, '\x1bc') + await write(terminal, SIXEL_USE_REGISTER_1) + expect(firstPixel(painted[2])).not.toEqual([255, 0, 0, 255]) + } finally { + terminal.dispose() + } + }) + + it('drops images without wedging the parser when wasm memory is exhausted', async () => { + stubCanvasGlobals() + // A pixelLimit no other test uses keeps the shared SIXEL pool empty for this key. + const { terminal, addon } = createTerminal({ pixelLimit: 1234567 }) + const replies = [] + terminal.onData((data) => replies.push(data)) + function exhausted() { + throw new RangeError('WebAssembly.Memory(): could not allocate memory') + } + vi.stubGlobal('WebAssembly', { ...WebAssembly, Memory: exhausted, Instance: exhausted }) + try { + expect(await writeOrWedge(terminal, '\x1b_Ga=T,f=32,s=1,v=1,i=7;AAAA/w==\x1b\\')).toBe( + 'parsed' + ) + expect(await writeOrWedge(terminal, IIP_PNG)).toBe('parsed') + expect(await writeOrWedge(terminal, SIXEL_USE_REGISTER_1)).toBe('parsed') + expect(await writeOrWedge(terminal, 'after')).toBe('parsed') + + expect(addon._storage._images.size).toBe(0) + expect(replies.join('')).toContain('ENOMEM') + expect(terminal.buffer.active.getLine(0).translateToString(true)).toContain('after') + } finally { + terminal.dispose() + } + }) +}) diff --git a/docs/reference/xterm-patch-regeneration.md b/docs/reference/xterm-patch-regeneration.md index d398f10a6bba..3197de33f20e 100644 --- a/docs/reference/xterm-patch-regeneration.md +++ b/docs/reference/xterm-patch-regeneration.md @@ -48,6 +48,15 @@ after reset, disable or disposal. `config/scripts/xterm-image-lifecycle-contract exercises those boundaries against the installed addon. Font zoom scales visible tiles without creating enlarged full-image canvases; `config/scripts/xterm-image-resize-contract.test.mjs` checks allocation and tile mapping. +Every wasm memory reserves its guard region inside V8's sandbox, which caps a +renderer at about 124 live memories no matter how much RAM is free. Upstream +gave each terminal a SIXEL decoder at activation and kept IIP decoders after the +first image, so a window with ~120+ terminals ran out. The patch borrows SIXEL +decoders from a small shared pool only while a sequence is open, keeping color +registers on the terminal, and drops IIP decoders after each image. A decoder +that cannot be allocated drops that image; before the patch it threw out of the +parser and left the terminal's write queue stuck. +`config/scripts/xterm-image-wasm-budget-contract.test.mjs` covers both. ## Rules diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 02422ea3f196..8b5c4b890d44 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,7 +111,7 @@ overrides: patchedDependencies: i18next-cli@1.74.2: 7955b89d3aa229f477408608d331f78c85148a85a85913729f89fac65ad8b207 '@vscode/windows-process-tree@0.8.0': b4be93859cefb159949d9cf05f97fa91a221dff0f793a6f03d02d78ae5b32035 - '@xterm/addon-image@0.10.0-beta.300': 5fc280019957573eefe8daa2969534d6090ddb29c6b5842b8f22e99dc1ce3146 + '@xterm/addon-image@0.10.0-beta.300': e5254a46d6f57bef4a8a19683bfa685afa0ca0127545aea53b54a48104ca3562 '@xterm/addon-ligatures@0.11.0-beta.300': 47405b9994b5acf1b4e90b49250358c1ca03649854d59560e7732b72fe336920 '@xterm/addon-search@0.17.0-beta.300': eee5338dd2621ece46e79c61ec06766cd7fadaf79ffdb24e2a8ab68e97ef31f0 '@xterm/addon-serialize@0.15.0-beta.300': b35533fe252e7e45433150170348889f4e08a6c17f7017ac34ea694d831fec7f @@ -331,7 +331,7 @@ importers: version: 0.12.0-beta.300(@xterm/xterm@6.1.0-beta.303(patch_hash=dd0ccc59cd1ccf99f4d76e5aa2456da165fa0804dce19a833d7638bd07ffa393)) '@xterm/addon-image': specifier: 0.10.0-beta.300 - version: 0.10.0-beta.300(patch_hash=5fc280019957573eefe8daa2969534d6090ddb29c6b5842b8f22e99dc1ce3146)(@xterm/xterm@6.1.0-beta.303(patch_hash=dd0ccc59cd1ccf99f4d76e5aa2456da165fa0804dce19a833d7638bd07ffa393)) + version: 0.10.0-beta.300(patch_hash=e5254a46d6f57bef4a8a19683bfa685afa0ca0127545aea53b54a48104ca3562)(@xterm/xterm@6.1.0-beta.303(patch_hash=dd0ccc59cd1ccf99f4d76e5aa2456da165fa0804dce19a833d7638bd07ffa393)) '@xterm/addon-ligatures': specifier: 0.11.0-beta.300 version: 0.11.0-beta.300(patch_hash=47405b9994b5acf1b4e90b49250358c1ca03649854d59560e7732b72fe336920)(@xterm/xterm@6.1.0-beta.303(patch_hash=dd0ccc59cd1ccf99f4d76e5aa2456da165fa0804dce19a833d7638bd07ffa393)) @@ -10744,7 +10744,7 @@ snapshots: dependencies: '@xterm/xterm': 6.1.0-beta.303(patch_hash=dd0ccc59cd1ccf99f4d76e5aa2456da165fa0804dce19a833d7638bd07ffa393) - '@xterm/addon-image@0.10.0-beta.300(patch_hash=5fc280019957573eefe8daa2969534d6090ddb29c6b5842b8f22e99dc1ce3146)(@xterm/xterm@6.1.0-beta.303(patch_hash=dd0ccc59cd1ccf99f4d76e5aa2456da165fa0804dce19a833d7638bd07ffa393))': + '@xterm/addon-image@0.10.0-beta.300(patch_hash=e5254a46d6f57bef4a8a19683bfa685afa0ca0127545aea53b54a48104ca3562)(@xterm/xterm@6.1.0-beta.303(patch_hash=dd0ccc59cd1ccf99f4d76e5aa2456da165fa0804dce19a833d7638bd07ffa393))': dependencies: '@xterm/xterm': 6.1.0-beta.303(patch_hash=dd0ccc59cd1ccf99f4d76e5aa2456da165fa0804dce19a833d7638bd07ffa393) From 6e1b7e7fa314362a039829b34fb72d96df1be861 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 29 Sep 2026 01:21:53 -0700 Subject: [PATCH 87/90] test: remove junk tests that assert source text instead of behavior (#23815) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deletes 101 test files and trims 112 more, all matching documented junk patterns: exact source/import/string greps, copied inventories and export lists, duplicate invocations of a contract another test already owns, typeof-shape checks TypeScript already enforces, and self-comparisons. The largest group read a production `.ts` file and asserted on its text — for example a TaskPage test that required the source to contain `selectedRepos.find((r) => r.id === newIssueRepoId) ?? selectedRepos[0] ?? null`. Any behavior-preserving rename broke it; no behavior change ever did. Production-side follow-through: exports that only these tests imported are de-exported or deleted, stale comments pointing at removed censuses are dropped, and the reliability-gate registry, `cloud/package.json` test lists, and orphaned source-reading helpers are updated so nothing references a deleted file. Two files kept their real coverage and lost only the census scaffolding: `agent-status-producer-census.test.ts` now drives all five producers end to end instead of grepping the source tree, and `config-toml-trust-stale-writes` replaces an export-list parity check. --- cloud/apps/relay/src/assignment-store.ts | 2 +- .../src/cell-inventory-lock-census.test.ts | 335 --------- .../cell-inventory-lock-contention.test.ts | 30 - ...production-cloud-sql-rollout-lock.test.mjs | 28 - .../scripts/push-gateway-workflow.test.mjs | 5 - .../scripts/push-validation-workflow.test.mjs | 48 -- .../relay-asia-admission-workflow.test.mjs | 375 ---------- .../relay-regional-rehome-workflow.test.mjs | 269 ------- .../relay-same-cap-script-census.test.mjs | 108 --- cloud/package.json | 4 +- config/reliability-gates.jsonc | 31 +- .../scripts/bun-profile-change-scope.test.mjs | 4 +- config/scripts/ci-shard-timings.json | 1 - .../cli-main-module-bundle-parity.test.ts | 91 --- ...t-hosted-browser-package-coverage.test.mjs | 7 - config/scripts/computer-e2e-workflow.test.mjs | 286 -------- .../electron-vite-output-contract.test.ts | 10 - .../headless-serve-shutdown-workflow.test.mjs | 171 ----- .../mobile-web-app-route-manifest.test.mjs | 22 +- ...package-electron-runtime-contract.test.mjs | 564 --------------- ...ged-hang-watchdog-worker-contract.test.mjs | 37 - .../scripts/pr-workflow-lint-parity.test.mjs | 86 --- .../scripts/ssh-docker-ci-sharding.test.mjs | 20 - .../terminal-ime-e2e-workflow.test.mjs | 32 - .../verify-dev-channel-packaging.test.mjs | 13 - .../scripts/win-crash-survival-e2e.test.mjs | 36 +- .../windows-process-tree-gyp-path.test.mjs | 32 +- ...ws-pty-native-capability-workflow.test.mjs | 87 --- ...windows-signing-workflow-contract.test.mjs | 498 ------------- .../accounts/mobile-accounts-route.test.ts | 13 - .../mobile-browser-pane-source.test.ts | 27 - .../mobile-agent-icon-assets.test.ts | 11 +- .../files/files-router-seam-census.test.ts | 35 - .../home-host-edit-navigation-source.test.ts | 11 - .../hooks/use-mobile-dictation-source.test.ts | 97 --- .../host-route-href-encoding.test.ts | 76 -- .../MobileWebShellScreen.test.tsx | 18 - .../bridge-client-frame-cap-boundary.test.ts | 16 - .../bridge-client-frame-cap-unit.test.ts | 14 - .../bridge/bridge-envelope.test.ts | 92 +-- ...age-first-paint-through-the-bridge.test.ts | 19 - .../mobile-web-shell-flag-census.test.ts | 207 ------ ...obile-web-shell-router-seam-census.test.ts | 94 --- .../mobile-web-shell-screen-test-harness.tsx | 2 +- .../shell-older-page-paths-census.test.ts | 89 --- .../shell-screen-route-census.test.ts | 278 -------- .../shell-view-surface.test.ts | 44 -- .../desktop-notification-channel.test.ts | 13 - .../notification-route-coordination.test.ts | 17 - .../keyboard-geometry-host-os-census.test.ts | 69 -- .../keyboard-geometry-owner-census.test.ts | 38 - .../microphone-screen-lock-census.test.ts | 104 --- ...ent-send-keyboard-dismissal-wiring.test.ts | 212 ------ .../session/mobile-native-chat-noise.test.ts | 1 + .../mobile-session-last-tab-close.test.ts | 43 -- .../mobile-session-route-parity.test.ts | 669 ------------------ ...ession-route-source-family.test-support.ts | 69 -- .../src/session/mobile-session-route.test.ts | 19 - .../mobile-session-startup-source.test.ts | 295 -------- ...uick-commands-tab-stability-source.test.ts | 67 -- .../session-router-seam-census.test.ts | 79 --- ...rminal-field-submit-binding-wiring.test.ts | 66 -- .../source-control/mobile-pr-create.test.ts | 26 - .../source-control-router-seam-census.test.ts | 44 -- .../mobile-tasks-refactor-parity.test.ts | 158 ----- .../document-parse-time-effects.test.ts | 52 -- .../src/terminal/document/host-seams.test.ts | 35 - .../terminal/terminal-cell-box-census.test.ts | 62 -- .../terminal-foreground-recovery.test.ts | 44 -- .../terminal-input-connection-gate.test.ts | 91 +-- .../terminal-ios-dictation-write-back.test.ts | 23 - .../terminal-ios-ime-keyboard.test.ts | 23 - ...erminal-keyboard-avoidance-webview.test.ts | 40 -- .../terminal-live-input-affordance.test.ts | 73 -- .../terminal/terminal-viewport-refit.test.ts | 194 +---- .../terminal-webview-consumer-census.test.ts | 85 --- .../terminal/terminal-webview-engine.test.ts | 61 -- .../terminal-webview-query-reply.test.ts | 32 - .../terminal/terminal-webview-reflow.test.ts | 62 -- .../terminal-webview-scroll-routing.test.ts | 258 ------- .../terminal-webview-text-zoom.test.ts | 80 --- ...erminal-write-coalescer-boundaries.test.ts | 79 --- .../bridged-parity/c2-page-closure.test.ts | 235 ------ .../bridged-parity/c3-page-closure.test.ts | 222 ------ .../test-support/census-source-files.test.ts | 34 +- .../src/test-support/rpc-recording/README.md | 16 +- .../native-mounting-substitutes.test.ts | 1 - .../operation-module-loader.test.ts | 2 - .../test-support/webview-document-census.ts | 6 +- .../paired-host-writer-census.test.ts | 39 - .../transport/timer-receiver-census.test.ts | 126 ---- .../unchecked-rpc-reader-boundary.test.ts | 5 - mobile/src/worktree/home-resume-card.test.ts | 11 - mobile/tests-typecheck-baseline.txt | 1 - src/cli/cli-command-name-parity.test.ts | 25 - src/cli/dispatch.ts | 3 +- src/cli/handler-group-manifest.test.ts | 30 - .../orchestration-timeout-cli.test.ts | 288 -------- .../handlers/orchestration-timeout.test.ts | 292 -------- src/cli/handlers/orchestration.test.ts | 127 +++- src/cli/registry-parity.test.ts | 46 -- src/cli/registry-parity.ts | 21 - src/cli/runtime-client-deferral.test.ts | 37 +- src/cli/serve-electron-flag-parity.test.ts | 31 +- .../wsl-hook-relay-sentinel.test.ts | 2 - .../session-search-host-registration.test.ts | 31 - ...r-session-registry-import-boundary.test.ts | 12 - .../claude-account-service-api-parity.test.ts | 31 +- .../claude-agent-sdk-import-boundary.test.ts | 110 +-- ...x-trust-grant-main-thread-boundary.test.ts | 60 -- ...=> config-toml-trust-stale-writes.test.ts} | 44 +- .../gpu-crash-diagnostics.test.ts | 28 - .../gpu-crash-fallback-field-sessions.test.ts | 114 +-- .../gpu-fallback-recovered-launch.test.ts | 21 - .../work-item-details-api-parity.test.ts | 37 - ...omation-dispatcher-source-boundary.test.ts | 22 - src/main/ipc/filesystem-watcher-real.test.ts | 9 - .../ipc/github-ipc-channel-parity.test.ts | 110 --- .../pty-spawn-shell-override-parity.test.ts | 26 - .../pi/titlebar-extension-service.test.ts | 4 - .../ports/port-scan-command-client.test.ts | 12 - .../port-scan-command-import-boundary.test.ts | 18 - .../settled-pty-writer-census.test.ts | 94 --- .../providers/ssh-filesystem-provider.test.ts | 12 - ...uit-teardown-agent-browser-daemons.test.ts | 33 - .../minimax/minimax-fetcher.test.ts | 58 +- .../agent-session-launch-env-backfill.test.ts | 89 --- ...gent-startup-input-assembly-census.test.ts | 56 -- ...osted-browser-row-hydration-census.test.ts | 63 -- .../agent-status-producer-census.test.ts | 130 +--- .../rpc/terminal-stream-byte-length.test.ts | 102 --- ...ructured-claude-auth-policy-wiring.test.ts | 24 +- .../ssh/relay-protocol-backpressure.test.ts | 297 -------- src/main/ssh/ssh-system-fallback.test.ts | 8 - src/main/startup/configure-process.test.ts | 35 +- src/main/startup/secure-dns-census.test.ts | 10 - ...updater-test-harness.leaked-timers.test.ts | 123 ---- .../usage/usage-scan-worker-client.test.ts | 13 - src/relay/relay-watcher-event-emitter.test.ts | 9 - .../workspace-view-cross-client-sync.test.tsx | 75 +- .../src/components/AgentStateDot.test.ts | 10 +- .../automation-scoped-list-client.test.ts | 3 +- .../BrowserAnnotationSendMenuContent.test.tsx | 17 - .../BrowserPane.remote-link-routing.test.ts | 25 - .../BrowserPane.render-ipc.test.ts | 19 - ...-client-page-metadata-route-census.test.ts | 43 -- .../browser-guest-paint-retention.ts | 1 - ...rowser-guest-retention-site-census.test.ts | 223 ------ ...nfirmation-dialog-refresh-boundary.test.ts | 22 - ...ture-interaction-writer-boundaries.test.ts | 323 --------- ...github-item-dialog-source-boundary.test.ts | 310 -------- .../repro-8784-ghe-avatar-fallback.test.ts | 85 --- .../linear-issue-workspace-api-parity.test.ts | 49 -- .../linear-issue-workspace-header.test.ts | 30 - ...StructuredSession.transport-probe.test.tsx | 377 ---------- .../native-chat-composer-containment.test.ts | 33 - .../native-chat/native-chat-noise.test.ts | 56 -- ...ourceControl.host-context-boundary.test.ts | 111 --- .../ai-vault-session-refresh.test.ts | 7 - .../components/settings/GeneralPane.test.ts | 31 - ...rktreeDialog.host-context-boundary.test.ts | 34 - .../sidebar/StatusIndicator.test.ts | 10 +- .../sidebar/project-group-header-dom.test.ts | 63 -- .../sidebar/worktree-keyboard-cycle.test.ts | 26 - .../worktree-list/grouping/build-rows.test.ts | 51 -- .../PetStatusSegment.layout.test.ts | 15 - ...urce-session-classification-parity.test.ts | 52 -- ...pace-space-manager-source-boundary.test.ts | 79 --- ...hosted-browser-row-strip-placement.test.ts | 42 -- ...urface.client-hosted-active-state.test.tsx | 20 - .../task-drawer-source-boundary.test.ts | 108 --- .../task-page-github-issue-creation.test.ts | 53 -- .../task-page-source-family.test-support.ts | 39 - .../task-page-source-switch-boundary.test.ts | 99 --- .../task-page-task-creation-drafts.test.ts | 103 --- ...k-page-workspace-composer-boundary.test.ts | 136 ---- ...erminal-pane-listener-order-parity.test.ts | 94 --- ...al-close-confirm-keyboard-vs-mouse.test.ts | 24 - ...inal-provider-snapshot-capability.test.tsx | 17 - ...ktree-jump-palette-sleeping-filter.test.ts | 26 - ...mp-palette-source-context-boundary.test.ts | 37 - ...rktree-jump-palette-source.test-support.ts | 6 - ...ace-session-merge-close-tombstones.test.ts | 13 - ...poserState-host-context-boundaries.test.ts | 593 ---------------- .../useSettingsNavigationMetadata.test.ts | 40 -- ...agent-launch-caller-profile-census.test.ts | 91 --- ...ent-launch-caller-profiles-test-harness.ts | 140 +--- ...agent-launch-routing-caller-census.test.ts | 86 --- .../non-secure-context-crypto.repro.test.ts | 17 +- .../react-commit-cascade-telemetry.test.ts | 2 - ...uctured-agent-startup-label-census.test.ts | 28 - .../workspace-emoji-shortcodes.lazy.test.ts | 9 - ...reation-flow-agent-trust-preflight.test.ts | 32 - ...rktree-status-spinner-launch-agent.test.ts | 12 - ...browser-workspace-tab-close-census.test.ts | 197 ------ .../host-session-mirror-settle-census.test.ts | 256 ------- .../src/runtime/remote-server-parity.test.ts | 44 -- .../runtime-host-contact-parity.test.ts | 70 +- .../store/slices/github-pr-comments.test.ts | 56 -- .../github-work-items-query-bounds.test.ts | 25 - .../store/slices/linear-invalidation.test.ts | 29 - .../slices/repo-identity-reconcile.test.ts | 3 - .../runtime-host-status-entry-parity.test.ts | 56 -- .../web-runtime-client-export-parity.test.ts | 18 - .../child-process-import-boundary.test.ts | 27 - .../emoji-shortcode-catalog.lazy.test.ts | 35 - src/shared/network/manual-address.test.ts | 8 - .../pane-agent-identity-inventory.test.ts | 488 ------------- ...e-agent-identity-surface-inventory.test.ts | 284 -------- src/shared/priority-semaphore.test.ts | 30 - .../runtime-client-export-parity.test.ts | 242 ------- .../run.test.mjs | 11 - 212 files changed, 201 insertions(+), 16828 deletions(-) delete mode 100644 cloud/apps/relay/src/cell-inventory-lock-census.test.ts delete mode 100644 cloud/dev/scripts/push-validation-workflow.test.mjs delete mode 100644 cloud/dev/scripts/relay-asia-admission-workflow.test.mjs delete mode 100644 cloud/dev/scripts/relay-regional-rehome-workflow.test.mjs delete mode 100644 config/scripts/cli-main-module-bundle-parity.test.ts delete mode 100644 config/scripts/packaged-hang-watchdog-worker-contract.test.mjs delete mode 100644 config/scripts/pr-workflow-lint-parity.test.mjs delete mode 100644 config/scripts/windows-pty-native-capability-workflow.test.mjs delete mode 100644 config/scripts/windows-signing-workflow-contract.test.mjs delete mode 100644 mobile/src/browser/mobile-browser-pane-source.test.ts delete mode 100644 mobile/src/files/files-router-seam-census.test.ts delete mode 100644 mobile/src/home-host-edit-navigation-source.test.ts delete mode 100644 mobile/src/hooks/use-mobile-dictation-source.test.ts delete mode 100644 mobile/src/host-screen/host-route-href-encoding.test.ts delete mode 100644 mobile/src/mobile-web-shell/mobile-web-shell-flag-census.test.ts delete mode 100644 mobile/src/mobile-web-shell/mobile-web-shell-router-seam-census.test.ts delete mode 100644 mobile/src/mobile-web-shell/shell-older-page-paths-census.test.ts delete mode 100644 mobile/src/mobile-web-shell/shell-screen-route-census.test.ts delete mode 100644 mobile/src/mobile-web-shell/shell-view-surface.test.ts delete mode 100644 mobile/src/platform/keyboard-geometry-host-os-census.test.ts delete mode 100644 mobile/src/platform/keyboard-geometry-owner-census.test.ts delete mode 100644 mobile/src/platform/microphone-screen-lock-census.test.ts delete mode 100644 mobile/src/session/agent-send-keyboard-dismissal-wiring.test.ts delete mode 100644 mobile/src/session/mobile-session-last-tab-close.test.ts delete mode 100644 mobile/src/session/mobile-session-route-parity.test.ts delete mode 100644 mobile/src/session/mobile-session-route-source-family.test-support.ts delete mode 100644 mobile/src/session/mobile-session-startup-source.test.ts delete mode 100644 mobile/src/session/quick-commands-tab-stability-source.test.ts delete mode 100644 mobile/src/session/session-router-seam-census.test.ts delete mode 100644 mobile/src/session/terminal-field-submit-binding-wiring.test.ts delete mode 100644 mobile/src/source-control/source-control-router-seam-census.test.ts delete mode 100644 mobile/src/tasks/mobile-tasks-refactor-parity.test.ts delete mode 100644 mobile/src/terminal/terminal-cell-box-census.test.ts delete mode 100644 mobile/src/terminal/terminal-ios-dictation-write-back.test.ts delete mode 100644 mobile/src/terminal/terminal-ios-ime-keyboard.test.ts delete mode 100644 mobile/src/terminal/terminal-live-input-affordance.test.ts delete mode 100644 mobile/src/terminal/terminal-webview-consumer-census.test.ts delete mode 100644 mobile/src/terminal/terminal-webview-reflow.test.ts delete mode 100644 mobile/src/terminal/terminal-webview-scroll-routing.test.ts delete mode 100644 mobile/src/test-support/bridged-parity/c2-page-closure.test.ts delete mode 100644 mobile/src/test-support/bridged-parity/c3-page-closure.test.ts delete mode 100644 mobile/src/transport/paired-host-writer-census.test.ts delete mode 100644 mobile/src/transport/timer-receiver-census.test.ts delete mode 100644 src/cli/cli-command-name-parity.test.ts delete mode 100644 src/cli/handlers/orchestration-timeout-cli.test.ts delete mode 100644 src/cli/handlers/orchestration-timeout.test.ts delete mode 100644 src/cli/registry-parity.test.ts delete mode 100644 src/cli/registry-parity.ts delete mode 100644 src/main/browser/browser-session-registry-import-boundary.test.ts delete mode 100644 src/main/codex/codex-trust-grant-main-thread-boundary.test.ts rename src/main/codex/{config-toml-trust-api-parity.test.ts => config-toml-trust-stale-writes.test.ts} (59%) delete mode 100644 src/main/github/work-item-details-api-parity.test.ts delete mode 100644 src/main/headless-automation-dispatcher-source-boundary.test.ts delete mode 100644 src/main/ipc/github-ipc-channel-parity.test.ts delete mode 100644 src/main/ipc/pty/pty-spawn-shell-override-parity.test.ts delete mode 100644 src/main/ports/port-scan-command-import-boundary.test.ts delete mode 100644 src/main/providers/settled-pty-writer-census.test.ts delete mode 100644 src/main/quit-teardown-agent-browser-daemons.test.ts delete mode 100644 src/main/runtime/agent-session-launch-env-backfill.test.ts delete mode 100644 src/main/runtime/agent-startup-input-assembly-census.test.ts delete mode 100644 src/main/runtime/client-hosted-browser-row-hydration-census.test.ts delete mode 100644 src/main/ssh/relay-protocol-backpressure.test.ts delete mode 100644 src/main/updater-test-harness.leaked-timers.test.ts delete mode 100644 src/renderer/src/components/browser-pane/assemble-chrome/BrowserPane.remote-link-routing.test.ts delete mode 100644 src/renderer/src/components/browser-pane/assemble-chrome/BrowserPane.render-ipc.test.ts delete mode 100644 src/renderer/src/components/browser-pane/browser-client-page-metadata-route-census.test.ts delete mode 100644 src/renderer/src/components/browser-pane/host-guest/browser-guest-retention-site-census.test.ts delete mode 100644 src/renderer/src/components/feature-interaction-writer-boundaries.test.ts delete mode 100644 src/renderer/src/components/github-item-dialog-source-boundary.test.ts delete mode 100644 src/renderer/src/components/linear-issue-workspace-api-parity.test.ts delete mode 100644 src/renderer/src/components/linear-issue-workspace-header.test.ts delete mode 100644 src/renderer/src/components/native-chat/NativeChatStructuredSession.transport-probe.test.tsx delete mode 100644 src/renderer/src/components/native-chat/native-chat-composer-containment.test.ts delete mode 100644 src/renderer/src/components/native-chat/native-chat-noise.test.ts delete mode 100644 src/renderer/src/components/right-sidebar/SourceControl.host-context-boundary.test.ts delete mode 100644 src/renderer/src/components/sidebar/DeleteWorktreeDialog.host-context-boundary.test.ts delete mode 100644 src/renderer/src/components/sidebar/project-group-header-dom.test.ts delete mode 100644 src/renderer/src/components/status-bar/PetStatusSegment.layout.test.ts delete mode 100644 src/renderer/src/components/status-bar/resource-session-classification-parity.test.ts delete mode 100644 src/renderer/src/components/status-bar/workspace-space-manager-source-boundary.test.ts delete mode 100644 src/renderer/src/components/task-drawer-source-boundary.test.ts delete mode 100644 src/renderer/src/components/task-page-github-issue-creation.test.ts delete mode 100644 src/renderer/src/components/task-page-source-family.test-support.ts delete mode 100644 src/renderer/src/components/task-page-source-switch-boundary.test.ts delete mode 100644 src/renderer/src/components/task-page-task-creation-drafts.test.ts delete mode 100644 src/renderer/src/components/task-page-workspace-composer-boundary.test.ts delete mode 100644 src/renderer/src/components/terminal-pane/terminal-pane-listener-order-parity.test.ts delete mode 100644 src/renderer/src/components/worktree-jump-palette-source-context-boundary.test.ts delete mode 100644 src/renderer/src/components/worktree-jump-palette-source.test-support.ts delete mode 100644 src/renderer/src/lib/agent-launch-caller-profile-census.test.ts delete mode 100644 src/renderer/src/lib/agent-launch-routing-caller-census.test.ts delete mode 100644 src/renderer/src/lib/structured-agent-startup-label-census.test.ts delete mode 100644 src/renderer/src/lib/worktree-creation-flow-agent-trust-preflight.test.ts delete mode 100644 src/renderer/src/runtime/browser-workspace-tab-close-census.test.ts delete mode 100644 src/renderer/src/runtime/host-session-mirror-settle-census.test.ts delete mode 100644 src/renderer/src/store/slices/github-work-items-query-bounds.test.ts delete mode 100644 src/renderer/src/store/slices/runtime-host-status-entry-parity.test.ts delete mode 100644 src/renderer/src/web/web-runtime-client-export-parity.test.ts delete mode 100644 src/shared/pane-agent-identity-inventory.test.ts delete mode 100644 src/shared/pane-agent-identity-surface-inventory.test.ts delete mode 100644 src/shared/runtime-client-export-parity.test.ts diff --git a/cloud/apps/relay/src/assignment-store.ts b/cloud/apps/relay/src/assignment-store.ts index 3572a69299cc..9a5cd9d4165c 100644 --- a/cloud/apps/relay/src/assignment-store.ts +++ b/cloud/apps/relay/src/assignment-store.ts @@ -8482,7 +8482,7 @@ function isDatabaseLockUnavailable(error: unknown): boolean { return error instanceof Error && error.message === 'database_lock_unavailable' } -export function cellInventoryLockOptions(mode: CellInventoryLockMode): RelayLockOptions { +function cellInventoryLockOptions(mode: CellInventoryLockMode): RelayLockOptions { if (mode === 'nowait') return { failIfUnavailable: true, measureHoldMs: true } if (mode === 'pool-default') return { measureHoldMs: true } return { lockTimeoutMs: CELL_INVENTORY_LOCK_TIMEOUT_MS, measureHoldMs: true } diff --git a/cloud/apps/relay/src/cell-inventory-lock-census.test.ts b/cloud/apps/relay/src/cell-inventory-lock-census.test.ts deleted file mode 100644 index e26d8d0551e6..000000000000 --- a/cloud/apps/relay/src/cell-inventory-lock-census.test.ts +++ /dev/null @@ -1,335 +0,0 @@ -import { readFileSync } from 'node:fs' -import { describe, expect, it } from 'vitest' -import { cellInventoryLockOptions, type CellInventoryLockMode } from './assignment-store.js' - -// Which entry points can reach a call site. A site a sweep can enter must never -// take the bounded wait: its 55P03 becomes a terminal transaction failure, and -// the incident monitor freezes on a single one. -type Reachability = 'request' | 'sweep' | 'both' | 'orphan' - -// 'caller' is not a CellInventoryLockMode: those sites take the mode threaded -// from `assign`, which is 'request' for a client and 'pool-default' for the -// evacuateDeadCells sweep. -type CensusMode = CellInventoryLockMode | 'caller' - -type CensusEntry = { method: string; mode: CensusMode; reach: Reachability } - -// Every lockCellInventory / lockGeneralCellInventory call site in -// assignment-store.ts, in source order. A new site fails this test until it is -// classified here, which is the point. -const CENSUS: CensusEntry[] = [ - // assignStickyOnce is gone from this list: its retry now locks only the row - // the host is pinned to (lockCellRows), which is what a sticky refresh - // touches. Placement below is the one genuinely fleet-wide decision left. - { method: 'assignOnce', mode: 'caller', reach: 'both' }, - { method: 'assignOnce', mode: 'caller', reach: 'both' }, - { method: 'assignOnce', mode: 'nowait', reach: 'both' }, - { method: 'assignOnce', mode: 'nowait', reach: 'both' }, - { method: 'assignOnce', mode: 'nowait', reach: 'both' }, - { method: 'refreshDrainMigrationLeasesOnce', mode: 'request', reach: 'request' }, - // changeActivity, acquireActivity, activateControl and - // removeSupersededSameCellControls no longer take the inventory: they lock - // only the one or two cell rows they touch, in cell_id order (lockCellRows), - // so they cannot cycle with placement's ordered inventory lock, and the - // 23-row lock there had serialised every reconnect in the fleet behind every - // other one. The control accept path went one step further and takes no cell - // read lock at all: its single conditional write is the last statement before - // COMMIT. - { method: 'startEvacuation', mode: 'request', reach: 'request' }, - { method: 'completeEvacuationFromDeadSourceOnce', mode: 'request', reach: 'request' }, - { method: 'completeEvacuationFromDeadSourceOnce', mode: 'nowait', reach: 'request' }, - { method: 'supersedeRegisteredEvacuationOnce', mode: 'request', reach: 'request' }, - { method: 'supersedeRegisteredEvacuationOnce', mode: 'nowait', reach: 'request' }, - { method: 'prepareRegisteredCellSupersession', mode: 'request', reach: 'request' }, - { method: 'prepareRegisteredCellSupersession', mode: 'request', reach: 'request' }, - { method: 'completeEvacuation', mode: 'nowait', reach: 'both' }, - { method: 'completeEvacuation', mode: 'pool-default', reach: 'both' }, - { method: 'rebalanceDormant', mode: 'request', reach: 'request' }, - // startRegionalRehomeCandidate is gone: the rehome commit reads the inventory - // unlocked and locks only its target row, NOWAIT, as the statement before - // COMMIT (reserveRegionalRehomeTargetRow below). - { method: 'completeRegionalRehomeCandidate', mode: 'nowait', reach: 'sweep' }, - // Both regional-rehome abort sweeps share this rollback; only the 24-hour - // one also disables the durable switch. - { method: 'rollBackStalledRegionalRehomes', mode: 'nowait', reach: 'sweep' }, - { method: 'abortExpiredEvacuations', mode: 'nowait', reach: 'sweep' }, - { method: 'abortExpiredEvacuations', mode: 'nowait', reach: 'sweep' }, - { method: 'releaseExpiredActivityLeases', mode: 'nowait', reach: 'sweep' }, - { method: 'releaseExpiredActivity', mode: 'nowait', reach: 'sweep' } - // reconcileReservationAccounting and leastLoadedCell are gone too: the first - // repairs exactly two cells' counters and now holds only those rows, and the - // second selects from the inventory its single caller has already locked. -] - -// Every inline `FROM relay_cells ... FOR UPDATE` outside the named lock helpers, -// in source order: whole-table locks in reconciliation and sticky placement, -// and single-row locks for a cell the method is already scoped to (heartbeat, -// fence, drain generation, configuration, or a reservation adjust that runs -// under a lock its caller already holds). A new inline lock fails the census -// below until it is listed here; per-connection paths that touch more than one -// cell go through lockCellRows so the order is fixed. -const NAMED_LOCK_HELPERS = ['lockCellInventory', 'lockGeneralCellInventory', 'lockCellRows'] - -const INLINE_CELL_LOCK_SITES = [ - 'reconcileCellsWithOptions', - 'assignStickyOnce', - 'recordCellHeartbeat', - 'attestCellFence', - 'adoptLegacyCellFence', - 'commitLegacyCellFenceAdoption', - 'prepareCellFenceAttempt', - 'attestCellFenceAttempt', - 'attestCellFenceAttempt', - 'configureCell', - 'reserveRegionalRehomeTargetRow', - 'assertDrainCellGeneration', - 'adjustCellReservation' -] - -// The background sweeps, and nothing else. A method reachable from one of these -// can be entered by a sweep tick, whatever else can also enter it. Both lists are -// read from source, so a new sweep step or a new route widens the derivation here -// instead of silently widening what a bounded wait can be entered from. -const SWEEP_ENTRY_FILES = ['./assignment-cleanup-steps.ts', './regional-rehome-worker.ts'] -const REQUEST_ENTRY_FILES = [ - './app.ts', - './relay-server.ts', - './host-session-registry.ts', - './cell-admission-startup.ts' -] - -const DECLARATION = /^ {2}(?:private |public )?(?:static )?(?:async )?([A-Za-z_][\w]*)[(<]/ - -function storeSource(): string[] { - return readFileSync(new URL('./assignment-store.ts', import.meta.url), 'utf8').split('\n') -} - -function entryPoints(files: string[]): string[] { - return files.flatMap((file) => - [ - ...readFileSync(new URL(file, import.meta.url), 'utf8').matchAll( - /assignments\.([A-Za-z_][\w]*)\(/g - ) - ].map((call) => call[1]!) - ) -} - -// Same-class call graph: store methods only ever reach each other through `this.`. -function storeCallGraph(lines: string[]): Map> { - const bounds: { name: string; start: number }[] = [] - lines.forEach((line, index) => { - const declaration = DECLARATION.exec(line) - if (declaration) bounds.push({ name: declaration[1]!, start: index }) - }) - const callees = new Map>() - bounds.forEach((method, index) => { - const end = bounds[index + 1]?.start ?? lines.length - const names = callees.get(method.name) ?? new Set() - for (const call of lines - .slice(method.start, end) - .join('\n') - .matchAll(/this\.([A-Za-z_][\w]*)\s*\(/g)) { - names.add(call[1]!) - } - callees.set(method.name, names) - }) - return callees -} - -function closure(callees: Map>, roots: string[]): Set { - const reached = new Set() - const pending = [...roots] - while (pending.length > 0) { - const name = pending.pop()! - if (reached.has(name)) continue - reached.add(name) - for (const callee of callees.get(name) ?? []) if (!reached.has(callee)) pending.push(callee) - } - return reached -} - -// Why: a hand-written reachability column is a claim, not a check. Derive both -// directions, so a new sweep edge into a bounded site fails here instead of in -// production, and so 'sweep' and 'both' stop being asserted by hand. -function derivedReachability(lines: string[]): (method: string) => Reachability { - const callees = storeCallGraph(lines) - const sweep = closure(callees, entryPoints(SWEEP_ENTRY_FILES)) - const request = closure(callees, entryPoints(REQUEST_ENTRY_FILES)) - return (method) => - sweep.has(method) - ? request.has(method) - ? 'both' - : 'sweep' - : request.has(method) - ? 'request' - : 'orphan' -} - -function readCallSites(): { method: string; mode: CensusMode }[] { - const sites: { method: string; mode: CensusMode }[] = [] - let method = '' - for (const line of storeSource()) { - const declaration = DECLARATION.exec(line) - if (declaration) method = declaration[1]! - if (/private async lock(General)?CellInventory\(/.test(line)) continue - const call = /lock(?:General)?CellInventory\(\s*\w+\s*,\s*(?:'([a-z-]+)'|(\w+))\s*\)/.exec(line) - if (!call) continue - sites.push({ method, mode: (call[1] ?? 'caller') as CensusMode }) - } - return sites -} - - -// Tier 3 and tier 4 of the row lock order documented in assignment-store.ts. A -// transaction that takes relay_cells before this host's reservation rows can -// cycle with one that takes them the other way round, and PostgreSQL resolves -// that as a 40P01 during exactly the drain and rehome waves these paths exist -// to run. The cell row is the one every host on a cell shares, so it is the -// lock that must be taken last, which fixes the direction for everyone else. -const CELL_LOCK_CALL = - /this\.(?:lockCellInventory|lockGeneralCellInventory|lockCellRows|adjustCellReservationAtomically|adjustCellReservation)\(|UPDATE relay_cells/ -const RESERVATION_LOCK_CALL = - /this\.(?:lockControlConnectionReservations|insertControlConnectionReservation|claimControlConnectionReservation|releaseSupersededControlConnectionReservations)\(|(?:UPDATE|INTO|DELETE FROM)\s+relay_control_connection_reservations/ - -// The lock helpers themselves, plus the one reporting query that reads both -// tables without locking either. -const ROW_LOCK_ORDER_EXEMPT = [ - 'lockCellInventory', - 'lockGeneralCellInventory', - 'lockCellRows', - 'lockControlConnectionReservations', - 'adjustCellReservation', - 'adjustCellReservationAtomically', - 'insertControlConnectionReservation', - 'claimControlConnectionReservation', - 'releaseSupersededControlConnectionReservations', - 'cellDeploymentStatus' -] - -function methodSpans(lines: string[]): { name: string; start: number; end: number }[] { - const starts: { name: string; start: number }[] = [] - lines.forEach((line, index) => { - const declaration = DECLARATION.exec(line) - if (declaration) starts.push({ name: declaration[1]!, start: index }) - }) - return starts.map((entry, index) => ({ - ...entry, - end: starts[index + 1]?.start ?? lines.length - })) -} - -function pathsTakingCellsBeforeReservations(lines: string[]): string[] { - const offending: string[] = [] - for (const span of methodSpans(lines)) { - if (ROW_LOCK_ORDER_EXEMPT.includes(span.name)) continue - let cell = Number.POSITIVE_INFINITY - let reservation = Number.POSITIVE_INFINITY - for (let index = span.start; index < span.end; index++) { - const line = lines[index]! - if (CELL_LOCK_CALL.test(line)) cell = Math.min(cell, index) - if (RESERVATION_LOCK_CALL.test(line)) reservation = Math.min(reservation, index) - } - if (cell < reservation && reservation !== Number.POSITIVE_INFINITY) { - offending.push(span.name) - } - } - return offending -} - -describe('cell inventory lock call-site census', () => { - it('classifies every call site exactly as recorded', () => { - expect(readCallSites()).toEqual(CENSUS.map(({ method, mode }) => ({ method, mode }))) - }) - - // Why: the census only sees lockCellInventory calls, so a hand-written - // `relay_cells ... FOR UPDATE` would escape classification entirely. - it('routes every relay_cells row lock through a named lock helper', () => { - const lines = storeSource() - const rawSites: string[] = [] - // Whole statements, not a fixed window: a wide column list or a raw - // FOR UPDATE inside query() must not slip past. - const source = lines.join('\n') - const bounds: { name: string; start: number }[] = [] - lines.forEach((line, index) => { - const declaration = DECLARATION.exec(line) - if (declaration) bounds.push({ name: declaration[1]!, start: index }) - }) - const methodAt = (offset: number): string => { - const lineIndex = source.slice(0, offset).split('\n').length - 1 - let name = '' - for (const bound of bounds) if (bound.start <= lineIndex) name = bound.name - return name - } - const tick = String.fromCharCode(96) - const statementCall = new RegExp( - '\\.(queryLocked|query)\\(\\s*' + tick + '([^' + tick + ']*)' + tick, - 'g' - ) - for (const call of source.matchAll(statementCall)) { - const statement = call[2]! - if (!/\bFROM\s+relay_cells\b/.test(statement)) continue - const locks = call[1] === 'queryLocked' || /\bFOR\s+UPDATE\b/.test(statement) - if (!locks) continue - const method = methodAt(call.index) - if (NAMED_LOCK_HELPERS.includes(method)) continue - rawSites.push(method) - } - expect(rawSites).toEqual(INLINE_CELL_LOCK_SITES) - }) - - it('takes the host reservation rows before the shared cell row everywhere', () => { - expect(pathsTakingCellsBeforeReservations(storeSource())).toEqual([]) - }) - - it('leaves no call site taking the inventory without naming a mode', () => { - const source = readFileSync(new URL('./assignment-store.ts', import.meta.url), 'utf8') - const unclassified = source - .split('\n') - .filter((line) => /lock(?:General)?CellInventory\(\s*\w+\s*\)/.test(line)) - .filter((line) => !line.includes('private async')) - - expect(unclassified).toEqual([]) - }) - - it('derives the same reachability the census claims', () => { - const reachOf = derivedReachability(storeSource()) - - expect(readCallSites().map(({ method }) => reachOf(method))).toEqual( - CENSUS.map((entry) => entry.reach) - ) - }) - - // Why: this is the whole point of the classification. A shorter wait on a - // sweep-reachable site turns contention into a terminal transaction failure - // that counts against the incident gate's relayPostgresRetryExhausted bar. - // Why: the hold distribution is what the 500ms bound will be tuned against, so - // a mode that stops asking for it goes unmeasured in exactly the lane that - // matters. Nothing else in the suite reads the pool-default branch. - it('measures the hold in every lock mode', () => { - const modes: CellInventoryLockMode[] = ['request', 'nowait', 'pool-default'] - - expect(modes.map((mode) => cellInventoryLockOptions(mode).measureHoldMs)).toEqual([ - true, - true, - true - ]) - }) - - it('never puts a sweep-reachable site on the bounded wait', () => { - const reachOf = derivedReachability(storeSource()) - const bounded = readCallSites().filter( - (site) => site.mode === 'request' && ['sweep', 'both'].includes(reachOf(site.method)) - ) - - expect(bounded).toEqual([]) - }) - - it('routes every sweep-only site to NOWAIT so it can skip the tick', () => { - const reachOf = derivedReachability(storeSource()) - const queueing = readCallSites().filter( - (site) => reachOf(site.method) === 'sweep' && site.mode !== 'nowait' - ) - - expect(queueing).toEqual([]) - }) -}) diff --git a/cloud/apps/relay/src/cell-inventory-lock-contention.test.ts b/cloud/apps/relay/src/cell-inventory-lock-contention.test.ts index 44a4b990ea8d..1bf3153f3e44 100644 --- a/cloud/apps/relay/src/cell-inventory-lock-contention.test.ts +++ b/cloud/apps/relay/src/cell-inventory-lock-contention.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { afterEach, describe, expect, it, vi } from 'vitest' const fakes = vi.hoisted(() => ({ @@ -78,7 +77,6 @@ describe('bounded cell-inventory lock wait', () => { // Why: a bound at or above the pool default would fence nothing, and one far // below the hold time would convert ordinary contention into terminal failures. it('keeps the request bound strictly inside the pool default', () => { - expect(CELL_INVENTORY_LOCK_TIMEOUT_MS).toBe(500) expect(CELL_INVENTORY_LOCK_TIMEOUT_MS).toBeLessThan(POSTGRES_LOCK_TIMEOUT_MS) }) @@ -361,15 +359,6 @@ describe('bounded cell-inventory lock wait', () => { await database.close() }) - // Why: index.ts boots a server on import, so its wiring can only be read. An - // unspread hold metric is invisible: the flush simply omits the fields. - it('spreads the hold counts into the runtime metrics flush', () => { - const source = readFileSync(new URL('./index.ts', import.meta.url), 'utf8') - const flush = /observability\.start\(\(\) => \(\{([^}]*)\}\)\)/.exec(source) - - expect(flush?.[1]).toContain('...consumeRelayCellInventoryHold(database)') - }) - // Why: 500ms is a first value, not a measurement. Tuning it needs the hold // distribution, which no runtime metric carried. it('reports how long the inventory lock was held to COMMIT', async () => { @@ -492,25 +481,6 @@ describe('background sweeps skip a contended cell inventory', () => { expect(warnings.entries).toEqual([]) await database.close() }) - - it('still aborts the expired evacuation once the inventory is free', async () => { - const database = await openInMemoryRelayDatabase() - const probe = new InventoryLockProbe(database) - let now = 1_000 - const store = new RelayAssignmentStore(probe, () => now) - await store.reconcileCells(CELLS) - const assignment = await store.assign(identity) - await store.activateControl(identity, { - cellId: assignment.cellId, - assignmentEpoch: assignment.assignmentEpoch, - generation: 1 - }) - await store.startEvacuation(identity, 'cell-b') - now += 24 * 60 * 60_000 - - expect(await store.abortExpiredEvacuations()).toBe(1) - await database.close() - }) }) // Returns each inventory lock the run took, as its bound or 'nowait'. diff --git a/cloud/dev/scripts/production-cloud-sql-rollout-lock.test.mjs b/cloud/dev/scripts/production-cloud-sql-rollout-lock.test.mjs index d79d4f910460..628b09176da6 100644 --- a/cloud/dev/scripts/production-cloud-sql-rollout-lock.test.mjs +++ b/cloud/dev/scripts/production-cloud-sql-rollout-lock.test.mjs @@ -1,5 +1,4 @@ import assert from 'node:assert/strict' -import { readFileSync } from 'node:fs' import { test } from 'node:test' import { LEASED_WORKFLOWS, @@ -21,7 +20,6 @@ import { revisionMintingScripts, workflowFiles } from './cloud-sql-rollout-lock-census.mjs' -import { relayWorkflowFile } from './relay-repository.mjs' const expectedLease = { production: PRODUCTION_LEASE, staging: STAGING_LEASE, selectable: SELECTABLE_LEASE } const leasedFiles = Object.keys(LEASED_WORKFLOWS) @@ -182,29 +180,3 @@ test('census: no workflow rolls out against the shared instance outside the leas assert.ok(!(file in NOT_A_CLOUD_SQL_CANDIDATE), `${file} cannot be both leased and a non-candidate`) } }) - -// The API and auth deploy scripts share this contract but stay in the private repository. -const serviceCapScripts = ['dev/scripts/deploy-relay-blue-green.mjs'] - -test('budgets tagged Cloud Run candidates outside the service-wide instance cap', () => { - for (const file of serviceCapScripts) { - const script = readFileSync(new URL(`../../${file}`, import.meta.url), 'utf8') - assert.match(script, /'--no-traffic'/, file) - assert.match(script, /'--max'/, file) - } - const budget = readFileSync( - new URL('../../dev/scripts/relay-cloud-sql-connection-budget.mjs', import.meta.url), - 'utf8' - ) - assert.match(budget, /directly addressable tagged revisions outside service-level caps/) - assert.match( - budget, - /apiCandidate: retainedDirectorRollback \+ inputs\.apiInstances \* inputs\.apiPoolMax/ - ) - const director = readWorkflow(relayWorkflowFile('deploy-relay-production-director.yml')) - const capacity = readWorkflow(relayWorkflowFile('deploy-relay-production-capacity-job.yml')) - const asia = readWorkflow(relayWorkflowFile('operate-relay-asia-admission.yml')) - assert.match(director, /--max-instances "\$\{DIRECTOR_MAX_INSTANCES\}"/) - assert.match(capacity, /--max-instances 5/) - assert.match(asia, /--max-instances "\$\{DIRECTOR_MAX_INSTANCES\}"/) -}) diff --git a/cloud/dev/scripts/push-gateway-workflow.test.mjs b/cloud/dev/scripts/push-gateway-workflow.test.mjs index 3ee4fabe4109..5a8349c1855d 100644 --- a/cloud/dev/scripts/push-gateway-workflow.test.mjs +++ b/cloud/dev/scripts/push-gateway-workflow.test.mjs @@ -309,11 +309,6 @@ test('push credentials cannot assume the shared Relay deploy identity', () => { assert.doesNotMatch(terraform('push-gateway.tf'), /member\s*=\s*local\.relay_github_deploy_service_account_member/) }) -// A latest revision needs a successor even when validation is inert. -test('dedicated database admits three simultaneous revision pools', () => { - assert.match(terraform('push-gateway.tf'), /var\.push_max_instances \* var\.push_database_pool_max \* 3 <= 64/) -}) - test('push has only a dedicated database attachment and a narrowly scoped deployment lease', () => { const service = terraform('push-gateway.tf') const database = terraform('push-dedicated-database.tf') diff --git a/cloud/dev/scripts/push-validation-workflow.test.mjs b/cloud/dev/scripts/push-validation-workflow.test.mjs deleted file mode 100644 index e26769cfeb35..000000000000 --- a/cloud/dev/scripts/push-validation-workflow.test.mjs +++ /dev/null @@ -1,48 +0,0 @@ -import assert from 'node:assert/strict' -import { readFileSync } from 'node:fs' -import test from 'node:test' -import { readRelayWorkflow } from './relay-repository.mjs' - -const workflow = readRelayWorkflow('push-deploy.yml') -const position = (name) => { - const index = workflow.indexOf(`- name: ${name}`) - assert.notEqual(index, -1) - return index -} -const capability = position('Require image support for inert validation') -const deploy = position('Deploy the candidate revision with no traffic') -const activation = position('Retire inert validation and activate the verified image') -const shift = position('Shift all traffic to the verified candidate') - -test('the exact build digest must support validation before production boot', () => { - assert.match(workflow, /docker buildx build --push --platform linux\/amd64 --provenance=false --metadata-file/) - assert.match(workflow, /containerimage\.digest/) - assert.doesNotMatch(workflow, /gcloud artifacts docker images describe/) - assert.ok(capability < deploy) - const preflight = workflow.slice(capability, deploy) - assert.match(preflight, /docker run --rm --network none --entrypoint node "\$\{IMAGE\}"/) - assert.match(preflight, /loadPushConfig\(env\)\.mode !== "validation"/) - assert.match(preflight, /validation_mode_not_fail_closed/) -}) - -test('inert validation and credential checks precede deliberate activation of the same digest', () => { - assert.match(workflow.slice(deploy, activation), /--update-env-vars ORCA_PUSH_MODE=validation/) - assert.match(workflow.slice(deploy, activation), /\.mode == "validation"/) - assert.ok(position('Prove the runtime identity can reach FCM') < activation) - const active = workflow.slice(activation, shift) - assert.ok(active.indexOf('gcloud run deploy') < active.indexOf('gcloud run revisions delete')) - assert.match(active, /--image "\$\{IMAGE\}"/) - assert.match(active, /--remove-env-vars ORCA_PUSH_MODE/) - assert.match(active, /\.spec\.containers\[0\]\.image == \$image/) - assert.match(active, /\.spec\.serviceAccountName == \$account/) - assert.match(active, /\.mode == "active"/) - assert.ok(active.indexOf('ACTIVATION_ATTEMPTED=true') < active.indexOf('gcloud run deploy')) - assert.match(workflow, /deletion below must stop its workers/) -}) - -test('production startup connects read-only and gates all background work in validation', () => { - const entry = readFileSync(new URL('../../apps/push/src/index.ts', import.meta.url), 'utf8') - assert.match(entry, /readOnly: config\.mode === 'validation'/) - assert.match(entry, /startPushBackground\(config,/) - assert.doesNotMatch(entry, /worker\.start\(/) -}) diff --git a/cloud/dev/scripts/relay-asia-admission-workflow.test.mjs b/cloud/dev/scripts/relay-asia-admission-workflow.test.mjs deleted file mode 100644 index 8283d43ca44e..000000000000 --- a/cloud/dev/scripts/relay-asia-admission-workflow.test.mjs +++ /dev/null @@ -1,375 +0,0 @@ -import assert from 'node:assert/strict' -import { readFileSync } from 'node:fs' -import { test } from 'node:test' -import { relayWorkflowUrl } from './relay-repository.mjs' - -const workflow = readFileSync( - relayWorkflowUrl('operate-relay-asia-admission.yml'), - 'utf8' -) -const iam = readFileSync(new URL('../../infra/terraform/relay-github-actions.tf', import.meta.url), 'utf8') -const stagingProof = readFileSync( - relayWorkflowUrl('prove-relay-asia-staging.yml'), - 'utf8' -) -const directorWorkflow = readFileSync( - relayWorkflowUrl('deploy-relay-production-director.yml'), - 'utf8' -) -const terraformReadme = readFileSync( - new URL('../../infra/terraform/README.md', import.meta.url), - 'utf8' -) -const proofIam = readFileSync( - new URL('../../infra/terraform/relay-asia-proof-iam.tf', import.meta.url), - 'utf8' -) -const relayTerraform = readFileSync( - new URL('../../infra/terraform/relay.tf', import.meta.url), - 'utf8' -) -const rolloutEvidence = readFileSync( - new URL('./relay-asia-rollout-evidence.mjs', import.meta.url), - 'utf8' -) -const admissionBudgets = readFileSync( - new URL('../../packages/relay-contract/src/admission-budgets.ts', import.meta.url), - 'utf8' -) - -test('offers the exact audited admission modes under the shared deployment lock', () => { - for (const mode of [ - 'inspect', 'initialize', 'verify', 'register', 'configure', 'promote', 'rollback' - ]) { - assert.match(workflow, new RegExp(`\\b${mode}\\b`)) - } - assert.match(workflow, /production-cloud-sql-rollout/) - assert.match(workflow, /relay-staging-mutation/) - assert.match(workflow, /selector-generation/) - assert.match(workflow, /selector-attempt-id/) -}) - -test('requires exact confirmations and uses the existing admin identity', () => { - assert.match(workflow, /INITIALIZE_ADMISSION_SELECTOR/) - assert.match(workflow, /REGISTER_ASIA_MIGRATION_ONLY/) - assert.match(workflow, /PROMOTE_ASIA_GENERAL/) - assert.match(workflow, /ROLLBACK_ASIA_MIGRATION_ONLY/) - assert.match(workflow, /CONFIGURE_ASIA_DIRECTOR/) - assert.match(workflow, /GCP_RELAY_DEPLOY_SERVICE_ACCOUNT/) - assert.match(workflow, /id_token_audience: \$\{\{ env\.DIRECTOR_ORIGIN \}\}\/v1\/admin\/drain/) - assert.match(iam, /"operate-relay-asia-admission\.yml"/) -}) - -test('discovers generation read-only and explicitly initializes only generation zero', () => { - assert.match(workflow, /leave empty only for inspect/) - assert.match(workflow, /test -z "\$\{EXPECTED_SELECTOR_GENERATION\}"/) - assert.match(workflow, /test "\$\{EXPECTED_SELECTOR_GENERATION\}" = 0/) - assert.match(workflow, /\^\(0\|\[1-9\]\[0-9\]\*\)\$/) - assert.match(workflow, /selector-membership-sha256/) - assert.match(workflow, /\^\[a-f0-9\]\{64\}\$/) - assert.match(workflow, /director-image-digest/) - assert.match(workflow, /\.spec\.containers\[0\]\.image == \$image/) -}) - -test('uploads one sanitized machine-readable admission result', () => { - assert.match(workflow, /sanitize-relay-asia-admission-result\.mjs/) - const upload = /- name: Upload sanitized admission result\n([\s\S]*?)(?=\n - name:)/ - .exec(workflow)?.[1] - assert.ok(upload) - assert.match( - upload, - /if: \$\{\{ inputs\.mode != 'configure' && steps\.admission-operation\.outcome == 'success' \}\}/ - ) - assert.match(upload, /uses: actions\/upload-artifact@v4/) - assert.match( - upload, - /relay-asia-admission-result-\$\{\{ github\.run_id \}\}-\$\{\{ github\.run_attempt \}\}/ - ) - assert.match(upload, /path: \$\{\{ runner\.temp \}\}\/relay-asia-admission-result\/result\.json/) - assert.match(upload, /if-no-files-found: error/) - assert.match(upload, /retention-days: 7/) - assert.ok( - workflow.indexOf('Upload sanitized admission result') > - workflow.indexOf('Upload immutable canary evidence') - ) -}) - -test('binds selector operations and director configuration to reviewed implementations', () => { - assert.match(workflow, /operate-relay-asia-admission\.mjs/) - assert.match(workflow, /prepare-relay-asia-director-cells\.mjs/) - assert.match(workflow, /deploy-relay-blue-green\.mjs/) - assert.match(workflow, /--prune-revisions false/) - assert.doesNotMatch(workflow, /gcloud secrets versions add/) - assert.match(workflow, /orca-cloud-relay-regional-placement-enabled/) - assert.match(workflow, /\.valueSource\.secretKeyRef/) - assert.match(workflow, /jq -er --arg secret "\$\{REGIONAL_PLACEMENT_SECRET\}"/) - assert.doesNotMatch(workflow, /jq -e --arg secret "\$\{REGIONAL_PLACEMENT_SECRET\}"/) - assert.doesNotMatch(workflow, /--regional-placement-enabled/) - assert.doesNotMatch(workflow, /"\$\{\{ inputs\./) - assert.doesNotMatch(workflow, /dns/i) -}) - -test('requires immutable staged evidence and a timed production canary before expansion', () => { - assert.match(workflow, /actions: read/) - assert.match(workflow, /actions\/download-artifact@v4/) - assert.match(workflow, /relay-asia-staging-\$\{EVIDENCE_RUN_ID\}-\$\{EVIDENCE_RUN_ATTEMPT\}/) - assert.match(workflow, /evidence_kind=staging/) - assert.match(workflow, /load-relay-controls\.mjs/) - assert.match(workflow, /--controls 1/) - assert.match(workflow, /--splices 1/) - assert.match(workflow, /--splice-hold-seconds 60/) - assert.match(workflow, /--relay-asia-load-principals 1/) - assert.match(workflow, /--duration-seconds 300/) - assert.match(workflow, /--required-lease-horizons 2/) - assert.match(workflow, /pnpm\/action-setup@v4/) - assert.match(workflow, /Install exact canary dependencies/) - assert.match(workflow, /pnpm install --frozen-lockfile/) - assert.match(workflow, /pnpm --filter @orca-cloud\/relay-contract build/) - assert.ok( - workflow.indexOf('Build the canary Relay contract') < - workflow.indexOf('Run a real five-minute canary control and splice') - ) - assert.match(workflow, /--load-report "\$\{RUNNER_TEMP\}\/relay-asia-canary-load\.json"/) - assert.match(workflow, /"production-gce-c28":"migration-only","production-gce-c29":"migration-only"/) - // C28/C29 promotion downloads C27's canary under exactly this name. - assert.match(workflow, /relay-asia-\$\{\{ steps\.inputs\.outputs\.canary_hostname \}\}-canary-\$\{\{ github\.run_id \}\}-\$\{\{ github\.run_attempt \}\}/) - assert.match(workflow, /echo "canary_hostname=\$\{canary_cell##\*-\}"/) - assert.match(workflow, /id: canary-evidence-upload/) - assert.match(workflow, /Return an unproven canary cell to migration-only/) - assert.match(workflow, /steps\.canary-evidence-upload\.outcome != 'success'/) - assert.match(workflow, /--mode recover-promotion[\s\S]*?--attempt-id "\$\{SELECTOR_ATTEMPT_ID\}"/) - assert.match(workflow, /--attempt-id "\$\{SELECTOR_ATTEMPT_ID\}-rollback"/) - assert.match(workflow, /evidence_kind=c27/) - assert.match(workflow, /orca_relay_runtime_metrics/) - assert.match(workflow, /relay-asia-rollout-evidence\.mjs create-canary \\\n\s+--cell-id "\$\{CANARY_CELL\}"/) - assert.match(workflow, /retention-days: 7/) - assert.match(workflow, /Require the exact director image before promotion/) - assert.match(workflow, /DIRECTOR_ORIGIN.*\/v1\/admin\/runtime-status/) - assert.match(workflow, /\.imageDigest.*IMAGE_DIGEST/) - const provenance = /- name: Verify evidence provenance and rollout binding before authentication\n([\s\S]*?)(?=\n - id: auth)/ - .exec(workflow)?.[1] - assert.ok(provenance) - assert.match(provenance, /\.head_sha \| select\(type == "string" and test\("\^\[a-f0-9\]\{40\}\$"\)\)/) - assert.match(provenance, /--commit-sha "\$\{evidence_commit_sha\}"/) - assert.doesNotMatch(provenance, /--commit-sha "\$\{GITHUB_SHA\}"/) -}) - -test('binds each production promotion wave to its exact evidence and canary', () => { - const cases = /case "\$\{TARGET_CELL_IDS\}" in\n([\s\S]*?)\n\s*esac/.exec(workflow)?.[1] - assert.ok(cases) - const waves = Object.fromEntries( - [...cases.matchAll(/^ {14}([a-z0-9,-]+)\)\n([\s\S]*?);;/gm)].map((match) => [match[1], { - evidence: /evidence_kind=([a-z0-9]+)/.exec(match[2])?.[1] ?? 'none', - canary: /canary_cell=([a-z0-9-]+)/.exec(match[2])?.[1] ?? 'none' - }]) - ) - assert.deepEqual(waves, { - 'production-gce-c27': { evidence: 'staging', canary: 'production-gce-c27' }, - 'production-gce-c28,production-gce-c29': { evidence: 'c27', canary: 'none' }, - 'production-gce-c30': { evidence: 'none', canary: 'production-gce-c30' } - }) - assert.match(cases, /\*\) echo "production promotion wave is not reviewed" >&2; exit 1 ;;/) - assert.match(workflow, /if test "\$\{evidence_kind\}" = none; then\n\s+test -z "\$\{EVIDENCE_RUN_ID\}"/) - assert.doesNotMatch(workflow, /inputs\.cell-ids == /) -}) - -test('runs the timed canary and its automatic rollback for C27 and C30 alike', () => { - const steps = workflow.split(/\n(?= - )/) - const named = (name) => steps.find((step) => step.includes(`name: ${name}`)) - for (const name of [ - 'Install exact canary dependencies', - 'Build the canary Relay contract', - 'Verify the canary cell state and start the timed canary', - 'Run a real five-minute canary control and splice', - 'Collect regional, Relay SQL, and Cloud SQL canary evidence', - 'Upload immutable canary evidence' - ]) { - assert.match(named(name), /if: \$\{\{ steps\.inputs\.outputs\.canary == 'true' \}\}/, name) - } - assert.match( - workflow, - /if: \$\{\{ inputs\.mode == 'configure' \|\| steps\.inputs\.outputs\.canary == 'true' \}\}/ - ) - const rollback = named('Return an unproven canary cell to migration-only') - assert.match( - rollback, - /if: \$\{\{ always\(\) && steps\.inputs\.outputs\.canary == 'true' && steps\.admission-operation\.outcome != 'skipped' && steps\.canary-evidence-upload\.outcome != 'success' \}\}/ - ) - assert.match(rollback, /CANARY_CELL: \$\{\{ steps\.inputs\.outputs\.canary_cell \}\}/) - assert.match(rollback, /--mode recover-promotion \\\n\s+--cell-ids "\$\{CANARY_CELL\}"/) - assert.match(rollback, /--mode rollback \\\n\s+--cell-ids "\$\{CANARY_CELL\}"/) - assert.match(rollback, /'\.states\[\$cell\]' <<< "\$\{result\}"\)" = migration-only/) - const start = named('Verify the canary cell state and start the timed canary') - assert.match(start, /production-gce-c30\)\n\s+verify_cells=production-gce-c30\n\s+expected_states='\{"production-gce-c30":"general"\}'/) - assert.match(start, /test "\$\(jq -cS '\.states' <<< "\$\{result\}"\)" = "\$\(jq -cS '\.' <<< "\$\{expected_states\}"\)"/) - assert.match(named('Run a real five-minute canary control and splice'), /--duration-seconds 300/) -}) - -test('creates staging evidence only after the bounded launch-path load and rollback', () => { - assert.match(stagingProof, /runs-on: \[self-hosted, linux, x64, relay-asia-east2-load\]/) - assert.doesNotMatch(stagingProof, /group: relay-asia-east2-load/) - assert.match(stagingProof, /pnpm\/action-setup@v4/) - assert.match(stagingProof, /pnpm install --frozen-lockfile/) - assert.match(stagingProof, /pnpm --filter @orca-cloud\/relay-contract build/) - assert.match(stagingProof, /run_phase launch 5 5/) - assert.doesNotMatch(stagingProof, /run_phase control|run_phase mixed/) - assert.match(stagingProof, /--aggregate-controls "\$\(\(controls \* 4\)\)"/) - assert.match(stagingProof, /--aggregate-splices "\$\(\(splices \* 4\)\)"/) - assert.match(stagingProof, /--required-lease-horizons 2/) - assert.match(stagingProof, /--splice-ramp-seconds 120/) - assert.match(stagingProof, /--max-generator-rss-growth-mib 512/) - assert.match(stagingProof, /--relay-asia-load-principals 32/) - assert.match(stagingProof, /ulimit -n/) - assert.match(stagingProof, /--region-behavior-probes 1/) - assert.match(stagingProof, /--capacity-cell-origin https:\/\/c4\.relay-staging\.onorca\.dev/) - assert.match(stagingProof, /--rebind-probes 2/) - assert.match(stagingProof, /--skip-rebind-overflow-check/) - assert.doesNotMatch(stagingProof, /--request-unit-invites|--regional-fallback-probes/) - assert.match(stagingProof, /--aggregate-reader-splices.*echo 5/) - assert.match(stagingProof, /--aggregate-reader-bytes.*echo 12582912/) - assert.match(stagingProof, /--phase-barrier-dir "\$\{proof_dir\}\/\$\{phase\}-barrier"/) - assert.match(stagingProof, /--duration-seconds 210/) - assert.match(stagingProof, /trap stop_shards EXIT/) - assert.match(stagingProof, /if ! wait "\$\{pid\}"; then failed=1; break; fi/) - assert.match(stagingProof, /connectionFailuresByReason/) - assert.match(stagingProof, /--launch-report "\$\{proof_dir\}\/launch\.json"/) - assert.match(stagingProof, /id-token: write/) - assert.match(stagingProof, /STAGING_GCP_RELAY_ASIA_PROOF_WORKLOAD_IDENTITY_PROVIDER/) - assert.match(stagingProof, /STAGING_GCP_RELAY_ASIA_PROOF_SERVICE_ACCOUNT/) - assert.doesNotMatch(stagingProof, /STAGING_GCP_DEPLOY_SERVICE_ACCOUNT/) - assert.doesNotMatch(stagingProof, /STAGING_RELAY_LOAD_ACCESS_TOKEN/) - assert.doesNotMatch(stagingProof, /secrets versions access|signing-key-file/) - assert.match(stagingProof, /relay-asia-rollout-evidence\.mjs create-staging/) - assert.match(stagingProof, /Require the exact staging director image before promotion/) - assert.match(stagingProof, /DIRECTOR_ORIGIN.*\/v1\/admin\/runtime-status/) - assert.match(stagingProof, /\.imageDigest.*IMAGE_DIGEST/) - assert.match(stagingProof, /Return staging C4 to migration-only/) - assert.match(stagingProof, /steps\.promote\.outcome != 'skipped'/) - assert.match(stagingProof, /--mode recover-promotion[\s\S]*?--attempt-id "\$\{PROMOTE_ATTEMPT_ID\}"/) - assert.match(stagingProof, /--mode rollback[\s\S]*?--expected-generation "\$\{promoted_generation\}"/) - assert.match(stagingProof, /if: \$\{\{ success\(\) \}\}/) - assert.match( - stagingProof, - /recover:\n if: \$\{\{ always\(\) && github\.ref == 'refs\/heads\/main' \}\}/ - ) - assert.match(stagingProof, /needs: prove/) - assert.match(stagingProof, /Recover staging C4 with a fresh identity/) - assert.equal((stagingProof.match(/google-github-actions\/auth@v2/g) ?? []).length, 2) - assert.equal((stagingProof.match(/--mode recover-promotion/g) ?? []).length, 2) - assert.equal((stagingProof.match(/--mode rollback/g) ?? []).length, 2) -}) - -test('keeps the private runner below its 64-port Cloud NAT allocation', () => { - const profile = /run_phase launch (\d+) (\d+)/.exec(stagingProof) - const controlsPerShard = Number(profile?.[1]) - const splicesPerShard = Number(profile?.[2]) - const rebindProbes = Number(/--rebind-probes (\d+)/.exec(stagingProof)?.[1]) - const runtimeStatusSockets = 1 - assert.ok( - controlsPerShard * 4 + splicesPerShard * 4 * 2 + rebindProbes + runtimeStatusSockets < 64 - ) -}) - -test('paces one-source staging upgrades below the Relay anti-abuse ceiling', () => { - const splicesPerShard = Number(/run_phase launch \d+ (\d+)/.exec(stagingProof)?.[1]) - const rebindProbes = Number(/--rebind-probes (\d+)/.exec(stagingProof)?.[1]) - const spliceRampMs = Number(/--splice-ramp-seconds (\d+)/.exec(stagingProof)?.[1]) * 1000 - const ceiling = Number( - /maxPreAuthAttemptsPerSourcePerMinute: (\d+)/.exec(admissionBudgets)?.[1] - ) - const totalSplices = splicesPerShard * 4 - const attempts = Array.from({ length: totalSplices }, (_, ordinal) => - Math.floor(ordinal * spliceRampMs / (totalSplices - 1)) - ).flatMap((startedAt) => [startedAt, startedAt]) - attempts.push(...Array.from({ length: 4 + rebindProbes }, () => 0)) - const busiestMinute = Math.max(...attempts.map((startedAt) => - attempts.filter((attempt) => attempt >= startedAt && attempt < startedAt + 60_000).length - )) - assert.ok(busiestMinute < ceiling) -}) - -test('reserves rollback time beyond the complete bounded staging proof envelope', () => { - const timeoutMinutes = Number(/timeout-minutes: (\d+)/.exec(stagingProof)?.[1]) - assert.equal(timeoutMinutes, 75) - const spliceRampSeconds = Number(/--splice-ramp-seconds (\d+)/.exec(stagingProof)?.[1]) - const launchSeconds = 180 + spliceRampSeconds + 210 + 60 - const setupEvidenceAndRollbackSeconds = 10 * 60 - const envelopeMinutes = Math.ceil((launchSeconds + setupEvidenceAndRollbackSeconds) / 60) - assert.ok(timeoutMinutes - envelopeMinutes >= 30) - assert.match(stagingProof, /--ramp-seconds 180/) - assert.match(stagingProof, /--duration-seconds 210/) -}) - -test('binds the staging proof to one least-privilege Google identity', () => { - assert.match( - proofIam, - /github_relay_asia_proof_workflow_file = "prove-relay-asia-staging\.yml"/ - ) - assert.match( - proofIam, - /assertion\.workflow_ref == '\$\{prefix\}\$\{local\.github_relay_asia_proof_workflow_file\}@refs\/heads\/main'/ - ) - assert.match(proofIam, /assertion\.environment == 'staging'/) - assert.match(proofIam, /assertion\.event_name == 'workflow_dispatch'/) - assert.match(proofIam, /roles\/logging\.viewer/) - assert.match(proofIam, /roles\/monitoring\.viewer/) - assert.match(rolloutEvidence, /readCloudSqlBackends/) - assert.match(rolloutEvidence, /cloudSql: await readCloudSqlBackends/) - assert.doesNotMatch(proofIam, /compute\.|cloudsql\.|secretmanager\.|roles\/editor|roles\/run\./) -}) - -test('keeps the production US-first switch in durable Secret Manager state', () => { - assert.match(directorWorkflow, /options: \[preserve, enable, disable\]/) - assert.match(directorWorkflow, /default: preserve/) - assert.match(directorWorkflow, /gcloud secrets versions add/) - assert.match(directorWorkflow, /preserve\) desired="\$\{current\}"/) - assert.match(directorWorkflow, /--regional-placement-secret-version "\$\{target_version\}"/) - assert.match(directorWorkflow, /test "\$\{CEILING\}" = "\$\{DIRECTOR_MAX_INSTANCES\}"/) - assert.match(directorWorkflow, /orca-cloud-relay-regional-placement-enabled/) - assert.match(directorWorkflow, /\.valueSource\.secretKeyRef \/\/ \.valueFrom\.secretKeyRef/) - assert.match(directorWorkflow, /\.version \/\/ \.key/) - assert.match(directorWorkflow, /\.secret \/\/ \.name/) - assert.match(workflow, /\.valueSource\.secretKeyRef \/\/ \.valueFrom\.secretKeyRef/) - assert.doesNotMatch(directorWorkflow, /--regional-placement-enabled/) - assert.doesNotMatch(workflow, /inputs\.regional-placement-enabled/) -}) - -test('prunes incompatible production revisions only when explicitly confirmed', () => { - assert.match( - directorWorkflow, - /prune-incompatible-revisions:[\s\S]*?default: false[\s\S]*?type: boolean/ - ) - assert.match(directorWorkflow, /PRUNE_INCOMPATIBLE_RELAY_DIRECTOR_REVISIONS/) - assert.match( - directorWorkflow, - /test "\$\{REGIONAL_PLACEMENT_MODE\}" = preserve[\s\S]*?test "\$\{CONFIRMATION\}" = PRUNE_INCOMPATIBLE_RELAY_DIRECTOR_REVISIONS/ - ) - assert.match( - directorWorkflow, - /--prune-revisions "\$\{PRUNE_INCOMPATIBLE_REVISIONS\}"/ - ) -}) - -test('documents the exact regional-placement secret bootstrap before director rollout', () => { - for (const address of [ - 'google_secret_manager_secret.relay_regional_placement_enabled', - 'google_secret_manager_secret_version.relay_regional_placement_enabled', - 'google_secret_manager_secret_iam_member.relay_regional_placement_runtime_accessor', - 'google_secret_manager_secret_iam_member.relay_regional_placement_deploy_accessor[0]', - 'google_secret_manager_secret_iam_member.relay_regional_placement_deploy_adder[0]', - 'google_secret_manager_secret_iam_member.relay_regional_placement_deploy_viewer[0]' - ]) { - assert.match(terraformReadme, new RegExp(address.replaceAll(/[.[\]]/g, '\\$&'))) - } - assert.match(terraformReadme, /Before the first director deployment/) - assert.match(terraformReadme, /Pass the exact environment tfvars/) - // The Cloudflare records left with the apps root; a -var for a variable this root no longer - // declares is a hard error, so no relay procedure may still tell an operator to pass it. - assert.doesNotMatch(terraformReadme, /manage_artifact_dns/) - assert.match(terraformReadme, /exactly these six additions/) - assert.match(terraformReadme, /version metadata/) - assert.match( - relayTerraform, - /resource "google_secret_manager_secret_iam_member" "relay_regional_placement_deploy_viewer"[\s\S]*?role\s+= "roles\/secretmanager\.viewer"/ - ) -}) diff --git a/cloud/dev/scripts/relay-regional-rehome-workflow.test.mjs b/cloud/dev/scripts/relay-regional-rehome-workflow.test.mjs deleted file mode 100644 index aabf80a65f0f..000000000000 --- a/cloud/dev/scripts/relay-regional-rehome-workflow.test.mjs +++ /dev/null @@ -1,269 +0,0 @@ -import assert from 'node:assert/strict' -import { readFileSync } from 'node:fs' -import { test } from 'node:test' -import { fileURLToPath } from 'node:url' -import { relayWorkflowUrl } from './relay-repository.mjs' - -function workflow(name) { - return readFileSync( - fileURLToPath(relayWorkflowUrl(name)), - 'utf8' - ) -} - -test('same-cap wrapper is reusable, canary-bound, and sequential', () => { - const wrapper = workflow('deploy-relay-production-same-cap.yml') - const job = workflow('deploy-relay-production-same-cap-job.yml') - assert.match(wrapper, /options: \[verify, canary-apply, batch-apply, rollback\]/) - assert.match(wrapper, /relay-same-cap-canary-\$\{\{ inputs\.canary-run-id \}\}/) - assert.match(wrapper, /needs: \[gate, cell_1\]/) - assert.match(wrapper, /needs: \[gate, cell_2\]/) - assert.match(wrapper, /needs: \[gate, cell_3\]/) - assert.match(job, /on:\n workflow_call:/) - assert.match(job, /c27\|c28\|c29\|c30\)/) - assert.match(job, /EXPECTED_HARD_CAP=3000/) - assert.match(job, /EXPECTED_REGION=asia-east2/) - assert.match(job, /--hard-cap "\$\{EXPECTED_HARD_CAP\}"/) - assert.match(job, /--regional-rehome-protocol "\$\{DESIRED_REHOME_PROTOCOL\}"/) - assert.match(job, /--argjson protocol "\$\{PREDECESSOR_REHOME_PROTOCOL\}"/) - assert.match(job, /runtime predecessor mismatch fields=/) - // A rollback interrupted between apply and restore must be resumable. - assert.match(job, /ROLLBACK_RESUME=true/) - assert.match(job, /test "\$\{LIVE_IMAGE_DIGEST\}" = "\$\{DESIRED_IMAGE_DIGEST\}"/) - // Resume must skip BOTH the drain (no restart will clear the flag) and the - // apply (state already converged), and prove convergence instead. - assert.match( - job, - /Reversibly isolate and drain only the selected cell\n if: \$\{\{ inputs\.mode != 'verify' && env\.ROLLBACK_RESUME != 'true' \}\}/ - ) - assert.match( - job, - /Apply only the selected same-cap template and MIG\n if: \$\{\{ inputs\.mode != 'verify' && env\.ROLLBACK_RESUME != 'true' \}\}/ - ) - assert.match( - job, - /Require converged Terraform state and a stable MIG on resume\n if: \$\{\{ inputs\.mode != 'verify' && env\.ROLLBACK_RESUME == 'true' \}\}/ - ) - assert.match(job, /resume found unconverged resources/) - // A canary or batch cell that failed before its template apply also - // resumes here with template drift from repo changes since its last roll; - // only a plan the reviewed validator approves for the image the cell - // already serves may pass, and resume still applies nothing. - assert.match(job, /requiring reviewed rollback-image drift/) - assert.match( - job, - /--image "\$\{DESIRED_IMAGE\}" \\\n {16}--rollback-image "\$\{DESIRED_IMAGE\}"/ - ) - // The relaxation is only safe if the reviewed validator actually runs on - // the NON-converged branch, in same-cap-cell mode, with the trust config - // the validator requires, restricted to the template-and-MIG change pair. - assert.match( - job, - /if ! terraform -chdir=infra\/terraform show -json[\s\S]{0,220}\| length == 0' >\/dev\/null\n then\n/ - ) - assert.match( - job, - /requiring reviewed rollback-image drift'\n[\s\S]{0,400}?\n {16}--mode same-cap-cell --cell-id "\$\{TARGET_CELL_ID\}" \\\n/ - ) - assert.match( - job, - /Require converged Terraform state and a stable MIG on resume[\s\S]{0,300}CAPACITY_SERVICE_ACCOUNT: \$\{\{ vars\.PRODUCTION_GCP_RELAY_CAPACITY_SERVICE_ACCOUNT \}\}\n {10}DIRECTOR_RUNTIME_SERVICE_ACCOUNT: \$\{\{ vars\.PRODUCTION_GCP_RELAY_DIRECTOR_RUNTIME_SERVICE_ACCOUNT \}\}/ - ) - assert.match( - job, - /--rollback-image "\$\{DESIRED_IMAGE\}" \\\n {16}--capacity-service-account "\$\{CAPACITY_SERVICE_ACCOUNT\}" \\\n {16}--rehome-director-service-account "\$\{DIRECTOR_RUNTIME_SERVICE_ACCOUNT\}"/ - ) - assert.match( - job, - /host-drain \\\n {16}--regional-rehome-protocol "\$\{DESIRED_REHOME_PROTOCOL\}" \\\n {16}"\$\{POOL_ARGUMENTS\[@\]\}"\)"\n {12}echo "\$\{RESUME_REVIEW\}"\n {12}jq -e '\.changes == 2' <<< "\$\{RESUME_REVIEW\}" >\/dev\/null/ - ) - // A resume applies nothing at all, which is what a resume means: the only accepted - // unconverged plan is the template-and-MIG rollback-image drift, and it is left pending. - const resumeStep = job.slice( - job.indexOf('- name: Require converged Terraform state and a stable MIG on resume'), - job.indexOf('- name: Apply only the selected same-cap template and MIG') - ) - assert.equal(resumeStep.split('terraform -chdir=infra/terraform apply').length, 1) - assert.match(job, /resume requires the isolated migration-only cell/) - assert.match(job, /test "\$\{TARGET_INCARNATION\}" = "\$\{SOURCE_INCARNATION\}"/) - assert.match(job, /\(.regionalRehomeProtocol \/\/ 0\) == \$protocol/) - assert.match(job, /\(\.draining == false or \$drainingOk\)/) - // Selector expectations must follow the mutations' returned generations, - // not fixed offsets: isolate is a no-op on a cell a failed canary already - // isolated, and the restore inspect must expect post-restore membership. - assert.match(job, /SELECTOR_GENERATION_AFTER_ISOLATE=\$\{EFFECTIVE_SELECTOR_GENERATION\}/) - assert.match(job, /SELECTOR_GENERATION_AFTER_ISOLATE=\$\{ISOLATE_GENERATION\}/) - assert.match(job, /--expected-selector-generation "\$\{SELECTOR_GENERATION_AFTER_ISOLATE\}"/) - assert.match(job, /--expected-selector-generation "\$\{SELECTOR_GENERATION_AFTER_RESTORE\}"/) - assert.match(job, /--expected-migration-only-cells "\$\{RESTORED_MIGRATION_CELLS\}"/) - assert.match(job, /--expected-general-cells "\$\{RESTORED_GENERAL_CELLS\}"/) - assert.match(job, /FAILSAFE_GENERATION/) - // Later batch waves start after ~16-min predecessor rolls, so BOTH evidence - // age checks must scale by wave or cell_2+ can never pass; the bound's - // per-wave step is the cell job timeout, so the two must move together. - assert.match(job, /--required-migration-policy strict \\\n --wave-index "\$\{WAVE_INDEX\}"/) - // Wave 0 must retry freshness-only failures too: one Cloud Monitoring publish - // lag at the sample instant is not health evidence, and single-shot wave 0 - // failed a whole batch on a series that was fresh again a minute later. - assert.match( - job, - /dry-run\.state\.json" \\\n {14}--wave-index "\$\{WAVE_INDEX\}" \\\n {14}--selector-wave-delta "\$\{SELECTOR_WAVE_DELTA\}" --retry-freshness/ - ) - assert.doesNotMatch(job, /RETRY_ARGS/) - // Break-glass: the override skips the aggregate 15-minute monitor evidence and - // nothing else. The live per-wave recheck still runs on the override path, off - // the dispatch inputs the rehome inspect below verifies against the director. - assert.match( - job, - /if test -n "\$\{GATE_OVERRIDE_CONFIRMATION\}"; then[\s\S]{0,700}?--no-monitor-state \\\n {14}--expected-selector-generation "\$\{EXPECTED_SELECTOR_GENERATION\}" \\\n {14}--selector-membership-file[\s\S]{0,160}?--wave-index "\$\{WAVE_INDEX\}" \\\n {14}--selector-wave-delta "\$\{SELECTOR_WAVE_DELTA\}" --retry-freshness/ - ) - // The override is re-validated here, not trusted from the caller, and it is - // bound to the digest this wave installs. - assert.match( - job, - /test "\$\{GATE_OVERRIDE_CONFIRMATION\}" = \\\n {14}"SKIP_RELAY_MONITOR_GATE \$\{TARGET_IMAGE_DIGEST\}"/ - ) - assert.match(job, /\[\[ "\$\{GATE_OVERRIDE_REASON\}" =~ \^\[\[:print:\]\]\{12,500\}\$ \]\]/) - // Exactly the aggregate-evidence steps are skipped, and only them: every step - // that reads or spends the sealed monitor artifact carries the override guard. - const overrideSkipped = [ - 'Require fresh aggregate monitor evidence reference', - 'Download private aggregate monitor evidence', - 'Verify monitor evidence provenance', - "Download this wave's single-use safety authority", - 'Require safety evidence consumed by this workflow' - ] - for (const name of overrideSkipped) { - assert.match( - job, - new RegExp(`- name: ${name}\\n {8}if: \\$\\{\\{ inputs\\.mode != 'verify' && inputs\\.gate-override-confirmation == '' \\}\\}`) - ) - } - assert.equal( - job.match(/inputs\.gate-override-confirmation == ''/g).length, - overrideSkipped.length - ) - // The wrapper validates the override before anything runs, passes it to every - // cell, seals it into the canary artifact, and prints it in the run summary. - assert.match(wrapper, /--gate-override-reason "\$\{GATE_OVERRIDE_REASON\}" \\\n {12}--gate-override-confirmation "\$\{GATE_OVERRIDE_CONFIRMATION\}"\)/) - // One per cell job in the serial cell_1..cell_10 chain. - assert.equal( - wrapper.match(/gate-override-confirmation: \$\{\{ inputs\.gate-override-confirmation \}\}/g).length, - 10 - ) - assert.match(wrapper, /Aggregate monitor gate overridden \(break-glass\)/) - assert.match(wrapper, /ACTOR: \$\{\{ github\.actor \}\}/) - for (const name of [ - 'Reject previously consumed aggregate safety evidence', - 'Consume aggregate safety evidence for this exact wave' - ]) { - assert.match( - wrapper, - new RegExp(`- name: ${name}\\n {8}if: \\$\\{\\{ inputs\\.mode != 'verify' && inputs\\.gate-override-confirmation == '' \\}\\}`) - ) - } - assert.match(job, /timeout-minutes: 75/) - // Both age gates step by the cell job timeout above; the constant is - // duplicated across the two languages, so pin each copy to it. - for (const source of [ - '../../dev/scripts/relay-monitor-evidence.mjs', - '../../apps/relay-ops/src/incident-live-preflight-cli.ts' - ]) { - const body = readFileSync(fileURLToPath(new URL(source, import.meta.url)), 'utf8') - assert.match(body, /WAVE_PREDECESSOR_TIMEOUT_MS = 75 \* 60_000/) - assert.match(body, /\^\[0-9\]\$/) - } - // Aged-evidence replay via job re-runs is fenced: mutations are - // single-dispatch, so a failed cell needs a fresh gate and monitor run. - assert.match(job, /test "\$\{GITHUB_RUN_ATTEMPT\}" = 1/) - for (const index of [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) { - assert.match(wrapper, new RegExp(`wave-index: '${index}'`)) - } - assert.doesNotMatch(job, /EFFECTIVE_SELECTOR_GENERATION \+ 1\)/) - assert.doesNotMatch(job, /EFFECTIVE_SELECTOR_GENERATION \+ 2\)/) - assert.match(job, /\$region == "us-central1" and \$protocol == 0 and [.]region == null/) - assert.match(job, /[.]regionalRehomeProtocol \/\/ 0/) - assert.match(job, /runtime predecessor normalized legacy fields=/) - assert.match(job, /probe-relay-rehome-trust[.]mjs/) - assert.doesNotMatch(job, /service_account: \$\{\{ vars\.PRODUCTION_GCP_RELAY_(?:DIRECTOR_)?RUNTIME_SERVICE_ACCOUNT/) - assert.doesNotMatch(job, /roles\/iam\.serviceAccountTokenCreator/) -}) - -// Why: the same-cap caller defines release_lease itself, and a caller-defined job presents the -// caller as job_workflow_ref, so the pair must admit the caller alongside its reusable job. -test('shared deploy WIF admits the exact same-cap reusable workflow pair and the caller itself', () => { - const terraform = readFileSync( - fileURLToPath(new URL('../../infra/terraform/relay-github-actions.tf', import.meta.url)), - 'utf8' - ) - const providerStart = terraform.indexOf( - 'resource "google_iam_workload_identity_pool_provider" "github"' - ) - const providerEnd = terraform.indexOf('\nresource "', providerStart + 1) - const sharedProvider = terraform.slice(providerStart, providerEnd) - assert.ok(providerStart >= 0 && providerEnd > providerStart) - assert.match(sharedProvider, /local\.relay_github_workflow_conditions\["github"\]/) - // The pairing itself now lives in the clause the provider renders, once per accepted repository. - assert.match( - terraform, - /assertion\.workflow_ref == '\$\{prefix\}\$\{local\.github_production_relay_same_cap_workflow_file\}@refs\/heads\/main' && \(assertion\.job_workflow_ref == '\$\{prefix\}\$\{local\.github_production_relay_same_cap_job_workflow_file\}@refs\/heads\/main' \|\| assertion\.job_workflow_ref == '\$\{prefix\}\$\{local\.github_production_relay_same_cap_workflow_file\}@refs\/heads\/main'\)/ - ) -}) - -test('pause and disable precede optional installation and cloud diagnostics', () => { - const job = workflow('operate-relay-production-rehome-job.yml') - const emergency = job.indexOf('Apply emergency durable pause or disable before diagnostics') - const install = job.indexOf('pnpm install --frozen-lockfile') - const revision = job.indexOf('Verify exact serving and rollback director identities') - assert.ok(emergency > 0) - assert.ok(emergency < install) - assert.ok(emergency < revision) - assert.match(job, /inputs\.mode == 'pause' \|\| inputs\.mode == 'disable'/) - assert.match(job, /Seal 24-hour aggregate region observation evidence/) - assert.match(job, /--freshness=25h --limit=30000/) - assert.match(job, /relay-region-observation-\$\{\{ github\.run_id \}\}-\$\{\{ github\.run_attempt \}\}/) - assert.match(job, /test "\$\{RATE_PER_MINUTE\}" = 10/) -}) - -test('a failed enable independently restores and verifies durable disabled state', () => { - const job = workflow('operate-relay-production-rehome-job.yml') - const enable = job.indexOf('Apply exact durable regional rehome enable') - const evidence = job.indexOf('Read fresh aggregate completion and abort evidence') - const summary = job.indexOf('Publish aggregate control evidence') - const recovery = job.indexOf('Fail closed after an unsuccessful enable run') - assert.ok(enable > 0 && enable < evidence && evidence < summary && summary < recovery) - const recoveryStep = job.slice(recovery) - assert.match( - recoveryStep, - /failure\(\) && inputs\.mode == 'enable' && steps\.google-auth\.outcome == 'success'/ - ) - assert.match(recoveryStep, /--mode recover-enable/) - assert.match(recoveryStep, /--expected-control-generation "\$\{EXPECTED_CONTROL_GENERATION\}"/) - assert.match(recoveryStep, /RECOVER_FAILED_REGIONAL_REHOME_ENABLE/) - assert.match(recoveryStep, /\.control\.enabled == false/) - assert.doesNotMatch(recoveryStep, /gcloud|pnpm/) -}) - -test('director rollout has a strict one-time identity bootstrap', () => { - const workflowBody = workflow('deploy-relay-production-director.yml') - const script = readFileSync( - fileURLToPath(new URL('./deploy-relay-blue-green.mjs', import.meta.url)), - 'utf8' - ) - assert.match(workflowBody, /BOOTSTRAP_RELAY_DIRECTOR_REHOME_IDENTITY/) - assert.match(workflowBody, /--predecessor-runtime-service-account/) - assert.match(workflowBody, /--expected-rehome-generation/) - assert.match(script, /args\.push\('--service-account', config\['runtime-service-account'\]\)/) - assert.match(script, /director predecessor runtime service account does not match/) - const candidateProof = script.indexOf('await verifyRehomeDisabled(candidate.origin)') - const trafficMove = script.indexOf('operations.updateTraffic(config, [`--to-tags=') - assert.ok(candidateProof > 0 && candidateProof < trafficMove) - assert.equal(script.indexOf('verifyRehomeDisabled', trafficMove), -1) -}) - -test('rehome job pipes every control result through tee under pipefail', () => { - const job = workflow('operate-relay-production-rehome-job.yml') - // Without `shell: bash` the step exit code is tee's, so a thrown inspect/apply passes green. - assert.match(job, /defaults:\n run:\n(?: #.*\n)* shell: bash\n/) - assert.ok((job.match(/\| tee "\$\{RUNNER_TEMP\}/g) ?? []).length >= 5) -}) diff --git a/cloud/dev/scripts/relay-same-cap-script-census.test.mjs b/cloud/dev/scripts/relay-same-cap-script-census.test.mjs index 1e023ce0c9d9..ff2c265ee726 100644 --- a/cloud/dev/scripts/relay-same-cap-script-census.test.mjs +++ b/cloud/dev/scripts/relay-same-cap-script-census.test.mjs @@ -13,7 +13,6 @@ import { readRelayWorkflow } from './relay-repository.mjs' import { validateCapacityPlan } from './validate-relay-capacity-plan.mjs' const workflow = readRelayWorkflow('deploy-relay-production-same-cap-job.yml') -const capacityWorkflow = readRelayWorkflow('deploy-relay-production-capacity-job.yml') const production = readFileSync( new URL('../../infra/terraform/environments/production.tfvars', import.meta.url), 'utf8' @@ -295,74 +294,10 @@ describe('same-cap roll scripts accept every same-cap cell', () => { assert.equal(resolveCellShape('production-gce-c31').status, 1) }) - it('passes the same-cap allowlist on every canary invocation the job runs', () => { - const invocations = workflow.split('prepare-relay-production-capacity-canary.mjs').slice(1) - assert.equal(invocations.length, 4) - for (const invocation of invocations) { - const lines = invocation.split('\n') - const end = lines.findIndex((line) => !line.endsWith('\\')) - const call = lines.slice(0, end + 1).join(' ') - assert.match(call, /--approved-cells same-cap/) - // The restore call picks its mode from the cell's entry admission class. - assert.match(call, /--mode (isolate|drain|activate|"\$\{RESTORE_MODE\}")/) - } - }) - it('paces the drain it sends to the selected cell', () => { - const drain = workflow.split('--mode drain')[1] ?? '' - assert.match(drain.split('\n').slice(0, 2).join(' '), /--pace-window-ms "\$\{DRAIN_PACE_WINDOW_MS\}"/) - // 5 min is the cell's DRAIN_PACE_WINDOW_MAX_MS; a 2,700-host cell at 2 min overruns the director's sticky lane. - assert.match(workflow, /DRAIN_PACE_WINDOW_MS: '300000'/) - // The transition wait has to outlast the pacing window on top of the leases it waits on. - assert.match(workflow, /--activity restart-safe[\s\S]*?--timeout-ms 1200000/) - }) - it('passes this cell\'s rehome protocol and pool on every plan validation the job runs', () => { - const invocations = workflow.split('validate-relay-capacity-plan.mjs').slice(1) - assert.equal(invocations.length, 2) - for (const invocation of invocations) { - const lines = invocation.split('\n') - const end = lines.findIndex((line) => !line.trimEnd().endsWith('\\')) - const call = lines.slice(0, end + 1).join(' ') - assert.match(call, /--mode same-cap-cell/) - assert.match(call, /--regional-rehome-protocol "\$\{DESIRED_REHOME_PROTOCOL\}"/) - assert.match(call, /"\$\{POOL_ARGUMENTS\[@\]\}"/) - } - // Each of those steps must build the flag from the resolved pool, and only when there is one. - const builders = workflow.split( - 'if test -n "${EXPECTED_DATABASE_POOL_MAX}"; then\n' + - ' POOL_ARGUMENTS=(--database-pool-max "${EXPECTED_DATABASE_POOL_MAX}")' - ) - assert.equal(builders.length, 3) - assert.equal(workflow.split('POOL_ARGUMENTS=()').length, 3) - }) - // One cell's compute path and nothing else: the template and the MIG bound to it. The cell - // backend service stays out because the capacity role has no compute.backendServices.update, - // so naming it fails the apply after the MIG has already rolled. - it('targets exactly this cell template and MIG on every plan the job runs', () => { - const plans = workflow.split('terraform -chdir=infra/terraform plan').slice(1) - assert.equal(plans.length, 2) - for (const plan of plans) { - const lines = plan.split('\n') - const end = lines.findIndex((line) => !line.trimEnd().endsWith('\\')) - const call = lines.slice(0, end + 1).join('\n') - assert.deepEqual( - [...call.matchAll(/-target=([\w.]+)\[\\"\$\{TARGET_CELL_ID\}\\"\]/g)] - .map(([, resource]) => resource), - [ - 'google_compute_instance_template.relay_gce_cell', - 'google_compute_instance_group_manager.relay_gce_cell' - ] - ) - // Any target that is not one of those two, or not scoped to this cell, fails here. - assert.equal(call.split('-target=').length, 3) - } - }) - it('never names a backend service on any plan or apply in the job', () => { - assert.equal(workflow.includes('google_compute_backend_service'), false) - }) it('validates a correct plan for every wave cell at that cell\'s rehome protocol', () => { const trusted = SAME_CAP_CELLS.filter((cell) => REHOME_SOURCE_CELLS.has(cell)) @@ -569,25 +504,6 @@ describe('same-cap roll scripts accept every same-cap cell', () => { ) }) - it('pins the capacity identity on every plan validation the job runs', () => { - const invocations = workflow.split('validate-relay-capacity-plan.mjs').slice(1) - assert.equal(invocations.length, 2) - for (const invocation of invocations) { - const lines = invocation.split('\n') - const end = lines.findIndex((line) => !line.trimEnd().endsWith('\\')) - assert.match( - lines.slice(0, end + 1).join(' '), - /--capacity-service-account "\$\{CAPACITY_SERVICE_ACCOUNT\}"/ - ) - } - // Both steps must read it from the same repository variable the job already requires. - assert.equal( - workflow.split( - 'CAPACITY_SERVICE_ACCOUNT: ${{ vars.PRODUCTION_GCP_RELAY_CAPACITY_SERVICE_ACCOUNT }}' - ).length, - 4 - ) - }) it('decides the predecessor draining rule from the real block, for both classes', () => { // A zero-host cell sheds nothing, and a failed canary's own drain leaves the flag set @@ -777,29 +693,5 @@ describe('same-cap roll scripts accept every same-cap cell', () => { assert.equal(rolls('resume', { changes: 0 }), 'no-replace') assert.equal(rolls('none', { changes: 0 }), 'no-replace') }) - - it('waits on the image a stranded cell actually serves', () => { - const isolate = workflow - .split('name: Reversibly isolate and drain only the selected cell')[1] - .split('\n - id:')[0] - assert.match(isolate, /--expected-image-digests "\$\{PREDECESSOR_IMAGE_DIGEST\}"/) - // A stranded cell has to come back on a new process, which is what clears the drain. - const after = workflow - .split('name: Verify new incarnation, exact image, protocol, and durable safety')[1] - .split('\n - name:')[0] - assert.match(after, /test "\$\{TARGET_INCARNATION\}" != "\$\{SOURCE_INCARNATION\}"/) - assert.match(after, /if test "\$\{ROLLBACK_RESUME\}" = true; then/) - }) - - it('leaves the US-only capacity job on the default allowlist', () => { - assert.doesNotMatch(capacityWorkflow, /--approved-cells/) - }) }) -// Both trusted versions must prove the same authenticated drain boundary. -it('proves rehome trust for protocol 3 on forward and rollback rolls', () => { - const step = workflow.split('name: Prove exact per-host trust and idempotent no-neighbor behavior')[1].split('\n - name:')[0] - assert.match(step, /inputs\.rollback-rehome-protocol != '0'/) - assert.match(step, /inputs\.target-rehome-protocol != '0'/) - assert.match(step, /probe-relay-rehome-trust\.mjs/) -}) diff --git a/cloud/package.json b/cloud/package.json index 0dd2a5466999..c029b06d6faf 100644 --- a/cloud/package.json +++ b/cloud/package.json @@ -20,8 +20,8 @@ "load:relay:model": "node dev/scripts/run-relay-load-model.mjs", "load:relay:recovery-gate": "node dev/scripts/run-relay-recovery-wave-gate.mjs", "ops:relay": "pnpm --filter @orca-cloud/relay-ops dev", - "pretest": "node --test dev/scripts/capture-terraform-plan-baseline.test.mjs dev/scripts/operate-relay-asia-admission.test.mjs dev/scripts/prepare-relay-asia-director-cells.test.mjs dev/scripts/prepare-relay-asia-topology-input.test.mjs dev/scripts/production-cloud-sql-rollout-lock.test.mjs dev/scripts/read-relay-serving-regional-placement-version.test.mjs dev/scripts/relay-asia-admission-workflow.test.mjs dev/scripts/relay-asia-rollout-evidence.test.mjs dev/scripts/relay-asia-topology-workflow.test.mjs dev/scripts/relay-cloud-sql-connection-budget.test.mjs dev/scripts/relay-load-reader-evidence.test.mjs dev/scripts/relay-lock-contention-alerts.test.mjs dev/scripts/relay-region-hint-metrics.test.mjs dev/scripts/relay-staging-deploy-identity.test.mjs dev/scripts/sanitize-relay-asia-admission-result.test.mjs dev/scripts/terraform-root-partition.test.mjs dev/scripts/validate-relay-asia-topology-plan.test.mjs ../.github/actions/cloud-sql-rollout-lease/action-contract.test.mjs ../.github/actions/cloud-sql-rollout-lease/storage-lease.test.mjs", - "test": "pnpm -r test && node --test dev/scripts/classify-relay-production-capacity-director.test.mjs dev/scripts/classify-relay-staging-bootstrap.test.mjs dev/scripts/deploy-relay-blue-green.test.mjs dev/scripts/deploy-relay-gce-candidate.test.mjs dev/scripts/deploy-relay-gce-multi-target.test.mjs dev/scripts/github-smoke-token.test.mjs dev/scripts/infra.test.mjs dev/scripts/operate-relay-regional-rehome.test.mjs dev/scripts/power-staging-relay.test.mjs dev/scripts/prepare-relay-capacity-canary.test.mjs dev/scripts/prepare-relay-production-capacity-canary.test.mjs dev/scripts/probe-relay-legacy-admission.test.mjs dev/scripts/probe-relay-rehome-trust.test.mjs dev/scripts/production-cell-image-digest-consistency.test.mjs dev/scripts/push-gateway-workflow.test.mjs dev/scripts/push-gateway-recovery.test.mjs dev/scripts/push-validation-workflow.test.mjs dev/scripts/read-relay-production-capacity-identity.test.mjs dev/scripts/relay-admin-endpoint-retry-workflow.test.mjs dev/scripts/relay-admin-transient-retry.test.mjs dev/scripts/relay-admission-selector.test.mjs dev/scripts/relay-gce-terraform-fence.test.mjs dev/scripts/relay-load-connection-failure.test.mjs dev/scripts/relay-load-control-peer.test.mjs dev/scripts/relay-load-director-capacity-gate.test.mjs dev/scripts/relay-load-model.test.mjs dev/scripts/relay-load-phase-barrier.test.mjs dev/scripts/relay-load-placement-boundary.test.mjs dev/scripts/relay-load-profile.test.mjs dev/scripts/relay-load-rebind-boundary.test.mjs dev/scripts/relay-load-region-behavior.test.mjs dev/scripts/relay-load-request-unit-boundary.test.mjs dev/scripts/relay-load-run-lifecycle.test.mjs dev/scripts/relay-monitor-evidence.test.mjs dev/scripts/relay-production-capacity-wave.test.mjs dev/scripts/relay-production-capacity-workflow.test.mjs dev/scripts/relay-production-identity-boundaries.test.mjs dev/scripts/relay-production-same-cap-wave.test.mjs dev/scripts/relay-public-workflow-contract.test.mjs dev/scripts/relay-recovery-wave-gate.test.mjs dev/scripts/relay-region-observation-evidence.test.mjs dev/scripts/relay-regional-rehome-workflow.test.mjs dev/scripts/relay-rehome-aggregate-evidence.test.mjs dev/scripts/relay-repository.test.mjs dev/scripts/relay-same-cap-script-census.test.mjs dev/scripts/relay-same-cap-shadow-gate.test.mjs dev/scripts/relay-staging-c4-refresh-workflow.test.mjs dev/scripts/relay-staging-capacity-identity.test.mjs dev/scripts/staging-relay-apply-guard.test.mjs dev/scripts/validate-relay-capacity-plan.test.mjs dev/scripts/verify-relay-capacity-transition.test.mjs dev/scripts/verify-relay-legacy-bootstrap.test.mjs dev/scripts/workload-identity-attribute-conditions.test.mjs", + "pretest": "node --test dev/scripts/capture-terraform-plan-baseline.test.mjs dev/scripts/operate-relay-asia-admission.test.mjs dev/scripts/prepare-relay-asia-director-cells.test.mjs dev/scripts/prepare-relay-asia-topology-input.test.mjs dev/scripts/production-cloud-sql-rollout-lock.test.mjs dev/scripts/read-relay-serving-regional-placement-version.test.mjs dev/scripts/relay-asia-rollout-evidence.test.mjs dev/scripts/relay-asia-topology-workflow.test.mjs dev/scripts/relay-cloud-sql-connection-budget.test.mjs dev/scripts/relay-load-reader-evidence.test.mjs dev/scripts/relay-lock-contention-alerts.test.mjs dev/scripts/relay-region-hint-metrics.test.mjs dev/scripts/relay-staging-deploy-identity.test.mjs dev/scripts/sanitize-relay-asia-admission-result.test.mjs dev/scripts/terraform-root-partition.test.mjs dev/scripts/validate-relay-asia-topology-plan.test.mjs ../.github/actions/cloud-sql-rollout-lease/action-contract.test.mjs ../.github/actions/cloud-sql-rollout-lease/storage-lease.test.mjs", + "test": "pnpm -r test && node --test dev/scripts/classify-relay-production-capacity-director.test.mjs dev/scripts/classify-relay-staging-bootstrap.test.mjs dev/scripts/deploy-relay-blue-green.test.mjs dev/scripts/deploy-relay-gce-candidate.test.mjs dev/scripts/deploy-relay-gce-multi-target.test.mjs dev/scripts/github-smoke-token.test.mjs dev/scripts/infra.test.mjs dev/scripts/operate-relay-regional-rehome.test.mjs dev/scripts/power-staging-relay.test.mjs dev/scripts/prepare-relay-capacity-canary.test.mjs dev/scripts/prepare-relay-production-capacity-canary.test.mjs dev/scripts/probe-relay-legacy-admission.test.mjs dev/scripts/probe-relay-rehome-trust.test.mjs dev/scripts/production-cell-image-digest-consistency.test.mjs dev/scripts/push-gateway-workflow.test.mjs dev/scripts/push-gateway-recovery.test.mjs dev/scripts/read-relay-production-capacity-identity.test.mjs dev/scripts/relay-admin-endpoint-retry-workflow.test.mjs dev/scripts/relay-admin-transient-retry.test.mjs dev/scripts/relay-admission-selector.test.mjs dev/scripts/relay-gce-terraform-fence.test.mjs dev/scripts/relay-load-connection-failure.test.mjs dev/scripts/relay-load-control-peer.test.mjs dev/scripts/relay-load-director-capacity-gate.test.mjs dev/scripts/relay-load-model.test.mjs dev/scripts/relay-load-phase-barrier.test.mjs dev/scripts/relay-load-placement-boundary.test.mjs dev/scripts/relay-load-profile.test.mjs dev/scripts/relay-load-rebind-boundary.test.mjs dev/scripts/relay-load-region-behavior.test.mjs dev/scripts/relay-load-request-unit-boundary.test.mjs dev/scripts/relay-load-run-lifecycle.test.mjs dev/scripts/relay-monitor-evidence.test.mjs dev/scripts/relay-production-capacity-wave.test.mjs dev/scripts/relay-production-capacity-workflow.test.mjs dev/scripts/relay-production-identity-boundaries.test.mjs dev/scripts/relay-production-same-cap-wave.test.mjs dev/scripts/relay-public-workflow-contract.test.mjs dev/scripts/relay-recovery-wave-gate.test.mjs dev/scripts/relay-region-observation-evidence.test.mjs dev/scripts/relay-rehome-aggregate-evidence.test.mjs dev/scripts/relay-repository.test.mjs dev/scripts/relay-same-cap-script-census.test.mjs dev/scripts/relay-same-cap-shadow-gate.test.mjs dev/scripts/relay-staging-c4-refresh-workflow.test.mjs dev/scripts/relay-staging-capacity-identity.test.mjs dev/scripts/staging-relay-apply-guard.test.mjs dev/scripts/validate-relay-capacity-plan.test.mjs dev/scripts/verify-relay-capacity-transition.test.mjs dev/scripts/verify-relay-legacy-bootstrap.test.mjs dev/scripts/workload-identity-attribute-conditions.test.mjs", "typecheck": "pnpm -r typecheck" }, "devDependencies": { diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 4e4443354fa7..e34688363730 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -943,7 +943,7 @@ "invariant": "One structured-send operation id causes at most one provider dispatch. A recorded or transport-ambiguous send reuses that id across retry, caller reconnect, client remount, and journal recovery; only a terminal rejection may rotate to a first delivery.", "oracle": "Inject adapter acknowledgement loss, RPC response loss, caller replacement, logical-client close after response, auth recovery with a written request, missing journal submissions, legacy pending rows, stale fences, operation expiry, mobile remount, and durable-journal capacity. Assert one provider dispatch or one operation id for every ambiguous retry, fresh identity only after rejection, and no eviction of ambiguous mobile ids.", "commands": [ - "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-session-operation-ledger.test.ts src/shared/structured-agent-session-send-disposition.test.ts src/main/runtime/agent-session-operation-admission.test.ts src/main/native-chat/agent-session-wire/structured-agent-session-refusal-retry.test.ts src/main/native-chat/agent-session-wire/structured-agent-session-send.test.ts src/main/runtime/orchestration/structured-mailbox-pointer-delivery.test.ts src/main/runtime/orchestration/structured-mailbox-pointer-host.test.ts src/main/runtime/orchestration/structured-pointer-operation-id.test.ts src/renderer/src/components/native-chat/use-structured-agent-session-outbox.test.tsx src/renderer/src/components/native-chat/use-structured-agent-session.test.tsx src/renderer/src/components/native-chat/NativeChatStructuredSession.transport-probe.test.tsx src/renderer/src/components/native-chat/NativeChatStructuredSessionDelivery.test.tsx src/renderer/src/lib/launch-structured-agent-session.test.ts", + "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-session-operation-ledger.test.ts src/shared/structured-agent-session-send-disposition.test.ts src/main/runtime/agent-session-operation-admission.test.ts src/main/native-chat/agent-session-wire/structured-agent-session-refusal-retry.test.ts src/main/native-chat/agent-session-wire/structured-agent-session-send.test.ts src/main/runtime/orchestration/structured-mailbox-pointer-delivery.test.ts src/main/runtime/orchestration/structured-mailbox-pointer-host.test.ts src/main/runtime/orchestration/structured-pointer-operation-id.test.ts src/renderer/src/components/native-chat/use-structured-agent-session-outbox.test.tsx src/renderer/src/components/native-chat/use-structured-agent-session.test.tsx src/renderer/src/components/native-chat/NativeChatStructuredSessionDelivery.test.tsx src/renderer/src/lib/launch-structured-agent-session.test.ts", "ORCA_BACKGROUND_LAUNCH=1 pnpm --dir mobile test ../mobile/src/session/mobile-native-chat-image-attachment.test.ts ../mobile/src/session/use-mobile-native-chat-image-attachments.test.ts ../mobile/src/session/mobile-structured-send-operation-journal.test.ts ../mobile/src/session/mobile-structured-session-operation-retention.test.ts ../mobile/src/session/mobile-structured-send-delivery.test.ts ../mobile/src/session/use-mobile-structured-agent-session-send.test.tsx ../mobile/src/session/use-mobile-structured-agent-session.test.tsx ../mobile/src/transport/mobile-relay-rpc-session.test.ts ../mobile/src/transport/rpc-client-delivery-ambiguity.test.ts ../mobile/src/transport/stable-logical-rpc-client.test.ts" ], "testFiles": [ @@ -957,7 +957,6 @@ "src/main/runtime/orchestration/structured-pointer-operation-id.test.ts", "src/renderer/src/components/native-chat/use-structured-agent-session-outbox.test.tsx", "src/renderer/src/components/native-chat/use-structured-agent-session.test.tsx", - "src/renderer/src/components/native-chat/NativeChatStructuredSession.transport-probe.test.tsx", "src/renderer/src/components/native-chat/NativeChatStructuredSessionDelivery.test.tsx", "src/renderer/src/lib/launch-structured-agent-session.test.ts", "mobile/src/session/mobile-native-chat-image-attachment.test.ts", @@ -1033,7 +1032,7 @@ "date": "2026-09-12", "runner": "local", "platform": "macos", - "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-session-operation-ledger.test.ts src/shared/structured-agent-session-send-disposition.test.ts src/main/runtime/agent-session-operation-admission.test.ts src/main/native-chat/agent-session-wire/structured-agent-session-refusal-retry.test.ts src/main/native-chat/agent-session-wire/structured-agent-session-send.test.ts src/main/runtime/orchestration/structured-mailbox-pointer-delivery.test.ts src/main/runtime/orchestration/structured-mailbox-pointer-host.test.ts src/main/runtime/orchestration/structured-pointer-operation-id.test.ts src/renderer/src/components/native-chat/use-structured-agent-session-outbox.test.tsx src/renderer/src/components/native-chat/use-structured-agent-session.test.tsx src/renderer/src/components/native-chat/NativeChatStructuredSession.transport-probe.test.tsx src/renderer/src/components/native-chat/NativeChatStructuredSessionDelivery.test.tsx src/renderer/src/lib/launch-structured-agent-session.test.ts", + "command": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-session-operation-ledger.test.ts src/shared/structured-agent-session-send-disposition.test.ts src/main/runtime/agent-session-operation-admission.test.ts src/main/native-chat/agent-session-wire/structured-agent-session-refusal-retry.test.ts src/main/native-chat/agent-session-wire/structured-agent-session-send.test.ts src/main/runtime/orchestration/structured-mailbox-pointer-delivery.test.ts src/main/runtime/orchestration/structured-mailbox-pointer-host.test.ts src/main/runtime/orchestration/structured-pointer-operation-id.test.ts src/renderer/src/components/native-chat/use-structured-agent-session-outbox.test.tsx src/renderer/src/components/native-chat/use-structured-agent-session.test.tsx src/renderer/src/components/native-chat/NativeChatStructuredSessionDelivery.test.tsx src/renderer/src/lib/launch-structured-agent-session.test.ts", "result": "passed", "durationSeconds": 22.1, "summary": "Thirteen focused host, shared, renderer, and orchestration files passed 148 tests." @@ -12353,7 +12352,7 @@ "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-pending-projection-admissions.test.ts src/main/ipc/ssh-pty-legacy-projection.test.ts src/main/ipc/ssh-pty-model-admission.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime-path-candidate-history.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/orca-runtime-tail-wait-memo.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-source-delivery-ledger.test.ts src/main/ssh/ssh-pty-retired-source-deliveries.test.ts src/main/ssh/ssh-relay-session.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/ssh/ssh-relay-session-incarnation.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-session-terminal-error.test.ts src/main/ssh/ssh-pty-recovery-retention-budget.test.ts src/main/ssh/relay-protocol-backpressure.test.ts src/relay/protocol-backpressure.test.ts src/relay/pty-source-credit-ledger.test.ts src/relay/pty-source-credit-scheduler.test.ts src/relay/relay-pty-source-publication.test.ts src/relay/ssh-pty-source-credit-adapter.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-source-delivery-ledger.test.ts src/main/ssh/ssh-pty-retired-source-deliveries.test.ts src/main/ssh/ssh-relay-session.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/ssh/ssh-relay-session-incarnation.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-session-terminal-error.test.ts src/main/ssh/ssh-pty-recovery-retention-budget.test.ts src/relay/protocol-backpressure.test.ts src/relay/pty-source-credit-ledger.test.ts src/relay/pty-source-credit-scheduler.test.ts src/relay/relay-pty-source-publication.test.ts src/relay/ssh-pty-source-credit-adapter.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/ssh-pty-model-admission.test.ts src/main/ipc/ssh-pty-output-model-migration.test.ts src/main/ssh/ssh-relay-session-model-migration.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/relay/git-response-stream-ownership.test.ts src/relay/pty-handler-output-streaming.test.ts --reporter=dot", "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-notification-routing.test.ts src/main/providers/ssh-pty-provider-agent-session-create-operation.test.ts src/main/providers/ssh-pty-provider-exit-race.test.ts src/main/providers/ssh-pty-provider-reattach-incarnation.test.ts --reporter=dot", @@ -12400,7 +12399,6 @@ "src/main/ssh/ssh-relay-session-terminal-error.test.ts", "src/main/ssh/ssh-pty-recovery-retention-budget.test.ts", "src/main/ssh/ssh-pty-retired-source-deliveries.test.ts", - "src/main/ssh/relay-protocol-backpressure.test.ts", "src/relay/protocol-backpressure.test.ts", "src/relay/git-response-stream-ownership.test.ts", "src/relay/pty-handler-output-streaming.test.ts", @@ -12617,13 +12615,6 @@ "invalid-checkpoint cancellation retains the exact delivery until restore response settlement, then retry mints a fresh activation and emits one live source frame" ] }, - { - "file": "src/main/ssh/relay-protocol-backpressure.test.ts", - "assertions": [ - "main SSH decoder accepts one maximum frame plus 1 MiB partial input and rejects one extra byte", - "a throwing continuation clears retained input, releases one pause epoch, and publishes one typed ownership error" - ] - }, { "file": "src/relay/protocol-backpressure.test.ts", "assertions": [ @@ -12812,7 +12803,7 @@ "date": "2026-07-29", "runner": "local", "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-source-delivery-ledger.test.ts src/main/ssh/ssh-pty-retired-source-deliveries.test.ts src/main/ssh/ssh-relay-session.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/ssh/ssh-relay-session-incarnation.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-session-terminal-error.test.ts src/main/ssh/ssh-pty-recovery-retention-budget.test.ts src/main/ssh/relay-protocol-backpressure.test.ts src/relay/protocol-backpressure.test.ts src/relay/pty-source-credit-ledger.test.ts src/relay/pty-source-credit-scheduler.test.ts src/relay/relay-pty-source-publication.test.ts src/relay/ssh-pty-source-credit-adapter.test.ts --reporter=dot", + "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-source-delivery-ledger.test.ts src/main/ssh/ssh-pty-retired-source-deliveries.test.ts src/main/ssh/ssh-relay-session.test.ts src/main/ssh/ssh-relay-session-data-delivery.test.ts src/main/ssh/ssh-relay-session-recovery-races.test.ts src/main/ssh/ssh-relay-session-incarnation.test.ts src/main/ssh/ssh-relay-session-reconnect-incarnation.test.ts src/main/ssh/ssh-relay-session-terminal-error.test.ts src/main/ssh/ssh-pty-recovery-retention-budget.test.ts src/relay/protocol-backpressure.test.ts src/relay/pty-source-credit-ledger.test.ts src/relay/pty-source-credit-scheduler.test.ts src/relay/relay-pty-source-publication.test.ts src/relay/ssh-pty-source-credit-adapter.test.ts --reporter=dot", "result": "passed", "durationSeconds": 2.24, "summary": "Sixteen deterministic SSH relay/session/source/decoder files passed 192 tests, including exit-sealed private recovery, retained stale-transfer cancellation authority, exact private-frame proof watermarks, one retirement record across 10,000 same-PTY token rotations, stale-owner fallback, and scheduler rejection isolation; no live topology was exercised." @@ -15501,7 +15492,7 @@ "oracle": "Seed status, dispatch, and worker_done rows across direct-handle and canonical Run recipients in an isolated DB. Compare pointer count, RPC and built-CLI check output, direct SQLite rows, unread/peek/all/type filters, concurrent pollers, fixed Delivery IDs, explicit acknowledgment, restart, filtered check --wait, and coordinator remint. Route a 125-row old-handle backlog, inject a commit without notification, and require startup repair. Exercise duplicate Run/Dispatch owners, stale panes, 50-row pages, cancellation, lifecycle fencing, and absent PTYs. Drop a federation ACK, reconnect/restart v1/v2 peers, and require stable import plus no duplicate read-row wake. Hold a healthy SSH write past five seconds but below the 60-second settlement deadline, then distinguish the three settlement outcomes end to end: only a proven refusal releases the reservation and drains a delivery parked behind the watermark; a dropped in-flight settlement must surface as unverifiable with bytes handed to the transport, preserve the durable write-attempted reservation, and emit no duplicate pointer after restart; a settled write that throws mid-pointer is unverifiable, not a refusal; and an Enter whose settlement is lost stays at enter-attempted so restart emits no second Enter. Install the production PTY controller and verify that it routes settled writes through the owning provider and refuses before any byte when the routed provider cannot settle. Census every production PTY provider class and reject a settlement synthesized from the fire-and-forget write.", "commands": [ "pnpm run build:cli && pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-message-delivery-identity.test.ts --reporter=dot --testTimeout=5000", - "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing-races.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-detached-routing.test.ts src/main/runtime/orchestration-mailbox-transport-settlement.test.ts src/main/ipc/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-write.test.ts src/main/providers/settled-pty-writer-census.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts", + "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing-races.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-detached-routing.test.ts src/main/runtime/orchestration-mailbox-transport-settlement.test.ts src/main/ipc/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-write.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/terminal-send-stale-leaf-liveness.test.ts src/main/runtime/rpc/methods/orchestration/runs/runs.test.ts src/main/runtime/rpc/methods/orchestration/messaging/send.test.ts src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration/federation-sync.test.ts src/main/runtime/rpc/methods/orchestration/federation/federation.test.ts src/main/runtime/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts --reporter=dot" ], @@ -15518,7 +15509,6 @@ "src/main/runtime/orchestration/formatter.test.ts", "src/main/providers/ssh-pty-provider.test.ts", "src/main/providers/ssh-pty-write.test.ts", - "src/main/providers/settled-pty-writer-census.test.ts", "src/main/runtime/orchestration/mailbox-pointer-stage.test.ts", "src/main/daemon/client.test.ts", "src/main/daemon/daemon-pty-router.test.ts", @@ -15620,13 +15610,6 @@ "file": "src/main/runtime/orchestration/mailbox-pointer-stage.test.ts", "assertions": ["a refused pointer write drains a delivery parked behind its watermark"] }, - { - "file": "src/main/providers/settled-pty-writer-census.test.ts", - "assertions": [ - "every production IPtyProvider class exposes a settled writer", - "no settled writer synthesizes its settlement from the fire-and-forget write" - ] - }, { "file": "src/main/ipc/pty-controller-ownership-routing.test.ts", "assertions": [ @@ -15666,7 +15649,7 @@ "date": "2026-09-05", "runner": "local", "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing-races.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-detached-routing.test.ts src/main/runtime/orchestration-mailbox-transport-settlement.test.ts src/main/ipc/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-write.test.ts src/main/providers/settled-pty-writer-census.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts", + "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing-races.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-detached-routing.test.ts src/main/runtime/orchestration-mailbox-transport-settlement.test.ts src/main/ipc/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-write.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts", "result": "passed", "durationSeconds": 4.73, "summary": "267 tests passed after the pointer-write path moved to the three-valued WriteSettlement union. New coverage: a dropped in-flight SSH settlement reaches the stager as unverifiable with bytes handed to the transport, a settled write that throws mid-pointer preserves the write-attempted reservation, an Enter whose settlement is lost stays at enter-attempted with no second Enter after restart, a refusal releases the reservation and drains a delivery parked behind its watermark, the production controller refuses before any byte when the routed provider cannot settle, and a census pins the five production IPtyProvider classes and rejects a settlement synthesized from the fire-and-forget write. Each new assertion was verified red against the pre-fix shape." @@ -15675,7 +15658,7 @@ "date": "2026-08-13", "runner": "local", "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing-races.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-detached-routing.test.ts src/main/runtime/orchestration-mailbox-transport-settlement.test.ts src/main/ipc/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-write.test.ts src/main/providers/settled-pty-writer-census.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts", + "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing-races.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-detached-routing.test.ts src/main/runtime/orchestration-mailbox-transport-settlement.test.ts src/main/ipc/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/providers/ssh-pty-provider.test.ts src/main/providers/ssh-pty-write.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts", "result": "passed", "durationSeconds": 8.22, "summary": "245 tests passed across mailbox identity, durable coordinator-handle migration, insertion-time canonicalization, duplicate-free 51-row ownership branch caps, unrestricted reservation merging, direct and Dispatch pointer suppression, persisted reconciliation, 50-row paging and filtered waits, cross-PTY serialization, lifecycle fencing, bounded daemon and SSH transport settlement, outstanding Deliveries, reminted Dispatch ownership, acknowledgment, cancellation, and bounded pane lookup." diff --git a/config/scripts/bun-profile-change-scope.test.mjs b/config/scripts/bun-profile-change-scope.test.mjs index ef21fed5e344..15258cea96d9 100644 --- a/config/scripts/bun-profile-change-scope.test.mjs +++ b/config/scripts/bun-profile-change-scope.test.mjs @@ -119,15 +119,13 @@ describe('the actual Bun build and profile-test dependency graph', () => { expect((await classifyBunProfileChanges([file], async () => inputs)).shouldRun).toBe(true) }) - it('retains all selected tests and uses the same selectors as the Bun runner', () => { + it('retains all selected tests and the selectors the Bun runner uses', () => { const tests = discoverBunProfileTests() expect(tests.length).toBeGreaterThan(80) expect(tests.every((file) => inputs.has(file))).toBe(true) expect( bunProfileTestPaths().every((selector) => tests.some((file) => file.includes(selector))) ).toBe(true) - const runner = readFileSync(new URL('./run-bun-profile-tests.mjs', import.meta.url), 'utf8') - expect(runner).toContain('testArgs.length > 0 ? testArgs : bunProfileTestPaths({ artifact })') }) }) diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 664e82686623..795f6070bafb 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -193,7 +193,6 @@ "config/scripts/package-electron-runtime-contract.test.mjs": 447, "config/scripts/package-linux-formats.test.mjs": 208, "config/scripts/packaged-browser-lane-contract.test.mjs": 104, - "config/scripts/packaged-hang-watchdog-worker-contract.test.mjs": 161, "config/scripts/packaged-node-pty-prebuild-prune.test.mjs": 93, "config/scripts/packaged-source-map-prune.test.mjs": 117, "config/scripts/patched-dependencies-frozen-install.test.mjs": 900, diff --git a/config/scripts/cli-main-module-bundle-parity.test.ts b/config/scripts/cli-main-module-bundle-parity.test.ts deleted file mode 100644 index b545579facfe..000000000000 --- a/config/scripts/cli-main-module-bundle-parity.test.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { readFileSync, readdirSync } from 'node:fs' -import { join, matchesGlob, resolve } from 'node:path' -import { createRequire } from 'node:module' -import { describe, expect, it } from 'vitest' -import { electronViteConfig } from '../../electron.vite.config' -import { GUARDED_ENTRY_NAMES } from '../build-plugins/plain-node-entry-guard' - -const REPO_ROOT = resolve(__dirname, '..', '..') -const CLI_ROOT = join(REPO_ROOT, 'src', 'cli') -const packaging = createRequire(import.meta.url)('../electron-builder.config.cjs') - -function listCliSourceFiles(dir: string): string[] { - return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => { - const path = join(dir, entry.name) - if (entry.isDirectory()) { - return listCliSourceFiles(path) - } - return entry.isFile() && entry.name.endsWith('.ts') && !entry.name.endsWith('.test.ts') - ? [path] - : [] - }) -} - -// Why: `import type` is erased by tsc, so it needs no emitted module at runtime. -const VALUE_IMPORT_FROM_MAIN = /(? { - const source = readFileSync(file, 'utf-8') - return [ - ...source.matchAll(VALUE_IMPORT_FROM_MAIN), - ...source.matchAll(DYNAMIC_IMPORT_FROM_MAIN) - ].map((match) => ({ - file: file.slice(REPO_ROOT.length + 1), - module: match[1].replace(/\.js$/, '') - })) - }) -} - -function findElectronViteMainEntries(): Record { - const input = electronViteConfig.main?.build?.rollupOptions?.input - if (!input || typeof input !== 'object' || Array.isArray(input)) { - throw new Error('Expected named main-process inputs') - } - return input -} - -describe('CLI imports of main-process modules', () => { - // Why: electron-vite cleans out/main and emits only its declared entries, so a - // `src/main/*` module the CLI imports but the config omits is deleted by the - // build that runs after `build:cli` — keep source-level feedback ahead of the - // final-artifact runtime verifier. - it('has an electron-vite entry for every main module the CLI imports', () => { - const entries = findElectronViteMainEntries() - const missing = findMainImports().filter( - ({ module }) => entries[module] !== join(REPO_ROOT, 'src', 'main', `${module}.ts`) - ) - - expect(missing).toEqual([]) - }) - - it('guards every CLI main module against Electron imports', () => { - const guarded = new Set(GUARDED_ENTRY_NAMES) - expect(findMainImports().filter(({ module }) => !guarded.has(module))).toEqual([]) - }) - - it('unpacks every CLI main entry for plain Node outside Electron', () => { - const missing = findMainImports().filter( - ({ module }) => - !packaging.asarUnpack.some((pattern: string) => - matchesGlob(`out/main/${module}.js`, pattern) - ) - ) - expect(missing).toEqual([]) - }) - - it('finds the imports it is meant to guard', () => { - // Why: a broken matcher would make the guard above vacuously pass. - expect(findMainImports()).toContainEqual({ - file: join('src', 'cli', 'profile-state-location.ts'), - module: 'persistence/profile-state/profile-state-active-location' - }) - expect(findMainImports()).toContainEqual({ - file: join('src', 'cli', 'handlers', 'agent-hooks.ts'), - module: 'orca-profiles/profile-index-store' - }) - expect(findMainImports().length).toBeGreaterThanOrEqual(2) - expect(Object.keys(findElectronViteMainEntries()).length).toBeGreaterThanOrEqual(2) - }) -}) diff --git a/config/scripts/client-hosted-browser-package-coverage.test.mjs b/config/scripts/client-hosted-browser-package-coverage.test.mjs index f7f1ceb5995e..204cf162e550 100644 --- a/config/scripts/client-hosted-browser-package-coverage.test.mjs +++ b/config/scripts/client-hosted-browser-package-coverage.test.mjs @@ -19,13 +19,6 @@ describe('client-hosted browser package coverage', () => { expect(steps[boundaries].run).not.toContain(file) }) - it('bundles the WSL browser-network relay with its version stamp', () => { - const relayBuild = readFileSync(join(projectDir, 'config/scripts/build-relay.mjs'), 'utf8') - - expect(relayBuild).toContain("outfile: join(outDir, 'wsl-browser-network-relay.js')") - expect(relayBuild).toContain("join(outDir, '.browser-network-version')") - }) - it('runs client-hosted Electron lifecycle coverage on native package hosts', () => { const prWorkflow = readFileSync(join(projectDir, '.github/workflows/pr.yml'), 'utf8') const parsedWorkflow = parse(prWorkflow) diff --git a/config/scripts/computer-e2e-workflow.test.mjs b/config/scripts/computer-e2e-workflow.test.mjs index fc605bac5bdc..3e31ccf5a807 100644 --- a/config/scripts/computer-e2e-workflow.test.mjs +++ b/config/scripts/computer-e2e-workflow.test.mjs @@ -6,197 +6,6 @@ import { parse } from 'yaml' const projectDir = resolve(import.meta.dirname, '../..') describe('computer-use e2e workflow', () => { - it('cancels superseded pull request runs without cancelling scheduled runs', () => { - const workflow = parse( - readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') - ) - - expect(workflow.concurrency).toEqual({ - group: 'computer-e2e-${{ github.event.pull_request.number || github.ref }}', - 'cancel-in-progress': "${{ github.event_name == 'pull_request' }}" - }) - }) - - it('runs computer-use e2e files serially because they share desktop focus', () => { - const config = readFileSync(join(projectDir, 'tests/e2e/vitest.config.ts'), 'utf8') - - expect(config).toContain('fileParallelism: false') - }) - - it('guards e2e source against fragile waits and Windows Calculator drift', () => { - const driver = readFileSync(join(projectDir, 'tests/e2e/helpers/computer-driver.ts'), 'utf8') - const cliDriver = readFileSync( - join(projectDir, 'tests/e2e/helpers/computer-cli-driver.ts'), - 'utf8' - ) - const windowsStoreE2e = readFileSync( - join(projectDir, 'tests/e2e/computer-windows-store.e2e.ts'), - 'utf8' - ) - - expect(driver).not.toContain('await delay(3500)') - expect(driver).toContain("await waitForComputerWindowTitle('gedit', fileName, 15000)") - expect(cliDriver).toContain('ORCA_DEV_USER_DATA_PATH') - expect(cliDriver).toContain('orca-computer-runtime-') - expect(cliDriver).toContain('retryMissingRuntimeMetadata') - expect(cliDriver).toContain('Could not read Orca runtime metadata') - expect(cliDriver).toContain("'serve', '--no-pairing', '--json'") - - expect(windowsStoreE2e).toContain("app.bundleId === 'ApplicationFrameHost'") - expect(windowsStoreE2e).toContain("app.bundleId === 'win32calc'") - expect(windowsStoreE2e).toContain('buttonIndex >= 0') - expect(windowsStoreE2e).toContain('pane(?:\\s|$)/m') - expect(windowsStoreE2e).toContain('String(clickIndex)') - expect(windowsStoreE2e).not.toContain( - "for (const buttonName of ['One', 'Plus', 'Two', 'Equals'])" - ) - }) - - it('triggers on computer-use shared contracts, scripts, and agent skill changes', () => { - const workflow = parse( - readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') - ) - const triggerPaths = workflow.on.pull_request.paths - - expect(triggerPaths).toEqual( - expect.arrayContaining([ - 'config/scripts/computer-e2e-workflow.test.mjs', - 'config/scripts/macos-computer-helper-owner-loss-group-recovery.test.mjs', - 'config/scripts/computer-use-modifier-safety.test.mjs', - 'config/scripts/computer-use-skill-guidance.test.mjs', - 'config/scripts/computer-use-smoke.mjs', - 'config/scripts/computer-use-smoke.test.mjs', - 'skills/computer-use/SKILL.md', - 'src/main/computer/**', - 'src/main/runtime/rpc/dispatcher.ts', - 'src/main/runtime/rpc/errors.ts', - 'src/main/runtime/rpc/methods/computer*.ts', - 'src/shared/computer-use-*.ts', - 'tests/e2e/vitest.config.ts' - ]) - ) - expect(triggerPaths).not.toContain('src/shared/runtime-types.ts') - }) - - it('runs focused computer-use regression tests in the PR native-smoke job', () => { - const workflow = parse( - readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') - ) - const nativeSmokeRuns = workflow.jobs['native-smoke'].steps - .map((step) => step.run) - .filter((run) => typeof run === 'string') - const checkout = workflow.jobs['native-smoke'].steps.find( - (step) => step.uses === 'actions/checkout@v6' - ) - const regressionRun = nativeSmokeRuns.find((run) => run.includes('pnpm vitest run')) - const expectedRegressionFiles = [ - 'config/scripts/macos-computer-helper-owner-loss-group-recovery.test.mjs', - 'config/scripts/macos-computer-helper-owner-loss-processes.test.mjs', - 'config/scripts/computer-use-modifier-safety.test.mjs', - 'config/scripts/computer-use-skill-guidance.test.mjs', - 'config/scripts/computer-use-smoke.test.mjs', - 'src/main/computer/computer-provider-lifecycle.test.ts', - 'src/main/computer/computer-provider-unavailable-message.test.ts', - 'src/main/computer/sidecar-client.test.ts', - 'src/main/computer/macos-native-provider-client.test.ts', - 'src/main/computer/macos-native-provider-socket.test.ts', - 'src/main/computer/macos-computer-use-permissions.test.ts', - 'src/main/computer/macos-computer-use-permission-status.test.ts', - 'src/main/computer/desktop-script-provider-client.test.ts', - 'src/main/computer/desktop-script-provider-cache.test.ts', - 'src/main/computer/desktop-script-provider-actions.test.ts', - 'src/main/computer/desktop-script-provider-cache-lifecycle.test.ts', - 'src/main/computer/desktop-script-provider-errors.test.ts', - 'src/main/computer/desktop-script-provider-action-errors.test.ts', - 'src/shared/computer-use-error-recovery.test.ts', - 'src/shared/computer-use-key-spec.test.ts', - 'src/cli/format.test.ts', - 'src/cli/handlers/computer.test.ts', - 'src/cli/handlers/computer-action-routing.test.ts', - 'src/cli/handlers/computer-action-validation.test.ts', - 'src/cli/handlers/computer-state-formatting.test.ts', - 'src/cli/specs/computer.test.ts', - 'src/cli/index.test.ts', - 'src/main/runtime/rpc/dispatcher-computer-errors.test.ts', - 'src/main/runtime/rpc/errors.test.ts', - 'src/main/runtime/rpc/methods/computer.test.ts', - 'src/main/runtime/rpc/methods/computer-actions.test.ts', - 'src/cli/runtime/envelope-schema.test.ts', - 'src/shared/remote-runtime-client.test.ts' - ] - - expect(checkout.with['persist-credentials']).toBe(false) - expect(regressionRun).toBeTruthy() - for (const file of expectedRegressionFiles) { - expect(regressionRun).toContain(file) - } - }) - - it('keeps Linux native imports available without installing the GUI-only stack in PR smoke', () => { - const workflow = parse( - readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') - ) - const nativeSmokeInstall = workflow.jobs['native-smoke'].steps.find( - (step) => step.if === "runner.os == 'Linux'" - ) - const scheduledLinuxInstall = workflow.jobs.linux.steps.find((step) => - step.run?.includes('apt-get install') - ) - - expect(nativeSmokeInstall.run).toContain('python3') - expect(nativeSmokeInstall.run).toContain('python3-gi') - expect(nativeSmokeInstall.run).toContain('gir1.2-atspi-2.0') - expect(nativeSmokeInstall.run).toContain('at-spi2-core') - expect(nativeSmokeInstall.run).not.toContain('gedit') - expect(nativeSmokeInstall.run).not.toContain('xvfb') - expect(nativeSmokeInstall.run).not.toContain('xdotool') - expect(scheduledLinuxInstall.run).toContain('gedit') - expect(scheduledLinuxInstall.run).toContain('xvfb') - expect(scheduledLinuxInstall.run).toContain('xdotool') - }) - - it('builds and tests the macOS helper on every trigger without hosted TCC e2e', () => { - const workflow = parse( - readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') - ) - const job = workflow.jobs['mac-native-owner-smoke'] - const runs = job.steps.map((step) => step.run).filter((run) => typeof run === 'string') - const checkout = job.steps.find((step) => step.uses === 'actions/checkout@v6') - const install = job.steps.find( - (step) => step.uses === './.github/actions/install-node-dependencies' - ) - - expect(job.if).toBeUndefined() - expect(job['runs-on']).toBe('macos-15') - expect(checkout.with['persist-credentials']).toBe(false) - expect(install.with['native-runtime']).toBe('electron') - expect(runs).toContain('pnpm bench:macos-computer-helper-owner-loss --expect reaped --trials 1') - const cleanupRun = runs.find((run) => - run.includes('config/scripts/macos-computer-helper-owner-loss-processes.test.mjs') - ) - expect(cleanupRun).toContain( - 'config/scripts/macos-computer-helper-owner-loss-group-recovery.test.mjs' - ) - expect(runs).toContain('pnpm verify:computer-native') - expect( - runs.find((run) => run.includes('config/scripts/build-native-for-platform.test.mjs')) - ).toContain('--config config/vitest.config.ts') - expect(runs.join('\n')).not.toContain('test:e2e:computer') - expect(workflow.jobs.mac).toBeUndefined() - expect(workflow.on.pull_request.paths).toEqual( - expect.arrayContaining([ - 'config/scripts/build-native-for-platform.mjs', - 'config/scripts/build-native-for-platform.test.mjs', - 'config/scripts/macos-computer-helper-owner-loss-benchmark.mjs', - 'config/scripts/macos-computer-helper-owner-loss-group-recovery.test.mjs', - 'config/scripts/macos-computer-helper-owner-loss-metrics.mjs', - 'config/scripts/macos-computer-helper-owner-loss-processes.mjs', - 'config/scripts/macos-computer-helper-owner-loss-processes.test.mjs', - 'config/scripts/macos-computer-helper-owner-loss-trial-cleanup.mjs' - ]) - ) - }) - it('uses the cached Electron dependency path for scheduled Linux and Windows e2e', () => { const workflow = parse( readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') @@ -220,29 +29,6 @@ describe('computer-use e2e workflow', () => { } }) - it('runs deterministic macOS owner-loss benchmark cleanup coverage', () => { - const benchmark = readFileSync( - join(projectDir, 'config/scripts/macos-computer-helper-owner-loss-benchmark.mjs'), - 'utf8' - ) - const cleanup = readFileSync( - join(projectDir, 'config/scripts/macos-computer-helper-owner-loss-trial-cleanup.mjs'), - 'utf8' - ) - - expect(benchmark).toContain('spawnBenchmarkProcess(executable, [launcherDir]') - expect(benchmark).toContain("stdio: ['ignore', stdoutDescriptor, stderrDescriptor]") - expect(benchmark).toContain('cleanupOwnerLossTrial({') - const parseIndex = benchmark.indexOf('parseBenchmarkTrialResult(serializedResult)') - const cleanupIndex = benchmark.indexOf('cleanupOwnerLossTrial({') - expect(parseIndex).toBeGreaterThanOrEqual(0) - expect(cleanupIndex).toBeGreaterThanOrEqual(0) - expect(parseIndex).toBeLessThan(cleanupIndex) - expect(benchmark).toContain('trialCleanupSha256: artifactSha256(trialCleanupPath)') - expect(cleanup).toContain('killRecordedAndMatchingProcesses(options.recordPath') - expect(cleanup).toContain("signalValidatedProcessGroup(options.pid, options.marker, 'SIGKILL'") - }) - it('boots the built daemon under plain Node in the PR native-smoke job after the main build', () => { const workflow = parse( readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') @@ -279,34 +65,6 @@ describe('computer-use e2e workflow', () => { ) }) - it('re-runs the native-smoke job when the daemon bundle graph changes', () => { - const workflow = parse( - readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') - ) - const triggerPaths = workflow.on.pull_request.paths - - expect(triggerPaths).toEqual( - expect.arrayContaining([ - 'config/scripts/daemon-boot-smoke.mjs', - 'config/scripts/windows-daemon-workspace-close-repro.mjs', - 'electron.vite.config.ts', - 'config/build-plugins/**', - 'src/main/daemon/**' - ]) - ) - }) - - it('does not run computer-use e2e in PR smoke jobs', () => { - const workflow = parse( - readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') - ) - const nativeSmokeRuns = workflow.jobs['native-smoke'].steps - .map((step) => step.run) - .filter((run) => typeof run === 'string') - - expect(nativeSmokeRuns.join('\n')).not.toContain('test:e2e:computer') - }) - it('builds Electron main output before every computer-use e2e run', () => { const workflow = parse( readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') @@ -352,48 +110,4 @@ describe('computer-use e2e workflow', () => { expect(allRuns.join('\n')).toContain('test:e2e:computer') expect(allRuns.join('\n')).not.toContain('test:e2e:computer -- --reporter') }) - - it('runs Linux e2e on schedule without advertising hosted macOS TCC coverage', () => { - const workflow = parse( - readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') - ) - const triggerPaths = workflow.on.pull_request.paths - const linuxRuns = workflow.jobs.linux.steps - .map((step) => step.run) - .filter((run) => typeof run === 'string') - - expect(triggerPaths).toEqual( - expect.arrayContaining([ - 'tests/e2e/computer-linux.e2e.ts', - 'tests/e2e/helpers/computer-cli-driver.ts', - 'tests/e2e/helpers/computer-driver.ts' - ]) - ) - expect(triggerPaths).not.toContain('tests/e2e/computer-mac.e2e.ts') - expect(triggerPaths).not.toContain('tests/e2e/computer-mac-safari.e2e.ts') - expect(workflow.jobs.mac).toBeUndefined() - expect(linuxRuns).toContain( - 'xvfb-run --auto-servernum dbus-run-session -- pnpm test:e2e:computer --reporter=verbose tests/e2e/computer-linux.e2e.ts' - ) - }) - - it('runs every Windows computer-use e2e file in the scheduled Windows job', () => { - const workflow = parse( - readFileSync(join(projectDir, '.github/workflows/computer-e2e.yml'), 'utf8') - ) - const triggerPaths = workflow.on.pull_request.paths - const windowsRuns = workflow.jobs.windows.steps - .map((step) => step.run) - .filter((run) => typeof run === 'string') - - expect(triggerPaths).toEqual( - expect.arrayContaining([ - 'tests/e2e/computer-windows.e2e.ts', - 'tests/e2e/computer-windows-store.e2e.ts' - ]) - ) - expect(windowsRuns).toContain( - 'pnpm test:e2e:computer --reporter=verbose tests/e2e/computer-windows.e2e.ts tests/e2e/computer-windows-store.e2e.ts' - ) - }) }) diff --git a/config/scripts/electron-vite-output-contract.test.ts b/config/scripts/electron-vite-output-contract.test.ts index 958e461ffd94..da6d45c8a230 100644 --- a/config/scripts/electron-vite-output-contract.test.ts +++ b/config/scripts/electron-vite-output-contract.test.ts @@ -20,9 +20,6 @@ import { createRequire } from 'node:module' import { electronViteConfig } from '../../electron.vite.config' import { BOOTSTRAP_FATAL_EXIT_GUARD_KEY } from '../../src/main/startup/bootstrap-fatal-exit-guard' -const targetConfig = readFileSync('config/electron-vite-target.config.cts', 'utf8') -const devRunner = readFileSync('config/scripts/run-electron-vite-dev.mjs', 'utf8') - type BootstrapProcessMock = EventEmitter & { env: Record pid: number @@ -253,11 +250,6 @@ describe('Electron Vite output contract', () => { ) }) - it('rejects prototype properties as build targets', () => { - // Own-property check only: an inherited key like `constructor` must not select a build target. - expect(targetConfig).toContain('Object.hasOwn(configByTarget, target)') - }) - it('gives the dev terminal daemon helper the TCC identity watched by Orca', () => { // Asserted on the values rather than the source text: the ids moved into // dev-electron-bundle-identity.mjs so every dev bundle signs to one cdhash. @@ -265,7 +257,5 @@ describe('Electron Vite output contract', () => { expect(getDevHelperPlistPatches()).toEqual([ { key: 'CFBundleIdentifier', value: DEV_HELPER_BUNDLE_ID } ]) - expect(devRunner).toContain("'Electron Helper.app',") - expect(devRunner).toContain('setPlistValue(helperPlistPath, key, value)') }) }) diff --git a/config/scripts/headless-serve-shutdown-workflow.test.mjs b/config/scripts/headless-serve-shutdown-workflow.test.mjs index 77b92b1d0c34..d9de91f28da6 100644 --- a/config/scripts/headless-serve-shutdown-workflow.test.mjs +++ b/config/scripts/headless-serve-shutdown-workflow.test.mjs @@ -4,53 +4,8 @@ import { parse } from 'yaml' import { describe, expect, it } from 'vitest' const workflow = parse(readFileSync('.github/workflows/pr.yml', 'utf8')) -const headlessLinuxGuide = readFileSync('docs/reference/headless-linux-server.md', 'utf8') -const signalCase = readFileSync('config/docker/headless-serve-shutdown/run-signal-case.sh', 'utf8') -const shutdownDockerRunner = readFileSync( - 'config/scripts/run-headless-serve-shutdown-docker.mjs', - 'utf8' -) -const shutdownDockerfile = readFileSync('config/docker/headless-serve-shutdown/Dockerfile', 'utf8') -const desktopStartupOracle = readFileSync( - 'config/docker/headless-serve-shutdown/run-appimage-desktop-startup-case.sh', - 'utf8' -) -const headlessLinuxProse = headlessLinuxGuide.replace(/\s+/g, ' ') - -function readSystemdUnitBlocks(doc, unitName) { - const escapedUnitName = unitName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - return [...doc.matchAll(new RegExp(`^# /etc/systemd/system/${escapedUnitName}$`, 'gm'))].map( - (match) => { - const start = match.index + match[0].length - const end = doc.indexOf('```', start) - const nextUnitHeaderOffset = doc.slice(start).search(/^# \/etc\/systemd\/system\/.+$/m) - const nextUnitHeader = nextUnitHeaderOffset === -1 ? -1 : start + nextUnitHeaderOffset - if (end === -1 || (nextUnitHeader !== -1 && end > nextUnitHeader)) { - throw new Error(`Missing closing code fence for ${unitName}`) - } - return doc.slice(start, end) - } - ) -} describe('headless serve shutdown PR gate', () => { - it('reads only exact, closed systemd unit blocks', () => { - expect( - readSystemdUnitBlocks('# /etc/systemd/system/orca-serveXservice\n```', 'orca-serve.service') - ).toEqual([]) - expect(() => - readSystemdUnitBlocks('# /etc/systemd/system/orca-serve.service\n', 'orca-serve.service') - ).toThrow('Missing closing code fence for orca-serve.service') - expect(() => - readSystemdUnitBlocks( - '# /etc/systemd/system/orca-serve.service\n' + - 'KillMode=mixed\n' + - '# /etc/systemd/system/other.service\n```', - 'orca-serve.service' - ) - ).toThrow('Missing closing code fence for orca-serve.service') - }) - it('packages Linux artifacts before running the Docker signal oracle', () => { const steps = workflow.jobs.package.steps const packageStep = steps.find((step) => step.name === 'Package unpacked app') @@ -72,130 +27,4 @@ describe('headless serve shutdown PR gate', () => { steps.filter((step) => step.run?.includes('run-headless-serve-shutdown-docker.mjs')) ).toHaveLength(1) }) - - it('keeps readiness polling finite and leak-free', () => { - expect(signalCase).toContain('read_ready_line()') - expect(signalCase).toContain("sed -u -n 's/^[^{]*//p'") - expect(signalCase).toContain('startup_timeout_seconds=${ORCA_STARTUP_TIMEOUT_SECONDS:-180}') - expect(signalCase).toContain('startup_deadline=$((SECONDS + startup_timeout_seconds))') - expect(signalCase).toContain('while (( SECONDS < startup_deadline )); do') - expect(signalCase).toContain('kill -0 "$app_pid" 2>/dev/null || break') - expect(signalCase).toContain( - "jq's `inputs` waits for EOF even when wrapped in `first`, so a tail -F" - ) - expect(signalCase).not.toContain('tail --pid=') - }) - - it('gives owned shutdown state a bounded cleanup grace', () => { - expect(signalCase).toContain('for shutdown_poll in {0..50}; do') - expect(signalCase).toContain('[[ -z "$listener_after" && -z "$owned_residue" ]]') - expect(signalCase).toContain('((${#survivors[@]} == 0))') - expect(signalCase).toContain('((shutdown_poll < 50)) && sleep 0.1') - }) - - it('checks that a serving-electron signal target owns the ready socket', () => { - const ssRecord = - 'LISTEN 0 128 127.0.0.1:41235 0.0.0.0:* users:(("orca-ide",pid=23,fd=7),("orca-ide",pid=25,fd=8))' - expect([...ssRecord.matchAll(/pid=([0-9]+)/g)].map((match) => match[1])).toEqual(['23', '25']) - expect(signalCase).toContain( - 'listener_before_pids=$(grep -oE \'pid=[0-9]+\' <<<"$listener_before" | cut -d= -f2 || true)' - ) - expect(signalCase).toContain('signal_target_pid=$(head -n1 <<<"$listener_before_pids")') - expect(signalCase).toContain('outside the entrypoint process tree') - }) - - it('runs the original AppImage desktop startup oracle before extraction and signals', () => { - expect(shutdownDockerfile).toContain( - 'COPY run-appimage-desktop-startup-case.sh /usr/local/bin/run-appimage-desktop-startup-case' - ) - const startupCall = shutdownDockerRunner.indexOf( - 'runDesktopStartupOracle({ image, appImage, platform })' - ) - const extractionCall = shutdownDockerRunner.indexOf( - "'timeout --kill-after=10s 120s /input/orca.AppImage --appimage-extract" - ) - const signalLoop = shutdownDockerRunner.indexOf("for (const signal of ['INT', 'TERM'])") - expect(startupCall).toBeGreaterThan(-1) - expect(extractionCall).toBeGreaterThan(startupCall) - expect(signalLoop).toBeGreaterThan(startupCall) - expect(shutdownDockerRunner).toContain("'/usr/local/bin/run-appimage-desktop-startup-case'") - }) - - it('preserves startup logs when the launcher exits before its marker', () => { - expect(desktopStartupOracle).toContain('signal_process_group TERM || true') - expect(desktopStartupOracle).toContain('signal_process_group KILL || true') - expect(desktopStartupOracle).toContain('cat "$stdout_log" >&2 2>/dev/null || true') - expect(desktopStartupOracle).toContain('cat "$stderr_log" >&2 2>/dev/null || true') - expect(desktopStartupOracle).toContain( - 'FAIL: desktop launcher exited before ${reason} (status=${observed_status})' - ) - expect(desktopStartupOracle).toContain('ORCA_STARTUP_STATE_DIR_CLEANUP=1') - expect(desktopStartupOracle).toContain( - '[[ "$state_dir" =~ ^/tmp/orca-appimage-startup\\.[^/]+$ ]] || return 0' - ) - }) - - it('requires the bound AppImage to be executable before launch and extraction', () => { - expect(desktopStartupOracle).toContain( - '[[ -x "$appimage" ]] || { echo "FAIL: AppImage is not executable: $appimage" >&2; exit 1; }' - ) - expect(shutdownDockerRunner).toContain( - '\'test -r /input/orca.AppImage && test -x /input/orca.AppImage || { echo "FAIL: AppImage bind must be readable and executable" >&2; exit 1; }\'' - ) - }) - - it('gives the original AppImage enough bounded extraction space', () => { - expect(shutdownDockerRunner).toContain("'/tmp:rw,nosuid,nodev,exec,size=1g'") - }) - - it('keeps owned Xvfb alive during the documented systemd graceful stop', () => { - const serveUnits = readSystemdUnitBlocks(headlessLinuxGuide, 'orca-serve.service') - const ownedXvfbUnits = serveUnits.filter((unit) => !/^Environment=DISPLAY=/m.test(unit)) - const managedXvfbUnits = serveUnits.filter((unit) => /^Environment=DISPLAY=/m.test(unit)) - - expect(ownedXvfbUnits).toHaveLength(1) - expect(ownedXvfbUnits[0]).toMatch(/^ExecStart=.*orca-linux\.AppImage serve.*$/m) - expect(ownedXvfbUnits[0]).toMatch(/^KillMode=mixed$/m) - expect(managedXvfbUnits).toHaveLength(1) - expect(managedXvfbUnits[0]).toMatch(/^KillMode=mixed$/m) - }) - - it('distinguishes persisted state from live work during a service restart', () => { - expect(headlessLinuxProse).toContain( - 'The detached terminal daemon is preserved by a different mechanism: it is launched through `systemd-run --user --scope`' - ) - expect(headlessLinuxProse).toContain( - 'These guarantees preserve live processes only when the daemon is in its own' - ) - expect(headlessLinuxProse).toContain( - 'The unscoped fallback remains destructive: a service restart kills every terminal' - ) - expect(headlessLinuxProse).toContain( - 'Treat a stop as destructive unless `health.terminalDaemon.cgroupUnit` names an `orca-daemon-*.scope` on that host' - ) - expect(headlessLinuxProse).toContain( - 'A separately paired runtime is outside that boundary; local execution and SSH hosts reached through this runtime are not. An affected or unknown omission, missing scope, failed request or lost connection is `unverifiable`' - ) - expect(headlessLinuxGuide).toContain( - 'sudo -Hu orca /home/orca/.local/bin/orca-ide terminal list --json' - ) - expect(headlessLinuxGuide).not.toContain('sudo -Hu orca orca-ide terminal list --json') - expect(headlessLinuxGuide).not.toContain('Two facts make this safe and predictable') - }) - - it('uses the registered CLI name from ordinary Linux shells', () => { - const commandRule = - 'The registered Linux CLI command is `orca-ide`, not `orca`, to avoid shadowing the GNOME Orca screen reader.' - const substitutionRule = - "From an ordinary shell outside that service user's managed environment, substitute `orca-ide` for `orca` in commands below." - const censusCommand = '`sudo -Hu orca /home/orca/.local/bin/orca-ide terminal list --json`' - - expect(headlessLinuxProse).toContain(commandRule) - expect(headlessLinuxProse).toContain(substitutionRule) - expect(headlessLinuxProse).toContain(censusCommand) - expect(headlessLinuxGuide).toContain('best-effort dispatcher at `$HOME/.local/bin/orca`') - expect(headlessLinuxProse.indexOf(substitutionRule)).toBeLessThan( - headlessLinuxProse.indexOf(censusCommand) - ) - }) }) diff --git a/config/scripts/mobile-web-app-route-manifest.test.mjs b/config/scripts/mobile-web-app-route-manifest.test.mjs index b4c29d8d9d83..1cbf256bd7a3 100644 --- a/config/scripts/mobile-web-app-route-manifest.test.mjs +++ b/config/scripts/mobile-web-app-route-manifest.test.mjs @@ -1,4 +1,4 @@ -import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises' +import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { fileURLToPath } from 'node:url' @@ -250,23 +250,3 @@ describe('the synthesized RequireContext', () => { expect(() => context('constructor')).toThrow('no route module') }) }) - -describe('the web entry', () => { - it('leaves the suspense boundary to expo-router', async () => { - const entry = await readFile(join(projectDir, 'mobile', 'web-entry', 'index.tsx'), 'utf8') - // A second boundary around the whole tree catches nothing the router has not already caught, - // and would only make the fallback ambiguous about which layer suspended. - expect(entry).not.toContain('Suspense') - }) - - itBundling('because the router already wraps every screen in one', async () => { - // The premise of the test above, read off the copy that is bundled: getQualifiedRouteComponent - // wraps each screen itself, which is what makes the lazy route manifest safe without a - // boundary of our own. - const useScreens = await readFile( - join(projectDir, 'mobile', 'node_modules', 'expo-router', 'build', 'useScreens.js'), - 'utf8' - ) - expect(useScreens).toContain(' { } it('keeps the native Windows registry addon optional and platform-gated', () => { - const rebuildScript = readProject('config/scripts/rebuild-native-deps.mjs') - const ensureScript = readProject('config/scripts/ensure-native-runtime.mjs') expect(packageJson.optionalDependencies['@orca/windows-registry']).toBe('workspace:*') // Why: allowBuilds stops pnpm running node-gyp at install time -- the root // Windows-only rebuild owns this addon so it is built against the right runtime ABI. expect(pnpmWorkspace.allowBuilds['@orca/windows-registry']).toBe(false) - // Why assert the guard and the member separately: the list now carries more - // than one addon, so pinning the whole literal only tested its formatting. - expect(rebuildScript).toContain("rebuildPlatform === 'win32'") - expect(rebuildScript).toContain("'@orca/windows-registry'") - expect(ensureScript).toContain("process.platform === 'win32'") - expect(ensureScript).toContain("'@orca/windows-registry'") if (windowsAddonsInstalled) { expect(packageTargets.win32).toEqual( expect.arrayContaining([ @@ -55,20 +46,10 @@ describe('Electron runtime package contract', () => { }) it('keeps the native Windows process-table addon optional and platform-gated', () => { - const rebuildScript = readFileSync( - join(projectDir, 'config/scripts/rebuild-native-deps.mjs'), - 'utf8' - ) - const ensureScript = readFileSync( - join(projectDir, 'config/scripts/ensure-native-runtime.mjs'), - 'utf8' - ) expect(packageJson.optionalDependencies['@vscode/windows-process-tree']).toBe('0.8.0') // Why: same rule as the registry addon -- allowBuilds stops pnpm running node-gyp at // install time so the Windows-only rebuild owns it with the right runtime ABI. expect(pnpmWorkspace.allowBuilds['@vscode/windows-process-tree']).toBe(false) - expect(rebuildScript).toContain("'@vscode/windows-process-tree'") - expect(ensureScript).toContain("'@vscode/windows-process-tree'") // Why pin the patch: the upstream binding.gyp requires Spectre-mitigated // libraries our build agents do not carry, and the enumeration stops after // 1024 processes -- on a busy host that silently hides the very descendants @@ -92,195 +73,6 @@ describe('Electron runtime package contract', () => { } }) - it('guards package scripts that launch Electron tooling', () => { - const scripts = packageJson.scripts - const guardedScripts = [ - 'start', - 'dev', - 'dev-stable-name', - 'build:unpack', - 'build:win', - 'build:mac', - 'build:mac:release', - 'build:linux', - 'test:e2e', - 'test:e2e:terminal-rendering-golden', - 'test:e2e:posix-profile-index-golden', - 'test:e2e:terminal-rendering-release-evidence', - 'test:e2e:headful' - ] - - for (const scriptName of guardedScripts) { - expect(scripts[scriptName], scriptName).toContain('pnpm run ensure:electron-runtime &&') - } - }) - - it('keeps Windows and Linux package builds off macOS native helper builds', () => { - const scripts = packageJson.scripts - - expect(scripts['build:desktop']).not.toContain('build:computer-macos') - expect(scripts['build:desktop']).not.toContain('build:keyboard-layout-macos') - expect(scripts['build:win']).toContain('pnpm run build:desktop') - expect(scripts['build:win']).not.toContain('pnpm run build ') - expect(scripts['build:win']).not.toContain('build:computer-macos') - expect(scripts['build:win']).not.toContain('build:keyboard-layout-macos') - expect(scripts['build:linux']).toContain('pnpm run build:desktop') - expect(scripts['build:linux']).not.toContain('pnpm run build ') - expect(scripts['build:linux']).not.toContain('build:computer-macos') - expect(scripts['build:linux']).not.toContain('build:keyboard-layout-macos') - expect(scripts['build:mac']).toContain('pnpm run build:computer-macos') - expect(scripts['build:mac']).toContain('pnpm run build:keyboard-layout-macos') - expect(scripts['build:release']).toContain('pnpm run build:native') - expect(scripts['build:release']).not.toContain('build:computer-macos') - }) - - it('runs the web build through the heap-sized Vite wrapper', () => { - expect(packageJson.scripts['build:web']).toContain('node config/scripts/run-vite-web-build.mjs') - expect(packageJson.scripts['build:web']).toContain('node config/scripts/verify-web-build.mjs') - }) - - it('guards release publishing before electron-builder runs', () => { - const releaseWorkflow = readFileSync( - join(projectDir, '.github/workflows/release-cut.yml'), - 'utf8' - ) - const parsedWorkflow = parse(releaseWorkflow) - const macWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/release-mac-build.yml'), 'utf8') - ) - const releaseCommands = new Map( - parsedWorkflow.jobs.build.strategy.matrix.include.map(({ platform, release_command }) => [ - platform, - release_command - ]) - ) - const macReleaseCommand = macWorkflow.jobs['build-mac'].steps.find( - (step) => step.name === 'Publish release artifacts (macOS)' - ).with.command - - expect([...releaseCommands.keys()].sort()).toEqual(['linux-arm64', 'linux-x64', 'win']) - for (const command of [...releaseCommands.values(), macReleaseCommand]) { - expect(command).toContain('node config/scripts/ensure-native-runtime.mjs --runtime=electron') - expect(command).toContain('electron-builder') - expect(command.indexOf('ensure-native-runtime')).toBeLessThan( - command.indexOf('electron-builder') - ) - } - expect(macReleaseCommand).toContain(' && ORCA_MAC_RELEASE=1 ') - expect(releaseCommands.get('linux-x64')).toContain(' && pnpm exec electron-builder ') - expect(releaseCommands.get('linux-x64')).toContain('--linux AppImage deb rpm --x64') - expect(releaseCommands.get('linux-arm64')).toContain('ORCA_LINUX_ARM64_RELEASE=1') - expect(releaseCommands.get('linux-arm64')).toContain('--linux AppImage deb rpm --arm64') - expect(releaseCommands.get('win')).toContain( - '; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }; pnpm exec electron-builder ' - ) - }) - - it('blocks Linux and macOS release packaging on watcher process fault recovery', () => { - const releaseWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/release-cut.yml'), 'utf8') - ) - const macWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/release-mac-build.yml'), 'utf8') - ) - const assertFaultGate = (steps, publishStepName, expectedCondition) => { - const names = steps.map((step) => step.name) - const gate = steps.find((step) => step.name === 'Gate runtime file-watcher process isolation') - - expect(gate.if).toBe(expectedCondition) - expect(gate['continue-on-error']).toBeUndefined() - expect(gate.run).toContain('node config/scripts/runtime-file-watcher-fault-harness.mjs') - expect(gate.run).toContain('ELECTRON_RUN_AS_NODE=1 pnpm exec electron') - expect(names.indexOf('Build app')).toBeLessThan(names.indexOf(gate.name)) - expect(names.indexOf(gate.name)).toBeLessThan(names.indexOf(publishStepName)) - } - - assertFaultGate( - releaseWorkflow.jobs.build.steps, - 'Publish release artifacts (Linux)', - "runner.os == 'Linux'" - ) - assertFaultGate( - macWorkflow.jobs['build-mac'].steps, - 'Publish release artifacts (macOS)', - undefined - ) - }) - - it('packages and release-gates the SSH relay watcher child', () => { - const relayBuild = readFileSync(join(projectDir, 'config/scripts/build-relay.mjs'), 'utf8') - const builderConfig = readFileSync( - join(projectDir, 'config/electron-builder.config.cjs'), - 'utf8' - ) - const remoteCommands = readFileSync( - join(projectDir, 'src/main/ssh/ssh-remote-commands.ts'), - 'utf8' - ) - const releaseWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/release-cut.yml'), 'utf8') - ) - const macWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/release-mac-build.yml'), 'utf8') - ) - - expect(relayBuild).toContain("'parcel-watcher-process-entry.ts'") - expect(relayBuild).toContain("outfile: join(outDir, 'relay-watcher.js')") - expect(relayBuild).toContain("outfile: join(outDir, 'relay-ai-vault-service.js')") - expect(builderConfig).toContain("from: 'out/relay'") - - // Hashing and remote install probing are manifest-driven, so the contract - // is that both companions are declared once and that both sites read it. - expect(relayArtifactFilenames(true)).toContain('relay-watcher.js') - expect(relayArtifactFilenames(true)).toContain('relay-ai-vault-service.js') - expect(relayBuild).toContain('relayArtifactFilenames(') - expect(remoteCommands).toContain('relayArtifactFilenames(') - - const assertRelayGate = (steps, publishStepName) => { - const names = steps.map((step) => step.name) - const gate = steps.find((step) => step.name === 'Gate SSH relay watcher process isolation') - expect(gate['continue-on-error']).toBeUndefined() - expect(gate.run).toContain('node config/scripts/relay-watcher-fault-harness.mjs') - expect(names.indexOf('Build app')).toBeLessThan(names.indexOf(gate.name)) - expect(names.indexOf(gate.name)).toBeLessThan(names.indexOf(publishStepName)) - } - - assertRelayGate(releaseWorkflow.jobs.build.steps, 'Publish release artifacts (Linux)') - assertRelayGate(macWorkflow.jobs['build-mac'].steps, 'Publish release artifacts (macOS)') - const releaseNames = releaseWorkflow.jobs.build.steps.map((step) => step.name) - expect(releaseNames.indexOf('Gate SSH relay watcher process isolation')).toBeLessThan( - releaseNames.indexOf('Build Windows release artifacts') - ) - }) - - it('packages and verifies the Windows SSH node-pty console-list fallback', () => { - const relayBuild = readFileSync(join(projectDir, 'config/scripts/build-relay.mjs'), 'utf8') - const relayDeploy = readFileSync(join(projectDir, 'src/main/ssh/ssh-relay-deploy.ts'), 'utf8') - const patchAsset = readFileSync( - join(projectDir, 'config/relay-assets/node-pty-1.1.0-console-list-agent-patch.cjs'), - 'utf8' - ) - - expect(relayBuild).toContain('copyFileSync(') - expect(relayBuild).toContain('hash.update(readFileSync') - expect(relayBuild).toContain('node-pty-1.1.0-console-list-agent-patch.cjs') - expect(relayDeploy).toContain('assertPatchedNodePtyConsoleListAgent') - expect(relayDeploy.match(/\$\{windowsNodePtyPatchCommand\(nodePath\)\}/g)).toHaveLength(2) - expect(patchAsset).toContain('consoleProcessList = [shellPid];') - expect(patchAsset).toContain('packageJson.version !== EXPECTED_NODE_PTY_VERSION') - }) - - it('pins the Windows release builder to the VS 2022 runner image', () => { - const releaseWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/release-cut.yml'), 'utf8') - ) - const windowsReleaseEntry = releaseWorkflow.jobs.build.strategy.matrix.include.find( - ({ platform }) => platform === 'win' - ) - - expect(windowsReleaseEntry.os).toBe('windows-2022') - }) - it('keeps release-cut signing provenance on GitHub-hosted runners', () => { const releaseWorkflow = parse( readFileSync(join(projectDir, '.github/workflows/release-cut.yml'), 'utf8') @@ -306,360 +98,4 @@ describe('Electron runtime package contract', () => { expect(releaseWorkflow.jobs['publish-release'].needs).toContain('build') expect(releaseWorkflow.jobs['publish-release'].needs).toContain('build-mac') }) - - it('runs the macOS release build in an isolated Blacksmith workflow', () => { - const releaseMacWorkflowText = readFileSync( - join(projectDir, '.github/workflows/release-mac-build.yml'), - 'utf8' - ) - const releaseMacWorkflow = parse(releaseMacWorkflowText) - const buildMacJob = releaseMacWorkflow.jobs['build-mac'] - const checkoutStep = buildMacJob.steps.find((step) => step.name === 'Checkout') - const publishStep = buildMacJob.steps.find( - (step) => step.name === 'Publish release artifacts (macOS)' - ) - - expect(releaseMacWorkflow['run-name']).toBe( - 'Mac release build ${{ inputs.tag }} (${{ inputs.release_run_id }})' - ) - expect(releaseMacWorkflow.on.workflow_dispatch.inputs.tag.required).toBe(true) - expect(releaseMacWorkflow.on.workflow_dispatch.inputs.release_run_id.required).toBe(true) - expect(buildMacJob['runs-on']).toBe('blacksmith-6vcpu-macos-15') - expect(checkoutStep.with.ref).toBe('refs/tags/${{ inputs.tag }}') - expect(publishStep.with.command).toContain('ORCA_MAC_RELEASE=1') - expect(publishStep.with.command).toContain('electron-builder') - expect(publishStep.with.command).toContain('--mac --publish always') - expect(releaseMacWorkflowText).not.toContain('signpath/') - expect(releaseMacWorkflowText).not.toContain('SIGNPATH_') - }) - - it('publishes both Linux release matrix entries', () => { - const releaseWorkflow = readFileSync( - join(projectDir, '.github/workflows/release-cut.yml'), - 'utf8' - ) - const parsedWorkflow = parse(releaseWorkflow) - const publishLinuxStep = parsedWorkflow.jobs.build.steps.find( - (step) => step.name === 'Publish release artifacts (Linux)' - ) - - expect(publishLinuxStep.if).toContain("matrix.platform == 'linux-x64'") - expect(publishLinuxStep.if).toContain("matrix.platform == 'linux-arm64'") - expect(publishLinuxStep.with.command).toBe('${{ matrix.release_command }}') - }) - - it('keeps Linux postinstall repairing Chromium sandbox permissions', () => { - const afterInstallScript = readFileSync( - join(projectDir, 'resources/linux/packaging/after-install.sh'), - 'utf8' - ) - - expect(afterInstallScript).toContain('chrome-sandbox') - expect(afterInstallScript).toContain('chmod 4755 "$sandbox"') - expect(afterInstallScript).not.toContain('chmod 0755 "$sandbox"') - expect(afterInstallScript).toContain('is_owned_link()') - expect(afterInstallScript).toContain('readlink -f -- "$link"') - expect(afterInstallScript).toContain('[ ! -e "$link" ] && [ ! -L "$link" ]') - expect(afterInstallScript).not.toContain('[ ! -e "$link" ] || [ -L "$link" ]') - }) - - it('advances only the skill release ledger in a taggable release-cut commit', () => { - const releaseWorkflow = readFileSync( - join(projectDir, '.github/workflows/release-cut.yml'), - 'utf8' - ) - const parsedWorkflow = parse(releaseWorkflow) - const checkoutStep = parsedWorkflow.jobs.cut.steps.find((step) => step.name === 'Checkout ref') - const bumpStep = parsedWorkflow.jobs.cut.steps.find( - (step) => step.name === 'Bump package.json and tag' - ) - - const bumpIndex = bumpStep.run.indexOf( - 'npm version "$VERSION" --no-git-tag-version --allow-same-version' - ) - const generateIndex = bumpStep.run.indexOf( - 'node config/scripts/generate-skill-bundle-manifest.mjs --release "$VERSION"' - ) - const commands = bumpStep.run.replace(/^\s*#.*$/gm, '') - // Unanchored: a `git add` chained after `&&` stages just as effectively. - const stagedPaths = [...commands.matchAll(/\bgit add (.+)$/gm)].flatMap((match) => - match[1].trim().split(/\s+/) - ) - // Quotes trimmed and deduped: the index guard names the row a second time. - const mentioned = new Set(commands.match(/resources[/\\]skills[^\s'"]*/g)) - expect(checkoutStep.with['fetch-depth']).toBe(0) - expect(bumpIndex).toBeGreaterThanOrEqual(0) - // Why: the cut is the only point that advances the release ledger, so this - // tag's revision is never rebuilt later — it appends that row, nothing else. - expect(generateIndex).toBeGreaterThan(bumpIndex) - expect(bumpStep.run.indexOf('git add package.json')).toBeGreaterThan(generateIndex) - expect(stagedPaths).toEqual(['package.json', 'resources/skills/release-mapping.json']) - // Every distinct mention must be staged, so a copy, a redirect, or a path - // held in a variable cannot reach the content-addressed artifacts. Matched - // without a trailing slash so `dir="resources/skills"` still counts. - expect([...mentioned]).toEqual(stagedPaths.slice(1)) - // Regeneration is banned job-wide by the generator suite. Here: `-a`, `-am`, - // and `--all` sweep unstaged artifacts in; `--allow-empty` below must not. - expect(commands).not.toMatch(/\bcommit\b[^\n]*(?:\s-[a-z]*a[a-z]*\b|\s--all\b)/) - expect(bumpStep.run).toContain('git diff --cached --quiet') - expect(bumpStep.run).toContain('git commit --allow-empty -m "$commit_message"') - }) - - it('keeps release-cut RC retries monotonic across stale attempts', () => { - const releaseWorkflow = readFileSync( - join(projectDir, '.github/workflows/release-cut.yml'), - 'utf8' - ) - const parsedWorkflow = parse(releaseWorkflow) - const versionStep = parsedWorkflow.jobs.cut.steps.find( - (step) => step.name === 'Compute next version' - ) - - expect(versionStep.run).toContain('node config/scripts/release-rc-history.mjs "$1"') - expect(versionStep.run).toContain('tag_matches_current_ref') - expect(versionStep.run).toContain('cutting the next version instead of reusing stale artifacts') - expect(versionStep.run).toContain('git rev-parse "$existing_rc_tag"') - }) - - it('bumps separate Homebrew casks for stable and RC desktop tags', () => { - const releaseWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/release-cut.yml'), 'utf8') - ) - const homebrewWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/homebrew-bump.yml'), 'utf8') - ) - - expect(releaseWorkflow.jobs['homebrew-bump'].if).toContain( - "startsWith(needs.cut.outputs.tag, 'v')" - ) - expect(releaseWorkflow.jobs['homebrew-bump'].if).not.toContain('-rc.') - expect(releaseWorkflow.jobs['homebrew-bump-published-rc-draft'].with.tag).toBe( - '${{ needs.cut.outputs.latest_published_rc_tag }}' - ) - - const resolveCaskStep = homebrewWorkflow.jobs['bump-cask'].steps.find( - (step) => step.name === 'Resolve cask target' - ) - const renderStep = homebrewWorkflow.jobs['bump-cask'].steps.find( - (step) => step.name === 'Render updated cask file' - ) - const copyStep = homebrewWorkflow.jobs['bump-cask'].steps.find( - (step) => step.name === 'Copy cask into tap and open PR' - ) - - expect(resolveCaskStep.run).toContain('token="orca@rc"') - expect(resolveCaskStep.run).toContain('token="orca"') - expect(renderStep.env.CASK_PATH).toBe('${{ steps.cask.outputs.path }}') - expect(copyStep.run).toContain('cp "$CASK_PATH" "tap/$CASK_PATH"') - expect(copyStep.run).toContain('git add "$CASK_PATH"') - }) - - it('installs the Electron package binary in the shared unit-test workflow', () => { - const unitTestWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/unit-tests.yml'), 'utf8') - ) - const installStep = unitTestWorkflow.jobs.test.steps.find( - (step) => step.name === 'Install Electron package binary for tests' - ) - - expect(installStep.run).toBe('node config/scripts/install-electron-package-binary.mjs') - }) - - it('smokes the packaged CLI from outside the checkout in PR checks', () => { - const prWorkflow = readFileSync(join(projectDir, '.github/workflows/pr.yml'), 'utf8') - const parsedWorkflow = parse(prWorkflow) - const smokeStep = parsedWorkflow.jobs.package.steps.find( - (step) => step.name === 'Smoke packaged CLI' - ) - - expect(smokeStep.run).toBe( - 'node config/scripts/smoke-packaged-cli.mjs --app-dir=dist/linux-unpacked' - ) - }) - - it('keeps terminal scale perf wired to the report budget gate', () => { - const packageScripts = packageJson.scripts - const terminalPerfWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/terminal-perf.yml'), 'utf8') - ) - const steps = terminalPerfWorkflow.jobs['terminal-perf'].steps - const runStep = steps.find((step) => step.name === 'Run terminal scale perf report gate') - const uploadStep = steps.find((step) => step.name === 'Upload terminal perf report') - - expect(packageScripts['test:e2e:terminal-perf:scale:report']).toContain( - 'run-terminal-scale-perf-report-gate.mjs' - ) - expect(runStep.run).toContain('pnpm run test:e2e:terminal-perf:scale:report') - expect(runStep.run).toContain('xvfb-run --auto-servernum') - const manualProfileKnobs = [ - ['ORCA_TERMINAL_PERF_FRAME_COUNT', 'frame_count', 'ORCA_E2E_OPENCODE_FRAME_COUNT'], - [ - 'ORCA_TERMINAL_PERF_FRAME_INTERVAL_MS', - 'frame_interval_ms', - 'ORCA_E2E_OPENCODE_FRAME_INTERVAL_MS' - ], - [ - 'ORCA_TERMINAL_PERF_PRESSURE_OUTPUT_CHARS', - 'pressure_output_chars', - 'ORCA_E2E_OPENCODE_PRESSURE_OUTPUT_CHARS' - ], - ['ORCA_TERMINAL_PERF_SCALE_PANES', 'scale_panes', 'ORCA_E2E_OPENCODE_SCALE_PANES'], - [ - 'ORCA_TERMINAL_PERF_SCALE_CROSS_WORKSPACE_PANES', - 'scale_cross_workspace_panes', - 'ORCA_E2E_OPENCODE_SCALE_CROSS_WORKSPACE_PANES' - ], - [ - 'ORCA_TERMINAL_PERF_SCALE_PRESSURE_PANES', - 'scale_pressure_panes', - 'ORCA_E2E_OPENCODE_SCALE_PRESSURE_PANES' - ], - [ - 'ORCA_TERMINAL_PERF_SCALE_HIDDEN_PRESSURE_PANES', - 'scale_hidden_pressure_panes', - 'ORCA_E2E_OPENCODE_SCALE_HIDDEN_PRESSURE_PANES' - ] - ] - for (const [workflowEnv, inputName, runnerEnv] of manualProfileKnobs) { - expect(runStep.env[workflowEnv]).toBe(`\${{ inputs.${inputName} }}`) - expect(runStep.run).toContain(runnerEnv) - } - expect(uploadStep.uses).toBe('actions/upload-artifact@v7') - expect(uploadStep.with.path).toBe('${{ env.ORCA_E2E_TERMINAL_PERF_REPORT_PATH }}') - }) - - it('keeps platform golden regressions in the manual and release workflows', () => { - const packageScripts = packageJson.scripts - const goldenWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/golden-e2e-experiment.yml'), 'utf8') - ) - const releaseWorkflow = parse( - readFileSync(join(projectDir, '.github/workflows/release-cut.yml'), 'utf8') - ) - const steps = goldenWorkflow.jobs['golden-e2e'].steps - const goldenPlatformLabels = new Map([ - ['linux', 'Linux'], - ['mac', 'macOS'], - ['windows', 'Windows'] - ]) - const goldenMatrix = goldenWorkflow.jobs['golden-e2e'].strategy.matrix.include - const goldenPlatforms = goldenMatrix.map(({ platform }) => platform).sort() - const goldenRunSteps = new Map( - goldenPlatforms.map((platform) => { - const label = goldenPlatformLabels.get(platform) - - expect(label, platform).toBeDefined() - - return [platform, steps.find((step) => step.name === `Run golden E2E tests on ${label}`)] - }) - ) - const releaseGoldenJob = releaseWorkflow.jobs['terminal-rendering-golden'] - const releaseGoldenMatrix = releaseGoldenJob.strategy.matrix.include - const releaseEvidenceJob = releaseWorkflow.jobs['terminal-rendering-release-evidence'] - const releaseBuildNeeds = releaseWorkflow.jobs.build.needs - const publishReleaseNeeds = releaseWorkflow.jobs['publish-release'].needs - // Why: Windows release evidence is temporarily paused for CI runner PTY readiness. - const releaseEvidencePlatforms = ['linux', 'mac'] - - expect(packageScripts['test:e2e:terminal-rendering-golden']).toContain( - '@terminal-rendering-golden' - ) - expect(packageScripts['test:e2e:terminal-rendering-golden']).toContain( - 'terminal-raw-emoji-table-scroll-restore.spec.ts' - ) - expect(packageScripts['test:e2e:terminal-rendering-golden']).toContain( - 'terminal-webgl-atlas-budget.spec.ts' - ) - expect(packageScripts['test:e2e:terminal-rendering-golden']).not.toContain( - 'terminal-long-table-scroll-restore.spec.ts' - ) - const goldenCommand = packageScripts['test:e2e:terminal-rendering-golden'] - expect(goldenCommand).toContain('--project electron-headless') - expect(goldenCommand).toContain('--project electron-headful') - expect(packageScripts['test:e2e:windows-fresh-startup-golden']).toContain( - 'golden-windows-fresh-startup.spec.ts' - ) - expect(packageScripts['test:e2e:windows-fresh-startup-golden']).toContain( - '@windows-fresh-startup-golden' - ) - expect(packageScripts['test:e2e:posix-profile-index-golden']).toContain( - 'golden-posix-profile-index-fsync.spec.ts' - ) - expect(packageScripts['test:e2e:posix-profile-index-golden']).toContain( - 'golden-posix-fresh-startup.spec.ts' - ) - expect(packageScripts['test:e2e:posix-profile-index-golden']).toContain( - '@posix-profile-index-golden' - ) - expect(packageScripts['test:e2e:terminal-rendering-release-evidence']).toContain( - 'terminal-opencode-emoji-table-rendering.spec.ts' - ) - expect(packageScripts['test:e2e:terminal-rendering-release-evidence']).toContain( - 'terminal-long-table-scroll-restore.spec.ts' - ) - expect(goldenMatrix).toEqual([ - { os: 'ubuntu-latest', platform: 'linux' }, - { os: 'macos-15', platform: 'mac' }, - { os: 'windows-2022', platform: 'windows' } - ]) - expect(goldenRunSteps.get('linux')?.run).toContain( - 'pnpm run test:e2e:terminal-rendering-golden' - ) - expect(goldenRunSteps.get('linux')?.run).toContain( - 'pnpm run --if-present test:e2e:posix-profile-index-golden' - ) - expect(goldenRunSteps.get('mac')?.run).toContain('pnpm run test:e2e:terminal-rendering-golden') - expect(goldenRunSteps.get('mac')?.run).toContain( - 'pnpm run --if-present test:e2e:posix-profile-index-golden' - ) - expect(goldenRunSteps.get('windows')).toMatchObject({ - if: "runner.os == 'Windows'", - shell: 'pwsh' - }) - expect(goldenRunSteps.get('windows').run).toContain( - 'pnpm run --if-present test:e2e:windows-fresh-startup-golden' - ) - expect(goldenWorkflow.on.pull_request).toBeUndefined() - expect(goldenWorkflow.on.workflow_dispatch).toBeDefined() - expect(releaseBuildNeeds).not.toContain('terminal-rendering-golden') - expect(releaseBuildNeeds).not.toContain('terminal-rendering-release-evidence') - expect(publishReleaseNeeds).toContain('terminal-rendering-golden') - expect(publishReleaseNeeds).toContain('build') - expect(publishReleaseNeeds).not.toContain('terminal-rendering-release-evidence') - expect(releaseGoldenJob['continue-on-error']).toBeUndefined() - expect(releaseGoldenMatrix).toEqual(goldenMatrix) - const releaseLinuxRunStep = releaseGoldenJob.steps.find( - (step) => step.name === 'Run terminal rendering golden on Linux' - ) - expect(releaseLinuxRunStep.run).toContain('pnpm run test:e2e:terminal-rendering-golden') - expect(releaseLinuxRunStep.run).toContain( - 'pnpm run --if-present test:e2e:posix-profile-index-golden' - ) - const releaseMacRunStep = releaseGoldenJob.steps.find( - (step) => step.name === 'Run terminal rendering golden on macOS' - ) - expect(releaseMacRunStep.run).toContain('pnpm run test:e2e:terminal-rendering-golden') - expect(releaseMacRunStep.run).toContain( - 'pnpm run --if-present test:e2e:posix-profile-index-golden' - ) - const releaseWindowsRunStep = releaseGoldenJob.steps.find( - (step) => step.name === 'Run fresh-startup golden on Windows' - ) - expect(releaseWindowsRunStep).toMatchObject({ - if: "runner.os == 'Windows'", - shell: 'pwsh' - }) - expect(releaseWindowsRunStep.run).toContain( - 'pnpm run --if-present test:e2e:windows-fresh-startup-golden' - ) - expect(releaseWindowsRunStep.run).not.toContain('test:e2e:workspace-session-golden') - expect(releaseWindowsRunStep.run).not.toContain('test:e2e:source-control-golden') - expect(releaseEvidenceJob['continue-on-error']).toBe(true) - expect( - releaseEvidenceJob.strategy.matrix.include.map(({ platform }) => platform).sort() - ).toEqual(releaseEvidencePlatforms) - expect(releaseEvidenceJob.steps.map((step) => step.run ?? '')).toContain( - 'xvfb-run --auto-servernum env SKIP_BUILD=1 ORCA_E2E_FORWARD_APP_LOGS=1 pnpm run test:e2e:terminal-rendering-release-evidence' - ) - }) }) diff --git a/config/scripts/packaged-hang-watchdog-worker-contract.test.mjs b/config/scripts/packaged-hang-watchdog-worker-contract.test.mjs deleted file mode 100644 index a4998760b67d..000000000000 --- a/config/scripts/packaged-hang-watchdog-worker-contract.test.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import { readFileSync } from 'node:fs' -import { parse } from 'yaml' -import { describe, expect, it } from 'vitest' - -describe('packaged hang watchdog worker contract', () => { - it('boots the worker from app.asar in PR checks', () => { - const workflow = parse(readFileSync('.github/workflows/pr.yml', 'utf8')) - const smokeSource = readFileSync( - 'config/scripts/smoke-packaged-hang-watchdog-worker.mjs', - 'utf8' - ) - const smokeStep = workflow.jobs.package.steps.find( - (step) => step.name === 'Smoke packaged hang watchdog worker' - ) - - expect(smokeStep.run).toBe( - 'xvfb-run --auto-servernum node config/scripts/smoke-packaged-hang-watchdog-worker.mjs --app-dir=dist/linux-unpacked' - ) - expect(smokeSource).toContain( - "process.platform === 'linux' ? ['--no-sandbox', launcherDir] : [launcherDir]" - ) - expect(smokeSource).toContain('const LAUNCH_TIMEOUT_MS = 30_000') - expect(smokeSource).toContain('timeout: LAUNCH_TIMEOUT_MS') - }) - - // Why: Electron ignores process.exitCode, so the gate needs app.exit plus a stdout assertion. - it('fails the smoke when the packaged worker never reports success', () => { - const smokeSource = readFileSync( - 'config/scripts/smoke-packaged-hang-watchdog-worker.mjs', - 'utf8' - ) - - expect(smokeSource).toContain('app.exit(1)') - expect(smokeSource).not.toContain('app.quit()') - expect(smokeSource).toContain('if (!result.stdout.includes(SUCCESS_LINE))') - }) -}) diff --git a/config/scripts/pr-workflow-lint-parity.test.mjs b/config/scripts/pr-workflow-lint-parity.test.mjs deleted file mode 100644 index 648714f244c9..000000000000 --- a/config/scripts/pr-workflow-lint-parity.test.mjs +++ /dev/null @@ -1,86 +0,0 @@ -import { readFileSync } from 'node:fs' -import { parse } from 'yaml' -import { describe, expect, it } from 'vitest' - -// Why: pr.yml re-lists the `lint` chain as individual steps so a single failure -// does not mask the rest and oxlint keeps its `--format github` annotations. -// Hand-maintained mirrors drift (#10601: three verifiers never ran on PRs), so -// this gate fails the moment a `lint` step has no counterpart in pr.yml. - -// Flags that only change reporting, so they must not split two otherwise identical commands. -const REPORTING_FLAGS_WITH_VALUE = new Set(['--format', '--reporter']) -const REPORTING_FLAGS = new Set(['--quiet']) -const PACKAGE_RUNNER_TOKENS = new Set(['pnpm', 'npm', 'yarn', 'npx', 'run', 'exec', 'node']) - -function splitCommandChain(command) { - return command - .split(/\n|&&|;/) - .map((part) => part.trim()) - .filter(Boolean) -} - -function canonicalize(command) { - const tokens = command.split(/\s+/) - const canonical = [] - - for (let index = 0; index < tokens.length; index += 1) { - const token = tokens[index] - if (canonical.length === 0 && PACKAGE_RUNNER_TOKENS.has(token)) { - continue - } - if (REPORTING_FLAGS.has(token)) { - continue - } - if (REPORTING_FLAGS_WITH_VALUE.has(token)) { - index += 1 - continue - } - canonical.push(token) - } - - return canonical.join(' ') -} - -/** Expands `pnpm run x` indirection until every entry is a real binary invocation. */ -function resolveLeafCommands(command, scripts, seen = new Set()) { - const leaves = [] - - for (const part of splitCommandChain(command)) { - const scriptName = part.match(/^(?:pnpm|npm|yarn)(?:\s+run)?\s+([\w:-]+)$/)?.[1] - if (scriptName && scripts[scriptName] && !seen.has(scriptName)) { - leaves.push( - ...resolveLeafCommands(scripts[scriptName], scripts, new Set([...seen, scriptName])) - ) - continue - } - leaves.push(canonicalize(part)) - } - - return leaves -} - -describe('PR workflow lint parity', () => { - it('runs every `pnpm lint` step on pull requests', () => { - const { scripts } = JSON.parse(readFileSync('package.json', 'utf8')) - const workflow = parse(readFileSync('.github/workflows/pr.yml', 'utf8')) - - // Scan every job: which one hosts the lint steps is an organizational - // detail that has already been renamed once (verify -> static_analysis). - const workflowCommands = new Set( - Object.values(workflow.jobs) - .flatMap((job) => job.steps ?? []) - .filter((step) => typeof step.run === 'string') - .flatMap((step) => resolveLeafCommands(step.run, scripts)) - ) - - const missing = resolveLeafCommands(scripts.lint, scripts).filter( - (leaf) => !workflowCommands.has(leaf) - ) - - expect( - missing, - `.github/workflows/pr.yml is missing lint steps: ${missing.join(', ')}. ` + - 'Add a step for each one so PR CI matches `pnpm lint`.' - ).toEqual([]) - }) -}) diff --git a/config/scripts/ssh-docker-ci-sharding.test.mjs b/config/scripts/ssh-docker-ci-sharding.test.mjs index c3b015727d67..403c059e92c3 100644 --- a/config/scripts/ssh-docker-ci-sharding.test.mjs +++ b/config/scripts/ssh-docker-ci-sharding.test.mjs @@ -37,26 +37,6 @@ it('gives every removed SSH spec a dedicated owner even for test-only edits', () ]) }) -it('runs all four isolated shards and the special SSH suites exactly once', () => { - expect(job.strategy.matrix.shard).toEqual([1, 2, 3, 4]) - expect(job.strategy['fail-fast']).toBe(false) - const remaining = job.steps.find((step) => step.name === 'Run remaining Docker SSH E2E') - expect(remaining.run).toContain('pnpm run test:e2e:ssh-docker --shard=${{ matrix.shard }}/4') - expect(remaining.if).toBe('always()') - expect(remaining['continue-on-error']).toBeUndefined() - expect(readRunner(runners[0])).toContain("'--workers=1'") - expect(job.steps.find((step) => step.name === 'Run Docker SSH watcher isolation E2E').if).toBe( - 'matrix.shard == 1' - ) - expect( - job.steps.find( - (step) => step.name === 'Run Docker SSH terminal parking + startup readiness E2E' - ).if - ).toBe('always() && matrix.shard == 1') - const upload = job.steps.find((step) => step.uses === 'actions/upload-artifact@v7') - expect(upload.with.name).toContain('${{ matrix.shard }}') -}) - it('native Playwright shards preserve every SSH test and project exactly once', async () => { const cli = join(dirname(require.resolve('playwright/package.json')), 'cli.js') const env = { diff --git a/config/scripts/terminal-ime-e2e-workflow.test.mjs b/config/scripts/terminal-ime-e2e-workflow.test.mjs index 162a6d08ace0..cb12839a2af0 100644 --- a/config/scripts/terminal-ime-e2e-workflow.test.mjs +++ b/config/scripts/terminal-ime-e2e-workflow.test.mjs @@ -45,29 +45,6 @@ describe('terminal IME e2e workflow', () => { expect(nativeIndex).toBeGreaterThan(deterministicIndex) }) - it('keeps IBus lifecycle scoped to owned processes', () => { - const runner = readFileSync( - join(projectDir, 'config/scripts/run-terminal-ibus-hangul-e2e.mjs'), - 'utf8' - ) - - expect(runner).toContain( - "['--xim', '--verbose', '--panel=disable', '--emoji-extension=disable']" - ) - expect(runner).toContain("spawn('xfwm4', ['--compositor=off']") - expect(runner).toContain("['initial-input-mode', 'hangul']") - expect(runner).toContain("['hangul-keyboard', '2']") - expect(runner).toContain("process.kill(-processGroupId, 'SIGTERM')") - expect(runner).toContain("process.kill(-processGroupId, 'SIGKILL')") - expect(runner).toContain('const killDeadline = Date.now() + processKillTimeoutMs') - expect(runner).toMatch( - /'test:e2e:headful',\s*'--workers=1',\s*'tests\/e2e\/terminal-ibus-hangul-native\.spec\.ts'/ - ) - expect(runner).not.toContain("'--replace'") - expect(runner).not.toContain('killall') - expect(runner).not.toContain('pkill') - }) - it('runs native Wayland independently with CJK fonts and retained evidence', () => { const job = workflow.jobs['linux-wayland'] expect(job.needs).toBeUndefined() @@ -82,13 +59,4 @@ describe('terminal IME e2e workflow', () => { expect(upload.if).toBe('always()') expect(upload.with.name).toBe('terminal-wayland-ime-evidence') }) - - it('bounds blocking native input commands', () => { - const nativeSpec = readFileSync( - join(projectDir, 'tests/e2e/terminal-ibus-hangul-native.spec.ts'), - 'utf8' - ) - - expect(nativeSpec.match(/timeout: NATIVE_COMMAND_TIMEOUT_MS/g)).toHaveLength(3) - }) }) diff --git a/config/scripts/verify-dev-channel-packaging.test.mjs b/config/scripts/verify-dev-channel-packaging.test.mjs index dfde5d461d29..ceef8f761741 100644 --- a/config/scripts/verify-dev-channel-packaging.test.mjs +++ b/config/scripts/verify-dev-channel-packaging.test.mjs @@ -53,19 +53,6 @@ describe('electron-builder dev-channel identity', () => { expect(config.win.verifyUpdateCodeSignature).toBe(false) }) - // Why on every channel: the hook is the only handle electron-builder gives on - // the NSIS uninstaller, and it signs nothing — it relays the file to and from - // the CI SignPath request. Carrying it must not drag a publisherName onto a - // dev build, which is the failure the split above exists to prevent. - it('carries the uninstaller sign hook without changing publisherName semantics', () => { - for (const env of [{}, WIN_ADHOC_ENV]) { - const config = loadConfigWithEnv(env) - expect(typeof config.win.signtoolOptions.sign).toBe('function') - } - expect(loadConfigWithEnv({}).win.signtoolOptions.publisherName).toBe('SignPath Foundation') - expect(loadConfigWithEnv(WIN_ADHOC_ENV).win.signtoolOptions.publisherName).toBeUndefined() - }) - it.each([ ['hourly', { ORCA_WIN_HOURLY: '1' }, 'orca-hourly'], ['daily', { ORCA_WIN_DAILY: '1' }, 'orca-daily'], diff --git a/config/scripts/win-crash-survival-e2e.test.mjs b/config/scripts/win-crash-survival-e2e.test.mjs index 40a2e1bb483e..9c772eb01eb4 100644 --- a/config/scripts/win-crash-survival-e2e.test.mjs +++ b/config/scripts/win-crash-survival-e2e.test.mjs @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { describe, expect, it, vi } from 'vitest' import { parseArgs } from '../../tests/tools/win-crash-survival-e2e/cli-args.mjs' import { buildCrashAssertions } from '../../tests/tools/win-crash-survival-e2e/crash-assertions.mjs' @@ -13,26 +12,6 @@ import { closeApp, resolveElectronMainPid } from '../../tests/tools/win-update-e import { isPidAlive } from '../../tests/tools/win-update-e2e/daemon-processes.mjs' describe('win-crash-survival-e2e proof contracts', () => { - it('keeps the packaged proof manually dispatchable without a PR trigger', () => { - const workflow = readFileSync('.github/workflows/win-crash-survival-e2e.yml', 'utf8') - expect(workflow).not.toMatch(/^ pull_request:/m) - expect(workflow).toMatch(/^ workflow_dispatch:/m) - expect(workflow).not.toMatch(/^ push:/m) - expect(workflow).toContain('--expect "$env:EXPECT"') - expect(workflow).toContain('exit $LASTEXITCODE') - expect(workflow).toContain("'!config/**/*.test.*'") - expect(workflow).toContain("'!src/**/*.test.*'") - expect(workflow).toContain("'!src/**/*.bench.*'") - expect(workflow).toContain("'!config/reliability-gates.jsonc'") - expect(workflow).toContain("'resources/**'") - expect(workflow).toContain('cache: pnpm') - expect(workflow.indexOf('- name: Setup Node.js')).toBeGreaterThan( - workflow.indexOf('- name: Setup pnpm') - ) - expect(workflow).toContain("if: steps.cache-installer.outputs.cache-hit != 'true'") - expect(workflow).toContain('crash-survival-electron-builder-') - }) - it('requires the full survival oracle, including daemon identity and reattach', () => { const base = { profile: 'survival', @@ -58,15 +37,6 @@ describe('win-crash-survival-e2e proof contracts', () => { ).toBe(false) }) - it('scans for FailFast only after the post-crash input probe', () => { - const harness = readFileSync('tests/tools/win-crash-survival-e2e/run.mjs', 'utf8') - const scanIndex = harness.indexOf('const { events: failFastEvents }') - const probeIndex = harness.indexOf('reattachProven = await proveReattachedShell') - expect(scanIndex).not.toBe(-1) - expect(probeIndex).not.toBe(-1) - expect(scanIndex).toBeGreaterThan(probeIndex) - }) - it('fails closed when the Windows event log query fails', () => { let command = '' expect(() => @@ -162,11 +132,7 @@ describe('win-crash-survival-e2e proof contracts', () => { expect(reattachSentinelMatches('1660|canary|extra', 'canary', 1660)).toBe(false) }) - it('requires the real packaged main for the crash proof but permits fallback cleanup', async () => { - const harness = readFileSync('tests/tools/win-crash-survival-e2e/run.mjs', 'utf8') - expect(harness).toContain( - 'resolveElectronMainPid(session.app, { allowLauncherFallback: false })' - ) + it('resolves the real packaged main but permits fallback cleanup', async () => { expect( await resolveElectronMainPid({ evaluate: async () => 222, diff --git a/config/scripts/windows-process-tree-gyp-path.test.mjs b/config/scripts/windows-process-tree-gyp-path.test.mjs index f1d3742e5833..0f8a651e12f3 100644 --- a/config/scripts/windows-process-tree-gyp-path.test.mjs +++ b/config/scripts/windows-process-tree-gyp-path.test.mjs @@ -1,43 +1,13 @@ import { execFileSync } from 'node:child_process' -import { existsSync, readFileSync } from 'node:fs' +import { existsSync } from 'node:fs' import { isAbsolute, join, resolve } from 'node:path' import { describe, expect, it } from 'vitest' const projectDir = resolve(import.meta.dirname, '../..') -const PATCH = readFileSync( - join(projectDir, 'config/patches/@vscode__windows-process-tree@0.8.0.patch'), - 'utf8' -) const PACKAGE_DIR = join(projectDir, 'node_modules', '@vscode', 'windows-process-tree') const RESOLVED_GYP = "require.resolve('node-addon-api/node_addon_api.gyp')" describe('windows-process-tree node-addon-api gyp path', () => { - it('stages headers without a pnpm-sensitive gyp dependency', () => { - expect(PATCH).not.toContain('+ "../../node-addon-api') - expect(PATCH).toContain('+ "include_dirs": ["deps/node-addon-api"],') - expect(PATCH).toContain('+ "defines": ["NAPI_CPP_EXCEPTIONS", "_HAS_EXCEPTIONS=1"],') - const buildScript = readFileSync( - join(projectDir, 'config/scripts/build-windows-process-tree-relay-addon.mjs'), - 'utf8' - ) - expect(buildScript).toContain('stageWindowsProcessTreeNodeAddonApiHeaders(PACKAGE_DIR)') - expect(buildScript).toContain('Repaired un-applied pnpm patch hunks before build.') - const rebuildHelper = readFileSync( - join(projectDir, 'config/scripts/windows-process-tree-gyp-rebuild.mjs'), - 'utf8' - ) - expect(rebuildHelper).toContain("createRequire(join(packageDir, 'package.json'))") - expect(rebuildHelper).toContain("resolve('node-addon-api/package.json')") - expect(rebuildHelper).toContain("'napi.h'") - expect(rebuildHelper).toContain("'napi-inl.h'") - expect(rebuildHelper).toContain("'napi-inl.deprecated.h'") - const rebuildScript = readFileSync( - join(projectDir, 'config/scripts/rebuild-native-deps.mjs'), - 'utf8' - ) - expect(rebuildScript).toContain('stageWindowsProcessTreeNodeAddonApiHeaders()') - }) - // The installed Windows dependency is exercised by the Windows CI lane. it.runIf(process.platform === 'win32')( 'resolves node_addon_api.gyp to a real file from the package directory', diff --git a/config/scripts/windows-pty-native-capability-workflow.test.mjs b/config/scripts/windows-pty-native-capability-workflow.test.mjs deleted file mode 100644 index e7b18363aeb9..000000000000 --- a/config/scripts/windows-pty-native-capability-workflow.test.mjs +++ /dev/null @@ -1,87 +0,0 @@ -import { readFileSync } from 'node:fs' -import { describe, expect, it } from 'vitest' -import { parse } from 'yaml' - -const workflow = parse(readFileSync('.github/workflows/pr.yml', 'utf8')) -const packageJson = JSON.parse(readFileSync('package.json', 'utf8')) - -describe('packaged Windows PTY native capability routing', () => { - it('runs the packaged executable immediately after the unpacked app is built', () => { - const job = workflow.jobs.package_windows - const packageIndex = job.steps.findIndex((step) => step.name === 'Package unpacked app') - const smokeIndex = job.steps.findIndex( - (step) => step.name === 'Smoke packaged Windows PTY native capability' - ) - const smoke = job.steps[smokeIndex] - - expect(job['runs-on']).toBe('windows-2022') - expect(smokeIndex).toBe(packageIndex + 1) - expect(smoke.run).toBe( - 'pnpm run smoke:windows-pty-native-capability -- --exe=dist/win-unpacked/Orca.exe' - ) - expect(smoke.if).toBeUndefined() - expect(smoke['continue-on-error']).toBeUndefined() - expect(packageJson.scripts['smoke:windows-pty-native-capability']).toBe( - 'node tests/tools/windows-pty-native-capability-smoke/run.mjs' - ) - }) - - it('keeps patched source rebuild, release build, runtime reuse, and aggregate routing intact', () => { - const job = workflow.jobs.package_windows - const install = job.steps.find( - (step) => step.uses === './.github/actions/install-node-dependencies' - ) - const nodeCacheSave = job.steps.find( - (step) => step.name === 'Save compiled Node native modules' - ) - const electronCache = job.steps.find( - (step) => step.name === 'Restore compiled Electron native modules' - ) - const build = job.steps.find((step) => step.name === 'Build package inputs') - const prepare = job.steps.find((step) => step.name === 'Prepare Electron native runtime') - const packageStep = job.steps.find((step) => step.name === 'Package unpacked app') - const verify = workflow.jobs.verify.steps.find( - (step) => step.name === 'Require successful checks' - ) - const ensureNativeRuntime = readFileSync('config/scripts/ensure-native-runtime.mjs', 'utf8') - - expect(install.with['native-runtime']).toBe('node') - expect(install.with['persist-native-cache']).toBe('false') - expect(nodeCacheSave.uses).toBe('actions/cache/save@v5') - expect(nodeCacheSave.with.key).toContain('-node-node') - expect(electronCache.with.key).toContain('-electron-node') - for (const cache of [nodeCacheSave, electronCache]) { - expect(cache.with.key).toContain('.github/actions/install-node-dependencies/action.yml') - expect(cache.with.key).toContain('config/scripts/ensure-native-runtime.mjs') - expect(cache.with.key).toContain('config/scripts/rebuild-native-deps.mjs') - } - expect(ensureNativeRuntime).toContain("runPnpm(['exec', 'node-gyp', 'rebuild']") - expect(ensureNativeRuntime).toContain("resolve(moduleDir, 'scripts', 'post-install.js')") - expect(build.run).toBe('pnpm run build:release:parallel') - expect(prepare.run).toBe('node config/scripts/ensure-native-runtime.mjs --runtime=electron') - expect(packageStep.env.ORCA_REUSE_PREPARED_NATIVE_RUNTIME).toBe('1') - expect(workflow.jobs.verify.needs).toContain('package_windows') - expect(verify.env.PACKAGE_WINDOWS).toBe('${{ needs.package_windows.result }}') - expect(verify.run).toContain('"$PACKAGE_WINDOWS"') - }) - - it('keeps the native probe event-based, scoped, and runnable in packaged Node mode', () => { - const driver = readFileSync('tests/tools/windows-pty-native-capability-smoke/run.mjs', 'utf8') - const probe = readFileSync( - 'tests/tools/windows-pty-native-capability-smoke/packaged-node-pty-capability-probe.cjs', - 'utf8' - ) - const source = `${driver}\n${probe}` - - expect(driver).toContain("ELECTRON_RUN_AS_NODE: '1'") - expect(source).not.toMatch(/\b(?:sleep|tasklist|taskkill)\b/i) - expect(source).not.toContain('maxRetries') - expect(source).not.toContain('retryDelay') - expect(source).not.toContain("from 'node:child_process'") - expect(source).not.toContain("require('node:child_process')") - expect(probe).toContain("'System32', 'wscript.exe'") - expect(probe).toContain('real-orca-detached-launcher.vbs') - expect(probe).not.toMatch(/cmd\.exe|start "" \/b/i) - expect(probe).toContain('native.terminateJob(target._pty, target.pid)') - }) -}) diff --git a/config/scripts/windows-signing-workflow-contract.test.mjs b/config/scripts/windows-signing-workflow-contract.test.mjs deleted file mode 100644 index 98d0d5e8e88d..000000000000 --- a/config/scripts/windows-signing-workflow-contract.test.mjs +++ /dev/null @@ -1,498 +0,0 @@ -import { readFileSync } from 'node:fs' -import { createRequire } from 'node:module' -import { join, resolve } from 'node:path' -import { describe, expect, it } from 'vitest' -import { parse } from 'yaml' - -const projectDir = resolve(import.meta.dirname, '../..') - -const readWorkflow = (relativePath) => parse(readFileSync(join(projectDir, relativePath), 'utf8')) - -describe('Windows signing workflow contract', () => { - it('preflights SignPath module install before Windows signing side effects', () => { - const parsedWorkflow = readWorkflow('.github/workflows/release-cut.yml') - const steps = parsedWorkflow.jobs.build.steps - const stepNames = steps.map((step) => step.name) - const installStepIndexes = stepNames.flatMap((name, index) => - name === 'Install SignPath PowerShell module' ? [index] : [] - ) - const buildIndex = stepNames.indexOf('Build Windows release artifacts') - const verifyNodePtyIndex = stepNames.indexOf('Verify Windows node-pty ConPTY runtime') - const uploadIndex = stepNames.indexOf('Upload unsigned Windows installer for SignPath') - const downloadIndex = stepNames.indexOf('Download signed Windows installer from SignPath') - - expect(verifyNodePtyIndex).toBe(buildIndex + 1) - expect(installStepIndexes).toEqual([verifyNodePtyIndex + 1]) - expect(installStepIndexes[0]).toBeLessThan(uploadIndex) - - expect(steps[verifyNodePtyIndex].run).toContain( - 'dist/win-unpacked/resources/node_modules/node-pty/build/Release' - ) - expect(steps[verifyNodePtyIndex].run).toContain('conpty/conpty.dll') - - const uploadThroughDownloadScript = steps - .slice(uploadIndex, downloadIndex + 1) - .map((step) => step.run ?? '') - .join('\n') - - expect(uploadThroughDownloadScript).not.toContain('Install-Module -Name SignPath') - - const installStep = steps[installStepIndexes[0]] - - expect(installStep.if).toBe("matrix.platform == 'win' && github.run_attempt == 1") - expect(installStep.uses).toBe('./.github/actions/install-signpath-module') - expect(installStep.run).toBeUndefined() - - const installAction = readWorkflow('.github/actions/install-signpath-module/action.yml') - const actionStep = installAction.runs.steps[0] - const installRun = actionStep.run - const sleepSeconds = [...installRun.matchAll(/Start-Sleep -Seconds (\d+)/g)].map( - ([, seconds]) => seconds - ) - - expect(installAction.runs.using).toBe('composite') - expect(actionStep.shell).toBe('pwsh') - expect(installRun).toContain( - 'if ($null -eq (Get-PSRepository -Name PSGallery -ErrorAction SilentlyContinue))' - ) - expect(installRun).toContain('Register-PSRepository -Default -InstallationPolicy Trusted') - expect(installRun).toContain('Set-PSRepository -Name PSGallery -InstallationPolicy Trusted') - expect(installRun).toMatch(/\$env:PSModulePath -split \[System\.IO\.Path\]::PathSeparator/) - expect(installRun).toContain( - "$signPathModulePath = Join-Path -Path $currentUserModuleRoot -ChildPath 'SignPath'" - ) - expect(installRun).toMatch(/for \(\$attempt = 1; \$attempt -le 3; \$attempt\+\+\)/) - expect(sleepSeconds).toContain('15') - expect(sleepSeconds).toContain('30') - expect(installRun).toContain( - 'Install-Module -Name SignPath -Repository PSGallery -MinimumVersion 4.0.0 -MaximumVersion 4.999.999 -Scope CurrentUser -Force -AllowClobber -ErrorAction Stop' - ) - expect(installRun).toContain('Import-Module SignPath -ErrorAction Stop') - expect(installRun).toContain( - 'Get-Command -Name Get-SignedArtifact -Module SignPath -ErrorAction Stop' - ) - expect(installRun).toContain('Remove-Item -LiteralPath $signPathModulePath -Recurse -Force') - expect(installRun).not.toContain('SignPath*') - expect(installRun).not.toMatch(/throw\s+\$_/) - }) - - it('falls back to a hash-pinned SignPath nupkg when the gallery API is down', () => { - const installAction = readWorkflow('.github/actions/install-signpath-module/action.yml') - const installRun = installAction.runs.steps[0].run - - // Why: the gallery API 403s during Azure Front Door incidents while its CDN - // stays up, so a pinned nupkg is the fallback. The hash pin is the only - // integrity check on that route — losing it would let any payload install. - const { 'fallback-version': version, 'fallback-sha256': sha256 } = installAction.inputs - expect(version.default).toMatch(/^4\.\d+\.\d+$/) - expect(sha256.default).toMatch(/^[0-9a-f]{64}$/) - expect(installRun).toContain('Get-FileHash -LiteralPath $nupkg -Algorithm SHA256') - expect(installRun).toContain('$actualHash -ne $expectedHash.ToUpperInvariant()') - expect(installRun).toContain('throw "SHA-256 mismatch for $source') - expect(installRun).toContain( - 'https://cdn.powershellgallery.com/packages/signpath.$version.nupkg' - ) - - // The module only resolves by name when the folder matches its ModuleVersion. - expect(installRun).toContain( - '$versionRoot = Join-Path -Path $signPathModulePath -ChildPath $version' - ) - // The fallback only runs after the gallery route is exhausted, and still - // fails the job when neither route produced a usable module. - expect(installRun.indexOf('$installed = $true')).toBeLessThan( - installRun.indexOf('if (-not $installed)') - ) - expect(installRun).toContain('throw "Unable to install the SignPath PowerShell module') - }) - - it('still installs SignPath when the cut ref predates the composite action', () => { - const parsedWorkflow = readWorkflow('.github/workflows/release-cut.yml') - const steps = parsedWorkflow.jobs.build.steps - const stepNames = steps.map((step) => step.name) - const checkoutIndex = stepNames.indexOf('Checkout') - const restoreIndex = stepNames.indexOf('Restore composite actions from the workflow ref') - const installIndex = stepNames.indexOf('Install SignPath PowerShell module') - - // Why: the build job checks out the cut tag, which for a hotfix cut from an - // older ref can predate `.github/actions/install-signpath-module`; without - // this restore the `uses: ./…` step dies on a missing action.yml. - expect(restoreIndex).toBeGreaterThan(checkoutIndex) - expect(restoreIndex).toBeLessThan(installIndex) - - const restoreStep = steps[restoreIndex] - const restoreRun = restoreStep.run - - expect(restoreStep.env.WORKFLOW_SHA).toBe('${{ github.workflow_sha }}') - expect(restoreRun).toContain('.github/actions/install-signpath-module/action.yml') - expect(restoreRun).toContain('git fetch --no-tags --depth=1 origin "$WORKFLOW_SHA"') - expect(restoreRun).toContain('git checkout "$WORKFLOW_SHA" -- .github/actions') - - // Why: restoring the action must not turn signing into a soft dependency — - // a missing module still has to fail the Windows job, and the CDN fallback - // still has to reject an unexpected payload. - expect(steps[installIndex]['continue-on-error']).toBeUndefined() - expect(restoreStep['continue-on-error']).toBeUndefined() - - const installRun = readWorkflow('.github/actions/install-signpath-module/action.yml').runs - .steps[0].run - - expect(installRun).toContain('$actualHash -ne $expectedHash.ToUpperInvariant()') - expect(installRun).toContain('throw "SHA-256 mismatch for $source') - }) - - it('never recreates Windows signing requests on a workflow rerun', () => { - const parsedWorkflow = readWorkflow('.github/workflows/release-cut.yml') - const steps = parsedWorkflow.jobs.build.steps - const stepNames = steps.map((step) => step.name) - const skipStep = steps.find((step) => step.name === 'Skip Windows artifact rebuild on rerun') - - expect(skipStep?.if).toBe("matrix.platform == 'win' && github.run_attempt != 1") - expect(skipStep?.run).toContain('Existing signed release assets must be reused') - - const signingStepNames = [ - 'Build Windows release artifacts', - 'Stage unsigned inner PE files for signing', - 'Upload unsigned inner binaries for SignPath', - 'Submit inner binaries signing request', - 'Download signed inner binaries from SignPath', - 'Upload unsigned Windows installer for SignPath', - 'Submit Windows installer signing request', - 'Download signed Windows installer from SignPath', - 'Stage signed Windows release assets', - 'Publish signed Windows release artifacts' - ] - - for (const stepName of signingStepNames) { - const step = steps[stepNames.indexOf(stepName)] - expect(step?.if, stepName).toContain('github.run_attempt == 1') - } - }) - - it('shares one SignPath module install path between release and rehearsal', () => { - const rehearsalWorkflow = readWorkflow('.github/workflows/windows-signing-rehearsal.yml') - const stepNames = rehearsalWorkflow.jobs.rehearse.steps.map((step) => step.name) - const installIndex = stepNames.indexOf('Install SignPath PowerShell module') - - // Why: the rehearsal exists to prove the real signing flow, so it must - // install the module exactly the way the release job does. - expect(rehearsalWorkflow.jobs.rehearse.steps[installIndex].uses).toBe( - './.github/actions/install-signpath-module' - ) - expect(rehearsalWorkflow.jobs.rehearse.steps[installIndex].run).toBeUndefined() - expect(installIndex).toBeLessThan( - stepNames.indexOf('Download signed inner binaries from SignPath') - ) - }) - - it('requires Windows inner binary signatures before publishing', () => { - const parsedWorkflow = readWorkflow('.github/workflows/release-cut.yml') - const steps = parsedWorkflow.jobs.build.steps - const stepNames = steps.map((step) => step.name) - const outerVerifyIndex = stepNames.indexOf('Verify signed Windows installer') - const innerVerifyIndex = stepNames.indexOf('Verify Windows inner binary signatures') - const evidenceIndex = stepNames.indexOf('Upload Windows inner signing evidence') - const publishIndex = stepNames.indexOf('Publish signed Windows release artifacts') - - expect(outerVerifyIndex).toBeGreaterThan(-1) - expect(innerVerifyIndex).toBe(outerVerifyIndex + 1) - expect(stepNames[innerVerifyIndex + 1]).toBe('Notify Slack when Windows signing fails') - expect(evidenceIndex).toBe(innerVerifyIndex + 2) - expect(publishIndex).toBe(evidenceIndex + 1) - - expect(steps[innerVerifyIndex].env.ORCA_WINDOWS_INNER_SIGNATURE_REQUIRED).toBe('true') - expect(steps[innerVerifyIndex].run).toContain("@('Orca.exe', 'resources\\bin\\orca.exe')") - expect(stepNames).not.toContain('Roll back to original installer after failed rebuild') - - const innerChainStepNames = [ - 'Stage unsigned inner PE files for signing', - 'Upload unsigned inner binaries for SignPath', - 'Submit inner binaries signing request', - 'Download signed inner binaries from SignPath', - 'Restore signed inner binaries into unpacked app', - 'Restore signed uninstaller for the installer rebuild', - 'Replace cached elevate.exe with the signed copy', - 'Rebuild NSIS installer from signed unpacked app' - ] - for (const stepName of innerChainStepNames) { - const step = steps[stepNames.indexOf(stepName)] - expect(step, stepName).toBeDefined() - expect(step['continue-on-error'], stepName).toBeUndefined() - } - }) -}) - -// Why these exist: the NSIS uninstaller is generated inside electron-builder's -// uninstaller pass and deleted immediately after being embedded, so the only way -// CI can sign it is the export/import relay through win.signtoolOptions.sign. -// Every link is asserted here the way Orca.exe and conpty_console_list.node are. -describe('Windows NSIS uninstaller signing', () => { - const releaseSteps = () => readWorkflow('.github/workflows/release-cut.yml').jobs.build.steps - const stepNamed = (steps, name) => steps.find((step) => step.name === name) - - const EXPORT_ENV = 'ORCA_WIN_UNINSTALLER_EXPORT_PATH' - const SIGNED_ENV = 'ORCA_WIN_UNINSTALLER_SIGNED_PATH' - - it('exports the uninstaller from the first Windows build', () => { - const build = stepNamed(releaseSteps(), 'Build Windows release artifacts') - - expect(build.env[EXPORT_ENV]).toContain('uninstaller-signing') - expect(build.env[EXPORT_ENV]).toContain('orca-uninstaller.exe') - }) - - // Why this is a test and not a comment: `files` in the electron-builder config - // is all-negation, so app-builder packs whatever is left in the checkout root. - // These steps retry, and a retried attempt would pack an unsigned .exe into - // app.asar — the very defect this chain removes. Every relay path must live - // outside the checkout. - it('keeps every relay path out of the packed checkout', () => { - const relayEnvValues = [ - ...releaseSteps(), - ...readWorkflow('.github/workflows/windows-signing-rehearsal.yml').jobs.rehearse.steps - ].flatMap((step) => [step.env?.[EXPORT_ENV], step.env?.[SIGNED_ENV]].filter(Boolean)) - - expect(relayEnvValues.length).toBe(4) - for (const value of relayEnvValues) { - expect(value).toContain('runner.temp') - expect(value).not.toContain('github.workspace') - } - - const relayScripts = [ - ...releaseSteps(), - ...readWorkflow('.github/workflows/windows-signing-rehearsal.yml').jobs.rehearse.steps - ] - .map((step) => step.run ?? '') - .filter((run) => run.includes('uninstaller-signing')) - - expect(relayScripts.length).toBeGreaterThan(0) - for (const run of relayScripts) { - // Why count occurrences rather than assert `toContain` once: a step - // carrying two relay paths could root the first in RUNNER_TEMP and leave - // the second bare-relative — which resolves against the checkout, and is - // exactly the shape of the defect this test exists to catch. - const mentions = run.match(/uninstaller-signing/g) ?? [] - const rooted = run.match(/Join-Path \$env:RUNNER_TEMP 'uninstaller-signing/g) ?? [] - - expect(rooted.length, run).toBe(mentions.length) - expect(run).not.toContain('$env:GITHUB_WORKSPACE') - } - }) - - it('stages the uninstaller into the same request as the inner binaries', () => { - const stage = stepNamed(releaseSteps(), 'Stage unsigned inner PE files for signing') - - expect(stage.run).toContain('uninstaller-signing\\unsigned\\orca-uninstaller.exe') - expect(stage.run).toContain('uninstaller\\orca-uninstaller.exe') - // No third SignPath request: exactly two submissions, as budgeted for the - // 1h + 4h approval waits inside the 360-minute job cap. - const submissions = releaseSteps().filter( - (step) => step.uses === 'signpath/github-action-submit-signing-request@v2' - ) - expect(submissions).toHaveLength(2) - }) - - it('keeps the uninstaller out of the inner-binary copy-back list', () => { - const stage = stepNamed(releaseSteps(), 'Stage unsigned inner PE files for signing') - const restoreInner = stepNamed( - releaseSteps(), - 'Restore signed inner binaries into unpacked app' - ) - - expect(stage.run).not.toMatch(/\$list\.Add\(['"]uninstaller/) - expect(restoreInner.run).not.toContain('orca-uninstaller.exe') - }) - - it('blocks publication when the exported uninstaller is missing', () => { - const stage = stepNamed(releaseSteps(), 'Stage unsigned inner PE files for signing') - const uninstallerBlock = stage.run.slice(stage.run.indexOf('$exportedUninstaller')) - - expect(uninstallerBlock).toContain('throw "No exported NSIS uninstaller') - expect(uninstallerBlock).not.toContain('catch') - expect(uninstallerBlock).toMatch(/Copy-Item[^\r\n]*-ErrorAction Stop/) - }) - - it('restores exact artifact paths rather than suffix-matching another executable', () => { - for (const [name, path] of [ - ['Restore signed inner binaries into unpacked app', '$relative'], - [ - 'Restore signed uninstaller for the installer rebuild', - "'uninstaller\\orca-uninstaller.exe'" - ] - ]) { - const restore = stepNamed(releaseSteps(), name) - expect(restore.run).toContain(`(Join-Path 'signed-inner' ${path})`) - expect(restore.run).toContain(`(Join-Path 'signed-inner/signing-stage' ${path})`) - expect(restore.run).toContain('if (@($candidates).Count -ne 1)') - expect(restore.run).not.toContain('Select-Object -First 1') - expect(restore.run).not.toContain('-like "*$relative"') - const rehearsal = readWorkflow('.github/workflows/windows-signing-rehearsal.yml') - const rehearseRestore = stepNamed(rehearsal.jobs.rehearse.steps, name) - expect(rehearseRestore.run).toBe(restore.run) - expect(restore.env.SIGNING_POLICY).toBe('release-signing') - expect(rehearseRestore.env.SIGNING_POLICY).toBe( - "${{ inputs.signing-policy-slug || 'test-signing' }}" - ) - expect(restore.run).toContain("$requireValid = $env:SIGNING_POLICY -ne 'test-signing'") - expect(restore.run).toContain( - "if ($null -eq $signature.SignerCertificate -or ($requireValid -and ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notlike '*CN=SignPath Foundation*')))" - ) - } - }) - - it('requires the CLI signature at its electron-builder extraResources destination', () => { - const require = createRequire(import.meta.url) - const config = require('../electron-builder.config.cjs') - const cli = config.win.extraResources.find((resource) => resource.to === 'bin/orca.exe') - expect(cli).toBeDefined() - const payloadPath = `resources/${cli.to}`.replaceAll('/', '\\') - const rehearsal = readWorkflow('.github/workflows/windows-signing-rehearsal.yml') - for (const gate of [ - stepNamed(releaseSteps(), 'Verify Windows inner binary signatures'), - stepNamed(rehearsal.jobs.rehearse.steps, 'Verify signatures end to end') - ]) { - expect(gate.run).toContain(`foreach ($requiredTarget in @('Orca.exe', '${payloadPath}'))`) - expect(gate.run).toContain( - 'if ($targets -notcontains $requiredTarget) { $targets += $requiredTarget }' - ) - expect(gate.run).toContain('foreach ($relative in $targets)') - } - }) - - it('waits for approval even when the notification fails', () => { - const steps = releaseSteps() - const notify = stepNamed( - steps, - 'Notify Slack that inner-binary signing is waiting for approval' - ) - const download = stepNamed(steps, 'Download signed inner binaries from SignPath') - expect(notify['continue-on-error']).toBe(true) - expect(download.if).not.toContain('notify-inner-signing') - expect(download.if).toContain("steps.submit-inner-signing.outcome == 'success'") - }) - - it('re-injects the signed uninstaller into the rebuilt installer', () => { - const steps = releaseSteps() - const restore = stepNamed(steps, 'Restore signed uninstaller for the installer rebuild') - const rebuild = stepNamed(steps, 'Rebuild NSIS installer from signed unpacked app') - const names = steps.map((step) => step.name) - - expect(restore.if).toContain('github.run_attempt == 1') - expect(restore.if).toContain("steps.restore-signed-inner.outcome == 'success'") - expect(restore.run).toContain('orca-uninstaller.exe') - expect(names.indexOf(restore.name)).toBeLessThan(names.indexOf(rebuild.name)) - expect(rebuild.env[SIGNED_ENV]).toContain('uninstaller-signing') - // Default success() gating blocks the rebuild after a failed restore. - expect(rebuild.if).not.toContain('restore-signed-uninstaller') - }) - - // NSIS hides the uninstaller in a compressed data section the bundled 7za - // cannot read, so the gate proves it from the sign hook's digest receipt - // instead of extracting it — and only when the relay actually ran. - it('reports the embedded uninstaller in the inner-binary evidence gate', () => { - const gate = stepNamed(releaseSteps(), 'Verify Windows inner binary signatures') - - expect(gate.env.UNINSTALLER_SIGNING_COMPLETED).toBe( - "${{ steps.restore-signed-uninstaller.outcome == 'success' }}" - ) - expect(gate.run).toContain('.embedded-sha256') - expect(gate.run).toContain("$failures.Add('The NSIS uninstaller signing did not complete.')") - expect(gate.run).toContain("$env:UNINSTALLER_SIGNING_COMPLETED -eq 'true'") - expect(gate.run).toContain('not signed by SignPath Foundation: Uninstall Orca.exe') - // The uninstaller must not join the 7z payload loop, which cannot see it. - expect(gate.run).not.toContain("$targets += 'Uninstall Orca.exe'") - }) - - it('rehearses the uninstaller leg end to end', () => { - const steps = readWorkflow('.github/workflows/windows-signing-rehearsal.yml').jobs.rehearse - .steps - const names = steps.map((step) => step.name) - const pack = stepNamed(steps, 'Package Windows app and export the NSIS uninstaller') - const rebuild = stepNamed(steps, 'Build NSIS installer from signed unpacked app') - const verify = stepNamed(steps, 'Verify signatures end to end') - - // --dir never produces an uninstaller, so the rehearsal has to build the - // installer the way release-cut's first Windows pass does. - expect(pack.run).toContain('--win --publish never') - expect(pack.run).not.toContain('--dir') - expect(pack.env[EXPORT_ENV]).toContain('orca-uninstaller.exe') - expect(names).toContain('Restore signed uninstaller for the installer rebuild') - expect(rebuild.env[SIGNED_ENV]).toContain('orca-uninstaller.exe') - expect(verify.run).toContain('.embedded-sha256') - // The receipt only proves the import leg ran. The rehearsal is where the - // shipped uninstaller itself gets checked — the release job cannot install - // onto the runner it publishes from. - expect(verify.run).toContain('shipped: Uninstall Orca.exe') - expect(verify.run).toContain('-tnsis') - expect(verify.run).toContain("-ArgumentList '/S'") - }) - - // This workflow is the merge gate, so it must not be able to fail on its own - // artefact: 7-Zip's NSIS handler is unreliable enough that its output has to - // be corroborated before a signature verdict is drawn from it. - it('never lets an unreliable extract fail the rehearsal', () => { - const steps = readWorkflow('.github/workflows/windows-signing-rehearsal.yml').jobs.rehearse - .steps - const verify = stepNamed(steps, 'Verify signatures end to end') - - // The 7-Zip route is only trusted when it reproduces the relayed bytes; - // otherwise it falls through to the install route rather than failing. - expect(verify.run).toContain( - 'Write-Host "7-Zip\'s NSIS output did not match the relayed digest; falling back to a silent install."' - ) - expect(verify.run).toMatch(/\$installedUninstaller = \$null\r?\n\s*\}/) - - // The comparison that is not tautological: a file NSIS wrote out, against - // the digest the sign hook recorded. - expect(verify.run).toContain('$shippedDigest -ne $expectedDigest') - expect(verify.run).toContain('the uninstaller the installer ships is not the relayed one') - - // An installer that prompts must not hang to the 360-minute job cap, and - // the app it launches must not outlive the step holding install-dir handles. - expect(verify.run).toContain('-PassThru') - expect(verify.run).toContain('$installerProcess.WaitForExit(300000)') - expect(verify.run).toContain('the silent install did not exit within 5 minutes') - expect(verify.run).toMatch(/for \(\$attempt = 0; \$attempt -lt 20; \$attempt\+\+\)/) - expect(verify.run).toContain("Get-Process -Name 'orca-terminal-daemon'") - }) - - // resources\elevate.exe is downgraded to advisory because app-builder-lib's - // CopyElevateHelper clobbers it on every nsis pack — a pre-existing defect - // that predates the uninstaller relay and is being tracked separately. The - // escape hatch it needed is the kind that quietly grows until the gate - // asserts nothing, so pin it to exactly that one file. - it('confines the advisory escape hatch to elevate.exe', () => { - const steps = readWorkflow('.github/workflows/windows-signing-rehearsal.yml').jobs.rehearse - .steps - const verify = stepNamed(steps, 'Verify signatures end to end') - const advisoryCalls = verify.run - .split('\n') - .filter((line) => line.includes('-Advisory') && line.includes('Test-Signature')) - - expect(advisoryCalls).toHaveLength(1) - expect(advisoryCalls[0]).toContain('installed: $relative') - expect(verify.run).toContain("if ($relative -eq 'resources\\elevate.exe')") - - // Both uninstaller verdicts stay fatal — the whole point of the gate. - for (const call of ['relayed: orca-uninstaller.exe', 'shipped: Uninstall Orca.exe']) { - const line = verify.run - .split('\n') - .find((it) => it.includes(`Test-Signature`) && it.includes(call)) - expect(line, call).toBeDefined() - expect(line, call).not.toContain('-Advisory') - } - - // An advisory must still reach the evidence artifact, or downgrading it - // becomes indistinguishable from deleting the check. - expect(verify.run).toContain('ADVISORY (known pre-existing') - expect(verify.run).toContain('$script:advisories.Add($problem)') - }) - - it('wires the electron-builder sign hook that the relay depends on', () => { - const require = createRequire(import.meta.url) - const configPath = resolve(projectDir, 'config/electron-builder.config.cjs') - delete require.cache[require.resolve(configPath)] - const config = require(configPath) - - expect(typeof config.win.signtoolOptions.sign).toBe('function') - delete require.cache[require.resolve(configPath)] - }) -}) diff --git a/mobile/src/accounts/mobile-accounts-route.test.ts b/mobile/src/accounts/mobile-accounts-route.test.ts index 0b25d44d3f0c..2a77c8a2b3a2 100644 --- a/mobile/src/accounts/mobile-accounts-route.test.ts +++ b/mobile/src/accounts/mobile-accounts-route.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { describe, expect, it, vi } from 'vitest' import { mobileAccountsRouteTarget } from './mobile-accounts-route' import { @@ -7,12 +6,6 @@ import { type HostStackNavigationState } from '../navigation/host-stack-navigation' -const homeSource = readFileSync(new URL('../home/MobileHomeScreen.tsx', import.meta.url), 'utf8') -const accountCardsSource = readFileSync( - new URL('../home/MobileHomeAccountUsageCards.tsx', import.meta.url), - 'utf8' -) - function navigationHarness(initialState: HostStackNavigationState) { const stateListeners = new Set<() => void>() let state = initialState @@ -85,10 +78,4 @@ describe('mobile accounts route', () => { payload: mobileAccountsRouteTarget('host/one') }) }) - - it('opens the home account-usage card through the cold-navigator-safe transition', () => { - expect(homeSource).toContain('onOpenAccounts={openMobileAccounts}') - expect(accountCardsSource).toContain('props.onOpen(host.id)') - expect(accountCardsSource).not.toContain('/accounts`') - }) }) diff --git a/mobile/src/browser/mobile-browser-pane-source.test.ts b/mobile/src/browser/mobile-browser-pane-source.test.ts deleted file mode 100644 index 69cd5af5391e..000000000000 --- a/mobile/src/browser/mobile-browser-pane-source.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { readFileSync } from 'node:fs' -import { describe, expect, it } from 'vitest' - -const source = readFileSync(new URL('./MobileBrowserPane.tsx', import.meta.url), 'utf8') - -function sliceBetween(startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('MobileBrowserPane source invariants', () => { - it('mirrors handler refs in a layout effect instead of during render', () => { - const mirrorBlock = sliceBetween( - 'useLayoutEffect(() => {', - ' useEffect(() => {\n lastZoomResetUrlRef.current' - ) - - expect(mirrorBlock).toContain('frameMetadataRef.current = frameMetadata') - expect(mirrorBlock).toContain('layoutRef.current = layout') - expect(mirrorBlock).toContain('dialogRef.current = dialog') - expect(mirrorBlock).toContain('zoomRef.current = zoom') - expect(mirrorBlock).toContain('}, [dialog, frameMetadata, layout, zoom])') - }) -}) diff --git a/mobile/src/components/mobile-agent-icon-assets.test.ts b/mobile/src/components/mobile-agent-icon-assets.test.ts index f4f6325d806d..7020d4b4977a 100644 --- a/mobile/src/components/mobile-agent-icon-assets.test.ts +++ b/mobile/src/components/mobile-agent-icon-assets.test.ts @@ -1,4 +1,4 @@ -import { existsSync, readFileSync } from 'node:fs' +import { existsSync } from 'node:fs' import path from 'node:path' import { describe, expect, it } from 'vitest' import type { TuiAgent } from '../../../src/shared/tui-agent' @@ -17,7 +17,6 @@ const GLYPH_AGENT_IDS = new Set([ const dirname = import.meta.dirname const assetsDir = path.resolve(dirname, '../../../src/shared/agent-icons') -const assetsModuleSource = readFileSync(path.join(dirname, 'mobile-agent-icon-assets.ts'), 'utf8') // Why: these agents previously loaded from Google's favicon service, which is // unreachable in some regions/offline (#8451). Every one that lacks a glyph @@ -34,12 +33,4 @@ describe('mobile bundled agent icons', () => { ) } }) - - it('wires every favicon-path agent into the bundled asset map', () => { - for (const id of agentsNeedingBundledIcon) { - expect(assetsModuleSource, `${id} not mapped in mobile-agent-icon-assets.ts`).toContain( - `agent-icons/${id}.png` - ) - } - }) }) diff --git a/mobile/src/files/files-router-seam-census.test.ts b/mobile/src/files/files-router-seam-census.test.ts deleted file mode 100644 index 360b040b2df6..000000000000 --- a/mobile/src/files/files-router-seam-census.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - callsRouteHandoff, - importsExpoRouterValue, - parse, - productFiles -} from '../navigation/router-seam-census.test-support' - -const FILES_ROOT = import.meta.dirname - -/** - * Which modules here hold a router, so the census cannot pass by seeing nothing. - * - * The walk and the two rules are the seam's, shared with every other domain that runs them; what - * stays here is this domain's own evidence: which of its modules are meant to hold a router. - */ -const ROUTER_HOLDERS = ['MobileFilePreviewScreen.tsx', 'MobileFileExplorerPanel.tsx'] - -describe('the files domain reaches the router through the handoff seam', () => { - const files = productFiles(FILES_ROOT) - - it('walks the modules it is written against', () => { - expect(files).toEqual(expect.arrayContaining(ROUTER_HOLDERS)) - }) - - it('imports no router from expo-router, which the page cannot hand a route back through', () => { - expect(files.filter((name) => importsExpoRouterValue(parse(FILES_ROOT, name)))).toEqual([]) - }) - - it('takes the router from useRouteHandoff at every screen that holds one', () => { - expect(files.filter((name) => callsRouteHandoff(parse(FILES_ROOT, name))).sort()).toEqual( - [...ROUTER_HOLDERS].sort() - ) - }) -}) diff --git a/mobile/src/home-host-edit-navigation-source.test.ts b/mobile/src/home-host-edit-navigation-source.test.ts deleted file mode 100644 index 617dd030c8a2..000000000000 --- a/mobile/src/home-host-edit-navigation-source.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { readFileSync } from 'node:fs' -import { describe, expect, it } from 'vitest' - -const homeSource = readFileSync(new URL('./home/MobileHomeScreen.tsx', import.meta.url), 'utf8') - -describe('Home host edit navigation wiring', () => { - it('uses the cold-navigator-safe edit transition', () => { - expect(homeSource).toMatch(/const openMobileHostEdit = useOpenMobileHostEdit\(\)/) - expect(homeSource).toMatch(/onEdit:\s*openMobileHostEdit/) - }) -}) diff --git a/mobile/src/hooks/use-mobile-dictation-source.test.ts b/mobile/src/hooks/use-mobile-dictation-source.test.ts deleted file mode 100644 index aedc0543bcea..000000000000 --- a/mobile/src/hooks/use-mobile-dictation-source.test.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { readFileSync } from 'node:fs' -import { describe, expect, it } from 'vitest' - -const source = readFileSync(new URL('./use-mobile-dictation.ts', import.meta.url), 'utf8') -const nativeCaptureSource = readFileSync( - new URL('../platform/dictation-capture.ts', import.meta.url), - 'utf8' -) - -function sliceSource(sourceText: string, startPattern: string, endPattern: string): string { - const start = sourceText.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = sourceText.indexOf(endPattern, start) - expect(end).toBeGreaterThan(start) - return sourceText.slice(start, end) -} - -function sliceBetween(startPattern: string, endPattern: string): string { - return sliceSource(source, startPattern, endPattern) -} - -describe('useMobileDictation source invariants', () => { - it('publishes live option refs from committed renders before passive Effects flush', () => { - const refDeclarations = sliceBetween( - 'const clientRef = useRef(client)', - 'useLayoutEffect(() => {' - ) - expect(refDeclarations).not.toContain('.current =') - - const mirrorEffect = sliceBetween('useLayoutEffect(() => {', 'const reportError =') - expect(mirrorEffect).toContain('clientRef.current = client') - expect(mirrorEffect).toContain('enabledRef.current = enabled') - expect(mirrorEffect).toContain('onTranscriptRef.current = onTranscript') - expect(mirrorEffect).toContain('onErrorRef.current = onError') - expect(mirrorEffect).toContain('}, [client, enabled, onTranscript, onError])') - }) - - it('carries audio the capture dropped into the same refusal the budget raises', () => { - const chunkHandler = sliceBetween('const sub = capture.onChunk(', 'return () => sub.remove()') - expect(chunkHandler).toContain('if (chunk.droppedBytes > 0)') - expect(chunkHandler).toContain('MOBILE_DICTATION_CONNECTION_SLOW_ERROR_MESSAGE') - // Only the page can drop: the seam's native half is where the microphone is. - expect(nativeCaptureSource).toContain('droppedBytes: 0') - }) - - it('resets pending audio bytes whenever pending chunk tracking is cleared', () => { - const pendingChunkClears = source.match(/pendingChunksRef\.current\.clear\(\)/g) ?? [] - const pendingAudioResets = source.match(/pendingAudioBudgetRef\.current\.reset\(\)/g) ?? [] - - expect(pendingAudioResets).toHaveLength(pendingChunkClears.length) - }) - - it('closes the capture on every path that ends a dictation', () => { - const closeAudio = sliceBetween( - 'const closeDictationAudio = useCallback(', - 'const failActiveDictation =' - ) - expect(closeAudio).toContain('capture.end()') - const cleanupSlices = [ - sliceBetween('const failActiveDictation = useCallback(', 'useEffect(() => {'), - sliceBetween('const abandonDictation = useCallback(', 'const cancel ='), - sliceBetween('return () => {\n const dictationId = activeIdRef.current', ' return {') - ] - for (const cleanupSlice of cleanupSlices) { - expect(cleanupSlice).toContain('closeDictationAudio()') - } - // The capture hands over its tail before the pending sends are taken, or the finish overtakes - // the last chunk. `mobile-dictation-stop-tail.test.tsx` drives the order this pins. - const stopBody = sliceBetween( - 'const stop = useCallback(async () => {', - 'const abandonDictation =' - ) - expect(stopBody.indexOf('capture.end()')).toBeLessThan( - stopBody.indexOf('await Promise.allSettled') - ) - }) - - it('routes an audio interruption through cancel and a disable through the reporting abort', () => { - const interruptionEffect = sliceBetween('capture.onInterruption(', 'return () => sub.remove()') - const disabledEffect = sliceBetween( - 'useEffect(() => {\n if (!enabled) {', - ' }, [abandonDictation, enabled])' - ) - - expect(interruptionEffect).toContain('void cancel()') - // A disable is not the user's cancel, so it carries the reason the composer shows; the user's - // own cancel is the one end that passes none. `mobile-dictation-input-closed-mid-start.test.tsx` - // drives both halves. - expect(disabledEffect).toContain( - 'void abandonDictation(MOBILE_DICTATION_INPUT_CLOSED_ERROR_MESSAGE)' - ) - expect(source).toContain('const cancel = useCallback(() => abandonDictation(null)') - // Which interruptions end a capture is one predicate both seams read, so a page cannot cancel - // on a kind the device ignores. `dictation-capture.test.ts` drives the rule itself. - expect(nativeCaptureSource).toContain('bridgeAudioInterruptionEndsCapture(event.data)') - }) -}) diff --git a/mobile/src/host-screen/host-route-href-encoding.test.ts b/mobile/src/host-screen/host-route-href-encoding.test.ts deleted file mode 100644 index c1ced2afe904..000000000000 --- a/mobile/src/host-screen/host-route-href-encoding.test.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -/** - * Every host-route target the host page builds, and whether its host id survives being one segment. - * - * `useLocalSearchParams` and the persisted host store both answer the decoded id, and the store - * admits any non-empty string, so an id carrying `/`, `?`, `#` or whitespace stops being the single - * segment `matchesRoutePattern` reads it as the moment it is interpolated raw. Inside the shell's - * page that decides where a tap goes: the handoff matches the pathname against the shell's - * `pageRoutes` before it chooses between this document and the native stack. - * - * A census rather than six assertions, because the failure is a habit and not a bug: each of these - * sites was written by copying the one next to it, and the seventh will be too. - */ -const MOBILE_ROOT = join(import.meta.dirname, '..', '..') - -/** The files that build a target from the host list and its row sheet. */ -const HOST_PAGE_SOURCES = [ - 'src/host-screen/host-screen-header.tsx', - 'src/host-screen/host-screen-overlays.tsx', - 'src/host-screen/use-host-worktree-actions.ts', - 'src/agent-history/worktree-navigation-actions.ts' -] - -/** - * The two `/h/${...}` reads that are not targets. - * - * Both compare against a pathname the router answers rather than building a link, so encoding them - * would change what a comparison matches instead of what a tap opens. They are listed by the text - * that makes them comparisons, so a line that stopped being one stops being exempt. - */ -const COMPARISONS = ['pathname === `/h/${hostId}`'] - -const HOST_SEGMENT = /`\/h\/\$\{([^}]*)\}/g - -function hostInterpolations(source: string): string[] { - return [...source.matchAll(HOST_SEGMENT)].map((match) => match[1] ?? '') -} - -describe('every host-route target the host page builds', () => { - it('reaches the census, so the assertion below cannot pass on an empty list', () => { - const found = HOST_PAGE_SOURCES.flatMap((path) => - hostInterpolations(readFileSync(join(MOBILE_ROOT, path), 'utf8')) - ) - expect(found.length).toBeGreaterThanOrEqual(6) - }) - - it('encodes the host id, at every site', () => { - const raw: string[] = [] - for (const path of HOST_PAGE_SOURCES) { - const source = readFileSync(join(MOBILE_ROOT, path), 'utf8') - const exempt = COMPARISONS.filter((text) => source.includes(text)).length - const unencoded = hostInterpolations(source).filter( - (expression) => !expression.includes('encodeURIComponent') - ) - // The comparisons are subtracted rather than matched away, so a file that lost its comparison - // and gained a raw target does not come out even. - if (unencoded.length > exempt) { - raw.push(`${path}: ${unencoded.length - exempt} raw`) - } - } - expect(raw).toEqual([]) - }) - - it('keeps the pathname comparisons out of the count for a stated reason, not by accident', () => { - const source = readFileSync( - join(MOBILE_ROOT, 'src/host-screen/use-host-worktree-actions.ts'), - 'utf8' - ) - // Present, so the exemption above is answering something real; and a comparison, so the - // exemption is not quietly covering a target. - expect(source).toContain(COMPARISONS[0]) - }) -}) diff --git a/mobile/src/mobile-web-shell/MobileWebShellScreen.test.tsx b/mobile/src/mobile-web-shell/MobileWebShellScreen.test.tsx index a93f503bd63a..64220f80c110 100644 --- a/mobile/src/mobile-web-shell/MobileWebShellScreen.test.tsx +++ b/mobile/src/mobile-web-shell/MobileWebShellScreen.test.tsx @@ -28,7 +28,6 @@ import { act, create } from 'react-test-renderer' import { bridgeId, clientFrame, createFakeRpcClient } from './bridge-host-test-fakes' import { byName, - DEFAULT_ROUTE_GRANTS, trackRenderedScreen, NativeFallback, SCREEN_BUILD_ID as BUILD_ID, @@ -150,7 +149,6 @@ describe('the hybrid shell screen', () => { const tree = await renderScreen(readyState('session-one')) const view = byName(tree, 'ShellViewProbe')[0] expect(view.props.bridgeEnabled).toBe(true) - expect(typeof view.props.onBridgeMessage).toBe('function') // Delivered with no client behind it: there is no host to answer, and nothing throws. await act(async () => { view.props.onBridgeMessage({ nativeEvent: { json: '{"v":1,"type":"ready"}' } }) @@ -634,22 +632,6 @@ describe('a refused update is said beside the page, not in front of it', () => { }) }) -/** - * Last in the file on purpose: it is the case the block above would have poisoned. - * - * Those cases grant the screencast lane and install a client, and before the shared setup reset - * them both, whatever ran next inherited a route granted a lane it never asked for. Deleting the - * reset fails here and nowhere else, because nothing else runs after a case that mutates them. - */ -describe('what one case mutates does not reach the next', () => { - it('starts from the shared route grants and no client', () => { - expect({ grants: dependencies.routeGrants, client: dependencies.client }).toEqual({ - grants: DEFAULT_ROUTE_GRANTS, - client: null - }) - }) -}) - /** * What is on screen between the generation being mounted and the page having a frame. * diff --git a/mobile/src/mobile-web-shell/bridge/bridge-client-frame-cap-boundary.test.ts b/mobile/src/mobile-web-shell/bridge/bridge-client-frame-cap-boundary.test.ts index 1901b5f368c4..b29219f178eb 100644 --- a/mobile/src/mobile-web-shell/bridge/bridge-client-frame-cap-boundary.test.ts +++ b/mobile/src/mobile-web-shell/bridge/bridge-client-frame-cap-boundary.test.ts @@ -1,6 +1,4 @@ import { describe, expect, it } from 'vitest' -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { BRIDGE_MAX_MESSAGE_BYTES, parseBridgeMessage } from './bridge-caps' import { createFakeBridgePortPair } from './bridge-port-pair-test-harness' @@ -95,18 +93,4 @@ describe('the page frame cap at its boundary', () => { expect(read.ok).toBe(false) expect(read.ok ? null : read.refusal).toBe('oversized') }) - - it('reaches the cap through the shared predicate and spells it nowhere else', () => { - // The census half. A copy of the bound inside the client is a second spelling that can only - // drift from the one the reader applies, and it would pass every case above on the day it was - // written. `isBridgeFrameWithinCap` is the one thing both sides call. - const client = readFileSync(join(import.meta.dirname, 'bridge-rpc-client.ts'), 'utf8') - expect(client).toContain('isBridgeFrameWithinCap(') - expect(client).not.toContain('BRIDGE_MAX_MESSAGE_BYTES') - // And the predicate is the reader's own, not a lookalike beside it: the module that parses - // inbound frames is the module that exports it. - const caps = readFileSync(join(import.meta.dirname, 'bridge-caps.ts'), 'utf8') - expect(caps).toContain('export function isBridgeFrameWithinCap') - expect(caps).toContain('if (!isBridgeFrameWithinCap(raw))') - }) }) diff --git a/mobile/src/mobile-web-shell/bridge/bridge-client-frame-cap-unit.test.ts b/mobile/src/mobile-web-shell/bridge/bridge-client-frame-cap-unit.test.ts index f4ab3eb9bd32..351810c682a3 100644 --- a/mobile/src/mobile-web-shell/bridge/bridge-client-frame-cap-unit.test.ts +++ b/mobile/src/mobile-web-shell/bridge/bridge-client-frame-cap-unit.test.ts @@ -1,6 +1,4 @@ import { describe, expect, it } from 'vitest' -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { BRIDGE_MAX_MESSAGE_BYTES, parseBridgeMessage, utf8ByteLength } from './bridge-caps' import { createFakeBridgePortPair } from './bridge-port-pair-test-harness' @@ -28,18 +26,6 @@ const WIDE_CHARACTER = '漢' const WIDE_CHARACTER_COUNT = 250_000 describe('what the frame cap counts', () => { - it('is the unit both shells count, read from their own sources', () => { - const shell = join(import.meta.dirname, '..', '..', '..', 'modules', 'orca-mobile-web-shell') - const swift = readFileSync(join(shell, 'ios', 'MobileWebShellView.swift'), 'utf8') - const kotlin = readFileSync( - join(shell, 'android/src/main/java/expo/modules/orcamobilewebshell/MobileWebShellView.kt'), - 'utf8' - ) - // The inbound gate on each platform, by the expression it measures with. - expect(swift).toContain('bridgeGate.accepts(byteCount: json.utf8.count)') - expect(kotlin).toContain('bridgeGate.accepts(json.toByteArray(Charsets.UTF_8).size)') - }) - it('refuses a frame under the cap in code units and over it in bytes', async () => { const pad = WIDE_CHARACTER.repeat(WIDE_CHARACTER_COUNT) // The precondition, without which this is just another oversized frame: a sender reading diff --git a/mobile/src/mobile-web-shell/bridge/bridge-envelope.test.ts b/mobile/src/mobile-web-shell/bridge/bridge-envelope.test.ts index 4542949ac326..a1abc7c2d3c3 100644 --- a/mobile/src/mobile-web-shell/bridge/bridge-envelope.test.ts +++ b/mobile/src/mobile-web-shell/bridge/bridge-envelope.test.ts @@ -1,14 +1,9 @@ import { describe, expect, it } from 'vitest' import { BrowserScreencastOpcode, - type BrowserScreencastFormat, type BrowserScreencastFrame } from '../../transport/browser-screencast-protocol' import { isRpcResponse } from '../../transport/rpc-response-shape' -import type { ConnectionState, ForegroundNudgeReason, RpcResponse } from '../../transport/types' -import type { SendRequestOptions } from '../../transport/unvalidated-rpc-request-port' -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' import { BRIDGE_MAX_MESSAGE_BYTES, BRIDGE_MAX_METHOD_CHARS, @@ -23,16 +18,12 @@ import { } from './bridge-caps' import { BRIDGE_HAPTICS_KINDS, BRIDGE_HAPTICS_NOTIFY } from './bridge-haptics-notify' import { - BRIDGE_BINARY_FORMATS, - BRIDGE_CONNECTION_STATES, BRIDGE_FAULT_GRANT, - BRIDGE_FOREGROUND_NUDGE_REASONS, BRIDGE_NAVIGATE_BACK_NOTIFY, BRIDGE_PROTOCOL_VERSION, readBridgeClientMessage, readBridgeHostMessage, - type BridgeHostMessage, - type BridgeReplyPayload + type BridgeHostMessage } from './bridge-envelope' import { BRIDGE_BACK_CLAIM_NOTIFY } from './bridge-page-back' import { BRIDGE_PAGE_PAINTED } from './bridge-page-painted' @@ -592,86 +583,7 @@ describe('the reply reader is the native acceptance predicate', () => { }) }) -describe('type pins', () => { - it('pins the protocol version both sides send', () => { - expect(BRIDGE_PROTOCOL_VERSION).toBe(1) - }) - - it('closes the connection states over the transport union', () => { - const asTransport = (value: (typeof BRIDGE_CONNECTION_STATES)[number]): ConnectionState => value - const asBridge = (value: ConnectionState): (typeof BRIDGE_CONNECTION_STATES)[number] => value - expect(BRIDGE_CONNECTION_STATES.map(asTransport).map(asBridge)).toEqual([ - ...BRIDGE_CONNECTION_STATES - ]) - }) - - it('closes the foreground reasons over the transport union', () => { - const asTransport = ( - value: (typeof BRIDGE_FOREGROUND_NUDGE_REASONS)[number] - ): ForegroundNudgeReason => value - const asBridge = ( - value: ForegroundNudgeReason - ): (typeof BRIDGE_FOREGROUND_NUDGE_REASONS)[number] => value - expect(BRIDGE_FOREGROUND_NUDGE_REASONS.map(asTransport).map(asBridge)).toEqual([ - ...BRIDGE_FOREGROUND_NUDGE_REASONS - ]) - }) - - it('resolves a reply payload to the transport envelope the page hands its callers', () => { - const asRpcResponse = (value: BridgeReplyPayload): RpcResponse => value - const read = readHost(client({ type: 'reply', id: ID, payload: SUCCESS_PAYLOAD })) - const payload = - read.ok && read.message.type === 'reply' && 'payload' in read.message - ? asRpcResponse(read.message.payload) - : null - expect(payload).toEqual(SUCCESS_PAYLOAD) - }) - - it('accepts every option the raw sender declares', () => { - // Both directions: the literal has to satisfy the type, and the type has to have no key the - // literal is missing, so a new option fails to compile until the schema learns it. - const optionKeys: Record = { - timeoutMs: true, - budgetSpansConnect: true, - failWhenDisconnected: true - } - const options: SendRequestOptions = { - timeoutMs: 1000, - budgetSpansConnect: true, - failWhenDisconnected: true - } - expect(Object.keys(optionKeys).toSorted()).toEqual(Object.keys(options).toSorted()) - expect(readClient(client({ type: 'request', id: ID, method: 'm', options })).ok).toBe(true) - }) - - it('bounds the viewport exactly where the desktop terminal contract does', () => { - // A viewport the page sends is replayed on resubscribe by every stream naming that terminal, - // the native screens' included. One the desktop refuses there would kill a stream the page - // never opened, so the two bounds have to be the same number. - // - // Read rather than imported: mobile may not pull a contract *value* into its bundle, and the - // boundary test that enforces that scans this file too. - const contract = readFileSync( - fileURLToPath( - new URL('../../../../src/shared/rpc-contract/terminal-unary-params.ts', import.meta.url) - ), - 'utf8' - ) - const start = contract.indexOf('export const TerminalViewport') - expect(start).toBeGreaterThan(-1) - const declaration = contract.slice(start, contract.indexOf('})', start)) - expect(declaration).toContain(`cols: z.number().int().min(1).max(${BRIDGE_MAX_VIEWPORT_COLS})`) - expect(declaration).toContain(`rows: z.number().int().min(1).max(${BRIDGE_MAX_VIEWPORT_ROWS})`) - }) - - it('closes the binary formats over the screencast protocol', () => { - const asProtocol = (value: (typeof BRIDGE_BINARY_FORMATS)[number]): BrowserScreencastFormat => - value - const asBridge = (value: BrowserScreencastFormat): (typeof BRIDGE_BINARY_FORMATS)[number] => - value - expect(BRIDGE_BINARY_FORMATS.map(asProtocol).map(asBridge)).toEqual([...BRIDGE_BINARY_FORMATS]) - }) - +describe('the screencast frame reader', () => { it('refuses a screencast metadata field that is not a finite number', () => { const keys = [ 'offsetTop', diff --git a/mobile/src/mobile-web-shell/bridge/page-first-paint-through-the-bridge.test.ts b/mobile/src/mobile-web-shell/bridge/page-first-paint-through-the-bridge.test.ts index c4962ebe16c6..46faf5f38c14 100644 --- a/mobile/src/mobile-web-shell/bridge/page-first-paint-through-the-bridge.test.ts +++ b/mobile/src/mobile-web-shell/bridge/page-first-paint-through-the-bridge.test.ts @@ -3,8 +3,6 @@ * what is worth proving is that the page's post reaches the shell's cover over a real frame. */ import { describe, expect, it } from 'vitest' -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { createFakeRpcClient } from '../bridge-host-test-fakes' import { createFakeBridgePortPair } from './bridge-port-pair-test-harness' import { createRouteScreenPaintReporter } from './page-first-paint' @@ -33,23 +31,6 @@ describe('the page telling the shell it has a frame', () => { expect(pair.pagePaintCount()).toBe(1) }) - it('is reported by the page entry, from the effect that runs after the tree commits', () => { - // The one call site, pinned: every test above drives the client directly, so a deleted line in - // the entry would leave a shell covering a page that has painted and will never say so. - const entry = readFileSync( - join(import.meta.dirname, '..', '..', '..', 'web-entry', 'index.tsx'), - 'utf8' - ) - expect(entry).toContain('createRouteScreenPaintReporter(') - expect(entry).toContain('client.notifyPagePainted()') - // Handed to the route screen rather than called from the wrapper's own effect, which commits - // while the route's chunk is still arriving and the body is empty. - expect(entry).toContain('RouteScreenPaintProvider') - expect(entry).not.toMatch( - /stampPageMountState\(target, 'mounted'\)\s*\n\s*reportRouteScreenPaint/ - ) - }) - it('costs the shell nothing to hear: no request, no subscription, no reply', async () => { const rpc = createFakeRpcClient() const pair = createFakeBridgePortPair({ rpc }) diff --git a/mobile/src/mobile-web-shell/mobile-web-shell-flag-census.test.ts b/mobile/src/mobile-web-shell/mobile-web-shell-flag-census.test.ts deleted file mode 100644 index fd23a1333757..000000000000 --- a/mobile/src/mobile-web-shell/mobile-web-shell-flag-census.test.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join, relative } from 'node:path' -import { describe, expect, it } from 'vitest' -import { censusSourceFiles } from '../test-support/census-source-files' - -/** - * The hybrid shell flag is the whole of what keeps this feature dark in a native build, so who - * touches it is a product invariant rather than a convention. A second reader is how a dark feature - * stops being dark: a launch-time sweep, a prefetch or a menu item that consults the flag would run - * in a native store build the moment anything flipped it, and none of those would fail a type - * check. - * - * The build-kind fact is the same shape of invariant one level up. `EXPO_PUBLIC_MOBILE_SHELL` is - * what a release workflow sets to build the OTA binary, and a second module spelling it would be a - * second answer to "is this the page's build" that no type check would catch either. - */ -const MOBILE_ROOT = join(import.meta.dirname, '..', '..') -const FLAG_KEY = 'orca:mobileWebShellEnabled' -/** The inlined form. Prose may name the variable; this is the spelling that reads it. */ -const BUILD_SWITCH_READ = 'process.env.EXPO_PUBLIC_' -/** The other spelling Expo's plugin inlines, which is how the rule above would be evaded. */ -const BUILD_SWITCH_BRACKET_READ = "process.env['EXPO_PUBLIC_" -const DEFINITION = 'src/storage/preferences.ts' -/** The one product reader, which only the shared switch decision asks. */ -const FLAG_HOOK = 'src/mobile-web-shell/use-mobile-web-shell-enabled.ts' -/** The one caller of that hook: every route asks this instead, so its list is the whole census. */ -const DECISION = 'src/mobile-web-shell/shell-switch-decision.ts' -const ROUTE = 'app/h/[hostId]/web.tsx' -const HOST_ROUTE = 'app/h/[hostId]/index.tsx' -const AGENT_HISTORY_ROUTE = 'app/h/[hostId]/agent-history/[worktreeId].tsx' -const TASKS_ROUTE = 'app/h/[hostId]/tasks.tsx' -const FILES_ROUTE = 'app/h/[hostId]/files/[worktreeId].tsx' -const FILES_PREVIEW_ROUTE = 'app/h/[hostId]/files/preview/[worktreeId].tsx' -const SOURCE_CONTROL_ROUTE = 'app/h/[hostId]/source-control/[worktreeId].tsx' -const REVIEW_ROUTE = 'app/h/[hostId]/review/[worktreeId].tsx' -const SESSION_ROUTE = 'app/h/[hostId]/session/[worktreeId].tsx' -/** The one switch with no native screen behind it; its route file only re-exports this body. */ -const CATCH_ALL_ROUTE = 'src/mobile-web-shell/catch-all-page-route.tsx' -/** What a switch paints while the decision is `pending`, and the third thing every switch names. */ -const PENDING_SCREEN = 'src/mobile-web-shell/ShellSwitchPendingScreen.tsx' -/** One entry per screen the flag can switch to the page, which is what a review reads. */ -const SWITCHED_ROUTES = [ - HOST_ROUTE, - AGENT_HISTORY_ROUTE, - TASKS_ROUTE, - FILES_ROUTE, - FILES_PREVIEW_ROUTE, - SOURCE_CONTROL_ROUTE, - REVIEW_ROUTE, - SESSION_ROUTE, - CATCH_ALL_ROUTE -] -const DEVELOPER_ROW = 'src/diagnostics/mobile-web-shell-dev-row.tsx' -/** The one screen that decides whether that row mounts, which is a build-kind question. */ -const TROUBLESHOOT_ROUTE = 'app/troubleshoot.tsx' -/** Every tree that ships in the app bundle, with the floor each must clear. `modules` is two files, - * but it is where the native view lives and so the easiest place for a second reader to hide. */ -const TREES = { src: 200, app: 10, modules: 1 } -const SHELL_VIEW = 'modules/orca-mobile-web-shell/src/index.ts' - -function sourceFiles(directory: string): string[] { - return censusSourceFiles(join(MOBILE_ROOT, directory)) - .map((path) => relative(MOBILE_ROOT, path)) - .filter((path) => /\.tsx?$/.test(path) && !path.includes('.test.')) -} - -const SOURCES = Object.keys(TREES) - .flatMap((tree) => sourceFiles(tree)) - .map((path) => ({ - path: path.split('\\').join('/'), - text: readFileSync(join(MOBILE_ROOT, path), 'utf8') - })) - -function filesContaining(needle: string): string[] { - return SOURCES.filter((file) => file.text.includes(needle)) - .map((file) => file.path) - .sort() -} - -/** - * The same matches with the line each was read off, as the failure message for the rules below. - * - * A census that answers only with paths tells a reader which file is wrong and nothing about what - * in it is: the needles here are identifiers, and a file can name one in an import, a call or a - * comment. The snippet is what turns "this list moved" into the edit that moved it. - */ -function matchesOf(needle: string): string { - // Sorted by path then by line number, not as text: `:59:` sorts before `:4:` as a string, which - // reads as a file whose matches are out of order. - return [...SOURCES] - .sort((left, right) => left.path.localeCompare(right.path)) - .flatMap((file) => - file.text - .split('\n') - .flatMap((line, index) => - line.includes(needle) ? [`${file.path}:${index + 1}: ${line.trim()}`] : [] - ) - ) - .join('\n') -} - -describe('who touches the hybrid shell flag', () => { - it('reaches every shipped tree, so the absence assertions below cannot pass vacuously', () => { - const paths = SOURCES.map((file) => file.path) - expect(paths).toContain(DEFINITION) - expect(paths).toContain(FLAG_HOOK) - expect(paths).toContain(DECISION) - expect(paths).toContain(PENDING_SCREEN) - expect(paths).toContain(ROUTE) - for (const route of SWITCHED_ROUTES) { - expect(paths).toContain(route) - } - expect(paths).toContain(DEVELOPER_ROW) - expect(paths).toContain(TROUBLESHOOT_ROUTE) - expect(paths).toContain(SHELL_VIEW) - const trees = Object.keys(TREES) - for (const [tree, floor] of Object.entries(TREES)) { - expect(paths.filter((path) => path.startsWith(`${tree}/`)).length).toBeGreaterThan(floor) - } - expect(paths.filter((path) => !trees.some((tree) => path.startsWith(`${tree}/`)))).toEqual([]) - }) - - it('keeps the storage key itself in one module', () => { - expect(filesContaining(FLAG_KEY)).toEqual([DEFINITION]) - }) - - it('reads the build-time switch in one module', () => { - // `babel-preset-expo` inlines an `EXPO_PUBLIC_*` variable only where it is spelled as a - // literal member expression of `process.env`, so a second read is a second literal to keep in - // step with the workflow input — and a value copied out into a binding is not rewritten at - // all, which reads `undefined` on a device and answers native in a build that is not. - // - // Prose is not a read: the docblocks that name the variable are how a reader finds this - // module, and pinning them would make every wording change a census failure. - expect(filesContaining(BUILD_SWITCH_READ), matchesOf(BUILD_SWITCH_READ)).toEqual([DEFINITION]) - expect( - filesContaining(BUILD_SWITCH_BRACKET_READ), - matchesOf(BUILD_SWITCH_BRACKET_READ) - ).toEqual([]) - }) - - it('answers the build kind through one named function, asked by the flag and the row label', () => { - expect(filesContaining('mobileShellBuildKind'), matchesOf('mobileShellBuildKind')).toEqual( - [DEFINITION, DEVELOPER_ROW].sort() - ) - }) - - it('is read by one hook and by the developer row that writes it, and nowhere else', () => { - expect(filesContaining('loadMobileWebShellEnabled')).toEqual( - [DEFINITION, DEVELOPER_ROW, FLAG_HOOK].sort() - ) - }) - - it('is read by the shared switch decision and by nothing else', () => { - // The narrowest this has ever been, and the reason the rule below is total: a route cannot - // hold a private opinion about the flag — including about the window where it is still `null` - // — without reading it, and this is the only place that reads it. - expect( - filesContaining('useMobileWebShellEnabled'), - matchesOf('useMobileWebShellEnabled') - ).toEqual([DECISION, FLAG_HOOK].sort()) - }) - - it('reaches the switched routes through that decision and no others', () => { - // Each switched route is a screen the flag decides the renderer of, and one more is one more - // place a dark feature could turn itself on. The list grows once per domain series, in the PR - // that switches the route file to MobileWebShellScreen, and never as a side effect of anything - // else. A switched route is inert until MOBILE_WEB_PAGE_ROUTES lists it as well, so an entry - // here can land a PR ahead of that one. - expect(filesContaining('useShellSwitchDecision'), matchesOf('useShellSwitchDecision')).toEqual( - [DECISION, ROUTE, ...SWITCHED_ROUTES].sort() - ) - }) - - it('gives every one of them the same neutral state to paint while the flag is unresolved', () => { - // The rule a sixth switch would otherwise regress past. Reading the flag through the decision - // is not on its own enough: a switch that ignored `pending` and fell through to its native - // screen would satisfy the rule above and still flash native in front of a flag-on user. This - // one says every switch names the neutral screen, which is existence rather than shape — where - // it names it is the route test's business, and `shell-switch-null-flag.test.tsx` drives all - // nine through the states themselves. - expect( - filesContaining('ShellSwitchPendingScreen'), - matchesOf('ShellSwitchPendingScreen') - ).toEqual([PENDING_SCREEN, ROUTE, ...SWITCHED_ROUTES].sort()) - }) - - it('fences the build kind in one place, which the read, the hook and the row gate ask', () => { - // The test that makes a native store build unable to turn the flag on: `__DEV__`, or a binary - // built with the switch set to `ota`. The hook starts its state on it so a native release - // build never reaches the neutral state, which is the same answer `loadMobileWebShellEnabled` - // gives one render later — and two spellings of one build-kind test are two things to keep - // true, where this feature's darkness rests on exactly one. - // - // The Troubleshoot route asks the same question to decide whether to mount the toggle, which - // is the one place a user can switch an OTA build back to the native screens. Asking it rather - // than re-deriving it is why that row and the flag can never disagree about the build. - expect( - filesContaining('mobileWebShellFlagCanBeOn'), - matchesOf('mobileWebShellFlagCanBeOn') - ).toEqual([DEFINITION, FLAG_HOOK, TROUBLESHOOT_ROUTE].sort()) - }) - - it('is written only by the developer row', () => { - expect(filesContaining('saveMobileWebShellEnabled')).toEqual([DEFINITION, DEVELOPER_ROW].sort()) - }) -}) diff --git a/mobile/src/mobile-web-shell/mobile-web-shell-router-seam-census.test.ts b/mobile/src/mobile-web-shell/mobile-web-shell-router-seam-census.test.ts deleted file mode 100644 index e7d8b6c00d37..000000000000 --- a/mobile/src/mobile-web-shell/mobile-web-shell-router-seam-census.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - callsRouteHandoff, - expoRouterValueImports, - parse, - productFiles -} from '../navigation/router-seam-census.test-support' - -const SHELL_ROOT = import.meta.dirname - -/** - * The tree that is both halves of the handoff, which is why it needs its own census. - * - * Every other domain here is page code: a screen the shell may serve, where expo-router's own - * router posts no `navigate` and a target outside the page paints Unmatched over it. This tree is - * different — it holds the app end of the seam as well, so the rule cannot be "no router" and has - * to name which modules are the app end. - * - * It is also the tree where the gap showed: `PageRouteUnavailableScreen` shipped with a bare - * `useRouter` and nothing caught it, because the three landed censuses walk `src/session`, - * `src/files` and `src/source-control` and this tree had none. - */ - -/** - * The two modules that ARE the app end of the handoff, and so hold expo-router's own router. - * - * `MobileWebShellScreen` is what hosts the page; its `router.push` is the `onNavigate` the page's - * `navigate` notify arrives at, so routing it through the seam would hand the page's target back to - * the page. `useShellStackPop` is the same for `onNavigateBack`: it pops the native stack the shell - * was pushed onto. Neither has a `.web.*` sibling and neither can run inside the page — the page has - * no shell within it — so neither is a screen the seam exists for. - */ -const SHELL_SIDE_ROUTER_HOLDERS = ['MobileWebShellScreen.tsx', 'use-shell-stack-pop.ts'] - -/** - * The screens here that render on the page and therefore must reach the router through the seam. - * - * One today. `PageRouteUnavailableScreen` is rendered by the catch-all on the device and by its - * `.web.tsx` sibling inside the page, so a bare replace there navigates within the WebView to a - * route the page does not carry instead of leaving it. - */ -const ROUTER_HOLDERS = ['PageRouteUnavailableScreen.tsx'] - -/** - * The expo-router names this tree may import outside those two, and why none is a router. - * - * `useLocalSearchParams` reads the params of the route already mounted and `usePathname` reads - * which route that is. Neither takes a target, so neither can put a screen in front of the page. - * - * A closed list rather than a ban on `useRouter`, for the reason the session census gives: - * expo-router also exports a module-singleton `router` that navigates from a plain function, and a - * rule written against the one spelling would read that as clean. - */ -const NON_NAVIGATING_ROUTER_NAMES = ['useLocalSearchParams', 'usePathname'] - -describe('the mobile-web-shell tree reaches the router through the handoff seam', () => { - const files = productFiles(SHELL_ROOT) - - it('walks the modules it is written against, so the empty list below means something', () => { - expect(files).toEqual(expect.arrayContaining(SHELL_SIDE_ROUTER_HOLDERS)) - expect(files).toEqual(expect.arrayContaining(ROUTER_HOLDERS)) - // The whole tree, not the five files that touch a router: a walk that collapsed to those would - // report an empty finding list for a domain it never read. - expect(files.length).toBeGreaterThan(60) - }) - - it('imports nothing from expo-router that can navigate, outside the two that are the seam', () => { - const offenders = files - .filter((name) => !SHELL_SIDE_ROUTER_HOLDERS.includes(name)) - .map((name) => ({ - name, - imported: expoRouterValueImports(parse(SHELL_ROOT, name)).filter( - (imported) => !NON_NAVIGATING_ROUTER_NAMES.includes(imported) - ) - })) - .filter((entry) => entry.imported.length > 0) - .map((entry) => `${entry.name} (${entry.imported.join(', ')})`) - expect(offenders).toEqual([]) - }) - - it('takes the router from useRouteHandoff at every screen the page renders', () => { - expect(files.filter((name) => callsRouteHandoff(parse(SHELL_ROOT, name))).sort()).toEqual( - [...ROUTER_HOLDERS].sort() - ) - }) - - it('still holds a real router at the app end, which is what the exemption is for', () => { - // The completeness half: the rule above also passes over a tree whose two seam modules stopped - // navigating at all, which is what it would read as if someone moved them and left this list. - for (const name of SHELL_SIDE_ROUTER_HOLDERS) { - expect(expoRouterValueImports(parse(SHELL_ROOT, name)), name).toContain('useRouter') - } - }) -}) diff --git a/mobile/src/mobile-web-shell/mobile-web-shell-screen-test-harness.tsx b/mobile/src/mobile-web-shell/mobile-web-shell-screen-test-harness.tsx index 2abeff8fd96e..a1b81f1bdc46 100644 --- a/mobile/src/mobile-web-shell/mobile-web-shell-screen-test-harness.tsx +++ b/mobile/src/mobile-web-shell/mobile-web-shell-screen-test-harness.tsx @@ -68,7 +68,7 @@ export const SCREEN_SNAPSHOT = { host: { id: 'host-1', name: 'Host One', endpoint: 'ws://host-1', lastConnected: 3 } } -export const DEFAULT_ROUTE_GRANTS: readonly string[] = [ +const DEFAULT_ROUTE_GRANTS: readonly string[] = [ 'navigate', 'storage', 'externalLink', diff --git a/mobile/src/mobile-web-shell/shell-older-page-paths-census.test.ts b/mobile/src/mobile-web-shell/shell-older-page-paths-census.test.ts deleted file mode 100644 index a1d40ccf49a1..000000000000 --- a/mobile/src/mobile-web-shell/shell-older-page-paths-census.test.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * The shell serves no page older than its floor (`MOBILE_WEB_PAGE_VERSION_FLOOR`), so it keeps no - * path for one: no negotiated `accepts`/`reports`, and no WebView resized for the keyboard. The - * retired names are listed so a reintroduction goes red. - */ -import { readFileSync } from 'node:fs' -import { join, relative } from 'node:path' -import { describe, expect, it } from 'vitest' -import { censusSourceFiles } from '../test-support/census-source-files' - -const MOBILE_DIR = join(import.meta.dirname, '..', '..') -const SHELL_DIR = import.meta.dirname -const RETIRED = new RegExp( - [ - 'softwareKeyboardWindowInset', - 'viewShortenedBy', - 'pageReadsKeyboardInset', - 'shellPageReadsKeyboardInset', - 'shellKeyboardGeometry', - 'BRIDGE_KEYBOARD_INSET_ACCEPT', - 'BRIDGE_ROUTE_UPDATE_ACCEPT', - 'BRIDGE_SAFE_AREA_ACCEPT', - 'BRIDGE_PAGE_CLIENT_IDENTITY_ACCEPT', - 'BRIDGE_SHELL_ACCEPTS', - 'BRIDGE_MAX_PAGE_ACCEPTS', - 'pageReportsPaint', - 'pageOwnsSafeArea', - 'shellPageOwnsSafeArea', - 'shellAccepts', - 'PageReadyDeclaration', - "'keyboard-inset'", - "'route-update'", - "'safe-area-insets'", - "'page-client-identity'" - ].join('|') -) -/** The negotiated fields themselves, in code: a `ready` or `init` declaring what it takes or reports. */ -const NEGOTIATED_FIELD = /\.(accepts|reports)\b|\b(accepts|reports)\??:/ -const COMMENT = /^\s*(\/\/|\*|\/\*)/ -const KEYBOARD_SIZES_VIEW = /\b(padding|margin)?(Bottom|bottom|height|Height)\s*:[^,}\n]*keyboard/i - -/** Lines that bring back a path for an older page, or size the view from the keyboard. */ -export function olderPagePaths(source: string, inShell: boolean): number[] { - return source - .split('\n') - .flatMap((line, index) => - RETIRED.test(line) || - (inShell && - ((NEGOTIATED_FIELD.test(line) && !COMMENT.test(line)) || KEYBOARD_SIZES_VIEW.test(line))) - ? [index + 1] - : [] - ) -} - -function sources(dir: string): string[] { - return censusSourceFiles(dir).filter( - (file) => /\.tsx?$/.test(file) && !/\.test\.tsx?$/.test(file) - ) -} - -describe('the shell and a page older than its floor', () => { - it('finds the lines it is looking for', () => { - expect(olderPagePaths('style={{ paddingBottom: keyboardInset }}', true)).toEqual([1]) - expect(olderPagePaths("accepts.includes('keyboard-inset')", false)).toEqual([1]) - expect(olderPagePaths('if (accepts.includes(BRIDGE_SAFE_AREA_ACCEPT)) {', false)).toEqual([1]) - expect(olderPagePaths(' accepts: z.array(z.string()).optional(),', true)).toEqual([1]) - expect(olderPagePaths('return message.reports ?? []', true)).toEqual([1]) - expect(olderPagePaths('session.pageOwnsSafeArea', false)).toEqual([1]) - expect( - olderPagePaths('{ paddingTop: insets.top, paddingBottom: insets.bottom }', true) - ).toEqual([]) - expect(olderPagePaths('publishKeyboardInset(keyboardInset)', true)).toEqual([]) - // The field rule is the shell's code: elsewhere, and in prose, `accepts` is an ordinary word. - expect(olderPagePaths('gate.accepts(byteCount)', false)).toEqual([]) - expect(olderPagePaths(' // the answer is what the caller reports: a page', true)).toEqual([]) - }) - - it('keeps no path for one anywhere in the app or the page entry', () => { - const offenders = [ - ...sources(join(MOBILE_DIR, 'src')), - ...sources(join(MOBILE_DIR, 'web-entry')) - ].flatMap((file) => - olderPagePaths(readFileSync(file, 'utf8'), file.startsWith(SHELL_DIR)).map( - (line) => `${relative(MOBILE_DIR, file)}:${line}` - ) - ) - expect(offenders).toEqual([]) - }) -}) diff --git a/mobile/src/mobile-web-shell/shell-screen-route-census.test.ts b/mobile/src/mobile-web-shell/shell-screen-route-census.test.ts deleted file mode 100644 index 1626e3769663..000000000000 --- a/mobile/src/mobile-web-shell/shell-screen-route-census.test.ts +++ /dev/null @@ -1,278 +0,0 @@ -import { existsSync, readdirSync, readFileSync } from 'node:fs' -import { dirname, join, resolve } from 'node:path' -import ts from 'typescript-api' -import { describe, expect, it } from 'vitest' - -const HOST_ROUTES = join(import.meta.dirname, '..', '..', 'app', 'h', '[hostId]') -const PAGE_ROUTE_REGISTRY = join( - import.meta.dirname, - '..', - '..', - '..', - 'config', - 'scripts', - 'mobile-web-page-routes.mjs' -) - -/** - * Every switch that hands a route to the shell asks whether the route is one the page can be - * given, and asks it in one place. - * - * A route the schema refuses is dropped to `null` by `bridge-host.ts` and reaches the phone as an - * `init` naming no screen, which the page answers with "Update Orca to open this workspace" — a - * failure screen in place of the native screen sitting right behind the switch. Three routes had - * each grown their own copy of the call and two had none at all, which is the state this census - * ends: the predicate is `shellScreenRoute`, and a switch that spells it itself has a second - * spelling of a rule that can only drift from the one the page reads. - * - * The walk is over the route tree rather than a list, so a route added later is held to this - * without anyone remembering to add it here. - */ -function hostRouteFiles(directory: string = HOST_ROUTES, prefix = ''): string[] { - return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => { - const name = prefix === '' ? entry.name : `${prefix}/${entry.name}` - if (entry.isDirectory()) { - return hostRouteFiles(join(directory, entry.name), name) - } - return entry.name.endsWith('.tsx') && !entry.name.includes('.test.') ? [name] : [] - }) -} - -/** - * A route file's body: the file itself, or the module its default export comes from. - * - * `[...page].tsx` is the reason: expo-router 55 reads a file's platform from the first dot of its - * stripped name, so a catch-all cannot carry a `.web.tsx` sibling under `app/` without registering - * a second route, and its body lives under `src/` where the stem is plain. Following the export - * keeps the walk derived from the tree rather than from a list beside it. - * - * Fails closed, which is the half that matters. A shape this cannot resolve is a file whose body - * it never read, and an unread body is exactly where a switch that skips `shellScreenRoute` would - * sit — so an unknown shape is named by the census rather than quietly treated as a non-switch. - */ -type RouteBody = - | { readonly kind: 'source'; readonly text: string } - | { readonly kind: 'unresolved'; readonly why: string } - -/** The module specifier a file's default export comes from, or null when the body is local. */ -function defaultExportSource(parsed: ts.SourceFile): string | null | undefined { - const importedFrom = new Map() - for (const statement of parsed.statements) { - if (ts.isImportDeclaration(statement) && ts.isStringLiteral(statement.moduleSpecifier)) { - const clause = statement.importClause - if (clause?.name !== undefined) { - importedFrom.set(clause.name.text, statement.moduleSpecifier.text) - } - const bindings = clause?.namedBindings - if (bindings !== undefined && ts.isNamedImports(bindings)) { - for (const element of bindings.elements) { - importedFrom.set(element.name.text, statement.moduleSpecifier.text) - } - } - } - } - for (const statement of parsed.statements) { - // `export { default } from 'x'`, and `export { Body as default } from 'x'`. - if ( - ts.isExportDeclaration(statement) && - statement.moduleSpecifier !== undefined && - ts.isStringLiteral(statement.moduleSpecifier) && - statement.exportClause !== undefined && - ts.isNamedExports(statement.exportClause) && - statement.exportClause.elements.some((element) => element.name.text === 'default') - ) { - return statement.moduleSpecifier.text - } - if (ts.isExportAssignment(statement) && statement.isExportEquals !== true) { - // `export default Body` where `Body` came from an import: the body is over there. Any other - // expression — a function, a class, a local — is this file's own. - return ts.isIdentifier(statement.expression) - ? (importedFrom.get(statement.expression.text) ?? null) - : null - } - // `export default function …` / `export default class …`: the body is here. - if ( - (ts.isFunctionDeclaration(statement) || ts.isClassDeclaration(statement)) && - statement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword) === - true - ) { - return null - } - } - return undefined -} - -function bodyOf(name: string): RouteBody { - const routeFile = join(HOST_ROUTES, name) - const source = readFileSync(routeFile, 'utf8') - const specifier = defaultExportSource(parse(source)) - if (specifier === undefined) { - return { kind: 'unresolved', why: 'no default export this census recognises' } - } - if (specifier === null) { - return { kind: 'source', text: source } - } - if (!specifier.startsWith('.')) { - return { kind: 'unresolved', why: `default export comes from the package "${specifier}"` } - } - const base = resolve(dirname(routeFile), specifier) - for (const extension of ['.tsx', '.ts']) { - if (existsSync(`${base}${extension}`)) { - return { kind: 'source', text: readFileSync(`${base}${extension}`, 'utf8') } - } - } - return { kind: 'unresolved', why: `no module at "${specifier}"` } -} - -/** The body text, for the rules below; an unresolved shape is caught by its own case first. */ -function read(name: string): string { - const body = bodyOf(name) - return body.kind === 'source' ? body.text : '' -} - -/** - * The one switch that hands over a route the rule refuses, on purpose. - * - * `web.tsx` is `__DEV__`-only and its fallback is `Redirect href="/h/"`, not a native - * screen. Adopting the guard there sends a `..` deep link through that redirect to the host route, - * which this PR keeps native, so the developer lands on the host list with nothing said about why - * the page did not open. Handed over instead, the same id reaches the bridge and comes back as the - * host's own failure screen, which is the better verdict for a route whose whole purpose is to - * open the page deliberately; `mobile-web-shell-route.test.tsx` pins that by name. - * - * Exempted here rather than silently unwalked, so the exception is read when it changes. - */ -const HANDS_OVER_UNJUDGED = ['web.tsx'] - -const parse = (source: string): ts.SourceFile => - ts.createSourceFile('route.tsx', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX) - -function importsNames(parsed: ts.SourceFile, module: string): string[] { - return parsed.statements.flatMap((statement) => { - if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier)) { - return [] - } - if (!statement.moduleSpecifier.text.endsWith(module)) { - return [] - } - const bindings = statement.importClause?.namedBindings - return bindings !== undefined && ts.isNamedImports(bindings) - ? bindings.elements.map((element) => element.name.text) - : [] - }) -} - -/** - * A switch is a route file that imports the shell screen. - * - * The import rather than ` { - if ( - ts.isCallExpression(node) && - ts.isIdentifier(node.expression) && - node.expression.text === name - ) { - called = true - } - ts.forEachChild(node, visit) - } - ts.forEachChild(parsed, visit) - return called -} - -describe('the switches that hand a route to the shell', () => { - const switches = hostRouteFiles().filter((name) => mountsShell(parse(read(name)))) - - it('walks the directory every registered route lives under', () => { - // The root above is written out rather than derived, so this is what ties it to the manifest: - // a page route outside `/h/[hostId]` would be a switch this census never reads. - const pathnames = [ - ...readFileSync(PAGE_ROUTE_REGISTRY, 'utf8').matchAll(/pathname: '([^']+)'/g) - ].map((match) => match[1]) - expect(pathnames.length).toBeGreaterThan(0) - expect(pathnames.filter((pathname) => !pathname.startsWith('/h/[hostId]'))).toEqual([]) - }) - - /** - * Every route file's body was read, so `switches` is a census and not a sample. - * - * A shape this cannot resolve is a body it never opened, and every rule below would read that - * file as "not a switch" — the one answer a census must never give by default. - */ - it('resolves every route file to a body, naming any shape it cannot', () => { - expect( - hostRouteFiles() - .map((name) => ({ name, body: bodyOf(name) })) - .filter((entry) => entry.body.kind === 'unresolved') - .map((entry) => `${entry.name}: ${entry.body.kind === 'unresolved' ? entry.body.why : ''}`) - ).toEqual([]) - }) - - it('walks the route tree and finds them, so the rules below cannot pass vacuously', () => { - expect(switches.sort()).toEqual([ - '[...page].tsx', - 'agent-history/[worktreeId].tsx', - 'files/[worktreeId].tsx', - 'files/preview/[worktreeId].tsx', - 'index.tsx', - 'review/[worktreeId].tsx', - 'session/[worktreeId].tsx', - 'source-control/[worktreeId].tsx', - 'tasks.tsx', - 'web.tsx' - ]) - }) - - it('asks shellScreenRoute whether the route is one the page can be given', () => { - // Imports it *and* calls it: an import the call no longer reaches is a switch that stopped - // asking while still looking like one. - expect( - switches - .filter((name) => !HANDS_OVER_UNJUDGED.includes(name)) - .filter((name) => { - const parsed = parse(read(name)) - return ( - !importsNames(parsed, 'shell-screen-route').includes('shellScreenRoute') || - !callsName(parsed, 'shellScreenRoute') - ) - }) - ).toEqual([]) - }) - - it('reads the call rather than the import, on a fixture that has only the import', () => { - // The rule the case above cannot show against the tree, every switch there calling what it - // imports: an import with no call is named. - const importOnly = parse( - "import { shellScreenRoute } from '../../../src/mobile-web-shell/shell-screen-route'\n" + - "import { MobileWebShellScreen } from '../../../src/mobile-web-shell/MobileWebShellScreen'\n" + - 'export default function Route() {\n return \n}\n' - ) - expect(mountsShell(importOnly)).toBe(true) - expect(importsNames(importOnly, 'shell-screen-route')).toContain('shellScreenRoute') - expect(callsName(importOnly, 'shellScreenRoute')).toBe(false) - }) - - it('spells the rule nowhere else, so the page and the app cannot disagree about it', () => { - // The copies this census ends. `shellScreenRoute` is the one caller of the schema outside the - // bridge, and a switch that reaches for it again is writing the second spelling back. - expect(switches.filter((name) => read(name).includes('BridgeInitRouteSchema'))).toEqual([]) - // And the exemption names a switch that exists, so it cannot outlive the file it excuses. - expect(switches).toEqual(expect.arrayContaining(HANDS_OVER_UNJUDGED)) - }) -}) diff --git a/mobile/src/mobile-web-shell/shell-view-surface.test.ts b/mobile/src/mobile-web-shell/shell-view-surface.test.ts deleted file mode 100644 index 7d8817147ca0..000000000000 --- a/mobile/src/mobile-web-shell/shell-view-surface.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { colors } from '../theme/mobile-theme' - -/** - * What the WebView paints before its document does, read off both shells. - * - * Neither can be proven from a JVM or a Swift unit test: it is a property of a live view. What is - * checkable is that neither shell gives the view a surface of its own, which is what makes the - * frame behind it — the screen's own, in the app's own colours — the thing on screen. - * - * The two defaults differ and both are wrong. Android's WebView paints nothing under a transparent - * background, which is fine; a WKWebView is opaque by default and paints white, so a dark app - * opening a page flashed white for the whole of the page's boot. - */ -const SHELL = join(import.meta.dirname, '..', '..', 'modules', 'orca-mobile-web-shell') - -function source(relative: string): string { - return readFileSync(join(SHELL, relative), 'utf8') -} - -describe('what a mounted view paints before the page does', () => { - it('gives the Android view no surface of its own', () => { - const kotlin = source( - 'android/src/main/java/expo/modules/orcamobilewebshell/MobileWebShellView.kt' - ) - expect(kotlin).toContain('view.setBackgroundColor(Color.TRANSPARENT)') - }) - - it('gives the iOS view none either, which is not its default', () => { - const swift = source('ios/MobileWebShellView.swift') - expect(swift).toContain('webView.isOpaque = false') - expect(swift).toContain('webView.backgroundColor = .clear') - expect(swift).toContain('webView.scrollView.backgroundColor = .clear') - }) - - it('leaves the app surface as the one colour behind a page, and it is not black', () => { - // What shows through both: the screen's own root, which is where the token is read. - const screen = readFileSync(join(import.meta.dirname, 'MobileWebShellScreen.tsx'), 'utf8') - expect(screen).toContain('backgroundColor: colors.bgBase') - expect(colors.bgBase).not.toBe('#000000') - }) -}) diff --git a/mobile/src/notifications/desktop-notification-channel.test.ts b/mobile/src/notifications/desktop-notification-channel.test.ts index 95ff41ebe351..283f3f668d4e 100644 --- a/mobile/src/notifications/desktop-notification-channel.test.ts +++ b/mobile/src/notifications/desktop-notification-channel.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { beforeEach, describe, expect, it, vi } from 'vitest' import * as Notifications from 'expo-notifications' import { Platform } from 'react-native' @@ -48,15 +47,3 @@ describe('ensureDesktopNotificationChannel', () => { await expect(ensureDesktopNotificationChannel()).rejects.toThrow('no channels') }) }) - -describe('app boot', () => { - it('creates the channel at startup, not only once a socket subscribes', () => { - // A background push can be the first thing to target 'orca-desktop', and Android - // drops a notification whose channel does not exist. Asserted against the source - // because vitest only collects src/, so app/_layout.tsx has no runtime coverage. - const layout = readFileSync(new URL('../../app/_layout.tsx', import.meta.url), 'utf8') - - expect(layout).toContain("from '../src/notifications/desktop-notification-channel'") - expect(layout).toMatch(/^void ensureDesktopNotificationChannel\(\)\.catch\(/m) - }) -}) diff --git a/mobile/src/notifications/notification-route-coordination.test.ts b/mobile/src/notifications/notification-route-coordination.test.ts index 6f1b8a4aeeca..a55d3809f5ff 100644 --- a/mobile/src/notifications/notification-route-coordination.test.ts +++ b/mobile/src/notifications/notification-route-coordination.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { describe, expect, it, vi } from 'vitest' import { getNotificationNavigationTarget } from './notification-routing' import { @@ -7,8 +6,6 @@ import { type HostStackNavigationState } from '../navigation/host-stack-navigation' -const rootLayoutSource = readFileSync(new URL('../../app/_layout.tsx', import.meta.url), 'utf8') - function navigationHarness(initialState: HostStackNavigationState | undefined) { const stateListeners = new Set<() => void>() let state = initialState @@ -100,20 +97,6 @@ describe('notification route coordination', () => { it('leaves a host-only notification as a shallow push with nothing to coordinate', () => { expect(getNotificationNavigationTarget({ hostId: 'host-1' })?.sessionTarget).toBeNull() }) - - it('routes notification taps through the coordinated transition, not a bare push', () => { - const start = rootLayoutSource.indexOf('// ─── Notification tap routing ───') - const end = rootLayoutSource.indexOf('// ─── End notification tap routing ───', start) - - // Assert the markers first: a renamed banner would otherwise slice garbage and report a - // missing call instead of the real cause. - expect(start).toBeGreaterThanOrEqual(0) - expect(end).toBeGreaterThan(start) - - const notificationEffect = rootLayoutSource.slice(start, end) - expect(notificationEffect).toContain('openNotificationRoute(target)') - expect(notificationEffect).not.toContain('router.push(') - }) }) it('reuses the current workspace screen and targets the notification pane without pushing', () => { diff --git a/mobile/src/platform/keyboard-geometry-host-os-census.test.ts b/mobile/src/platform/keyboard-geometry-host-os-census.test.ts deleted file mode 100644 index 81b7259395dc..000000000000 --- a/mobile/src/platform/keyboard-geometry-host-os-census.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Keyboard and inset arithmetic branches on the host OS, never on `Platform.OS`. - * - * The page runs as `web` while the keyboard it lifts over is the phone's, reported in that OS's own - * terms (iOS counts the home indicator). A `Platform.OS === 'ios'` there takes the Android branch on - * an iPhone page: measured on the iPhone 17 simulator, the terminal lifted 34 pt past native. - */ -import { readFileSync } from 'node:fs' -import { relative } from 'node:path' -import { fileURLToPath } from 'node:url' -import { describe, expect, it } from 'vitest' -import { censusSourceFiles } from '../test-support/census-source-files' - -const MOBILE_DIR = fileURLToPath(new URL('../../', import.meta.url)) -const GEOMETRY = - /keyboardHeight|keyboardLift|keyboardInset|bottomInset|insets\.bottom|KeyboardAvoidingView|keyboard(Will|Did)(Show|Hide)/ - -const KEYBOARD_READ = - /keyboardHeight|keyboardLift|keyboardInset|useKeyboardOcclusion|useSoftKeyboard/ -const KEYBOARD_IMPORT = /from '[^']*(keyboard|inset)[^']*'/i -const KEYBOARD_FILE = /(keyboard|inset|drawer|lift)[^/]*$/i -const COMMENT = /^\s*(\/\/|\*|\/\*)/ - -/** - * `Platform.OS` reads near keyboard or inset arithmetic, or anywhere in a file that reads the keyboard, - * imports a keyboard/inset module or is named for one: a live-input reopen flag four lines from its - * keyboard height escaped the proximity rule alone. Comments are not reads. - */ -export function platformReadsInGeometry(source: string, file = ''): number[] { - const lines = source.split('\n') - const wholeFile = - KEYBOARD_READ.test(source) || KEYBOARD_IMPORT.test(source) || KEYBOARD_FILE.test(file) - return lines.flatMap((line, index) => - line.includes('Platform.OS') && - !COMMENT.test(line) && - (wholeFile || - lines.slice(Math.max(0, index - 2), index + 3).some((near) => GEOMETRY.test(near))) - ? [index + 1] - : [] - ) -} - -function files(): string[] { - return ['src', 'app'].flatMap((dir) => - censusSourceFiles(fileURLToPath(new URL(`../../${dir}/`, import.meta.url))).filter( - (file) => /\.tsx?$/.test(file) && !/\.test\.tsx?$/.test(file) && !file.endsWith('host-os.ts') - ) - ) -} - -describe('keyboard and inset arithmetic', () => { - it('finds the reads it is looking for', () => { - expect( - platformReadsInGeometry("const lift = Platform.OS === 'ios' ? keyboardHeight - 1 : 0") - ).toEqual([1]) - expect( - platformReadsInGeometry("keyboardType={Platform.OS === 'ios' ? 'url' : 'default'}") - ).toEqual([]) - }) - - it('reads the host OS, never Platform.OS', () => { - const offenders = files().flatMap((file) => - platformReadsInGeometry(readFileSync(file, 'utf8'), file).map( - (line) => `${relative(MOBILE_DIR, file)}:${line}` - ) - ) - expect(offenders).toEqual([]) - }) -}) diff --git a/mobile/src/platform/keyboard-geometry-owner-census.test.ts b/mobile/src/platform/keyboard-geometry-owner-census.test.ts deleted file mode 100644 index b3bee07b5f49..000000000000 --- a/mobile/src/platform/keyboard-geometry-owner-census.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Who may ask React Native's `Keyboard` for geometry: the keyboard seam, and one named exception. - * - * react-native-web's `Keyboard` has no `metrics` and an `addListener` that never fires, so a page - * screen that asks it directly either throws (a fill sheet crashed the page on `metrics()`) or waits - * forever. The seam has a web sibling that answers from the window instead; everything else reads it. - */ -import { readFileSync } from 'node:fs' -import { relative } from 'node:path' -import { fileURLToPath } from 'node:url' -import { describe, expect, it } from 'vitest' -import { censusSourceFiles } from '../test-support/census-source-files' - -const MOBILE_DIR = fileURLToPath(new URL('../../', import.meta.url)) -const SRC_DIR = fileURLToPath(new URL('../', import.meta.url)) - -const SEAM = 'src/platform/keyboard-occlusion.ts' -/** A one-shot "open after the keyboard hides" with a timer fallback; on the page, where the event - * never fires, the timer is what opens the sheet, so it cannot wait forever. */ -const TAB_SHEET_AFTER_HIDE = 'src/session/use-mobile-session-terminal-send-actions.ts' - -const asksKeyboard = (line: string): boolean => - line.includes('Keyboard.metrics(') || line.includes('Keyboard.addListener(') - -function callers(): string[] { - return censusSourceFiles(SRC_DIR) - .filter((file) => /\.tsx?$/.test(file) && !/\.test\.tsx?$/.test(file)) - .filter((file) => readFileSync(file, 'utf8').split('\n').some(asksKeyboard)) - .map((file) => relative(MOBILE_DIR, file)) - .sort() -} - -describe("React Native's Keyboard geometry", () => { - it('is read only by the keyboard seam and the tab sheet that waits for a hide', () => { - // Also the presence precondition: the seam itself must match, or the matcher is broken. - expect(callers()).toEqual([SEAM, TAB_SHEET_AFTER_HIDE].sort()) - }) -}) diff --git a/mobile/src/platform/microphone-screen-lock-census.test.ts b/mobile/src/platform/microphone-screen-lock-census.test.ts deleted file mode 100644 index 992918930e43..000000000000 --- a/mobile/src/platform/microphone-screen-lock-census.test.ts +++ /dev/null @@ -1,104 +0,0 @@ -/** - * Who may name the screen: one module, and nothing on the page. - * - * The screen a dictation holds awake is a property of the microphone, so the device module that - * opens the mic takes it and gives it back. Everything above that — the composer's five states, the - * pending-audio budget, where a transcript is routed — has no business naming it, and the page has - * no way to: the verb it used to ask through is gone, along with the tag pools, the timeouts and - * the foreground re-acquire that existed to keep the page's idea of the screen and the device's - * agreeing. - * - * A census rather than a rule in a reviewer's head, because the seam grew back twice from exactly - * the shape this forbids: a page that can ask for a wake tag acquires the bookkeeping to track what - * it asked for. Existence, not shape — any import of the package, and any mention of the verb's - * name at all, from any file but the one owner. - */ -import { readFileSync, readdirSync } from 'node:fs' -import { relative, join } from 'node:path' -import { fileURLToPath } from 'node:url' -import { describe, expect, it } from 'vitest' - -const MOBILE_DIR = fileURLToPath(new URL('../../', import.meta.url)) - -/** The one module that may hold the screen: the device calls the microphone's capture makes. */ -const SCREEN_LOCK_OWNER = 'src/platform/native-audio-device.ts' - -/** This file names both things it forbids, so it reads every file but itself. */ -const CENSUS = 'src/platform/microphone-screen-lock-census.test.ts' - -const KEEP_AWAKE_PACKAGE = 'expo-keep-awake' - -/** Built rather than written, so the census does not contain the word it bans. */ -const RETIRED_VERB_WORD = `wake${'lock'}` - -function sourceFiles(): string[] { - const found: string[] = [] - const walk = (dir: string): void => { - for (const entry of readdirSync(dir, { withFileTypes: true })) { - const full = join(dir, entry.name) - if (entry.isDirectory()) { - walk(full) - continue - } - if (entry.name.endsWith('.ts') || entry.name.endsWith('.tsx')) { - found.push(relative(MOBILE_DIR, full)) - } - } - } - for (const root of ['src', 'app']) { - walk(join(MOBILE_DIR, root)) - } - return found.sort() -} - -/** The line, not just the file: a census that answers "somewhere in 1,400 files" is one a reader - * has to re-run by hand before they can act on it. */ -function hits(match: (line: string) => boolean, skip: readonly string[]): string[] { - const found: string[] = [] - for (const file of sourceFiles()) { - if (skip.includes(file)) { - continue - } - const lines = readFileSync(join(MOBILE_DIR, file), 'utf8').split('\n') - for (const [index, line] of lines.entries()) { - if (match(line)) { - found.push(`${file}:${index + 1}: ${line.trim()}`) - } - } - } - return found -} - -/** An import of the package, which is a module that can hold the screen. A test's `vi.mock` of it - * is not one: the mock exists because the graph reaches the owner, which is the rule holding. */ -const importsKeepAwake = (line: string): boolean => - line.includes(`from '${KEEP_AWAKE_PACKAGE}'`) || line.includes(`require('${KEEP_AWAKE_PACKAGE}')`) - -const namesRetiredVerb = (line: string): boolean => - line.toLowerCase().includes(RETIRED_VERB_WORD.toLowerCase()) - -describe('the one module that may hold the screen awake', () => { - it('is the only one that imports the keep-awake package', () => { - expect(hits(importsKeepAwake, [SCREEN_LOCK_OWNER, CENSUS])).toEqual([]) - }) - - it('does import it, so the absence above is the rule holding and not the match missing', () => { - // The presence precondition every absence needs: the matcher finds the one file that should - // match, so a typo in the package name fails here rather than passing everywhere. - expect(hits(importsKeepAwake, [CENSUS]).map((hit) => hit.split(':')[0])).toEqual([ - SCREEN_LOCK_OWNER - ]) - }) - - it('leaves no page-facing name for the screen anywhere in the app', () => { - // The retired verb, in any casing: a grant row, a schema, a server, a tag, a mock or a comment - // pointing at a seam that no longer exists. - expect(hits(namesRetiredVerb, [CENSUS])).toEqual([]) - }) - - it('reads a tree big enough for those absences to mean something', () => { - // A walk that found nothing would pass all three rules above by having nothing to judge. - expect(sourceFiles().length).toBeGreaterThan(900) - expect(sourceFiles()).toContain(SCREEN_LOCK_OWNER) - }) -}) diff --git a/mobile/src/session/agent-send-keyboard-dismissal-wiring.test.ts b/mobile/src/session/agent-send-keyboard-dismissal-wiring.test.ts deleted file mode 100644 index 03b5398939d2..000000000000 --- a/mobile/src/session/agent-send-keyboard-dismissal-wiring.test.ts +++ /dev/null @@ -1,212 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readMobileSessionRouteSource } from './mobile-session-route-source-family.test-support' - -const runtimeSource = readMobileSessionRouteSource('./use-mobile-session-terminal-runtime.ts') -const nativeChatSource = readMobileSessionRouteSource( - './use-mobile-session-native-chat-dictation.ts' -) -const sendActionsSource = readMobileSessionRouteSource( - './use-mobile-session-terminal-send-actions.ts' -) -const commandDockSource = readMobileSessionRouteSource('./MobileSessionCommandDock.tsx') -const tabApplicationSource = readMobileSessionRouteSource('./use-mobile-session-tab-application.ts') -const terminalListSource = readMobileSessionRouteSource('./use-mobile-session-terminal-list.ts') -const startupSource = readMobileSessionRouteSource('./use-mobile-session-startup.ts') -const bufferedDraftHookSource = readMobileSessionRouteSource( - '../terminal/use-buffered-terminal-drafts.ts' -) -const keyboardDismissalHookSource = readMobileSessionRouteSource( - './use-agent-send-keyboard-dismissal.ts' -) - -function sourceSlice(source: string, anchorStart: string, anchorEnd: string): string { - const start = source.indexOf(anchorStart) - expect(start).toBeGreaterThanOrEqual(0) - // Why: a duplicated start anchor would silently slice the wrong region. - expect(source.indexOf(anchorStart, start + 1)).toBe(-1) - const end = source.indexOf(anchorEnd, start) - expect(end).toBeGreaterThan(start) - return source.slice(start, end + anchorEnd.length) -} - -describe('terminal send keyboard dismissal wiring', () => { - it('gates the dismissal on the agent-session predicate', () => { - const slice = sourceSlice( - sendActionsSource, - 'const dismissKeyboardAfterAgentSend = useAgentSendKeyboardDismissal(', - 'getSendCompletionGeneration\n )' - ) - expect(slice).toContain('dismissSoftwareKeyboard') - expect(keyboardDismissalHookSource).toContain( - 'shouldDismissKeyboardAfterTerminalSend(origin.tab, accepted)' - ) - expect(keyboardDismissalHookSource).toContain( - 'origin.generation === getSendCompletionGeneration()' - ) - expect(keyboardDismissalHookSource).toContain('dismissSoftwareKeyboard()') - expect(keyboardDismissalHookSource).toContain('return useCallback(') - expect(sendActionsSource).toContain( - "import { useAgentSendKeyboardDismissal } from './use-agent-send-keyboard-dismissal'" - ) - }) - - it('invalidates pending terminal sends when the focused input surface changes', () => { - const slice = sourceSlice( - nativeChatSource, - 'const getSendCompletionGeneration = useMobileSendCompletionGeneration({', - '})' - ) - expect(nativeChatSource).toContain( - 'const routeKey = nativeChatScopeKey ?? `${hostId}\\0${worktreeId}`' - ) - expect(slice).toContain( - 'surfaceKey: JSON.stringify([routeKey, activeHandle, showNativeChat, liveInputEnabled])' - ) - }) - - it('dismisses after the live input submits, which is the only Enter path', () => { - // terminal-live-input.ts deliberately keeps Enter off the key map, so - // submitLiveInput is the single send seam for the live field. - const slice = sourceSlice( - sendActionsSource, - 'const submitLiveInput = useCallback(() => {', - 'useTerminalTextFieldSubmitBinding(liveInputRef, submitLiveInput)' - ) - expect(slice).toContain('const submit = handleLiveInputSubmit()') - expect(slice).toContain('generation: getSendCompletionGeneration()') - expect(slice).toContain('interaction: getLiveInteractionGeneration()') - expect(slice).toContain('sendOrigin.interaction === getLiveInteractionGeneration()') - expect(slice).toContain('dismissKeyboardAfterAgentSend(') - }) - - it('gives the live field both Enter paths and neither blur', () => { - // The page reaches submitLiveInput through the ref binding, because react-native-web withholds - // onSubmitEditing under an open composition; native reaches it through the editor action. - const slice = sourceSlice( - commandDockSource, - 'ref={bindLiveInputField}', - 'importantForAutofill="no"' - ) - expect(slice).toContain('onSubmitEditing={submitLiveInput}') - // Explicit dismissal replaces RN's blur, which stays off so a shell send - // does not drop focus. - expect(slice).toContain('blurOnSubmit={false}') - }) - - it('dismisses the buffered command send only once the write is accepted', () => { - const slice = sourceSlice( - sendActionsSource, - 'async function handleSend() {', - 'async function handleAccessoryKey(' - ) - const acceptedAt = slice.indexOf( - 'const accepted = terminalInputSend.interpret(response) === true' - ) - const restoreAt = slice.indexOf('restoreRejectedDraft()', acceptedAt) - const dismissAt = slice.indexOf('dismissKeyboardAfterAgentSend(') - const responseAt = slice.indexOf('const response = await terminalInputSend.request(') - const catchAt = slice.indexOf('} catch {') - expect(dismissAt).toBeGreaterThan(0) - expect(responseAt).toBeGreaterThan(0) - expect(acceptedAt).toBeGreaterThan(responseAt) - expect(restoreAt).toBeGreaterThan(acceptedAt) - expect(dismissAt).toBeGreaterThan(responseAt) - expect(slice).toContain( - 'const draftUnchanged =\n accepted && bufferedTerminalDraftState.settleBufferedTerminalDraftSend(bufferedDraftSend)' - ) - expect(slice).toContain('dismissKeyboardAfterAgentSend(sendOrigin, accepted && draftUnchanged)') - expect(catchAt).toBeGreaterThan(0) - // Both resolved rejections and transport failures restore the raw draft. - expect(dismissAt).toBeLessThan(catchAt) - expect(slice.slice(catchAt)).not.toContain('dismissKeyboardAfterAgentSend(') - expect(slice.slice(catchAt)).toContain('restoreRejectedDraft()') - }) - - it('keeps buffered Return focused until accepted-agent dismissal runs', () => { - const slice = sourceSlice( - commandDockSource, - 'ref={bindCommandField}', - 'onSubmitEditing={() => void handleSend()}' - ) - expect(slice).toContain('blurOnSubmit={false}') - }) - - it('restores a rejected buffered draft by origin without generation fencing', () => { - const sendSlice = sourceSlice( - sendActionsSource, - 'async function handleSend() {', - 'async function handleAccessoryKey(' - ) - const originAt = sendSlice.indexOf('handle: activeHandle') - const requestAt = sendSlice.indexOf('await terminalInputSend.request(') - const restoreSlice = sourceSlice( - sendActionsSource, - 'const bufferedDraftSend = bufferedTerminalDraftState.beginBufferedTerminalDraftSend(', - 'bufferedTerminalDraftState.restoreRejectedDraft(bufferedDraftSend)' - ) - expect(originAt).toBeGreaterThan(0) - expect(originAt).toBeLessThan(requestAt) - expect(restoreSlice).toContain('activeHandle,\n draft') - expect(bufferedDraftHookSource).not.toContain('getSendCompletionGeneration()') - expect(bufferedDraftHookSource).toContain( - 'restoreRejectedBufferedTerminalDraft(current, send.token.handle, send.draft)' - ) - expect(sendSlice.match(/restoreRejectedDraft\(\)/g)).toHaveLength(2) - expect(keyboardDismissalHookSource).toContain( - 'origin.generation === getSendCompletionGeneration()' - ) - }) - - it('keeps buffered draft callbacks scoped to terminal surfaces and prunes ended tabs', () => { - expect(bufferedDraftHookSource).toContain('const handle = activeHandleRef.current') - expect(bufferedDraftHookSource).toContain('invalidateBufferedTerminalDraftRestoration(') - expect(bufferedDraftHookSource).toContain( - 'setDrafts((current) => updateBufferedTerminalDraft(current, handle, value))' - ) - expect(bufferedDraftHookSource).toContain('pruneBufferedTerminalDraftRestorations(') - expect(runtimeSource).toContain('useRef(bufferedTerminalDraftState.reconcileTerminalTabs)') - expect(tabApplicationSource).toContain( - 'reconcileBufferedDraftsRef.current(currentSessionTabs, nextTabs, {' - ) - const routeResetSlice = sourceSlice( - startupSource, - '// Why: Expo reuses this screen across worktrees;', - 'clearDelayedActionTimers()\n }' - ) - expect(routeResetSlice).toContain('bufferedTerminalDraftState.resetDrafts()') - expect(routeResetSlice).toContain('bufferedTerminalDraftState.clearPendingRestorations()') - }) - - it('bounds buffered drafts on the terminal.list sweep, against the retained set', () => { - // The drafts record and the pending-restoration map both live as long as the - // session screen does; this one call is the only thing that bounds either. - const slice = sourceSlice( - terminalListSource, - 'const liveHandles = new Set(result.terminals.map((terminal) => terminal.handle))', - 'setTerminalKeyboardMetrics((prev) => pruneTerminalKeyboardMetrics(prev, shouldPrune))' - ) - expect(slice).toContain('const retainedHandles = resolveRetainedTerminalHandles(pruneContext)') - expect(slice).toContain('bufferedTerminalDraftState.pruneDrafts(retainedHandles)') - // Not the raw list: terminal.list omits a chat-covered handle while the desktop - // graph reloads, so sweeping drafts against it erases text the user still holds. - expect(slice).not.toContain('pruneDrafts(liveHandles)') - expect(slice.match(/pruneDrafts\(/g)).toHaveLength(1) - expect(bufferedDraftHookSource).toContain( - 'setDrafts((current) => pruneBufferedTerminalDrafts(current, retainedMappedHandles))' - ) - expect(bufferedDraftHookSource).toContain( - 'pruneBufferedTerminalDraftRestorations(pendingRestorationsRef.current, retainedMappedHandles)' - ) - }) - - it('leaves the accessory shortcut keys alone, Enter included', () => { - // Why: the accessory bar sits on top of the keyboard — dismissing would - // pull away the very row the user is tapping. - const slice = sourceSlice( - sendActionsSource, - 'async function handleAccessoryKey(', - 'const sendLiveTerminalInput = useCallback(' - ) - expect(slice).not.toContain('dismissKeyboardAfterAgentSend') - }) -}) diff --git a/mobile/src/session/mobile-native-chat-noise.test.ts b/mobile/src/session/mobile-native-chat-noise.test.ts index 0369a609135d..dcda3f3dace1 100644 --- a/mobile/src/session/mobile-native-chat-noise.test.ts +++ b/mobile/src/session/mobile-native-chat-noise.test.ts @@ -44,6 +44,7 @@ describe('isNoiseMessage', () => { it('keeps assistant and tool turns', () => { expect(isNoiseMessage(msg('assistant', ' in prose'))).toBe(false) + expect(isNoiseMessage(msg('system', 'Conversation interrupted'))).toBe(false) }) it('keeps a user turn that carries tool results', () => { diff --git a/mobile/src/session/mobile-session-last-tab-close.test.ts b/mobile/src/session/mobile-session-last-tab-close.test.ts deleted file mode 100644 index a15a62b1535f..000000000000 --- a/mobile/src/session/mobile-session-last-tab-close.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readMobileSessionRouteSourceFamily } from './mobile-session-route-source-family.test-support' - -const sessionRouteSource = readMobileSessionRouteSourceFamily() - -describe('mobile session last-tab close', () => { - it('preserves terminal identity while an empty snapshot may be transient', () => { - const start = sessionRouteSource.indexOf('const applySessionTabs = useCallback') - const end = sessionRouteSource.indexOf('const readMarkdownTab', start) - const block = sessionRouteSource.slice(start, end) - - expect(block).toContain('} else if (active) {') - expect(block).toContain('retainMissingSurfaces: result.tabs.length === 0') - }) - - it('clears stale active identity when closing leaves no tabs', () => { - const start = sessionRouteSource.indexOf('async function handleCloseSessionTab') - const end = sessionRouteSource.indexOf('const bulkCloseActions', start) - const block = sessionRouteSource.slice(start, end) - - expect(block).toContain( - 'activeSessionTabIdRef.current === tab.id || remainingTabs.length === 0' - ) - expect(block).toContain('activeSessionTabIdRef.current = null') - expect(block).toContain('activeHandleRef.current = null') - expect(block).toContain( - 'reconcileBufferedDraftsRef.current(sessionTabsRef.current, remainingTabs)' - ) - }) - - it('ignores a pending terminal handle when the host requests follow navigation', () => { - const start = sessionRouteSource.indexOf('const applySessionTabs = useCallback') - const end = sessionRouteSource.indexOf('const readMarkdownTab', start) - const block = sessionRouteSource.slice(start, end) - - const followsHost = block.indexOf("const followsHost = result.navigationIntent === 'follow'") - const pendingHandle = block.indexOf('const pendingActiveTerminalHandle = followsHost') - - expect(followsHost).toBeGreaterThanOrEqual(0) - expect(pendingHandle).toBeGreaterThan(followsHost) - expect(block.slice(pendingHandle, pendingHandle + 150)).toContain('? null') - }) -}) diff --git a/mobile/src/session/mobile-session-route-parity.test.ts b/mobile/src/session/mobile-session-route-parity.test.ts deleted file mode 100644 index 7c0ac36e4532..000000000000 --- a/mobile/src/session/mobile-session-route-parity.test.ts +++ /dev/null @@ -1,669 +0,0 @@ -import { createHash } from 'node:crypto' -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' -import ts from 'typescript-api' -import { describe, expect, it } from 'vitest' -import { MOBILE_SESSION_ROUTE_SOURCE_FILES } from './mobile-session-route-source-family.test-support' - -const SESSION_FILES = MOBILE_SESSION_ROUTE_SOURCE_FILES -/** The function the route mounts, which C7.7 moved out of the route file and into a component. */ -const ROOT_COMPONENT = 'MobileSessionRouteScreen' -const LOGIC_EXPANSION_NAMES = new Set([ - 'useMobileSessionController', - 'useMobileSessionFoundation', - 'useMobileSessionScreenState', - 'useMobileSessionTerminalRuntime', - 'useMobileSessionFeedbackCapabilities', - 'useMobileSessionNativeChatDictation', - 'useMobileSessionTerminalSubscriptionFoundation', - 'useMobileSessionTerminalSubscription', - 'useMobileSessionTerminalStreamDisplay', - 'useMobileSessionTerminalList', - 'useMobileSessionTabApplication', - 'useMobileSessionDocumentReaders', - 'useMobileSessionDiffComments', - 'useMobileSessionMarkdownActions', - 'useMobileSessionTabReconciliation', - 'useMobileSessionLifecycle', - 'useMobileSessionKeyboardState', - 'useMobileSessionStartup', - 'useMobileSessionPreferenceFocus', - 'useMobileSessionTabSwitching', - 'useMobileSessionTerminalWebview', - 'useMobileSessionTerminalSendActions', - 'useMobileSessionFileActions', - 'useMobileSessionTerminalInput', - 'useMobileSessionAccessorySelection', - 'useMobileSessionAttachments', - 'useMobileSessionTerminalCreateActions', - 'useMobileSessionContentCreateActions', - 'useMobileSessionCloseActions', - 'useMobileSessionBulkClose', - 'useMobileSessionPresentation', - 'useMobileSessionPanelRouteActions' -]) -const SURFACE_EXPANSION_NAMES = new Set([ - 'MobileSessionSurface', - 'MobileSessionHeader', - 'MobileSessionContentRow', - 'MobileSessionActiveContent', - 'MobileSessionCommandDock', - 'MobileSessionSheets' -]) -const CONTENT_COMPONENT_NAMES = ['MarkdownReader', 'DiffLineRow', 'FileReader'] as const -const HOST_COMPONENT_NAMES = new Set([ - 'ActivityIndicator', - 'Animated.View', - 'FlatList', - 'Image', - 'Pressable', - 'SafeAreaView', - 'ScrollView', - 'Text', - 'TextInput', - 'View' -]) - -// Refreshed by C7.2: five clipboard hooks joined the expanded route, which is the whole of the +5 — -// a writer in the diff-note, Markdown and selection actions, a reader in the selection actions and -// the attachment probe. The screen's other four clipboard sites (the terminal's paste, the sheets, -// the quick-command row, the diff-review send) sit outside the walk from `MobileSessionRouteScreen` -// and so do not move this pin. The copy-path sheet also gained the failure toast the other two had. -// Refreshed for `reportDictationFailure`, the whole of that +1: the composer's two dictation -// failure handlers were one policy written twice, and only `onError`'s copy knew about the setup -// sheet, so a refused start showed the desktop's own `voice_dictation_disabled` as a toast. -// -// Refreshed again for the page's keyboard: the screen's own `Keyboard.addListener` pair became the -// `useSoftKeyboard` seam, because react-native-web never fires those events and the live input row -// laid itself out under the IME. +2 hooks (the seam, and the one effect split into a visibility one -// and a height one), +1 effect, -2 registrations and -2 removals for the listener pair, and -6 -// strings: the four event names and the two `'ios'` guards that chose between them. Re-recorded -// against the merged tree, since neither side's hash covers the other's change. -// -// Refreshed for the terminal fields' submit seam: react-native-web withholds `onSubmitEditing` -// when the Enter keydown reports an open composition, which is a soft keyboard's normal mid-word -// state, so both of the dock's fields also bind the page's own line-break signal. +4 hooks and +2 -// callbacks in the send actions — `submitLiveInput` and `submitBufferedDraft`, each with a -// `useTerminalTextFieldSubmitBinding` beside it — and both fields moved their ref, the live one -// its submit handler too. -// Moved once more, -1 hook and -1 callback: `submitBufferedDraft` stopped being a `useCallback`. -// Memoizing it on `[]` froze the per-render `handleSend` it reads, whose guard needs a `client` -// and an `activeHandle` the first render does not have, so the page's line-break submit could -// never pass it. Found by pullfrog on #22300. -// Moved, count unchanged, when the Markdown actions' Back `useEffect` became `useBackClaim`, the -// seam that also claims the key on the page while a draft is dirty. -// Refreshed when the first subscribe began sizing itself from the document's reported cell box: -// the first-subscribe mark ref and `measureViewportOnce` are gone (hooks 282 → 280, callbacks 79 → 78). -// Again when xterm became the only cell measurer: `useTerminalCellBoxRefit` is gone, the frame's -// width ref and `handleTerminalFrameLayout` subscribe a known box on layout (hooks 282, callbacks 79), -// and the pane's `onCellBoxChange` goes to the viewport refit. -// Again when one frame ref replaced the height ref, width ref and width state (hooks 280). -// Again when one `notifyTerminalFrame` took the frame's layout (hooks 281, callbacks 80). -const HEAD_MAIN_HOOK_SHA256 = '004b011722b17ac82c96f0b3c8e303d39b2431a216424e9b86a1ee6a4896f23e' -// Moved when the prompt-cancel flag became one structured-session host support object (main). -// Re-recorded against the merged tree. Again when the frame-layout and cell-box-change callbacks -// named the refs they read in their dependency lists (react-doctor). -// Again when the frame's width and height became one `terminalFrameRef`. -// Again when the frame's layout moved into `notifyTerminalFrame`. -const HEAD_HOOK_BINDING_SHA256 = 'c1bcb859202aaf8d612d3023cb4d895719da513879c61b01545a249a0bda662b' -// Moved when `notifyTerminalFrame` joined and `handleTerminalFrameLayout` became `subscribeIntendedActiveTerminal`. -const HEAD_CALLBACK_IDENTITY_SHA256 = - '9c966301b373c11b27359ef1388c593b638c7f6831186d5c5321553504183e07' -// Pins that no callback body in the route changed unnoticed. Body text, not behaviour: the sends -// and repo reads inside them now name their `RpcOperation` instead of the raw `sendRequest` port. -// Refreshed in step 6 for the gesture flush, whose `terminal.send` became `terminalInputSend` and -// whose accepted-check became that operation's own verdict, then again when that check was spelled -// `=== true` to match the other four sites reading the same verdict. Refreshed in step 7 for the -// reply casts the checked readers made unnecessary — the markdown tab doc, the worktree record's -// `diffComments` and the browser tab's page id are typed by their schemas now. Refreshed once more -// on the merge, for the display-mode toggle whose send became `terminalDisplayModeSet`. Refreshed -// for the files domain's step 7, which retired the markdown disk fallback's `{ content, truncated, -// byteLength }` cast: the preview reader checks the content and salvages the flag, so `readMarkdownTab` -// reads `fallback.value` directly. The dictation-mode refresh is main's own body again — it forwards -// whatever mode the reply carried, so an absent one leaves the mic as inert as main left it. -// Refreshed on the merge of C7.2 and C7.3, which moved this pin from both sides: the terminal -// subscribe now carries the snapshot byte budget its transport imposes, nothing on a phone and the -// frame cap inside the shell's page, and the Markdown copy action gained the failure branch that -// answers a refused write. Re-recorded against the merged tree, since neither side's hash covers -// the other's body. The hook and string counts are C7.2's and stand. -// Refreshed once more for the two dictation failure handlers, which now both call -// `reportDictationFailure` instead of each choosing between the setup sheet and a toast. -// Moved when the metrics handler compared every field, the row pitch included (main). -// Again when the subscribe waited for web-ready and `handleTerminalWebReady` lost `documentHasInit`. -// Again when the subscribe's inits began carrying the laid-out terminal frame, and its resize too. -// Again when those grids read the one frame ref. -// Again when the subscribe sized its viewport inline instead of through a helper. -// Again when the document took the hold rule and the subscribe stopped holding its grid. -// Again when an init took one options object. -// Again when the frame's layout became one `notifyTerminalFrame`. -// Again when the init option took the message's name, `initialData`. -// Again when the document readers mapped refusal codes through one function and kept truncation. -const HEAD_CALLBACK_BODY_SHA256 = 'ff818790399c8532ead38d047d072caf715070b21311538932da2dc811312b06' -// Refreshed for the startup effect: both `worktree.activate` sends became `worktreeActivate`, and -// the sleeping-agent check reads that operation's verdict instead of the reply envelope. Refreshed -// again when the reporter took the reply and interpreted it itself, retiring the hand-built -// refusal the timer site passed when it had no reply at all. Refreshed once more for the -// last-visited-worktree effect, whose bare store write became the one writer of that key, so the -// hybrid shell's page mirror sees it as it is written rather than one `init` later. Refreshed for -// the diff-comments effect, which now catches the loader's rejection. Count unchanged. -// Moved again by the keyboard seam above, which is the +1 effect. -// -1 effect for the Markdown actions' Back registration, which is `useBackClaim`'s own now. -// Moved by the capability probe setting that host support object. -const HEAD_EFFECT_SHA256 = '9b045a547ed269acf95db16cc87e33a9035a20c6888fd30e0363e58bb6b7d883' -const HEAD_CONTENT_HOOK_SHA256 = '9c3b612fef3f370d66873aefdbe1d701f20cb64ded31fef5cc45fde6f8189581' -// Same pin for the 12 bodies that sit in nested functions rather than callbacks, moved by the same -// rewrite of those send and read expressions. Count unchanged. Refreshed again in step 6 for -// `handleClearTerminal`, whose send became `terminalBufferClear`, in step 7 for the browser tab -// create, whose `{ browserPageId?: string }` cast its schema now carries, and once more for -// `handleCreateTerminal`, whose send became `sessionTabCreateTerminal` and whose `response.ok` -// branch became that operation's own throw-the-host-message acceptance. Refreshed for negotiated -// optimistic placement, which defers to legacy host snapshots when ownership paths disagree. -const HEAD_NESTED_FUNCTION_SHA256 = - '923b5ea7fe3330cbd98213b72736bf1f653115ddb5492cb8eb8306d8ca4f28e8' -// -1 registration and -1 removal: the Markdown actions' `BackHandler` pair is `useBackClaim`'s. -const HEAD_NATIVE_REGISTRATION_SHA256 = - '87d4599f475575131d4d5daa20f0dac579ca6c829353cbb654206ea6965dadae' -const HEAD_NATIVE_REMOVAL_SHA256 = - '089bebbc1e4f2e68c5dbaf189bb605d8d5bb247ef5ca52b9db08cc2661afc097' -const HEAD_TIMER_CREATION_SHA256 = - '1a31b625e2174c3db77272249843196d2b6b06ab1e654a96d8f7858e3082e66b' -const HEAD_TIMER_CLEANUP_SHA256 = 'c73f1d1c2cc89642f3d727d6f3b6b81860a9d6f34234541a2065ec3d1a8cd116' -// Six method literals fewer than before step 6: `terminal.send` and `terminal.clearBuffer` went -// first, then `worktree.activate` twice, `session.tabs.createTerminal` and -// `terminal.setDisplayMode`. Each is now fixed at its operation's definition instead of being -// spelled at the call site. Two literals more across C7.2, both of them the toast a refused write -// now shows: "Couldn't copy path" when the sheets moved onto the clipboard seam, taking the count -// from 532 to 533, and "Couldn't copy" when the Markdown copy action gained the failure branch the -// other copy paths already had, taking it to 534. -// -// Two more across C7.7, 534 -> 536: `'web'`, the platform guard the Markdown actions' -// `BackHandler` registration gained so it stops logging on the page, and `"button"`, the -// accessibility role the header's Back control gained so the page serves it by name. Neither is a -// behaviour change on a phone. The same `'web'` moves the effect hash, and `"button"` the host-JSX -// hash. The effect hash moved a second time and back: the diff-notes loader's uncaught rejection -// was caught and then reverted, because the fix moves `matrix-session.diff-notes-worktree.show-1` -// and a golden is a review event — so this hash is the one the uncaught `void` call produces. -// -// 536 -> 530 for the keyboard seam above: the four event names and the two `'ios'` guards left -// with the listener pair. -// -// The host-JSX hash moved for the header's reconnect tap, which now also checks the re-dial exists: -// the page's provider hands out none. Nothing a phone renders or does changed. -// -// 530 -> 529: `'hardwareBackPress'` left with the Markdown actions' registration for `useBackClaim`. -// -// 529 -> 530, and the host-JSX hash: `key="terminal-frame"`, so the page's frame mounts with its -// onLayout rather than reusing the loading View. Native measured 47 rows before and after: its -// frame reported either way, and its window is its frame, so both measure paths agree there. -// -// 531 -> 530, and the host-JSX and style hashes: the key left, and one `contentFrame` View wraps -// every branch and carries the frame's onLayout, so the page's frame mounts with it. The page measured -// 47 rows before and after; native was measured only on main's bundle (47), and the wrapper is a -// flex:1 View around the same flex:1 frame, so its box is the frame's. -// Count unchanged: `'frame-not-laid-out'`, the gate awaiting the frame's first layout, replaced `'measuring-viewport'`. -// 530 -> 532, and the host-JSX hash: the tab bar and the accessory bar take a ref that gives the -// page `keyboardShouldPersistTaps` ('handled', 'always'), which react-native-web ignores. Natively -// the ref is undefined. 532 -> 531: the live input's reopen flag reads the host OS, not an 'android' literal. -// 531 -> 529: the markdown status line moved to `markdownReaderStatusText`. -const HEAD_RUNTIME_STRING_SHA256 = - '4ab2f316f60c234480615136c02273675543f24d653eb76a62b76f6bc986d985' -// Moved by both of the dock's fields: their refs, and the live one's submit handler, are the seam's now; -// their keyboard type and remount key read the host OS. -// Moved again when the terminal frame kept its laid-out width unrounded, for every fit. -// Again when the frame's onLayout wrote one frame ref and notified a new width imperatively. -// Again when the frame's first laid-out layout alone subscribes a held-back document. -// Again when the frame's onLayout made one `notifyTerminalFrame` call. -const HEAD_HOST_JSX_SHA256 = 'f71b1ee495f67a6e389abf597948ffdff1f9a4a10cde6abefd2611ea4dd94245' -const HEAD_LEAF_JSX_SHA256 = '62eb05c6e2ac0be6d553a141fc8aa1641fcb0c678777d5d539f490aab8648417' -const HEAD_STYLE_REFERENCE_SHA256 = - '56a005a1f65b30c11092e3422caef67810e1ec50f66fdd06471c370138b1eeb6' -const HEAD_IDENTITY_FIELD_SHA256 = - '91146853930a34dd1f3d80e5c97fbacd7cf19fb93dd26fe8fc6f29169622f9d6' -const HEAD_NAVIGATION_SHA256 = '9d96f5dad7de555d6553eac39c0fab00efad507470fd562cb9beaa32db16f512' -// Moved when structured-session features became one helper call; the capability strings it reads -// are pinned by that helper's own test. -const HEAD_CAPABILITY_SHA256 = 'ec1159d6e726383bf7121e9c642657fee5b4ebec049cb44ba132a303bb9a61e2' - -type Definition = { declaration: ts.FunctionDeclaration; sourceFile: ts.SourceFile } -type HookFacts = { - bindings: string[] - callbackBodies: string[] - callbacks: string[] - effects: string[] - hooks: string[] -} - -const printer = ts.createPrinter({ removeComments: true }) -const sourceFiles = new Map() - -function parse(relativePath: string): ts.SourceFile { - const cached = sourceFiles.get(relativePath) - if (cached) { - return cached - } - const filePath = fileURLToPath(new URL(relativePath, import.meta.url)) - const sourceFile = ts.createSourceFile( - relativePath, - readFileSync(filePath, 'utf8'), - ts.ScriptTarget.Latest, - true, - relativePath.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS - ) - sourceFiles.set(relativePath, sourceFile) - return sourceFile -} - -function canonical(node: ts.Node, sourceFile: ts.SourceFile): string { - return printer.printNode(ts.EmitHint.Unspecified, node, sourceFile).replace(/\s+/g, '') -} - -function hash(values: readonly string[]): string { - return createHash('sha256').update(values.join('\n')).digest('hex') -} - -function readDefinitions(): Map { - const definitions = new Map() - for (const relativePath of SESSION_FILES) { - const sourceFile = parse(relativePath) - const visit = (node: ts.Node): void => { - if (ts.isFunctionDeclaration(node) && node.name) { - definitions.set(node.name.text, { declaration: node, sourceFile }) - } - ts.forEachChild(node, visit) - } - visit(sourceFile) - } - return definitions -} - -function visitLogicalFunction( - name: string, - definitions: ReadonlyMap, - onNode: (node: ts.Node, sourceFile: ts.SourceFile) => void, - active = new Set() -): void { - const definition = definitions.get(name) - if (!definition?.declaration.body) { - throw new Error(`Missing session function: ${name}`) - } - if (active.has(name)) { - throw new Error(`Recursive session function: ${name}`) - } - const nextActive = new Set(active).add(name) - const visit = (node: ts.Node): void => { - if ( - ts.isCallExpression(node) && - ts.isIdentifier(node.expression) && - LOGIC_EXPANSION_NAMES.has(node.expression.text) - ) { - visitLogicalFunction(node.expression.text, definitions, onNode, nextActive) - return - } - onNode(node, definition.sourceFile) - ts.forEachChild(node, visit) - } - visit(definition.declaration.body) -} - -function readHookFacts(name: string, definitions: ReadonlyMap): HookFacts { - const facts: HookFacts = { - bindings: [], - callbackBodies: [], - callbacks: [], - effects: [], - hooks: [] - } - visitLogicalFunction(name, definitions, (node, sourceFile) => { - if ( - !ts.isCallExpression(node) || - !ts.isIdentifier(node.expression) || - !/^use[A-Z]/.test(node.expression.text) - ) { - return - } - const hookName = node.expression.text - facts.hooks.push(hookName) - const owner = ts.isVariableDeclaration(node.parent) - ? node.parent.name.getText(sourceFile) - : ts.isExpressionStatement(node.parent) - ? '' - : ts.isCallExpression(node.parent) && ts.isIdentifier(node.parent.expression) - ? `` - : '' - const lastArgument = node.arguments.at(-1) - const dependencies = - lastArgument && ts.isArrayLiteralExpression(lastArgument) - ? canonical(lastArgument, sourceFile) - : '' - facts.bindings.push(`${hookName}|${owner}|${dependencies}`) - if (hookName === 'useCallback') { - facts.callbacks.push(`${owner}|${dependencies}`) - facts.callbackBodies.push( - `${owner}|${canonical(node.arguments[0], sourceFile)}|${dependencies}` - ) - } - if (hookName === 'useEffect') { - facts.effects.push(`${canonical(node.arguments[0], sourceFile)}|${dependencies}`) - } - }) - return facts -} - -function readNestedFunctions(definitions: ReadonlyMap): string[] { - const functions: string[] = [] - const visitDefinition = (name: string, active: ReadonlySet): void => { - const definition = definitions.get(name) - if (!definition?.declaration.body || active.has(name)) { - throw new Error(`Invalid nested-function stage: ${name}`) - } - const nextActive = new Set(active).add(name) - const visit = (node: ts.Node): void => { - if ( - ts.isCallExpression(node) && - ts.isIdentifier(node.expression) && - LOGIC_EXPANSION_NAMES.has(node.expression.text) - ) { - visitDefinition(node.expression.text, nextActive) - return - } - if (ts.isFunctionDeclaration(node) && node.name) { - functions.push(`${node.name.text}|${canonical(node, definition.sourceFile)}`) - return - } - ts.forEachChild(node, visit) - } - visit(definition.declaration.body) - } - visitDefinition(ROOT_COMPONENT, new Set()) - return functions -} - -function readNativeAndTimerFacts(definitions: ReadonlyMap): { - cleanups: string[] - creations: string[] - registrations: string[] - removals: string[] -} { - const registrations: string[] = [] - const removals: string[] = [] - const creations: string[] = [] - const cleanups: string[] = [] - const collect = (node: ts.Node, sourceFile: ts.SourceFile): void => { - if (!ts.isCallExpression(node)) { - return - } - if (ts.isPropertyAccessExpression(node.expression)) { - const receiver = node.expression.expression.getText(sourceFile) - const method = node.expression.name.text - if ( - ['BackHandler', 'AppState', 'Keyboard'].includes(receiver) && - ['addEventListener', 'addListener'].includes(method) - ) { - registrations.push(canonical(node, sourceFile)) - } - if (method === 'remove') { - removals.push(canonical(node, sourceFile)) - } - } - if (ts.isIdentifier(node.expression)) { - if (['setTimeout', 'setInterval', 'requestAnimationFrame'].includes(node.expression.text)) { - creations.push(canonical(node, sourceFile)) - } - if ( - ['clearTimeout', 'clearInterval', 'cancelAnimationFrame'].includes(node.expression.text) - ) { - cleanups.push(canonical(node, sourceFile)) - } - } - } - visitLogicalFunction('FileReader', definitions, collect) - visitLogicalFunction(ROOT_COMPONENT, definitions, collect) - return { cleanups, creations, registrations, removals } -} - -function isRuntimeNode(node: ts.Node): boolean { - for (let parent = node.parent; parent; parent = parent.parent) { - if ( - ts.isImportDeclaration(parent) || - ts.isExportDeclaration(parent) || - ts.isImportTypeNode(parent) || - ts.isTypeNode(parent) - ) { - return false - } - } - return true -} - -function readRuntimeStrings(): string[] { - const values: string[] = [] - for (const relativePath of SESSION_FILES) { - const visit = (node: ts.Node): void => { - if (isRuntimeNode(node)) { - if ( - ts.isStringLiteral(node) || - ts.isNoSubstitutionTemplateLiteral(node) || - ts.isTemplateHead(node) || - ts.isTemplateMiddle(node) || - ts.isTemplateTail(node) - ) { - values.push(node.text) - } - if (ts.isJsxText(node) && node.text.trim()) { - values.push(node.text.replace(/\s+/g, ' ').trim()) - } - } - ts.forEachChild(node, visit) - } - visit(parse(relativePath)) - } - return values.sort() -} - -function readJsxFacts(definitions: ReadonlyMap): { - host: string[] - leaf: string[] - styleReferences: string[] -} { - const host: string[] = [] - const leaf: string[] = [] - const active = new Set() - const visitDefinition = (name: string): void => { - const definition = definitions.get(name) - if (!definition?.declaration.body || active.has(name)) { - throw new Error(`Invalid JSX stage: ${name}`) - } - active.add(name) - const visit = (node: ts.Node): void => { - if ( - ts.isCallExpression(node) && - ts.isIdentifier(node.expression) && - LOGIC_EXPANSION_NAMES.has(node.expression.text) - ) { - visitDefinition(node.expression.text) - return - } - if (ts.isJsxElement(node) || ts.isJsxSelfClosingElement(node)) { - const opening = ts.isJsxElement(node) ? node.openingElement : node - const tagName = opening.tagName.getText(definition.sourceFile) - if (SURFACE_EXPANSION_NAMES.has(tagName)) { - visitDefinition(tagName) - return - } - const attributes = opening.attributes.properties - .map((attribute) => { - if (ts.isJsxSpreadAttribute(attribute)) { - return `...${canonical(attribute.expression, definition.sourceFile)}` - } - const attributeName = attribute.name.getText(definition.sourceFile) - if (!attribute.initializer) { - return attributeName - } - if (ts.isStringLiteral(attribute.initializer)) { - return `${attributeName}=${JSON.stringify(attribute.initializer.text)}` - } - return `${attributeName}=${ - attribute.initializer.expression - ? canonical(attribute.initializer.expression, definition.sourceFile) - : '' - }` - }) - .join(',') - ;(HOST_COMPONENT_NAMES.has(tagName) ? host : leaf).push(`${tagName}|${attributes}`) - for (const attribute of opening.attributes.properties) { - ts.forEachChild(attribute, visit) - } - if (ts.isJsxElement(node)) { - for (const child of node.children) { - visit(child) - } - } - return - } - if (ts.isJsxFragment(node)) { - for (const child of node.children) { - visit(child) - } - return - } - ts.forEachChild(node, visit) - } - visit(definition.declaration.body) - active.delete(name) - } - for (const name of CONTENT_COMPONENT_NAMES) { - visitDefinition(name) - } - visitDefinition(ROOT_COMPONENT) - const styleReferences: string[] = [] - for (const record of [...host, ...leaf]) { - for (const match of record.matchAll(/styles\.([A-Za-z0-9_]+)/g)) { - styleReferences.push(match[1]) - } - } - return { host, leaf, styleReferences } -} - -function readCompatibilityFacts(definitions: ReadonlyMap): { - capabilities: string[] - identityFields: string[] - navigation: string[] -} { - const capabilities: string[] = [] - const identityFields: string[] = [] - const navigation: string[] = [] - visitLogicalFunction(ROOT_COMPONENT, definitions, (node, sourceFile) => { - if (!isRuntimeNode(node)) { - return - } - if (ts.isPropertyAssignment(node)) { - const name = node.name.getText(sourceFile) - if (['notifyClients', 'deviceToken', 'clientId'].includes(name)) { - identityFields.push(`${name}|${canonical(node.initializer, sourceFile)}`) - } - if ( - name === 'client' && - ts.isObjectLiteralExpression(node.initializer) && - node.initializer.properties.some( - (property) => property.name?.getText(sourceFile) === 'id' - ) && - node.initializer.properties.some( - (property) => property.name?.getText(sourceFile) === 'type' - ) - ) { - identityFields.push(`client|${canonical(node.initializer, sourceFile)}`) - } - } - if (!ts.isCallExpression(node)) { - return - } - if ( - ts.isPropertyAccessExpression(node.expression) && - node.expression.expression.getText(sourceFile) === 'router' && - ['push', 'replace', 'back'].includes(node.expression.name.text) - ) { - navigation.push(canonical(node, sourceFile)) - } - const callName = ts.isIdentifier(node.expression) - ? node.expression.text - : ts.isPropertyAccessExpression(node.expression) - ? node.expression.name.text - : '' - const callText = canonical(node, sourceFile) - if ( - [ - 'startRuntimeCapabilityProbe', - 'supportsMobileQuickCommands', - 'structuredAgentSessionHostSupport' - ].includes(callName) || - (callName === 'includes' && callText.includes('capabilities.includes')) - ) { - capabilities.push(callText) - } - }) - return { capabilities, identityFields, navigation } -} - -describe('mobile session route extraction parity', () => { - it('preserves hooks, callbacks, effects, and nested action bodies', () => { - const definitions = readDefinitions() - const main = readHookFacts(ROOT_COMPONENT, definitions) - const contentBindings = CONTENT_COMPONENT_NAMES.flatMap( - (name) => readHookFacts(name, definitions).bindings - ) - expect(main.hooks).toHaveLength(281) - expect(hash(main.hooks)).toBe(HEAD_MAIN_HOOK_SHA256) - expect(hash(main.bindings)).toBe(HEAD_HOOK_BINDING_SHA256) - expect(main.callbacks).toHaveLength(80) - expect(hash(main.callbacks)).toBe(HEAD_CALLBACK_IDENTITY_SHA256) - expect(hash(main.callbackBodies)).toBe(HEAD_CALLBACK_BODY_SHA256) - expect(main.effects).toHaveLength(24) - expect(hash(main.effects)).toBe(HEAD_EFFECT_SHA256) - expect(contentBindings).toHaveLength(14) - expect(hash(contentBindings)).toBe(HEAD_CONTENT_HOOK_SHA256) - const nestedFunctions = readNestedFunctions(definitions) - expect(nestedFunctions).toHaveLength(12) - expect(hash(nestedFunctions)).toBe(HEAD_NESTED_FUNCTION_SHA256) - }) - - it('preserves native listeners, timers, identity payloads, and compatibility gates', () => { - const definitions = readDefinitions() - const native = readNativeAndTimerFacts(definitions) - expect(native.registrations).toHaveLength(4) - expect(hash(native.registrations)).toBe(HEAD_NATIVE_REGISTRATION_SHA256) - expect(native.removals).toHaveLength(6) - expect(hash(native.removals)).toBe(HEAD_NATIVE_REMOVAL_SHA256) - expect(native.creations.filter((fact) => fact.startsWith('setTimeout'))).toHaveLength(7) - expect(native.creations.filter((fact) => fact.startsWith('setInterval'))).toHaveLength(1) - expect( - native.creations.filter((fact) => fact.startsWith('requestAnimationFrame')) - ).toHaveLength(1) - expect(hash(native.creations)).toBe(HEAD_TIMER_CREATION_SHA256) - expect(native.cleanups.filter((fact) => fact.startsWith('clearTimeout'))).toHaveLength(11) - expect(native.cleanups.filter((fact) => fact.startsWith('clearInterval'))).toHaveLength(1) - expect(native.cleanups.filter((fact) => fact.startsWith('cancelAnimationFrame'))).toHaveLength( - 1 - ) - expect(hash(native.cleanups)).toBe(HEAD_TIMER_CLEANUP_SHA256) - const compatibility = readCompatibilityFacts(definitions) - expect(compatibility.identityFields).toHaveLength(14) - expect(hash(compatibility.identityFields)).toBe(HEAD_IDENTITY_FIELD_SHA256) - expect(compatibility.navigation).toHaveLength(6) - expect(hash(compatibility.navigation)).toBe(HEAD_NAVIGATION_SHA256) - expect(compatibility.capabilities).toHaveLength(6) - expect(hash(compatibility.capabilities)).toBe(HEAD_CAPABILITY_SHA256) - }) - - it('preserves runtime strings, styles, and the expanded JSX tree', () => { - const strings = readRuntimeStrings() - expect(strings).toHaveLength(529) - expect(hash(strings)).toBe(HEAD_RUNTIME_STRING_SHA256) - const jsx = readJsxFacts(readDefinitions()) - expect(jsx.host).toHaveLength(125) - expect(hash(jsx.host)).toBe(HEAD_HOST_JSX_SHA256) - expect(jsx.leaf).toHaveLength(61) - expect(hash(jsx.leaf)).toBe(HEAD_LEAF_JSX_SHA256) - expect(jsx.styleReferences).toHaveLength(173) - expect(hash(jsx.styleReferences)).toBe(HEAD_STYLE_REFERENCE_SHA256) - }) -}) diff --git a/mobile/src/session/mobile-session-route-source-family.test-support.ts b/mobile/src/session/mobile-session-route-source-family.test-support.ts deleted file mode 100644 index 23ae6fb348e4..000000000000 --- a/mobile/src/session/mobile-session-route-source-family.test-support.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' - -/** - * The session screen as one source family, rooted at the component the route mounts. - * - * `MobileSessionRouteScreen.tsx` and not the route file: C7.7 made that file a flag switch, whose - * business is which of the two screens to render and not what the session screen does. Walking it - * would pin the switch's own params and literals into an extraction parity hash that is about the - * screen, and the root function this family is read from is the one that calls the controller. - */ -export const MOBILE_SESSION_ROUTE_SOURCE_FILES = [ - './MobileSessionRouteScreen.tsx', - './use-mobile-session-controller.ts', - './use-mobile-session-foundation.ts', - './use-mobile-session-screen-state.ts', - './use-mobile-session-terminal-runtime.ts', - './use-mobile-session-feedback-capabilities.ts', - './use-mobile-session-native-chat-dictation.ts', - './use-mobile-session-terminal-subscription-foundation.ts', - './use-mobile-session-terminal-subscription.ts', - './use-mobile-session-terminal-stream-display.ts', - './use-mobile-session-terminal-list.ts', - './use-mobile-session-tab-application.ts', - './use-mobile-session-document-readers.ts', - './use-mobile-session-diff-comments.ts', - './use-mobile-session-markdown-actions.ts', - './use-mobile-session-tab-reconciliation.ts', - './use-mobile-session-lifecycle.ts', - './use-mobile-session-keyboard-state.ts', - './use-mobile-session-startup.ts', - './use-mobile-session-preference-focus.ts', - './use-mobile-session-tab-switching.ts', - './use-mobile-session-terminal-webview.ts', - './use-mobile-session-terminal-send-actions.ts', - './use-mobile-session-file-actions.ts', - './use-mobile-session-terminal-input.ts', - './use-mobile-session-accessory-selection.ts', - './use-mobile-session-attachments.ts', - './use-mobile-session-terminal-create-actions.ts', - './use-mobile-session-content-create-actions.ts', - './use-mobile-session-close-actions.ts', - './use-mobile-session-bulk-close.ts', - './use-mobile-session-presentation.ts', - './use-mobile-session-panel-route-actions.tsx', - './MobileSessionMarkdownReader.tsx', - './MobileSessionDiffLineRow.tsx', - './MobileSessionFileReader.tsx', - './MobileSessionSurface.tsx', - './MobileSessionHeader.tsx', - './MobileSessionContentRow.tsx', - './MobileSessionActiveContent.tsx', - './MobileSessionCommandDock.tsx', - './MobileSessionSheets.tsx' -] as const - -export function readMobileSessionRouteSource(relativePath: string): string { - return readFileSync(fileURLToPath(new URL(relativePath, import.meta.url)), 'utf8') -} - -export function readMobileSessionRouteSourceFamily( - relativePaths: readonly string[] = MOBILE_SESSION_ROUTE_SOURCE_FILES -): string { - return relativePaths - .map( - (relativePath) => `// Source: ${relativePath}\n${readMobileSessionRouteSource(relativePath)}` - ) - .join('\n') -} diff --git a/mobile/src/session/mobile-session-route.test.ts b/mobile/src/session/mobile-session-route.test.ts index 33872e0271f3..4cd040a061a1 100644 --- a/mobile/src/session/mobile-session-route.test.ts +++ b/mobile/src/session/mobile-session-route.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { describe, expect, it, vi } from 'vitest' import { mobileSessionRouteTarget } from './mobile-session-route' import { @@ -7,8 +6,6 @@ import { type HostStackNavigationState } from '../navigation/host-stack-navigation' -const homeSource = readFileSync(new URL('../home/MobileHomeScreen.tsx', import.meta.url), 'utf8') - function navigationHarness(initialState: HostStackNavigationState) { const stateListeners = new Set<() => void>() let state = initialState @@ -95,20 +92,4 @@ describe('mobile session route', () => { payload: target }) }) - - it('routes the home Resume card through the cold-navigator-safe transition', () => { - expect(homeSource).toContain('onOpenResume={openResume}') - - // The tap handler itself must go through the coordinated transition; its only - // direct push is the shallow noticed host-index route for a proven-missing target. - const handlerStart = homeSource.indexOf('const openResume = useCallback(') - const handlerEnd = homeSource.indexOf('[data.router, openMobileSession]', handlerStart) - expect(handlerStart).toBeGreaterThanOrEqual(0) - expect(handlerEnd).toBeGreaterThan(handlerStart) - - const openResume = homeSource.slice(handlerStart, handlerEnd) - expect(openResume).toContain('openMobileSession({') - expect(openResume.match(/router\.push\(/g)).toHaveLength(1) - expect(openResume).toContain('data.router.push(hostRouteWithNotice(') - }) }) diff --git a/mobile/src/session/mobile-session-startup-source.test.ts b/mobile/src/session/mobile-session-startup-source.test.ts deleted file mode 100644 index b457164beed4..000000000000 --- a/mobile/src/session/mobile-session-startup-source.test.ts +++ /dev/null @@ -1,295 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - readMobileSessionRouteSource, - readMobileSessionRouteSourceFamily -} from './mobile-session-route-source-family.test-support' - -const source = readMobileSessionRouteSourceFamily() -const startupSource = readMobileSessionRouteSource('./use-mobile-session-startup.ts') -const tabReconciliationSource = readMobileSessionRouteSource( - './use-mobile-session-tab-reconciliation.ts' -) -const bulkCloseSource = readMobileSessionRouteSource('./use-mobile-session-bulk-close.ts') -const presentationSource = readMobileSessionRouteSource('./use-mobile-session-presentation.ts') -const tabSwitchingSource = readMobileSessionRouteSource('./use-mobile-session-tab-switching.ts') -const sheetsSource = readMobileSessionRouteSource('./MobileSessionSheets.tsx') -const reconciliationHookSource = readMobileSessionRouteSource( - './use-mobile-session-tabs-reconciliation.ts' -) -const terminalInventoryRecoverySource = readMobileSessionRouteSource( - './use-mobile-terminal-inventory-recovery.ts' -) -const terminalSubscriptionSource = readMobileSessionRouteSource( - './use-mobile-session-terminal-subscription.ts' -) -const terminalListSource = readMobileSessionRouteSource('./use-mobile-session-terminal-list.ts') -const tabReconciliationOwnerSource = readMobileSessionRouteSource( - './use-mobile-session-tab-reconciliation.ts' -) -const autoCreateHookSource = readMobileSessionRouteSource( - './use-initial-session-terminal-autocreate.ts' -) -const foundationSource = readMobileSessionRouteSource('./use-mobile-session-foundation.ts') -const terminalRuntimeSource = readMobileSessionRouteSource( - './use-mobile-session-terminal-runtime.ts' -) -const terminalSubscriptionSourceForIdentity = readMobileSessionRouteSource( - './use-mobile-session-terminal-subscription.ts' -) -const lifecycleSource = readMobileSessionRouteSource('./use-mobile-session-lifecycle.ts') - -function sliceBetween(startPattern: string, endPattern: string, targetSource = source): string { - const start = targetSource.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = targetSource.indexOf(endPattern, start) - expect(end).toBeGreaterThan(start) - return targetSource.slice(start, end) -} - -describe('mobile session startup', () => { - it('auto-creates one terminal for a newly created empty session', () => { - expect(source).toContain('useWorktreeSessionTabsLoaded(worktreeId)') - expect(source).toContain( - 'initialSessionAutoCreateRef.current = createInitialSessionAutoCreateState()' - ) - - const autoCreateCall = sliceBetween( - 'useInitialSessionTerminalAutoCreate({', - 'const connectionVerdict =', - presentationSource - ) - expect(autoCreateCall).toContain('stateRef: initialSessionAutoCreateRef') - expect(autoCreateCall).toContain( - 'consumeCreationRoute: () => router.setParams({ created: undefined })' - ) - expect(autoCreateCall).toContain("newlyCreatedWorkspace: created === '1'") - expect(autoCreateCall).toContain('visibleTabCount: visibleTabs.length') - expect(autoCreateCall).toContain('createTerminal: () => void handleCreateTerminal()') - - expect(autoCreateHookSource).toContain('shouldAutoCreateInitialSessionTerminal({') - expect(autoCreateHookSource).toContain('stateRef.current.autoCreatedForWorktree === worktreeId') - expect(autoCreateHookSource).toContain('stateRef.current.autoCreatedForWorktree = worktreeId') - expect(autoCreateHookSource).toContain("connState === 'connected'") - expect(autoCreateHookSource).toContain('(visibleTabCount > 0 || activeHandle !== null)') - // Why: both callbacks are re-created every render, so the effect must reach them - // through useEffectEvent rather than deps or a render-time ref write. - expect(autoCreateHookSource).toContain('useEffectEvent(args.consumeCreationRoute)') - expect(autoCreateHookSource).toContain('useEffectEvent(args.createTerminal)') - expect(autoCreateHookSource).toContain('consumeCreationRoute()') - expect(autoCreateHookSource).toContain('createTerminal()') - }) - - it('arms the auto-create only until the route has published a tab (#9717)', () => { - // Emptiness after a populated list is a close, not a cold hydrate. - expect(source).toContain( - 'initialSessionAutoCreateRef.current.sawSessionTabs ||= nextTabs.length > 0' - ) - - const autoCreateCall = sliceBetween( - 'useInitialSessionTerminalAutoCreate({', - 'const connectionVerdict =', - presentationSource - ) - expect(autoCreateCall).toContain('stateRef: initialSessionAutoCreateRef') - expect(autoCreateHookSource).toContain('sawSessionTabs: stateRef.current.sawSessionTabs') - }) - - it('delegates stream ownership while retaining degraded polling and a certified sweep', () => { - expect(source).toContain('useMobileSessionTabsReconciliation<') - expect(source).toContain('const applicationRevision = ++appliedSessionTabsRevisionRef.current') - expect(source).toContain('getApplicationRevision: getSessionTabsApplicationRevision') - expect(source).not.toContain("client.subscribe(\n 'session.tabs.subscribe'") - expect(reconciliationHookSource).toContain("client.subscribe(\n 'session.tabs.subscribe'") - expect(reconciliationHookSource).toContain("if (AppState.currentState !== 'active')") - expect(reconciliationHookSource).toContain('suspendTerminalInventoryRecovery(true)') - expect(reconciliationHookSource).toContain('controller.poll()') - expect(reconciliationHookSource).toContain('tabsRequest !== null') - expect(reconciliationHookSource).toContain('void refreshTerminalInventory()') - expect(reconciliationHookSource).toContain("AppState.addEventListener('change'") - expect(reconciliationHookSource).toContain('const interval = setInterval(') - expect(reconciliationHookSource).toContain('RECONCILIATION_INTERVAL_MS = 2000') - expect(terminalInventoryRecoverySource).toContain('CERTIFIED_TERMINAL_SWEEP_MS = 60_000') - expect(reconciliationHookSource).toContain('controller.setReconciliationActive(false)') - expect(reconciliationHookSource).toContain('clearInterval(interval)') - expect(reconciliationHookSource).toContain('appStateSubscription.remove()') - }) - - it('binds terminal identity to the shared client before subscription effects run', () => { - expect(foundationSource).toContain('const { client, clientId, state: connState }') - expect(foundationSource).toContain(' clientId,') - expect(terminalRuntimeSource).toContain('useRef(clientId)') - expect(terminalRuntimeSource).toContain('deviceTokenRef.current = clientId') - expect(terminalRuntimeSource).toContain('inputGate.canSend && clientId !== null') - expect(terminalSubscriptionSourceForIdentity).toContain('if (clientId === null)') - expect(terminalSubscriptionSourceForIdentity).toContain( - "client: { id: clientId, type: 'mobile' as const }" - ) - expect(lifecycleSource).not.toContain('deviceTokenRef.current = host.deviceToken') - }) - - it('confirms terminal stream teardown with a committed inventory-recovery bridge', () => { - expect(terminalSubscriptionSource).toContain( - "if (data.type === 'end' || data.type === 'error')" - ) - expect(terminalSubscriptionSource).toContain('signalTerminalInventoryRecovery()') - expect(terminalInventoryRecoverySource).toContain('actionRef.current = recoveryAction') - expect(terminalInventoryRecoverySource).toContain('pendingSignalScopeRef.current = scopeKey') - expect(terminalInventoryRecoverySource).toContain( - 'committedScope !== null && committedScope !== scopeKey' - ) - expect(terminalListSource).toContain('return terminalInventoryRequest.activate()') - expect(terminalListSource).toContain('if (!isCurrent() || !response.accepted)') - expect(terminalInventoryRecoverySource).toContain( - 'TERMINAL_INVENTORY_CONFIRMATION_DELAY_MS = 750' - ) - expect(terminalInventoryRecoverySource).toContain( - 'refreshTerminalInventory({ allowEmptyLoaded: true })' - ) - }) - - it('loads session tabs without waiting for desktop activation', () => { - const startupEffect = sliceBetween( - 'void (async () => {', - 'return () => {\n disposed = true', - startupSource - ) - - // Both sends migrated to the typed `worktreeActivate` operation in step 6; what these pin is - // unchanged — the plain activation is fired and not awaited, and it goes out before the tab load. - expect(startupEffect).toContain('void worktreeActivate\n .request(client, {') - expect(startupEffect).toContain("if (client && created !== '1' && !isFloatingWorkspaceRoute)") - expect(startupEffect).toContain("if (client && created === '1' && !isFloatingWorkspaceRoute)") - expect(startupEffect).toContain('notifyClients: false') - expect(startupEffect).toContain("navigation: 'caller'") - expect(startupEffect).not.toContain('await worktreeActivate\n .request(client, {') - expect(startupEffect.indexOf('worktreeActivate\n .request(client, {')).toBeLessThan( - startupEffect.indexOf('await ensureSessionTabs()') - ) - expect(startupEffect).toContain('headlessActivationNeedsHostRenderer(activation.value)') - expect(startupEffect).toContain("showToast('Open Orca on the host to wake sleeping agents.'") - }) - - it('fails runtime capability gates closed before probing a replacement client', () => { - const capabilityEffect = sliceBetween( - 'const hostQueryReplyInputSupportedRef = useRef(false)', - 'return {\n consumeAcceptedSessionTabs', - tabReconciliationSource - ) - const probeStart = capabilityEffect.indexOf('startRuntimeCapabilityProbe(client,') - - expect(probeStart).toBeGreaterThanOrEqual(0) - for (const reset of [ - 'setBrowserScreencastSupported(null)', - 'setAgentSessionHistorySupported(null)', - 'setQuickCommandsSupported(null)', - 'setShowQuickCommands(false)', - 'hostQueryReplyInputSupportedRef.current = false' - ]) { - const resetIndex = capabilityEffect.lastIndexOf(reset) - expect(resetIndex).toBeGreaterThanOrEqual(0) - expect(resetIndex).toBeLessThan(probeStart) - } - }) - - it('activates an already-selected pending terminal tab after hydration', () => { - expect(source).toContain( - 'const pendingTerminalActivationAttemptRef = useRef(null)' - ) - expect(source).toContain('pendingTerminalActivationAttemptRef.current = null') - - const pendingActivationEffect = sliceBetween( - "if (!client || connState !== 'connected' || !activePendingTerminalTab) {", - 'return {\n bulkCloseActions', - bulkCloseSource - ) - expect(pendingActivationEffect).toContain( - 'pendingTerminalActivationAttemptRef.current === activationKey' - ) - expect(pendingActivationEffect).toContain('activateMobileSessionTab(client,') - expect(pendingActivationEffect).toContain('tabId: activePendingTerminalTab.id') - expect(pendingActivationEffect).toContain('leafId: activePendingTerminalTab.leafId') - expect(pendingActivationEffect).toContain('notifyClients: false') - expect(pendingActivationEffect).toContain("navigation: 'caller'") - expect(pendingActivationEffect).toContain( - 'applySessionTabs((response as RpcSuccess).result as SessionTabsResult)' - ) - expect(pendingActivationEffect).toContain('scheduleDelayedAction(() => void fetchSessionTabs()') - }) - - it('keeps ready terminal taps local while publishing caller selection', () => { - const readyTerminalSwitch = sliceBetween( - 'const switchTab = useCallback(', - 'const switchSessionTab = useCallback(', - tabSwitchingSource - ) - - expect(readyTerminalSwitch).not.toContain('focusMobileTerminal(client, handle)') - expect(readyTerminalSwitch).toContain('activateMobileSessionTab(client,') - expect(readyTerminalSwitch).toContain('notifyClients: false') - expect(readyTerminalSwitch).toContain("navigation: 'caller'") - }) - - it('keeps background and pending session-tab activation local to the phone', () => { - const activationRequests = source.split('activateMobileSessionTab(client,').slice(1) - - expect(activationRequests).toHaveLength(4) - for (const request of activationRequests) { - expect(request.slice(0, request.indexOf('})'))).toContain('notifyClients: false') - expect(request.slice(0, request.indexOf('})'))).toContain("navigation: 'caller'") - } - }) - - it('keeps dynamic agent rows above fixed New Tab actions', () => { - const newTabActions = sliceBetween( - 'title="New Tab"', - 'onClose={() => setShowCreateTabDrawer', - sheetsSource - ) - - expect(newTabActions.indexOf('...createTabAgentActions')).toBeLessThan( - newTabActions.indexOf("label: 'Terminal'") - ) - expect(newTabActions.indexOf("label: 'Terminal'")).toBeLessThan( - newTabActions.indexOf("label: 'Browser'") - ) - expect(newTabActions.indexOf("label: 'Browser'")).toBeLessThan( - newTabActions.indexOf("label: 'Markdown Note'") - ) - }) - - it('wires pending-handle recovery through its bounded context (STA-4256)', () => { - const applySessionTabs = sliceBetween( - 'const applySessionTabs = useCallback(', - 'const consumeAcceptedSessionTabs = useCallback(' - ) - const recoveryContext = sliceBetween( - 'const pendingTerminalRecoveryContextCache = useMemo(', - 'const sessionTabsFetchReporting', - tabReconciliationOwnerSource - ) - - const tabsRefWrite = 'sessionTabsRef.current = nextTabs' - const tabsStateWrite = 'setSessionTabs((prev)' - const activeRefWrite = 'activeSessionTabIdRef.current = active?.id ?? null' - const activeStateWrite = 'setActiveSessionTabId(active?.id ?? null)' - for (const write of [tabsRefWrite, tabsStateWrite, activeRefWrite, activeStateWrite]) { - expect(applySessionTabs).toContain(write) - } - expect(applySessionTabs.indexOf(tabsRefWrite)).toBeLessThan( - applySessionTabs.indexOf(tabsStateWrite) - ) - expect(applySessionTabs.indexOf(activeRefWrite)).toBeLessThan( - applySessionTabs.indexOf(activeStateWrite) - ) - expect(recoveryContext).toContain('() => new PendingTerminalHandleRecoveryContextCache()') - expect(recoveryContext).toContain('sessionTabsRef.current,') - expect(recoveryContext).toContain('activeSessionTabIdRef.current') - expect(recoveryContext).toContain( - 'const pendingTerminalRecoveryContextKey = getPendingTerminalRecoveryContextKey()' - ) - expect(source).toContain('hasRecoveryNeed: hasSessionTabsRecoveryNeed') - expect(source).toContain('getPendingTerminalRecoveryContextKey,') - expect(source).toContain('onPendingTerminalRecoveryParked: setParkedPendingTerminalContext') - expect(source).toContain('retryPendingTerminalRecovery()') - }) -}) diff --git a/mobile/src/session/quick-commands-tab-stability-source.test.ts b/mobile/src/session/quick-commands-tab-stability-source.test.ts deleted file mode 100644 index 9c744a5f982f..000000000000 --- a/mobile/src/session/quick-commands-tab-stability-source.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import ts from 'typescript' -import { describe, expect, it } from 'vitest' -import { readMobileSessionRouteSource } from './mobile-session-route-source-family.test-support' - -const sourcePath = './MobileSessionHeader.tsx' -const source = readMobileSessionRouteSource(sourcePath) -const sheetsSource = readMobileSessionRouteSource('./MobileSessionSheets.tsx') -const sourceFile = ts.createSourceFile( - sourcePath, - source, - ts.ScriptTarget.Latest, - true, - ts.ScriptKind.TSX -) - -function findQuickCommandsTabButtons(): ts.JsxSelfClosingElement[] { - const matches: ts.JsxSelfClosingElement[] = [] - - function visit(node: ts.Node): void { - if ( - ts.isJsxSelfClosingElement(node) && - node.tagName.getText(sourceFile) === 'QuickCommandsTabButton' - ) { - matches.push(node) - } - ts.forEachChild(node, visit) - } - - visit(sourceFile) - return matches -} - -function getQuickCommandsTabSource(): string { - const start = source.indexOf('accessibilityLabel="New tab"') - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf('', start) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('quick-commands tab stability', () => { - it('keeps the button mounted while preserving the capability gate', () => { - const tabSource = getQuickCommandsTabSource() - const buttons = findQuickCommandsTabButtons() - - expect(buttons).toHaveLength(1) - const tabBar = buttons[0].parent - expect(ts.isJsxElement(tabBar)).toBe(true) - if (!ts.isJsxElement(tabBar)) { - return - } - expect(tabBar.openingElement.tagName.getText(sourceFile)).toBe('View') - const style = tabBar.openingElement.attributes.properties.find( - (attribute): attribute is ts.JsxAttribute => - ts.isJsxAttribute(attribute) && attribute.name.getText(sourceFile) === 'style' - ) - expect(style?.initializer?.getText(sourceFile)).toBe('{styles.tabBar}') - expect(tabSource).toContain('if (quickCommandsSupported === true)') - expect(tabSource).toContain('setShowQuickCommands(true)') - expect(tabSource).toContain('Desktop update required for quick commands') - expect(tabSource).toContain('Checking desktop capabilities — try again in a moment') - }) - - it('only presents the sheet after support is confirmed', () => { - expect(sheetsSource).toContain('visible={showQuickCommands && quickCommandsSupported === true}') - }) -}) diff --git a/mobile/src/session/session-router-seam-census.test.ts b/mobile/src/session/session-router-seam-census.test.ts deleted file mode 100644 index 9f73a5434ca2..000000000000 --- a/mobile/src/session/session-router-seam-census.test.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - callsRouteHandoff, - expoRouterValueImports, - parse, - productFiles -} from '../navigation/router-seam-census.test-support' - -const SESSION_ROOT = import.meta.dirname - -/** - * Which modules here hold a router, so the census cannot pass by seeing nothing. - * - * Four, and each for a different target. The foundation hook bounces a deleted workspace back to - * its host; the file-tap handlers push a preview route from a terminal link or a chat path; the - * notification hook consumes a pane tap by rewriting this route's own params; the review route - * body replaces to the session screen and pops the stack behind it. Only the first two and the - * last can leave the page, which is the whole reason the third is in the list anyway — a - * `setParams` on expo-router's router and a `setParams` on the handoff's are the same call, and - * listing it here is what stops someone later giving it back its own `useRouter` because "it never - * navigates". - */ -const ROUTER_HOLDERS = [ - 'MobileDiffReviewRouteScreen.tsx', - 'use-mobile-file-tap-handlers.ts', - 'use-mobile-session-foundation.ts', - 'use-notification-pane-navigation.ts' -] - -/** - * The expo-router names this domain may still import, and why each one is not a router. - * - * `useFocusEffect` reads whether this screen is the focused one in the document's own stack and - * `useLocalSearchParams` reads the params of the route already mounted. Neither takes a target, so - * neither can put a screen in front of the page; both are the page's own router answering about the - * page's own route, which is exactly what it is for. - * - * A closed list rather than a ban on `useRouter`: the hazard is anything that navigates, and - * expo-router exports a module-singleton `router` that does it from a plain function. A rule written - * against the one spelling would have read that as clean. - */ -const NON_NAVIGATING_ROUTER_NAMES = ['useFocusEffect', 'useLocalSearchParams'] - -describe('the session domain reaches the router through the handoff seam', () => { - const files = productFiles(SESSION_ROOT) - - it('walks the modules it is written against', () => { - expect(files).toEqual(expect.arrayContaining(ROUTER_HOLDERS)) - expect(files.length).toBeGreaterThan(200) - }) - - it('imports nothing from expo-router that can navigate', () => { - const offenders = files - .map((name) => ({ - name, - imported: expoRouterValueImports(parse(SESSION_ROOT, name)).filter( - (imported) => !NON_NAVIGATING_ROUTER_NAMES.includes(imported) - ) - })) - .filter((entry) => entry.imported.length > 0) - .map((entry) => `${entry.name} (${entry.imported.join(', ')})`) - expect(offenders).toEqual([]) - }) - - it('takes the router from useRouteHandoff at every screen that holds one', () => { - expect(files.filter((name) => callsRouteHandoff(parse(SESSION_ROOT, name))).sort()).toEqual( - [...ROUTER_HOLDERS].sort() - ) - }) - - it('still reaches expo-router for the two names that answer about its own route', () => { - // The completeness half: the rule above also passes over a domain that imports nothing at all, - // which is what it would read as if someone moved these hooks and left the list behind. - const imported = new Set( - files.flatMap((name) => expoRouterValueImports(parse(SESSION_ROOT, name))) - ) - expect([...imported].sort()).toEqual([...NON_NAVIGATING_ROUTER_NAMES].sort()) - }) -}) diff --git a/mobile/src/session/terminal-field-submit-binding-wiring.test.ts b/mobile/src/session/terminal-field-submit-binding-wiring.test.ts deleted file mode 100644 index 25a4761af85b..000000000000 --- a/mobile/src/session/terminal-field-submit-binding-wiring.test.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readMobileSessionRouteSource } from './mobile-session-route-source-family.test-support' - -const sendActionsSource = readMobileSessionRouteSource( - './use-mobile-session-terminal-send-actions.ts' -) - -const BINDING_CALL = 'useTerminalTextFieldSubmitBinding(' - -/** The handler each field hands its submit binding, in source order. */ -function readBoundSubmitNames(source: string): string[] { - const names: string[] = [] - let at = source.indexOf(BINDING_CALL) - while (at >= 0) { - const args = source.slice(at + BINDING_CALL.length, source.indexOf(')', at)) - const handler = args.split(',')[1]?.trim() - if (handler) { - names.push(handler) - } - at = source.indexOf(BINDING_CALL, at + 1) - } - return names -} - -/** - * The rule: a handler bound through `useTerminalTextFieldSubmitBinding` must not be frozen on an - * empty dependency list. - * - * `handleSend` is a per-render function whose guard reads `client`, `activeHandle` and `canSend`, - * all absent on the first render, so a submit memoized on `[]` is one closure for the life of the - * component and the field's line-break submit can never pass that guard. The field's own - * `onSubmitEditing` prop keeps working, which is what hid it. - * - * Why a source rule and not a render: every check that mounts its own submit writes the identity - * under test itself, so the render rig's probe route could catch neither the defect nor the fix. - * `terminal-field-submit-binding-send.test.tsx` reads the behaviour instead and catches spellings - * this cannot; this one is the cheap guard beside it. - */ -describe('the submit handlers the terminal fields bind', () => { - it('names one handler per bound field', () => { - expect(readBoundSubmitNames(sendActionsSource)).toEqual([ - 'submitLiveInput', - 'submitBufferedDraft' - ]) - }) - - it('freezes none of them on an empty dependency list', () => { - for (const name of readBoundSubmitNames(sendActionsSource)) { - const declaredAt = sendActionsSource.indexOf(`const ${name} = `) - expect(declaredAt).toBeGreaterThanOrEqual(0) - const boundAt = sendActionsSource.indexOf(`${BINDING_CALL}`, declaredAt) - expect(boundAt).toBeGreaterThan(declaredAt) - expect(sendActionsSource.slice(declaredAt, boundAt)).not.toContain('}, [])') - } - }) - - // The other half of the rule: a handler that is memoized must name what it reads, so the closure - // moves when the send guard's inputs do. - it('gives the live input submit the dependencies its closure reads', () => { - const declaredAt = sendActionsSource.indexOf('const submitLiveInput = ') - const boundAt = sendActionsSource.indexOf(BINDING_CALL, declaredAt) - const slice = sendActionsSource.slice(declaredAt, boundAt) - expect(slice).toContain('handleLiveInputSubmit') - expect(slice).toContain('activeSessionTab') - }) -}) diff --git a/mobile/src/source-control/mobile-pr-create.test.ts b/mobile/src/source-control/mobile-pr-create.test.ts index d52f4861fd40..4935d514f366 100644 --- a/mobile/src/source-control/mobile-pr-create.test.ts +++ b/mobile/src/source-control/mobile-pr-create.test.ts @@ -158,32 +158,6 @@ describe('mobile create form gating parity', () => { ) }) - it('desktop gate hard-blocks on positive unresolved review evidence', () => { - // Mobile lacks review-lookup signals, so it fails closed on ambiguity: the - // shared desktop gate must return false even when eligibility looks ready. - expect( - shouldOpenChecksPanelCreateComposer({ - activeReview: null, - isFolder: false, - branch: 'feature/x', - hostedReviewCreation: eligibility({ canCreate: true }), - reviewLookup: 'positive_unresolved' - }) - ).toBe(false) - }) - - it('desktop gate hard-blocks during a hard refresh error', () => { - expect( - shouldOpenChecksPanelCreateComposer({ - activeReview: null, - isFolder: false, - branch: 'feature/x', - hostedReviewCreation: eligibility({ canCreate: true }), - hasHardRefreshError: true - }) - ).toBe(false) - }) - it('fails closed on an unavailable review lookup even when eligibility looks ready', () => { // The existing-review lookup could not prove there is no PR; mobile has no // review-lookup signal of its own, so create must be blocked. diff --git a/mobile/src/source-control/source-control-router-seam-census.test.ts b/mobile/src/source-control/source-control-router-seam-census.test.ts deleted file mode 100644 index e34d4ad93d87..000000000000 --- a/mobile/src/source-control/source-control-router-seam-census.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { - callsRouteHandoff, - importsExpoRouterValue, - parse, - productFiles -} from '../navigation/router-seam-census.test-support' - -const SOURCE_CONTROL_ROOT = import.meta.dirname - -/** - * Which modules here hold a router, so the census cannot pass by seeing nothing. - * - * One holder, not one per screen: the hub's router is taken once in the openers hook and passed - * down through the state hook to the runners and the panel. So this domain's whole reach into the - * router is that single call, and the rules below say so rather than counting screens. - * - * `use-mobile-source-control-runners.ts` is the case a value/type rule is written for: it named - * expo-router only to write `ReturnType`, which is a value import in a type - * position and keeps the module in the graph. `RouteHandoff` is the seam's own name for that type. - */ -const ROUTER_HOLDERS = ['use-mobile-source-control-openers.ts'] - -describe('the source-control domain reaches the router through the handoff seam', () => { - const files = productFiles(SOURCE_CONTROL_ROOT) - - it('walks the modules it is written against', () => { - expect(files).toEqual(expect.arrayContaining(ROUTER_HOLDERS)) - expect(files).toContain('use-mobile-source-control-runners.ts') - expect(files).toContain('MobileSourceControlPanel.tsx') - }) - - it('imports no router from expo-router, which the page cannot hand a route back through', () => { - expect( - files.filter((name) => importsExpoRouterValue(parse(SOURCE_CONTROL_ROOT, name))) - ).toEqual([]) - }) - - it('takes the router from useRouteHandoff at every screen that holds one', () => { - expect( - files.filter((name) => callsRouteHandoff(parse(SOURCE_CONTROL_ROOT, name))).sort() - ).toEqual([...ROUTER_HOLDERS].sort()) - }) -}) diff --git a/mobile/src/tasks/mobile-tasks-refactor-parity.test.ts b/mobile/src/tasks/mobile-tasks-refactor-parity.test.ts deleted file mode 100644 index 4eb61e3f1dad..000000000000 --- a/mobile/src/tasks/mobile-tasks-refactor-parity.test.ts +++ /dev/null @@ -1,158 +0,0 @@ -import { createHash } from 'node:crypto' -import { describe, expect, it } from 'vitest' -import { - readFlattenedMobileTasksHookSignatures, - readMobileTasksSemanticSource, - readMobileTasksStyleSource -} from './mobile-tasks-source-family.test-support' -import { readFlattenedMobileTasksRenderTokens } from './mobile-tasks-render-parity.test-support' -import { - readFlattenedMobileTasksCoreStatements, - readMobileTasksDeclarationSignatures -} from './mobile-tasks-execution-parity.test-support' - -const hash = (parts: string[] | string): string => - createHash('sha256') - .update(Array.isArray(parts) ? parts.join('\n') : parts) - .digest('hex') - -// Bound requests change source signatures the same way bound provider, workspace-creation and -// settings requests did: the method string and the envelope read leave the screen and an operation -// name arrives. The behaviour they used to pin is pinned by the recordings in -// mobile/rpc-foundation/goldens instead, which did not move. -// -// The screen-holdout migration takes the last two sends out of this family — the filter sheet's -// linear.selectWorkspace and the screen-root hook's repo.list. Hook, statement, declaration, render -// and style counts are all unchanged, and `semantics` is a pure deletion of four lines, none in: -// two `rpc:` call signatures and the two method literals they carried. The render-token hash moves -// because the picker's handler now names an operation instead of the client. -// -// Step 7's first half moves four of the six again, and moves nothing else. Checked readers on the -// item and list operations delete the reply casts these consumers carried, plus the three shape -// tests the reader now answers for: both `Array.isArray(payload)` guards on the checks read and the -// `typeof count === 'number'` fallback on the item count. Hook, statement, declaration and render -// counts are unchanged, and the render-token hash does not move at all — nothing this family sees -// changed inside a JSX tree. `semantics` is a pure deletion of ten lines. -// -// Round-1 review moves four, and names what each one is. The reaction reader stops matching -// `content` against an arm set mobile invented and forwards it, so `DetailComment` loses the eight -// phantom arms and `COMMENT_REACTION_EMOJI` stops being keyed by them: that is ten string literals -// gone and the `?? ''` fallback's one added, the whole of `semantics`' 3,290 -> 3,281. The eight -// alias-only bindings the deleted casts left behind (`const result = created` and its seven -// siblings) are inlined, which moves the hook and statement hashes without moving their counts. -// Only those eight: the Linear arm of task creation keeps its own `result`, which is a declaration -// with a name rather than an alias for one. -// No `rpc:` signature and no `jsx:` signature moves, the render-token hash does not move, and -// counts stay at 350 hooks, 417 statements and 194 declarations. -// -// The `gitlab.todos` fixture correction moves the same three hashes once more and no others: the -// to-do row is checked now, so the reader's cast is gone from the list-loading hook and the row -// type it forwarded is declared by what the reader proves. Counts are unchanged again, and -// `semantics` does not move, because no RPC call, runtime string or JSX host signature does. -// -// Round 2 moves two, and only because one member widens. `GitHubDetailFile.viewerViewedState` is -// `string` rather than the host's three arms, because the reader forwards it now: that is the -// declaration hash and the three arm literals, `semantics` 3,281 -> 3,278. `status` keeps its arms -// and moves nothing, because its only consumer sends it back as a param the host validates against -// the same set. Hook, statement and render hashes do not move; nothing executable changed. -// -// Step 7's tasks-2 half moves the hook, statement, declaration and semantic hashes once more, for -// the board, runtime, search, workspace-source and workspace-create operations, and moves no count: -// hooks stay at 350, statements at 417, declarations at 194. `semantics` is a pure deletion of four -// lines, 3,278 -> 3,274, and all four are the literals inside the one inline cast type this half -// deletes in use-mobile-tasks-project-detail-loading.tsx — `'DISMISSED'`, `'VIEWED'`, `'UNVIEWED'` -// and the `['status']` index into GitHubDetailFile. No method literal and no `rpc:` call signature -// moves. -// -// The hook and statement hashes also move for comment text alone: `normalized` reads a statement's -// full span, so a comment nested inside one is hashed with it. They move once more when the two -// halves are deduplicated: the project pane's five collection casts and the assignee list's are -// deleted where the entity schemas from the item half now type those rows. -// -// Round 2 of tasks-2 moves the hook and statement hashes a last time, and only those two. One -// statement changes: the Linear list cast (`found as LinearIssue[]`) becomes `found`, because the -// nine members linearIssueRowSchema requires make the value assignable to the mobile alias without -// it. The rest is comment text nested inside statements — three `SAFETY:` lines rewritten to argue -// from the schemas that landed instead of the fixtures round 1 deleted. Counts are unchanged at 350 -// hooks and 417 statements; the declaration, semantic, render and style hashes do not move, which -// is the evidence that deleting the cast changed no type and no call. -// -// The pullfrog pass on the same round moved both once more, again by comment text alone: the -// GitHub search `SAFETY:` line now separates the two members the schema requires (`items`, -// `labels`) from the eight it only types. No statement, type or call changed; counts hold. -// C2.1 swaps the workspace-creation push onto `hostNewWorktreeSessionRoute`, which already built -// this href with both segments encoded. Three of the family move and nothing else does: the hook -// list, because the handler's statements changed shape; the statement hash, for the same reason; -// and `semantics`, which is a pure deletion of two lines — the `URLSearchParams` construction and -// the raw `/h/${hostId}/session/...` template it fed. No RPC call, method literal or JSX host -// signature changed, and the render and style hashes did not move. - -// C2.1 swaps the two clipboard writes onto the platform seam, so the comment-review hook gains one -// hook call and one statement. Two of the family move: the hook list and the statement hash, each -// by one entry. `semantics` does not — no RPC call, method literal or JSX host signature changed — -// and the render and style hashes hold. - -// C2.8 names the status bar's Back control for the shell, which has no native chrome behind it to -// announce one. `accessibilityRole="button"` and `accessibilityLabel="Back"` on that one Pressable -// move the two hashes a JSX prop must move, and only those two. `semantics` 3,272 -> 3,274: the -// element's host signature widens (`jsx:Pressable:style,onPress` -> the same plus the two props) -// and the two new runtime strings `"button"` and `"Back"` arrive. The render-token stream gains -// the eight tokens those two attributes are, 35,195 -> 35,203. No RPC call signature and no method -// literal moves, and the hook, statement, declaration and style hashes do not move at all, which -// is the evidence that nothing executable changed. -// -// The same commit gives that control the `hitSlop={8}` its four siblings carry, so its touch -// target is no longer the glyph alone. One more line of `semantics` changes and no line is added -// or removed — the host signature gains `hitSlop` — so the count holds at 3,274 and only the hash -// moves. The render-token stream gains the four tokens that one attribute is, 35,203 -> 35,207. -// Nothing else in the family moves. - -const SCREEN_RPC_SCREEN_HOOKS = '0f66df2141117dfec2f8a0adb3f598312e6fda8e80833a365a645796f5ab48c3' -const PRE_REFACTOR_DIFF_HOOKS = '93c7189b32bed8456cc51814fffa8ce80cf62011ef968a9d53ddec2b9686f58f' -const SCREEN_RPC_STATEMENTS = 'dd8f33cb3cf96f5c39abac397cb77e35f59079291033a1866ead462b041ab979' -// Saved Linear selections now accept unknown persisted values; reconciliation tests cover them. -const MAIN_REBASED_DECLARATIONS = 'ec77d34712c7c4ab19ac6a4d57878f32d22aba790d2420cc14c2c0f000d120e9' -const SCREEN_RPC_SEMANTICS = 'e07a63387d57106483ee703ec6c19dea593e0eca5c651758f42bcb36254850b7' -// StatusDot's spacing moved to the tasks title row as `gap: spacing.sm`; same 8 px. -const PRE_REFACTOR_STYLES = '11504e9f655d4d45deb25d942158a0ee99a1f98007ad1630bb03e1bdfe1e73de' -const SCREEN_RPC_RENDER_TREE = '086742f95f1e87fb89d8c67ffd9f7a229799ae05115f9f4bcc1a925e56dcc8bb' - -describe('Mobile Tasks refactor parity', () => { - it('preserves recursively flattened hook and dependency order', () => { - const screenHooks = readFlattenedMobileTasksHookSignatures('MobileTasksScreen') - expect(screenHooks).toHaveLength(351) - expect(hash(screenHooks)).toBe(SCREEN_RPC_SCREEN_HOOKS) - - const diffHooks = readFlattenedMobileTasksHookSignatures('GitHubPrFileDiff') - expect(diffHooks).toHaveLength(3) - expect(hash(diffHooks)).toBe(PRE_REFACTOR_DIFF_HOOKS) - }) - - it('preserves every screen statement in execution order', () => { - const statements = readFlattenedMobileTasksCoreStatements() - expect(statements).toHaveLength(418) - expect(hash(statements)).toBe(SCREEN_RPC_STATEMENTS) - }) - - it('preserves every moved top-level declaration', () => { - const declarations = readMobileTasksDeclarationSignatures() - expect(declarations).toHaveLength(194) - expect(hash(declarations)).toBe(MAIN_REBASED_DECLARATIONS) - }) - - it('preserves RPC calls, runtime strings, and JSX host signatures', () => { - const semantics = readMobileTasksSemanticSource() - expect(semantics.split('\n')).toHaveLength(3_274) - expect(hash(semantics)).toBe(SCREEN_RPC_SEMANTICS) - }) - - it('preserves render expressions and event handlers in tree order', () => { - const tokens = readFlattenedMobileTasksRenderTokens() - expect(tokens).toHaveLength(35_207) - expect(hash(tokens)).toBe(SCREEN_RPC_RENDER_TREE) - }) - - it('preserves every StyleSheet property and value', () => { - expect(hash(readMobileTasksStyleSource())).toBe(PRE_REFACTOR_STYLES) - }) -}) diff --git a/mobile/src/terminal/document/document-parse-time-effects.test.ts b/mobile/src/terminal/document/document-parse-time-effects.test.ts index 0acddfb78b3c..86b8433ed148 100644 --- a/mobile/src/terminal/document/document-parse-time-effects.test.ts +++ b/mobile/src/terminal/document/document-parse-time-effects.test.ts @@ -1,13 +1,9 @@ -import { readFileSync } from 'node:fs' import { describe, expect, it } from 'vitest' import { - DECLARATION_KINDS, documentModuleNames, documentModuleSource, exportedLifecycleFunctions, - parseModule, parseTimeEffects, - readsTheDocument, sequenceCalls, topLevelDeclarationsReachAnElement } from '../../test-support/webview-document-census' @@ -71,43 +67,6 @@ describe('the document modules at parse time', () => { } }) - it('would report a planted element read, which the statement filter cannot see', () => { - // The second reader has its own precondition. A `const` initialised from the document is a - // declaration by shape and a parse-time element read by effect — the exact form that survived - // a remount holding the first mount's node — and the statement-kind filter waves it through. - const planted = - "import { scope } from './document-scope'\n" + - "const indicator = document.getElementById('scroll-indicator')\n" + - 'export function n() {\n return indicator ?? scope.term\n}\n' - expect(parseTimeEffects('planted', planted)).toEqual([ - "planted: indicator = document.getElementById('scroll-indicator')" - ]) - // And the element reader the case above spends on every module: the same plant, seen by it. - expect(topLevelDeclarationsReachAnElement('planted', planted)).toBe(true) - // And the other direction, because a reader that flagged every initialiser would agree with - // the empty list above only by refusing everything: a plain literal is not work. - const inert = - "import { scope } from './document-scope'\n" + - 'const options = { capture: true, passive: false }\n' + - 'export function n() {\n return options.capture && scope.term !== null\n}\n' - expect(parseTimeEffects('inert', inert)).toEqual([]) - }) - - it('would report one, so the empty list above is a measurement', () => { - // The precondition. A walk that matched nothing would agree with an empty expectation just as - // happily, so the same reader is aimed at a module that does have a top-level effect: this - // test file itself, whose `describe` call is exactly the shape the rule refuses. - const source = readFileSync( - new URL('./document-parse-time-effects.test.ts', import.meta.url), - 'utf8' - ) - const running = parseModule('probe', source).body.filter( - (statement) => !DECLARATION_KINDS.has(statement.type) - ) - expect(running.length).toBeGreaterThan(0) - expect(readsTheDocument({ type: 'Identifier', name: 'document' })).toBe(true) - }) - it('start and stop: the sequence calls every one there is, and undoes them in reverse', () => { // Moving an effect out is only correct if something calls it, and a count cannot say that: a // module could export a start nobody runs and the count would agree as soon as the literal @@ -120,9 +79,6 @@ describe('the document modules at parse time', () => { MODULES.filter((name) => name !== THE_SEQUENCE).flatMap((name) => exportedLifecycleFunctions(moduleSource(name), keyword, 'TerminalDocumentScope') ) - expect(moduleSource('selection-overlay')).toContain( - 'export function stopSelectionOverlay(scope: TerminalDocumentScope) {\n stopEdgeScroll(scope)' - ) const started = sequenceCallsTo('startTerminalDocument') // `cancelDocumentFrames` is the frame registry's undo rather than a module's stop, and it is @@ -145,12 +101,4 @@ describe('the document modules at parse time', () => { ) expect(sequenceCallsTo('stopTerminalDocument').at(-1)).toBe('cancelDocumentFrames') }) - - it('would name a start the sequence forgot, which is what the comparison above is for', () => { - // The precondition, planted rather than argued: a module that exports a start nobody calls is - // the failure the set comparison exists to catch, and the reader has to say its name. - const planted = sequenceCallsTo('startTerminalDocument') - expect(planted).not.toContain('startReflow') - expect([...planted, 'startReflow'].sort()).not.toEqual(planted.slice().sort()) - }) }) diff --git a/mobile/src/terminal/document/host-seams.test.ts b/mobile/src/terminal/document/host-seams.test.ts index 17d709ddc421..c000062acf0a 100644 --- a/mobile/src/terminal/document/host-seams.test.ts +++ b/mobile/src/terminal/document/host-seams.test.ts @@ -7,7 +7,6 @@ import { notify } from './host-notify' import { flog } from './viewport-transform' import { attachWebglAddon } from './webgl-recovery' import type { TerminalDocumentHost, TerminalViewportChange } from './document-host-seams' -import { documentSourceText } from './document-module-source.test-support' /** * The host seams the page sets, and the window reads and writes they default to. @@ -324,38 +323,4 @@ describe("the document's viewport", () => { window.dispatchEvent(new Event('resize')) expect(scope.panX).toBe(0) }) - - it('is read through the seam everywhere, never off the window directly', () => { - // The default in `document-host-seams.ts` is the one window read, so the census runs over - // every other module; a raw read elsewhere sizes a page terminal to the whole page. - const raw = documentSourceText() - .split('\n') - .filter((line) => /window\.inner(Height|Width)|\binner(Height|Width)\b/.test(line)) - expect(raw).toEqual([ - ' return { left: 0, top: 0, width: window.innerWidth, height: window.innerHeight }' - ]) - }) - - it('maps a client point into the grid only through viewportPoint', () => { - // On the page the host's origin is not the window's, so a client coordinate used against - // anything but another client coordinate lands rows low. Differences of two need no origin. - const arithmetic = documentSourceText() - .split('\n') - .filter((line) => !/^\s*(\*|\/\/)/.test(line)) - .filter((line) => /client[XY]\s*[-+*/<>]|[-+*/<>]=?\s*[\w.[\]]*client[XY]\b/.test(line)) - .map((line) => line.trim()) - .sort() - expect(arithmetic).toEqual([ - 'const dx = Math.abs(e.clientX - gesture.startX)', - 'const dx = Math.abs(mt.clientX - scope.tapCandidate.x)', - 'const dx = Math.abs(t.clientX - scope.longPressOrigin.x)', - 'const dx = a.clientX - b.clientX,', - 'const dy = Math.abs(e.clientY - gesture.startY)', - 'const dy = Math.abs(mt.clientY - scope.tapCandidate.y)', - 'const dy = Math.abs(t.clientY - scope.longPressOrigin.y)', - 'dy = a.clientY - b.clientY', - 'return viewportPoint(scope, (a.clientX + b.clientX) / 2, (a.clientY + b.clientY) / 2)', - 'return { x: clientX - frame.left, y: clientY - frame.top }' - ]) - }) }) diff --git a/mobile/src/terminal/terminal-cell-box-census.test.ts b/mobile/src/terminal/terminal-cell-box-census.test.ts deleted file mode 100644 index ea0e9ece12ca..000000000000 --- a/mobile/src/terminal/terminal-cell-box-census.test.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { readFileSync } from 'node:fs' -import { relative } from 'node:path' -import { fileURLToPath } from 'node:url' -import { describe, expect, it } from 'vitest' -import { censusSourceFiles } from '../test-support/census-source-files' - -const SOURCE_ROOT = fileURLToPath(new URL('..', import.meta.url)) - -// xterm is the only measurer of the cell box. These are the ways to measure a glyph without it, -// matched by technique rather than by name, so a rename cannot hide one. xterm's own code is the -// generated engine, which the walk leaves out. -const GLYPH_MEASUREMENT: [string, RegExp][] = [ - ['canvas text metrics', /\bmeasureText\s*\(/], - ['offscreen canvas', /\bOffscreenCanvas\b/], - ['font bounding box', /\b(font|actual)BoundingBox(Ascent|Descent|Left|Right)\b/] -] -// A probe span: a created span, a run of one glyph, and its laid-out width, all in one file. -const PROBE_SPAN = [ - /createElement\(\s*['"`]span['"`]\s*\)/, - /['"`][A-Za-z0-9]['"`]\s*\.repeat\s*\(/, - /\b(offsetWidth|getBoundingClientRect)\b/ -] - -function productSources(): { path: string; text: string }[] { - return censusSourceFiles(SOURCE_ROOT) - .map((path) => ({ path, name: relative(SOURCE_ROOT, path).replaceAll('\\', '/') })) - .filter(({ name }) => /\.tsx?$/.test(name) && !/\.test\.tsx?$/.test(name)) - .map(({ path, name }) => ({ path: name, text: readFileSync(path, 'utf8') })) -} - -function glyphMeasurements(text: string): string[] { - const found = GLYPH_MEASUREMENT.filter(([, pattern]) => pattern.test(text)).map(([kind]) => kind) - return PROBE_SPAN.every((pattern) => pattern.test(text)) ? [...found, 'probe span'] : found -} - -describe('the cell box has one measurer', () => { - it('walks the product sources, including the document that reports the box', () => { - const paths = productSources().map((source) => source.path) - expect(paths).toContain('terminal/document/laid-out-cell-box.ts') - expect(paths).toContain('terminal/document/terminal-init.ts') - }) - - it('recognises each technique it fences', () => { - expect(glyphMeasurements("ctx.measureText('W')")).toEqual(['canvas text metrics']) - expect(glyphMeasurements('new OffscreenCanvas(1, 1)')).toEqual(['offscreen canvas']) - expect(glyphMeasurements('m.fontBoundingBoxAscent + m.fontBoundingBoxDescent')).toEqual([ - 'font bounding box' - ]) - expect( - glyphMeasurements( - "const s = document.createElement('span'); s.textContent = 'W'.repeat(32); s.offsetWidth" - ) - ).toEqual(['probe span']) - }) - - it('has no file under mobile/src measure a glyph outside xterm', () => { - const found = productSources().flatMap(({ path, text }) => - glyphMeasurements(text).map((kind) => `${path}: ${kind}`) - ) - expect(found).toEqual([]) - }) -}) diff --git a/mobile/src/terminal/terminal-foreground-recovery.test.ts b/mobile/src/terminal/terminal-foreground-recovery.test.ts index abf1bd01045f..50fcda6ec52d 100644 --- a/mobile/src/terminal/terminal-foreground-recovery.test.ts +++ b/mobile/src/terminal/terminal-foreground-recovery.test.ts @@ -2,23 +2,12 @@ import type { RefObject } from 'react' import { describe, expect, it, vi } from 'vitest' import type { ConnectionState } from '../transport/types' import type { TerminalWebViewHandle } from './TerminalWebView' -import { readMobileSessionRouteSource } from '../session/mobile-session-route-source-family.test-support' import { TERMINAL_FOREGROUND_RECOVERY_DELAY_MS, recoverActiveTerminalAfterForeground, shouldRecoverTerminalOnAppStateChange } from './terminal-foreground-recovery' -const lifecycleSource = readMobileSessionRouteSource('../session/use-mobile-session-lifecycle.ts') - -function sliceSessionSource(startPattern: string, endPattern: string): string { - const start = lifecycleSource.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = lifecycleSource.indexOf(endPattern, start) - expect(end).toBeGreaterThan(start) - return lifecycleSource.slice(start, end) -} - type RecoveryHarness = { activeHandleRef: RefObject terminalRefs: RefObject> @@ -139,37 +128,4 @@ describe('terminal foreground recovery', () => { expect(harness.subscribeToTerminal).not.toHaveBeenCalled() }) - - it('is wired to AppState foregrounding in the session screen', () => { - const foregroundPredicate = sliceSessionSource( - 'const shouldRecover = shouldRecoverTerminalOnAppStateChange(', - 'previousAppState = nextAppState' - ) - - expect(lifecycleSource).toContain('shouldRecoverTerminalOnAppStateChange') - expect(foregroundPredicate).toContain('Platform.OS') - expect(lifecycleSource).toContain('recoverActiveTerminalAfterForeground({') - expect(lifecycleSource).toContain("AppState.addEventListener('change'") - const readinessInvalidation = lifecycleSource.indexOf( - 'terminalRef.prepareForForegroundRecovery()' - ) - const replay = lifecycleSource.indexOf('recoverActiveTerminalAfterForeground({') - expect(readinessInvalidation).toBeGreaterThanOrEqual(0) - expect(replay).toBeGreaterThan(readinessInvalidation) - }) - - it('re-runs a deferred recovery once the session screen reconnects', () => { - // Why: resume usually lands mid-reconnect; the session screen must retry - // recovery on the connState→connected transition or blanked panes stay - // stale until a manual tab switch. - expect(lifecycleSource).toContain( - "pendingForegroundRecoveryRef.current = outcome === 'deferred'" - ) - const reconnectRetry = sliceSessionSource( - "if (connState !== 'connected' || !pendingForegroundRecoveryRef.current)", - 'recoverActiveTerminalAfterForeground({' - ) - expect(reconnectRetry).toContain('pendingForegroundRecoveryRef.current = false') - expect(reconnectRetry).toContain("AppState.currentState !== 'active'") - }) }) diff --git a/mobile/src/terminal/terminal-input-connection-gate.test.ts b/mobile/src/terminal/terminal-input-connection-gate.test.ts index 4d55c31bcf4d..747f0eaab4c7 100644 --- a/mobile/src/terminal/terminal-input-connection-gate.test.ts +++ b/mobile/src/terminal/terminal-input-connection-gate.test.ts @@ -1,28 +1,6 @@ import { describe, expect, it } from 'vitest' import { resolveMobileTerminalInputGate } from './terminal-input-connection-gate' import { buildTerminalSendParams, TERMINAL_INPUT_SEND_OPTIONS } from './terminal-send-request' -import { readMobileSessionRouteSource } from '../session/mobile-session-route-source-family.test-support' - -const runtimeSource = readMobileSessionRouteSource( - '../session/use-mobile-session-terminal-runtime.ts' -) -const sendActionsSource = readMobileSessionRouteSource( - '../session/use-mobile-session-terminal-send-actions.ts' -) -const terminalInputSource = readMobileSessionRouteSource( - '../session/use-mobile-session-terminal-input.ts' -) -const commandDockSource = readMobileSessionRouteSource('../session/MobileSessionCommandDock.tsx') - -function sourceSlice(source: string, anchorStart: string, anchorEnd: string): string { - const start = source.indexOf(anchorStart) - expect(start).toBeGreaterThanOrEqual(0) - // Why: a duplicated start anchor would silently slice the wrong region. - expect(source.indexOf(anchorStart, start + 1)).toBe(-1) - const end = source.indexOf(anchorEnd, start) - expect(end).toBeGreaterThan(start) - return source.slice(start, end + anchorEnd.length) -} describe('terminal input connection gate', () => { it('Given a live connection on a terminal tab Then composing and sending are both allowed', () => { @@ -83,74 +61,9 @@ describe('terminal input connection gate', () => { }) }) -describe('session route offline-compose wiring', () => { - it('derives both gates from the shared resolver', () => { - expect(runtimeSource).toContain('resolveMobileTerminalInputGate({') - }) - - it('keeps the buffered command box editable offline while the live capture stays send-gated', () => { - const bufferedInput = sourceSlice( - commandDockSource, - 'ref={bindCommandField}', - 'onSubmitEditing={() => void handleSend()}' - ) - expect(bufferedInput).toContain('editable={canCompose}') - - const liveCapture = sourceSlice( - commandDockSource, - 'ref={bindLiveInputField}', - 'importantForAutofill="no"' - ) - expect(liveCapture).toContain('editable={canSend}') - }) - - it('keeps the send button connection-gated so held text cannot fire into a dead link', () => { - const sendButton = sourceSlice( - commandDockSource, - 'styles.sendButton,', - 'accessibilityLabel="Send command"' - ) - expect(sendButton).toContain('disabled={!canSend}') - }) - - it('holds composed text when the return key submits offline', () => { - const handleSend = sourceSlice( - sendActionsSource, - 'async function handleSend()', - 'sendingRef.current = true' - ) - expect(handleSend).toContain('!canSend') - }) - - it('keeps the live/buffered mode toggle reachable offline', () => { - const modeToggle = sourceSlice( - commandDockSource, - 'liveInputEnabled && styles.accessoryKeyActive', - 'onPress={toggleLiveInput}' - ) - expect(modeToggle).toContain('disabled={!canCompose}') - }) - - it('tells the live-input commit hook about connection loss so stale mirror state resets', () => { - const hookCall = sourceSlice( - runtimeSource, - 'useTerminalLiveInputCommit({', - 'setLiveInputCapture' - ) - expect(hookCall).toContain("connected: connState === 'connected'") - }) - +describe('terminal send request shape', () => { it('keeps every keystroke-grade terminal send now-or-never so nothing replays after reconnect', () => { - // Live mirror, buffered send, and gesture arrows must all opt out of the - // connect wait — a parked send replays stale bytes into the PTY. Accessory - // keys get the same option inside terminal-live-accessory-raw-send.ts. - expect(sendActionsSource).toContain('TERMINAL_INPUT_SEND_OPTIONS') - expect(terminalInputSource).toContain('TERMINAL_INPUT_SEND_OPTIONS') - const optionUses = [sendActionsSource, terminalInputSource].flatMap( - (source) => source.match(/TERMINAL_INPUT_SEND_OPTIONS/g) ?? [] - ).length - // Two owner imports plus one buffered, one live, and one gesture send. - expect(optionUses).toBe(5) + // A parked send replays stale bytes into the PTY once the socket comes back. expect(TERMINAL_INPUT_SEND_OPTIONS).toEqual({ failWhenDisconnected: true }) }) diff --git a/mobile/src/terminal/terminal-ios-dictation-write-back.test.ts b/mobile/src/terminal/terminal-ios-dictation-write-back.test.ts deleted file mode 100644 index 9929f09c37dd..000000000000 --- a/mobile/src/terminal/terminal-ios-dictation-write-back.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readMobileSessionRouteSource } from '../session/mobile-session-route-source-family.test-support' - -const commandDockSource = readMobileSessionRouteSource('../session/MobileSessionCommandDock.tsx') -const sendActionsSource = readMobileSessionRouteSource( - '../session/use-mobile-session-terminal-send-actions.ts' -) - -// Why: iOS terminates an active keyboard-dictation (and IME) session whenever -// JS writes a value into the focused field that differs from the native text -// (RN applies it via setTextAndSelection / _setAttributedString). Terminal -// inputs therefore must echo the raw field text in their controlled value and -// apply dash normalization only on the send/mirror path. See stablyai/orca#7925. -describe('terminal iOS dictation write-back', () => { - it('does not write normalized text back into the buffered command input value', () => { - expect(commandDockSource).toContain('onChangeText={bufferedTerminalDraftState.setInput}') - expect(commandDockSource).not.toContain('setInput((previousText) => normalizeTerminalTextInput') - }) - - it('still normalizes the buffered command text at send time', () => { - expect(sendActionsSource).toContain('normalizeTerminalTextInput(draft)') - }) -}) diff --git a/mobile/src/terminal/terminal-ios-ime-keyboard.test.ts b/mobile/src/terminal/terminal-ios-ime-keyboard.test.ts deleted file mode 100644 index 573dcf04bbf5..000000000000 --- a/mobile/src/terminal/terminal-ios-ime-keyboard.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readMobileSessionRouteSource } from '../session/mobile-session-route-source-family.test-support' - -const commandDockSource = readMobileSessionRouteSource('../session/MobileSessionCommandDock.tsx') - -describe('terminal iOS IME keyboard', () => { - it('does not force terminal inputs onto the ASCII-only iOS keyboard', () => { - expect(commandDockSource).not.toContain("'ascii-capable'") - expect(commandDockSource).not.toContain('"ascii-capable"') - }) - - it('subscribes live capture to onChange so the marked-text report survives', () => { - // onChangeText hands over only a string, discarding the preedit report that - // decides whether the text may reach the PTY at all. - expect(commandDockSource).toContain('onChange={handleLiveInputChange}') - expect(commandDockSource).not.toContain('onChangeText={handleLiveInputChange}') - }) - - it('does not put terminal keyboard capture behind iOS textContentType semantics', () => { - expect(commandDockSource).not.toContain('textContentType="none"') - expect(commandDockSource).toContain('autoComplete="off"') - }) -}) diff --git a/mobile/src/terminal/terminal-keyboard-avoidance-webview.test.ts b/mobile/src/terminal/terminal-keyboard-avoidance-webview.test.ts index 89830162921d..40a03d145924 100644 --- a/mobile/src/terminal/terminal-keyboard-avoidance-webview.test.ts +++ b/mobile/src/terminal/terminal-keyboard-avoidance-webview.test.ts @@ -2,7 +2,6 @@ import { Terminal } from '@xterm/xterm' import { describe, expect, it, vi } from 'vitest' import { createTerminalDocumentScope } from './document/document-scope' -import { documentModuleSource } from './document/document-module-source.test-support' import { emitKeyboardAvoidanceMetrics } from './document/keyboard-avoidance-metrics' import { commitFitScale } from './document/fit-scale' import { parseTerminalKeyboardAvoidanceMetrics } from './terminal-webview-contract' @@ -193,45 +192,6 @@ describe('terminal keyboard-avoidance WebView metrics', () => { }) }) - it('refreshes metrics after every buffer geometry reset', () => { - // Four places change the buffer's geometry, and each owes a fresh emit after it: a stale - // content-bottom row is what lifts the keyboard over the wrong line. Read from each module's - // own source, so a fifth site added in a new module is not silently uncovered. - // A text-scale resize reports through the fit it schedules, whose commit emits (pinned below). - const directEmit = 'emitKeyboardAvoidanceMetrics(scope)' - const blocks = [ - ['terminal-init', 'export function resize(', directEmit], - ['reflow', 'export function reflow(', directEmit], - ['host-message-router', "} else if (msg.type === 'clear') {", directEmit], - ['text-scaling', 'export function applyTextScale(', 'applyFitScale(scope'] - ] as const - - for (const [module, opener, emit] of blocks) { - const source = documentModuleSource(module) - const start = source.indexOf(opener) - expect(start, `${module} no longer carries ${opener}`).toBeGreaterThanOrEqual(0) - const block = source.slice(start, source.indexOf('\n}', start)) - const emitAt = block.lastIndexOf(emit) - const geometryAt = block.includes('.resize(') - ? block.indexOf('.resize(') - : block.indexOf('.reset(') - expect(emitAt, `${module} does not emit metrics`).toBeGreaterThanOrEqual(0) - expect(emitAt, `${module} emits before it resizes`).toBeGreaterThan(geometryAt) - } - }) - - it('reports a text-scale change only through the fit it commits', () => { - // One emit site: a pinch release and a settings change both end in the fit commit, so the - // release carries no emit of its own and needs no word back on whether a refit is pending. - const textScaling = documentModuleSource('text-scaling') - const start = textScaling.indexOf('export function applyTextScale(') - const applyTextScale = textScaling.slice(start, textScaling.indexOf('\n}', start)) - expect(applyTextScale).not.toMatch(/return (true|false)/) - expect(documentModuleSource('surface-touch-gestures')).not.toContain( - 'emitKeyboardAvoidanceMetrics' - ) - }) - it('reports the row pitch as drawn, fit scale included, and none before a cell is measured', () => { // Desktop display mode keeps the desktop's rows and the fit shrinks the grid by width. const buffer = { cursorY: 0, viewportY: 0, type: 'normal', getLine: () => undefined } diff --git a/mobile/src/terminal/terminal-live-input-affordance.test.ts b/mobile/src/terminal/terminal-live-input-affordance.test.ts deleted file mode 100644 index 565b355d7716..000000000000 --- a/mobile/src/terminal/terminal-live-input-affordance.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readFileSync } from 'node:fs' -import { readMobileSessionRouteSource } from '../session/mobile-session-route-source-family.test-support' - -const commandDockSource = readMobileSessionRouteSource('../session/MobileSessionCommandDock.tsx') -const terminalRuntimeSource = readMobileSessionRouteSource( - '../session/use-mobile-session-terminal-runtime.ts' -) -const nativeChatSource = readMobileSessionRouteSource( - '../session/use-mobile-session-native-chat-dictation.ts' -) -const liveInputStatusSource = readFileSync( - new URL('../session/MobileTerminalLiveInputStatus.tsx', import.meta.url), - 'utf8' -) -const commandInputStylesSource = readFileSync( - new URL('../session/mobile-session-command-input-styles.ts', import.meta.url), - 'utf8' -) -const liveInputFocusSource = readFileSync( - new URL('./use-terminal-live-input-focus.ts', import.meta.url), - 'utf8' -) -const sendCompletionGenerationSource = readFileSync( - new URL('../session/use-mobile-send-completion-generation.ts', import.meta.url), - 'utf8' -) - -function liveInputBarBlock(): string { - const start = commandDockSource.indexOf('{liveInputEnabled ? (') - expect(start).toBeGreaterThanOrEqual(0) - const end = commandDockSource.indexOf(') : (', start) - expect(end).toBeGreaterThan(start) - return commandDockSource.slice(start, end) -} - -describe('terminal live input affordance', () => { - it('keeps the live status row wired as the keyboard focus control', () => { - const block = liveInputBarBlock() - - expect(block).toContain('onPress={focusLiveInput}') - expect(block).toContain('accessibilityRole="button"') - expect(block).toContain('accessibilityLabel="Show keyboard for live terminal input"') - expect(block).toContain( - 'accessibilityHint="Typed text is sent directly to the active terminal"' - ) - expect(block).toContain('pressed && styles.liveInputFocusTargetPressed') - expect(block).toContain('!canSend && styles.liveInputFocusTargetDisabled') - expect(block).toContain('showSoftInputOnFocus') - expect(block).toContain('liveInputText={liveInputCapture}') - expect(terminalRuntimeSource).toContain('useTerminalLiveInputFocus({') - expect(nativeChatSource).toContain('useMobileSendCompletionGeneration({') - expect(nativeChatSource).toContain('onBlur: resetLiveInputFocus') - expect(sendCompletionGenerationSource).toContain('return () => {') - expect(sendCompletionGenerationSource).toContain('onBlur()') - expect(liveInputFocusSource).toContain('focusTerminalLiveInputTarget(inputRef.current') - expect(liveInputFocusSource).toContain('lifecycleIdentity,') - expect(liveInputFocusSource).toContain('resetLiveInputFocus') - expect(liveInputFocusSource).toContain('keyboardHeight: context.keyboardHeight') - expect(liveInputFocusSource).toContain( - 'scheduleTerminalLiveInputFocus(timerRef, focusLiveInput)' - ) - }) - - it('makes the live keyboard target visible instead of status-only chrome', () => { - expect(liveInputStatusSource).toContain("'Tap to show keyboard'") - expect(liveInputStatusSource).toContain("liveInputText || 'Tap to show keyboard'") - expect(liveInputStatusSource).toContain('ellipsizeMode="head"') - expect(commandInputStylesSource).toContain('backgroundColor: colors.bgRaised') - expect(commandInputStylesSource).toContain('borderWidth: 1') - expect(commandInputStylesSource).toContain('liveInputFocusTargetPressed') - }) -}) diff --git a/mobile/src/terminal/terminal-viewport-refit.test.ts b/mobile/src/terminal/terminal-viewport-refit.test.ts index 9b8a5b24b0e4..51a349175be3 100644 --- a/mobile/src/terminal/terminal-viewport-refit.test.ts +++ b/mobile/src/terminal/terminal-viewport-refit.test.ts @@ -1,59 +1,15 @@ -import { readFileSync } from 'node:fs' import { describe, expect, it } from 'vitest' import type { RpcResponse } from '../transport/types' -import { readMobileSessionRouteSource } from '../session/mobile-session-route-source-family.test-support' import { terminalViewportUpdate } from './mobile-terminal-operations' import { isTerminalViewportRefitTargetCurrent, reduceTerminalFrameHeightRefit, resolveTerminalUpdateViewportCapability, type TerminalFrameHeightRefitEvent, - type TerminalFrameHeightRefitState, - type TerminalUpdateViewportCapability + type TerminalFrameHeightRefitState } from './terminal-viewport-refit-state' -const hookSource = readFileSync(new URL('./terminal-viewport-refit.ts', import.meta.url), 'utf8') -const sessionSource = [ - readMobileSessionRouteSource('../session/use-mobile-session-keyboard-state.ts'), - readMobileSessionRouteSource('../session/MobileSessionActiveContent.tsx'), - readMobileSessionRouteSource('../session/use-mobile-session-terminal-webview.ts') -].join('\n') - describe('terminal viewport refit', () => { - it('refits when the window dimensions change (fold/unfold, rotation)', () => { - // Why: a PTY fitted on the folded cover screen must be re-measured when - // the window grows, or the terminal renders in a fraction of the display. - expect(hookSource).toContain('useWindowDimensions()') - const start = hookSource.indexOf('const { width: windowWidth, height: windowHeight }') - expect(start).toBeGreaterThanOrEqual(0) - const resizeEffect = hookSource.slice(start) - expect(resizeEffect).toContain('viewportMeasuredRef.current = false') - expect(resizeEffect).toContain('scheduleViewportRefit()') - expect(resizeEffect).toContain( - '[windowWidth, windowHeight, viewportMeasuredRef, scheduleViewportRefit]' - ) - }) - - it('still refits when the tab strip toggles visibility', () => { - const start = hookSource.indexOf('const prevTabStripVisibleRef') - expect(start).toBeGreaterThanOrEqual(0) - const tabEffect = hookSource.slice(start, hookSource.indexOf('useWindowDimensions()')) - expect(tabEffect).toContain('viewportMeasuredRef.current = false') - expect(tabEffect).toContain('scheduleViewportRefit()') - }) - - it('refits the PTY when terminal text scale changes', () => { - // Why: mobile text size must change the real PTY grid, not just scale pixels - // in the WebView, or wrapped CLI output diverges from what the shell sees. - const start = hookSource.indexOf('const prevTextScaleRef = useRef(textScale)') - expect(start).toBeGreaterThanOrEqual(0) - const textScaleEffect = hookSource.slice(start, start + 600) - expect(textScaleEffect).toContain('prevTextScaleRef.current === textScale') - expect(textScaleEffect).toContain('viewportMeasuredRef.current = false') - expect(textScaleEffect).toContain('scheduleViewportRefit()') - expect(textScaleEffect).toContain('[textScale, viewportMeasuredRef, scheduleViewportRefit]') - }) - it('coalesces keyboard-visible frame-height churn into one refit after close', () => { let state: TerminalFrameHeightRefitState = { frameHeight: 600, @@ -84,17 +40,6 @@ describe('terminal viewport refit', () => { expect(refitCount).toBe(2) }) - it('routes imperative height notifications through the keyboard-aware reducer', () => { - const start = hookSource.indexOf('const notifyFrameHeightRefitEvent = useCallback(') - expect(start).toBeGreaterThanOrEqual(0) - const notifier = hookSource.slice(start, start + 1_300) - expect(notifier).toContain('reduceTerminalFrameHeightRefit(') - expect(notifier).toContain("{ type: 'frame-height', height }") - expect(notifier).toContain("{ type: 'keyboard-visibility', visible }") - expect(notifier).toContain('viewportMeasuredRef.current = false') - expect(notifier).toContain('scheduleViewportRefit({ heightOriginated: true })') - }) - it('re-defers a height refit if the keyboard reopens before the debounce fires', () => { // Settle while the keyboard is up -> deferred (pending), no refit. let r = reduceTerminalFrameHeightRefit( @@ -126,95 +71,6 @@ describe('terminal viewport refit', () => { expect(ran.state.pending).toBe(false) }) - it('re-checks the keyboard at fire time only for height-originated refits', () => { - const start = hookSource.indexOf('refitTimerRef.current = setTimeout(') - expect(start).toBeGreaterThanOrEqual(0) - const timerBody = hookSource.slice(start, start + 900) - // The height flag scopes the guard; forced/width refits stay unguarded. - expect(timerBody).toContain('if (heightOriginatedRefitRef.current)') - expect(timerBody).toContain("type: 'refit-committed'") - expect(timerBody).toContain('if (!decision.shouldRefit)') - }) - - it('suppresses refits while native chat covers the active terminal', () => { - // Why: native chat renders the transcript, not the grid — a refit there would - // reflow the desktop PTY to phone dims the user never sees. - const timerStart = hookSource.indexOf('refitTimerRef.current = setTimeout(') - const coveredCheck = hookSource.indexOf('if (nativeChatCoveredRef.current)', timerStart) - const fitIndex = hookSource.indexOf('ref.fitDimensions(', timerStart) - expect(timerStart).toBeGreaterThanOrEqual(0) - expect(coveredCheck).toBeGreaterThan(timerStart) - expect(fitIndex).toBeGreaterThan(coveredCheck) - expect(sessionSource).toContain('nativeChatCoveredRef: showNativeChatRef') - }) - - it('is wired into the session screen', () => { - expect(sessionSource).toContain('useTerminalViewportRefit({') - expect(sessionSource).toContain('tabStripVisible: terminals.length > 1') - expect(sessionSource).toContain('textScale: terminalTextScale') - expect(sessionSource).toContain('connState,') - expect(sessionSource).toContain('notifyTerminalFrame({ width, height })') - expect(sessionSource).toContain('notifyTerminalFrameHeight(Math.round(frame.height))') - expect(sessionSource).toContain('notifyTerminalFrameWidth()') - // One seam for both facts: they come apart for a floating keyboard, which is open yet covers - // nothing the screen has to lift for. - expect(sessionSource).toContain('const softKeyboard = useSoftKeyboard()') - expect(sessionSource).toContain('notifyKeyboardVisibility(softKeyboard.visible)') - expect(sessionSource).toContain('setKeyboardHeight(softKeyboard.height)') - }) - - it('does not rerender SessionScreen for frame-height-only layout changes', () => { - // The imperative notifier keeps a dock-settling burst off React's render path. - expect(sessionSource).not.toContain('setTerminalFrameHeight') - expect(sessionSource).not.toContain('const [terminalFrameHeight,') - }) - - it('defers height-only window resizes while the keyboard is visible', () => { - const start = hookSource.indexOf('const prevWindowDimsRef') - const windowEffect = hookSource.slice(start, start + 1_100) - expect(windowEffect).toContain( - 'prev.width === windowWidth && frameHeightRefitStateRef.current.keyboardVisible' - ) - }) - - it('forces a refit on iOS foreground and connection recovery', () => { - const foregroundEffect = hookSource.slice( - hookSource.indexOf("if (Platform.OS !== 'ios')"), - hookSource.indexOf('const previousConnStateRef') - ) - const reconnectEffect = hookSource.slice( - hookSource.indexOf('const previousConnStateRef'), - hookSource.indexOf('disposedRef.current = false') - ) - - expect(foregroundEffect).toContain("AppState.addEventListener('change'") - expect(foregroundEffect).toContain('viewportMeasuredRef.current = false') - expect(foregroundEffect).toContain('scheduleForcedViewportRefit()') - expect(reconnectEffect).toContain("connState !== 'connected'") - expect(reconnectEffect).toContain('viewportMeasuredRef.current = false') - expect(reconnectEffect).toContain('scheduleForcedViewportRefit()') - }) - - it('bypasses the equal-dimensions guard for resume and reconnect refits', () => { - expect(hookSource).toContain('const forceRefit = forceNextRefitRef.current') - expect(hookSource).toContain( - 'if (!forceRefit && prev && prev.cols === dims.cols && prev.rows === dims.rows)' - ) - const forceRead = hookSource.indexOf('const forceRefit = forceNextRefitRef.current') - const updateViewport = hookSource.indexOf('terminalViewportUpdate.request(rpc,') - expect(forceRead).toBeGreaterThanOrEqual(0) - expect(updateViewport).toBeGreaterThan(forceRead) - }) - - it('prefers the in-place updateViewport RPC over resubscribe', () => { - const rpcIndex = hookSource.indexOf('terminalViewportUpdate.request(rpc,') - const cacheUpdateIndex = hookSource.indexOf('updateTerminalSubscriptionViewport(handle, dims)') - const resubscribeIndex = hookSource.indexOf('subscribeToTerminal(handle)') - expect(rpcIndex).toBeGreaterThanOrEqual(0) - expect(cacheUpdateIndex).toBeGreaterThan(rpcIndex) - expect(resubscribeIndex).toBeGreaterThan(rpcIndex) - }) - it('falls back to legacy resubscribe when an older desktop lacks updateViewport', () => { const unsupported = { id: 'old-host', @@ -229,52 +85,8 @@ describe('terminal viewport refit', () => { error: { code: 'temporary_failure', message: 'retryable' } }) ).toBe('unknown') - - let capability: TerminalUpdateViewportCapability = 'unknown' - let probeCount = 0 - for (let refit = 0; refit < 10; refit += 1) { - if (capability === 'unsupported') { - continue - } - probeCount += 1 - capability = resolveTerminalUpdateViewportCapability(unsupported) - } - expect(probeCount).toBe(1) - - const responseCheckIndex = hookSource.indexOf('if (outcome?.updated)') - const unsubscribeIndex = hookSource.indexOf('unsubscribeTerminal(handle)', responseCheckIndex) - const subscribeIndex = hookSource.indexOf('subscribeToTerminal(handle)', unsubscribeIndex) - expect(responseCheckIndex).toBeGreaterThanOrEqual(0) - expect(unsubscribeIndex).toBeGreaterThan(responseCheckIndex) - expect(subscribeIndex).toBeGreaterThan(unsubscribeIndex) - expect(hookSource).toContain("updateViewportCapabilityRef.current !== 'unsupported'") - expect(hookSource).toContain("updateViewportCapabilityRef.current = 'unknown'") - }) - - it('reflows the local xterm scrollback after a successful updateViewport', () => { - // Why: updateViewport may only record an informational mobile viewport in - // desktop mode. Reflow local scrollback only after the server says it - // actually applied phone-fit to the PTY. - const appliedIndex = hookSource.indexOf('if (outcome.applied)') - const reflowIndex = hookSource.indexOf('ref.reflow(dims.cols, dims.rows, frame)') - const cacheUpdateIndex = hookSource.indexOf('updateTerminalSubscriptionViewport(handle, dims)') - // Assert each anchor exists before ordering: a missing marker yields -1 and would - // let the ordering comparisons pass vacuously. - expect(appliedIndex).toBeGreaterThanOrEqual(0) - expect(cacheUpdateIndex).toBeGreaterThanOrEqual(0) - expect(reflowIndex).toBeGreaterThanOrEqual(0) - expect(reflowIndex).toBeGreaterThan(appliedIndex) - expect(reflowIndex).toBeGreaterThan(cacheUpdateIndex) - }) - - it('checks refit freshness after updateViewport resolves before side effects', () => { - // Why: rapid dock/sidebar resizing can complete RPCs out of order; a stale - // response must not update the viewport cache or locally reflow the old dims. - const responseIndex = hookSource.indexOf('terminalViewportUpdate.request(rpc,') - const postRpcCurrentIndex = hookSource.indexOf('if (!isCurrentTarget())', responseIndex) - const cacheUpdateIndex = hookSource.indexOf('updateTerminalSubscriptionViewport(handle, dims)') - expect(postRpcCurrentIndex).toBeGreaterThan(responseIndex) - expect(postRpcCurrentIndex).toBeLessThan(cacheUpdateIndex) + // A method_not_found refusal latches the capability, so a refit stops re-probing. + expect(resolveTerminalUpdateViewportCapability(unsupported)).toBe('unsupported') }) it('only treats updateViewport as applied when the runtime updated the subscriber', () => { diff --git a/mobile/src/terminal/terminal-webview-consumer-census.test.ts b/mobile/src/terminal/terminal-webview-consumer-census.test.ts deleted file mode 100644 index cb57e4a47558..000000000000 --- a/mobile/src/terminal/terminal-webview-consumer-census.test.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { readFileSync, readdirSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -/** - * Nothing above the terminal component knows which of the two it has. - * - * The page's `TerminalWebView.web.tsx` is resolved by the bundler, not chosen by a caller, so the - * whole substitution rests on every consumer holding only `terminal-webview-contract` — the props - * and the handle — and on the one that renders the component naming it without an extension. A - * consumer that reached into `TerminalWebView.tsx` for a type, or imported `terminal-webview-html` - * for the document string, would work natively and break on the page in a way no native test sees. - * - * Scanned rather than listed, so a new consumer joins the rule by existing. - */ - -const terminalDir = import.meta.dirname -const sessionDir = join(terminalDir, '..', 'session') - -/** The modules that may reach into the component's own file or the document's HTML. */ -const ALLOWED_INSIDE_TERMINAL = new Set([ - 'TerminalWebView.tsx', - 'TerminalWebView.web.tsx', - 'terminal-web-document-mount.ts', - 'terminal-webview-html.ts', - 'terminal-webview-html.web.ts', - // Test scaffolding that drives the document's own modules; it is not shipped in either build. - 'terminal-webview-mouse-test-harness.ts' -]) - -const FORBIDDEN_ABOVE_THE_CONTRACT = [ - /from '(\.\.\/terminal|\.)\/TerminalWebView\.(web\.)?tsx?'/, - /from '(\.\.\/terminal|\.)\/terminal-webview-html'/, - /from '(\.\.\/terminal|\.)\/terminal-webview-engine(-css)?\.generated'/, - /from '(\.\.\/terminal|\.)\/document\// -] - -function productModules(directory: string): string[] { - return readdirSync(directory) - .filter((name) => /\.tsx?$/.test(name)) - .filter((name) => !name.includes('.test') && !name.includes('.test-support')) - .sort() -} - -function offenders(directory: string, skip: (name: string) => boolean): string[] { - const found: string[] = [] - for (const name of productModules(directory)) { - if (skip(name)) { - continue - } - const source = readFileSync(join(directory, name), 'utf8') - for (const pattern of FORBIDDEN_ABOVE_THE_CONTRACT) { - if (pattern.test(source)) { - found.push(`${name}: ${pattern.source}`) - } - } - } - return found -} - -describe('the terminal component contract', () => { - it('is all that src/session imports of the terminal', () => { - expect(offenders(sessionDir, () => false)).toEqual([]) - // The precondition: a scan that read no session module would report nothing either. - const rendering = readFileSync(join(sessionDir, 'TerminalPaneView.tsx'), 'utf8') - expect(rendering).toContain("from '../terminal/TerminalWebView'") - expect(rendering).toContain("from '../terminal/terminal-webview-contract'") - }) - - it('is all that the terminal directory itself imports, outside the component and its document', () => { - expect(offenders(terminalDir, (name) => ALLOWED_INSIDE_TERMINAL.has(name))).toEqual([]) - expect(productModules(terminalDir).length).toBeGreaterThan(40) - }) - - it('would report a consumer that named the component file', () => { - // The scan tested on the text it is meant to refuse, so an empty offender list above is a - // measurement rather than a regex that matches nothing. - const planted = "import { TerminalWebView } from '../terminal/TerminalWebView.tsx'\n" - expect(FORBIDDEN_ABOVE_THE_CONTRACT.some((pattern) => pattern.test(planted))).toBe(true) - const html = "import { XTERM_HTML } from '../terminal/terminal-webview-html'\n" - expect(FORBIDDEN_ABOVE_THE_CONTRACT.some((pattern) => pattern.test(html))).toBe(true) - const extensionless = "import { TerminalWebView } from '../terminal/TerminalWebView'\n" - expect(FORBIDDEN_ABOVE_THE_CONTRACT.some((pattern) => pattern.test(extensionless))).toBe(false) - }) -}) diff --git a/mobile/src/terminal/terminal-webview-engine.test.ts b/mobile/src/terminal/terminal-webview-engine.test.ts index 3f3aab326fec..96a4327f0908 100644 --- a/mobile/src/terminal/terminal-webview-engine.test.ts +++ b/mobile/src/terminal/terminal-webview-engine.test.ts @@ -1,6 +1,4 @@ // @vitest-environment happy-dom -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { Script } from 'node:vm' import { parse } from 'acorn' import { describe, expect, it, vi } from 'vitest' @@ -8,15 +6,8 @@ import { XTERM_ENGINE_CSS } from './terminal-webview-engine-css.generated' import { XTERM_ENGINE_JS } from './terminal-webview-engine.generated' import { createTerminalDocumentScope } from './document/document-scope' import { attachWebglAddon, startWebglRecovery } from './document/webgl-recovery' -import { - documentModuleSource, - documentSourceText -} from './document/document-module-source.test-support' import { XTERM_HTML } from './terminal-webview-html' -// The document's own source, so a rule about what the document does is read where it is written. -const terminalHtmlSource = documentSourceText() - function createWebglRecoveryHarness(failSecondAttach = false) { const timers: Array<() => void> = [] const addons: Array<{ @@ -151,58 +142,6 @@ describe('terminal WebView bundled engine', () => { expect(XTERM_ENGINE_CSS).not.toMatch(/<\/style/i) }) - it('reports WebView message handler failures instead of swallowing them', () => { - const start = terminalHtmlSource.indexOf('function handleIncomingMessage') - // Bounded by the next declaration in the same module: ruling 24 took the resize listener out - // of the bridge, so the handler is followed by the start that installs the transport. - const end = terminalHtmlSource.indexOf('function startMessageBridge', start) - expect(start).toBeGreaterThanOrEqual(0) - expect(end).toBeGreaterThan(start) - const handlerSource = terminalHtmlSource.slice(start, end) - - expect(handlerSource).toContain('reportEngineError(') - expect(handlerSource).toContain("'terminal init failed'") - expect(handlerSource).toContain("'terminal message failed'") - expect(handlerSource).not.toContain('catch(ex) {}') - }) - - it('classifies runtime errors by a document-scoped ever-ready latch', () => { - // Why: init() flips `ready` false on every re-init (live width reflow keeps the - // old surface visible meanwhile), so the fatal default and the init-catch must - // key off `everReady` — otherwise a transient reflow error blanks a live - // terminal behind the fatal overlay. The latch stays set for the document. - // Ruling 21: the latch's initial value is in the scope factory, not in a parse-time write. - expect(terminalHtmlSource).toContain('everReady: false,') - expect(terminalHtmlSource).toContain('scope.everReady = true') - expect(terminalHtmlSource).toContain('fatal === undefined ? !scope.everReady : !!fatal') - expect(terminalHtmlSource).toContain("msg && msg.type === 'init' && !scope.everReady") - expect(terminalHtmlSource).not.toMatch(/fatal === void 0 \? !scope\.ready\b/) - }) - - it('bounds error capture and non-fatal reporting on a degraded engine', () => { - // Why: a constructed-but-broken engine can throw per render frame; both - // onerror capture sites must cap the buffer and non-fatal notifies must - // stop flooding RN while fatal reports always emit. - // Both sites: the document's own reporter, and the shell's inline handler that catches what - // fails before the document has run at all. - // `dirname`, not the module URL: a DOM-environment case has no `file:` URL to convert. - const shell = readFileSync( - join(import.meta.dirname, 'terminal-webview-html', 'document-shell.ts'), - 'utf8' - ) - // The shell's buffer is a global because it is older than any document; the document appends to - // it through the seam, so the two sites now spell the same cap over the same list differently. - expect(shell).toContain('window.__engineErrors.length < 20') - expect(terminalHtmlSource).toContain('const captured = scope.capturedEngineErrors()') - expect(terminalHtmlSource).toContain('if (captured.length < 20) {') - // The global is read in one place, the seam's own default, and the reporter no longer names it. - expect(documentModuleSource('host-notify')).not.toContain('window.__engineErrors') - expect(documentModuleSource('document-host-seams')).toContain( - 'window.__engineErrors = window.__engineErrors ?? []' - ) - expect(terminalHtmlSource).toContain('nonFatalErrorNotifies > 5') - }) - it('recreates WebGL once after context loss, then stays on the DOM renderer', () => { const { addons, logged, term, timers } = createWebglRecoveryHarness() diff --git a/mobile/src/terminal/terminal-webview-query-reply.test.ts b/mobile/src/terminal/terminal-webview-query-reply.test.ts index 48de712bcaa7..fe090b1436e9 100644 --- a/mobile/src/terminal/terminal-webview-query-reply.test.ts +++ b/mobile/src/terminal/terminal-webview-query-reply.test.ts @@ -6,7 +6,6 @@ import { resetTerminalDataReplyAuthority, resumeTerminalDataReplyAuthority } from './document/query-reply' -import { documentModuleSource } from './document/document-module-source.test-support' type QueryReplyGate = { forward: (data: string) => void @@ -50,32 +49,6 @@ function createQueryReplyGate(notify: (message: unknown) => void): { } describe('mobile terminal query replies', () => { - it('forwards xterm-generated data only after initial replay drains', () => { - const bridge = documentModuleSource('query-reply') - const init = documentModuleSource('terminal-init') - // The listener is armed by the bridge, and what it forwards is the gate's own call. - expect(bridge).toContain('term.onData(') - expect(bridge).toContain('forwardTerminalDataReply(scope, data)') - // The terminal takes keystrokes from the host, never from its own textarea: stdin is enabled so - // xterm generates replies, and the textarea is read-only so the phone's keyboard cannot type. - expect(init).toContain('disableStdin: false') - // Both are the bridge's own doing, where the listener it arms is: it takes the key handler and - // the textarea in the same breath. - expect(bridge).toContain('term.attachCustomKeyEventHandler(') - expect(bridge).toContain('term.textarea.readOnly = true') - }) - - it('mutes a replacement terminal until its own replay drains', () => { - const init = documentModuleSource('terminal-init') - const initIndex = init.indexOf('export function init(') - const disableIndex = init.indexOf('resetTerminalDataReplyAuthority(scope)', initIndex) - const enableIndex = init.indexOf('attachTerminalQueryReplyBridge(scope,', disableIndex) - - expect(initIndex).toBeGreaterThanOrEqual(0) - expect(disableIndex).toBeGreaterThan(initIndex) - expect(enableIndex).toBeGreaterThan(disableIndex) - }) - it('suppresses replay, then forwards live queries queued behind its boundary', () => { const messages: unknown[] = [] const { gate, queuedBoundaries } = createQueryReplyGate((message) => messages.push(message)) @@ -117,10 +90,5 @@ describe('mobile terminal query replies', () => { gate.forward('\x1b[3;4R') expect(messages).toEqual([{ type: 'terminal-data', bytes: '\x1b[3;4R' }]) - const router = documentModuleSource('host-message-router') - const clearStart = router.indexOf("} else if (msg.type === 'clear') {") - const clearEnd = router.indexOf("} else if (msg.type === 'reset-zoom')", clearStart) - expect(clearStart).toBeGreaterThanOrEqual(0) - expect(router.slice(clearStart, clearEnd)).toContain('resumeTerminalDataReplyAuthority(scope)') }) }) diff --git a/mobile/src/terminal/terminal-webview-reflow.test.ts b/mobile/src/terminal/terminal-webview-reflow.test.ts deleted file mode 100644 index 82948f541eb7..000000000000 --- a/mobile/src/terminal/terminal-webview-reflow.test.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { readFileSync } from 'node:fs' -import { describe, expect, it } from 'vitest' -import { - documentModuleSource, - documentSourceText -} from './document/document-module-source.test-support' - -const DOCUMENT_SOURCE = documentSourceText() - -// The reflow logic is the document's; the message dispatch and the handle wiring are the -// component's. Both are read as source, because the document is source now. -const reflowSource = documentModuleSource('reflow') -// The handle is built by the controller both components share, which is where the wiring is read. -const handleSource = readFileSync( - new URL('./use-terminal-webview-controller.ts', import.meta.url), - 'utf8' -) - -function reflowFnBody(): string { - const start = reflowSource.indexOf('export function reflow(scope: TerminalDocumentScope') - expect(start).toBeGreaterThanOrEqual(0) - return reflowSource.slice(start) -} - -describe('terminal WebView reflow', () => { - it('skips the alternate screen so TUI snapshots are not mutated', () => { - // Why: alt-screen snapshots are repainted by the PTY; a local resize there - // can drop SGR attributes (white text). Reflow must early-return. - expect(reflowFnBody()).toContain('if (!scope.term || isAlternateBufferActive(scope)) {') - }) - - it('rewraps the local buffer via term.resize to the new cols', () => { - expect(reflowFnBody()).toContain('scope.term.resize(nextCols, nextRows)') - }) - - it('preserves the user scroll position across the rewrap', () => { - const body = reflowFnBody() - // At the live bottom -> stay pinned; scrolled up -> hold distance-from-bottom. - expect(body).toContain('const wasAtBottom = buffer.viewportY >= buffer.baseY') - expect(body).toContain('scope.term.scrollToBottom()') - expect(body).toContain('rewrapped.baseY - distanceFromBottom - rewrapped.viewportY') - }) - - it('is no-op when the dimensions are unchanged', () => { - expect(reflowFnBody()).toContain( - 'if (nextCols === scope.term.cols && nextRows === scope.term.rows) {' - ) - }) - - it('is dispatched by the reflow WebView message and exposed on the handle', () => { - expect(DOCUMENT_SOURCE).toContain("} else if (msg.type === 'reflow') {") - expect(DOCUMENT_SOURCE).toContain('reflow(scope, msg.cols!, msg.rows!)') - expect(handleSource).toContain("postMessage({ type: 'reflow', cols, rows, frame })") - }) - - it('does not locally resize hidden WebViews to a one-column grid', () => { - // The floor belongs to the one fit the app and the document share. - const gridFitSource = readFileSync(new URL('./terminal-grid-fit.ts', import.meta.url), 'utf8') - expect(gridFitSource).toContain('export const MIN_FIT_COLS = 20') - expect(gridFitSource).toContain('if (!(cols >= MIN_FIT_COLS)) {') - }) -}) diff --git a/mobile/src/terminal/terminal-webview-scroll-routing.test.ts b/mobile/src/terminal/terminal-webview-scroll-routing.test.ts deleted file mode 100644 index bb0cc6494121..000000000000 --- a/mobile/src/terminal/terminal-webview-scroll-routing.test.ts +++ /dev/null @@ -1,258 +0,0 @@ -import { readFileSync } from 'node:fs' -import { describe, expect, it } from 'vitest' -import { webviewPageSource } from './document/document-module-source.test-support' - -const DOCUMENT_SOURCE = webviewPageSource() - -// The RN wrapper and the pending-message queue are TypeScript; everything the WebView runs is the -// generated document. Concatenated so assertions resolve regardless of file. -const source = - readFileSync(new URL('./TerminalWebView.tsx', import.meta.url), 'utf8') + - readFileSync(new URL('./use-terminal-webview-controller.ts', import.meta.url), 'utf8') + - readFileSync(new URL('./terminal-webview-ready-promises.ts', import.meta.url), 'utf8') + - readFileSync(new URL('./terminal-webview-pending-messages.ts', import.meta.url), 'utf8') + - readFileSync(new URL('./terminal-webview-html/document-markup.ts', import.meta.url), 'utf8') + - readFileSync(new URL('./terminal-webview-html/document-style.ts', import.meta.url), 'utf8') + - DOCUMENT_SOURCE -const sessionSource = readFileSync( - new URL('../session/use-mobile-session-terminal-input.ts', import.meta.url), - 'utf8' -) -const sessionHelperSource = readFileSync( - new URL('../session/mobile-session-route-helpers.ts', import.meta.url), - 'utf8' -) - -function sliceBetween(startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('TerminalWebView scroll routing', () => { - it('keeps Android touch drags inside the terminal WebView', () => { - expect(source).toContain('nestedScrollEnabled') - }) - - it('maps a downward pull at the bottom to older scrollback rows', () => { - expect(source).toContain('const deltaY = scope.touchGesture.lastY - y') - expect(source).toContain('scope.smoothScrollOffsetY -= deltaY') - expect(source).toContain( - 'const lines = Math.trunc(-scope.smoothScrollOffsetY / effectiveCellH)' - ) - - const nextViewportY = simulateNormalBufferPull({ - baseY: 120, - viewportY: 120, - startY: 300, - endY: 340, - cellHeight: 20 - }) - - expect(nextViewportY).toBe(118) - }) - - it('routes alternate-screen and mouse-aware scroll before smooth normal scroll', () => { - expect(source).toContain( - 'return isWheelMouseTrackingMode(getMouseTrackingMode(scope)) || isAlternateBufferActive(scope)' - ) - - const touchMoveBlock = sliceBetween( - "targetSurface.addEventListener(\n 'touchmove'", - '{ capture: true, passive: false }' - ) - expect(touchMoveBlock.indexOf('if (shouldRouteScrollToTerminalInput(scope))')).toBeLessThan( - touchMoveBlock.indexOf('if (enqueueNormalBufferScrollDelta(scope, deltaY))') - ) - expect(touchMoveBlock).toContain('routeScrollLines(scope, lines, x, y)') - - const momentumBlock = sliceBetween( - 'function momentumStep(frameTime: number) {', - 'if (Math.abs(vel) > MIN_VEL)' - ) - expect(momentumBlock.indexOf('if (shouldRouteScrollToTerminalInput(scope))')).toBeLessThan( - momentumBlock.indexOf('if (!applyNormalBufferScrollDelta(scope, delta))') - ) - expect(momentumBlock).toContain( - 'routeScrollLines(scope, lines, scope.touchGesture.lastX, scope.touchGesture.lastY)' - ) - }) - - it('does not rubber-band normal scroll at scrollback edges', () => { - expect(source).toContain('export function canScrollNormalBufferDelta(') - const smoothScrollBlock = sliceBetween( - 'export function applyNormalBufferScrollDelta(', - 'export function enqueueNormalBufferScrollDelta(' - ) - expect(smoothScrollBlock).toContain('if (!canScrollNormalBufferDelta(scope, deltaY))') - expect(smoothScrollBlock).toContain('resetSmoothScrollOffset(scope)') - expect(smoothScrollBlock).toContain('return false') - expect(smoothScrollBlock).toContain('return true') - - const touchMoveBlock = sliceBetween( - "targetSurface.addEventListener(\n 'touchmove'", - '{ capture: true, passive: false }' - ) - expect(touchMoveBlock).toContain('if (enqueueNormalBufferScrollDelta(scope, deltaY))') - expect(touchMoveBlock).toContain('scope.touchGesture.velY = 0') - - const momentumBlock = sliceBetween( - 'function momentumStep(frameTime: number) {', - 'if (Math.abs(vel) > MIN_VEL)' - ) - expect(momentumBlock).toContain('if (!applyNormalBufferScrollDelta(scope, delta))') - expect(momentumBlock).toContain('scope.touchGesture.momentumId = null') - }) - - it('coalesces normal touch scroll row commits onto animation frames', () => { - const enqueueBlock = sliceBetween( - 'export function enqueueNormalBufferScrollDelta(', - 'export function resetSmoothScrollOffset(' - ) - expect(enqueueBlock).toContain('scope.pendingNormalScrollDeltaY += deltaY') - expect(enqueueBlock).toContain('if (scope.normalScrollFrameId !== null) {') - // Ruling 21: every document frame goes through the scope's registry so dispose can take it - // back; the id is still held here, which is what the reset below cancels. - expect(enqueueBlock).toContain( - 'scope.normalScrollFrameId = scheduleDocumentFrame(scope, function () {' - ) - expect(enqueueBlock).toContain('applyNormalBufferScrollDelta(scope, delta)') - - const resetBlock = sliceBetween( - 'export function resetSmoothScrollOffset(', - 'export function stopNormalBufferSmoothScroll(' - ) - expect(resetBlock).toContain('scope.pendingNormalScrollDeltaY = 0') - expect(resetBlock).toContain('cancelAnimationFrame(scope.normalScrollFrameId)') - }) - - it('bounds native-side pending WebView writes while preserving control messages', () => { - expect(source).toContain('const MAX_PENDING_WEB_WRITE_BYTES = 1_000_000') - expect(source).toContain('const MAX_PENDING_WEB_WRITE_MESSAGES = 4096') - expect(source).toContain('let pendingWriteBytes = 0') - expect(source).toContain('let pendingWriteCount = 0') - expect(source).toContain('const queue = (msg: TerminalWebViewCommand)') - expect(source).toContain('pendingWriteCount > MAX_PENDING_WEB_WRITE_MESSAGES') - expect(source).toContain("candidate.type === 'write'") - expect(source).toContain('pendingMessages.queue(msg)') - expect(source).toContain('pendingMessages.clear()') - }) - - it('clears the ready await timer when the real response wins', () => { - // C7.5 moved the promise into `terminal-webview-ready-promises.ts`, which both components - // reach through the controller. - const readyBlock = sliceBetween('async function awaitReady()', 'return { armReady') - expect(readyBlock).toContain('clearTimeout(timeout)') - expect(readyBlock).toContain('void pending.finally') - }) - - it('hides xterm scrollbars and drives the mobile scroll indicator from committed rows', () => { - expect(source).toContain('
    ') - expect(source).toContain('.xterm .xterm-viewport::-webkit-scrollbar') - expect(source).toContain('.xterm .xterm-scrollable-element > .xterm-scrollbar') - expect(source).toContain('overflow-y: hidden !important') - expect(source).toContain('display: none !important') - expect(source).toContain('export function updateScrollIndicator(') - expect(source).toContain('buffer.viewportY / maxViewportY') - expect(source).not.toContain('fractionalRows') - expect(source).toContain('scrollThumb.style.transform =') - expect(source).toContain('updateScrollIndicator(scope, true)') - }) - - it('does not apply fractional smooth scroll transforms to terminal content', () => { - const updateTransformBlock = sliceBetween( - 'export function updateTransform(', - 'export function updateScrollIndicator(' - ) - expect(updateTransformBlock).toContain( - "'translate(' + scope.panX + 'px,' + scope.panY + 'px) scale(' + getTotalScale(scope) + ')'" - ) - expect(source).not.toContain("querySelector('.xterm-screen')") - expect(source).not.toContain('updateTerminalScreenTransform') - expect(updateTransformBlock).not.toContain('getVisualPanY() + "px) scale("') - expect(updateTransformBlock).not.toContain('smoothScrollOffsetY') - }) - - it('smooths velocity samples and uses lower friction for mobile momentum', () => { - expect(source).toContain('export function updateTouchVelocity(') - expect(source).toContain('scope.touchGesture.velY * 0.55 + instantVelocity * 0.45') - expect(source).toContain('const FRICTION = 0.972') - expect(source).toContain('const MIN_VEL = 0.012') - // #21687: the decay is per elapsed millisecond, so a 120 Hz screen coasts the same distance. - expect(source).toContain('let lastMomentumTime = performance.now()') - expect(source).toContain( - 'const elapsed = Math.max(1, Math.min(50, frameTime - lastMomentumTime))' - ) - expect(source).toContain('vel *= FRICTION ** (elapsed / 16)') - expect(source).toContain('const delta = vel * elapsed') - }) - - it('keeps selection edge autoscroll active and extends the dragged endpoint', () => { - const startBlock = sliceBetween( - 'export function startEdgeScroll(', - 'export function stopEdgeScroll(' - ) - expect(startBlock.indexOf('stopEdgeScroll(scope)')).toBeLessThan( - startBlock.indexOf('scope.edgeScrollDir = dir') - ) - expect(startBlock.indexOf('scope.term.scrollLines(scope.edgeScrollDir)')).toBeLessThan( - startBlock.indexOf('syncEdgeScrollSelectionEndpoint(scope)') - ) - - const dragMoveBlock = sliceBetween( - 'export function handleDragMove(', - 'function attachSurfaceEventHandlers(' - ) - expect(dragMoveBlock).toContain('scope.edgeScrollClientX = clientX') - expect(dragMoveBlock).toContain('scope.edgeScrollClientY = clientY') - expect(dragMoveBlock).toContain( - 'syncSelectionHandleToViewportPoint(scope, handle, clientX, clientY)' - ) - }) - - it('allows x10 mouse gesture reports through the mobile session gate', () => { - expect(sessionHelperSource).toContain('function isGestureMouseTrackingMode') - expect(sessionHelperSource).toContain( - "return mode === 'x10' || mode === 'vt200' || mode === 'drag' || mode === 'any'" - ) - - const inputBlockStart = sessionSource.indexOf('const handleTerminalInput = useCallback') - expect(inputBlockStart).toBeGreaterThanOrEqual(0) - const inputBlockEnd = sessionSource.indexOf( - 'async function handleClearTerminal', - inputBlockStart - ) - expect(inputBlockEnd).toBeGreaterThan(inputBlockStart) - const inputBlock = sessionSource.slice(inputBlockStart, inputBlockEnd) - expect(inputBlock).toContain('!isGestureMouseTrackingMode(modes?.mouseTrackingMode)') - expect(inputBlock).toContain('const sequenceCount = countTerminalGestureInputSequences(bytes)') - expect(inputBlock.indexOf('countTerminalGestureInputSequences')).toBeLessThan( - inputBlock.indexOf('enqueueTerminalGestureInput') - ) - }) -}) - -function simulateNormalBufferPull({ - baseY, - viewportY, - startY, - endY, - cellHeight -}: { - baseY: number - viewportY: number - startY: number - endY: number - cellHeight: number -}): number { - const deltaY = startY - endY - if (deltaY > 0 ? viewportY >= baseY : viewportY <= 0) { - return viewportY - } - const smoothScrollOffsetY = -deltaY - const lines = Math.trunc(-smoothScrollOffsetY / cellHeight) - const applied = Math.max(lines, -viewportY) - return viewportY + applied -} diff --git a/mobile/src/terminal/terminal-webview-text-zoom.test.ts b/mobile/src/terminal/terminal-webview-text-zoom.test.ts index 20b2d2a0afdc..29ba4bfcd138 100644 --- a/mobile/src/terminal/terminal-webview-text-zoom.test.ts +++ b/mobile/src/terminal/terminal-webview-text-zoom.test.ts @@ -1,19 +1,8 @@ // @vitest-environment happy-dom -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { describe, expect, it, vi } from 'vitest' import { createTerminalDocumentScope } from './document/document-scope' import { normalizeStatusDotPresentation } from './document/write-queue' import { startTextScaling } from './document/text-scaling' -import { webviewPageSource } from './document/document-module-source.test-support' - -const terminalWebViewSource = readFileSync(join(import.meta.dirname, 'TerminalWebView.tsx'), 'utf8') -const terminalHtmlDocumentShellSource = readFileSync( - join(import.meta.dirname, 'terminal-webview-html', 'document-shell.ts'), - 'utf8' -) -// The document's own source, which is what the WebView runs once bundled. -const terminalHtmlSource = webviewPageSource() function normalizeStatusDotChunks(chunks: string[]) { const scope = createTerminalDocumentScope() @@ -46,45 +35,6 @@ function resolveTerminalFontFamily(navigatorValue: { } describe('TerminalWebView text zoom', () => { - it('pins textZoom to 100 so Android system font scale cannot inflate glyphs past xterm cell metrics', () => { - const start = terminalWebViewSource.indexOf('', start) - expect(end).toBeGreaterThan(start) - const webViewProps = terminalWebViewSource.slice(start, end) - expect(webViewProps).toContain('textZoom={100}') - }) - - it('keeps the HTML source object stable so parent renders do not reload xterm', () => { - const start = terminalWebViewSource.indexOf('', start) - expect(end).toBeGreaterThan(start) - const webViewProps = terminalWebViewSource.slice(start, end) - // One source object per view, pinned at mount. - expect(terminalWebViewSource).toContain('const [source] = useState(() =>') - expect(webViewProps).toContain('source={source}') - }) - - it('forces the Claude status dot to text presentation before xterm writes', () => { - expect(terminalHtmlSource).toContain('font-variant-emoji: text') - // The dot and its two selectors are the write queue's own constants, and the pattern is a - // literal because a construction at a module's top level would be parse-time work (ruling 20). - expect(terminalHtmlSource).toContain("const CLAUDE_STATUS_DOT = '\\u23fa'") - expect(terminalHtmlSource).toContain("const TEXT_PRESENTATION_SELECTOR = '\\ufe0e'") - expect(terminalHtmlSource).toContain("const EMOJI_PRESENTATION_SELECTOR = '\\ufe0f'") - expect(terminalHtmlSource).toContain( - 'const CLAUDE_STATUS_DOT_PATTERN = /\\u23fa[\\ufe0e\\ufe0f]*/g' - ) - expect(terminalHtmlSource).toContain('export function normalizeStatusDotPresentation(') - expect(terminalHtmlSource).toContain( - 'CLAUDE_STATUS_DOT_PATTERN,\n CLAUDE_STATUS_DOT + TEXT_PRESENTATION_SELECTOR' - ) - expect(terminalHtmlSource).toContain( - 'scope.writeQueue.push(normalizeStatusDotPresentation(scope, data))' - ) - }) - it('normalizes Claude status dots idempotently across write chunks', () => { const dot = String.fromCharCode(0x23fa) const textSelector = String.fromCharCode(0xfe0e) @@ -111,36 +61,6 @@ describe('TerminalWebView text zoom', () => { ) }) - it('resets pending Claude status dot selector state when the terminal lifecycle resets', () => { - const initStart = terminalHtmlSource.indexOf('export function init(') - const initReplay = terminalHtmlSource.indexOf( - 'const replayData = normalizeInitialData(initialData)' - ) - const clearStart = terminalHtmlSource.indexOf("} else if (msg.type === 'clear') {") - const clearEnd = terminalHtmlSource.indexOf("} else if (msg.type === 'reset-zoom')", clearStart) - expect(initStart).toBeGreaterThanOrEqual(0) - expect(initReplay).toBeGreaterThan(initStart) - expect(clearStart).toBeGreaterThanOrEqual(0) - expect(clearEnd).toBeGreaterThan(clearStart) - expect(terminalHtmlSource.slice(initStart, initReplay)).toContain( - 'scope.statusDotPendingSelector = false' - ) - expect(terminalHtmlSource.slice(clearStart, clearEnd)).toContain( - 'scope.statusDotPendingSelector = false' - ) - }) - - it('loads Unicode 11 before replaying mobile terminal bytes', () => { - expect(terminalHtmlDocumentShellSource).toContain('XTERM_ENGINE_JS') - expect(terminalHtmlSource).toContain('window.Unicode11Addon.Unicode11Addon') - const open = terminalHtmlSource.indexOf('term.open(scope.surface!)') - const unicode = terminalHtmlSource.indexOf("term.unicode.activeVersion = '11'") - const replay = terminalHtmlSource.indexOf("enqueueWrite(scope, ESC + '[0m' + replayData)") - expect(open).toBeGreaterThanOrEqual(0) - expect(unicode).toBeGreaterThan(open) - expect(replay).toBeGreaterThan(unicode) - }) - const IOS_IPHONE_NAVIGATOR = { userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 19_0 like Mac OS X) AppleWebKit/605.1.15', platform: 'iPhone', diff --git a/mobile/src/terminal/terminal-write-coalescer-boundaries.test.ts b/mobile/src/terminal/terminal-write-coalescer-boundaries.test.ts index 39615ef36926..3dd290fa1ff0 100644 --- a/mobile/src/terminal/terminal-write-coalescer-boundaries.test.ts +++ b/mobile/src/terminal/terminal-write-coalescer-boundaries.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { afterEach, describe, expect, it, vi } from 'vitest' import type { TerminalWebViewCommand } from './terminal-webview-messages' import { createTerminalWebViewPendingMessages } from './terminal-webview-pending-messages' @@ -7,15 +6,6 @@ import { TERMINAL_WRITE_FLUSH_WINDOW_MS } from './terminal-write-coalescer' -const webViewSource = readFileSync(new URL('./TerminalWebView.tsx', import.meta.url), 'utf8') -// C7.5 moved everything that is not `react-native-webview` into the controller both components -// share, so the coalescer's boundaries are read there; the component is still read for the two -// WebView lifecycle events that reach it. -const controllerSource = readFileSync( - new URL('./use-terminal-webview-controller.ts', import.meta.url), - 'utf8' -) - // Simulates TerminalWebView's postMessage: ready → deliver, not ready → queue. // There is no React render harness in the node environment, so the boundary // invariants are gated here against the same pending-queue module the component uses. @@ -110,73 +100,4 @@ describe('terminal write coalescer boundaries', () => { { type: 'write', data: 'still-current-document' } ]) }) - - it('routes handle.write through the coalescer whose delivery posts the write command', () => { - expect(controllerSource).toContain( - "createTerminalWriteCoalescer((data) => postMessage({ type: 'write', data }))" - ) - const writeStart = controllerSource.indexOf('write(data: string) {') - expect(writeStart).toBeGreaterThanOrEqual(0) - const writeBody = controllerSource.slice(writeStart, writeStart + 120) - expect(writeBody).toContain('writeCoalescer.write(data)') - expect(writeBody).not.toContain('postMessage') - }) - - it('clears the coalescer before posting init and clear (snapshot supersession)', () => { - // Anchor on the init() signature (unique) — 'init(' alone also matches comments. - const initStart = controllerSource.indexOf( - 'init({ cols, rows, initialData, preserveScroll, oscLinks, frame }' - ) - const initClear = controllerSource.indexOf('writeCoalescer.clear()', initStart) - const initPost = controllerSource.indexOf("type: 'init'", initStart) - expect(initStart).toBeGreaterThanOrEqual(0) - expect(initClear).toBeGreaterThan(initStart) - expect(initClear).toBeLessThan(initPost) - - const clearStart = controllerSource.indexOf('clear() {', initPost) - const clearBody = controllerSource.slice(clearStart, clearStart + 160) - expect(clearStart).toBeGreaterThanOrEqual(0) - expect(clearBody.indexOf('writeCoalescer.clear()')).toBeGreaterThanOrEqual(0) - expect(clearBody.indexOf('writeCoalescer.clear()')).toBeLessThan( - clearBody.indexOf("postMessage({ type: 'clear' })") - ) - }) - - it('flushes pending writes before resize and reflow so boundaries observe prior bytes', () => { - for (const method of ['resize', 'reflow'] as const) { - const start = controllerSource.indexOf( - `${method}(cols: number, rows: number, frame: TerminalFrame | null) {` - ) - expect(start).toBeGreaterThanOrEqual(0) - const body = controllerSource.slice(start, start + 300) - const flushIndex = body.indexOf('writeCoalescer.flushNow()') - const postIndex = body.indexOf(`postMessage({ type: '${method}'`) - expect(flushIndex).toBeGreaterThanOrEqual(0) - expect(postIndex).toBeGreaterThan(flushIndex) - } - }) - - it('clears the coalescer in both document-lifecycle hooks alongside pendingMessages', () => { - // Both hooks now reach one function, so the clearing is asserted once where it lives and the - // two WebView events are asserted to be the callers. Reading only the component would pass on - // a `resetReadiness` that had quietly stopped clearing either one. - const start = controllerSource.indexOf('const resetReadiness = useCallback') - expect(start).toBeGreaterThanOrEqual(0) - const body = controllerSource.slice(start, controllerSource.indexOf('}, [', start)) - expect(body).toContain('pendingMessages.clear()') - expect(body).toContain('writeCoalescer.clear()') - expect(webViewSource).toContain('onLoadStart={resetReadiness}') - const terminated = webViewSource.indexOf('const handleContentProcessDidTerminate') - expect(terminated).toBeGreaterThanOrEqual(0) - expect(webViewSource.slice(terminated, webViewSource.indexOf('}, [', terminated))).toContain( - 'resetReadiness()' - ) - }) - - it('clears the coalescer on unmount so no timer leaks', () => { - const cleanupStart = controllerSource.indexOf('useEffect(() => {\n return () => {') - expect(cleanupStart).toBeGreaterThanOrEqual(0) - const cleanupBody = controllerSource.slice(cleanupStart, cleanupStart + 160) - expect(cleanupBody).toContain('writeCoalescer.clear()') - }) }) diff --git a/mobile/src/test-support/bridged-parity/c2-page-closure.test.ts b/mobile/src/test-support/bridged-parity/c2-page-closure.test.ts deleted file mode 100644 index ca797265cfe3..000000000000 --- a/mobile/src/test-support/bridged-parity/c2-page-closure.test.ts +++ /dev/null @@ -1,235 +0,0 @@ -import { readdirSync } from 'node:fs' -import { resolve } from 'node:path' -import { describe, expect, it } from 'vitest' -import { C1_PAGE_CLOSURE } from './c1-page-closure' -import { C2_PAGE_CLOSURE } from './c2-page-closure' -import { C2_TASK_SOURCE_CLOSURE_FAMILIES } from './c2-task-source-closure-families' -import { C2_WORK_ITEM_CLOSURE_FAMILIES } from './c2-work-item-closure-families' -import { C5_PAGE_CLOSURE } from './c5-page-closure' -import { pinsFromSource } from './page-closure-pin-source' -import { BRIDGED_PARITY_EXCLUSIONS } from './divergence-classes' -import { - pageClosureDrift, - pageClosureExclusions, - pageClosureRunTotals, - pageClosureTotals, - type PageClosureObservation -} from './page-closure' -import { readGolden } from '../rpc-recording/golden-recording' - -const GOLDENS = resolve(import.meta.dirname, '../../../rpc-foundation/goldens') -const C1_SOURCE = resolve(import.meta.dirname, 'c1-page-closure.ts') - -/** The run a corpus that diverged exactly as the pin says would hand the rule. */ -function asPinned(): Map { - const run = new Map() - for (const [family, goldens] of Object.entries(C2_PAGE_CLOSURE)) { - for (const [id, verdict] of Object.entries(goldens)) { - run.set(id, { family, verdict }) - } - } - return run -} - -describe('the C2 page closure', () => { - /** - * The census reads the committed table, and does not re-derive the closure. - * - * Nothing here or in the gate runs esbuild or maps a scenario's `sites` back to the module graph, - * so this fixes how many families the table may hold, not which families belong in it. A golden - * arriving in a family already pinned is caught, by `pageClosureDrift` and by this count. A new - * *family* entering the closure — a scenario recorded at a site the route newly imports — is - * invisible until someone re-derives the closure by hand, as C1's and C5's pins are too. - */ - it('is the census the design named: 68 families, 257 goldens', () => { - const goldens = Object.values(C2_PAGE_CLOSURE).flatMap((family) => Object.keys(family)) - expect({ families: Object.keys(C2_PAGE_CLOSURE).length, goldens: goldens.length }).toEqual({ - families: 68, - goldens: 257 - }) - expect(new Set(goldens).size).toBe(goldens.length) - }) - - /** - * The totals, asserted beside the per-id pins rather than instead of them. - * - * A walk that compares each id to its own verdict cannot see a table built wrong in a way that is - * self-consistent — C5 derived exactly that file once, with an empty mismatch list and three - * goldens in the wrong class. These counts are what showed it, and the gate re-asserts them - * against the run rather than against the table. - */ - it('pins how many goldens land in each class, which a per-id walk cannot see move', () => { - expect(pageClosureTotals(C2_PAGE_CLOSURE)).toEqual({ - identical: 108, - 'result-absent-settlement': 115, - 'params-undefined': 29, - 'result-absent-stream-release': 3, - 'write-ordinal': 2 - }) - }) - - it("inherits C1's families whole, with the verdicts C1's file commits", () => { - // Against the file's text rather than the imported object, because today the composition - // spreads that object and a comparison to it agrees with itself. This holds the shape of the - // inheritance: that C2's table carries C1's families at C1's verdicts and overrides none of - // them, and it keeps holding if the spread is ever replaced by inlined entries. - // - // What it cannot hold: a verdict changed inside `c1-page-closure.ts`. C2 inherits whatever C1 - // commits, so both sides of this comparison move together. Measured, that edit is red in the - // bridged-parity gate, which compares the pin to a run rather than to a file, and here in the - // class totals and the exclusion count, which pin absolute numbers. It is green in - // `c1-page-closure.test.ts`, whose exclusion check is `toBeGreaterThan(0)` and which pins no - // class totals at all. - // - // C2's own rule does not reproduce these pins — measured, it disagrees on 13 of the 103, being - // `tasks.smart-source-search` 7, `host-worktree-refresh` 5 and `worktree-catalog-snapshot` 1 — - // so inheritance is the derivation rather than a re-derivation that looked close. - const committed = pinsFromSource(C1_SOURCE) - // The reader found a table rather than nothing, which every assertion below depends on. - expect({ - families: Object.keys(committed).length, - pins: Object.values(committed).flatMap(Object.keys).length - }).toEqual({ families: 20, pins: 94 }) - for (const [family, pinned] of Object.entries(committed)) { - expect(C2_PAGE_CLOSURE[family], family).toEqual(pinned) - } - expect(Object.keys(C1_PAGE_CLOSURE)).toEqual(Object.keys(committed)) - }) - - it('agrees with C5 object for object on every family both domains pin', () => { - // Two page closures that share a family share the goldens in it. Were one to be re-derived and - // the other inherited, this is the assertion that would not hold. - const shared = Object.keys(C5_PAGE_CLOSURE).filter((family) => family in C2_PAGE_CLOSURE) - expect(shared.length).toBe(20) - for (const family of shared) { - expect(C2_PAGE_CLOSURE[family], family).toEqual(C5_PAGE_CLOSURE[family]) - } - }) - - it('adds 48 families, split across the two halves without overlap', () => { - // The composed table is a spread, so a family named in both halves would be taken from the last - // one silently. Disjointness is what makes the two files data rather than a precedence rule. - const work = Object.keys(C2_WORK_ITEM_CLOSURE_FAMILIES) - const source = Object.keys(C2_TASK_SOURCE_CLOSURE_FAMILIES) - expect(work.filter((family) => source.includes(family))).toEqual([]) - expect(work.filter((family) => family in C1_PAGE_CLOSURE)).toEqual([]) - expect(source.filter((family) => family in C1_PAGE_CLOSURE)).toEqual([]) - expect({ work: work.length, source: source.length }).toEqual({ work: 26, source: 22 }) - const added = Object.keys(C2_PAGE_CLOSURE).filter((family) => !(family in C1_PAGE_CLOSURE)) - expect(added.sort()).toEqual([...work, ...source].sort()) - }) - - it('names the families where a pin proves only that the divergence kept its name', () => { - // "266 certified" would read as 266 proofs of byte-identity. Six families have no byte-identical - // golden at all, so their 27 say only that the class did not change, and the PR body says so. - const wholly = Object.entries(C2_PAGE_CLOSURE) - .filter(([, pins]) => !Object.values(pins).includes('identical')) - .map(([family, pins]) => [family, Object.keys(pins).length] as const) - expect(wholly).toEqual([ - ['host-worktree-refresh', 5], - ['tasks.item-checks-files', 6], - ['tasks.item-metadata-gitlab-mr', 2], - ['tasks.project-row-files-merge', 6], - ['tasks.provider-load', 6], - ['tasks.task-list-gitlab-items', 2] - ]) - }) - - it('pins goldens that exist, in the family the corpus records them under', () => { - for (const [family, goldens] of Object.entries(C2_PAGE_CLOSURE)) { - for (const id of Object.keys(goldens)) { - // Through the corpus's own reader, which checks the format version and the value pool and - // throws a named diagnostic otherwise. - const recorded = readGolden(GOLDENS, id) - expect({ id, family: recorded.family }).toEqual({ id, family }) - } - } - }) - - it('claims no golden the corpus does not have', () => { - const corpus = new Set( - readdirSync(GOLDENS) - .filter((name) => name.endsWith('.json')) - .map((name) => name.replace(/\.json$/, '')) - ) - const missing = Object.values(C2_PAGE_CLOSURE) - .flatMap((family) => Object.keys(family)) - .filter((id) => !corpus.has(id)) - expect(missing).toEqual([]) - }) - - it('excludes a closure golden only into a class that has a reason', () => { - const exclusions = pageClosureExclusions(C2_PAGE_CLOSURE) - expect(exclusions.length).toBe(149) - expect(exclusions.filter(([, name]) => BRIDGED_PARITY_EXCLUSIONS[name] === undefined)).toEqual( - [] - ) - }) -}) - -describe('reading a run against the C2 pin', () => { - it('says nothing when the run is the pin', () => { - expect(pageClosureDrift(C2_PAGE_CLOSURE, asPinned())).toEqual([]) - expect(pageClosureRunTotals(C2_PAGE_CLOSURE, asPinned())).toEqual( - pageClosureTotals(C2_PAGE_CLOSURE) - ) - }) - - it('names a closure golden that changed verdict', () => { - const run = asPinned() - const found = [...run].find(([, seen]) => seen.verdict !== 'params-undefined') - if (found === undefined) { - throw new Error('the pin is empty') - } - const [id, observation] = found - run.set(id, { ...observation, verdict: 'params-undefined' }) - const drift = pageClosureDrift(C2_PAGE_CLOSURE, run) - expect(drift.length).toBe(1) - expect(drift[0]).toContain(id) - expect(drift[0]).toContain(`pinned ${observation.verdict}, ran params-undefined`) - // And in the counts, which is the check that holds when a second golden moves the other way. - expect(pageClosureRunTotals(C2_PAGE_CLOSURE, run)).not.toEqual( - pageClosureTotals(C2_PAGE_CLOSURE) - ) - }) - - it('names a golden newly derived into a closure family, which no id list would', () => { - const run = asPinned() - const [family] = Object.keys(C2_PAGE_CLOSURE) - if (family === undefined) { - throw new Error('the pin is empty') - } - run.set('matrix-arrived-1', { family, verdict: 'identical' }) - expect(pageClosureDrift(C2_PAGE_CLOSURE, run)).toEqual([ - `${family}: arrived matrix-arrived-1; left (none)` - ]) - }) - - it('names a closure golden the run stopped producing, three ways', () => { - const run = asPinned() - const [family, goldens] = Object.entries(C2_PAGE_CLOSURE)[0] ?? [] - const [id] = Object.keys(goldens ?? {}) - if (family === undefined || id === undefined) { - throw new Error('the pin is empty') - } - run.delete(id) - expect(pageClosureDrift(C2_PAGE_CLOSURE, run)).toEqual([ - `${family}: arrived (none); left ${id}` - ]) - // Drift is one of three. The run's totals fall short of the pin's, and the census above fixes - // the number of goldens the table may hold, so a drop cannot be absorbed by deleting the pin. - expect(pageClosureRunTotals(C2_PAGE_CLOSURE, run)).not.toEqual( - pageClosureTotals(C2_PAGE_CLOSURE) - ) - expect([...run].filter(([, seen]) => seen.family in C2_PAGE_CLOSURE).length).toBe(256) - }) - - it('ignores every golden outside the closure, which is most of the corpus', () => { - const run = asPinned() - run.set('session-diff-review-elsewhere', { - family: 'session.diff-review', - verdict: 'result-absent-settlement' - }) - expect(pageClosureDrift(C2_PAGE_CLOSURE, run)).toEqual([]) - }) -}) diff --git a/mobile/src/test-support/bridged-parity/c3-page-closure.test.ts b/mobile/src/test-support/bridged-parity/c3-page-closure.test.ts deleted file mode 100644 index afc1c8975640..000000000000 --- a/mobile/src/test-support/bridged-parity/c3-page-closure.test.ts +++ /dev/null @@ -1,222 +0,0 @@ -import { readdirSync } from 'node:fs' -import { resolve } from 'node:path' -import { describe, expect, it } from 'vitest' -import { C1_PAGE_CLOSURE } from './c1-page-closure' -import { C2_PAGE_CLOSURE } from './c2-page-closure' -import { C3_PAGE_CLOSURE } from './c3-page-closure' -import { C3_EXPLORER_CLOSURE_FAMILIES } from './c3-explorer-closure-families' -import { C3_PREVIEW_CLOSURE_FAMILIES } from './c3-preview-closure-families' -import { C5_PAGE_CLOSURE } from './c5-page-closure' -import { pinsFromSource } from './page-closure-pin-source' -import { BRIDGED_PARITY_EXCLUSIONS } from './divergence-classes' -import { - pageClosureDrift, - pageClosureExclusions, - pageClosureRunTotals, - pageClosureTotals, - type PageClosureObservation -} from './page-closure' -import { readGolden } from '../rpc-recording/golden-recording' - -const GOLDENS = resolve(import.meta.dirname, '../../../rpc-foundation/goldens') -const C1_SOURCE = resolve(import.meta.dirname, 'c1-page-closure.ts') - -/** The run a corpus that diverged exactly as the pin says would hand the rule. */ -function asPinned(): Map { - const run = new Map() - for (const [family, goldens] of Object.entries(C3_PAGE_CLOSURE)) { - for (const [id, verdict] of Object.entries(goldens)) { - run.set(id, { family, verdict }) - } - } - return run -} - -describe('the C3 page closure', () => { - /** - * The census reads the committed table, and does not re-derive the closure. - * - * Nothing here or in the gate runs esbuild or maps a scenario's `sites` back to the module graph, - * so this fixes how many families the table may hold, not which families belong in it. A golden - * arriving in a family already pinned is caught, by `pageClosureDrift` and by this count. A new - * *family* entering the closure is invisible until someone re-derives it by hand — which - * `config/scripts/mobile-web-app-page-closure-families.test.mjs` now does for both files routes. - */ - it('is the census the design named: 26 families, 116 goldens', () => { - const goldens = Object.values(C3_PAGE_CLOSURE).flatMap((family) => Object.keys(family)) - expect({ families: Object.keys(C3_PAGE_CLOSURE).length, goldens: goldens.length }).toEqual({ - families: 26, - goldens: 116 - }) - expect(new Set(goldens).size).toBe(goldens.length) - }) - - /** - * The totals, asserted beside the per-id pins rather than instead of them. - * - * A walk that compares each id to its own verdict cannot see a table built wrong in a way that is - * self-consistent — C5 derived exactly that file once, with an empty mismatch list and three - * goldens in the wrong class. These counts are what showed it, and the gate re-asserts them - * against the run rather than against the table. - */ - it('pins how many goldens land in each class, which a per-id walk cannot see move', () => { - expect(pageClosureTotals(C3_PAGE_CLOSURE)).toEqual({ - identical: 60, - 'result-absent-settlement': 44, - 'params-undefined': 7, - 'result-absent-stream-release': 3, - 'write-ordinal': 2 - }) - }) - - it("inherits C1's families whole, with the verdicts C1's file commits", () => { - // Against the file's text rather than the imported object: the composition spreads that object, - // so a hand-edited inherited entry would be read back as C1's and agree with itself. - // - // What this cannot see is an edit to `c1-page-closure.ts` itself, because both sides of the - // comparison then move together. What it does see is a C3 half redeclaring an inherited family, - // which the spread would otherwise take silently from the last table. Both measured: flipping - // `settings-repo-metadata-icons` in C1's file leaves this case green and reds seven others — - // the class totals and the exclusion counts in C2's suite and this one, both cross-series - // agreements, and C5's own inheritance case, which compares against an independent literal - // rather than a spread. - // - // Redeclaring `settings.repo-metadata` in the preview half always reds this case; how many - // others go with it depends on the shape of the redeclaration, so the number is not the claim. - // Measured: one golden under the family's name reds seven, because it also shrinks the census - // and leaves that family with no byte-identical golden. The family copied verbatim with a - // single verdict flipped reds five, the census unmoved. Both keep the load-bearing half — the - // spread takes the last table's entry, and this case is what sees it. - // - // C2's rule does not reproduce these pins — measured here, it disagrees on 13 of the 94, - // being `tasks.smart-source-search` 7, `host-worktree-refresh` 5 and - // `worktree-catalog-snapshot` 1 — so inheritance is the derivation rather than a - // re-derivation that looked close. - const committed = pinsFromSource(C1_SOURCE) - expect({ - families: Object.keys(committed).length, - pins: Object.values(committed).flatMap(Object.keys).length - }).toEqual({ families: 20, pins: 94 }) - for (const [family, pinned] of Object.entries(committed)) { - expect(C3_PAGE_CLOSURE[family], family).toEqual(pinned) - } - }) - - it('agrees with C2 and C5 object for object on every family they share', () => { - // Three page closures that share a family share the goldens in it. Were one re-derived and the - // others inherited, this is the assertion that would not hold. - for (const [name, other] of [ - ['C2', C2_PAGE_CLOSURE], - ['C5', C5_PAGE_CLOSURE] - ] as const) { - const shared = Object.keys(other).filter((family) => family in C3_PAGE_CLOSURE) - expect(shared.length, name).toBe(20) - for (const family of shared) { - expect(C3_PAGE_CLOSURE[family], `${name}/${family}`).toEqual(other[family]) - } - } - }) - - it('adds 6 families, split across the two routes without overlap', () => { - // The composed table is a spread, so a family named in both halves would be taken from the last - // one silently. Disjointness is what makes the two files data rather than a precedence rule. - const explorer = Object.keys(C3_EXPLORER_CLOSURE_FAMILIES) - const preview = Object.keys(C3_PREVIEW_CLOSURE_FAMILIES) - expect(explorer.filter((family) => preview.includes(family))).toEqual([]) - expect(explorer.filter((family) => family in C1_PAGE_CLOSURE)).toEqual([]) - expect(preview.filter((family) => family in C1_PAGE_CLOSURE)).toEqual([]) - expect({ explorer: explorer.length, preview: preview.length }).toEqual({ - explorer: 1, - preview: 5 - }) - const added = Object.keys(C3_PAGE_CLOSURE).filter((family) => !(family in C1_PAGE_CLOSURE)) - expect(added.sort()).toEqual([...explorer, ...preview].sort()) - }) - - it('names the families where a pin proves only that the divergence kept its name', () => { - // "125 certified" would read as 125 proofs of byte-identity. One family has no byte-identical - // golden at all, so its 5 say only that the class did not change, and the PR body says so. - const wholly = Object.entries(C3_PAGE_CLOSURE) - .filter(([, pins]) => !Object.values(pins).includes('identical')) - .map(([family, pins]) => [family, Object.keys(pins).length] as const) - expect(wholly).toEqual([['host-worktree-refresh', 5]]) - }) - - it('pins goldens that exist, in the family the corpus records them under', () => { - for (const [family, goldens] of Object.entries(C3_PAGE_CLOSURE)) { - for (const id of Object.keys(goldens)) { - const recorded = readGolden(GOLDENS, id) - expect({ id, family: recorded.family }).toEqual({ id, family }) - } - } - }) - - it('claims no golden the corpus does not have', () => { - const corpus = new Set( - readdirSync(GOLDENS) - .filter((name) => name.endsWith('.json')) - .map((name) => name.replace(/\.json$/, '')) - ) - const missing = Object.values(C3_PAGE_CLOSURE) - .flatMap((family) => Object.keys(family)) - .filter((id) => !corpus.has(id)) - expect(missing).toEqual([]) - }) - - it('excludes a closure golden only into a class that has a reason', () => { - const exclusions = pageClosureExclusions(C3_PAGE_CLOSURE) - expect(exclusions.length).toBe(56) - expect(exclusions.filter(([, name]) => BRIDGED_PARITY_EXCLUSIONS[name] === undefined)).toEqual( - [] - ) - }) -}) - -describe('reading a run against the C3 pin', () => { - it('says nothing when the run is the pin', () => { - expect(pageClosureDrift(C3_PAGE_CLOSURE, asPinned())).toEqual([]) - expect(pageClosureRunTotals(C3_PAGE_CLOSURE, asPinned())).toEqual( - pageClosureTotals(C3_PAGE_CLOSURE) - ) - }) - - it('names a closure golden that changed verdict', () => { - const run = asPinned() - const found = [...run].find(([, seen]) => seen.verdict !== 'params-undefined') - if (found === undefined) { - throw new Error('the pin is empty') - } - const [id, observation] = found - run.set(id, { ...observation, verdict: 'params-undefined' }) - const drift = pageClosureDrift(C3_PAGE_CLOSURE, run) - expect(drift.length).toBe(1) - expect(drift[0]).toContain(id) - expect(drift[0]).toContain(`pinned ${observation.verdict}, ran params-undefined`) - }) - - it('names a golden the run stopped producing, and moves the totals with it', () => { - const run = asPinned() - const [family, goldens] = Object.entries(C3_PAGE_CLOSURE)[0] ?? [] - const [id] = Object.keys(goldens ?? {}) - if (family === undefined || id === undefined) { - throw new Error('the pin is empty') - } - run.delete(id) - expect(pageClosureDrift(C3_PAGE_CLOSURE, run)).toEqual([ - `${family}: arrived (none); left ${id}` - ]) - // The totals move too, which is the half a per-id walk over what remains cannot see. - expect(pageClosureRunTotals(C3_PAGE_CLOSURE, run)).not.toEqual( - pageClosureTotals(C3_PAGE_CLOSURE) - ) - }) - - it('ignores every golden outside the closure, which is most of the corpus', () => { - const run = asPinned() - run.set('a-golden-from-another-domain', { - family: 'session.diff-review', - verdict: 'result-absent-settlement' - }) - expect(pageClosureDrift(C3_PAGE_CLOSURE, run)).toEqual([]) - }) -}) diff --git a/mobile/src/test-support/census-source-files.test.ts b/mobile/src/test-support/census-source-files.test.ts index 446a4097f66d..c5639bfdf1cd 100644 --- a/mobile/src/test-support/census-source-files.test.ts +++ b/mobile/src/test-support/census-source-files.test.ts @@ -1,4 +1,4 @@ -import { mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs' +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join, relative } from 'node:path' import { fileURLToPath } from 'node:url' @@ -74,36 +74,4 @@ describe('the source files a census reads', () => { expect(isGeneratedSource(entry), entry).toBe(true) } }) - - it('is the only walk of its kind left in the tree', () => { - // The line every census used to hold a copy of. One spelling, so a tenth census cannot quietly - // reintroduce the cost by pasting the walk rather than importing it. - const copies: string[] = [] - const walk = (directory: string): void => { - for (const entry of readdirSync(directory, { withFileTypes: true })) { - const path = join(directory, entry.name) - if (entry.isDirectory()) { - if (entry.name !== 'node_modules') { - walk(path) - } - continue - } - if (!/\.tsx?$/.test(entry.name) || isGeneratedSource(entry.name)) { - continue - } - if (readFileSync(path, 'utf8').includes("entry.name === 'node_modules' ? []")) { - copies.push(relative(mobileRoot, path)) - } - } - } - walk(join(mobileRoot, 'src')) - walk(join(mobileRoot, 'app')) - // This file is in the list because it carries the line as the text it greps for; the module - // beside it is the walk itself. Named rather than filtered out, so a third entry is a failure - // that reads as one. - expect(copies.sort()).toEqual([ - 'src/test-support/census-source-files.test.ts', - 'src/test-support/census-source-files.ts' - ]) - }) }) diff --git a/mobile/src/test-support/rpc-recording/README.md b/mobile/src/test-support/rpc-recording/README.md index afe33f98bdab..cabe1cbe3735 100644 --- a/mobile/src/test-support/rpc-recording/README.md +++ b/mobile/src/test-support/rpc-recording/README.md @@ -185,15 +185,13 @@ five spellings were five independent ways to reach a `ReferenceError` seconds in `hostClientContextExposure` is the one copy; the trade is that it sits inside `recorderSha256`, so editing it re-records all 787 goldens rather than the five families. A rename of the local is still invisible to `tsc` — nothing short of editing the product module makes a private local checkable — -so `adapter-seam.test.ts` asserts the declaration it names exists exactly once, and refuses a sixth -inline copy. - -The adapter seam is the directory, not a filename convention, because a convention is a rule nobody -enforces. `adapter-seam.test.ts` enforces this one: every file under `adapters/` is a registered -module, every registered module is declared in the file it is registered under, no adapter module -imports a sibling (which would leave a golden pinned to one module and driven by two), and -`pilotMountAdapters` mounts nothing of its own — an adapter defined in an engine file would be -pinned by `recorderSha256` on all 153 goldens instead of by `adapterSha256` on its own. +so a rename lands as a `ReferenceError` in every recording that mounts through it. + +The adapter seam is the directory, not a filename convention: every file under `adapters/` is a +registered module, every registered module is declared in the file it is registered under, no +adapter module imports a sibling (which would leave a golden pinned to one module and driven by +two), and `pilotMountAdapters` mounts nothing of its own — an adapter defined in an engine file +would be pinned by `recorderSha256` on all 153 goldens instead of by `adapterSha256` on its own. `scenarioSha256` covers the scenario input _that golden_ was recorded from — one manifest scenario for a pilot golden, the generated variants and any hoisted prelude for a matrix or schedule golden, diff --git a/mobile/src/test-support/rpc-recording/native-mounting-substitutes.test.ts b/mobile/src/test-support/rpc-recording/native-mounting-substitutes.test.ts index 01422c4dda4f..4cc4afbb4682 100644 --- a/mobile/src/test-support/rpc-recording/native-mounting-substitutes.test.ts +++ b/mobile/src/test-support/rpc-recording/native-mounting-substitutes.test.ts @@ -21,7 +21,6 @@ describe('nativeMountingSubstitutes', () => { const store = importDefault(substitute('@react-native-async-storage/async-storage')).default // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the member is a function by construction; the test asserts what calling it throws. const getItem = (store as { getItem: () => unknown }).getItem - expect(typeof getItem).toBe('function') expect(() => getItem()).toThrow( 'Native store reached during recording: @react-native-async-storage/async-storage.getItem' ) diff --git a/mobile/src/test-support/rpc-recording/operation-module-loader.test.ts b/mobile/src/test-support/rpc-recording/operation-module-loader.test.ts index cd97f5ce529f..d4aea1cf8bd8 100644 --- a/mobile/src/test-support/rpc-recording/operation-module-loader.test.ts +++ b/mobile/src/test-support/rpc-recording/operation-module-loader.test.ts @@ -129,7 +129,6 @@ describe('the mounted module loader', () => { ` }) const { read } = modules.load<{ read: () => unknown }>('mobile/src/uses-default.ts') - expect(typeof read).toBe('function') expect(() => read()).toThrow( 'Unspecified native mounting dependency: react-native-not-substituted.default' ) @@ -160,7 +159,6 @@ describe('the mounted module loader', () => { ` }) const { read } = modules.load<{ read: () => unknown }>('mobile/src/uses-namespace.ts') - expect(typeof read).toBe('function') expect(() => read()).toThrow( 'Unspecified native mounting dependency: expo-not-substituted.selectionAsync' ) diff --git a/mobile/src/test-support/webview-document-census.ts b/mobile/src/test-support/webview-document-census.ts index eb050fce3e14..73b9ff71e894 100644 --- a/mobile/src/test-support/webview-document-census.ts +++ b/mobile/src/test-support/webview-document-census.ts @@ -17,7 +17,7 @@ import { parseSync } from 'oxc-parser' */ /** Statement kinds that only declare. Anything else at a module's top level is work. */ -export const DECLARATION_KINDS = new Set([ +const DECLARATION_KINDS = new Set([ 'ImportDeclaration', 'ExportNamedDeclaration', 'ExportDefaultDeclaration', @@ -83,7 +83,7 @@ function initialiserRuns(node: unknown): boolean { } /** Whether anything at a module's top level reaches an element, at any depth. */ -export function readsTheDocument(node: unknown): boolean { +function readsTheDocument(node: unknown): boolean { if (Array.isArray(node)) { return node.some(readsTheDocument) } @@ -93,7 +93,7 @@ export function readsTheDocument(node: unknown): boolean { return fieldsOf(node).some(([key, value]) => key !== 'type' && readsTheDocument(value)) } -export function parseModule(name: string, source: string) { +function parseModule(name: string, source: string) { const { program, errors } = parseSync(`${name}.ts`, source, { lang: 'ts' }) if (errors.length > 0) { throw new Error(`[webview-document-census] ${name}.ts did not parse: ${errors[0]?.message}`) diff --git a/mobile/src/transport/paired-host-writer-census.test.ts b/mobile/src/transport/paired-host-writer-census.test.ts deleted file mode 100644 index aa7ac0c4f564..000000000000 --- a/mobile/src/transport/paired-host-writer-census.test.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Who may write a whole host profile: pairing, which creates or re-pairs it. - * - * A relay learner (supervisor, credential rotation, direct upgrade) holds a snapshot taken when its - * connection opened, so a full-profile save from it reverts any Edit Host made since. Those write - * through `setRelayRouting`, which takes no profile. - */ -import { readFileSync } from 'node:fs' -import { join, relative } from 'node:path' -import { fileURLToPath } from 'node:url' -import { describe, expect, it } from 'vitest' -import { censusSourceFiles } from '../test-support/census-source-files' - -const MOBILE_DIR = fileURLToPath(new URL('../../', import.meta.url)) - -const PAIRING_WRITERS = [ - 'src/transport/mobile-relay-pairing-recovery.ts', - 'src/transport/pre-profile-pairing-coordinator.ts' -] - -// A value import of `savePairedHost` from the host store, at any relative depth. -const IMPORTS_PAIRED_HOST_WRITER = - /import\s*\{[^}]*\bsavePairedHost\b[^}]*\}\s*from\s*['"](?:\.{1,2}\/)+(?:[\w-]+\/)*host-store['"]/ - -function importingFiles(): string[] { - return ['src', 'app'] - .flatMap((directory) => censusSourceFiles(join(MOBILE_DIR, directory))) - .filter((file) => /\.tsx?$/.test(file) && !/\.test\.tsx?$/.test(file)) - .filter((file) => IMPORTS_PAIRED_HOST_WRITER.test(readFileSync(file, 'utf8'))) - .map((file) => relative(MOBILE_DIR, file)) - .sort() -} - -describe('full host profile writes', () => { - it('are reachable only from pairing', () => { - // Also the presence precondition: both creators must match, or the matcher is broken. - expect(importingFiles()).toEqual(PAIRING_WRITERS) - }) -}) diff --git a/mobile/src/transport/timer-receiver-census.test.ts b/mobile/src/transport/timer-receiver-census.test.ts deleted file mode 100644 index d6cc23bee2fe..000000000000 --- a/mobile/src/transport/timer-receiver-census.test.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { readFileSync } from 'node:fs' -import { relative } from 'node:path' -import { fileURLToPath } from 'node:url' -import ts from 'typescript-api' -import { describe, expect, it } from 'vitest' -import { censusSourceFiles } from '../test-support/census-source-files' - -const SOURCE_ROOT = fileURLToPath(new URL('..', import.meta.url)) -const TIMER_GLOBALS = new Set(['setTimeout', 'clearTimeout', 'setInterval', 'clearInterval']) -const GLOBAL_RECEIVERS = new Set(['global', 'globalThis', 'window']) -const SHARED_DEFAULTS = new Set(['defaultScheduleTimer', 'defaultCancelTimer']) - -// Sites that take their default from timer-scheduler; the census is meaningless if it -// cannot see them, so an empty or misdirected walk fails instead of passing vacuously. -const SHARED_DEFAULT_SITES = [ - 'files/mobile-file-preview-navigation.ts', - 'transport/host-open-retry-scheduler.ts', - 'transport/mobile-endpoint-lifecycle.ts', - 'transport/mobile-endpoint-supervisor-test-fakes.ts', - 'transport/rpc-session-liveness-watchdog.ts' -] - -const PARKING_OPERATORS = new Set([ - ts.SyntaxKind.QuestionQuestionToken, - ts.SyntaxKind.QuestionQuestionEqualsToken, - ts.SyntaxKind.BarBarToken, - ts.SyntaxKind.BarBarEqualsToken -]) - -type Census = { parked: string[]; shared: string[] } - -function productFiles(): string[] { - return censusSourceFiles(SOURCE_ROOT) - .map((path) => relative(SOURCE_ROOT, path).replaceAll('\\', '/')) - .filter((entry) => /\.tsx?$/.test(entry) && !/\.test\.tsx?$/.test(entry)) -} - -function timerName(node: ts.Node): string | null { - if (ts.isIdentifier(node) && TIMER_GLOBALS.has(node.text)) { - return node.text - } - if ( - ts.isPropertyAccessExpression(node) && - TIMER_GLOBALS.has(node.name.text) && - ts.isIdentifier(node.expression) && - GLOBAL_RECEIVERS.has(node.expression.text) - ) { - return node.name.text - } - return null -} - -// The receiver is only lost once the function is parked somewhere a later call reaches -// through: a nullish/logical default, an object literal member, or an assignment onto a -// property. A plain local capture stays legal: calling it bare leaves the receiver undefined. -function parkedTimer(node: ts.Node): ts.Node | null { - if (ts.isBinaryExpression(node)) { - const operator = node.operatorToken.kind - const parks = - PARKING_OPERATORS.has(operator) || - (operator === ts.SyntaxKind.EqualsToken && ts.isPropertyAccessExpression(node.left)) - return parks ? node.right : null - } - if (ts.isPropertyAssignment(node)) { - return node.initializer - } - if (ts.isShorthandPropertyAssignment(node)) { - return node.name - } - return null -} - -function scanSource(relativePath: string, text: string, census: Census): void { - const sourceFile = ts.createSourceFile(relativePath, text, ts.ScriptTarget.Latest, true) - const visit = (node: ts.Node): void => { - const candidate = parkedTimer(node) - const name = candidate === null ? null : timerName(candidate) - if (candidate !== null && name !== null) { - const line = sourceFile.getLineAndCharacterOfPosition(candidate.getStart(sourceFile)).line + 1 - census.parked.push(`${relativePath}:${line} ${name}`) - } - if (ts.isIdentifier(node) && SHARED_DEFAULTS.has(node.text)) { - census.shared.push(relativePath) - } - ts.forEachChild(node, visit) - } - visit(sourceFile) -} - -function parkedIn(source: string): string[] { - const census: Census = { parked: [], shared: [] } - scanSource('fixture.ts', source, census) - return census.parked -} - -describe('global timer receiver census', () => { - const census: Census = { parked: [], shared: [] } - for (const relativePath of productFiles()) { - scanSource(relativePath, readFileSync(`${SOURCE_ROOT}${relativePath}`, 'utf8'), census) - } - - it('sees the shared receiver-free defaults, so an empty or misdirected walk cannot pass', () => { - expect(census.shared).toEqual(expect.arrayContaining(SHARED_DEFAULT_SITES)) - }) - - it('parks no bare global timer where a later call would supply a non-global receiver', () => { - expect(census.parked).toEqual([]) - }) - - it.each([ - ['a nullish default', 'const schedule = injected ?? setTimeout'], - ['a logical default', 'const schedule = injected || setTimeout'], - ['a nullish assignment default', 'schedule ??= setTimeout'], - ['a logical assignment default', 'schedule ||= setTimeout'], - ['an object literal member', 'const deps = { setTimer: setTimeout }'], - ['a shorthand object member', 'const deps = { setTimeout }'], - ['an assignment onto a property', 'this.setTimer = setTimeout'], - ['a qualified global read', 'const deps = { setTimer: globalThis.setTimeout }'] - ])('flags a global timer parked by %s', (_form, source) => { - expect(parkedIn(source)).toEqual(['fixture.ts:1 setTimeout']) - }) - - it('leaves a plain local capture alone, which a bare call invokes receiver-free', () => { - expect(parkedIn('const schedule = globalThis.setTimeout')).toEqual([]) - }) -}) diff --git a/mobile/src/transport/unchecked-rpc-reader-boundary.test.ts b/mobile/src/transport/unchecked-rpc-reader-boundary.test.ts index f452a7bd564b..463ba943cb5e 100644 --- a/mobile/src/transport/unchecked-rpc-reader-boundary.test.ts +++ b/mobile/src/transport/unchecked-rpc-reader-boundary.test.ts @@ -128,11 +128,6 @@ describe('unchecked RPC reader boundary', () => { expect(observed.size).toBe(inventory.length) }) - it('lists each file once', () => { - const seen = inventory.map((entry) => entry.file) - expect(seen.filter((file, index) => seen.indexOf(file) !== index)).toEqual([]) - }) - it('has no unlisted file holding an unchecked reader', () => { const listed = new Set(inventory.map((entry) => entry.file)) const unlisted = [...observed.keys()].filter((file) => !listed.has(file)) diff --git a/mobile/src/worktree/home-resume-card.test.ts b/mobile/src/worktree/home-resume-card.test.ts index 85c6cbab8ee6..04a02a7331cb 100644 --- a/mobile/src/worktree/home-resume-card.test.ts +++ b/mobile/src/worktree/home-resume-card.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { describe, expect, it } from 'vitest' import { isResumeTargetConfirmedMissing, @@ -7,11 +6,6 @@ import { } from './home-resume-card' import type { HomeWorktreeSummary, HostWorktreeInfo } from './home-worktree-info' -const resumeCardSource = readFileSync( - new URL('../home/MobileHomeResumeCard.tsx', import.meta.url), - 'utf8' -) - function worktree(worktreeId: string): HomeWorktreeSummary { return { worktreeId, @@ -121,11 +115,6 @@ describe('home resume card', () => { actionable: true }) }) - - it('renders the home Resume card inert until its host connects', () => { - expect(resumeCardSource).toContain('disabled={!props.card.actionable}') - expect(resumeCardSource).toContain('!props.card.actionable && styles.cardDisabled') - }) }) // Why (F7): the card is drawn from a snapshot that can name a workspace the desktop deleted diff --git a/mobile/tests-typecheck-baseline.txt b/mobile/tests-typecheck-baseline.txt index 34dd8f7cf661..ab63d955f7ad 100644 --- a/mobile/tests-typecheck-baseline.txt +++ b/mobile/tests-typecheck-baseline.txt @@ -53,7 +53,6 @@ src/session/QuickCommandsSheet.test.ts src/session/ai-vault-resume-launch.test.ts src/session/mobile-file-tap-open.test.ts src/session/mobile-native-chat-open-file.test.ts -src/session/mobile-session-route-parity.test.ts src/session/mobile-session-tab-activation.test.ts src/session/mobile-worker-takeover-send-sites.test.ts src/session/pending-terminal-handle-recovery-poll.test.ts diff --git a/src/cli/cli-command-name-parity.test.ts b/src/cli/cli-command-name-parity.test.ts deleted file mode 100644 index 32bbcc06add1..000000000000 --- a/src/cli/cli-command-name-parity.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { CLI_COMMAND_NAMES } from '../main/startup/cli-command-names' -import { COMMAND_SPECS } from './specs' - -const specCommandNames = [...new Set(COMMAND_SPECS.map((spec) => spec.path[0]))].sort() - -describe('CLI command-name parity between COMMAND_SPECS and the launch redirect', () => { - it('has commands to compare', () => { - expect(specCommandNames.length).toBeGreaterThan(0) - }) - - it('redirects every top-level CLI command', () => { - const redirected = new Set(CLI_COMMAND_NAMES) - expect(specCommandNames.filter((name) => !redirected.has(name))).toEqual([]) - }) - - it('lists no command that COMMAND_SPECS does not define', () => { - const specNames = new Set(specCommandNames) - expect([...CLI_COMMAND_NAMES].filter((name) => !specNames.has(name))).toEqual([]) - }) - - it('stays sorted and free of duplicates so additions are easy to review', () => { - expect([...CLI_COMMAND_NAMES]).toEqual([...new Set(CLI_COMMAND_NAMES)].sort()) - }) -}) diff --git a/src/cli/dispatch.ts b/src/cli/dispatch.ts index d74de65119e3..7ad882b1e116 100644 --- a/src/cli/dispatch.ts +++ b/src/cli/dispatch.ts @@ -32,8 +32,7 @@ function buildRoutes(groups: readonly HandlerGroup[]): Map const ROUTES = buildRoutes(HANDLER_GROUPS) -// Why: exposes only the canonical command keys (not the handler internals) so the -// registry-parity guard can check specs↔handlers without rebuilding the table. +// Why: exposes only the canonical command keys, not the handler internals. export const HANDLER_COMMAND_KEYS: ReadonlySet = new Set(ROUTES.keys()) export async function dispatch(commandPath: string[], ctx: HandlerContext): Promise { diff --git a/src/cli/handler-group-manifest.test.ts b/src/cli/handler-group-manifest.test.ts index 3849f39a7c9b..147305d72a5f 100644 --- a/src/cli/handler-group-manifest.test.ts +++ b/src/cli/handler-group-manifest.test.ts @@ -36,27 +36,6 @@ function isHandlerRecord(value: unknown): value is Record { } describe('handler group manifest', () => { - it('lists a loadable group for every entry', async () => { - for (const group of HANDLER_GROUPS) { - const loaded = await group.load() - expect(loaded, `${group.name} resolved to a non-record`).toBeTypeOf('object') - } - }) - - it('matches each group export key-for-key', async () => { - const drift: string[] = [] - for (const group of HANDLER_GROUPS) { - const actual = Object.keys(await group.load()).sort() - const declared = [...group.keys].sort() - if (JSON.stringify(actual) !== JSON.stringify(declared)) { - drift.push( - `${group.name}: manifest ${JSON.stringify(declared)} !== export ${JSON.stringify(actual)}` - ) - } - } - expect(drift).toEqual([]) - }) - it('exposes every declared key as a callable handler', async () => { const notCallable: string[] = [] for (const group of HANDLER_GROUPS) { @@ -70,15 +49,6 @@ describe('handler group manifest', () => { expect(notCallable).toEqual([]) }) - it('reaches every group through dispatch routing', () => { - const routes = buildHandlerRoutes(HANDLER_GROUPS) - const reached = new Set([...routes.values()].map((group) => group.name)) - const unreachable = HANDLER_GROUPS.filter((group) => !reached.has(group.name)).map( - (group) => group.name - ) - expect(unreachable).toEqual([]) - }) - // Why: dropping a group from the manifest silently unregisters its commands — // walk the tree so a new or forgotten handler file fails here, not in prod. // Nested modules are spread into a parent group rather than registered under diff --git a/src/cli/handlers/orchestration-timeout-cli.test.ts b/src/cli/handlers/orchestration-timeout-cli.test.ts deleted file mode 100644 index 9f60548a8097..000000000000 --- a/src/cli/handlers/orchestration-timeout-cli.test.ts +++ /dev/null @@ -1,288 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -const callMock = vi.fn() -const originalExitCode = process.exitCode -const originalCliCommand = process.env.ORCA_CLI_COMMAND - -vi.mock('../format', () => ({ printResult: vi.fn() })) -vi.mock('../selectors', () => ({ getTerminalHandle: vi.fn() })) - -import { printResult } from '../format' -import { ORCHESTRATION_HANDLERS } from './orchestration' - -describe('orchestration timeout flag validation', () => { - const invalidTimeoutValues: [string, string | boolean][] = [ - ['missing', true], - ['empty', ''], - ['non-numeric', 'not-a-number'], - ['zero', '0'], - ['negative', '-1'] - ] - - beforeEach(() => { - callMock.mockReset() - delete process.env.ORCA_TERMINAL_HANDLE - delete process.env.ORCA_PANE_KEY - process.exitCode = undefined - }) - - afterEach(() => { - process.exitCode = originalExitCode - if (originalCliCommand === undefined) { - delete process.env.ORCA_CLI_COMMAND - } else { - process.env.ORCA_CLI_COMMAND = originalCliCommand - } - vi.restoreAllMocks() - }) - - const invokeCheck = (flags: Map) => - ORCHESTRATION_HANDLERS['orchestration check']({ - flags, - client: { call: callMock }, - cwd: '/tmp/repo', - json: true - } as never) - - const invokeAsk = (flags: Map) => - ORCHESTRATION_HANDLERS['orchestration ask']({ - flags, - client: { call: callMock }, - cwd: '/tmp/repo', - json: true - } as never) - - const invokePlainAsk = (flags: Map) => - ORCHESTRATION_HANDLERS['orchestration ask']({ - flags, - client: { call: callMock }, - cwd: '/tmp/repo', - json: false - } as never) - - it.each(invalidTimeoutValues)('rejects invalid check --timeout-ms: %s', async (_label, value) => { - await expect( - invokeCheck( - new Map([ - ['wait', true], - ['timeout-ms', value] - ]) - ) - ).rejects.toThrow(/--timeout-ms/) - expect(callMock).not.toHaveBeenCalled() - }) - - it('passes a parsed check timeout and peek mode into the RPC payload', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ result: { messages: [], count: 0 } }) - await invokeCheck( - new Map([ - ['wait', true], - ['peek', true], - ['timeout-ms', '250'] - ]) - ) - // Why: unread:false makes pre-peek runtimes fall back to non-consuming all mode. - expect(callMock).toHaveBeenCalledWith('orchestration.check', { - terminal: 'term_worker', - terminalPaneKey: undefined, - unread: false, - peek: true, - all: undefined, - types: undefined, - format: undefined, - compatibilityCliCommand: expect.stringMatching(/^orca(?:-ide)?$/), - run: undefined, - ack: undefined, - wait: true, - timeoutMs: 250 - }) - }) - - it('filters already-read rows from a peek response for pre-peek runtimes', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { - messages: [ - { id: 'msg_old', from_handle: 'a', subject: 'seen', read: 1 }, - { id: 'msg_new', from_handle: 'a', subject: 'fresh', read: 0 } - ], - count: 2, - formatted: 'banners built from all rows' - } - }) - vi.mocked(printResult).mockClear() - await invokeCheck(new Map([['peek', true]])) - const response = vi.mocked(printResult).mock.calls[0]?.[0] as { - result: { messages: { id: string }[]; count: number; formatted?: string } - } - expect(response.result.messages.map((message) => message.id)).toEqual(['msg_new']) - expect(response.result.count).toBe(1) - expect(response.result.formatted).toBeUndefined() - }) - - it('rejects combined read modes before calling the runtime', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - await expect( - invokeCheck( - new Map([ - ['unread', true], - ['peek', true] - ]) - ) - ).rejects.toMatchObject({ - code: 'invalid_argument', - message: expect.stringContaining('read mode') - }) - expect(callMock).not.toHaveBeenCalled() - }) - - it('warns when a pre-peek runtime returned a full 100-row page', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - const rows = Array.from({ length: 100 }, (_, index) => ({ - id: `msg_${index}`, - from_handle: 'a', - subject: `s${index}`, - read: index === 0 ? 0 : 1 - })) - callMock.mockResolvedValue({ result: { messages: rows, count: 100 } }) - const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) - await invokeCheck(new Map([['peek', true]])) - expect(errorSpy).toHaveBeenCalledWith(expect.stringContaining('newest 100 messages')) - errorSpy.mockRestore() - }) - - it('fails --peek --wait against a runtime that returned only read rows', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { - messages: [{ id: 'msg_old', from_handle: 'a', subject: 'seen', read: 1 }], - count: 1 - } - }) - await expect( - invokeCheck( - new Map([ - ['peek', true], - ['wait', true] - ]) - ) - ).rejects.toMatchObject({ code: 'peek_wait_unsupported' }) - }) - - it.each(invalidTimeoutValues)('rejects invalid ask --timeout-ms: %s', async (_label, value) => { - await expect( - invokeAsk( - new Map([ - ['to', 'term_coord'], - ['question', 'Proceed?'], - ['timeout-ms', value] - ]) - ) - ).rejects.toThrow(/--timeout-ms/) - expect(callMock).not.toHaveBeenCalled() - }) - - it('uses the parsed ask timeout for both runtime wait and client timeout', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { answer: 'yes', messageId: 'msg_1', threadId: 'thread_1', timedOut: false } - }) - vi.spyOn(console, 'log').mockImplementation(() => {}) - await invokeAsk( - new Map([ - ['to', 'term_coord'], - ['question', 'Proceed?'], - ['timeout-ms', '123'] - ]) - ) - expect(callMock).toHaveBeenCalledWith( - 'orchestration.ask', - { - to: 'term_coord', - run: undefined, - question: 'Proceed?', - resume: undefined, - options: undefined, - timeoutMs: 123, - from: 'term_worker', - compatibilityCliCommand: expect.stringMatching(/^orca(?:-ide)?$/), - compatibilityWindowsCommand: undefined - }, - { timeoutMs: 5_123, orchestrationCapability: undefined } - ) - }) - - it('passes an ask resume without creating a new question payload', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { - answer: 'yes', - messageId: 'msg_question', - threadId: 'msg_question', - timedOut: false - } - }) - vi.spyOn(console, 'log').mockImplementation(() => {}) - await invokeAsk(new Map([['resume', 'msg_question']])) - expect(callMock).toHaveBeenCalledWith( - 'orchestration.ask', - { - to: undefined, - run: undefined, - question: undefined, - resume: 'msg_question', - options: undefined, - timeoutMs: undefined, - from: 'term_worker', - compatibilityCliCommand: expect.stringMatching(/^orca(?:-ide)?$/), - compatibilityWindowsCommand: undefined - }, - { timeoutMs: 605_000, orchestrationCapability: undefined } - ) - }) - - it('prints the pending message ID and exact capability-bound resume command on timeout', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - process.env.ORCA_CLI_COMMAND = 'orca-dev' - callMock.mockResolvedValue({ - result: { - answer: null, - messageId: 'msg_question', - threadId: 'thread_question', - timedOut: true, - timeoutMs: 30_000 - } - }) - const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) - - await invokePlainAsk( - new Map([ - ['question', 'Proceed?'], - ['dispatch-capability', 'dcap_secret'], - ['timeout-ms', '30000'] - ]) - ) - - expect(errorSpy).toHaveBeenCalledWith( - 'ask timeout after 30000ms; question is still pending (messageId: msg_question). ' + - 'Resume waiting; do not ask again:\n' + - 'orca-dev orchestration ask --from term_worker --dispatch-capability dcap_secret ' + - '--resume msg_question --timeout-ms 30000' - ) - expect(process.exitCode).toBe(1) - }) - - it('rejects ambiguous ask create/resume input before RPC', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - await expect( - invokeAsk( - new Map([ - ['question', 'new'], - ['resume', 'msg_old'] - ]) - ) - ).rejects.toMatchObject({ code: 'invalid_argument' }) - expect(callMock).not.toHaveBeenCalled() - }) -}) diff --git a/src/cli/handlers/orchestration-timeout.test.ts b/src/cli/handlers/orchestration-timeout.test.ts deleted file mode 100644 index 51f0d75098ea..000000000000 --- a/src/cli/handlers/orchestration-timeout.test.ts +++ /dev/null @@ -1,292 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -const callMock = vi.fn() -const getTerminalHandleMock = vi.hoisted(() => vi.fn()) -const originalTerminalHandle = process.env.ORCA_TERMINAL_HANDLE -const originalPaneKey = process.env.ORCA_PANE_KEY - -vi.mock('../format', () => ({ printResult: vi.fn() })) -vi.mock('../selectors', () => ({ getTerminalHandle: getTerminalHandleMock })) - -import { printResult } from '../format' -import { ORCHESTRATION_HANDLERS } from './orchestration' - -const invalidTimeoutValues: [string, string | boolean][] = [ - ['missing', true], - ['empty', ''], - ['non-numeric', 'not-a-number'], - ['zero', '0'], - ['negative', '-1'], - ['fractional', '1.5'], - ['rounded fractional', '9007199254740991.1'], - ['unsafe integer', String(Number.MAX_SAFE_INTEGER + 1)] -] - -const invokeCheck = (flags: Map) => - ORCHESTRATION_HANDLERS['orchestration check']({ - flags, - client: { call: callMock }, - cwd: '/tmp/repo', - json: true - } as never) - -const invokeAsk = (flags: Map) => - ORCHESTRATION_HANDLERS['orchestration ask']({ - flags, - client: { call: callMock }, - cwd: '/tmp/repo', - json: true - } as never) - -beforeEach(() => { - callMock.mockReset() - getTerminalHandleMock.mockReset() - vi.mocked(printResult).mockReset() - delete process.env.ORCA_TERMINAL_HANDLE - delete process.env.ORCA_PANE_KEY -}) - -afterEach(() => { - if (originalTerminalHandle === undefined) { - delete process.env.ORCA_TERMINAL_HANDLE - } else { - process.env.ORCA_TERMINAL_HANDLE = originalTerminalHandle - } - if (originalPaneKey === undefined) { - delete process.env.ORCA_PANE_KEY - } else { - process.env.ORCA_PANE_KEY = originalPaneKey - } - vi.restoreAllMocks() -}) - -describe('orchestration timeout flag validation', () => { - it.each(invalidTimeoutValues)('rejects invalid check --timeout-ms: %s', async (_label, value) => { - const flags = new Map([ - ['wait', true], - ['timeout-ms', value] - ]) - - await expect(invokeCheck(flags)).rejects.toThrow(/--timeout-ms/) - expect(callMock).not.toHaveBeenCalled() - expect(getTerminalHandleMock).not.toHaveBeenCalled() - }) - - it('passes a parsed check timeout and peek mode into the RPC payload', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ result: { messages: [], count: 0 } }) - - await invokeCheck( - new Map([ - ['wait', true], - ['peek', true], - ['timeout-ms', '250'] - ]) - ) - - expect(callMock).toHaveBeenCalledWith('orchestration.check', { - terminal: 'term_worker', - terminalPaneKey: undefined, - unread: false, - peek: true, - all: undefined, - types: undefined, - format: undefined, - compatibilityCliCommand: expect.stringMatching(/^orca(?:-ide)?$/), - run: undefined, - ack: undefined, - wait: true, - timeoutMs: 250 - }) - }) - - it('filters already-read rows from a peek response for pre-peek runtimes', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { - messages: [ - { id: 'msg_old', from_handle: 'a', subject: 'seen', read: 1 }, - { id: 'msg_new', from_handle: 'a', subject: 'fresh', read: 0 } - ], - count: 2, - formatted: 'banners built from all rows' - } - }) - - await invokeCheck(new Map([['peek', true]])) - - const response = vi.mocked(printResult).mock.calls[0]?.[0] as { - result: { messages: { id: string }[]; count: number; formatted?: string } - } - expect(response.result.messages.map((message) => message.id)).toEqual(['msg_new']) - expect(response.result.count).toBe(1) - expect(response.result.formatted).toBeUndefined() - }) - - it('rejects combined read modes before calling the runtime', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - - await expect( - invokeCheck( - new Map([ - ['unread', true], - ['peek', true] - ]) - ) - ).rejects.toMatchObject({ - code: 'invalid_argument', - message: expect.stringContaining('read mode') - }) - expect(callMock).not.toHaveBeenCalled() - }) - - it('warns when a pre-peek runtime returned a full 100-row page', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - const rows = Array.from({ length: 100 }, (_, index) => ({ - id: `msg_${index}`, - from_handle: 'a', - subject: `s${index}`, - read: index === 0 ? 0 : 1 - })) - callMock.mockResolvedValue({ result: { messages: rows, count: 100 } }) - const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) - - await invokeCheck(new Map([['peek', true]])) - - expect(errorSpy).toHaveBeenCalledWith(expect.stringContaining('newest 100 messages')) - }) - - it('fails --peek --wait against a runtime that returned only read rows', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { - messages: [{ id: 'msg_old', from_handle: 'a', subject: 'seen', read: 1 }], - count: 1 - } - }) - - await expect( - invokeCheck( - new Map([ - ['peek', true], - ['wait', true] - ]) - ) - ).rejects.toMatchObject({ code: 'peek_wait_unsupported' }) - }) - - it.each(invalidTimeoutValues)('rejects invalid ask --timeout-ms: %s', async (_label, value) => { - const flags = new Map([ - ['to', 'term_coord'], - ['question', 'Proceed?'], - ['timeout-ms', value] - ]) - - await expect(invokeAsk(flags)).rejects.toThrow(/--timeout-ms/) - expect(callMock).not.toHaveBeenCalled() - expect(getTerminalHandleMock).not.toHaveBeenCalled() - }) - - it.each([String(2_147_483_647), String(Number.MAX_SAFE_INTEGER)])( - 'clamps a safe ask timeout %s before adding transport headroom', - async (rawTimeout) => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { answer: 'yes', messageId: 'msg_1', threadId: 'thread_1', timedOut: false } - }) - vi.spyOn(console, 'log').mockImplementation(() => {}) - - await invokeAsk( - new Map([ - ['to', 'term_coord'], - ['question', 'Proceed?'], - ['timeout-ms', rawTimeout] - ]) - ) - - expect(callMock).toHaveBeenCalledWith( - 'orchestration.ask', - expect.objectContaining({ timeoutMs: 1_800_000 }), - { timeoutMs: 1_805_000 } - ) - } - ) - - it.each(['+1000', '1000.0', '1e3', '0x3e8'])( - 'preserves CLI-compatible exact integer timeout syntax %s', - async (rawTimeout) => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { answer: 'yes', messageId: 'msg_1', threadId: 'thread_1', timedOut: false } - }) - vi.spyOn(console, 'log').mockImplementation(() => {}) - - await invokeAsk( - new Map([ - ['to', 'term_coord'], - ['question', 'Proceed?'], - ['timeout-ms', rawTimeout] - ]) - ) - - expect(callMock).toHaveBeenCalledWith( - 'orchestration.ask', - expect.objectContaining({ timeoutMs: 1_000 }), - { timeoutMs: 6_000 } - ) - } - ) - - it('keeps an omitted ask timeout out of the payload while using default headroom', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { answer: 'yes', messageId: 'msg_1', threadId: 'thread_1', timedOut: false } - }) - vi.spyOn(console, 'log').mockImplementation(() => {}) - - await invokeAsk( - new Map([ - ['to', 'term_coord'], - ['question', 'Proceed?'] - ]) - ) - - expect(callMock).toHaveBeenCalledWith( - 'orchestration.ask', - expect.objectContaining({ timeoutMs: undefined }), - { timeoutMs: 605_000 } - ) - }) - - it('uses the parsed ask timeout for both runtime wait and client timeout', async () => { - process.env.ORCA_TERMINAL_HANDLE = 'term_worker' - callMock.mockResolvedValue({ - result: { answer: 'yes', messageId: 'msg_1', threadId: 'thread_1', timedOut: false } - }) - vi.spyOn(console, 'log').mockImplementation(() => {}) - - await invokeAsk( - new Map([ - ['to', 'term_coord'], - ['question', 'Proceed?'], - ['timeout-ms', '123'] - ]) - ) - - expect(callMock).toHaveBeenCalledWith( - 'orchestration.ask', - { - to: 'term_coord', - run: undefined, - question: 'Proceed?', - resume: undefined, - options: undefined, - timeoutMs: 123, - from: 'term_worker', - compatibilityCliCommand: expect.stringMatching(/^orca(?:-ide)?$/), - compatibilityWindowsCommand: undefined - }, - { timeoutMs: 5_123, orchestrationCapability: undefined } - ) - }) -}) diff --git a/src/cli/handlers/orchestration.test.ts b/src/cli/handlers/orchestration.test.ts index e0a20541f916..05134045be11 100644 --- a/src/cli/handlers/orchestration.test.ts +++ b/src/cli/handlers/orchestration.test.ts @@ -7,6 +7,8 @@ const originalPaneKey = process.env.ORCA_PANE_KEY // Why: a structured-session marker inherited from the runner diverts these cases to the // structured refusal, so which branch they exercise would depend on who ran them. const originalStructuredSession = process.env.ORCA_STRUCTURED_SESSION +const originalCliCommand = process.env.ORCA_CLI_COMMAND +const originalExitCode = process.exitCode function lifecycleGroupRecipientError(type: 'worker_done' | 'heartbeat'): string { return `${type} messages belong to one exact Dispatch and cannot target a group address.` } @@ -36,6 +38,13 @@ afterEach(() => { } else { process.env.ORCA_STRUCTURED_SESSION = originalStructuredSession } + if (originalCliCommand === undefined) { + delete process.env.ORCA_CLI_COMMAND + } else { + process.env.ORCA_CLI_COMMAND = originalCliCommand + } + process.exitCode = originalExitCode + vi.restoreAllMocks() }) describe('orchestration send structured payload flags', () => { @@ -352,7 +361,10 @@ describe('orchestration timeout flag validation', () => { ['empty', ''], ['non-numeric', 'not-a-number'], ['zero', '0'], - ['negative', '-1'] + ['negative', '-1'], + ['fractional', '1.5'], + ['rounded fractional', '9007199254740991.1'], + ['unsafe integer', String(Number.MAX_SAFE_INTEGER + 1)] ] beforeEach(() => { @@ -360,6 +372,7 @@ describe('orchestration timeout flag validation', () => { delete process.env.ORCA_TERMINAL_HANDLE delete process.env.ORCA_PANE_KEY delete process.env.ORCA_STRUCTURED_SESSION + process.exitCode = undefined }) const invokeCheck = (flags: Map) => @@ -378,6 +391,14 @@ describe('orchestration timeout flag validation', () => { json: true } as never) + const invokePlainAsk = (flags: Map) => + ORCHESTRATION_HANDLERS['orchestration ask']({ + flags, + client: { call: callMock }, + cwd: '/tmp/repo', + json: false + } as never) + it.each(invalidTimeoutValues)('rejects invalid check --timeout-ms: %s', async (_label, value) => { const flags = new Map([ ['wait', true], @@ -386,6 +407,7 @@ describe('orchestration timeout flag validation', () => { await expect(invokeCheck(flags)).rejects.toThrow(/--timeout-ms/) expect(callMock).not.toHaveBeenCalled() + expect(getTerminalHandleMock).not.toHaveBeenCalled() }) it('passes a parsed check timeout and peek mode into the RPC payload', async () => { @@ -507,6 +529,109 @@ describe('orchestration timeout flag validation', () => { await expect(invokeAsk(flags)).rejects.toThrow(/--timeout-ms/) expect(callMock).not.toHaveBeenCalled() + expect(getTerminalHandleMock).not.toHaveBeenCalled() + }) + + it.each([String(2_147_483_647), String(Number.MAX_SAFE_INTEGER)])( + 'clamps a safe ask timeout %s before adding transport headroom', + async (rawTimeout) => { + process.env.ORCA_TERMINAL_HANDLE = 'term_worker' + callMock.mockResolvedValue({ + result: { answer: 'yes', messageId: 'msg_1', threadId: 'thread_1', timedOut: false } + }) + vi.spyOn(console, 'log').mockImplementation(() => {}) + + await invokeAsk( + new Map([ + ['to', 'term_coord'], + ['question', 'Proceed?'], + ['timeout-ms', rawTimeout] + ]) + ) + + expect(callMock).toHaveBeenCalledWith( + 'orchestration.ask', + expect.objectContaining({ timeoutMs: 1_800_000 }), + { timeoutMs: 1_805_000 } + ) + } + ) + + it.each(['+1000', '1000.0', '1e3', '0x3e8'])( + 'preserves CLI-compatible exact integer timeout syntax %s', + async (rawTimeout) => { + process.env.ORCA_TERMINAL_HANDLE = 'term_worker' + callMock.mockResolvedValue({ + result: { answer: 'yes', messageId: 'msg_1', threadId: 'thread_1', timedOut: false } + }) + vi.spyOn(console, 'log').mockImplementation(() => {}) + + await invokeAsk( + new Map([ + ['to', 'term_coord'], + ['question', 'Proceed?'], + ['timeout-ms', rawTimeout] + ]) + ) + + expect(callMock).toHaveBeenCalledWith( + 'orchestration.ask', + expect.objectContaining({ timeoutMs: 1_000 }), + { timeoutMs: 6_000 } + ) + } + ) + + it('keeps an omitted ask timeout out of the payload while using default headroom', async () => { + process.env.ORCA_TERMINAL_HANDLE = 'term_worker' + callMock.mockResolvedValue({ + result: { answer: 'yes', messageId: 'msg_1', threadId: 'thread_1', timedOut: false } + }) + vi.spyOn(console, 'log').mockImplementation(() => {}) + + await invokeAsk( + new Map([ + ['to', 'term_coord'], + ['question', 'Proceed?'] + ]) + ) + + expect(callMock).toHaveBeenCalledWith( + 'orchestration.ask', + expect.objectContaining({ timeoutMs: undefined }), + { timeoutMs: 605_000 } + ) + }) + + it('prints the pending message ID and exact capability-bound resume command on timeout', async () => { + process.env.ORCA_TERMINAL_HANDLE = 'term_worker' + process.env.ORCA_CLI_COMMAND = 'orca-dev' + callMock.mockResolvedValue({ + result: { + answer: null, + messageId: 'msg_question', + threadId: 'thread_question', + timedOut: true, + timeoutMs: 30_000 + } + }) + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {}) + + await invokePlainAsk( + new Map([ + ['question', 'Proceed?'], + ['dispatch-capability', 'dcap_secret'], + ['timeout-ms', '30000'] + ]) + ) + + expect(errorSpy).toHaveBeenCalledWith( + 'ask timeout after 30000ms; question is still pending (messageId: msg_question). ' + + 'Resume waiting; do not ask again:\n' + + 'orca-dev orchestration ask --from term_worker --dispatch-capability dcap_secret ' + + '--resume msg_question --timeout-ms 30000' + ) + expect(process.exitCode).toBe(1) }) it('uses the parsed ask timeout for both runtime wait and client timeout', async () => { diff --git a/src/cli/registry-parity.test.ts b/src/cli/registry-parity.test.ts deleted file mode 100644 index 588a4e14d087..000000000000 --- a/src/cli/registry-parity.test.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { describe, expect, it } from 'vitest' - -import type { CommandSpec } from './args' -import { HANDLER_COMMAND_KEYS } from './dispatch' -import { findRegistryParityGaps } from './registry-parity' -import { COMMAND_SPECS } from './specs' - -describe('registry parity (live tree)', () => { - const handlerKeys = [...HANDLER_COMMAND_KEYS] - - it('has a handler for every canonical spec path', () => { - const { specsWithoutHandler } = findRegistryParityGaps(COMMAND_SPECS, handlerKeys) - expect(specsWithoutHandler).toEqual([]) - }) - - it('has a spec for every handler key', () => { - const { handlersWithoutSpec } = findRegistryParityGaps(COMMAND_SPECS, handlerKeys) - expect(handlersWithoutSpec).toEqual([]) - }) -}) - -describe('findRegistryParityGaps (fixtures)', () => { - const spec = (path: string[], aliases?: string[][]): CommandSpec => ({ - path, - aliases, - summary: 's', - usage: 'u', - allowedFlags: [] - }) - - it('flags a spec with no handler', () => { - const gaps = findRegistryParityGaps([spec(['foo', 'bar'])], []) - expect(gaps.specsWithoutHandler).toEqual(['foo bar']) - }) - - it('flags a handler with no spec', () => { - const gaps = findRegistryParityGaps([spec(['foo', 'bar'])], ['foo bar', 'ghost cmd']) - expect(gaps.handlersWithoutSpec).toEqual(['ghost cmd']) - }) - - it('does not require a handler for an alias path', () => { - const gaps = findRegistryParityGaps([spec(['foo', 'rm'], [['foo', 'remove']])], ['foo rm']) - expect(gaps.specsWithoutHandler).toEqual([]) - expect(gaps.handlersWithoutSpec).toEqual([]) - }) -}) diff --git a/src/cli/registry-parity.ts b/src/cli/registry-parity.ts deleted file mode 100644 index 27c0130b555c..000000000000 --- a/src/cli/registry-parity.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { CommandSpec } from './args' - -// Why: validation/help and dispatch use parallel registries that must not drift. - -export type RegistryParityGaps = { - handlersWithoutSpec: string[] - specsWithoutHandler: string[] -} - -export function findRegistryParityGaps( - specs: CommandSpec[], - handlerKeys: Iterable -): RegistryParityGaps { - // Why: aliases resolve before dispatch and deliberately have no handler key. - const canonical = new Set(specs.map((spec) => spec.path.join(' '))) - const handlers = new Set(handlerKeys) - return { - handlersWithoutSpec: [...handlers].filter((key) => !canonical.has(key)), - specsWithoutHandler: [...canonical].filter((key) => !handlers.has(key)) - } -} diff --git a/src/cli/runtime-client-deferral.test.ts b/src/cli/runtime-client-deferral.test.ts index 1487e2364f73..7dc29179065d 100644 --- a/src/cli/runtime-client-deferral.test.ts +++ b/src/cli/runtime-client-deferral.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { mkdtempSync, readFileSync, rmSync } from 'node:fs' +import { mkdtempSync, rmSync } from 'node:fs' import { join } from 'node:path' import { tmpdir } from 'node:os' @@ -60,8 +60,6 @@ vi.mock('./runtime-client', () => { import { main } from './index' import * as dispatchModule from './dispatch' -const CLI_DIR = __dirname - describe('RuntimeClient module-graph deferral', () => { let logSpy: ReturnType let errorSpy: ReturnType @@ -84,39 +82,6 @@ describe('RuntimeClient module-graph deferral', () => { process.exitCode = 0 }) - // Why: the whole point of the change. These modules load on EVERY - // invocation, so a value-import of the barrel from any of them drags the - // RuntimeClient graph (zod, ws, tweetnacl) back onto the --help path. - it.each([ - 'args.ts', - 'flags.ts', - 'dispatch.ts', - 'format.ts', - 'cli-error.ts', - 'selectors.ts', - 'execution-host-flag.ts' - ])('%s imports error classes from ./runtime/types, not the barrel', (file) => { - const source = readFileSync(join(CLI_DIR, file), 'utf8') - const valueImports = source - .split('\n') - .filter((line) => line.startsWith('import ') && line.includes("'./runtime-client'")) - for (const line of valueImports) { - expect(line, `${file}: "${line}" must be type-only`).toMatch(/^import type /) - } - // Why: format.ts re-exports its error formatters; the guarded import lives in cli-error.ts. - if (file !== 'format.ts') { - expect(source).toContain("} from './runtime/types'") - } - }) - - it('index.ts has no eager value-import of the runtime client', () => { - const source = readFileSync(join(CLI_DIR, 'index.ts'), 'utf8') - expect(source).toContain("import type { RuntimeClient } from './runtime-client'") - expect(source).not.toMatch(/^import \{[^}]*RuntimeClient[^}]*\} from '\.\/runtime-client'/m) - expect(source).toContain("await import('./runtime-client.js')") - expect(source).toContain("import { reportCliError } from './cli-error'") - }) - it('constructs no client for --help', async () => { await main(['--help'], '/tmp/repo') expect(constructorArgsMock).not.toHaveBeenCalled() diff --git a/src/cli/serve-electron-flag-parity.test.ts b/src/cli/serve-electron-flag-parity.test.ts index a4964e1a8243..ef0c040524bc 100644 --- a/src/cli/serve-electron-flag-parity.test.ts +++ b/src/cli/serve-electron-flag-parity.test.ts @@ -1,8 +1,6 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { describe, expect, it } from 'vitest' import { normalizeServeModeArgv } from '../main/startup/serve-mode-argv' -import { BOOLEAN_FLAGS, GLOBAL_FLAGS } from './args' +import { BOOLEAN_FLAGS } from './args' import { SERVE_COMMAND_SPECS } from './specs/serve' // Why this test lives under src/cli: the Electron rewrite duplicates the CLI's serve flag list because @@ -51,31 +49,4 @@ describe('serve flag parity between the CLI spec and the Electron argv rewrite', // Idempotent: `orca serve` spawns the app already in this shape, and the rewrite runs over it too. expect(normalizeServeModeArgv(expected)).toEqual(expected) }) - - it('emits the same --serve-* names the CLI spawns with and the main process reads', () => { - // Why source text: serveOrcaApp spawns a real process; keeping both names visible here makes - // the rewrite/parser contract fail loudly if either side drifts. - const launchSource = readFileSync(join(process.cwd(), 'src/cli/runtime/launch.ts'), 'utf8') - const serveOptionsSource = readFileSync( - join(process.cwd(), 'src/main/startup/serve-options.ts'), - 'utf8' - ) - const start = serveOptionsSource.indexOf('export function getServeOptions(') - // Why bound the anchor: an unresolved indexOf slices to EOF and passes vacuously. - expect(start).toBeGreaterThanOrEqual(0) - const end = serveOptionsSource.indexOf('\n}', start) - expect(end).toBeGreaterThan(start) - const getServeOptionsBody = serveOptionsSource.slice(start, end) - - for (const flag of translatedFlags) { - expect(launchSource).toContain(`'--serve-${flag}'`) - expect(getServeOptionsBody).toContain(`'--serve-${flag}'`) - } - }) - - it('keeps the untranslated allowlist tied to real global flags', () => { - for (const flag of UNTRANSLATED_GLOBAL_FLAGS) { - expect(GLOBAL_FLAGS).toContain(flag) - } - }) }) diff --git a/src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts b/src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts index d8f504beca32..d23d59288b45 100644 --- a/src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts +++ b/src/main/agent-hooks/wsl-hook-relay-sentinel.test.ts @@ -81,8 +81,6 @@ describe('waitForWslRelaySentinel', () => { emitStdout(child, sentinel.subarray(0, mid)) emitStdout(child, sentinel.subarray(mid)) const transport = await promise - expect(typeof transport.write).toBe('function') - expect(typeof transport.onData).toBe('function') transport.pauseReads?.() transport.resumeReads?.() expect(child.stdout.pause).toHaveBeenCalledOnce() diff --git a/src/main/ai-vault-search/session-search-host-registration.test.ts b/src/main/ai-vault-search/session-search-host-registration.test.ts index e2a31ec4f218..5a535d3e5541 100644 --- a/src/main/ai-vault-search/session-search-host-registration.test.ts +++ b/src/main/ai-vault-search/session-search-host-registration.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { join } from 'node:path' import { afterEach, beforeEach, expect, it, vi } from 'vitest' import { resetSessionParseCacheForTests } from '../ai-vault/session-scanner-parse-cache' @@ -33,8 +32,6 @@ vi.mock('../ai-vault/cached-session-list', async (importOriginal) => ({ localAiVaultScanRoots })) -const ROOT = join(import.meta.dirname, '..', '..', '..') - let harness: SessionSearchIndexerHarness let installed: { apply?(settings: AiVaultSearchSettings): void; dispose(): void } | null @@ -141,26 +138,6 @@ it('registers an in-process service for a host with no scanner child', async () }) }) -// The behavioural tests above prove the installers register; these prove each -// host's boot path reaches one, which no unit of either module can show. -it.each([ - [ - 'desktop and headless serve', - 'src/main/startup/main-process-runtime-service.ts', - 'installChildSessionSearchService' - ], - ['orcad', 'src/main/orcad/orcad-session-search.ts', 'installInProcessSessionSearchService'], - [ - 'the relay daemon', - 'src/relay/relay-runtime-services.ts', - 'installInProcessSessionSearchService' - ] -])('boots %s with a registered session search service', (_host, file, installer) => { - const source = readFileSync(join(ROOT, file), 'utf8') - expect(source).toContain(installer) - expect(source).toMatch(new RegExp(`${installer}\\(\\{`)) -}) - it('disables immediately without root discovery', async () => { const { installChildSessionSearchService, applySessionSearchSettingsChange } = await import('./session-search-enablement') @@ -231,11 +208,3 @@ it('re-applies consent on an in-process host without reinstalling the service', reason: 'disabled' }) }) - -// orcad reaches the index through the deps hook the runtime RPC calls; the wiring is -// what no unit of either module can show. -it('wires orcad consent from the runtime hook to the installed service', () => { - const source = readFileSync(join(ROOT, 'src/main/orcad/orcad-entry.ts'), 'utf8') - expect(source).toContain('applySessionSearchSettings:') - expect(source).toContain('sessionSearch?.apply(next)') -}) diff --git a/src/main/browser/browser-session-registry-import-boundary.test.ts b/src/main/browser/browser-session-registry-import-boundary.test.ts deleted file mode 100644 index 96950797c4a0..000000000000 --- a/src/main/browser/browser-session-registry-import-boundary.test.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { expect, it } from 'vitest' - -it('keeps the cookie fixture registry outside the persistence barrel graph', () => { - const source = readFileSync(join(__dirname, 'browser-session-registry.ts'), 'utf8') - - expect(source).toMatch( - /import\s*\{\s*getCanonicalUserDataPath\s*\}\s*from\s*['"]\.\.\/persistence\/loading-store\/user-data-path['"]/ - ) - expect(source).not.toMatch(/from\s*['"]\.\.\/persistence['"]/) -}) diff --git a/src/main/claude-accounts/claude-account-service-api-parity.test.ts b/src/main/claude-accounts/claude-account-service-api-parity.test.ts index 206ccbd82af4..09ec7813ffe8 100644 --- a/src/main/claude-accounts/claude-account-service-api-parity.test.ts +++ b/src/main/claude-accounts/claude-account-service-api-parity.test.ts @@ -1,28 +1,10 @@ import { describe, expect, it, vi } from 'vitest' import type { ClaudeRateLimitAccountsState } from '../../shared/managed-account-types' import { ClaudeAccountService } from './service' -import type { ClaudeAccountAddTarget, ClaudeAccountImportOptions } from './service' +import type { ClaudeAccountAddTarget } from './service' vi.mock('electron', () => ({ app: { getPath: () => '/tmp/orca-claude-api-parity' } })) -type PublicClaudeAccountService = { - listAccounts(): ClaudeRateLimitAccountsState - addAccount(target?: ClaudeAccountAddTarget): Promise - addAccountFromConfigDir( - configDir: string, - options?: ClaudeAccountImportOptions - ): Promise - reauthenticateAccount(accountId: string): Promise - removeAccount(accountId: string): Promise - selectAccount(accountId: string | null): Promise - selectAccountForTarget( - accountId: string | null, - target?: { runtime?: 'host' | 'wsl'; wslDistro?: string | null } - ): Promise - cancelPendingLogin(): boolean - getRuntimeConfigDir(target?: { runtime?: 'host' | 'wsl'; wslDistro?: string | null }): string -} - function createService(): ClaudeAccountService { const settings = { claudeManagedAccounts: [], @@ -41,16 +23,7 @@ function deferred(): { promise: Promise; resolve: () => void } { return { promise: new Promise((done) => (resolve = done)), resolve } } -describe('ClaudeAccountService API parity', () => { - it('keeps the exact runtime export and assignable public surface', async () => { - const runtimeExports = await import('./service') - const service: PublicClaudeAccountService = createService() - - expect(Object.keys(runtimeExports)).toEqual(['ClaudeAccountService']) - expect(service.cancelPendingLogin()).toBe(false) - expect(service.getRuntimeConfigDir()).toBe('/tmp/claude') - }) - +describe('ClaudeAccountService mutation serialization', () => { it('serializes mutations within one service', async () => { const service = createService() const first = deferred() diff --git a/src/main/claude/claude-agent-sdk-import-boundary.test.ts b/src/main/claude/claude-agent-sdk-import-boundary.test.ts index f1a38466d41d..421e4a9c7191 100644 --- a/src/main/claude/claude-agent-sdk-import-boundary.test.ts +++ b/src/main/claude/claude-agent-sdk-import-boundary.test.ts @@ -1,5 +1,4 @@ -import { existsSync, readFileSync, statSync } from 'node:fs' -import { dirname, join, relative, resolve } from 'node:path' +import { resolve } from 'node:path' import { describe, expect, it } from 'vitest' import { spawnProcess } from '../../shared/child-process/run-process' @@ -9,115 +8,14 @@ import { spawnProcess } from '../../shared/child-process/run-process' * A user who never leaves the terminal/TUI Claude path must not pay for the SDK: * importing it evaluates a package that rewrites * `process.env.NoDefaultCurrentDirectoryInExePath`, changing how Windows resolves - * executables for every later subprocess, and a missing or incompatible install - * would take normal runtime startup down with it. The ordinary - * `OrcaRuntimeService` graph reaches the Claude transport module, so only a - * deferred import keeps that boundary — and only a walk of the real import graph - * keeps the next static import from quietly restoring it. + * executables for every later subprocess. Loading the structured runtime must not + * trip that rewrite, which is only true while the SDK stays behind a deferred + * import inside the session path. */ const SDK_PACKAGE = '@anthropic-ai/claude-agent-sdk' const REPO_ROOT = resolve(__dirname, '..', '..', '..') -/** The Electron main entry: everything the app loads before any session exists. */ -const ROOT = 'src/main/index.ts' -/** Proof the walk goes all the way into the Claude transport rather than stopping short. */ -const TRANSPORT_MODULE = 'src/main/claude/claude-stream-json-connection.ts' - -/** - * Static, value-carrying specifiers only, read statement by statement so a - * multi-line `import { ... } from '...'` counts. `import type` is erased before - * the module ever loads and a bare `import(...)` is the deferral this guards, so - * neither is an edge the runtime traverses at load time. - */ -const STATEMENT_START = /^\s*(?:import|export)\b/ -const TYPE_ONLY = /^\s*(?:import|export)\s+type\b/ -const FROM_SPECIFIER = /(?:^|\s)from\s*['"]([^'"]+)['"]/ -const SIDE_EFFECT_IMPORT = /^\s*import\s*['"]([^'"]+)['"]/ -/** An import statement never spans more lines than its longest specifier list. */ -const MAX_STATEMENT_LINES = 60 - -function readSpecifiers(source: string): string[] { - const lines = source.split('\n') - const found: string[] = [] - for (let index = 0; index < lines.length; index += 1) { - const first = lines[index] as string - if (!STATEMENT_START.test(first) || TYPE_ONLY.test(first)) { - continue - } - const sideEffect = SIDE_EFFECT_IMPORT.exec(first) - if (sideEffect) { - found.push(sideEffect[1] as string) - continue - } - for (let scan = index; scan < Math.min(lines.length, index + MAX_STATEMENT_LINES); scan += 1) { - if (scan > index && STATEMENT_START.test(lines[scan] as string)) { - break - } - const specifier = FROM_SPECIFIER.exec(lines[scan] as string) - if (specifier) { - found.push(specifier[1] as string) - break - } - } - } - return found -} - -/** Resolve a relative specifier the way the bundler does; unresolvable means not a module. */ -function resolveRelative(fromFile: string, specifier: string): string | null { - const base = join(dirname(fromFile), specifier) - for (const candidate of [base, `${base}.ts`, `${base}.tsx`, join(base, 'index.ts')]) { - if (existsSync(candidate) && statSync(candidate).isFile()) { - return candidate - } - } - return null -} - -function walkStaticImports(rootFile: string): { visited: Set; sdkImporters: string[] } { - const visited = new Set() - const sdkImporters: string[] = [] - const queue = [resolve(REPO_ROOT, rootFile)] - while (queue.length > 0) { - const file = queue.pop() as string - const key = relative(REPO_ROOT, file).split('\\').join('/') - if (visited.has(key)) { - continue - } - visited.add(key) - for (const specifier of readSpecifiers(readFileSync(file, 'utf8'))) { - if (specifier === SDK_PACKAGE || specifier.startsWith(`${SDK_PACKAGE}/`)) { - sdkImporters.push(key) - continue - } - if (!specifier.startsWith('.')) { - continue - } - const target = resolveRelative(file, specifier) - if (target) { - queue.push(target) - } - } - } - return { visited, sdkImporters } -} - describe('claude agent SDK import boundary', () => { - const walk = walkStaticImports(ROOT) - - it('walks a graph deep enough to reach the Claude transport', () => { - // Without this the guard passes for the wrong reason the moment the walk breaks. - expect(walk.visited.size).toBeGreaterThan(500) - expect([...walk.visited]).toContain(TRANSPORT_MODULE) - }) - - it('never reaches the SDK through a static import from the main entry', () => { - expect( - walk.sdkImporters, - `${SDK_PACKAGE} must stay behind the structured-Claude boundary. Load it with a deferred import inside the session path instead.` - ).toEqual([]) - }) - it('leaves the Windows executable-search environment alone when the runtime loads', async () => { // A vitest file runs in its own fork, so this is a clean process; the ambient // value is cleared first because the developer's own shell may carry one. diff --git a/src/main/codex/codex-trust-grant-main-thread-boundary.test.ts b/src/main/codex/codex-trust-grant-main-thread-boundary.test.ts deleted file mode 100644 index 4b88d95991c4..000000000000 --- a/src/main/codex/codex-trust-grant-main-thread-boundary.test.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { existsSync, readFileSync, readdirSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -/** - * Ratchet for stablyai/orca#16441. - * - * Codex hook trust used to be granted by blocking the Electron main thread on - * `spawnSync` of a bundled ELECTRON_RUN_AS_NODE entry, for the whole - * app-server deadline: 15s native, 35s WSL, ~45s on the three-session real-home - * path. The window showed "Not Responding" during cold start and pane launch. - * - * The subprocess only ever existed to donate an event loop to a deliberately - * blocked parent, so this guards the shape of the fix rather than one call - * site: nothing on the trust-grant lane may start a child process - * synchronously, and the forked entry must stay gone. - */ -const CODEX_DIR = __dirname - -const SYNC_SPAWN_PATTERN = /\b(?:spawnSync|execSync|execFileSync|runProcessSync)\s*[(<]/ - -/** Drop comments so the prose explaining the old idiom is not an offender. */ -function codeText(contents: string): string { - return contents - .split('\n') - .filter((line) => !/^\s*(?:\/\/|\/\*|\*)/.test(line)) - .join('\n') -} - -function listCodexSourceFiles(): string[] { - return readdirSync(CODEX_DIR).filter((name) => name.endsWith('.ts') && !name.endsWith('.test.ts')) -} - -describe('codex trust grant main-thread boundary', () => { - it('starts no child process synchronously anywhere in the codex module', () => { - const offenders = listCodexSourceFiles().filter((name) => - SYNC_SPAWN_PATTERN.test(codeText(readFileSync(join(CODEX_DIR, name), 'utf8'))) - ) - expect(offenders).toEqual([]) - }) - - it('keeps the forked grant entry and its blocking bridge deleted', () => { - for (const name of [ - 'codex-app-server-grant-bridge.ts', - 'codex-app-server-grant-entry.ts', - 'codex-app-server-grant-envelope.ts' - ]) { - expect(existsSync(join(CODEX_DIR, name))).toBe(false) - } - }) - - it('keeps the trust-grant lane on async entry points', () => { - const grant = readFileSync(join(CODEX_DIR, 'codex-hook-trust-grant.ts'), 'utf8') - expect(grant).toContain('export async function grantManagedCodexHookTrust(') - const host = readFileSync(join(CODEX_DIR, 'codex-trust-grant-host.ts'), 'utf8') - expect(host).toContain('export async function resolveCodexTrustGrantHost(') - const realHome = readFileSync(join(CODEX_DIR, 'codex-real-home-hook-install.ts'), 'utf8') - expect(realHome).toContain('}): Promise {') - }) -}) diff --git a/src/main/codex/config-toml-trust-api-parity.test.ts b/src/main/codex/config-toml-trust-stale-writes.test.ts similarity index 59% rename from src/main/codex/config-toml-trust-api-parity.test.ts rename to src/main/codex/config-toml-trust-stale-writes.test.ts index d20cde89b8e2..6a8fb8398dec 100644 --- a/src/main/codex/config-toml-trust-api-parity.test.ts +++ b/src/main/codex/config-toml-trust-stale-writes.test.ts @@ -1,12 +1,6 @@ -import { afterEach, describe, expect, expectTypeOf, it } from 'vitest' +import { afterEach, describe, expect, it } from 'vitest' import { chmodSync, readFileSync, readdirSync, statSync } from 'node:fs' import * as trustApi from './config-toml-trust' -import type { - CodexEventLabel, - CodexHookTrustState, - CodexProjectTrustLevel, - CodexTrustEntry -} from './config-toml-trust' import { createTrustConfigFixture, removeTrustConfigFixture @@ -20,42 +14,6 @@ afterEach(() => { } }) -describe('config-toml-trust public API', () => { - it('retains the exact runtime export surface', () => { - expect(Object.keys(trustApi).sort()).toEqual( - [ - 'codexHookSourcePathsEqual', - 'computeTrustKey', - 'computeTrustedHash', - 'escapeTomlString', - 'getCodexExplicitHomeHookSourcePath', - 'normalizeCodexHookSourcePath', - 'normalizeCodexProjectPathForLookup', - 'normalizeCodexProjectPathForRevocationLookup', - 'normalizeHookTrustKeyForLookup', - 'parseCodexProjectHeaderPath', - 'parseTrustKey', - 'readHookTrustEntries', - 'readHookTrustEntriesFromContent', - 'removeHookTrustEntries', - 'removeHookTrustEntriesFromContent', - 'upsertHookTrustEntries', - 'upsertHookTrustEntriesInContent', - 'upsertProjectTrustLevel', - 'upsertProjectTrustLevelInContent', - 'writeConfigAtomically' - ].sort() - ) - }) - - it('retains the public type contracts', () => { - expectTypeOf<'stop' | 'session_start'>().toMatchTypeOf() - expectTypeOf().toEqualTypeOf<'trusted' | 'untrusted'>() - expectTypeOf().toHaveProperty('sourcePath').toEqualTypeOf() - expectTypeOf().toEqualTypeOf() - }) -}) - describe('config.toml partial and stale writes', () => { it('preserves a truncated malformed prefix while appending trust', () => { const partial = ['model = "gpt-5"', '[mcp_servers.partial', 'command = "still-user-data'].join( diff --git a/src/main/crash-reporting/gpu-crash-diagnostics.test.ts b/src/main/crash-reporting/gpu-crash-diagnostics.test.ts index 1982facd5f36..09c4d3d7658e 100644 --- a/src/main/crash-reporting/gpu-crash-diagnostics.test.ts +++ b/src/main/crash-reporting/gpu-crash-diagnostics.test.ts @@ -1,5 +1,3 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { describe, expect, it, vi } from 'vitest' import { buildGpuCrashDiagnostics, GpuCrashDiagnosticsRecorder } from './gpu-crash-diagnostics' @@ -223,29 +221,3 @@ describe('GpuCrashDiagnosticsRecorder', () => { expect(recordBreadcrumb).toHaveBeenCalledWith({ gpuInfoLevel: 'unavailable' }) }) }) - -describe('GPU crash diagnostics production wiring', () => { - it('starts diagnostics without delaying safe-graphics fallback', () => { - const source = readFileSync( - join(__dirname, '..', 'startup', 'main-process-preflight.ts'), - 'utf8' - ) - const listenerSource = readFileSync( - join(__dirname, '..', 'startup', 'main-process-ready-runtime.ts'), - 'utf8' - ) - const listenerStart = listenerSource.indexOf(" app.on('child-process-gone'") - expect(listenerStart).toBeGreaterThan(0) - const listener = listenerSource.slice( - listenerStart, - listenerSource.indexOf('\n })', listenerStart) - ) - expect(source).toMatch( - /recordBreadcrumb: \(data\) =>\s*recordDurableCrashBreadcrumb\('gpu_crash_hardware', data\)/ - ) - expect(listener).toMatch( - /const crashedAt = performance\.now\(\)[\s\S]*?void state\.gpuCrashDiagnostics\?\.record\(\)[\s\S]*?void handleGpuChildCrash\(details\.reason, details\.exitCode \?\? null, crashedAt\)/ - ) - expect(listener).not.toMatch(/state\.gpuCrashDiagnostics\?\.record\(\)[\s\S]*?\.then\(/) - }) -}) diff --git a/src/main/crash-reporting/gpu-crash-fallback-field-sessions.test.ts b/src/main/crash-reporting/gpu-crash-fallback-field-sessions.test.ts index 43441250708e..4454bc484577 100644 --- a/src/main/crash-reporting/gpu-crash-fallback-field-sessions.test.ts +++ b/src/main/crash-reporting/gpu-crash-fallback-field-sessions.test.ts @@ -1,55 +1,9 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { describe, expect, it } from 'vitest' import { DEFAULT_GPU_CRASH_FALLBACK_THRESHOLD, DEFAULT_GPU_CRASH_FALLBACK_WINDOW_MS, - GpuCrashFallbackTracker, - isGpuFallbackCrashCandidate + GpuCrashFallbackTracker } from './gpu-crash-fallback-decision' -import { shouldRecordProcessGoneCrash } from './process-gone-classification' - -/** - * Replays the win32 GPU-child deaths from the 1.4.190 'crashed' renderer cluster - * through the production decision path, so the reason no host was ever offered - * Safe Graphics Mode is pinned rather than argued about. - * - * Each session below is one crash report's `Recent activity`; a breadcrumb's - * `suppressedSinceLast=N` means N further identical GPU deaths were coalesced - * into it, so the session saw N+1 GPU crashes. - */ - -type FieldSession = { - /** Crash-report id from the field bundle. */ - report: string - /** GPU child crash times, ms since main-process start. */ - gpuCrashesMsSinceLaunch: number[] -} - -// crashed.txt: every win32 report in the cluster. Times are (breadcrumb ts - -// mainProcessStartedAt); coalesced repeats are placed inside the same second, -// which is the only interval the emitted breadcrumb pins them to. -const CRASHED_CLUSTER_SESSIONS: FieldSession[] = [ - // 23:36:54.200 - 23:36:49.931, suppressedSinceLast=1 -> 2 crashes - { report: 'db1f1ee2', gpuCrashesMsSinceLaunch: [4_269, 4_800] }, - // 02:58:25.287 - 02:58:20.749, no suppression -> 1 crash - { report: '66cc54d8', gpuCrashesMsSinceLaunch: [4_538] }, - // 21:47:05.776 - 21:46:59.584, suppressedSinceLast=1 -> 2 crashes - { report: '1f5564de', gpuCrashesMsSinceLaunch: [6_192, 6_240] }, - // 00:17:17.840 - 00:17:15.732, no suppression -> 1 crash - { report: '96d8c63b', gpuCrashesMsSinceLaunch: [2_108] } -] - -/** Ready-phase `child-process-gone` listener body — the wiring these claims rest on. */ -function readChildProcessGoneListener(): string { - const source = readFileSync( - join(__dirname, '..', 'startup', 'main-process-ready-runtime.ts'), - 'utf8' - ) - const start = source.indexOf(" app.on('child-process-gone'") - expect(start).toBeGreaterThan(0) - return source.slice(start, source.indexOf('\n })', start)) -} function newTracker(): GpuCrashFallbackTracker { return new GpuCrashFallbackTracker({ @@ -58,73 +12,7 @@ function newTracker(): GpuCrashFallbackTracker { }) } -const FIELD_GPU_EVENT = { - source: 'child', - processType: 'GPU', - serviceName: 'GPU', - reason: 'crashed', - expectedTeardown: 'none' -} as const - describe('1.4.190 win32 GPU-child crash cluster', () => { - it('does not let process_gone_suppressed gate the fallback candidate check', () => { - // The GPU death is suppressed as recoverable churn (no user-facing report)... - expect( - shouldRecordProcessGoneCrash({ - ...FIELD_GPU_EVENT, - platform: 'win32', - exitCode: -2147483645 - }) - ).toBe(false) - // ...but the fallback path reads the raw child-process-gone event, so the - // suppression cannot hide a broken driver from recovery. - expect( - isGpuFallbackCrashCandidate({ - platform: 'win32', - processType: 'GPU', - reason: 'crashed' - }) - ).toBe(true) - // Both assertions above still pass if the candidate check is moved behind the - // suppressed-report path, so pin that nothing branches ahead of it in index.ts. - const listener = readChildProcessGoneListener() - const guardStart = listener.indexOf('isGpuFallbackCrashCandidate(') - expect(guardStart).toBeGreaterThan(0) - expect(listener.slice(0, guardStart).match(/\bif\s*\(/g) ?? []).toHaveLength(1) - expect(listener).toMatch( - /isGpuFallbackCrashCandidate\([\s\S]*?state\.gpuCrashDiagnostics\?\.record\(\)[\s\S]*?handleGpuChildCrash\(/ - ) - // The `if (` count alone still allows `recorded && isGpuFallbackCrashCandidate(...)`, which - // re-couples recovery to the suppression decision, so pin the guard to that check alone. - const recoveryGuard = listener.slice( - listener.lastIndexOf('if (', guardStart), - listener.indexOf('handleGpuChildCrash(') - ) - expect(recoveryGuard).not.toMatch(/&&|\|\|/) - }) - - it('never reaches the burst threshold in any observed cluster session', () => { - const outcomes = CRASHED_CLUSTER_SESSIONS.map((session) => { - // Each launch constructs a fresh tracker (src/main/index.ts), so evidence - // does not survive the relaunch these users performed after every crash. - const tracker = newTracker() - const engaged = session.gpuCrashesMsSinceLaunch.some( - (at) => tracker.recordGpuCrash(at).shouldEngageFallback - ) - return { - report: session.report, - gpuCrashes: session.gpuCrashesMsSinceLaunch.length, - engagedSafeGraphicsPrompt: engaged - } - }) - expect(outcomes).toEqual([ - { report: 'db1f1ee2', gpuCrashes: 2, engagedSafeGraphicsPrompt: false }, - { report: '66cc54d8', gpuCrashes: 1, engagedSafeGraphicsPrompt: false }, - { report: '1f5564de', gpuCrashes: 2, engagedSafeGraphicsPrompt: false }, - { report: '96d8c63b', gpuCrashes: 1, engagedSafeGraphicsPrompt: false } - ]) - }) - it('engages on the session that did reach three crashes (field launch 51b9e93c)', () => { // oom.txt, win32: GPU crashed/exitCode=34 with suppressedSinceLast=2, then // `gpu_fallback_engaged (crashesInWindow=3)` and `gpu_fallback_restart_deferred`. diff --git a/src/main/crash-reporting/gpu-fallback-recovered-launch.test.ts b/src/main/crash-reporting/gpu-fallback-recovered-launch.test.ts index 23707754ff8e..dd918ba93977 100644 --- a/src/main/crash-reporting/gpu-fallback-recovered-launch.test.ts +++ b/src/main/crash-reporting/gpu-fallback-recovered-launch.test.ts @@ -1,5 +1,3 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' const { showMessageBoxMock } = vi.hoisted(() => ({ @@ -105,22 +103,3 @@ describe('handleGpuFallbackRecoveredLaunch', () => { expect(handlers.restartWithHardware).not.toHaveBeenCalled() }) }) - -describe('recovered safe-graphics production wiring', () => { - it('prompts only after the recovered window is shown and persists both consent states', () => { - const windowSource = readFileSync( - join(__dirname, '..', 'startup', 'main-window-controller.ts'), - 'utf8' - ) - const lifecycleSource = readFileSync( - join(__dirname, '..', 'startup', 'gpu-lifecycle.ts'), - 'utf8' - ) - expect(windowSource).toMatch( - /window\.once\('show',[\s\S]*?presentGpuFallbackRecoveredLaunchPrompt\(window\)/ - ) - expect(lifecycleSource).toMatch( - /persistMarker:[\s\S]*?userConfirmed: false[\s\S]*?confirmMarker:[\s\S]*?userConfirmed: true/ - ) - }) -}) diff --git a/src/main/github/work-item-details-api-parity.test.ts b/src/main/github/work-item-details-api-parity.test.ts deleted file mode 100644 index 187680f64cdb..000000000000 --- a/src/main/github/work-item-details-api-parity.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { describe, expect, expectTypeOf, it } from 'vitest' -import type { GitHubPRFile, GitHubPRFileContents } from '../../shared/github/pull-request-types' -import type { GitHubWorkItemDetails } from '../../shared/github/work-item-types' -import type { IssueSourcePreference } from '../../shared/repo-types' -import type { LocalGitExecOptions } from './gh-utils' -import type { GitHubApiRepository } from './github-api-repository' -import * as workItemDetails from './work-item-details' - -type GetWorkItemDetails = ( - repoPath: string, - number: number, - type?: 'issue' | 'pr', - connectionId?: string | null, - localGitOptions?: LocalGitExecOptions, - preference?: IssueSourcePreference -) => Promise - -type GetPRFileContents = (args: { - repoPath: string - connectionId?: string | null - localGitOptions?: LocalGitExecOptions - prRepo?: GitHubApiRepository | null - prNumber: number - path: string - oldPath?: string - status: GitHubPRFile['status'] - headSha: string - baseSha: string -}) => Promise - -describe('work-item-details public API parity', () => { - it('retains only the established runtime exports and call signatures', () => { - expect(Object.keys(workItemDetails).sort()).toEqual(['getPRFileContents', 'getWorkItemDetails']) - expectTypeOf(workItemDetails.getWorkItemDetails).toEqualTypeOf() - expectTypeOf(workItemDetails.getPRFileContents).toEqualTypeOf() - }) -}) diff --git a/src/main/headless-automation-dispatcher-source-boundary.test.ts b/src/main/headless-automation-dispatcher-source-boundary.test.ts deleted file mode 100644 index 5f7a10fedec6..000000000000 --- a/src/main/headless-automation-dispatcher-source-boundary.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const source = readFileSync(join(__dirname, 'startup', 'main-process-automations.ts'), 'utf8') - -function sourceBetween(startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('headless automation dispatcher source boundaries', () => { - it('creates new-per-run workspaces from the resolved run target repo', () => { - const createArgsSection = sourceBetween('buildHeadlessAutomationWorktreeCreateArgs({', '})') - - expect(createArgsSection).toContain('repo: target.repo') - expect(createArgsSection).not.toContain('automation.sourceContext') - }) -}) diff --git a/src/main/ipc/filesystem-watcher-real.test.ts b/src/main/ipc/filesystem-watcher-real.test.ts index 6bd5060fb0e1..f884e596f72d 100644 --- a/src/main/ipc/filesystem-watcher-real.test.ts +++ b/src/main/ipc/filesystem-watcher-real.test.ts @@ -77,15 +77,6 @@ describe('filesystem-watcher real @parcel/watcher integration', () => { vi.clearAllMocks() }) - // Why: a clear, separate failure mode — if the native addon is missing from - // the bundle the watcher silently no-ops (doInstallLocalWatcher swallows the - // import error), so the wiring assertion below would time out with a vague - // message. This makes "addon absent" distinct from "wiring broken". - it('loads the real @parcel/watcher native addon', async () => { - const watcher = await import('@parcel/watcher') - expect(typeof watcher.subscribe).toBe('function') - }) - // Why: this integration targets the Linux native watcher path described // above; macOS developer sandboxes can load the addon while suppressing // subscribe callbacks, which makes this an environment check instead. diff --git a/src/main/ipc/github-ipc-channel-parity.test.ts b/src/main/ipc/github-ipc-channel-parity.test.ts deleted file mode 100644 index 1746890199a8..000000000000 --- a/src/main/ipc/github-ipc-channel-parity.test.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { readFileSync } from 'node:fs' -import { beforeEach, describe, expect, it, vi } from 'vitest' - -const mocks = await vi.hoisted(async () => { - const { createGitHubIpcMocks } = await import('./github-ipc-module-mocks') - return createGitHubIpcMocks() -}) - -vi.mock('electron', () => mocks.electron) -vi.mock('../github/client', () => mocks.client) -vi.mock('../github/work-item-details', () => mocks.workItemDetails) -vi.mock('../github/pr-refresh-coordinator', () => mocks.prRefresh) -vi.mock('../telemetry/client', () => mocks.telemetry) -vi.mock('../telemetry/cohort-classifier', () => mocks.cohort) -vi.mock('./ui', () => mocks.ui) - -import * as github from './github' -import { createGitHubIpcHarness } from './github-ipc-test-harness' - -const EXPECTED_GITHUB_IPC_CHANNELS = [ - 'gh:prForBranch', - 'gh:refreshPRNow', - 'gh:enqueuePRRefresh', - 'gh:reportVisiblePRRefreshCandidates', - 'gh:issue', - 'gh:listIssues', - 'gh:createIssue', - 'gh:listWorkItems', - 'gh:countWorkItems', - 'gh:workItem', - 'gh:workItemByOwnerRepo', - 'gh:workItemDetails', - 'gh:notifyWorkItemMutated', - 'gh:prFileContents', - 'gh:repoSlug', - 'gh:repoUpstream', - 'gh:prChecks', - 'gh:prCheckDetails', - 'gh:prComments', - 'gh:setPRCommentReaction', - 'gh:resolveReviewThread', - 'gh:setPRFileViewed', - 'gh:addPRReviewCommentReply', - 'gh:addPRReviewComment', - 'gh:updatePRTitle', - 'gh:mergePR', - 'gh:setPRAutoMerge', - 'gh:updatePRState', - 'gh:markPRReadyForReview', - 'gh:rerunPRChecks', - 'gh:requestPRReviewers', - 'gh:removePRReviewers', - 'gh:updateIssue', - 'gh:addIssueComment', - 'gh:listLabels', - 'gh:listAssignableUsers', - 'gh:viewer', - 'gh:checkOrcaStarred', - 'gh:starOrca', - 'gh:rateLimit', - 'gh:diagnoseAuth', - 'gh:listBindableAccounts', - 'gh:validateAccountBinding', - 'gh:listAccessibleProjects', - 'gh:resolveProjectRef', - 'gh:listProjectViews', - 'gh:getProjectViewTable', - 'gh:projectWorkItemDetailsBySlug', - 'gh:updateProjectItemField', - 'gh:clearProjectItemField', - 'gh:updateIssueBySlug', - 'gh:updatePullRequestBySlug', - 'gh:addIssueCommentBySlug', - 'gh:updateIssueCommentBySlug', - 'gh:deleteIssueCommentBySlug', - 'gh:listLabelsBySlug', - 'gh:listAssignableUsersBySlug', - 'gh:listIssueTypesBySlug', - 'gh:updateIssueTypeBySlug' -] as const - -describe('GitHub IPC channel parity', () => { - const harness = createGitHubIpcHarness(mocks) - - beforeEach(harness.reset) - - it('preserves the facade and fixed IPC channel contract', () => { - github.registerGitHubHandlers(harness.store as never, harness.stats as never) - - // The preload facade now composes the two GitHub bridge owners; inspect - // both owners so the channel census remains tied to the actual invokes. - const preloadSource = [ - '../../preload/api/gh-bridge-pull-requests-and-work-items.ts', - '../../preload/api/gh-bridge-mutations-and-projects.ts' - ] - .map((relativePath) => readFileSync(new URL(relativePath, import.meta.url), 'utf8')) - .join('\n') - const exposedChannels = [...preloadSource.matchAll(/ipcRenderer\.invoke\('(gh:[^']+)'/g)].map( - (match) => match[1] - ) - const registeredChannels = mocks.electron.ipcMain.handle.mock.calls.map( - ([channel]) => channel as string - ) - - expect(Object.keys(github)).toEqual(['registerGitHubHandlers']) - expect(new Set(registeredChannels).size).toBe(registeredChannels.length) - expect(registeredChannels).toEqual(EXPECTED_GITHUB_IPC_CHANNELS) - expect(registeredChannels.toSorted()).toEqual([...new Set(exposedChannels)].toSorted()) - }) -}) diff --git a/src/main/ipc/pty/pty-spawn-shell-override-parity.test.ts b/src/main/ipc/pty/pty-spawn-shell-override-parity.test.ts deleted file mode 100644 index 67bee9ca7007..000000000000 --- a/src/main/ipc/pty/pty-spawn-shell-override-parity.test.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -/** - * The two spawn preflights are twins: one serves renderer/IPC spawns, the other serves runtime - * spawns (`terminal.create` from the CLI, headless serve, and paired remote environments). They - * had drifted — the runtime twin passed a literal `undefined` for the caller's shell, so on a - * Windows host a runtime-created terminal could only ever be the host's default shell. A caller - * asking for cmd or PowerShell had to send it as `command`, which the provider TYPES into that - * default shell: the pty stayed the default shell with the requested one running inside it, and - * leaving that child dropped the caller's handle back onto a prompt it never asked for. - * - * Source-level because the functional seam is a whole spawn pipeline; what actually regressed is - * one twin silently not reading a field the other reads. - */ -const PREFLIGHTS = ['ipc', 'runtime'] as const - -describe.each(PREFLIGHTS)('%s pty spawn preflight', (lane) => { - const source = readFileSync(join(__dirname, lane, 'spawn-preflight.ts'), 'utf8') - - it("resolves Windows terminal runtime options from the caller's requested shell", () => { - expect(source).toContain('requestedShellOverride: args.shellOverride') - expect(source).not.toContain('requestedShellOverride: undefined') - }) -}) diff --git a/src/main/pi/titlebar-extension-service.test.ts b/src/main/pi/titlebar-extension-service.test.ts index 6b66d7f337f1..bc259e893a9d 100644 --- a/src/main/pi/titlebar-extension-service.test.ts +++ b/src/main/pi/titlebar-extension-service.test.ts @@ -277,7 +277,6 @@ describe('PiTitlebarExtensionService', () => { const env = svc.buildPtyEnv('pty-omp-sqlite', piHome, 'omp') const sourcePath = join(piHome, 'agent.db') - const content = 'agent.db credentials' expect(env.PI_CODING_AGENT_DIR).toBeUndefined() expect(readFileSync(env.ORCA_OMP_FRESH_CONFIG, 'utf8')).toBe('autoResume: false\n') @@ -287,9 +286,6 @@ describe('PiTitlebarExtensionService', () => { expect(existsSync(sourcePath)).toBe(false) expect(existsSync(join(userDataDir, 'omp-agent-overlays'))).toBe(false) expect(existsSync(join(piHome, 'history.db'))).toBe(false) - writeFileSync(sourcePath, content) - - expect(readFileSync(sourcePath, 'utf-8')).toBe(content) }) it('migrates missing OMP state from the old source overlay without overwriting source files', () => { diff --git a/src/main/ports/port-scan-command-client.test.ts b/src/main/ports/port-scan-command-client.test.ts index 37e8451a4dad..d79fe80fbbdb 100644 --- a/src/main/ports/port-scan-command-client.test.ts +++ b/src/main/ports/port-scan-command-client.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { join, sep } from 'node:path' import { Worker } from 'node:worker_threads' import { afterEach, describe, expect, it, vi } from 'vitest' @@ -244,17 +243,6 @@ describe('resolveWorkerEntryPath', () => { expect(resolved).toBe(join(moduleDir, WORKER_ENTRY_FILENAME)) expect(resolved).not.toContain('app.asar') }) - - // A rename in the build config would leave both branches pointing at a file - // that is never emitted, and only the packaged one fails silently. - it('names the entry the main build actually emits', () => { - const config = readFileSync( - join(import.meta.dirname, '..', '..', '..', 'electron.vite.config.ts'), - 'utf8' - ) - - expect(config).toContain("'port-scan-command-worker-entry': resolve(") - }) }) const REAL_WORKER_BLOCK_MS = 800 diff --git a/src/main/ports/port-scan-command-import-boundary.test.ts b/src/main/ports/port-scan-command-import-boundary.test.ts deleted file mode 100644 index bd9b9d05fb83..000000000000 --- a/src/main/ports/port-scan-command-import-boundary.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -// Why (#11161): libuv runs process creation inline on the calling event loop, -// so the port scan only stays off CrBrowserMain while these main-thread modules -// spawn nothing themselves. Spawning belongs to port-scan-command-execution.ts, -// which only the worker entry imports. -const MAIN_THREAD_MODULES = ['local-workspace-port-scanner.ts', 'port-scan-command-client.ts'] - -describe('port scan main-thread spawn boundary', () => { - it.each(MAIN_THREAD_MODULES)('keeps %s free of child_process', (fileName) => { - const source = readFileSync(join(import.meta.dirname, fileName), 'utf8') - - expect(source).not.toMatch(/from\s+['"](node:)?child_process['"]/) - expect(source).not.toMatch(/require\(\s*['"](node:)?child_process['"]\s*\)/) - }) -}) diff --git a/src/main/providers/settled-pty-writer-census.test.ts b/src/main/providers/settled-pty-writer-census.test.ts deleted file mode 100644 index 08dd99894007..000000000000 --- a/src/main/providers/settled-pty-writer-census.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { execFileSync } from 'node:child_process' -import { describe, expect, it, vi } from 'vitest' -import { LocalPtyProvider } from './local-pty-provider' -import { SshPtyProvider } from './ssh-pty-provider' -import { createMockMux } from './ssh-pty-provider-mock-multiplexer' -import { DaemonPtyRouter } from '../daemon/daemon-pty-router' -import { DegradedDaemonPtyProvider } from '../daemon/degraded-daemon-pty-provider' -import { DaemonPtyAdapter } from '../daemon/daemon-pty-adapter' - -vi.mock('electron', () => ({ - app: { getPath: vi.fn(() => '/tmp'), isPackaged: false }, - BrowserWindow: { fromId: vi.fn(() => null) }, - ipcMain: { on: vi.fn(), removeListener: vi.fn() }, - webContents: { fromId: vi.fn(() => null) } -})) - -const REPO_ROOT = join(__dirname, '..', '..', '..') - -/** - * Requiring the method is satisfiable by a lie: the degraded daemon router used to answer it - * with `provider.write(...) !== false`, reproducing the fire-and-forget bug through the fix. - * The census pins the producers and reads their bodies, so a new provider or a revived - * fabricated handoff fails here rather than silently clearing a mailbox reservation. - */ -const SETTLED_PTY_WRITER_FILES = [ - 'src/main/providers/local-pty-provider.ts', - 'src/main/providers/ssh-pty-provider.ts', - 'src/main/daemon/daemon-pty-router.ts', - 'src/main/daemon/degraded-daemon-pty-provider.ts', - 'src/main/daemon/daemon-pty-adapter.ts' -] - -/** Where the provider-side settlement is actually decided; the adapter inherits its own. */ -const SETTLED_WRITER_DECLARATIONS = [ - 'src/main/providers/local-pty-provider.ts', - 'src/main/providers/ssh-pty-provider.ts', - 'src/main/providers/ssh-pty-provider-rpc-operations.ts', - 'src/main/daemon/daemon-pty-router.ts', - 'src/main/daemon/degraded-daemon-pty-provider.ts', - 'src/main/daemon/daemon-pty-session-input.ts' -] - -function declaredProviderFiles(): string[] { - const output = execFileSync('git', ['grep', '-l', '--', 'implements IPtyProvider', 'src/main'], { - cwd: REPO_ROOT, - encoding: 'utf8' - }) - // Tests may name the clause while pinning it; only production declarations count. - return output - .split('\n') - .filter((file) => file && !file.endsWith('.test.ts')) - .sort() -} - -function settledWriterBody(file: string): string { - const source = readFileSync(join(REPO_ROOT, file), 'utf8') - const start = source.indexOf('writeWithSettlement') - expect(start, `${file} declares no settled writer`).toBeGreaterThan(-1) - const end = source.indexOf('\n }', start) - return source.slice(start, end === -1 ? source.length : end) -} - -describe('settled PTY writer census', () => { - it('covers every production provider class that declares IPtyProvider', () => { - expect(declaredProviderFiles()).toEqual([...SETTLED_PTY_WRITER_FILES].sort()) - }) - - it('exposes a settled writer on every production provider instance', () => { - const daemonClient = { isConnected: () => false, onEvent: vi.fn(() => vi.fn()) } - const adapter = new DaemonPtyAdapter(daemonClient as never) - const instances = [ - new LocalPtyProvider({} as never), - new SshPtyProvider('conn-census', createMockMux() as never), - new DaemonPtyRouter({ current: adapter, legacy: [] }), - new DegradedDaemonPtyProvider({ - current: adapter, - legacy: [], - fallback: new LocalPtyProvider({} as never) - }), - adapter - ] - for (const provider of instances) { - expect(typeof provider.writeWithSettlement, provider.constructor.name).toBe('function') - } - }) - - it('never synthesizes a settlement from the fire-and-forget write', () => { - for (const file of SETTLED_WRITER_DECLARATIONS) { - expect(settledWriterBody(file), file).not.toMatch(/\.write\(/) - } - }) -}) diff --git a/src/main/providers/ssh-filesystem-provider.test.ts b/src/main/providers/ssh-filesystem-provider.test.ts index a20dfb98d9bc..0917c4cf81ae 100644 --- a/src/main/providers/ssh-filesystem-provider.test.ts +++ b/src/main/providers/ssh-filesystem-provider.test.ts @@ -527,18 +527,6 @@ describe('SshFilesystemProvider', () => { }) describe('watch', () => { - it('sends fs.watch request and returns unsubscribe', async () => { - const callback = vi.fn() - const unsub = await provider.watch('/home/user/project', callback) - - expect(mux.request).toHaveBeenCalledWith( - 'fs.watch', - { rootPath: '/home/user/project', watchId: expect.any(Number) }, - { signal: expect.any(AbortSignal) } - ) - expect(typeof unsub).toBe('function') - }) - it('uses a registration-owned cancellation signal for the mux fs.watch request', async () => { mux.request.mockResolvedValue(undefined) const controller = new AbortController() diff --git a/src/main/quit-teardown-agent-browser-daemons.test.ts b/src/main/quit-teardown-agent-browser-daemons.test.ts deleted file mode 100644 index 315eba73aa00..000000000000 --- a/src/main/quit-teardown-agent-browser-daemons.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -/** - * agent-browser forks a daemon per browser tab that Orca holds no handle on, and - * `destroyAllSessions` closes each one by spawning another agent-browser child — - * hundreds of ms apiece. Left off the will-quit barrier, `app.quit()` fired first and - * every open tab's daemon outlived the app (#16367). - */ -const source = readFileSync(join(__dirname, 'startup', 'main-process-quit.ts'), 'utf8') - -function teardownBarrierMembers(): string { - const start = source.indexOf('settleTeardownWithinDeadline([') - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf('])', start) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('quit teardown of agent-browser daemons', () => { - it('joins the will-quit teardown barrier', () => { - expect(teardownBarrierMembers()).toContain("{ name: 'browser', promise: browserShutdown }") - }) - - it('captures the destroyAllSessions promise instead of firing and forgetting', () => { - expect(source).toMatch( - /const browserShutdown = \(async \(\): Promise => \{[\s\S]*?await state\.runtime\?\.getAgentBrowserBridge\(\)\?\.destroyAllSessions\(\)\s+\}\)\(\)/ - ) - // Why: a second, uncaptured call site is the pre-fix shape — it loses the race to app.quit(). - expect(source.match(/getAgentBrowserBridge\(\)\?\.destroyAllSessions\(\)/g)).toHaveLength(1) - }) -}) diff --git a/src/main/rate-limits/minimax/minimax-fetcher.test.ts b/src/main/rate-limits/minimax/minimax-fetcher.test.ts index d587c6b92568..d03c6a7c589b 100644 --- a/src/main/rate-limits/minimax/minimax-fetcher.test.ts +++ b/src/main/rate-limits/minimax/minimax-fetcher.test.ts @@ -19,12 +19,7 @@ vi.mock('electron', () => ({ session: { fromPartition: sessionFromPartitionMock } })) -import { - extractMiniMaxCookieValue, - fetchMiniMaxRateLimits, - normalizeMiniMaxCookieHeader, - redactMiniMaxSecret -} from './minimax-fetcher' +import { fetchMiniMaxRateLimits } from './minimax-fetcher' const MINIMAX_URL = 'https://platform.minimax.io/v1/api/openplatform/coding_plan/remains' @@ -646,54 +641,3 @@ describe('fetchMiniMaxRateLimits', () => { }) }) }) - -describe('normalizeMiniMaxCookieHeader', () => { - it('preserves all cookie pairs from a browser Cookie header', () => { - const normalized = normalizeMiniMaxCookieHeader( - '_token=tok; session=other; ak_bmsc=ak; minimax_group_id_v2=42; random=xyz' - ) - expect(normalized).toBe( - '_token=tok; session=other; ak_bmsc=ak; minimax_group_id_v2=42; random=xyz' - ) - }) - - it('normalizes quoted MiniMax cookie storage syntax', () => { - expect(normalizeMiniMaxCookieHeader('_token:"tok" minimax_group_id_v2:"42"')).toBe( - '_token=tok; minimax_group_id_v2=42' - ) - }) - - it('accepts a copied Cookie header line', () => { - expect(normalizeMiniMaxCookieHeader('Cookie: session=abc; other=xyz')).toBe( - 'session=abc; other=xyz' - ) - }) -}) - -describe('extractMiniMaxCookieValue', () => { - it('returns the value for a given cookie name', () => { - expect(extractMiniMaxCookieValue(FULL_COOKIE, 'minimax_group_id_v2')).toBe('12345') - }) - it('returns null when the name is absent', () => { - expect(extractMiniMaxCookieValue('_token=tok', 'minimax_group_id_v2')).toBeNull() - }) -}) - -describe('redactMiniMaxSecret', () => { - it('redacts _token values', () => { - expect(redactMiniMaxSecret('cookie _token=eyJhABCDEF')).toContain('_token=[REDACTED]') - expect(redactMiniMaxSecret('cookie _token=eyJhABCDEF')).not.toContain('eyJhABCDEF') - }) - it('redacts minimax_group_id_v2 values', () => { - expect(redactMiniMaxSecret('minimax_group_id_v2=99999 trailing')).not.toContain('99999') - }) - it('redacts MiniMax anti-bot cookie values', () => { - const redacted = redactMiniMaxSecret('ak_bmsc=secret bm_sv:"secret2"') - expect(redacted).not.toContain('secret') - expect(redacted).toContain('ak_bmsc=[REDACTED]') - expect(redacted).toContain('bm_sv:[REDACTED]') - }) - it('redacts Cookie: header lines', () => { - expect(redactMiniMaxSecret('X-Cookie: _token=secret')).toContain('[REDACTED]') - }) -}) diff --git a/src/main/runtime/agent-session-launch-env-backfill.test.ts b/src/main/runtime/agent-session-launch-env-backfill.test.ts deleted file mode 100644 index 50cf9e6b35ca..000000000000 --- a/src/main/runtime/agent-session-launch-env-backfill.test.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { mkdtemp, rm } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { afterEach, beforeEach, describe, expect, it } from 'vitest' -import { AgentSessionRecordStore } from './agent-session-record-store' -import type { AgentSessionReserveRequest } from './agent-session-reservation-admission' - -const NOW = 1_800_000_000_000 -const SESSION = 'session-launch-env' -let directory: string - -function request(overrides: Partial = {}): AgentSessionReserveRequest { - return { - sessionId: SESSION, - location: { - executionHostId: 'local', - wslDistro: null, - workspaceId: 'workspace-1', - workspaceKind: 'git-worktree' - }, - provider: 'claude', - accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude' }, - expectedFence: null, - spawnToken: 'spawn-a', - claimKeyId: 'key-1', - handoffOperationId: null, - probe: { outcome: 'reservation-unused' }, - operation: { - callerKey: 'client-1', - operationId: `${NOW}-00000000000000000000000000000001`, - fingerprint: 'fp-1' - }, - now: NOW, - ...overrides - } -} - -beforeEach(async () => { - directory = await mkdtemp(join(tmpdir(), 'orca-agent-session-launch-env-')) -}) - -afterEach(async () => { - await rm(directory, { recursive: true, force: true }) -}) - -describe('legacy agent session launch environment', () => { - it('durably pins the first environment resolved by a current reservation', async () => { - const store = await AgentSessionRecordStore.open({ directory, hostId: 'local' }) - await store.reserveOwner(request()) - await store.reserveOwner( - request({ - expectedFence: 1, - spawnToken: 'spawn-b', - launchEnv: { ANTHROPIC_AUTH_TOKEN: 'pinned-token' }, - operation: { - callerKey: 'client-1', - operationId: `${NOW}-00000000000000000000000000000002`, - fingerprint: 'fp-2' - } - }) - ) - - const reopened = await AgentSessionRecordStore.open({ directory, hostId: 'local' }) - expect( - (reopened.getRecord(SESSION) as { launchEnv?: Record } | null)?.launchEnv - ).toBeUndefined() - }) - - it('rejects an environment that could not be reloaded before writing it', async () => { - const store = await AgentSessionRecordStore.open({ directory, hostId: 'local' }) - const launchEnv = Object.fromEntries( - Array.from({ length: 257 }, (_, index) => [`KEY_${index}`, 'value']) - ) - - await expect(store.reserveOwner(request({ launchEnv }))).rejects.toThrow( - 'agent_session_launch_env_invalid' - ) - expect(store.getRecord(SESSION)).toBeNull() - }) - - it('rejects an overlong environment key before writing it', async () => { - const store = await AgentSessionRecordStore.open({ directory, hostId: 'local' }) - - await expect( - store.reserveOwner(request({ launchEnv: { ['K'.repeat(513)]: 'value' } })) - ).rejects.toThrow('agent_session_launch_env_invalid') - expect(store.getRecord(SESSION)).toBeNull() - }) -}) diff --git a/src/main/runtime/agent-startup-input-assembly-census.test.ts b/src/main/runtime/agent-startup-input-assembly-census.test.ts deleted file mode 100644 index ca05ed03648d..000000000000 --- a/src/main/runtime/agent-startup-input-assembly-census.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const REPO_ROOT = join(import.meta.dirname, '../../..') - -/** - * The host modules that turn settings into `buildAgentStartupPlan` inputs. - * - * `buildAgentStartupPlan` was always shared; the input assembly was not, and the hand-rolled - * copies drifted — one dropped `sessionOptionsOverrideAgentArgs` and let configured args defeat a - * picked model. This pins the funnel so a sixth host site cannot re-derive the inputs by hand. - */ -const MIGRATED_HOST_LAUNCH_MODULES = [ - 'src/main/runtime/orca-runtime-create-agent-session.ts', - 'src/main/runtime/orca-runtime-resolve-mobile-session-terminal-command.ts', - 'src/main/runtime/orca-runtime-resolve-worktree-removal-target.ts', - 'src/main/runtime/runtime-worktree-agent-startup.ts' -] - -/** Reading any of these next to a startup plan means the inputs are being assembled by hand. */ -const HAND_ASSEMBLY_MARKERS = [ - 'resolveTuiAgentLaunchArgs(', - 'resolveTuiAgentLaunchEnv(', - 'resolveLocalWindowsAgentStartupShell(' -] - -function read(file: string): string { - return readFileSync(join(REPO_ROOT, file), 'utf8') -} - -describe('host agent-startup input assembly census', () => { - it('routes every migrated host launch site through the shared resolver', () => { - const missing = MIGRATED_HOST_LAUNCH_MODULES.filter( - (file) => !read(file).includes('resolveAgentStartupPlanInputs(') - ) - expect(missing).toEqual([]) - }) - - it('leaves no migrated host site assembling the settings-derived inputs by hand', () => { - const handAssembled = MIGRATED_HOST_LAUNCH_MODULES.filter((file) => { - const source = read(file) - return HAND_ASSEMBLY_MARKERS.some((marker) => source.includes(marker)) - }) - expect(handAssembled).toEqual([]) - }) - - it('detects hand assembly when it is present', () => { - // Positive control: the markers are real names, so an empty result above is a true negative - // rather than a typo that can never match. - const resumeSite = read( - 'src/main/runtime/orca-runtime-get-agent-session-execution-namespace.ts' - ) - expect(HAND_ASSEMBLY_MARKERS.some((marker) => resumeSite.includes(marker))).toBe(true) - }) -}) diff --git a/src/main/runtime/client-hosted-browser-row-hydration-census.test.ts b/src/main/runtime/client-hosted-browser-row-hydration-census.test.ts deleted file mode 100644 index e50e066a5445..000000000000 --- a/src/main/runtime/client-hosted-browser-row-hydration-census.test.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' -import { glob } from 'tinyglobby' - -const REPO_ROOT = join(import.meta.dirname, '../../..') -const CENSUS_FILE = 'src/main/runtime/client-hosted-browser-row-hydration-census.test.ts' - -/** - * `deliverHydrationSnapshot` reads like a getter and is not one: it replaces the publisher's record - * of which workspaces the renderer holds rows for. A second caller that reasonably treats it as a - * peek — a status panel, a diagnostic dump, a second window's look-ahead — would clear that record - * out from under the live renderer, and the rows it is showing become unretractable. That is the - * exact defect this round shipped a fix for, so the single-caller shape is pinned rather than - * trusted to the name. - */ -async function countCallSites(pattern: RegExp): Promise> { - const files = await glob(['src/**/*.ts', 'src/**/*.tsx'], { - cwd: REPO_ROOT, - ignore: ['**/node_modules/**', '**/*.test.ts', '**/*.test.tsx', CENSUS_FILE] - }) - const counts: Record = {} - for (const file of files) { - // Counted per file, not merely detected: two call sites in one file mask each other. - const hits = readFileSync(join(REPO_ROOT, file), 'utf8').match(pattern)?.length ?? 0 - if (hits > 0) { - counts[file] = hits - } - } - return counts -} - -// Anchored on the member-call shape rather than the bare name, so the declaration does not count -// itself and prose about the method does not have to be kept out of the file. -const DELIVER_CALL = /\.deliverHydrationSnapshot\(/g -const LIST_CALL = /\.listClientHostedBrowserRows\(/g - -describe('client-hosted row hydration caller census', () => { - it('keeps the hydration delivery to its one runtime caller', async () => { - expect(await countCallSites(DELIVER_CALL)).toEqual({ - 'src/main/runtime/orca-runtime-stored-mobile-snapshot-has-stale-preserved-tab.ts': 1 - }) - }) - - // The IPC handler is the other half of the same invariant: it is what turns one renderer's - // hydration request into one delivery, so a second production reader would arrive through here. - it('keeps the runtime accessor to its one IPC caller', async () => { - expect(await countCallSites(LIST_CALL)).toEqual({ - 'src/main/ipc/runtime.ts': 1 - }) - }) - - // Why: the two censuses above pass by finding what is already there, so a matcher that had - // stopped matching would read the same as a clean repo. Prove it counts a second caller. - it('counts a second caller rather than reporting the same single site', () => { - const source = ` - const a = runtime.deliverHydrationSnapshot() - const b = other.deliverHydrationSnapshot() - ` - expect(source.match(DELIVER_CALL)?.length).toBe(2) - expect('runtime.listClientHostedBrowserRows()'.match(LIST_CALL)?.length).toBe(1) - }) -}) diff --git a/src/main/runtime/rpc/methods/orchestration/worker/agent-status-producer-census.test.ts b/src/main/runtime/rpc/methods/orchestration/worker/agent-status-producer-census.test.ts index cef9e7dd8c13..e939d8a05f7a 100644 --- a/src/main/runtime/rpc/methods/orchestration/worker/agent-status-producer-census.test.ts +++ b/src/main/runtime/rpc/methods/orchestration/worker/agent-status-producer-census.test.ts @@ -1,4 +1,3 @@ -import { resolve } from 'node:path' import { describe, expect, it, vi } from 'vitest' const { ipcHandlers } = vi.hoisted(() => ({ @@ -31,10 +30,6 @@ vi.mock('@electron-toolkit/utils', () => ({ })) import type Database from '../../../../../sqlite/sync-database' -import { - scanSourceTree, - stripComments -} from '../../../../../../shared/source-scan/source-tree-scan' import type { AgentStatusIpcPayload } from '../../../../../../shared/agent-status-ipc-payload' import { toAgentStatusIpcPayload } from '../../../../../agent-hooks/server/server-status-identity' import type { EnrichedAgentHookEventPayload } from '../../../../../agent-hooks/server/server-types' @@ -47,119 +42,6 @@ import { OrcaRuntimeService } from '../../../../orca-runtime' import { ORCHESTRATION_WORKER_LIST_METHOD } from './worker-list-method' import { projectFleetWorkerPage } from './worker-observation' -/** - * Census of every production site in `src/main` that turns hook-server agent-status rows into - * something a consumer reads. - * - * Why a census and not a single seam test: the false-liveness bug (rework failure table L-1) was - * one such site publishing rows that carry a pane key and nothing else, into a consumer that - * matches on terminal identity. Fixing that site fixes nothing if a fifth one is added beside it, - * so the list is pinned and the identity-bearing paths are each driven end to end. - */ -type CensusRow = { - path: string - /** `produces` = mints payloads a consumer reads; `consumes` = reads them; `wiring` = neither. */ - kind: 'produces' | 'consumes' | 'wiring' - role: string -} - -const CENSUS: readonly CensusRow[] = [ - { - path: 'main/ipc/agent-hooks.ts', - kind: 'produces', - role: 'agentStatus:getSnapshot — renderer pull, enriched (driven below)' - }, - { - path: 'main/ipc/agent-status-ipc-boundary.ts', - kind: 'produces', - role: 'resolveAgentStatusBinding — the one identity lookup the pull and fleet paths share' - }, - { - path: 'main/runtime/agent-status-observed-pane-identity.ts', - kind: 'produces', - role: 'captures the identity a hook row was observed under (fleet-status-observed-identity)' - }, - { - path: 'main/runtime/orchestration-fleet-agent-status-snapshot.ts', - kind: 'produces', - role: 'readOrchestrationFleetAgentStatusSnapshot — the minted fleet evidence (driven below)' - }, - { - path: 'main/startup/main-window-agent-status.ts', - kind: 'produces', - role: 'agentStatus:set — renderer live push, enriched inline (driven below)' - }, - { - path: 'main/startup/main-process-runtime-service.ts', - kind: 'wiring', - role: 'binds the hook server snapshot into the runtime deps' - }, - { - path: 'main/orcad/orcad-entry.ts', - kind: 'wiring', - role: 'binds the same snapshot, OSC producer and structured sink into the headless orcad runtime deps' - }, - { - path: 'main/runtime/orca-runtime-state-fields.ts', - kind: 'wiring', - role: 'stores the snapshot deps on the runtime' - }, - { - path: 'main/runtime/orca-runtime-preserved-branch-cleanup.ts', - kind: 'wiring', - role: 'declares the snapshot dep fields' - }, - { - path: 'main/runtime/orca-runtime-get-orchestration-dispatch-authority.ts', - kind: 'produces', - role: 'getOrchestrationFleetAgentStatusSnapshot — delegates to the checked snapshot module' - }, - { - path: 'main/runtime/orca-runtime-stop-requested-pty-ids.ts', - kind: 'wiring', - role: 'feeds the enriched fleet rows to the orchestration projection' - }, - { - path: 'main/runtime/runtime-agent-orchestration-projection.ts', - kind: 'consumes', - role: 'indexes rows by pane key to attach dispatch context' - }, - { - path: 'main/runtime/rpc/methods/orchestration/worker/worker-list-method.ts', - kind: 'consumes', - role: 'worker-list fleet verdict (driven below)' - }, - { - path: 'main/runtime/rpc/methods/orchestration/worker/worker-observation.ts', - kind: 'consumes', - role: 'worker-show fleet verdict (driven below)' - }, - { - path: 'main/runtime/orca-runtime-get-worktree-ps.ts', - kind: 'consumes', - role: 'worktree.ps inline agent rows (driven below)' - }, - { - path: 'main/runtime/orca-runtime-get-terminal-interactive-wait.ts', - kind: 'consumes', - role: 'exact-worker provider session selection, matched on pane key' - }, - { - path: 'main/runtime/orca-runtime-serialize-agent-prompt-submission.ts', - kind: 'consumes', - role: 'prompt-submission serialization, matched on pane key' - }, - { - path: 'main/runtime/orca-runtime-prune-mobile-session-tab-group-layout.ts', - kind: 'consumes', - role: 'mobile tab-group pruning and its live agent row, plus the pane identity accessors' - } -] - -/** The names a hook row travels under. A new producer has to use one of them to reach a consumer. */ -const PRODUCER_TOKENS = - /getAgentStatusSnapshot|getAgentProviderSessionSnapshot|enrichAgentStatusIpcPayload|mintAgentStatusFleetEvidence|resolveAgentStatusBinding|getOrchestrationFleetAgentStatusSnapshot|agentStatus:set/ - const PANE_KEY = 'tab-census:leaf-census' const TERMINAL_HANDLE = 'term_census' const PROCESS_INCARNATION = 'pty-census:inc-1' @@ -258,17 +140,7 @@ function censusStore() { } } -describe('agent status producer census', () => { - it('pins every production site that hands hook rows to a consumer', () => { - const root = resolve(import.meta.dirname, '../../../../../..') - const scanned = scanSourceTree(resolve(root, 'main')) - .filter((file) => PRODUCER_TOKENS.test(stripComments(file.source))) - .map((file) => `main/${file.relativePath}`) - .sort() - - expect(scanned).toEqual(CENSUS.map((row) => row.path).sort()) - }) - +describe('agent status identity across every producer and consumer path', () => { it('reads live on worker-list from a hook row that carries only a pane key', async () => { const db = new OrchestrationDb(':memory:') try { diff --git a/src/main/runtime/rpc/terminal-stream-byte-length.test.ts b/src/main/runtime/rpc/terminal-stream-byte-length.test.ts index 60c4c86fe445..1c0f08cf33f3 100644 --- a/src/main/runtime/rpc/terminal-stream-byte-length.test.ts +++ b/src/main/runtime/rpc/terminal-stream-byte-length.test.ts @@ -5,7 +5,6 @@ import { terminalStreamByteLength, terminalStreamByteLengthExceeds } from './terminal-stream-byte-length' -import { TERMINAL_OUTPUT_BATCH_MAX_BYTES } from '../../../shared/terminal-multiplex-flow-control' // Copy of the pre-change implementation (shared/clipboard-text.ts // measureClipboardTextByteLength), kept here so equivalence is checked against the @@ -323,92 +322,6 @@ describe('terminal stream byte length equivalence with the legacy code-point sca } } } - expect(MIN_NATIVE_BYTE_LENGTH_CODE_UNITS).toBeGreaterThan(0) - }) -}) - -// Reproduces createTerminalOutputBatcher's byte accounting exactly, under both the -// legacy scan and the new measurement, and asserts IDENTICAL flush boundaries. This is -// what makes the partial-count behaviour provably unobservable at that call site. -function simulateBatcherFlushes( - chunks: string[], - measure: ( - data: string, - options: { stopAfterBytes?: number } - ) => { byteLength: number; exceededLimit: boolean } -): string[] { - const flushes: string[] = [] - let pending: string[] = [] - let bytes = 0 - const flush = (): void => { - if (pending.length === 0) { - return - } - flushes.push(pending.join('')) - pending = [] - bytes = 0 - } - for (const data of chunks) { - if (!data) { - continue - } - pending.push(data) - const remainingBudget = Math.max(1, TERMINAL_OUTPUT_BATCH_MAX_BYTES - bytes) - const measurement = measure(data, { stopAfterBytes: remainingBudget }) - bytes += measurement.byteLength - if (measurement.exceededLimit || bytes >= TERMINAL_OUTPUT_BATCH_MAX_BYTES) { - flush() - } - } - flush() - return flushes -} - -describe('terminal output batcher flush boundaries are unchanged', () => { - it( - 'produces identical flush boundaries over randomized multi-chunk runs', - { timeout: 60000 }, - () => { - const random = mulberry32(0x1337) - for (let run = 0; run < 300; run += 1) { - const chunks: string[] = [] - const chunkCount = 1 + Math.floor(random() * 40) - for (let index = 0; index < chunkCount; index += 1) { - // Sizes straddle the 64KiB batch cap so single chunks both fit and blow the budget. - // Sizes straddle the native-call floor too, so runs mix scan-branch and - // native-branch measurements inside one batcher's byte accounting. - const scale = random() - const maxUnits = - scale < 0.25 - ? MIN_NATIVE_BYTE_LENGTH_CODE_UNITS * 2 - : scale < 0.5 - ? 64 - : scale < 0.85 - ? 20000 - : 90000 - chunks.push(random() < 0.5 ? randomString(random, maxUnits) : rawUtf16(random, maxUnits)) - } - const legacyFlushes = simulateBatcherFlushes(chunks, legacyMeasure) - const actualFlushes = simulateBatcherFlushes(chunks, measureTerminalStreamByteLength) - if (legacyFlushes.length !== actualFlushes.length) { - throw new Error(`flush count diverged on run ${run}`) - } - for (let index = 0; index < legacyFlushes.length; index += 1) { - if (legacyFlushes[index] !== actualFlushes[index]) { - throw new Error(`flush ${index} diverged on run ${run}`) - } - } - } - expect(true).toBe(true) - } - ) - - it('exercises runs that actually cross the batch budget', () => { - const oversized = '\u{1f600}'.repeat(TERMINAL_OUTPUT_BATCH_MAX_BYTES) - const chunks = ['a'.repeat(10), oversized, 'b'.repeat(10), oversized, 'c'] - const legacyFlushes = simulateBatcherFlushes(chunks, legacyMeasure) - expect(legacyFlushes.length).toBeGreaterThan(1) - expect(simulateBatcherFlushes(chunks, measureTerminalStreamByteLength)).toEqual(legacyFlushes) }) }) @@ -419,23 +332,8 @@ describe('resync trim byte accounting for a snapshot-sliced chunk', () => { it('re-measures a sliced chunk in UTF-8 bytes, not UTF-16 code units', () => { const data = '\u{1f600}é走a' const sliced = data.slice(2) - expect(terminalStreamByteLength(sliced)).toBe(legacyByteLength(sliced)) // Guards the mutant: code-unit length would be 4 here, UTF-8 is 6. expect(terminalStreamByteLength(sliced)).toBe(6) expect(terminalStreamByteLength(sliced)).not.toBe(sliced.length) }) - - it('matches the legacy byte length for every suffix slice of multi-byte terminal text', () => { - const random = mulberry32(0x51ced) - for (let iteration = 0; iteration < 2000; iteration += 1) { - const data = iteration % 2 === 0 ? randomString(random, 24) : rawUtf16(random, 24) - for (let offset = 0; offset <= data.length; offset += 1) { - const sliced = data.slice(offset) - if (terminalStreamByteLength(sliced) !== legacyByteLength(sliced)) { - throw new Error(`sliced byte length diverged for ${JSON.stringify(data)} at ${offset}`) - } - } - } - expect(true).toBe(true) - }) }) diff --git a/src/main/runtime/structured-claude-auth-policy-wiring.test.ts b/src/main/runtime/structured-claude-auth-policy-wiring.test.ts index f018dfd30da4..cc2b5c3b1640 100644 --- a/src/main/runtime/structured-claude-auth-policy-wiring.test.ts +++ b/src/main/runtime/structured-claude-auth-policy-wiring.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { join } from 'node:path' import { mkdtemp, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' @@ -10,28 +9,11 @@ import { } from './structured-agent-session-runtime' /** - * The structured host's Claude auth policy has exactly one production wiring, and it - * lives in `orca-runtime-get-worktree-ps.ts` — a `@ts-nocheck` file, so neither the - * compiler nor a type test can see the field disappear. Deleting that wiring used to - * leave ~1000 tests green while every `ANTHROPIC_*` variable in the shell reached the - * child, because `stripAuthEnv` silently fell back to `false`. - * - * Two independent guards replace that silence, and this file pins both. + * The structured host's Claude auth policy has exactly one production wiring. Deleting it + * used to leave ~1000 tests green while every `ANTHROPIC_*` variable in the shell reached + * the child, because `stripAuthEnv` silently fell back to `false`. */ describe('structured Claude auth policy wiring', () => { - // The behavioural version of this assertion — importing the runtime class and - // capturing the installed deps — costs 35s of module transform for the whole - // OrcaRuntime chain (measured), so the wiring itself is pinned by source and the - // policy's meaning by claude-structured-auth-policy.test.ts. - it('passes a settings-derived Claude auth policy to the host installer', () => { - const source = readFileSync(join(__dirname, 'orca-runtime-get-worktree-ps.ts'), 'utf8') - - expect(source).toContain('claudeStructuredAuthPolicyForSettings') - expect(source).toMatch( - /resolveClaudeAuthPolicy:\s*\(\)\s*=>\s*\n?\s*claudeStructuredAuthPolicyForSettings\(/ - ) - }) - describe('installing without one', () => { let stateDirectory: string | null = null diff --git a/src/main/ssh/relay-protocol-backpressure.test.ts b/src/main/ssh/relay-protocol-backpressure.test.ts deleted file mode 100644 index 45a869af16ed..000000000000 --- a/src/main/ssh/relay-protocol-backpressure.test.ts +++ /dev/null @@ -1,297 +0,0 @@ -import { describe, expect, it, vi } from 'vitest' -import { - FrameDecoder, - FrameDecoderContinuationError, - FRAME_DECODER_MAX_RETAINED_BYTES, - HEADER_LENGTH, - MAX_MESSAGE_SIZE, - MessageType, - encodeFrame, - type DecodedFrame -} from './relay-protocol' - -function createScheduler(): { - schedule: (callback: () => void) => number - cancel: (handle: unknown) => void - runNext: () => void - pending: () => number -} { - let nextHandle = 1 - const callbacks = new Map void>() - return { - schedule: (callback) => { - const handle = nextHandle++ - callbacks.set(handle, callback) - return handle - }, - cancel: (handle) => callbacks.delete(handle as number), - runNext: () => { - const entry = callbacks.entries().next().value as [number, () => void] | undefined - if (!entry) { - throw new Error('No decoder continuation scheduled') - } - callbacks.delete(entry[0]) - entry[1]() - }, - pending: () => callbacks.size - } -} - -function frame(id: number, payload = `${id}`): Buffer { - return encodeFrame(MessageType.Regular, id, 0, Buffer.from(payload)) -} - -describe('FrameDecoder bounded turns', () => { - it('retains at most one maximum frame plus one MiB of partial input', () => { - expect(FRAME_DECODER_MAX_RETAINED_BYTES).toBe(MAX_MESSAGE_SIZE + HEADER_LENGTH + 1024 * 1024) - const maximumFrame = encodeFrame(MessageType.Regular, 1, 0, Buffer.alloc(MAX_MESSAGE_SIZE)) - const acceptedError = vi.fn() - const accepted = new FrameDecoder(vi.fn(), acceptedError) - - accepted.feed(Buffer.concat([maximumFrame, Buffer.alloc(1024 * 1024)])) - - expect(acceptedError).not.toHaveBeenCalled() - expect(accepted.drain()).toHaveLength(1024 * 1024) - - const excessError = vi.fn() - const excess = new FrameDecoder(vi.fn(), excessError) - excess.feed(Buffer.concat([maximumFrame, Buffer.alloc(1024 * 1024 + 1)])) - - expect(excessError).toHaveBeenCalledWith( - expect.objectContaining({ message: expect.stringContaining('retained-input') }) - ) - expect(excess.drain()).toHaveLength(0) - }) - - it('fails closed when one delivered chunk exceeds retained-input capacity', () => { - const onError = vi.fn() - const decoder = new FrameDecoder(vi.fn(), onError) - - decoder.feed(Buffer.alloc(FRAME_DECODER_MAX_RETAINED_BYTES + 1)) - - expect(onError).toHaveBeenCalledWith( - expect.objectContaining({ message: expect.stringContaining('retained-input') }) - ) - expect(decoder.drain()).toHaveLength(0) - }) - - it('emits the first frame synchronously and preserves order through self-pause', () => { - const scheduler = createScheduler() - const seen: number[] = [] - let decoder: FrameDecoder - const pause = vi.fn(() => decoder.feed(frame(4))) - const resume = vi.fn() - decoder = new FrameDecoder((decoded) => seen.push(decoded.id), undefined, { - maxFramesPerTurn: 1, - schedule: scheduler.schedule, - cancelScheduled: scheduler.cancel, - pause, - resume - }) - - decoder.feed(Buffer.concat([frame(1), frame(2), frame(3)])) - - expect(seen).toEqual([1]) - expect(pause).toHaveBeenCalledTimes(1) - expect(scheduler.pending()).toBe(1) - - scheduler.runNext() - scheduler.runNext() - scheduler.runNext() - - expect(seen).toEqual([1, 2, 3, 4]) - expect(pause).toHaveBeenCalledTimes(1) - expect(resume).toHaveBeenCalledTimes(1) - expect(scheduler.pending()).toBe(0) - }) - - it('bounds decoded bytes and time independently from the frame count', () => { - const byteScheduler = createScheduler() - const byteSeen: number[] = [] - const first = frame(1, 'one') - const second = frame(2, 'two') - const byteDecoder = new FrameDecoder((decoded) => byteSeen.push(decoded.id), undefined, { - maxFramesPerTurn: 64, - maxBytesPerTurn: first.length, - schedule: byteScheduler.schedule, - cancelScheduled: byteScheduler.cancel - }) - - byteDecoder.feed(Buffer.concat([first, second])) - expect(byteSeen).toEqual([1]) - byteScheduler.runNext() - expect(byteSeen).toEqual([1, 2]) - - const timeScheduler = createScheduler() - const timeSeen: number[] = [] - let nowCalls = 0 - const timeDecoder = new FrameDecoder((decoded) => timeSeen.push(decoded.id), undefined, { - maxFramesPerTurn: 64, - maxBytesPerTurn: MAX_MESSAGE_SIZE + HEADER_LENGTH, - maxTurnMs: 4, - now: () => (nowCalls++ === 0 ? 0 : 5), - schedule: timeScheduler.schedule, - cancelScheduled: timeScheduler.cancel - }) - - timeDecoder.feed(Buffer.concat([frame(3), frame(4)])) - expect(timeSeen).toEqual([3]) - timeScheduler.runNext() - expect(timeSeen).toEqual([3, 4]) - }) - - it('releases its pause epoch when continuation scheduling throws', () => { - const pause = vi.fn() - const resume = vi.fn() - const decoder = new FrameDecoder(() => {}, undefined, { - maxFramesPerTurn: 1, - pause, - resume, - schedule: () => { - throw new Error('scheduler unavailable') - } - }) - - expect(() => decoder.feed(Buffer.concat([frame(1), frame(2)]))).toThrow('scheduler unavailable') - expect(pause).toHaveBeenCalledTimes(1) - expect(resume).toHaveBeenCalledTimes(1) - decoder.reset() - expect(resume).toHaveBeenCalledTimes(1) - }) - - it('contains a throwing continuation, resets residue, and reports one typed error', () => { - const scheduler = createScheduler() - const seen: number[] = [] - const onError = vi.fn() - const pause = vi.fn() - const resume = vi.fn() - const decoder = new FrameDecoder( - (decoded) => { - if (decoded.id === 2) { - throw new Error('frame owner failed') - } - seen.push(decoded.id) - }, - onError, - { - maxFramesPerTurn: 1, - schedule: scheduler.schedule, - cancelScheduled: scheduler.cancel, - pause, - resume - } - ) - - decoder.feed(Buffer.concat([frame(1), frame(2), frame(3)])) - expect(() => scheduler.runNext()).not.toThrow() - - expect(seen).toEqual([1]) - expect(onError).toHaveBeenCalledExactlyOnceWith(expect.any(FrameDecoderContinuationError)) - expect(onError.mock.calls[0]?.[0]).toMatchObject({ - name: 'FrameDecoderContinuationError', - cause: expect.objectContaining({ message: 'frame owner failed' }) - }) - expect(pause).toHaveBeenCalledTimes(1) - expect(resume).toHaveBeenCalledTimes(1) - expect(scheduler.pending()).toBe(0) - expect(decoder.drain()).toHaveLength(0) - - decoder.feed(frame(4)) - expect(seen).toEqual([1, 4]) - }) - - // feed() runs straight from a transport data handler. A frame owner that threw on the first - // turn used to escape feed() and reach uncaughtException. The continuation path was already - // contained; the synchronous path must match it. - it('contains a frame owner that throws on the synchronous turn and reports one typed error', () => { - const seen: number[] = [] - const onError = vi.fn() - const pause = vi.fn() - const resume = vi.fn() - const decoder = new FrameDecoder( - (decoded) => { - if (decoded.id === 2) { - throw new Error('frame owner failed') - } - seen.push(decoded.id) - }, - onError, - { pause, resume } - ) - - expect(() => decoder.feed(Buffer.concat([frame(1), frame(2), frame(3)]))).not.toThrow() - - expect(seen).toEqual([1]) - expect(onError).toHaveBeenCalledExactlyOnceWith(expect.any(FrameDecoderContinuationError)) - expect(onError.mock.calls[0]?.[0]).toMatchObject({ - cause: expect.objectContaining({ message: 'frame owner failed' }) - }) - expect(decoder.drain()).toHaveLength(0) - expect(pause).not.toHaveBeenCalled() - expect(resume).not.toHaveBeenCalled() - - decoder.feed(frame(4)) - expect(seen).toEqual([1, 4]) - }) - - it('keeps reads active for partial frames and incrementally discards oversized payloads', () => { - const errors: Error[] = [] - const seen: DecodedFrame[] = [] - const pause = vi.fn() - const decoder = new FrameDecoder( - (decoded) => seen.push(decoded), - (error) => errors.push(error), - { pause } - ) - const valid = frame(2, 'complete') - - decoder.feed(valid.subarray(0, HEADER_LENGTH + 2)) - expect(seen).toHaveLength(0) - expect(pause).not.toHaveBeenCalled() - decoder.feed(valid.subarray(HEADER_LENGTH + 2)) - expect(seen.map(({ id }) => id)).toEqual([2]) - - const oversizedHeader = Buffer.alloc(HEADER_LENGTH) - oversizedHeader[0] = MessageType.Regular - oversizedHeader.writeUInt32BE(3, 1) - oversizedHeader.writeUInt32BE(MAX_MESSAGE_SIZE + 1, 9) - decoder.feed(Buffer.concat([oversizedHeader, Buffer.alloc(32)])) - - expect(errors).toHaveLength(1) - expect(pause).not.toHaveBeenCalled() - decoder.reset() - decoder.feed(frame(4, 'after-reset')) - expect(seen.map(({ id }) => id)).toEqual([2, 4]) - }) - - it('drain and reset cancel continuation ownership without replaying residue', () => { - const scheduler = createScheduler() - const seen: number[] = [] - const resume = vi.fn() - const cancel = vi.fn(scheduler.cancel) - const decoder = new FrameDecoder((decoded) => seen.push(decoded.id), undefined, { - maxFramesPerTurn: 1, - schedule: scheduler.schedule, - cancelScheduled: cancel, - resume - }) - const second = frame(2, 'residue') - - decoder.feed(Buffer.concat([frame(1), second])) - const residue = decoder.drain() - - expect(seen).toEqual([1]) - expect(residue.equals(second)).toBe(true) - expect(cancel).toHaveBeenCalledTimes(1) - expect(resume).toHaveBeenCalledTimes(1) - expect(scheduler.pending()).toBe(0) - - decoder.feed(Buffer.concat([frame(3), frame(4)])) - decoder.reset() - expect(cancel).toHaveBeenCalledTimes(2) - expect(scheduler.pending()).toBe(0) - - decoder.feed(frame(5)) - expect(seen).toEqual([1, 3, 5]) - }) -}) diff --git a/src/main/ssh/ssh-system-fallback.test.ts b/src/main/ssh/ssh-system-fallback.test.ts index b477ad682ef0..3212a44b6fb6 100644 --- a/src/main/ssh/ssh-system-fallback.test.ts +++ b/src/main/ssh/ssh-system-fallback.test.ts @@ -880,14 +880,6 @@ describe('spawnSystemSsh', () => { vi.stubEnv('PATH', '') expect(() => spawnSystemSsh(createTarget())).toThrow('No system ssh binary found') }) - - it('returns a process wrapper with kill and onExit', () => { - const result = spawnSystemSsh(createTarget()) - - expect(result.pid).toBe(12345) - expect(typeof result.kill).toBe('function') - expect(typeof result.onExit).toBe('function') - }) }) describe('system SSH operation aborts', () => { diff --git a/src/main/startup/configure-process.test.ts b/src/main/startup/configure-process.test.ts index fd4379354c41..70747c926f48 100644 --- a/src/main/startup/configure-process.test.ts +++ b/src/main/startup/configure-process.test.ts @@ -1,4 +1,4 @@ -import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs' +import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { homedir, tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, expect, it, vi } from 'vitest' @@ -942,39 +942,6 @@ describe('safe graphics mode startup switches', () => { ) }) - // Why: the defect was the call site, not the switch — a win32 safe-graphics launch runs - // `if (!gpuFallbackActiveThisLaunch) enableMainProcessGpuFeatures()` and skips everything - // parked inside it, so only an unconditional call site reaches the users a GPU crash already hit. - it('calls the throttling opt-out outside the GPU-fallback gate in preflight', () => { - const mainSource = readFileSync(join(__dirname, 'main-process-preflight.ts'), 'utf8') - const gateStart = mainSource.indexOf('if (!state.gpuFallbackActiveThisLaunch) {') - expect(gateStart).toBeGreaterThanOrEqual(0) - const gateEnd = mainSource.indexOf('\n }', gateStart) - expect(gateEnd).toBeGreaterThan(gateStart) - - expect(mainSource.match(/\boptOutOfHiddenPageWakeUpThrottling\(\)/g)).toHaveLength(1) - expect(mainSource.slice(gateStart, gateEnd)).not.toContain('optOutOfHiddenPageWakeUpThrottling') - }) - - // Why: Chromium consumes the command line at ready, so this must stay in the pre-ready - // top-level block and never move into the whenReady callback, where appendSwitch is a silent - // no-op — the same invisible failure as parking it behind the GPU gate. - it('appends the throttling opt-out before app ready in preflight', () => { - const mainSource = readFileSync(join(__dirname, 'main-process-preflight.ts'), 'utf8') - const entrySource = readFileSync(join(__dirname, '..', 'index.ts'), 'utf8') - const preflightEnd = mainSource.indexOf('\n return true') - const readyStart = entrySource.indexOf('void app.whenReady()') - const preflightCall = entrySource.indexOf('runMainProcessPreflight({') - expect(preflightEnd).toBeGreaterThan(0) - expect(readyStart).toBeGreaterThan(0) - expect(preflightCall).toBeGreaterThanOrEqual(0) - expect(preflightCall).toBeLessThan(readyStart) - - const callIndex = mainSource.indexOf('optOutOfHiddenPageWakeUpThrottling()') - expect(callIndex).toBeGreaterThan(0) - expect(callIndex).toBeLessThan(preflightEnd) - }) - // Why: Chromium enables IntensiveWakeUpThrottling on every desktop platform, so the opt-out // must never become reachable only through the GPU-feature path again. it('does not couple the throttling opt-out to GPU feature setup', async () => { diff --git a/src/main/startup/secure-dns-census.test.ts b/src/main/startup/secure-dns-census.test.ts index 6393ac3f3a47..72177fc04d41 100644 --- a/src/main/startup/secure-dns-census.test.ts +++ b/src/main/startup/secure-dns-census.test.ts @@ -33,14 +33,4 @@ describe('secure DNS census', () => { expect(offenders).toEqual([]) }) - - it('detects a DoH mode when one is present', () => { - // Why: the census reads real sources, so it passes vacuously today; prove the matcher on a known offender. - const offending = "app.configureHostResolver({ secureDnsMode: 'automatic' })" - const modes = [...offending.matchAll(/secureDnsMode\s*:\s*'([^']*)'/g)].map((match) => match[1]) - - expect(offending.includes('configureHostResolver')).toBe(true) - expect(modes).toEqual(['automatic']) - expect(modes.every((mode) => mode === 'off')).toBe(false) - }) }) diff --git a/src/main/updater-test-harness.leaked-timers.test.ts b/src/main/updater-test-harness.leaked-timers.test.ts deleted file mode 100644 index 6857852c0e2b..000000000000 --- a/src/main/updater-test-harness.leaked-timers.test.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { setTimeout as sleep } from 'node:timers/promises' -import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { Mock } from 'vitest' -import { loadUpdaterModule, warmUpdaterModule } from './updater-test-module-loader' - -const { autoUpdaterMock, fetchNewerReleaseTagsMock, moduleFactories, resetUpdaterMocks } = - await vi.hoisted(async () => (await import('./updater-test-harness')).createUpdaterMocks()) - -vi.mock('electron', () => moduleFactories.electron()) -vi.mock('electron-updater', () => moduleFactories.electronUpdater()) -vi.mock('./electron-updater-loader', () => moduleFactories.electronUpdaterLoader()) -vi.mock('@electron-toolkit/utils', () => moduleFactories.electronToolkitUtils()) -vi.mock('./ipc/pty', () => moduleFactories.ipcPty()) -vi.mock('./linux-update-package-type', () => moduleFactories.linuxUpdatePackageType()) -vi.mock('./updater-lifecycle-diagnostics', () => moduleFactories.updaterLifecycleDiagnostics()) -vi.mock('./updater-changelog', () => moduleFactories.updaterChangelog()) -vi.mock('./updater-nudge', () => moduleFactories.updaterNudge()) -vi.mock('./update-install-exit-watchdog', () => moduleFactories.updateInstallExitWatchdog()) -vi.mock('./updater-prerelease-feed', () => moduleFactories.updaterPrereleaseFeed()) -vi.mock('./local-builds/local-build-switch', () => moduleFactories.localBuildSwitch()) -vi.mock('./local-builds/local-build-feed-server', () => moduleFactories.localBuildFeedServer()) - -const SILENT_SETTLE_DELAY_MS = 1_000 -const AUTO_UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000 - -warmUpdaterModule() - -describe('updater test harness real-timer tracking', () => { - beforeEach(() => { - resetUpdaterMocks() - }) - - it('cancels a real timer armed before the reset', async () => { - let fired = false - setTimeout(() => { - fired = true - }, 20) - - resetUpdaterMocks() - - await sleep(150) - expect(fired).toBe(false) - }) - - it('still arms real timers after the reset', async () => { - let fired = false - setTimeout(() => { - fired = true - }, 10) - - await sleep(150) - expect(fired).toBe(true) - }) - - it('hands back the untouched Node timeout handle', () => { - const handle = setTimeout(() => {}, 60_000) - - // Why: production code calls unref() on these; the tracker must not swap in a plain id. - expect(typeof handle.unref).toBe('function') - handle.unref() - clearTimeout(handle) - }) -}) - -// Why: this pair reproduces the cross-test leak, so it depends on running in file order — the first -// test arms the timer and the second one is the later test it used to fire into. -describe('abandoned updater instance', () => { - let leakedStatusSend: Mock = vi.fn() - - beforeEach(() => { - resetUpdaterMocks() - }) - - it('leaves a silent-settle timer armed when its module instance is abandoned', async () => { - let resolveCheck: (value: unknown) => void = () => {} - autoUpdaterMock.checkForUpdates.mockImplementation(() => { - // Why: the checking status is what makes the silent settle publish 'not-available' later. - autoUpdaterMock.emit('checking-for-update') - return new Promise((resolve) => { - resolveCheck = resolve - }) - }) - leakedStatusSend = vi.fn() - - const { setupAutoUpdater } = await loadUpdaterModule() - - setupAutoUpdater({ webContents: { send: leakedStatusSend } } as never, { - getLastUpdateCheckAt: () => Date.now() - 25 * 60 * 60 * 1000 - }) - - await vi.waitFor(() => { - expect(autoUpdaterMock.checkForUpdates).toHaveBeenCalledTimes(1) - }) - - // Why: resolving without a terminal event is what arms the 1s silent settle; do it here so the - // full delay is still ahead of us and the timer is guaranteed to be pending when this test ends. - resolveCheck(undefined) - await sleep(0) - - expect(leakedStatusSend).not.toHaveBeenCalledWith( - 'updater:status', - expect.objectContaining({ state: 'not-available' }) - ) - }) - - it('never reaches the shared spies once the next test owns the clock', async () => { - vi.useFakeTimers() - - // Why: real time past the settle delay — the abandoned instance would settle here and re-arm its - // 24h auto check on this test's fake clock at its epoch. - await sleep(SILENT_SETTLE_DELAY_MS + 300) - await vi.advanceTimersByTimeAsync(AUTO_UPDATE_CHECK_INTERVAL_MS) - - expect(leakedStatusSend).not.toHaveBeenCalledWith( - 'updater:status', - expect.objectContaining({ state: 'not-available' }) - ) - // Why: the generation fence stops at the autoUpdater spies; this one sits past it on the - // pinDefaultReleaseFeed chain that the stale instance's re-armed background check still reached. - expect(fetchNewerReleaseTagsMock).not.toHaveBeenCalled() - expect(autoUpdaterMock.checkForUpdates).not.toHaveBeenCalled() - }) -}) diff --git a/src/main/usage/usage-scan-worker-client.test.ts b/src/main/usage/usage-scan-worker-client.test.ts index 7b34b5a80f4e..09c6f378f007 100644 --- a/src/main/usage/usage-scan-worker-client.test.ts +++ b/src/main/usage/usage-scan-worker-client.test.ts @@ -1,4 +1,3 @@ -import { readFileSync } from 'node:fs' import { join, sep } from 'node:path' import { describe, expect, it, vi } from 'vitest' import { resolveWorkerThreadEntryPath } from '../worker-thread-entry-path' @@ -235,16 +234,4 @@ describe('usage scan worker entry path', () => { USAGE_SCAN_WORKER_ENTRY_FILENAME ]) }) - - // A rename in the build config would leave both branches pointing at a file - // that is never emitted, and only the packaged one fails silently. - it('names the entry the main build actually emits', () => { - const config = readFileSync( - join(import.meta.dirname, '..', '..', '..', 'electron.vite.config.ts'), - 'utf8' - ) - - expect(USAGE_SCAN_WORKER_ENTRY_FILENAME).toBe('usage-scan-worker-entry.js') - expect(config).toContain("'usage-scan-worker-entry': resolve(") - }) }) diff --git a/src/relay/relay-watcher-event-emitter.test.ts b/src/relay/relay-watcher-event-emitter.test.ts index 0f0991e5c012..82b10e2fdf3a 100644 --- a/src/relay/relay-watcher-event-emitter.test.ts +++ b/src/relay/relay-watcher-event-emitter.test.ts @@ -1,5 +1,3 @@ -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' import { describe, expect, it, vi } from 'vitest' import type { WatcherProcessEvent } from '../main/ipc/parcel-watcher-process-protocol' import { RelayDispatcher } from './dispatcher' @@ -200,13 +198,6 @@ describe('relay watcher writer admission', () => { }) describe('relay watcher overflow suppression key', () => { - it('keeps the source free of NUL bytes so git and grep still see text', () => { - const source = readFileSync( - fileURLToPath(new URL('./relay-watcher-event-emitter.ts', import.meta.url)) - ) - expect(source.includes(0)).toBe(false) - }) - it('scopes the outstanding marker per client as well as per root', () => { const primary = createRecordingSink(65536) const secondary = createRecordingSink(65536) diff --git a/src/renderer/src/app-shell/workspace-view-cross-client-sync.test.tsx b/src/renderer/src/app-shell/workspace-view-cross-client-sync.test.tsx index 314977a17aaa..f5d404b4e104 100644 --- a/src/renderer/src/app-shell/workspace-view-cross-client-sync.test.tsx +++ b/src/renderer/src/app-shell/workspace-view-cross-client-sync.test.tsx @@ -6,16 +6,11 @@ // authority (main) = real updatePersistedUI/getPersistedUI merge // broadcast = controlled queue modeling the async ui:stateChanged IPC send // mobile client = mobile/src/worktree/workspace-view-settings mapping; the ui.set -// payload uses the shipping buildWorkspaceViewSettingsUpdate when -// exported, else the legacy whole-snapshot shape — the source-pin -// test asserts use-host-view-settings.ts matches whichever path is -// active, so the model stays tethered to shipping code. +// payload mirrors the shipping buildWorkspaceViewSettingsUpdate. // // Invariant: when two independently identified clients change DISJOINT workspace-view // fields concurrently or across stale-mirror windows, both changes survive and all // mirrors converge; no client may restore a stale sibling field. -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { StrictMode, act, createElement } from 'react' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' @@ -84,8 +79,7 @@ function createAuthority() { type Authority = ReturnType // Local model of mobile/src/worktree/workspace-view-settings.ts (the desktop test -// runner cannot transform Expo-configured sources). The source-pin test at the -// bottom fails if the shipping module stops matching this model. +// runner cannot transform Expo-configured sources). type MobileViewState = { groupMode: 'none' | 'workspaceStatus' | 'repo' | 'prStatus' sortMode: 'smart' | 'name' | 'recent' | 'repo' | 'manual' @@ -96,10 +90,6 @@ type MobileViewState = { collapsedGroups: string[] } -function mobileHasPatchOnlyBuilder(): boolean { - return readMobileViewSettingsSource().includes('export function buildWorkspaceViewSettingsUpdate') -} - /** Mirrors buildWorkspaceViewSettingsUpdate (candidate) — only touched fields. */ function patchOnlyUpdate( patch: Partial, @@ -127,18 +117,6 @@ function patchOnlyUpdate( return update } -/** Mirrors the pre-fix persistViewSettings payload — the full snapshot on every tap. */ -function legacyWholeSnapshotUpdate(next: MobileViewState): Partial { - return { - groupBy: next.groupMode === 'workspaceStatus' ? 'workspace-status' : 'repo', - sortBy: next.sortMode, - hideSleepingWorkspaces: next.hideSleeping, - hideDefaultBranchWorkspace: next.hideDefaultBranch, - filterRepoIds: next.filterRepoIds, - collapsedGroups: next.collapsedGroups - } -} - /** Model of the mobile host screen's view-settings client (persistViewSettings et al.). */ function createMobileClient(authority: Authority) { let view: MobileViewState = { @@ -171,28 +149,12 @@ function createMobileClient(authority: Authority) { /** A user tap: apply locally, then push through the shipping payload shape. */ tap(patch: Partial) { view = { ...view, ...patch } - const payload = mobileHasPatchOnlyBuilder() - ? patchOnlyUpdate(patch, view) - : legacyWholeSnapshotUpdate(view) + const payload = patchOnlyUpdate(patch, view) authority.set(omitPairingLocalUiFields(payload) as Partial) } } } -function readMobileViewSettingsHookSource(): string { - return readFileSync( - join(__dirname, '../../../../mobile/src/host-screen/use-host-view-settings.ts'), - 'utf-8' - ) -} - -function readMobileViewSettingsSource(): string { - return readFileSync( - join(__dirname, '../../../../mobile/src/worktree/workspace-view-settings.ts'), - 'utf-8' - ) -} - describe('workspace view preferences: cross-client persistence (STA-5781)', () => { let authority: Authority let store: StoreApi @@ -710,35 +672,4 @@ describe('workspace view preferences: cross-client persistence (STA-5781)', () = expect(authority.get().hideDefaultBranchWorkspace).toBe(false) expect(store.getState().hideDefaultBranchWorkspace).toBe(false) }) - - it('pins the modeled mobile ui.set payload to the shipping source', async () => { - const source = readMobileViewSettingsHookSource() - if (mobileHasPatchOnlyBuilder()) { - // Candidate: the persistence hook must push through the patch-only builder this model uses. - expect(source).toContain('buildWorkspaceViewSettingsUpdate(patch, next)') - const builderSource = readMobileViewSettingsSource() - for (const guard of [ - "if ('groupMode' in patch)", - "if ('sortMode' in patch)", - "if ('hideSleeping' in patch)", - "if ('hideDefaultBranch' in patch)", - "if ('filterRepoIds' in patch)", - "if ('collapsedGroups' in patch)" - ]) { - expect(builderSource).toContain(guard) - } - } else { - // Baseline: persistViewSettings pushes exactly this whole-snapshot payload. - for (const key of [ - 'groupBy: groupModeToDesktop(next.groupMode)', - 'sortBy: next.sortMode', - 'hideSleepingWorkspaces: next.hideSleeping', - 'hideDefaultBranchWorkspace: next.hideDefaultBranch', - 'filterRepoIds: next.filterRepoIds', - 'collapsedGroups: next.collapsedGroups' - ]) { - expect(source).toContain(key) - } - } - }) }) diff --git a/src/renderer/src/components/AgentStateDot.test.ts b/src/renderer/src/components/AgentStateDot.test.ts index 33642542d79f..a767a61ccf4b 100644 --- a/src/renderer/src/components/AgentStateDot.test.ts +++ b/src/renderer/src/components/AgentStateDot.test.ts @@ -47,15 +47,9 @@ describe('AgentStateDot', () => { it('renders working as a yellow spinner', () => { const markup = renderMarkup('working') - expect(markup).toContain('border-yellow-500') - expect(markup).toContain('border-t-transparent') - // Why: rotation must come from the compositor-driven CSS animation, not a - // JS clock writing per-element styles on the input thread (STA-3328). - expect(markup).toContain('agent-working-spinner') + // The spinner's own classes and animation contract belong to AgentWorkingSpinner.test.tsx; + // this pins only that 'working' reaches for it. expect(markup).toContain('data-agent-spinner') - // Why: under reduced motion the top border is filled so the static ring - // reads as a complete marker, not a broken partial spinner (#9515). - expect(markup).toContain('motion-reduce:border-t-yellow-500') }) it('renders monitoring as a static yellow heartbeat glyph', () => { diff --git a/src/renderer/src/components/automations/automation-scoped-list-client.test.ts b/src/renderer/src/components/automations/automation-scoped-list-client.test.ts index e07399319fb3..43319886180a 100644 --- a/src/renderer/src/components/automations/automation-scoped-list-client.test.ts +++ b/src/renderer/src/components/automations/automation-scoped-list-client.test.ts @@ -288,7 +288,7 @@ describe('owner-fenced mutations', () => { }) it('fences a desktop mutation over the local runtime target with the same precondition', async () => { - const { deleteAutomationForOwner, updateAutomationForOwner } = await client() + const { updateAutomationForOwner } = await client() callRuntimeRpc.mockResolvedValue({ automation: { id: 'a1' } }) await updateAutomationForOwner({ authority: DESKTOP, selector: { kind: 'self' } }, 'a1', { enabled: true @@ -300,7 +300,6 @@ describe('owner-fenced mutations', () => { expect.anything() ) expect(getRuntimeEnvironmentStatus).not.toHaveBeenCalled() - expect(typeof deleteAutomationForOwner).toBe('function') }) }) diff --git a/src/renderer/src/components/browser-pane/annotate/BrowserAnnotationSendMenuContent.test.tsx b/src/renderer/src/components/browser-pane/annotate/BrowserAnnotationSendMenuContent.test.tsx index 4eb4174211b8..24524a10dc7d 100644 --- a/src/renderer/src/components/browser-pane/annotate/BrowserAnnotationSendMenuContent.test.tsx +++ b/src/renderer/src/components/browser-pane/annotate/BrowserAnnotationSendMenuContent.test.tsx @@ -1,6 +1,4 @@ import React from 'react' -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' import { describe, expect, it, vi } from 'vitest' import { BrowserAnnotationSendMenuContent } from './BrowserAnnotationSendMenuContent' @@ -92,19 +90,4 @@ describe('BrowserAnnotationSendMenuContent', () => { onPromptDelivered }) }) - - it('is wired into both browser annotation send surfaces', () => { - const bannerSource = readFileSync( - fileURLToPath(new URL('../assemble-chrome/browser-page-chrome-banners.tsx', import.meta.url)), - 'utf8' - ) - const traySource = readFileSync( - fileURLToPath(new URL('./browser-page-annotation-tray.tsx', import.meta.url)), - 'utf8' - ) - const sendSurfaces = `${bannerSource}\n${traySource}` - - expect(sendSurfaces.match(/ { - it('pins context-menu opens to the runtime that owns the pane', () => { - const source = readFileSync( - fileURLToPath(new URL('../stream-remote/remote-browser-page-pane.tsx', import.meta.url)), - 'utf8' - ) - const paneStart = source.indexOf('function RemoteBrowserPagePane') - const actionStart = source.indexOf('void openWorkspaceBrowserTab({', paneStart) - const actionEnd = source.indexOf('}).catch((error) => {', actionStart) - const openRequest = source.slice(actionStart, actionEnd) - - expect(openRequest).toContain('workspaceId: worktreeId') - expect(openRequest).toContain('expectedRuntimeEnvironmentId: runtimeEnvironmentId') - expect(openRequest).toContain("placementPreference: 'server'") - // A background link follows its source wrapper and never selects the workspace again. - expect(openRequest).toContain( - '...(sourceUnifiedTab ? { afterTabId: sourceUnifiedTab.id } : {})' - ) - expect(openRequest).toContain('selectWorktree: false') - }) -}) diff --git a/src/renderer/src/components/browser-pane/assemble-chrome/BrowserPane.render-ipc.test.ts b/src/renderer/src/components/browser-pane/assemble-chrome/BrowserPane.render-ipc.test.ts deleted file mode 100644 index 9e42075283c8..000000000000 --- a/src/renderer/src/components/browser-pane/assemble-chrome/BrowserPane.render-ipc.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' -import { describe, expect, it } from 'vitest' - -describe('BrowserPagePane render IPC boundary', () => { - it('derives toolbar URLs without querying the webview', () => { - const source = readFileSync( - fileURLToPath(new URL('./browser-page-pane.tsx', import.meta.url)), - 'utf8' - ) - const start = source.indexOf('const isBlankTab =', source.indexOf('function BrowserPagePane')) - const end = source.indexOf('useEffect(() => {', start) - const renderUrlDerivation = source.slice(start, end) - - expect(renderUrlDerivation).toContain('getLiveBrowserUrl(browserTab.id)') - expect(renderUrlDerivation).not.toContain('webviewRef') - expect(renderUrlDerivation).not.toContain('.getURL(') - }) -}) diff --git a/src/renderer/src/components/browser-pane/browser-client-page-metadata-route-census.test.ts b/src/renderer/src/components/browser-pane/browser-client-page-metadata-route-census.test.ts deleted file mode 100644 index 6937de9e6e46..000000000000 --- a/src/renderer/src/components/browser-pane/browser-client-page-metadata-route-census.test.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' -import { describe, expect, it } from 'vitest' - -/** - * Page metadata has exactly one way out of this renderer: main, which owns the browser-host lease. - * - * Why a census and not a behavioural test: the failure this guards is silent. The runtime accepts - * page traffic only on the connection its lease attached on, so a publish sent as an ordinary - * runtime call is refused as a stale lease and simply never lands — the pane keeps working, the - * guest keeps navigating, and only the runtime's copy of the URL stays frozen at the create URL. - * Nothing in the rendered result changes, so only the route itself can be asserted. - */ -const ROUTE_PATH = fileURLToPath( - new URL('./browser-client-page-metadata-reporting.ts', import.meta.url) -) -const PANE_PATH = fileURLToPath(new URL('./ClientHostedBrowserPagePane.tsx', import.meta.url)) - -describe('client-hosted page metadata route', () => { - const route = readFileSync(ROUTE_PATH, 'utf8') - const pane = readFileSync(PANE_PATH, 'utf8') - - it('publishes through main and never through a plain runtime call', () => { - expect(occurrences(route, 'window.api.browser.publishClientPageMetadata')).toBe(1) - expect(occurrences(route, 'runtimeEnvironments.call')).toBe(0) - expect(occurrences(pane, 'runtimeEnvironments.call')).toBe(0) - }) - - it('reports a publish that did not land', () => { - expect(occurrences(route, 'onUnpublished:')).toBe(1) - }) - - // The pane must not build its own publisher around the route: a second construction site is a - // second chance to wire the transport wrongly, and it would not be covered by the counts above. - it('leaves the pane one way to start publishing', () => { - expect(occurrences(pane, 'createBrowserClientPageMetadataPublisher(')).toBe(0) - expect(occurrences(pane, 'startBrowserClientPageMetadataPublisher(')).toBe(1) - }) -}) - -function occurrences(source: string, needle: string): number { - return source.split(needle).length - 1 -} diff --git a/src/renderer/src/components/browser-pane/host-guest/browser-guest-paint-retention.ts b/src/renderer/src/components/browser-pane/host-guest/browser-guest-paint-retention.ts index 0d1364c139ba..941c527b38f0 100644 --- a/src/renderer/src/components/browser-pane/host-guest/browser-guest-paint-retention.ts +++ b/src/renderer/src/components/browser-pane/host-guest/browser-guest-paint-retention.ts @@ -61,7 +61,6 @@ export function useBrowserGuestPaintRetention(browserPageIds: readonly string[]) // Why one exported predicate rather than the same OR-list at each site: a hand-rolled copy stays // green when a term is added — nothing typechecks a site that never names the new signal — and the // remote-viewer term reached the panes while four copies in Terminal.tsx still had three terms. -// browser-guest-retention-site-census.test.ts holds the sites to this function. export function browserPageNeedsPaintRetention(browserPageId: string): boolean { return ( isBrowserAutomationVisible(browserPageId) || diff --git a/src/renderer/src/components/browser-pane/host-guest/browser-guest-retention-site-census.test.ts b/src/renderer/src/components/browser-pane/host-guest/browser-guest-retention-site-census.test.ts deleted file mode 100644 index 5d8c60283293..000000000000 --- a/src/renderer/src/components/browser-pane/host-guest/browser-guest-retention-site-census.test.ts +++ /dev/null @@ -1,223 +0,0 @@ -import { readdirSync, readFileSync } from 'node:fs' -import { join, relative, sep } from 'node:path' -import { describe, expect, it } from 'vitest' - -// Guest retention is an OR over several independent signals, and every container from the app -// shell down to the guest has to agree on the list — Chromium stops painting inside a display:none -// subtree, so the *most* pinched ancestor wins. Adding a term (the remote-viewer signal, STA-4150) -// reached the panes while four hand-rolled copies still listed three: nothing typechecks a site -// that never names the new symbol. So the terms live behind one helper, and this census holds the -// sites to it — the classification is enforced here, not by review. - -const RENDERER_SRC = join(__dirname, '..', '..', '..') - -// The three term stores. -const RETENTION_TERM_STORES = [ - 'components/browser-pane/host-guest/browser-automation-visibility.ts', - 'lib/pane-manager/browser-mobile-driver-state.ts', - 'lib/pane-manager/browser-remote-viewer-state.ts' -] - -// ...plus the single module allowed to OR their terms together. -const RETENTION_TERM_OWNERS = [ - ...RETENTION_TERM_STORES, - 'components/browser-pane/host-guest/browser-guest-paint-retention.ts' -] - -// Every way a term store lets a caller read one term. A site that hand-rolls the OR-list from -// readers missing here would pass the census, so the last check holds this list to the exports. -const RETENTION_TERM_SYMBOLS = [ - 'isBrowserAutomationVisible', - 'useBrowserAutomationVisibilityForAny', - 'getBrowserAutomationVisiblePageIds', - 'onBrowserAutomationVisibilityChange', - 'isBrowserPageMobileDriven', - 'hasMobileDriverForAnyBrowserPage', - 'useBrowserMobileDriverForAny', - 'getBrowserMobileDrivenPageIds', - 'getDriverForBrowserPage', - 'useBrowserDriverForPage', - 'onBrowserDriverChange', - 'isBrowserPageRemotelyViewed', - 'hasRemoteViewerForAnyBrowserPage', - 'useBrowserRemoteViewerForAny', - 'getBrowserRemotelyViewedPageIds', - 'onBrowserRemoteViewerChange' -] - -const RETENTION_HELPER_SYMBOLS = [ - 'useAnyBrowserGuestNeedsPaint', - 'useBrowserGuestPaintRetention', - 'browserPageNeedsPaintRetention', - 'onBrowserGuestPaintRetentionChange', - 'browserTabsVetoGuestEviction' -] - -// Every place that decides whether a browser guest keeps painting, and the helper it must use. -const RETENTION_SITES = new Map([ - ['components/TerminalWorkbenchContainer.tsx', ['useAnyBrowserGuestNeedsPaint']], - // The two outermost workbench wrappers: strict ancestors of every guest, so the per-worktree - // surface hatch below cannot rescue a guest either one parked with `hidden`. - ['components/TerminalSurface.tsx', ['useAnyBrowserGuestNeedsPaint']], - ['components/TerminalSplitWorkspaceSurfaces.tsx', ['useAnyBrowserGuestNeedsPaint']], - ['components/TerminalWorktreeSplitSurface.tsx', ['useBrowserGuestPaintRetention']], - [ - 'components/browser-pane/assemble-chrome/BrowserPaneOverlayLayer.tsx', - ['useBrowserGuestPaintRetention'] - ], - [ - 'components/browser-pane/host-guest/browser-guest-worktree-retention.ts', - ['browserPageNeedsPaintRetention'] - ], - [ - 'components/use-terminal-browser-retention.ts', - ['browserTabsVetoGuestEviction', 'onBrowserGuestPaintRetentionChange'] - ] -]) - -// The per-page threading hooks are the carve-out: they hand one boolean per page to -// browser-page-paintability's required fields, so a missing term IS a typecheck error there. They -// still travel as a set — a caller that reads two of the three is the same omission bug. -const PER_PAGE_RETENTION_HOOKS = [ - 'useBrowserAutomationVisiblePageIds', - 'useBrowserMobileDrivenPageIds', - 'useBrowserRemotelyViewedPageIds' -] - -// One production read of a term is not a retention decision: the pane reads *who* drives the active -// page to label the overlay and lock input. Naming the exception per file rather than dropping the -// symbol keeps every other file that reads it a census failure. -const NON_RETENTION_TERM_READERS = new Map([ - [ - 'components/browser-pane/assemble-chrome/browser-workspace-pane.tsx', - ['useBrowserDriverForPage'] - ] -]) - -// Writers, hydrators and the idle sentinel: they set or seed a term rather -// than read it, so naming one is not a retention decision. -const NON_READER_TERM_EXPORTS = [ - 'acquireBrowserAutomationVisibility', - 'releaseBrowserAutomationVisibility', - 'setDriverForBrowserPage', - 'hydrateBrowserDrivers', - 'IDLE_BROWSER_DRIVER', - 'setRemoteViewersForBrowserPage', - 'hydrateBrowserRemoteViewerPages' -] - -function productionSources(): Map { - const sources = new Map() - for (const entry of readdirSync(RENDERER_SRC, { recursive: true, withFileTypes: true })) { - if (!entry.isFile() || !/\.tsx?$/.test(entry.name) || entry.name.endsWith('.d.ts')) { - continue - } - if (/\.test\.tsx?$/.test(entry.name) || /test-(harness|rig|fixtures)/.test(entry.name)) { - continue - } - const filePath = join(entry.parentPath, entry.name) - sources.set( - relative(RENDERER_SRC, filePath).split(sep).join('/'), - readFileSync(filePath, 'utf8') - ) - } - return sources -} - -function namedSymbols(source: string, symbols: readonly string[]): string[] { - return symbols.filter((symbol) => new RegExp(`\\b${symbol}\\b`).test(source)) -} - -describe('browser guest retention site census', () => { - const sources = productionSources() - - it('keeps every individual retention term behind the shared helper', () => { - const offenders = [...sources] - .filter(([file]) => !RETENTION_TERM_OWNERS.includes(file)) - .map(([file, source]) => ({ - file, - terms: namedSymbols(source, RETENTION_TERM_SYMBOLS).filter( - (term) => !(NON_RETENTION_TERM_READERS.get(file) ?? []).includes(term) - ) - })) - .filter(({ terms }) => terms.length > 0) - .map(({ file, terms }) => `${file}: ${terms.join(', ')}`) - .sort() - - expect( - offenders, - 'A retention site that names terms one by one silently keeps its old list when a new signal ' + - 'is added. Call useBrowserGuestPaintRetention / browserPageNeedsPaintRetention instead, ' + - 'and register the site in RETENTION_SITES.' - ).toEqual([]) - }) - - it('registers every consumer of the shared retention helper', () => { - const consumers = [...sources] - .filter( - ([file]) => file !== 'components/browser-pane/host-guest/browser-guest-paint-retention.ts' - ) - .filter(([, source]) => namedSymbols(source, RETENTION_HELPER_SYMBOLS).length > 0) - .map(([file]) => file) - .sort() - - expect(consumers, 'New retention sites must be listed in RETENTION_SITES.').toEqual( - [...RETENTION_SITES.keys()].sort() - ) - }) - - it('keeps each registered site consulting retention through its helper', () => { - const missing: string[] = [] - for (const [file, requiredSymbols] of RETENTION_SITES) { - const source = sources.get(file) - expect(source, `${file} is registered as a retention site but no longer exists`).toBeDefined() - for (const symbol of requiredSymbols) { - if (!new RegExp(`\\b${symbol}\\b`).test(source ?? '')) { - missing.push(`${file}: ${symbol}`) - } - } - } - expect(missing, 'A registered retention site stopped consulting retention.').toEqual([]) - }) - - it('keeps the per-page threading hooks travelling as a full set', () => { - const partial = [...sources] - .filter(([file]) => !RETENTION_TERM_OWNERS.includes(file)) - .map(([file, source]) => ({ file, hooks: namedSymbols(source, PER_PAGE_RETENTION_HOOKS) })) - .filter(({ hooks }) => hooks.length > 0 && hooks.length < PER_PAGE_RETENTION_HOOKS.length) - .map(({ file, hooks }) => `${file}: only ${hooks.join(', ')}`) - .sort() - - expect( - partial, - 'A pane that threads some retention terms per page must thread all of them.' - ).toEqual([]) - }) - - // Keeps the symbol lists above from going stale: a term store that grows a new reader nobody - // classified would otherwise be a free way to hand-roll the OR-list. - it('classifies every value a term store exports', () => { - const classified = new Set([ - ...RETENTION_TERM_SYMBOLS, - ...PER_PAGE_RETENTION_HOOKS, - ...NON_READER_TERM_EXPORTS - ]) - const unclassified: string[] = [] - for (const file of RETENTION_TERM_STORES) { - const source = sources.get(file) - expect(source, `${file} is registered as a term store but no longer exists`).toBeDefined() - for (const [, name] of (source ?? '').matchAll(/^export (?:function|const|let) (\w+)/gm)) { - if (!classified.has(name)) { - unclassified.push(`${file}: ${name}`) - } - } - } - - expect( - unclassified, - 'A term store exports something this census does not classify. Add a reader to ' + - 'RETENTION_TERM_SYMBOLS (or PER_PAGE_RETENTION_HOOKS, for the per-page hooks typecheck ' + - 'already covers) so hand-rolled sites keep failing, and a writer to NON_READER_TERM_EXPORTS.' - ).toEqual([]) - }) -}) diff --git a/src/renderer/src/components/confirmation-dialog-refresh-boundary.test.ts b/src/renderer/src/components/confirmation-dialog-refresh-boundary.test.ts index 952cb21e23dc..b2f1db2de1f1 100644 --- a/src/renderer/src/components/confirmation-dialog-refresh-boundary.test.ts +++ b/src/renderer/src/components/confirmation-dialog-refresh-boundary.test.ts @@ -1,33 +1,11 @@ // @vitest-environment happy-dom -import { createRequire } from 'node:module' import { createElement, type ReactNode } from 'react' import { renderHook } from '@testing-library/react' import { describe, expect, it } from 'vitest' -import * as contextModule from '@/components/confirmation-dialog-context' -import * as providerModule from '@/components/confirmation-dialog' import { ConfirmationDialogProvider } from '@/components/confirmation-dialog' import { useConfirmationDialog } from '@/components/confirmation-dialog-context' -// react-refresh ships no types; take the one binding this needs. -const { isLikelyComponentType } = createRequire(import.meta.url)('react-refresh/runtime') as { - isLikelyComponentType: (value: unknown) => boolean -} - describe('confirmation dialog Fast Refresh boundary', () => { - it('exports nothing from the provider module that invalidates the refresh boundary', () => { - expect(Object.keys(providerModule)).toEqual(['ConfirmationDialogProvider']) - expect(isLikelyComponentType(providerModule.ConfirmationDialogProvider)).toBe(true) - }) - - it('keeps the context and hook in a component-free module', () => { - const components = Object.entries(contextModule) - .filter(([, value]) => isLikelyComponentType(value)) - .map(([name]) => name) - - expect(components).toEqual([]) - expect(typeof contextModule.useConfirmationDialog).toBe('function') - }) - it('resolves the hook against the context the provider publishes', () => { const wrapper = ({ children }: { children: ReactNode }) => createElement(ConfirmationDialogProvider, null, children) diff --git a/src/renderer/src/components/feature-interaction-writer-boundaries.test.ts b/src/renderer/src/components/feature-interaction-writer-boundaries.test.ts deleted file mode 100644 index 4a02840098e6..000000000000 --- a/src/renderer/src/components/feature-interaction-writer-boundaries.test.ts +++ /dev/null @@ -1,323 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const COMPONENT_ROOT = __dirname - -function componentSource(relativePath: string): string { - return readFileSync(join(COMPONENT_ROOT, relativePath), 'utf8') -} - -function sourceBetween(source: string, startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('feature interaction writer boundaries', () => { - it('keeps Cmd+J feature writers in open/selection handlers, not query or navigation rendering', () => { - // Selection and create callbacks now live in focused hooks; the surface only renders them. - const selectionSource = componentSource('use-worktree-jump-palette-selection-actions.ts') - const lifecycleSource = componentSource('use-worktree-jump-palette-selection-lifecycle.ts') - const createSource = componentSource('use-worktree-jump-palette-create-action.ts') - const handlerSection = [selectionSource, lifecycleSource, createSource].join('\n') - const renderSection = componentSource('worktree-jump-palette-surface.tsx') - - const cmdJWriterPattern = /recordFeatureInteraction\('cmd-j/g - const allCmdJWriterCount = handlerSection.match(cmdJWriterPattern)?.length ?? 0 - expect(allCmdJWriterCount).toBeGreaterThanOrEqual(6) - expect(handlerSection.match(cmdJWriterPattern)?.length ?? 0).toBe(allCmdJWriterCount) - expect(renderSection).not.toContain("recordFeatureInteraction('cmd-j") - expect( - sourceBetween(lifecycleSource, 'const handleQueryChange', 'const cancelFallbackFocusFrames') - ).not.toContain("recordFeatureInteraction('cmd-j") - }) - - it('keeps task-provider writers off filters, tab switches, query edits, refresh, and pagination', () => { - const providerWriter = /recordFeatureInteraction\('(github|gitlab|linear)-tasks'\)/ - const refreshSource = componentSource('use-task-page-github-cache-reconciliation.ts') - const paginationSource = componentSource('use-task-page-github-search-pagination.ts') - const searchSource = componentSource('use-task-page-search-actions.ts') - - const passiveSections = [ - sourceBetween(refreshSource, 'const handleRefreshGithubTasks', 'const nextModel'), - sourceBetween(paginationSource, 'const handleLoadNextPage', 'const commitTaskSearch'), - sourceBetween(searchSource, 'const applyPRFilterChange', 'const handleApplyTaskSearch'), - sourceBetween(searchSource, 'const handleApplyTaskSearch', 'const handleTaskSearchChange'), - sourceBetween( - searchSource, - 'const handleTaskSearchChange', - 'const handleSetDefaultTaskPreset' - ), - sourceBetween( - searchSource, - 'const handleSelectGithubTaskKind', - 'const handleResetGithubTaskSearch' - ) - ] - for (const section of passiveSections) { - expect(section).not.toMatch(providerWriter) - } - }) - - it('records GitHub provider-depth for inline item mutation success paths', () => { - const githubWriter = "recordFeatureInteraction('github-tasks')" - // Why: table cells route success telemetry through the optimistic mutation - // hook so provider-depth recording stays on one confirm path. - const hookSource = readFileSync( - join(COMPONENT_ROOT, '../hooks/useTaskPageGitHubWorkItemMutation.ts'), - 'utf8' - ) - expect( - sourceBetween(hookSource, "if (confirmed === 'confirmed')", 'return confirmed') - ).toContain(githubWriter) - expect( - sourceBetween( - componentSource('use-task-page-workspace-actions.ts'), - 'const handleOpenOrUseGitHubWorkItem', - 'const openComposerForGitLabItem' - ) - ).toContain(githubWriter) - }) - - it('threads GitHub task source context through inline task mutations', () => { - const sections = [ - componentSource('task-page/github/StatusCell.tsx'), - componentSource('task-page/github/AssigneesCell.tsx'), - componentSource('task-page/github/ReviewCell.tsx'), - componentSource('task-page/github/MergeCell.tsx'), - sourceBetween( - componentSource('use-task-page-github-issue-creation.ts'), - 'const handleCreateNewIssue', - 'const nextModel' - ) - ] - - for (const section of sections) { - expect(section).toContain('sourceContext') - } - const rowSource = componentSource('task-page/github/Rows.tsx') - // Rows inline the repo lookup per cell rather than hoisting one const. - expect( - rowSource.match(/sourceContext=\{getTaskPageRepoSourceContext\(itemRepo, 'github'\)\}/g) - ).toHaveLength(4) - }) - - it('suppresses Tasks surface telemetry for in-page provider switches and detail opens', () => { - const suppression = 'recordTasksInteraction: false' - const githubDetailSection = sourceBetween( - componentSource('use-task-page-github-detail.ts'), - 'const openGitHubDetailPage', - 'const nextModel' - ) - - const inPageNavigationSections = [ - sourceBetween( - componentSource('use-task-page-detail-routing.ts'), - 'const openLinearDetailPage', - 'const openRelatedLinearIssue' - ), - sourceBetween( - componentSource('task-page/SourceBar.tsx'), - 'taskSourceManuallyChangedRef.current = true', - 'void updateSettings' - ) - ] - - expect(githubDetailSection).toContain('openGitHubSourceContext') - expect(githubDetailSection).toContain('openTaskPage') - expect(githubDetailSection).toContain(suppression) - - for (const section of inPageNavigationSections) { - expect(section).toContain(suppression) - } - }) - - it('records Cmd+J create-workspace as its own destination, not a generic quick action', () => { - const source = componentSource('use-worktree-jump-palette-selection-actions.ts') - const section = sourceBetween( - source, - 'const handleSelectQuickAction', - 'const handleSelectProjectTarget' - ) - - expect(section).toContain("recordFeatureInteraction('cmd-j-create-workspace')") - expect(section).toContain("recordFeatureInteraction('cmd-j-quick-action')") - expect(section.indexOf("recordFeatureInteraction('cmd-j-create-workspace')")).toBeLessThan( - section.indexOf("recordFeatureInteraction('cmd-j-quick-action')") - ) - expect( - sourceBetween( - section, - "if (action.id === 'create-workspace')", - "recordFeatureInteraction('cmd-j-quick-action')" - ) - ).toContain('return') - }) - - it('records GitLab provider-depth for detail opens, workspace use, and dialog mutations', () => { - const detailsSource = componentSource('gitlab-item-dialog/use-gitlab-details-editing.ts') - const primarySource = componentSource('gitlab-item-dialog/use-gitlab-primary-actions.ts') - const reviewSource = componentSource('gitlab-item-dialog/use-gitlab-review-actions.ts') - const gitlabWriter = "recordFeatureInteraction('gitlab-tasks')" - - expect( - sourceBetween( - componentSource('task-page/gitlab/ItemList.tsx'), - '{displayedGitLabItems.map((item) => (', - 'handleUseGitLabItem(item)' - ).match(/recordFeatureInteraction\('gitlab-tasks'\)/g) - ).toHaveLength(2) - expect( - sourceBetween( - componentSource('use-task-page-workspace-actions.ts'), - 'const handleUseGitLabItem', - 'const nextModel' - ) - ).toContain(gitlabWriter) - - const mutationSections = [ - sourceBetween(detailsSource, 'const handleSaveDetails', 'return {'), - sourceBetween(reviewSource, 'const handleSetReviewers', 'const handleSubmitInlineComment'), - sourceBetween( - reviewSource, - 'const handleSubmitInlineComment', - 'const handleResolveDiscussion' - ), - sourceBetween(primarySource, 'const handleClose', 'const handleReopen'), - sourceBetween(primarySource, 'const handleReopen', 'const handleMerge'), - sourceBetween(primarySource, 'const handleMerge', 'const handleSubmitComment'), - sourceBetween(primarySource, 'const handleSubmitComment', 'return {'), - sourceBetween(reviewSource, 'const handleResolveDiscussion', 'return {') - ] - for (const section of mutationSections) { - expect(section).toContain(gitlabWriter) - expect(section).toContain('showGitLabMutationError') - } - }) - - it('keeps nested GitLab row actions from also opening task details by keyboard', () => { - const rowSection = sourceBetween( - componentSource('task-page/gitlab/ItemList.tsx'), - 'onKeyDown={(e) => {', - 'className="grid w-full cursor-pointer' - ) - expect(rowSection).toContain('e.target !== e.currentTarget') - expect(rowSection.indexOf('e.target !== e.currentTarget')).toBeLessThan( - rowSection.indexOf("e.key === 'Enter'") - ) - }) - - it('keys GitLab rows by repository and item identity across hosts', () => { - expect(componentSource('task-page/gitlab/ItemList.tsx')).toContain( - 'key={`${item.repoId}:${item.id}`}' - ) - }) - - it('records Linear provider-depth for inline edits, board drops, creation, and workspace use', () => { - const drawerSource = [ - componentSource('linear-item-drawer-edit-controller.tsx'), - componentSource('linear-item-drawer-comment-footer.tsx') - ].join('\n') - const linearWriter = "recordFeatureInteraction('linear-tasks')" - - const taskPageSections = [ - sourceBetween( - componentSource('task-page-linear-issue-model.tsx'), - 'export function LinearStateCell', - 'return (' - ), - sourceBetween( - componentSource('use-task-page-linear-board.ts'), - 'const handleLinearBoardDrop', - 'const toggleLinearDisplayProperty' - ), - sourceBetween( - componentSource('use-task-page-linear-issue-creation.ts'), - 'const handleCreateNewLinearIssue', - 'const nextModel' - ), - sourceBetween( - componentSource('use-task-page-composer-actions.ts'), - 'const handleUseLinearItem', - 'const handleLinearWorkspaceChange' - ) - ] - for (const section of taskPageSections) { - expect(section).toContain(linearWriter) - } - - const drawerMutationSections = [ - sourceBetween(drawerSource, 'const handleStateChange', 'const handlePriorityChange'), - sourceBetween(drawerSource, 'const handlePriorityChange', 'const handleEstimateChange'), - sourceBetween(drawerSource, 'const handleEstimateChange', 'const handleEstimateSubmit'), - sourceBetween(drawerSource, 'const handleAssigneeChange', 'const handleLabelToggle'), - sourceBetween(drawerSource, 'const handleLabelToggle', 'return {'), - sourceBetween(drawerSource, 'const handleSubmit = useCallback(async () => {', 'return (') - ] - for (const section of drawerMutationSections) { - expect(section).toContain(linearWriter) - } - }) - - it('records Jira provider-depth for workspace use', () => { - const jiraWriter = "recordFeatureInteraction('jira-tasks')" - - // End boundary is the declaration after the handler: the Jira connect flow - // now lives in the shared JiraConnectDialog, so handleJiraConnect (the prior - // marker) no longer exists in TaskPage. - expect( - sourceBetween( - componentSource('use-task-page-composer-actions.ts'), - 'const handleUseJiraItem', - 'const nextModel' - ) - ).toContain(jiraWriter) - }) - - it('records browser annotation agent handoff only from the prompt-delivered callback', () => { - const source = componentSource('browser-pane/annotate/use-browser-page-annotation-send.ts') - expect( - source.match(/recordFeatureInteraction\('browser-annotations-sent-to-agent'\)/g) - ).toHaveLength(1) - expect( - sourceBetween( - source, - 'const handleBrowserAnnotationsSentToAgent', - 'const handleClearBrowserAnnotations' - ) - ).toContain("recordFeatureInteraction('browser-annotations-sent-to-agent')") - expect( - sourceBetween( - source, - 'const handleCopyBrowserAnnotations', - 'const handleBrowserAnnotationsSentToAgent' - ) - ).not.toContain("recordFeatureInteraction('browser-annotations-sent-to-agent')") - expect( - sourceBetween( - source, - 'const handleClearBrowserAnnotations', - 'const handleDeleteBrowserAnnotation' - ) - ).not.toContain("recordFeatureInteraction('browser-annotations-sent-to-agent')") - }) - - it('records floating workspace hide only from explicit disable or hide actions', () => { - const allowedSources = [ - componentSource('settings/FloatingWorkspacePane.tsx'), - componentSource('floating-terminal/FloatingTerminalIconContextMenu.tsx') - ].join('\n') - const passiveSources = [ - componentSource('../App.tsx'), - componentSource('floating-terminal/FloatingTerminalPanel.tsx') - ].join('\n') - - expect( - allowedSources.match(/recordFeatureInteraction\('floating-workspace-hidden'\)/g) ?? [] - ).toHaveLength(2) - expect(passiveSources).not.toContain("recordFeatureInteraction('floating-workspace-hidden')") - }) -}) diff --git a/src/renderer/src/components/github-item-dialog-source-boundary.test.ts b/src/renderer/src/components/github-item-dialog-source-boundary.test.ts deleted file mode 100644 index 630ae68a7a07..000000000000 --- a/src/renderer/src/components/github-item-dialog-source-boundary.test.ts +++ /dev/null @@ -1,310 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const COMPONENT_ROOT = __dirname - -function componentSource(relativePath: string): string { - // Why: CRLF checkouts would otherwise break every multi-line source assertion. - return readFileSync(join(COMPONENT_ROOT, relativePath), 'utf8').replace(/\r\n?/g, '\n') -} - -function destSources(...relativePaths: string[]): string { - return relativePaths.map((relativePath) => componentSource(relativePath)).join('\n') -} - -function sourceBetween(source: string, startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('GitHubItemDialog source host boundaries', () => { - it('does not keep the stale right-side sheet owner', () => { - const source = destSources( - 'GitHubItemDialog.tsx', - 'github-item-dialog/open-dialog/github-item-dialog.tsx' - ) - - expect(source).not.toContain('@/components/ui/sheet') - expect(source).not.toContain(' { - const source = destSources( - 'github-item-dialog/land-pull-request/pr-reviewers-panel.tsx', - 'github-item-dialog/land-pull-request/pr-reviewers-request-actions.ts' - ) - const section = source - - expect(section).toContain('getTaskSourceRuntimeSettings(sourceContext)') - expect(section).toContain('useRepoAssigneesBySlug(') - expect(section).toContain('sourceSettings') - expect(section).toContain('useRepoAssignees(') - expect(section).toContain('sourceSettings') - expect(section).toContain('getActiveRuntimeTarget(sourceSettings)') - expect(section).toContain( - 'const runtimeRepo = getGitHubRuntimeRepoId(sourceContext, item.repoId)' - ) - expect(section).toContain("'github.requestPRReviewers'") - expect(section).toContain("'github.removePRReviewers'") - expect(section).toContain('resolvePullRequestRepo(item, projectOrigin)') - expect(section.match(/prRepo: reviewRepo/g)).toHaveLength(4) - expect(section).toContain('notifyWorkItemDetailsMutation(') - expect(section).toContain('{ local: false }') - }) - - it('routes edit metadata through the same task source as issue mutations', () => { - const source = destSources( - 'github-item-dialog/edit-item-fields/gh-edit-section.tsx', - 'github-item-dialog/edit-item-fields/gh-edit-section-mutations.ts' - ) - const section = source - const helperSection = componentSource('github/github-work-item-edit-mutations.ts') - - expect(section).toContain('getTaskSourceRuntimeSettings(sourceContext)') - expect(section).toContain('useRepoLabels(') - expect(section).toContain('useRepoLabelsBySlug(') - expect(section).toContain('projectOrigin?.host') - expect(section).toContain('useRepoAssignees(') - expect(section).toContain('useRepoAssigneesBySlug(') - expect(section).toContain('sourceSettings') - expect(helperSection).toContain("'github.updateIssue'") - expect(helperSection).toContain("'github.updatePRState'") - expect(helperSection).toContain("'github.project.updateIssueBySlug'") - expect(helperSection).toContain("'github.project.updatePullRequestBySlug'") - expect(helperSection).toContain("args.sourceContext?.provider === 'github'") - expect(helperSection).toContain('getTaskSourceRuntimeSettings(args.sourceContext)') - expect(helperSection).toContain( - 'getGitHubMutationRoutingSettings(useAppStore.getState(), args.repoId, args.sourceContext)' - ) - expect(helperSection).toContain('notifyWorkItemDetailsMutation(') - expect(helperSection).toContain( - "repo: getGitHubRuntimeRepoId(args.sourceContext, args.repoId ?? '')" - ) - expect(helperSection).toContain('{ local: false }') - }) - - it('uses source-aware details routing and cache identity', () => { - const source = destSources( - 'github-item-dialog/load-item-details/work-item-details-cache.ts', - 'github-item-dialog/load-item-details/use-github-item-dialog-details.ts' - ) - const cacheKeySection = sourceBetween( - source, - 'function getWorkItemDetailsCacheKey', - 'function touchWorkItemDetailsCache' - ) - const matchInvalidationSection = sourceBetween( - source, - 'function invalidateWorkItemDetailsCacheByMatch', - 'function patchCachedPRFileViewedState' - ) - - expect(source).toContain('lookupGitHubWorkItemDetailsForSource({') - expect(source).toContain('sourceContext,') - expect(cacheKeySection).toContain('sourceCacheScope') - expect(source).toContain('getTaskSourceCacheScope(sourceContext)') - expect(matchInvalidationSection).toContain( - 'if (removed) {\n workItemDetailsCacheGeneration += 1' - ) - }) - - it('treats null details as unavailable while preserving empty detail payloads', () => { - const source = destSources( - 'github-item-dialog/load-item-details/use-github-item-dialog-details.ts', - 'github-item-dialog/load-item-details/work-item-details-fetch-settle.ts' - ) - const loadedSection = sourceBetween( - source, - 'const loading = !!cachedEntry?.pending && !cachedEntry?.details', - '// Why: if a cross-window mutation invalidates' - ) - const resultSection = sourceBetween(source, 'inflight', '.catch((err) => {') - - expect(loadedSection).toContain('const detailsLoaded = Boolean(cachedEntry?.details)') - expect(loadedSection).not.toContain('fetchedAt > 0') - expect(resultSection).toContain('} else if (result === null) {') - expect(resultSection).toContain('error: WORK_ITEM_DETAILS_UNAVAILABLE_MESSAGE') - expect(resultSection).toContain('details: result') - }) - - it('routes PR file viewed mutations through the task source context', () => { - const changeSection = destSources( - 'github-item-dialog/load-item-details/use-github-item-dialog-details.ts', - 'github-item-dialog/load-item-details/pr-file-viewed-change.ts' - ) - const helperSection = componentSource('github/github-work-item-comment-mutations.ts') - - expect(helperSection).toContain('getGitHubSourceRuntimeHost(args.sourceContext)') - expect(helperSection).toContain("'github.setPRFileViewed'") - expect(helperSection).toContain('repo: getGitHubRuntimeRepoId(args.sourceContext, args.repoId)') - expect(helperSection).toContain('sourceContext: args.sourceContext') - expect(helperSection).toContain('{ local: false }') - expect(changeSection).toContain('canUseDetailsRepoContext') - expect(changeSection).toContain('repoPath: repoPath ??') - expect(changeSection).toContain('sourceContext,') - }) - - it('routes comment mutations through runtime source context when needed', () => { - const helperSource = componentSource('github/github-work-item-comment-mutations.ts') - const helperSection = sourceBetween( - helperSource, - 'function addIssueCommentForRepo', - 'function setPRFileViewedForRepo' - ) - - expect(helperSection).toContain('getGitHubSourceRuntimeHost(args.sourceContext)') - expect(helperSection).toContain("'github.addIssueComment'") - expect(helperSection).toContain("'github.addPRReviewComment'") - expect(helperSection).toContain("'github.addPRReviewCommentReply'") - expect(helperSection).toContain('repo: getGitHubRuntimeRepoId(args.sourceContext, args.repoId)') - expect(helperSection).toContain('sourceContext: args.sourceContext') - expect(helperSection).toContain('notifyWorkItemDetailsMutation(') - expect(helperSection).toContain('{ local: false }') - }) - - it('routes PR file contents and runtime viewed invalidations through the task source context', () => { - const source = destSources( - 'github-item-dialog/load-item-details/work-item-details-cache.ts', - 'github-item-dialog/load-item-details/pr-file-content-cache.ts' - ) - const commentMutations = componentSource('github/github-work-item-comment-mutations.ts') - const fileContentsSection = sourceBetween( - source, - 'function loadPRFileContents', - 'touchPRFileContentCache(cacheKey, request)' - ) - const fileContentsCacheKeySection = sourceBetween( - source, - 'function getPRFileContentCacheKey', - 'function loadPRFileContents' - ) - const listenerSection = sourceBetween(source, 'let workItemMutatedUnsub', '// Why: bounded LRU') - - expect(fileContentsCacheKeySection).toContain( - 'source:${getTaskSourceCacheScope(args.sourceContext)}' - ) - expect(fileContentsSection).toContain("'github.prFileContents'") - expect(fileContentsSection).toContain( - 'repo: getGitHubRuntimeRepoId(args.sourceContext, args.repoId)' - ) - expect(fileContentsSection).toContain('sourceContext: args.sourceContext') - expect(fileContentsSection).toContain('sourceContext,') - expect(listenerSection).toContain('onGitHubWorkItemDetailsCacheMutation') - expect(commentMutations).toContain('emitGitHubWorkItemDetailsCacheMutation(args)') - expect(commentMutations).toContain('options.local !== false') - expect(commentMutations).toContain('notifyWorkItemMutated({') - }) - - it('routes merge actions through the repo owner host (#6957)', () => { - const actionsSection = componentSource( - 'github-item-dialog/land-pull-request/pr-actions-panel.tsx' - ) - - expect(actionsSection).toContain( - 'getGitHubMutationRoutingSettings(s, item.repoId ?? repoId ?? null, sourceContext)' - ) - expect(actionsSection).toContain('getActiveRuntimeTarget(sourceSettings)') - expect(actionsSection).toContain( - 'const canMergeWithRepoContext = !!repoPath || mergeTarget.kind ===' - ) - expect(actionsSection).toContain("'github.mergePR'") - expect(actionsSection).toContain("'github.setPRAutoMerge'") - expect(actionsSection).toContain('const prRepo = resolvePullRequestRepo(item, projectOrigin)') - expect(actionsSection).not.toContain('prRepo: item.prRepo ?? null') - expect(actionsSection).toContain( - 'repo: getGitHubRuntimeRepoId(sourceContext, repoId ?? item.repoId)' - ) - expect(actionsSection).toContain('sourceContext,') - expect(actionsSection).toContain('notifyWorkItemDetailsMutation(') - expect(actionsSection).toContain('{ local: false }') - }) - - it('routes check actions through the task source context', () => { - const checksSection = destSources( - 'github-item-dialog/inspect-pull-request/checks-tab.tsx', - 'github-item-dialog/inspect-pull-request/checks-tab-actions.ts', - 'github-item-dialog/inspect-pull-request/checks-tab-request-details.ts' - ) - - expect(checksSection).toContain('sourceContext?: TaskSourceContext | null') - expect(checksSection).toContain('sourceContext,') - expect(checksSection).toContain("'github.prChecks'") - expect(checksSection).toContain("'github.rerunPRChecks'") - expect(checksSection).toContain("'github.prCheckDetails'") - expect(checksSection).toContain( - 'repo: getGitHubRuntimeRepoId(ctx.sourceContext, ctx.repoId ?? ctx.itemRepoId)' - ) - expect(checksSection).toContain('window.api.gh.prChecks({') - expect(checksSection).toContain('window.api.gh.rerunPRChecks({') - expect(checksSection).toContain('prCheckDetails({') - expect(checksSection).toMatch( - /withGitHubCheckDetailsTimeout\(\(signal\) =>\s*ctx\.runtimeHost\s*\?\s*callRuntimeRpc[\s\S]*:\s*window\.api\.gh\.prCheckDetails\(\{/ - ) - expect(checksSection).toContain('{ timeoutMs: 30_000, signal }') - }) - - it('makes failed check detail loads retryable and fences stale responses', () => { - const checksSection = destSources( - 'github-item-dialog/inspect-pull-request/checks-tab.tsx', - 'github-item-dialog/inspect-pull-request/checks-tab-actions.ts', - 'github-item-dialog/inspect-pull-request/checks-tab-request-details.ts', - 'github-item-dialog/inspect-pull-request/checks-tab-check-details.tsx' - ) - - expect(checksSection).toContain('createGitHubChecksTabState(checks, checkDetailsContextKey)') - expect(checksSection).toContain('checksState,\n checks,\n checkDetailsContextKey') - expect(checksSection).toContain('resetGitHubChecksTabForSource(current)') - expect(checksSection).toContain( - 'committedChecksContextOwnerRef.current !== refreshContextOwner' - ) - expect(checksSection).toContain('activeChecksRefreshRequestIdRef.current !== refreshRequestId') - expect(checksSection).toContain('current.contextOwner === refreshContextOwner') - expect(checksSection).toContain( - 'const rerunContextOwner = ctx.committedChecksContextOwnerRef.current' - ) - expect(checksSection).toContain( - 'ctx.committedChecksContextOwnerRef.current !== rerunContextOwner' - ) - expect(checksSection).toContain('await refreshGitHubChecksTab(ctx, rerunContextOwner)') - expect(checksSection).toContain('!ctx.mountedRef.current ||') - expect(checksSection).toContain('settleGitHubChecksTabDetails(current, key, requestId, next)') - expect(checksSection).toContain('onClick={() => onRetry(check, getCheckDetailsKey(check))}') - expect(checksSection).toContain('disabled={state.loading}') - expect(checksSection).toContain('aria-busy={state.loading}') - expect(checksSection).toContain("translate('githubChecks.retrying', 'Retrying…')") - expect(checksSection).toContain("'Retry'") - }) - - it('uses hydrated work item details for the page checks tab', () => { - const source = componentSource('github-item-dialog/open-dialog/github-item-dialog-pr-tabs.tsx') - const checksTab = sourceBetween( - source, - ' { - const editSection = destSources( - 'github-item-dialog/edit-item-fields/gh-edit-section.tsx', - 'github-item-dialog/edit-item-fields/gh-edit-section-mutations.ts' - ) - expect(editSection).toContain('assertTaskPageGitHubDialogStateAuthority({') - expect(editSection).toContain('if (authority?.revert())') - - const actionsSection = componentSource( - 'github-item-dialog/land-pull-request/pr-actions-panel.tsx' - ) - expect(actionsSection.match(/assertTaskPageGitHubDialogStateAuthority\(\{/g)).toHaveLength(2) - expect(actionsSection).toContain('if (authority.revert())') - expect(actionsSection).toContain("state: 'merged'") - }) -}) diff --git a/src/renderer/src/components/github/repro-8784-ghe-avatar-fallback.test.ts b/src/renderer/src/components/github/repro-8784-ghe-avatar-fallback.test.ts index 8b33b3dc40c8..ddf7fb92cfff 100644 --- a/src/renderer/src/components/github/repro-8784-ghe-avatar-fallback.test.ts +++ b/src/renderer/src/components/github/repro-8784-ghe-avatar-fallback.test.ts @@ -4,15 +4,12 @@ * Regression guard (was a repro that documented the broken path). After the fix: * - resolveGitHubUserAvatarSrc prefers API URLs * - PullRequestPage author uses authorAvatarUrl via GitHubUserAvatar - * - TaskPage ReviewChipAvatar no longer hardcodes github.com login.png * * Re-run: * pnpm exec vitest run --config config/vitest.config.ts \ * src/renderer/src/components/github/repro-8784-ghe-avatar-fallback.test.ts */ import { describe, expect, it } from 'vitest' -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { githubAvatarUrl, resolveGitHubUserAvatarSrc } from './github-user-avatar' describe('issue #8784 GHE avatar fallback (regression)', () => { @@ -38,86 +35,4 @@ describe('issue #8784 GHE avatar fallback (regression)', () => { // enrichment + image onError → initials when this 404s. expect(githubAvatarUrl('corp-user')).toBe('https://github.com/corp-user.png?size=64') }) - - it('source routes PR author/reviewer avatars through GitHubUserAvatar + authorAvatarUrl', () => { - const prPage = readFileSync(join(__dirname, '../pull-request-page/page/header.tsx'), 'utf8') - expect(prPage).toMatch(/GitHubUserAvatar/) - expect(prPage).toMatch(/authorAvatarUrl/) - // Why: author chip must not ignore API avatar_url and only pass login. - expect(prPage).not.toMatch(/githubAvatarUrl\(workItem\.author\)/) - - const reviewChip = readFileSync(join(__dirname, '../task-page/github/Avatars.tsx'), 'utf8') - expect(reviewChip).toMatch(/GitHubUserAvatar/) - // Why: list chip must not hardcode github.com/{login}.png. - expect(reviewChip).not.toMatch(/github\.com\/\$\{reviewer\.login\}\.png/) - }) - - // GHES URLs can exist but fail unauthenticated; target slots need onError fallbacks. - // Scope checks because TaskPage also renders non-GitHub provider avatars. - const GITHUB_AVATAR_SLOTS = [ - { - file: 'pull-request-page/reviewers/picker-row.tsx', - fn: 'ReviewerPickerRow', - login: 'reviewer.login', - displayName: 'reviewer.name' - }, - { - file: 'pull-request-page/conversation/comment-card.tsx', - fn: 'ConversationCommentCard', - login: 'comment.author', - displayName: null - }, - { - file: 'pull-request-page/mentions/textarea.tsx', - fn: 'MentionTextarea', - login: 'option.login', - displayName: 'option.name' - }, - { - file: 'task-page/github/Avatars.tsx', - fn: 'GitHubAssigneeAvatar', - login: 'assignee.login', - displayName: 'assignee.name' - }, - { - file: 'task-page/github/AssigneesCell.tsx', - fn: 'GHAssigneesCell', - login: 'user.login', - displayName: 'user.name' - }, - { - file: 'task-page/github/ReviewerPicker.tsx', - fn: 'TaskPageGitHubReviewerPicker', - login: 'reviewer.login', - displayName: 'reviewer.name' - } - ] as const - - function componentBody(file: string, fn: string): string { - const source = readFileSync(join(__dirname, '..', file), 'utf8') - const start = source.indexOf(`function ${fn}`) - expect(start, `${file}: function ${fn} not found`).toBeGreaterThanOrEqual(0) - const next = source.indexOf('\nfunction ', start + 1) - return source.slice(start, next === -1 ? undefined : next) - } - - it.each(GITHUB_AVATAR_SLOTS)( - 'renders the $fn avatar through GitHubUserAvatar (#13976)', - ({ file, fn, login }) => { - const body = componentBody(file, fn) - - // Reject aliases and resolver expressions as well as direct avatarUrl fields. - expect(body, `${fn} still renders a bare img`).not.toMatch(/]/) - expect(body, `${fn} does not use GitHubUserAvatar`).toContain(' slot.displayName !== null))( - 'passes the $fn display name so initials are not reduced to one letter (#13976)', - ({ file, fn, displayName }) => { - expect(componentBody(file, fn)).toContain(`name={${displayName}}`) - } - ) }) diff --git a/src/renderer/src/components/linear-issue-workspace-api-parity.test.ts b/src/renderer/src/components/linear-issue-workspace-api-parity.test.ts deleted file mode 100644 index 91310627cf71..000000000000 --- a/src/renderer/src/components/linear-issue-workspace-api-parity.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -function componentSource(file: string): string { - return readFileSync(join(__dirname, file), 'utf8') -} - -describe('Linear issue workspace provider API parity', () => { - it('keeps detail and comments on the selected source and workspace', () => { - const source = componentSource('linear-issue-workspace-detail-state.ts') - expect(source).toContain('initialRequest.providerSettings,') - expect(source).toContain('initialRequest.issue.id,') - expect(source).toContain('initialRequest.issue.workspaceId') - expect(source).toContain('targetProviderSettings,') - expect(source).toContain('targetIssue.id,') - expect(source).toContain('targetIssue.workspaceId') - }) - - it('keeps project search and assignment source-scoped', () => { - const source = componentSource('linear-issue-project-selector.tsx') - expect(source).toContain( - 'linearListProjects(providerSettings, requestQuery, 20, issue.workspaceId)' - ) - expect(source).toMatch( - /linearUpdateIssue\(\s*providerSettings,\s*issue\.id,\s*\{ projectId: project\.id \},\s*issue\.workspaceId/ - ) - expect(source).toContain('patchLinearIssue(issue.id, { project }, { sourceContext })') - }) - - it('keeps sub-issue create and open payloads source-scoped', () => { - const source = componentSource('linear-issue-sub-issues.tsx') - expect(source).toContain('parentIssueId: issue.id') - expect(source).toContain('teamId: issue.team.id') - expect(source).toContain('workspaceId: issue.workspaceId') - expect(source).toContain('projectId: issue.project?.id ?? null') - expect(source).toMatch( - /fetchLinearIssue\(subIssue\.id, issue\.workspaceId, \{\s*sourceContext\s*\}\)/ - ) - }) - - it('keeps git and folder workspace attachments in the same lookup', () => { - const source = componentSource('LinearIssueWorkspace.tsx') - expect(source).toContain('...allWorktrees') - expect(source).toContain('...folderWorkspaces.map(folderWorkspaceToWorktree)') - expect(source).toContain('findLinearIssueWorkspaceAttachment(attachmentWorkspaces') - expect(source).toContain('openLinearIssueWorkspaceOrStart(detail.displayed') - }) -}) diff --git a/src/renderer/src/components/linear-issue-workspace-header.test.ts b/src/renderer/src/components/linear-issue-workspace-header.test.ts deleted file mode 100644 index 4fd36b23bf45..000000000000 --- a/src/renderer/src/components/linear-issue-workspace-header.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const source = readFileSync(join(__dirname, 'linear-issue-workspace-header.tsx'), 'utf8') - -function headerSource(): string { - const start = source.indexOf('
    ') - expect(header).toContain('') - expect(header).toContain("'Start workspace'") - expect(header).toContain("'Start workspace from issue'") - expect(header).not.toContain("'Copy issue identifier'") - expect(header).toMatch(/size="sm"[\s\S]*onClick=\{onOpenOrUseIssue\}/) - expect(header).not.toMatch(/size="icon-sm"\s+onClick=\{onOpenOrUseIssue\}/) - }) -}) diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.transport-probe.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.transport-probe.test.tsx deleted file mode 100644 index ffa8787e7536..000000000000 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.transport-probe.test.tsx +++ /dev/null @@ -1,377 +0,0 @@ -// @vitest-environment happy-dom - -import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react' -import React from 'react' -import { afterEach, describe, expect, it, vi } from 'vitest' - -const { mocks, moduleFactories, resetStructuredSessionMocks } = await vi.hoisted(async () => - (await import('./NativeChatStructuredSession.test-harness')).createStructuredSessionMocks() -) - -vi.mock('@/runtime/structured-agent-session-client', () => - moduleFactories.structuredAgentSessionClient() -) -vi.mock('./use-structured-agent-session', () => moduleFactories.useStructuredAgentSession()) -vi.mock('./use-native-chat-font-scale', () => moduleFactories.useNativeChatFontScale()) -vi.mock('./use-native-chat-file-link-context', () => moduleFactories.useNativeChatFileLinkContext()) -vi.mock('./use-native-chat-file-link-click', () => moduleFactories.useNativeChatFileLinkClick()) -vi.mock('./NativeChatMessageList', () => moduleFactories.nativeChatMessageList()) -vi.mock('./NativeChatComposer', () => moduleFactories.nativeChatComposer()) -vi.mock('./NativeChatEmptyState', () => moduleFactories.nativeChatEmptyState()) -vi.mock('./NativeChatApprovalCard', () => moduleFactories.nativeChatApprovalCard()) -vi.mock('./NativeChatQuestionCard', () => moduleFactories.nativeChatQuestionCard()) - -import { NativeChatStructuredSession } from './NativeChatStructuredSession' - -describe('NativeChatStructuredSession transport-unconfirmed sends', () => { - afterEach(() => { - cleanup() - resetStructuredSessionMocks() - }) - - it('retries an unconfirmed transport send and clears the delivery notice', async () => { - mocks.mode = 'outbox' - mocks.call.mockRejectedValueOnce(new Error('socket closed')).mockResolvedValueOnce({ - ok: true, - value: { - submission: { - clientMessageId: 'client-1', - dispatchState: 'accepted' - } - } - }) - - render( - - ) - - const send = mocks.composerProps?.structuredTransport?.send as - | ((text: string, attachments: readonly { id: string; path: string }[]) => boolean) - | undefined - expect(send?.('hello', [])).toBe(true) - await waitFor(() => expect(mocks.call).toHaveBeenCalledOnce()) - await waitFor(() => expect(screen.getByText('Message delivery is unconfirmed.')).toBeTruthy()) - - fireEvent.click(screen.getByRole('button', { name: /Retry/ })) - - await waitFor(() => expect(mocks.call).toHaveBeenCalledTimes(2)) - await waitFor(() => expect(screen.queryByText('Message delivery is unconfirmed.')).toBeNull()) - }) - - it('resends a transport-unconfirmed head so later messages are not wedged', async () => { - mocks.mode = 'outbox' - mocks.submissions = [] - mocks.call.mockRejectedValueOnce(new Error('socket closed')).mockResolvedValue({ - ok: true, - value: { submission: { clientMessageId: 'client-1', dispatchState: 'accepted' } } - }) - - render( - - ) - - const send = mocks.composerProps?.structuredTransport?.send as - | ((text: string, attachments: readonly { id: string; path: string }[]) => boolean) - | undefined - expect(send?.('first', [])).toBe(true) - await waitFor(() => expect(mocks.call).toHaveBeenCalledOnce()) - await waitFor(() => expect(screen.getByText('Message delivery is unconfirmed.')).toBeTruthy()) - - expect(send?.('second', [])).toBe(true) - // The head is probed automatically, clears, and the queue drains. - await waitFor(() => expect(mocks.call).toHaveBeenCalledTimes(3), { timeout: 10000 }) - await waitFor(() => expect(screen.queryByText('Message delivery is unconfirmed.')).toBeNull()) - }, 20000) - - it('probes the same operation without marking an explicit user retry', async () => { - mocks.mode = 'outbox' - mocks.submissions = [] - mocks.call.mockRejectedValueOnce(new Error('socket closed')).mockResolvedValue({ - ok: true, - value: { submission: { clientMessageId: 'client-1', dispatchState: 'accepted' } } - }) - - render( - - ) - - const send = mocks.composerProps?.structuredTransport?.send as - | ((text: string, attachments: readonly { id: string; path: string }[]) => boolean) - | undefined - expect(send?.('first', [])).toBe(true) - await waitFor(() => expect(mocks.call).toHaveBeenCalledTimes(2), { timeout: 10000 }) - - const first = mocks.call.mock.calls[0]?.[2] as Record - const probe = mocks.call.mock.calls[1]?.[2] as Record - expect(probe.retryUnknown).toBeUndefined() - // Same operation id: both dedupe layers key off it. - expect((probe.envelope as { clientOperationId: string }).clientOperationId).toBe( - (first.envelope as { clientOperationId: string }).clientOperationId - ) - }, 20000) - - it('parks a host-confirmed unknown instead of probing it', async () => { - mocks.mode = 'outbox' - mocks.call.mockRejectedValueOnce(new Error('socket closed')).mockResolvedValue({ - ok: true, - value: { submission: { clientMessageId: 'client-1', dispatchState: 'accepted' } } - }) - - render( - - ) - - const send = mocks.composerProps?.structuredTransport?.send as - | ((text: string, attachments: readonly { id: string; path: string }[]) => boolean) - | undefined - expect(send?.('first', [])).toBe(true) - await waitFor(() => expect(mocks.call).toHaveBeenCalledOnce()) - - const sent = mocks.call.mock.calls[0]?.[2] as { envelope: { clientOperationId: string } } - // The host now reports an unresolved unknown: another replay is the user's call. - mocks.submissions = [ - { - clientMessageId: sent.envelope.clientOperationId, - fence: 1, - payloadFingerprint: 'fp', - dispatchState: 'unknown', - providerItemId: null, - reason: null, - submittedAt: 1, - resolvedAt: null - } - ] - // Queue a second message purely to re-render so the effect observes the - // new submissions; it must stay wedged behind the parked head. - await act(async () => { - send?.('second', []) - }) - await act(async () => { - await new Promise((resolve) => setTimeout(resolve, 3000)) - }) - expect(mocks.call).toHaveBeenCalledOnce() - }, 20000) - - it('still probes while streaming batches rebuild the submissions array', async () => { - mocks.mode = 'outbox' - mocks.submissions = [] - mocks.call.mockRejectedValueOnce(new Error('socket closed')).mockResolvedValue({ - ok: true, - value: { submission: { clientMessageId: 'client-1', dispatchState: 'accepted' } } - }) - - const makeView = (): React.ReactElement => ( - - ) - const { rerender } = render(makeView()) - - const send = mocks.composerProps?.structuredTransport?.send as - | ((text: string, attachments: readonly { id: string; path: string }[]) => boolean) - | undefined - expect(send?.('first', [])).toBe(true) - await waitFor(() => expect(mocks.call).toHaveBeenCalledOnce()) - - // Each batch mints a fresh submissions array for an unrelated message. An - // array-identity dependency restarts the backoff on every one of these, so a - // stream that outlasts the delay would never let the probe fire. - for (let index = 0; index < 12; index += 1) { - mocks.submissions = [ - { - clientMessageId: `other-${index}`, - fence: 1, - payloadFingerprint: 'fp', - dispatchState: 'accepted', - providerItemId: null, - reason: null, - submittedAt: index, - resolvedAt: index - } - ] - await act(async () => { - rerender(makeView()) - await new Promise((resolve) => setTimeout(resolve, 250)) - }) - } - - // Asserted with no trailing grace period: the probe must have fired *during* - // the stream, not after it went quiet. - expect(mocks.call).toHaveBeenCalledTimes(2) - }, 20000) - - it('restarts probe delay when the runtime target changes', async () => { - mocks.mode = 'outbox' - mocks.call.mockRejectedValueOnce(new Error('socket closed')).mockResolvedValue({ - ok: true, - value: { submission: { clientMessageId: 'client-1', dispatchState: 'accepted' } } - }) - - const makeView = ( - target: { kind: 'local' } | { kind: 'environment'; environmentId: string } - ) => ( - - ) - const { rerender } = render(makeView({ kind: 'local' })) - const send = mocks.composerProps?.structuredTransport?.send as - | ((text: string, attachments: readonly { id: string; path: string }[]) => boolean) - | undefined - expect(send?.('first', [])).toBe(true) - await waitFor(() => expect(mocks.call).toHaveBeenCalledOnce()) - await waitFor(() => expect(screen.getByText('Message delivery is unconfirmed.')).toBeTruthy()) - - await act(async () => { - await new Promise((resolve) => setTimeout(resolve, 300)) - }) - rerender(makeView({ kind: 'environment', environmentId: 'env-1' })) - await act(async () => { - await new Promise((resolve) => setTimeout(resolve, 600)) - }) - expect(mocks.call).toHaveBeenCalledOnce() - await waitFor(() => expect(mocks.call).toHaveBeenCalledTimes(2), { timeout: 1500 }) - }, 10000) - - it('never auto-probes an entry the user already force-retried', async () => { - mocks.mode = 'outbox' - mocks.submissions = [] - // Both the original send and the user's explicit Retry fail at the transport. - mocks.call.mockRejectedValue(new Error('socket closed')) - - render( - - ) - - const send = mocks.composerProps?.structuredTransport?.send as - | ((text: string, attachments: readonly { id: string; path: string }[]) => boolean) - | undefined - expect(send?.('first', [])).toBe(true) - await waitFor(() => expect(mocks.call).toHaveBeenCalledOnce()) - await waitFor(() => expect(screen.getByText('Message delivery is unconfirmed.')).toBeTruthy()) - - // User retries with the same envelope and no legacy redelivery signal. - fireEvent.click(screen.getByRole('button', { name: /Retry/ })) - await waitFor(() => expect(mocks.call).toHaveBeenCalledTimes(2)) - const forcedRequest = mocks.call.mock.calls[1]?.[2] as Record | undefined - expect(forcedRequest?.retryUnknown).toBeUndefined() - - // That retry also failed at the transport. The probe must not repeat an - // explicit retry automatically. - await act(async () => { - await new Promise((resolve) => setTimeout(resolve, 3000)) - }) - expect(mocks.call).toHaveBeenCalledTimes(2) - }, 20000) - - it('does not hot-loop when the host answers pending', async () => { - mocks.mode = 'outbox' - mocks.call.mockResolvedValue({ - ok: true, - value: { submission: { clientMessageId: 'client-1', dispatchState: 'pending' } } - }) - - render( - - ) - - const send = mocks.composerProps?.structuredTransport?.send as - | ((text: string, attachments: readonly { id: string; path: string }[]) => boolean) - | undefined - expect(send?.('first', [])).toBe(true) - await waitFor(() => expect(mocks.call).toHaveBeenCalledOnce()) - - // A pending row parks the entry under the backoff instead of re-dispatching - // immediately. Without that, this window is an unbounded back-to-back RPC flood. - await act(async () => { - await new Promise((resolve) => setTimeout(resolve, 2500)) - }) - expect(mocks.call.mock.calls.length).toBeLessThanOrEqual(3) - }, 20000) - - it('keeps probing past the old five-attempt budget', async () => { - mocks.mode = 'outbox' - mocks.call.mockRejectedValue(new Error('socket closed')) - vi.useFakeTimers({ shouldAdvanceTime: true }) - try { - render( - - ) - - const send = mocks.composerProps?.structuredTransport?.send as - | ((text: string, attachments: readonly { id: string; path: string }[]) => boolean) - | undefined - expect(send?.('first', [])).toBe(true) - - // Backoff is 1+2+4+8+16 = 31s for five probes, which was the old hard budget. - // Step past it; a seventh call proves the probe re-arms instead of giving up. - for (let step = 0; step < 12; step += 1) { - await act(async () => { - await vi.advanceTimersByTimeAsync(8_000) - }) - } - expect(mocks.call.mock.calls.length).toBeGreaterThanOrEqual(7) - } finally { - vi.useRealTimers() - } - }, 30000) -}) diff --git a/src/renderer/src/components/native-chat/native-chat-composer-containment.test.ts b/src/renderer/src/components/native-chat/native-chat-composer-containment.test.ts deleted file mode 100644 index 2c8a08ffa893..000000000000 --- a/src/renderer/src/components/native-chat/native-chat-composer-containment.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import fs from 'node:fs' -import { describe, expect, it } from 'vitest' - -const composerField = fs.readFileSync( - new URL('./NativeChatComposerField.tsx', import.meta.url), - 'utf8' -) -const autocompleteMenus = fs.readFileSync( - new URL('./NativeChatAutocompleteMenus.tsx', import.meta.url), - 'utf8' -) - -describe('native chat composer paint containment (#10481)', () => { - it('bounds caret repaints to the composer input shell', () => { - expect(composerField).toContain('[contain:paint]') - }) - - it('keeps the outer composer uncontained so the pickers can overflow it', () => { - // The pickers are siblings that render above the shell via `bottom-full`; - // containing their parent would clip them. - const outerShell = composerField.slice(0, composerField.indexOf('[contain:paint]')) - expect(outerShell).toContain('
    ') - expect(outerShell).not.toContain('contain:paint') - }) - - it('lifts both pickers above the contained shell', () => { - // The shell is a stacking context now, so it paints at z-index 0 in tree - // order — an unlayered picker would lose its drop shadow to it. - for (const picker of ['bottom-full left-0 right-0 z-20', 'bottom-full left-3 right-3 z-20']) { - expect(autocompleteMenus).toContain(picker) - } - }) -}) diff --git a/src/renderer/src/components/native-chat/native-chat-noise.test.ts b/src/renderer/src/components/native-chat/native-chat-noise.test.ts deleted file mode 100644 index a9942ed82d78..000000000000 --- a/src/renderer/src/components/native-chat/native-chat-noise.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { describe, expect, it } from 'vitest' -import type { NativeChatMessage } from '../../../../shared/native-chat-types' -import { isNoiseMessage, stripNoiseMessages } from './native-chat-noise' - -function msg( - role: NativeChatMessage['role'], - text: string, - blocks?: NativeChatMessage['blocks'] -): NativeChatMessage { - return { - id: text.slice(0, 8), - role, - blocks: blocks ?? [{ type: 'text', text }], - timestamp: 0, - source: 'transcript' - } -} - -describe('isNoiseMessage', () => { - it('flags task-notification and system-reminder user turns', () => { - expect(isNoiseMessage(msg('user', '\nx'))).toBe(true) - expect(isNoiseMessage(msg('user', '\nbe careful'))).toBe(true) - expect( - isNoiseMessage( - msg( - 'user', - 'Caveat: The messages below were generated by the user while running local commands' - ) - ) - ).toBe(true) - expect(isNoiseMessage(msg('user', '[Request interrupted by user]'))).toBe(true) - }) - - it('keeps real user messages', () => { - expect(isNoiseMessage(msg('user', 'make it work for codex'))).toBe(false) - expect(isNoiseMessage(msg('user', 'pasted code'))).toBe(false) - }) - - it('keeps assistant and tool turns', () => { - expect(isNoiseMessage(msg('assistant', ' in prose'))).toBe(false) - expect(isNoiseMessage(msg('system', 'Conversation interrupted'))).toBe(false) - }) - - it('keeps a user turn that carries tool results', () => { - expect(isNoiseMessage(msg('user', '', [{ type: 'tool-result', output: 'ok' }]))).toBe(false) - }) - - it('stripNoiseMessages removes only the noise', () => { - const out = stripNoiseMessages([ - msg('user', 'hello'), - msg('user', 'done'), - msg('assistant', 'hi') - ]) - expect(out.map((m) => m.role)).toEqual(['user', 'assistant']) - }) -}) diff --git a/src/renderer/src/components/right-sidebar/SourceControl.host-context-boundary.test.ts b/src/renderer/src/components/right-sidebar/SourceControl.host-context-boundary.test.ts deleted file mode 100644 index 12539a08accd..000000000000 --- a/src/renderer/src/components/right-sidebar/SourceControl.host-context-boundary.test.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const WORKTREE_CONTEXT_SOURCE = readFileSync( - join(__dirname, 'source-control/listing/use-worktree-context.ts'), - 'utf8' -) -const PR_GENERATION_SOURCE = readFileSync( - join(__dirname, 'source-control/review/use-pull-request-generation.ts'), - 'utf8' -) -const CREATE_REVIEW_COMPOSER_SOURCE = readFileSync( - join(__dirname, 'source-control/review/use-create-review-composer.ts'), - 'utf8' -) -const STATUS_REFRESH_SOURCE = readFileSync( - join(__dirname, 'source-control/sync/use-status-refresh.ts'), - 'utf8' -) -const BASE_REF_DEFAULT_SOURCE = readFileSync( - join(__dirname, 'source-control/sync/use-base-ref-default.ts'), - 'utf8' -) - -function sourceBetween(source: string, startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('SourceControl host-context boundaries', () => { - it('snapshots PR generation host ownership and reuses it after async branch preparation', () => { - const generateSection = sourceBetween( - PR_GENERATION_SOURCE, - 'const handleGeneratePullRequestFieldsForActive = useCallback(', - 'const handleCancelGeneratePullRequestFieldsForActive = useCallback(' - ) - expect(generateSection).toContain('runtimeTargetSettings: activeRepoSettings') - expect(generateSection).toContain('settings: context.runtimeTargetSettings') - - const cancelSection = sourceBetween( - PR_GENERATION_SOURCE, - 'const handleCancelGeneratePullRequestFieldsForActive = useCallback(', - 'const handlePullRequestGenerationSeedRestored = useCallback(' - ) - expect(cancelSection).toContain('settings: record.context.runtimeTargetSettings') - - const refreshSection = sourceBetween( - STATUS_REFRESH_SOURCE, - 'const refreshGitStatusAfterPullRequestGeneration = useCallback(', - ' return {' - ) - expect(refreshSection).toContain('settings: context.runtimeTargetSettings') - expect(refreshSection).not.toContain('settings: activeRepoSettings') - }) - - it('routes create-review field generation through caller-provided owner settings', () => { - const composerCall = sourceBetween( - CREATE_REVIEW_COMPOSER_SOURCE, - '} = useCreatePullRequestDialogFields({', - 'const handleGeneratePullRequestFieldsClick = useCallback' - ) - expect(composerCall).toContain('settings: activeRepoSettings') - - const hookSource = readFileSync( - join(__dirname, 'use-create-pull-request-field-generation.ts'), - 'utf8' - ) - const requestContext = sourceBetween(hookSource, 'const requestContext = {', 'const seed = {') - expect(requestContext).toContain('settings,') - expect(requestContext).not.toContain('useAppStore.getState().settings') - }) - - it('keeps eligibility base refreshes scoped to repo execution ownership', () => { - const ownerSettingsSection = sourceBetween( - WORKTREE_CONTEXT_SOURCE, - 'const activeRepoSettings = useMemo(', - 'const activeRepoRuntimeEnvironmentId' - ) - expect(ownerSettingsSection).not.toContain('activeRepo ?? null') - expect(ownerSettingsSection).toContain( - '[activeRepoConnectionId, activeRepoExecutionHostId, activeRepoId, settings]' - ) - - const baseRefSection = sourceBetween( - BASE_REF_DEFAULT_SOURCE, - '// Why: reset to null so that effectiveBaseRef becomes falsy until the IPC', - ' return defaultBaseRef' - ) - expect(baseRefSection).toContain( - 'getRuntimeRepoBaseRefDefault(\n { activeRuntimeEnvironmentId: activeRepoRuntimeEnvironmentId },\n activeRepoId' - ) - const dependencyBlock = sourceBetween(baseRefSection, ' }, [', ' ])') - const dependencyEntries = dependencyBlock - .split('\n') - .slice(1) - .map((line) => line.trim().replace(/,$/, '')) - .filter((line) => line.length > 0 && !line.startsWith('//')) - expect(dependencyEntries).toEqual([ - 'activeRepoConnectionId', - 'activeRepoExecutionHostId', - 'activeRepoId', - 'activeRepoRuntimeEnvironmentId', - 'isBranchVisible', - 'isFolder' - ]) - }) -}) diff --git a/src/renderer/src/components/right-sidebar/ai-vault-session-refresh.test.ts b/src/renderer/src/components/right-sidebar/ai-vault-session-refresh.test.ts index 567e080360a7..db39129526ec 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault-session-refresh.test.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault-session-refresh.test.ts @@ -819,11 +819,4 @@ describe('useAiVaultSessionRefresh in a non-secure context', () => { }) }) }) - - // Guards the stub itself: an own-property stub of randomUUID is unrestorable, so a - // leaky teardown would silently strip the real method from every later test in the file. - it('leaves the real crypto.randomUUID in place afterwards', () => { - // oxlint-disable-next-line no-restricted-properties -- asserting the restore this case exists for - expect(typeof globalThis.crypto.randomUUID).toBe('function') - }) }) diff --git a/src/renderer/src/components/settings/GeneralPane.test.ts b/src/renderer/src/components/settings/GeneralPane.test.ts index 482fc1df787e..e8fd5ea998bf 100644 --- a/src/renderer/src/components/settings/GeneralPane.test.ts +++ b/src/renderer/src/components/settings/GeneralPane.test.ts @@ -4,7 +4,6 @@ import { getDesktopPlatformFromUserAgent, getGeneralPaneSearchEntries, getTabOrderControlSearchKeywords, - shouldCommitOpenInApplicationsDraft, shouldShowProjectRuntimeSection, updateAutoSaveDelayDraftState } from './GeneralPane' @@ -30,36 +29,6 @@ describe('GeneralPane auto-save delay drafts', () => { }) }) -describe('GeneralPane open-in application drafts', () => { - it('does not commit rows until both label and command are present', () => { - expect( - shouldCommitOpenInApplicationsDraft([{ id: 'draft', label: 'Cursor', command: '' }]) - ).toBe(false) - expect( - shouldCommitOpenInApplicationsDraft([{ id: 'draft', label: '', command: 'cursor' }]) - ).toBe(false) - expect( - shouldCommitOpenInApplicationsDraft([{ id: 'draft', label: ' ', command: 'cursor' }]) - ).toBe(false) - expect( - shouldCommitOpenInApplicationsDraft([{ id: 'draft', label: 'Cursor', command: ' ' }]) - ).toBe(false) - }) - - it('allows commit when every draft row has a label and command', () => { - expect(shouldCommitOpenInApplicationsDraft([])).toBe(true) - expect( - shouldCommitOpenInApplicationsDraft([{ id: 'cursor', label: 'Cursor', command: 'cursor' }]) - ).toBe(true) - expect( - shouldCommitOpenInApplicationsDraft([ - { id: 'cursor', label: 'Cursor', command: 'cursor' }, - { id: 'zed', label: 'Zed', command: 'zed' } - ]) - ).toBe(true) - }) -}) - describe('GeneralPane desktop platform detection', () => { it('keeps Windows available for Windows-only CLI settings', () => { expect( diff --git a/src/renderer/src/components/sidebar/DeleteWorktreeDialog.host-context-boundary.test.ts b/src/renderer/src/components/sidebar/DeleteWorktreeDialog.host-context-boundary.test.ts deleted file mode 100644 index 15f7cc04a984..000000000000 --- a/src/renderer/src/components/sidebar/DeleteWorktreeDialog.host-context-boundary.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const SOURCE = readFileSync(join(__dirname, 'use-delete-worktree-status-hydration.ts'), 'utf8') - -function sourceBetween(source: string, startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('DeleteWorktreeDialog host-context boundaries', () => { - it('preloads git status from the selected worktree owner instead of the focused host', () => { - const effect = sourceBetween(SOURCE, 'deleteTargets.filter(', 'return () => {') - - expect(effect).toContain('getSettingsForWorktreeRuntimeOwner') - expect(effect).toContain('worktreesByRepo: useAppStore.getState().worktreesByRepo') - expect(effect).toContain('target.id') - expect(effect).not.toContain('settings,\n worktreeId: target.id') - }) - - it('does not restart pending status requests when one target hydrates', () => { - const effect = sourceBetween(SOURCE, 'useEffect(() => {', '}, [') - - expect(SOURCE).not.toContain('useAppStore((state) => state.gitStatusByWorktree)') - expect(effect).toContain('useAppStore.getState().gitStatusByWorktree') - expect(effect).toContain('const controller = new AbortController()') - expect(effect).toContain('signal: controller.signal') - expect(effect).toContain('controller.abort()') - }) -}) diff --git a/src/renderer/src/components/sidebar/StatusIndicator.test.ts b/src/renderer/src/components/sidebar/StatusIndicator.test.ts index 1c2386156285..668596ef6dd4 100644 --- a/src/renderer/src/components/sidebar/StatusIndicator.test.ts +++ b/src/renderer/src/components/sidebar/StatusIndicator.test.ts @@ -36,15 +36,9 @@ describe('StatusIndicator', () => { it('renders working as a yellow spinner ring', () => { const markup = renderMarkup('working') - expect(markup).toContain('border-yellow-500') - expect(markup).toContain('border-t-transparent') - // Why: rotation must come from the compositor-driven CSS animation, not a - // JS clock writing per-element styles on the input thread (STA-3328). - expect(markup).toContain('agent-working-spinner') + // The spinner's own classes and animation contract belong to AgentWorkingSpinner.test.tsx; + // this pins only that 'working' reaches for it. expect(markup).toContain('data-agent-spinner') - // Why: under reduced motion the top border is filled so the static ring - // reads as a complete marker, not a broken partial spinner (#9515). - expect(markup).toContain('motion-reduce:border-t-yellow-500') }) it('renders monitoring as a static heartbeat glyph', () => { diff --git a/src/renderer/src/components/sidebar/project-group-header-dom.test.ts b/src/renderer/src/components/sidebar/project-group-header-dom.test.ts deleted file mode 100644 index 2e7523e5ecb5..000000000000 --- a/src/renderer/src/components/sidebar/project-group-header-dom.test.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' -import { describe, expect, it } from 'vitest' - -function readWorktreeListSource(): string { - return readFileSync( - fileURLToPath(new URL('./worktree-list/rows/SectionHeader.tsx', import.meta.url)), - 'utf8' - ) -} - -function readHeaderDragSource(): string { - return readFileSync( - fileURLToPath(new URL('./worktree-list/drag/use-header-drag.ts', import.meta.url)), - 'utf8' - ) -} - -describe('Project Group header drag DOM source', () => { - it('renders concrete Project Group header drag attributes separately from repo headers', () => { - const source = readWorktreeListSource() - - expect(source).toContain('data-project-group-header-id={projectGroupIdForHeader}') - expect(source).toContain('data-project-group-header-index={projectGroupHeaderIndex}') - expect(source).toContain('data-project-group-header-bucket={projectGroupHeaderBucketKey}') - expect(source).toContain('data-project-group-header-drag-handle=') - }) - - it('commits Project Group manual sorting through updateProjectGroup tabOrder', () => { - const source = readHeaderDragSource() - - expect(source).toContain('const updateProjectGroup = useAppStore((s) => s.updateProjectGroup)') - // Why: the commit must carry the group's owner host so a non-focused host still persists the order. - expect(source).toContain( - 'void updateProjectGroup(groupId, { tabOrder }, { hostId: ownerHostId ?? undefined })' - ) - }) - - it('keeps grab cursor on the title surface and dual handle attrs on row + surface', () => { - // Why: lock the cursor/hit-test split so a cleanup does not put grab back on the whole row - // or drop row-level handle attrs that arm drag from indent/padding. - const source = readWorktreeListSource() - const headerBlockStart = source.indexOf('data-repo-header-id={projectIdForHeader}') - const headerBlockEnd = source.indexOf('', headerBlockStart) - expect(headerBlockStart).toBeGreaterThan(-1) - expect(headerBlockEnd).toBeGreaterThan(headerBlockStart) - const headerBlock = source.slice(headerBlockStart, headerBlockEnd) - - // Dual handle placement: row (indent/padding) + title surface. - expect(headerBlock.match(/data-repo-header-drag-handle=/g)?.length).toBe(2) - expect(headerBlock.match(/data-project-group-header-drag-handle=/g)?.length).toBe(2) - // Surface owns grab; outer row only gets cursor-pointer when not draggable. - expect(headerBlock).toContain( - "!(isDraggableRepoHeader || isDraggableProjectGroupHeader) && 'cursor-pointer'" - ) - expect(headerBlock).toContain("'flex min-w-0 flex-1 items-center gap-1.5 self-stretch'") - expect(headerBlock).toContain("'cursor-grab active:cursor-grabbing'") - // Row-level ternary grab must stay gone. - expect(headerBlock).not.toMatch( - /isDraggableRepoHeader \|\| isDraggableProjectGroupHeader\s*\?\s*'cursor-grab/ - ) - }) -}) diff --git a/src/renderer/src/components/sidebar/worktree-keyboard-cycle.test.ts b/src/renderer/src/components/sidebar/worktree-keyboard-cycle.test.ts index 430736c92be0..9f5562d91cd0 100644 --- a/src/renderer/src/components/sidebar/worktree-keyboard-cycle.test.ts +++ b/src/renderer/src/components/sidebar/worktree-keyboard-cycle.test.ts @@ -1,5 +1,3 @@ -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' import type { HostSectionRow } from './host-section-rows' import { @@ -151,27 +149,3 @@ describe('getCyclableWorktreeIds', () => { expect(getCyclableWorktreeIds(rows, 'single-location')).toEqual(['visible-after-host']) }) }) - -describe('WorktreeList keyboard cycling', () => { - it('cycles over the rendered rows instead of rebuilding a parallel layout', () => { - const source = readFileSync( - fileURLToPath(new URL('./worktree-list/navigation/use-keyboard.ts', import.meta.url)), - 'utf8' - ) - const navigateWorktree = source.slice( - source.indexOf('const navigateWorktree = useCallback('), - source.indexOf('const handleContainerKeyDown = useCallback(') - ) - - // Why: a second buildRows call drifts from the rendered layout (host sections, - // pinned placement); cycling must read the same rows the viewport renders. - expect(navigateWorktree).toContain('getCyclableWorktreeRows(rows, pinnedDisplayPolicy)') - expect(navigateWorktree).toContain('getCyclableRowIdentity') - // Why: the active host is stored resolved while a local row is unqualified; comparing raw identities wraps to the top. - expect(navigateWorktree).toContain('resolveActiveCycleIdentity') - expect(navigateWorktree).not.toContain('composeWorktreeHostIdentity') - expect(navigateWorktree).toContain('executionHostId: nextWorktree.hostId') - expect(navigateWorktree).toContain('resolveCycledWorktreeId') - expect(navigateWorktree).not.toContain('buildRows(') - }) -}) diff --git a/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.test.ts b/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.test.ts index d95c204026ce..fb53b8d016a2 100644 --- a/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.test.ts +++ b/src/renderer/src/components/sidebar/worktree-list/grouping/build-rows.test.ts @@ -1,25 +1,11 @@ -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' import { buildRows } from './build-rows' import { ALL_GROUP_META, getPRGroupKey, PINNED_GROUP_KEY } from './group-keys' import { getGroupKeyForWorktree } from './worktree-group-keys' -import { - REPO_HEADER_ACTION_BUTTON_CLASS, - REPO_HEADER_ACTION_REVEAL_CLASS -} from '../../repo-header-action-button-class' import { repo, worktree, repoMap } from '../../worktree-list-groups-test-fixtures' import type { Repo } from '../../../../../../shared/repo-types' import type { Worktree } from '../../../../../../shared/worktree/types' -function readWorktreeListSource(): string { - return readFileSync(fileURLToPath(new URL('../../WorktreeList.tsx', import.meta.url)), 'utf8') -} - -function readSectionHeaderRowSource(): string { - return readFileSync(fileURLToPath(new URL('../rows/SectionHeader.tsx', import.meta.url)), 'utf8') -} - describe('getPRGroupKey', () => { it('puts merged PRs in the done group', () => { const prCache = { @@ -382,40 +368,3 @@ describe('buildRows with pinned worktrees', () => { ]) }) }) - -describe('WorktreeList header styles', () => { - it('does not title-case workspace group labels', () => { - const source = readSectionHeaderRowSource() - - expect(source).not.toContain('leading-none capitalize') - }) - - it('collapses repo header actions without reserving title width', () => { - expect(REPO_HEADER_ACTION_REVEAL_CLASS).toContain('min-w-0 max-w-0 -ml-1.5') - expect(REPO_HEADER_ACTION_REVEAL_CLASS).toContain('focus:ml-0 focus:max-w-5 focus:opacity-100') - expect(REPO_HEADER_ACTION_REVEAL_CLASS).toContain( - 'group-hover:ml-0 group-hover:max-w-5 group-hover:opacity-100' - ) - expect(REPO_HEADER_ACTION_BUTTON_CLASS).toContain( - 'transition-[margin,max-width,opacity,background-color,color]' - ) - expect(REPO_HEADER_ACTION_BUTTON_CLASS).toContain( - 'data-[state=open]:ml-0 data-[state=open]:max-w-5 data-[state=open]:opacity-100' - ) - }) - - it('resolves repo header color from project group headers only', () => { - const source = readSectionHeaderRowSource() - - expect(source).toContain('resolveProjectGroupHeaderColor({') - expect(source).toContain('headerKey: row.key') - expect(source).toContain('color={repoHeaderColor}') - }) - - it('adapts projected setup rows for sidebar project grouping', () => { - const source = readWorktreeListSource() - - expect(source).toContain('const projectHostSetupProjection = useProjectHostSetupProjection()') - expect(source).toContain('projectHostSetups: projectHostSetupProjection.setups') - }) -}) diff --git a/src/renderer/src/components/status-bar/PetStatusSegment.layout.test.ts b/src/renderer/src/components/status-bar/PetStatusSegment.layout.test.ts deleted file mode 100644 index e213100816e4..000000000000 --- a/src/renderer/src/components/status-bar/PetStatusSegment.layout.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -describe('PetStatusSegment layout', () => { - it('does not reserve fixed right padding on the pet menu trigger', () => { - const source = readFileSync(join(__dirname, 'PetStatusSegment.tsx'), 'utf8') - - // Why: the old pr-[6.5rem] reserved ~104px of empty space after the label and - // shoved neighboring status-bar segments left; unit-guard so CI catches a - // reintroduction without needing Electron Playwright. - expect(source).not.toMatch(/pr-\[\d+(?:\.\d+)?rem\]/) - expect(source).toMatch(/className="group inline-flex items-center cursor-pointer pl-1 py-0\.5"/) - }) -}) diff --git a/src/renderer/src/components/status-bar/resource-session-classification-parity.test.ts b/src/renderer/src/components/status-bar/resource-session-classification-parity.test.ts deleted file mode 100644 index ec7c7a628486..000000000000 --- a/src/renderer/src/components/status-bar/resource-session-classification-parity.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { readFileSync } from 'node:fs' -import { resolve } from 'node:path' -import { describe, expect, it } from 'vitest' - -const CONTROLLER_PATH = resolve(__dirname, 'use-resource-usage-status-controller.ts') -const DERIVED_MODEL_PATH = resolve(__dirname, 'use-resource-usage-derived-model.ts') - -/** - * Both destructive paths — bulk "kill orphans" and a single row's kill — must classify from the - * same binding inputs. When the merge call site re-listed the fields instead of reusing the - * object, it silently omitted deferred SSH sessions: bulk cleanup spared them while the row's - * kill destroyed them with no confirmation. Same bug, one click over (#8459). - */ -describe('resource session classification parity', () => { - it('feeds the row merge the same binding inputs as the bulk selector', () => { - const source = readFileSync(DERIVED_MODEL_PATH, 'utf8') - const mergeCall = source.slice( - source.indexOf('mergeSnapshotAndSessions(resourceSnapshot'), - source.indexOf('ambiguousWorktreeIds\n })') - ) - - expect(mergeCall).toContain('...resourceSessionBindings') - // Any of these appearing inline means the call site is re-deriving bindings and can drift. - for (const field of [ - 'ptyIdsByTabId,', - 'tabsByWorktree,', - 'terminalLayoutsByTabId,', - 'deferredSshSessionIdsByTabId,', - 'workspaceSessionReady,' - ]) { - expect(mergeCall).not.toContain(field) - } - }) - - it('keeps every binding source in the one object both paths read', () => { - const source = readFileSync(CONTROLLER_PATH, 'utf8') - const bindings = source.slice( - source.indexOf('const resourceSessionBindings = useMemo'), - source.indexOf('const popoverBodyRef') - ) - - for (const field of [ - 'ptyIdsByTabId', - 'tabsByWorktree', - 'terminalLayoutsByTabId', - 'deferredSshSessionIdsByTabId', - 'workspaceSessionReady' - ]) { - expect(bindings).toContain(field) - } - }) -}) diff --git a/src/renderer/src/components/status-bar/workspace-space-manager-source-boundary.test.ts b/src/renderer/src/components/status-bar/workspace-space-manager-source-boundary.test.ts deleted file mode 100644 index 3bf7a94c1ddd..000000000000 --- a/src/renderer/src/components/status-bar/workspace-space-manager-source-boundary.test.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const COMPONENT_ROOT = __dirname -const PRODUCTION_MODULES = [ - 'WorkspaceSpaceManagerPanel.tsx', - 'use-workspace-space-decision-projection.ts', - 'use-workspace-space-git-refresh-action.ts', - 'use-workspace-space-manager-bindings.ts', - 'use-workspace-space-manager-panel.ts', - 'use-workspace-space-manager-projection.ts', - 'workspace-space-breakdown-list.tsx', - 'workspace-space-decision-details.ts', - 'workspace-space-decision-hover-card.tsx', - 'workspace-space-manager-overview.tsx', - 'workspace-space-manager-state-types.ts', - 'workspace-space-manager-table.tsx', - 'workspace-space-manager-toolbar.tsx', - 'workspace-space-manager-view.tsx', - 'workspace-space-metrics.tsx', - 'workspace-space-selection-controls.tsx', - 'workspace-space-status-badge.tsx', - 'workspace-space-treemap.tsx', - 'workspace-space-worktree-row.tsx' -] as const - -function source(relativePath: string): string { - return readFileSync(join(COMPONENT_ROOT, relativePath), 'utf8').replace(/\r\n?/g, '\n') -} - -describe('workspace space manager source boundaries', () => { - it('keeps the public export path as a controller/view facade', () => { - const facade = source('WorkspaceSpaceManagerPanel.tsx') - - expect(facade).toContain('useWorkspaceSpaceManagerPanel()') - expect(facade).toContain('') - expect(facade).toContain('export { getWorkspaceDecisionDetails }') - expect(facade).not.toContain('max-lines') - }) - - it('keeps every production module below its physical line limit', () => { - for (const moduleName of PRODUCTION_MODULES) { - const moduleSource = source(moduleName) - const limit = moduleName.endsWith('.tsx') ? 400 : 300 - - expect(moduleSource.split('\n').length - 1, moduleName).toBeLessThan(limit) - expect(moduleSource, moduleName).not.toContain('disable max-lines') - } - }) - - it('preserves bounded git refreshes and source-owned runtime routing', () => { - const action = source('use-workspace-space-git-refresh-action.ts') - const projection = source('use-workspace-space-manager-projection.ts') - - expect(action).toContain('const currentState = useAppStore.getState()') - expect(action).toContain('connectionId:') - expect(action).toContain('getRuntimeGitStatus({') - expect(action).toContain('getWorkspaceSpaceWorktreeIdentity(worktree)') - expect(action).toContain('inFlightGitStatusRefreshes.current.delete(requestKey)') - expect(projection).toContain('const GIT_STATUS_REFRESH_CONCURRENCY = 6') - expect(projection).toContain('await refreshWorkspaceGitStatus(worktree)') - expect(projection).toContain('void Promise.all(') - expect(projection).toContain('cancelled = true') - }) - - it('preserves normal, force, and open-workspace action routing', () => { - const controller = source('use-workspace-space-manager-panel.ts') - const table = source('workspace-space-manager-table.tsx') - - expect(controller).toContain('runWorktreeBatchDelete(identities, {') - expect(controller).toContain('forceConfirm: true') - expect(controller).toContain('prepareActiveWorktreeFocusAfterDelete(worktree.worktreeId)') - expect(controller).toContain( - 'removeWorktree(\n { id: worktree.worktreeId, executionHostId: worktree.executionHostId ?? null },\n true,\n { allowUnverifiedPtyStop: true }\n )' - ) - expect(table).toContain('activateAndRevealWorktree(worktree.worktreeId, {') - }) -}) diff --git a/src/renderer/src/components/tab-bar/client-hosted-browser-row-strip-placement.test.ts b/src/renderer/src/components/tab-bar/client-hosted-browser-row-strip-placement.test.ts index 2b3dfadf4731..a2b30515f1d4 100644 --- a/src/renderer/src/components/tab-bar/client-hosted-browser-row-strip-placement.test.ts +++ b/src/renderer/src/components/tab-bar/client-hosted-browser-row-strip-placement.test.ts @@ -1,28 +1,11 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { describe, expect, it } from 'vitest' import { resolveClientHostedBrowserRowStripGroupId } from './client-hosted-browser-row-strip-placement' -function itemSurfaceSource(): string { - return readFileSync(join(__dirname, 'tab-bar-item-surface.tsx'), 'utf8') -} - describe('resolveClientHostedBrowserRowStripGroupId', () => { - it('names exactly one owning strip when the worktree is split', () => { - const groups = [{ id: 'group-left' }, { id: 'group-right' }, { id: 'group-bottom' }] - - const owner = resolveClientHostedBrowserRowStripGroupId(groups) - - expect(groups.filter((group) => group.id === owner)).toHaveLength(1) - }) - // Why: picking the focused group instead would make a row hop strips as the user clicks around. it('keeps the same owner as focus moves', () => { const groups = [{ id: 'group-left' }, { id: 'group-right' }] - expect(resolveClientHostedBrowserRowStripGroupId(groups)).toBe( - resolveClientHostedBrowserRowStripGroupId([...groups]) - ) expect(resolveClientHostedBrowserRowStripGroupId(groups)).toBe('group-left') }) @@ -30,28 +13,3 @@ describe('resolveClientHostedBrowserRowStripGroupId', () => { expect(resolveClientHostedBrowserRowStripGroupId([])).toBeNull() }) }) - -/** - * A client-hosted placeholder is retired by activating anything else in its strip. That only holds - * while every row kind's activation goes through the one wrapper — a new kind wired straight to - * its `onActivate*` prop would leave the placeholder covering the pane it just switched to. - */ -describe('tab-bar activation census', () => { - it('routes every row kind activation through the placeholder-clearing wrapper', () => { - const source = itemSurfaceSource() - const activations = source.match(/onActivate=\{[^}]*\}/g) ?? [] - - expect(activations.length).toBeGreaterThan(0) - for (const activation of activations) { - expect(activation, 'a row kind activates without retiring the placeholder').toContain( - 'activateRealTab(' - ) - } - }) - - it('clears the placeholder before handing off to the real activation', () => { - expect(itemSurfaceSource()).toMatch( - /clearClientHostedBrowserRowSelection\(\)\s*\n\s*activate\?\.\(arg\)/ - ) - }) -}) diff --git a/src/renderer/src/components/tab-bar/tab-bar-item-surface.client-hosted-active-state.test.tsx b/src/renderer/src/components/tab-bar/tab-bar-item-surface.client-hosted-active-state.test.tsx index 2cdff8b19315..a3f85044626a 100644 --- a/src/renderer/src/components/tab-bar/tab-bar-item-surface.client-hosted-active-state.test.tsx +++ b/src/renderer/src/components/tab-bar/tab-bar-item-surface.client-hosted-active-state.test.tsx @@ -1,7 +1,5 @@ // @vitest-environment happy-dom -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import type React from 'react' import { afterEach, describe, expect, it } from 'vitest' import type { WorkspaceVisibleTabType } from '../../../../shared/tab-types' @@ -166,21 +164,3 @@ describe('client-hosted row while a real tab is activated', () => { } ) }) - -/** - * The fixtures above cannot cover a row kind that does not exist yet, and a new one wired straight - * to its own active-tab selector is exactly how this regressed the first time. - */ -describe('tab-bar active-state census', () => { - it('suppresses every row kind while a client-hosted row owns the strip', () => { - const source = readFileSync(join(__dirname, 'tab-bar-item-surface.tsx'), 'utf8') - const decisions = source.match(/isActive=\{[^}]*\}/g) ?? [] - - expect(decisions.length).toBeGreaterThan(0) - for (const decision of decisions) { - expect(decision, 'a row kind underlines itself past a client-hosted row').toContain( - '!clientHostedRowOwnsActiveState' - ) - } - }) -}) diff --git a/src/renderer/src/components/task-drawer-source-boundary.test.ts b/src/renderer/src/components/task-drawer-source-boundary.test.ts deleted file mode 100644 index 1a2f64504e76..000000000000 --- a/src/renderer/src/components/task-drawer-source-boundary.test.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const COMPONENT_ROOT = __dirname - -function componentSource(relativePath: string): string { - return readFileSync(join(COMPONENT_ROOT, relativePath), 'utf8').replace(/\r\n?/g, '\n') -} - -function sourceBetween(source: string, startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('task drawer source boundaries', () => { - it('threads GitHub task source context through detail mutations', () => { - const source = [ - componentSource('github-item-dialog/edit-item-fields/gh-edit-section.tsx'), - componentSource('github-item-dialog/edit-item-fields/gh-edit-section-mutations.ts') - ].join('\n') - const issueUpdate = sourceBetween( - componentSource('github/github-work-item-edit-mutations.ts'), - 'async function runIssueUpdate', - 'async function runWorkItemBodyUpdate' - ) - const commentUpdate = sourceBetween( - componentSource('github/github-work-item-comment-mutations.ts'), - 'function addIssueCommentForRepo', - 'function addPRReviewCommentForRepo' - ) - const editSection = source - - expect(issueUpdate).toContain('sourceContext: args.sourceContext') - expect(commentUpdate).toContain('sourceContext: args.sourceContext') - expect(editSection).toContain('sourceContext,') - expect(editSection).toContain( - 'patchWorkItem(itemId, { state: newState }, itemRepoId, { sourceContext })' - ) - expect(editSection).toContain( - 'patchWorkItem(itemId, { labels: newLabels }, itemRepoId, { sourceContext })' - ) - }) - - it('threads GitLab task source context through the shared drawer selector', () => { - const controllerSource = componentSource('GitLabItemDialog.tsx') - const source = [ - controllerSource, - componentSource('gitlab-item-dialog/use-gitlab-item-dialog-effects.ts'), - componentSource('gitlab-item-dialog/use-gitlab-details-editing.ts'), - componentSource('gitlab-item-dialog/use-gitlab-primary-actions.ts'), - componentSource('gitlab-item-dialog/use-gitlab-review-actions.ts') - ].join('\n') - const selector = sourceBetween( - controllerSource, - 'const repoSelector = useMemo', - 'const updateCommentDraft' - ) - - expect(selector).toContain('...(repoId ? { repoId } : {})') - expect(selector).toContain('...(sourceContext ? { sourceContext } : {})') - expect(selector).toContain('}, [repoId, repoPath, sourceContext])') - expect(source).toContain('workItemDetails({ ...repoSelector') - expect(source).toContain('updateMR({ ...repoSelector') - expect(source).toContain('addMRComment({') - expect(source).toContain('addIssueComment({') - expect(source).toContain('...repoSelector') - }) - - it('uses Linear task source context for drawer reads, mutations, and optimistic patches', () => { - const drawerSource = componentSource('LinearItemDrawer.tsx') - const editSection = componentSource('linear-item-drawer-edit-controller.tsx') - const drawer = sourceBetween( - drawerSource, - 'export default function LinearItemDrawer', - 'return renderLinearItemDrawerSheet' - ) - - expect(editSection).toContain('const providerSettings = sourceContext ?? settings') - expect(editSection).toContain('linearUpdateIssue(providerSettings') - expect(editSection).toContain( - 'patchLinearIssue(issue.id, { state: stateValue }, { sourceContext })' - ) - expect(editSection).toContain( - 'patchLinearIssue(issue.id, { assignee: newAssignee }, { sourceContext })' - ) - expect(drawer).toContain('const providerSettings = sourceContext ?? settings') - expect(drawer).toContain('linearGetIssue(providerSettings') - expect(drawer).toContain('linearIssueComments(providerSettings') - }) - - it('uses Jira task source context for drawer reads, mutations, and optimistic patches', () => { - const source = componentSource('JiraIssueWorkspace.tsx') - const drawer = sourceBetween(source, 'export default function JiraIssueWorkspace', 'return (') - - expect(drawer).toContain('const providerSettings = sourceContext ?? settings') - expect(drawer).toContain('jiraIssueComments(providerSettings') - expect(drawer).toContain('jiraGetIssue(providerSettings') - expect(drawer).toContain('jiraListTransitions(providerSettings') - expect(drawer).toContain('jiraUpdateIssue(providerSettings') - expect(drawer).toContain('jiraAddIssueComment(') - expect(drawer).toContain('patchJiraIssue(displayed.key, optimistic, { sourceContext })') - expect(drawer).toContain('patchJiraIssue(previous.key, previous, { sourceContext })') - }) -}) diff --git a/src/renderer/src/components/task-page-github-issue-creation.test.ts b/src/renderer/src/components/task-page-github-issue-creation.test.ts deleted file mode 100644 index bacc3988bb8f..000000000000 --- a/src/renderer/src/components/task-page-github-issue-creation.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readTaskPageSource } from './task-page-source-family.test-support' -import { readFileSync } from 'node:fs' - -const taskPageSource = readTaskPageSource('use-task-page-github-issue-creation.ts') -const newIssueDraftSource = readFileSync( - new URL('./use-task-page-github-issue-draft.ts', import.meta.url), - 'utf8' -) -const newIssueRepoResetSource = readFileSync( - new URL('./task-page-new-issue-draft.ts', import.meta.url), - 'utf8' -) - -function issueCreationSection(): string { - const start = taskPageSource.indexOf('const handleCreateNewIssue') - expect(start).toBeGreaterThanOrEqual(0) - const end = taskPageSource.indexOf('const nextModel', start) - expect(end).toBeGreaterThan(start) - return taskPageSource.slice(start, end) -} - -describe('TaskPage GitHub issue creation', () => { - it('keeps issue creation targeted to the first selected repo on a fresh mount', () => { - expect(newIssueDraftSource).toContain( - 'selectedRepos.find((r) => r.id === newIssueRepoId) ?? selectedRepos[0] ?? null' - ) - // Why: a repo leaving the selection mid-draft must reset to the first selected repo. - expect(newIssueRepoResetSource).toContain('newIssueRepoId === null') - expect(newIssueRepoResetSource).toContain('return { repoId: selectedRepoIds[0] ?? null }') - }) - - it('covers the complete remote oversized-body recovery timeout envelope', () => { - const section = issueCreationSection() - - expect(section).toContain("'github.createIssue'") - expect(section).toMatch(/\{\s*timeoutMs: 65_000\s*\}/) - }) - - it('treats a body-save warning as created while preserving the recovery draft', () => { - const section = issueCreationSection() - const warningBranch = section.slice( - section.indexOf('if (result.bodySaveWarning)'), - section.indexOf('// Why: bump the nonce') - ) - - expect(warningBranch).toContain('toast.warning') - expect(warningBranch).toContain('description: result.bodySaveWarning') - expect(warningBranch).toMatch(/setNewIssueDraft\(\{\s*title: ''\s*\}\)/) - expect(warningBranch).toContain('} else {') - expect(warningBranch).toContain('clearNewIssueDraft()') - }) -}) diff --git a/src/renderer/src/components/task-page-source-family.test-support.ts b/src/renderer/src/components/task-page-source-family.test-support.ts deleted file mode 100644 index 14dd9a76d2e9..000000000000 --- a/src/renderer/src/components/task-page-source-family.test-support.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { readFileSync, readdirSync } from 'node:fs' -import { join } from 'node:path' - -const TASK_PAGE_FLAT_SOURCE_PATTERN = /^(?:use-task-page-.*\.ts|task-page-.*\.tsx?)$/ -const TASK_PAGE_DIRECTORY = 'task-page' -function isSourceFile(name: string): boolean { - return !name.includes('.test.') && !name.includes('.test-support.') -} - -// Why: the components/task-page tree nests by provider, so a flat readdir would silently -// return an empty family and turn every ratchet built on it into a no-op. -function readTaskPageDirectory(relativeDirectory: string): string[] { - return readdirSync(join(__dirname, relativeDirectory), { withFileTypes: true }).flatMap( - (entry) => { - const relativePath = `${relativeDirectory}/${entry.name}` - if (entry.isDirectory()) { - return readTaskPageDirectory(relativePath) - } - return /\.tsx?$/.test(entry.name) && isSourceFile(entry.name) ? [relativePath] : [] - } - ) -} - -export const TASK_PAGE_SOURCE_FILES = [ - ...readdirSync(__dirname).filter( - (name) => TASK_PAGE_FLAT_SOURCE_PATTERN.test(name) && isSourceFile(name) - ), - ...readTaskPageDirectory(TASK_PAGE_DIRECTORY) -].sort() - -export function readTaskPageSource(relativePath: string): string { - return readFileSync(join(__dirname, relativePath), 'utf8') -} - -export function readTaskPageSourceFamily(): string { - return TASK_PAGE_SOURCE_FILES.map( - (relativePath) => `// TaskPage source: ${relativePath}\n${readTaskPageSource(relativePath)}` - ).join('\n') -} diff --git a/src/renderer/src/components/task-page-source-switch-boundary.test.ts b/src/renderer/src/components/task-page-source-switch-boundary.test.ts deleted file mode 100644 index ae3bc60df21e..000000000000 --- a/src/renderer/src/components/task-page-source-switch-boundary.test.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readTaskPageSource } from './task-page-source-family.test-support' - -const CONTENT_SOURCE = readTaskPageSource('task-page/Content.tsx') -const SOURCE_BAR_SOURCE = readTaskPageSource('task-page/SourceBar.tsx') -const SOURCE_CONTEXT_SOURCE = readTaskPageSource('task-page-source-context.tsx') -const RUNTIME_HOSTS_SOURCE = readTaskPageSource('use-task-page-runtime-hosts.ts') -const GITHUB_DETAIL_SOURCE = readTaskPageSource('use-task-page-github-detail.ts') -const WORKSPACE_ACTIONS_SOURCE = readTaskPageSource('use-task-page-workspace-actions.ts') - -function sourceBetween(source: string, startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('TaskPage source switching host boundary', () => { - it('renders GitHub item details from the task-detail page owner only', () => { - const detailSection = sourceBetween( - CONTENT_SOURCE, - '') - expect(detailSection).toContain('workItem={dialogWorkItem}') - expect(detailSection).toContain(' { - const section = sourceBetween( - SOURCE_BAR_SOURCE, - '{visibleSourceOptions.map((source) => {', - "{taskSource === 'linear' && linearConnected ?" - ) - - expect(section).toContain('openTaskPage(') - expect(section).toContain('taskSource: source.id') - expect(section).toContain('defaultTaskSource: source.id') - expect(section).not.toContain('activeRuntimeEnvironmentId') - expect(section).not.toContain('projectHostSetupId') - expect(section).not.toContain('workspaceRunContext') - }) - - it('treats missing remote task-source capability as source unavailable', () => { - const section = sourceBetween( - SOURCE_CONTEXT_SOURCE, - 'function getTaskSourceHostAvailabilityForHost', - 'function getTaskPageRepoCacheInput' - ) - - expect(section).toContain('TASK_SOURCE_CONTEXT_RUNTIME_CAPABILITY') - expect(section).toContain("reason: 'checking-task-source-capability'") - expect(section).toContain("reason: 'missing-task-source-capability'") - }) - - it('checks runtime-owned provider auth on the owning runtime', () => { - const section = sourceBetween( - RUNTIME_HOSTS_SOURCE, - 'const runtimeTaskSourceHostIds = useMemo(() => {', - 'const nextModel' - ) - - expect(section).toContain('TASK_SOURCE_CONTEXT_RUNTIME_CAPABILITY') - expect(section).toContain("'preflight.check'") - expect(section).toMatch(/\{\s*kind: 'environment',\s*environmentId: parsed\.environmentId\s*\}/) - expect(RUNTIME_HOSTS_SOURCE).toContain('runtimePreflightStatusByHostId') - }) - - it('preserves exact GitLab project identity when opening or starting from an item', () => { - const sourceContextBuilder = sourceBetween( - SOURCE_CONTEXT_SOURCE, - 'function getTaskPageRepoSourceContext', - 'function getTaskSourceHostAvailabilityForHost' - ) - expect(sourceContextBuilder).toContain('gitlabProjectRef?: GitLabProjectRef | null') - expect(sourceContextBuilder).toContain('buildGitLabProviderIdentity(gitlabProjectRef)') - - const openGitLabDetail = sourceBetween( - GITHUB_DETAIL_SOURCE, - 'const openGitLabDetailPage = useCallback(', - 'const nextModel' - ) - expect(openGitLabDetail).toContain('item.projectRef') - - const startGitLabWorkspace = sourceBetween( - WORKSPACE_ACTIONS_SOURCE, - 'const openComposerForGitLabItem = useCallback(', - 'const handleUseGitLabItem = useCallback(' - ) - expect(startGitLabWorkspace).toContain('item.projectRef') - }) -}) diff --git a/src/renderer/src/components/task-page-task-creation-drafts.test.ts b/src/renderer/src/components/task-page-task-creation-drafts.test.ts deleted file mode 100644 index 969c1b0c3733..000000000000 --- a/src/renderer/src/components/task-page-task-creation-drafts.test.ts +++ /dev/null @@ -1,103 +0,0 @@ -import { readFileSync } from 'node:fs' -import { describe, expect, it } from 'vitest' -import { - readTaskPageSource, - readTaskPageSourceFamily -} from './task-page-source-family.test-support' - -const taskPageSource = readTaskPageSourceFamily() -const linearCreateDialogsSource = readFileSync( - new URL('./use-task-page-linear-creation-state.ts', import.meta.url), - 'utf8' -) -const jiraCreateDialogSource = readFileSync( - new URL('./use-task-page-jira-creation-state.ts', import.meta.url), - 'utf8' -) -const jiraCreateSubmitSource = readFileSync( - new URL('./use-task-page-jira-issue-creation.ts', import.meta.url), - 'utf8' -) -const draftWriterSource = readFileSync( - new URL('./task-page-draft-storage.tsx', import.meta.url), - 'utf8' -) -const draftRetentionSource = [linearCreateDialogsSource, jiraCreateDialogSource].join('\n') - -function sectionBetween(source: string, startAnchor: string, endAnchor: string): string { - const start = source.indexOf(startAnchor) - expect(start, `missing anchor: ${startAnchor}`).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endAnchor, start) - expect(end, `missing anchor: ${endAnchor}`).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('TaskPage Linear/Jira creation drafts', () => { - it('uses the contentful gate for each session draft writer', () => { - expect(draftWriterSource.split('isTaskCreationDraftContentful(draft)')).toHaveLength(4) - }) - - it('retains all three drafts on dismissal without subscribing TaskPage to draft actions', () => { - expect(draftRetentionSource.split('useTaskCreationDraftRetention({')).toHaveLength(4) - expect(taskPageSource).not.toMatch( - /useAppStore\(\(s\) => s\.(?:set|clear)New(?:LinearProject|LinearIssue|JiraIssue)Draft\)/ - ) - expect(draftRetentionSource).not.toMatch( - /useAppStore\(\(s\) => s\.(?:set|clear)New(?:LinearProject|LinearIssue|JiraIssue)Draft\)/ - ) - }) - - it('restores dismissed typed text when each dialog reopens', () => { - const linearFilters = readFileSync( - new URL('./task-page/linear/Filters.tsx', import.meta.url), - 'utf8' - ) - const jiraFilters = readFileSync( - new URL('./task-page/jira/Filters.tsx', import.meta.url), - 'utf8' - ) - expect(linearFilters).toContain("setNewLinearProjectName(draft?.name ?? '')") - expect(linearFilters).toContain("setNewLinearProjectDescription(draft?.description ?? '')") - expect(linearFilters).toContain("setNewLinearProjectContent(draft?.content ?? '')") - expect(linearFilters).toContain("setNewLinearIssueTitle(issueDraft?.title ?? '')") - expect(linearFilters).toContain("setNewLinearIssueBody(issueDraft?.body ?? '')") - expect(jiraFilters).toContain("setNewJiraIssueTitle(draft?.title ?? '')") - expect(jiraFilters).toContain("setNewJiraIssueBody(draft?.body ?? '')") - }) - - it('discards each recovery draft only on a successful create', () => { - const linearProjectSection = sectionBetween( - readTaskPageSource('use-task-page-linear-project-creation.ts'), - 'const handleCreateNewLinearProject', - 'const nextModel' - ) - expect(linearProjectSection).toContain('discardNewLinearProjectDraft()') - - const linearIssueSection = sectionBetween( - readTaskPageSource('use-task-page-linear-issue-creation.ts'), - 'const handleCreateNewLinearIssue', - 'const nextModel' - ) - expect(linearIssueSection).toContain('discardNewLinearIssueDraft()') - - const jiraIssueSection = sectionBetween( - readTaskPageSource('use-task-page-jira-issue-creation.ts'), - 'const handleCreateNewJiraIssue', - 'const nextModel' - ) - expect(jiraIssueSection).toContain('discardNewJiraIssueDraft()') - }) - - it('surfaces Jira create transport failures without leaking stale-context toasts', () => { - const jiraIssueSection = sectionBetween( - jiraCreateSubmitSource, - 'const handleCreateNewJiraIssue', - 'const nextModel' - ) - expect(jiraIssueSection).toContain('} catch (error) {') - expect(jiraIssueSection).toContain( - 'submitProviderRuntimeContextKey === providerRuntimeContextKeyRef.current' - ) - expect(jiraIssueSection).toContain('toast.error(') - }) -}) diff --git a/src/renderer/src/components/task-page-workspace-composer-boundary.test.ts b/src/renderer/src/components/task-page-workspace-composer-boundary.test.ts deleted file mode 100644 index 4eedb629f2aa..000000000000 --- a/src/renderer/src/components/task-page-workspace-composer-boundary.test.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' -import { - readTaskPageSource, - readTaskPageSourceFamily -} from './task-page-source-family.test-support' - -const TASK_PAGE_SOURCE = readTaskPageSourceFamily() -const WORKSPACE_ACTIONS_SOURCE = readTaskPageSource('use-task-page-workspace-actions.ts') -const COMPOSER_ACTIONS_SOURCE = readTaskPageSource('use-task-page-composer-actions.ts') -const PROJECT_VIEW_SOURCE = readFileSync( - join(__dirname, 'github-project', 'ProjectViewWrapper.tsx'), - 'utf8' -) -const COMPOSER_MODAL_SOURCE = readFileSync(join(__dirname, 'NewWorkspaceComposerModal.tsx'), 'utf8') -const QUICK_SUBMIT_PREPARATION_SOURCE = - readFileSync(join(__dirname, '../hooks/composer-state/quick-submit-preparation.ts'), 'utf8') + - readFileSync(join(__dirname, '../hooks/composer-state/quick-creation-execution.ts'), 'utf8') + - readFileSync(join(__dirname, '../hooks/composer-state/quick-creation-request.ts'), 'utf8') - -function sourceBetween(source: string, startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('TaskPage workspace creation source boundaries', () => { - it('prefills the workspace composer for GitHub issues and pull requests', () => { - const section = sourceBetween( - WORKSPACE_ACTIONS_SOURCE, - 'const openComposerForItem = useCallback(', - 'const handleUseWorkItem = useCallback(' - ) - - expect(section).toContain("provider: 'github'") - expect(section).toContain('type: item.type') - expect(section).toContain('number: item.number') - expect(section).toContain('title: item.title') - expect(section).toContain('url: item.url') - expect(section).toContain("openModal('new-workspace-composer', {") - expect(section).toContain("getTaskPageRepoSourceContext(repoMap.get(item.repoId), 'github')") - expect(section).toContain('prefilledName: getGitHubWorkItemWorkspaceSeed(item)') - expect(section).toContain('initialRepoId: item.repoId') - expect(section).toContain('initialGitHubWorkItem: item') - expect(section).toContain("enableIssueAutomation: item.type === 'issue'") - expect(section).toContain("telemetrySource: 'sidebar'") - }) - - it('forwards PR start-point data and issue automation through quick submit', () => { - expect(COMPOSER_MODAL_SOURCE).toContain( - 'initialGitHubWorkItem: modalData.initialGitHubWorkItem ?? null' - ) - expect(COMPOSER_MODAL_SOURCE).toContain( - 'enableIssueAutomation: modalData.enableIssueAutomation === true' - ) - const quickSubmit = QUICK_SUBMIT_PREPARATION_SOURCE - expect(quickSubmit).toContain('readAndConfirmRuntimeIssueCommand(') - expect(quickSubmit).toContain('selectedRepoExecutionHostId') - expect(quickSubmit).toContain('isSubmissionCancelled') - expect(quickSubmit).toContain( - '...(input.issueCommand ? { issueCommand: input.issueCommand } : {})' - ) - }) - - it('routes TaskPage GitHub starts directly to the composer', () => { - const section = sourceBetween( - WORKSPACE_ACTIONS_SOURCE, - 'const handleUseWorkItem = useCallback(', - 'const handleOpenOrUseGitHubWorkItem = useCallback(' - ) - - expect(section).toContain("recordFeatureInteraction('github-tasks')") - expect(section).toContain('openComposerForItem(item)') - expect(section).not.toContain('createGitHubWorkItemWorkspaceInBackground') - expect(WORKSPACE_ACTIONS_SOURCE).not.toContain('@/lib/github-work-item-background-create') - expect(TASK_PAGE_SOURCE).not.toContain('@/lib/github-work-item-background-create') - }) - - it('routes TaskPage Linear starts directly to the composer', () => { - const composerSection = sourceBetween( - COMPOSER_ACTIONS_SOURCE, - 'const openComposerForLinearItem = useCallback(', - 'const handleUseLinearItem = useCallback(' - ) - const handlerSection = sourceBetween( - COMPOSER_ACTIONS_SOURCE, - 'const handleUseLinearItem = useCallback(', - 'const handleOpenOrUseLinearItem = useCallback(' - ) - - expect(composerSection).toContain('buildLinearIssueLinkedWorkItem(issue)') - expect(composerSection).toContain("openModal('new-workspace-composer', {") - expect(composerSection).toContain('taskSourceContext: linearTaskSourceContext') - expect(composerSection).toContain('prefilledName: getLinearIssueWorkspaceName(issue)') - expect(composerSection).toContain("telemetrySource: 'sidebar'") - expect(handlerSection).toContain("recordFeatureInteraction('linear-tasks')") - expect(handlerSection).toContain('openComposerForLinearItem(issue)') - }) - - it('resumes an attachment from the primary action and composes when none exists', () => { - const section = sourceBetween( - WORKSPACE_ACTIONS_SOURCE, - 'const handleOpenOrUseGitHubWorkItem = useCallback(', - 'const openComposerForGitLabItem = useCallback(' - ) - - expect(section).toContain('findGithubWorkItemWorkspaceAttachment(') - expect(section).toContain('if (!currentAttached)') - expect(section).toContain('handleUseWorkItem(item)') - expect(section).toContain('activateAndRevealWorktree(currentAttached.id, {') - }) - - it('uses the shared composer handler from GitHub detail and start-new actions', () => { - const detail = readFileSync(join(__dirname, 'task-page/Content.tsx'), 'utf8') - const actions = readFileSync(join(__dirname, 'task-page/github/Rows.tsx'), 'utf8') - expect(detail.match(/onUse=\{\(item\) => \{/g)).toHaveLength(2) - expect(actions.match(/onSelect=\{\(\) => handleUseWorkItem\(item\)\}/g)).toHaveLength(2) - }) - - it('keeps project-view GitHub actions on the direct start-work path for issue #4756', () => { - const startAnchor = PROJECT_VIEW_SOURCE.includes('const handleStartWork') - ? 'const handleStartWork = useCallback(' - : '// Why: issue #4756 keeps project-view actions on the direct' - const endAnchor = PROJECT_VIEW_SOURCE.includes('const handleStartWork') - ? 'const closeDialogRepoItem' - : 'openModalFallback: () => {' - const section = sourceBetween(PROJECT_VIEW_SOURCE, startAnchor, endAnchor) - - expect(section).toContain('void launchWorkItemDirect({') - expect(section).toContain("launchSource: 'task_page'") - expect(section).not.toContain('createGitHubWorkItemWorkspaceInBackground') - }) -}) diff --git a/src/renderer/src/components/terminal-pane/terminal-pane-listener-order-parity.test.ts b/src/renderer/src/components/terminal-pane/terminal-pane-listener-order-parity.test.ts deleted file mode 100644 index 70a214abfd5e..000000000000 --- a/src/renderer/src/components/terminal-pane/terminal-pane-listener-order-parity.test.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { createHash } from 'node:crypto' -import { readFileSync, readdirSync } from 'node:fs' -import { join } from 'node:path' -// TypeScript 7 is a native CLI; AST tests still need the legacy JavaScript API. -import ts from 'typescript-api' -import { describe, expect, it } from 'vitest' - -const LISTENER_SOURCE_PATTERN = - /^(?:TerminalPane\.tsx|terminal-pane-paste-listeners\.ts|use-terminal-pane-(?:chat-state|close-actions|context-actions|controller|foundation|global-listeners|layout-bindings|layout-persistence|lifecycle-stage|mobile-actions|paste-listeners|projection|reconciliation|startup-actions|store-bindings|title-effects|title-state)\.ts)$/ -const PRE_REFACTOR_LISTENER_ORDER_SHA256 = - '2a2c5caaa368636d761ec819a7858f6b8010e578ccdd5c1be5960f87968c7e8a' - -type FunctionDefinition = { declaration: ts.FunctionDeclaration; sourceFile: ts.SourceFile } - -function readDefinitions(): Map { - const definitions = new Map() - for (const relativePath of readdirSync(__dirname).filter((name) => - LISTENER_SOURCE_PATTERN.test(name) - )) { - const filePath = join(__dirname, relativePath) - const sourceFile = ts.createSourceFile( - filePath, - readFileSync(filePath, 'utf8'), - ts.ScriptTarget.Latest, - true, - relativePath.endsWith('.tsx') ? ts.ScriptKind.TSX : ts.ScriptKind.TS - ) - const visit = (node: ts.Node): void => { - if ( - ts.isFunctionDeclaration(node) && - node.name && - (node.name.text === 'TerminalPane' || - node.name.text === 'registerTerminalPanePasteListeners' || - node.name.text.startsWith('useTerminalPane')) - ) { - definitions.set(node.name.text, { declaration: node, sourceFile }) - } - ts.forEachChild(node, visit) - } - visit(sourceFile) - } - return definitions -} - -function readFlattenedListeners(): string[] { - const definitions = readDefinitions() - const listeners: string[] = [] - const visitDefinition = (name: string, active: ReadonlySet): void => { - const definition = definitions.get(name) - if (!definition?.declaration.body) { - throw new Error(`Missing terminal pane stage: ${name}`) - } - if (active.has(name)) { - throw new Error(`Recursive terminal pane stage: ${name}`) - } - const nextActive = new Set([...active, name]) - const visit = (node: ts.Node): void => { - if (ts.isCallExpression(node)) { - if ( - ts.isPropertyAccessExpression(node.expression) && - ['addEventListener', 'removeEventListener'].includes(node.expression.name.text) - ) { - listeners.push( - [ - node.expression.expression.getText(definition.sourceFile), - node.expression.name.text, - ...node.arguments.map((argument) => - argument.getText(definition.sourceFile).replace(/\s+/g, '') - ) - ].join('|') - ) - } - if (ts.isIdentifier(node.expression) && definitions.has(node.expression.text)) { - visitDefinition(node.expression.text, nextActive) - } - } - ts.forEachChild(node, visit) - } - visit(definition.declaration.body) - } - - visitDefinition('TerminalPane', new Set()) - return listeners -} - -describe('TerminalPane refactor listener parity', () => { - it('preserves ordered listener registration and cleanup', () => { - const listeners = readFlattenedListeners() - expect(listeners).toHaveLength(24) - expect(createHash('sha256').update(listeners.join('\n')).digest('hex')).toBe( - PRE_REFACTOR_LISTENER_ORDER_SHA256 - ) - }) -}) diff --git a/src/renderer/src/components/terminal/terminal-close-confirm-keyboard-vs-mouse.test.ts b/src/renderer/src/components/terminal/terminal-close-confirm-keyboard-vs-mouse.test.ts index b2cdcb5b2adc..82f686f851f7 100644 --- a/src/renderer/src/components/terminal/terminal-close-confirm-keyboard-vs-mouse.test.ts +++ b/src/renderer/src/components/terminal/terminal-close-confirm-keyboard-vs-mouse.test.ts @@ -8,8 +8,6 @@ * Keyboard path: Cmd+W -> TerminalPane.handleRequestClosePane -> probePtyRunningWork * (split panes) or closeTerminalTab's guard (last pane) -> CloseTerminalDialog. */ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' const { @@ -92,21 +90,6 @@ describe('#10142 close confirmation policy is the same for keyboard and mouse', }) }) - // Control: the keyboard entry point does probe for running children. - it('keyboard Cmd+W path probes for running child processes before closing', () => { - const source = readFileSync( - join(__dirname, '../terminal-pane/use-terminal-pane-close-actions.ts'), - 'utf8' - ) - const handler = source.slice(source.indexOf('const handleRequestClosePane')) - // The shared probe, not a direct inspect: the pane path asks the same question as the tab - // guard, and routing both through one measurement is what stops them drifting on what an - // unanswered host means. - expect(handler.slice(0, handler.indexOf('useImperativeHandle'))).toContain( - 'probePtyRunningWork' - ) - }) - // Control: the harness does observe a guard when one exists — pinning blocks the same mouse close. it('mouse close routes a pinned tab through its confirmation guard', () => { const state = stateWithBusyTerminalTab(closeTab) @@ -121,13 +104,6 @@ describe('#10142 close confirmation policy is the same for keyboard and mouse', expect(closeTab).not.toHaveBeenCalled() }) - it('mouse close (X button / middle-click) consults the running-process probe', async () => { - closeTerminalTab('tab-busy') - await Promise.resolve() - - expect(inspectRuntimeTerminalProcessMock).toHaveBeenCalled() - }) - it('mouse close (X button / middle-click) does not drop a busy tab without confirmation', async () => { closeTerminalTab('tab-busy') await Promise.resolve() diff --git a/src/renderer/src/components/terminal/use-terminal-provider-snapshot-capability.test.tsx b/src/renderer/src/components/terminal/use-terminal-provider-snapshot-capability.test.tsx index b1f6e0876171..c17634115864 100644 --- a/src/renderer/src/components/terminal/use-terminal-provider-snapshot-capability.test.tsx +++ b/src/renderer/src/components/terminal/use-terminal-provider-snapshot-capability.test.tsx @@ -1,6 +1,4 @@ // @vitest-environment happy-dom -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { renderHook, waitFor } from '@testing-library/react' import { @@ -195,21 +193,6 @@ describe('useTerminalProviderSnapshotCapability', () => { hook.unmount() }) - // Why source-pinned: the hook test cannot prove the quiet parking effect consumes the external revision. - it('invalidates the Terminal parking pass when a capability verdict changes', () => { - const projectionSource = readFileSync( - join(__dirname, '../use-terminal-workspace-projection.ts'), - 'utf8' - ) - const parkingSource = readFileSync(join(__dirname, '../use-terminal-parking-pass.ts'), 'utf8') - - expect(projectionSource).toContain( - 'const terminalProviderSnapshotCapabilityRevision = useTerminalProviderSnapshotCapability(' - ) - expect(projectionSource).toContain('terminalProviderSnapshotCapabilityRevision') - expect(parkingSource.match(/terminalProviderSnapshotCapabilityRevision/g)).toHaveLength(2) - }) - it('cancels an unknown-capability retry when the hook unmounts', async () => { vi.useFakeTimers() resolveCapabilities.mockResolvedValue([{ id: 'ssh:target@@pty-1', authoritative: null }]) diff --git a/src/renderer/src/components/worktree-jump-palette-sleeping-filter.test.ts b/src/renderer/src/components/worktree-jump-palette-sleeping-filter.test.ts index 73ce01b2951b..56fe90c0eb2a 100644 --- a/src/renderer/src/components/worktree-jump-palette-sleeping-filter.test.ts +++ b/src/renderer/src/components/worktree-jump-palette-sleeping-filter.test.ts @@ -1,10 +1,6 @@ import { describe, expect, it } from 'vitest' import { isSleepingSweepExemptWorkspace } from './sidebar/visible-worktrees' import type { Worktree } from '../../../shared/worktree/types' -import { readWorktreeJumpPaletteSource } from './worktree-jump-palette-source.test-support' - -const worktreeSource = readWorktreeJumpPaletteSource('use-worktree-jump-palette-worktrees.ts') -const storeSource = readWorktreeJumpPaletteSource('use-worktree-jump-palette-store-state.ts') function makeWorktree(overrides: Partial = {}): Worktree { return { @@ -30,28 +26,6 @@ function makeWorktree(overrides: Partial = {}): Worktree { } describe('Cmd+J empty-query "Hide sleeping" pass (#8873)', () => { - // Why source-level: the palette re-implements the sidebar's filter pass - // inline, so the only structural guarantee that the two agree is that both - // call the shared predicate. A behavioral copy here would not catch a - // hand-rolled duplicate creeping back in. - it('routes the sleeping sweep through the shared exemption predicate', () => { - const start = worktreeSource.indexOf('const emptyQueryVisibleWorktrees = useMemo(') - expect(start).toBeGreaterThanOrEqual(0) - const end = worktreeSource.indexOf('const { visibleWorktreesForState', start) - const filterPass = worktreeSource.slice(start, end) - - expect(filterPass).toContain( - '!isSleepingSweepExemptWorkspace(worktree, alwaysShowDefaultBranchWorkspace)' - ) - expect(filterPass).toContain('alwaysShowDefaultBranchWorkspace,') - }) - - it('reads the flag from the same store field the sidebar uses', () => { - expect(storeSource).toMatch( - /const alwaysShowDefaultBranchWorkspace = useAppStore\(\s*\(state\) => state\.alwaysShowDefaultBranchWorkspace\s*\)/ - ) - }) - it('exempts a project entry point by default and honours an explicit opt-out', () => { const main = makeWorktree() diff --git a/src/renderer/src/components/worktree-jump-palette-source-context-boundary.test.ts b/src/renderer/src/components/worktree-jump-palette-source-context-boundary.test.ts deleted file mode 100644 index 0815cc7092f0..000000000000 --- a/src/renderer/src/components/worktree-jump-palette-source-context-boundary.test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { readWorktreeJumpPaletteSource } from './worktree-jump-palette-source.test-support' - -const source = [ - readWorktreeJumpPaletteSource('use-worktree-jump-palette-create-action.ts'), - readWorktreeJumpPaletteSource('worktree-jump-palette-create-worktree.ts') -].join('\n') - -function sourceBetween(startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('WorktreeJumpPalette source-context boundaries', () => { - it('defers pasted GitHub URL resolution to the composer so cross-project detection runs', () => { - // Why: pasting a cross-project URL must surface the same "Switch project?" - // prompt as Cmd+N. The palette hands the raw URL to the composer's name - // field instead of pre-resolving it against an arbitrary repo, which - // silently linked cross-project items to the wrong project. - const githubLinkSection = sourceBetween('if (ghLink) {', 'if (ghNumber !== null) {') - expect(githubLinkSection).toContain('prefilledName: trimmed') - expect(githubLinkSection).not.toContain('lookupGitHubWorkItemByOwnerRepoForSource') - }) - - it('resolves typed raw issue/PR numbers through the lookup repo source host', () => { - expect(source).toContain('buildTaskSourceContextFromRepo') - - const rawNumberSection = sourceBetween( - 'void lookupGitHubWorkItemForSource({', - '.then((item) => {' - ) - expect(rawNumberSection).toContain('sourceContext') - }) -}) diff --git a/src/renderer/src/components/worktree-jump-palette-source.test-support.ts b/src/renderer/src/components/worktree-jump-palette-source.test-support.ts deleted file mode 100644 index 6cb92e66de66..000000000000 --- a/src/renderer/src/components/worktree-jump-palette-source.test-support.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' - -export function readWorktreeJumpPaletteSource(relativePath: string): string { - return readFileSync(join(__dirname, relativePath), 'utf8') -} diff --git a/src/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.ts b/src/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.ts index 57964af2e99c..5fbdd00ffed5 100644 --- a/src/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.ts +++ b/src/renderer/src/hooks/remote-workspace-session-merge-close-tombstones.test.ts @@ -156,19 +156,6 @@ describe('direct-SSH pull merge: closed-tab tombstones', () => { expect(merged.tabsByWorktree[WORKTREE].map((tab) => tab.id)).toEqual(['live']) }) - it('leaves a tab alone when no tombstone names it', () => { - // The pre-existing absence-is-not-closed trade, restated: a host that still lists a tab closed - // on some other client keeps it here, because absence is all this merge would have to go on. - const agent = terminalTab('agent') - const closedElsewhere = terminalTab('closed-elsewhere') - const current = sessionState({ tabsByWorktree: { [WORKTREE]: [agent, closedElsewhere] } }) - const remote = sessionState({ tabsByWorktree: { [WORKTREE]: [agent] } }) - - const merged = merge(current, remote, { [WORKTREE]: [agent, closedElsewhere] }) - - expect(merged.tabsByWorktree[WORKTREE].map((tab) => tab.id)).toContain('closed-elsewhere') - }) - it('neither retires nor writes back a record once the host stops listing the tab', () => { // Main alone writes records; an acknowledgement used to delete them here, which made a workspace // the user emptied read as never initialized as soon as the host caught up. diff --git a/src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts b/src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts index 764a033275fe..9d76c9f9a232 100644 --- a/src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts +++ b/src/renderer/src/hooks/useComposerState-host-context-boundaries.test.ts @@ -1,8 +1,5 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { describe, expect, it } from 'vitest' import { - canResolveFolderSmartGitHubSubmit, getInitialAutoManagedWorkspaceName, getInitialGitHubPrStartPointSelection, getMatchingLinkedTaskSourceContext, @@ -11,54 +8,6 @@ import { resolveInitialWorkspaceRunSeed } from './useComposerState' -function readComposerModule(fileName: string): string { - return readFileSync(join(__dirname, 'composer-state', fileName), 'utf8') -} - -const COMPOSER_SOURCE = { - cardProps: readComposerModule('composer-card-props.ts'), - derived: readComposerModule('derived-composer-state.ts'), - folderSubmit: readComposerModule('folder-submit-orchestration.ts'), - fullCreation: readComposerModule('full-creation-execution.ts'), - fullCreationStartup: readComposerModule('full-creation-startup.ts'), - fullSubmitOrchestration: readComposerModule('full-submit-orchestration.ts'), - fullSubmitPreparation: readComposerModule('full-submit-preparation.ts'), - fullSubmitSourcePreparation: readComposerModule('full-submit-source-preparation.ts'), - githubProvider: readComposerModule('github-provider-selection.ts'), - githubSourceApplication: readComposerModule('github-source-application.ts'), - githubSubmit: readComposerModule('github-submit-resolution.ts'), - gitlabProvider: readComposerModule('gitlab-provider-selection.ts'), - hostRuntime: readComposerModule('host-runtime-effects.ts'), - initialTarget: readComposerModule('initial-target-state.ts'), - issueSource: readComposerModule('issue-source-actions.ts'), - linkedItemLookup: readComposerModule('linked-item-lookup-effects.ts'), - navigation: readComposerModule('composer-navigation-actions.ts'), - projectTarget: readComposerModule('project-target-actions.ts'), - providerRuntime: readComposerModule('provider-runtime-sync.ts'), - quickCreation: readComposerModule('quick-creation-execution.ts'), - quickSubmitAction: readComposerModule('quick-submit-action.ts'), - quickSubmitPreparation: readComposerModule('quick-submit-preparation.ts'), - quickSubmitSourcePreparation: readComposerModule('quick-submit-source-preparation.ts'), - runtimeTarget: readComposerModule('runtime-target-selection.ts'), - sourceContext: readComposerModule('source-context-state.ts'), - sourceIdentity: readComposerModule('source-identity-actions.ts'), - targetChange: readComposerModule('target-change-actions.ts'), - quickStartup: readComposerModule('quick-startup-plan.ts'), - workspaceIdentity: readComposerModule('workspace-identity-state.ts') -} as const -const RECIPE_OPTIONS_SOURCE = readFileSync( - join(__dirname, 'useEphemeralVmRecipeOptions.ts'), - 'utf8' -) - -function sourceBetween(source: string, startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - describe('useComposerState host-context boundaries', () => { it('seeds TaskPage pull requests as submit-time PR start points', () => { const item = { @@ -156,14 +105,6 @@ describe('useComposerState host-context boundaries', () => { ).toEqual({ workspaceName: 'title-derived-name', displayName: 'Title derived name' }) }) - it('requires pasted PR recovery to match the selected GitHub host', () => { - const recoverySection = COMPOSER_SOURCE.derived - - expect(recoverySection).toContain('githubRepoIdentityKey(fromName.slug)') - expect(recoverySection).toContain('githubRepoIdentityKey(selectedRepoSlug)') - expect(recoverySection).not.toContain('fromName.slug.owner.toLowerCase()') - }) - it('auto-owns linked-item generated prefilled names', () => { expect( getInitialAutoManagedWorkspaceName({ @@ -179,112 +120,6 @@ describe('useComposerState host-context boundaries', () => { ).toBe('fix-workspace-name') }) - it('resolves GitHub PR bases against the selected run repo, not the source item repo', () => { - const section = COMPOSER_SOURCE.githubProvider - - expect(section).toContain('const runRepo = selectedRepo ??') - expect(section).toContain('resolveGitHubPrStartPointForRepo') - expect(section).toContain('repoId: runRepo.id') - expect(section).toContain('settings: itemRepoSettings') - expect(section).toContain('smartGitHubPrStartPointSelectionRef.current = startPointSelection') - expect(section).toContain( - 'if (smartGitHubPrStartPointSelectionRef.current !== startPointSelection)' - ) - expect(section).not.toContain('repoId: repoForItem.id') - expect(section).not.toContain('repo: repoForItem.id') - }) - - it('resolves GitLab MR bases against the selected run repo, not the source item repo', () => { - const section = COMPOSER_SOURCE.gitlabProvider - - expect(section).toContain('const runRepo = selectedRepo ??') - expect(section).toContain('repoId: runRepo.id') - expect(section).toContain('getSettingsForRepoRuntimeOwner') - expect(section).toContain('worktree.resolveMrBase') - expect(section).toContain('repo: runRepo.id') - expect(section).not.toContain('repoId: repoForItem.id') - // Why (#6263): an unresolved MR base must surface a toast and clear stale - // state instead of silently dropping the worktree onto origin/master. - expect(section).toContain('toast.error(result.error)') - expect(section).toContain("'Failed to resolve MR base.'") - expect(section).toMatch(/\.catch\(\(error: unknown\) =>/) - }) - - it('clears only repo-scoped linked work items when the repo or project changes', () => { - // Why: Linear and Jira issues are workspace-scoped context — a repo or - // project switch must keep them attached. Jira used to be dropped because - // this path special-cased Linear only. - const repoChangeSection = COMPOSER_SOURCE.targetChange - expect(repoChangeSection).toContain( - '!shouldPreserveWorkspaceSourceOnRepoChange(linkedWorkItem)' - ) - - const folderSourceSection = COMPOSER_SOURCE.targetChange - expect(folderSourceSection).toContain('!shouldPreserveWorkspaceSourceOnRepoChange(current)') - - // No switch path may gate the linked-item clear on a Linear-only predicate - // again. (isLinearLinkedWorkItem itself may still appear — it drives the - // separate Linear branch-name feature — but never the preservation decision.) - expect(COMPOSER_SOURCE.targetChange).not.toContain('if (!preserveLinearLinkedWorkItem)') - }) - - it('does not use local SSH gates for runtime-owned folder targets', () => { - const targetSection = COMPOSER_SOURCE.runtimeTarget - expect(targetSection).toContain("parsedFolderTargetHost?.kind === 'runtime'") - expect(targetSection).toContain('connectionId: folderTargetConnectionId') - expect(COMPOSER_SOURCE.runtimeTarget).not.toContain('folderSourceConnectionId') - }) - - it('routes folder target runtime ownership through detection, path status, and create', () => { - const targetSection = COMPOSER_SOURCE.runtimeTarget - expect(targetSection).toContain('folderTargetRuntimeEnvironmentId') - expect(targetSection).toContain("{ kind: 'runtime' as const") - expect(targetSection).toContain('useFolderWorkspaceComposerPathStatus(') - expect(targetSection).toContain('folderTargetRuntimeEnvironmentId') - expect(targetSection).toContain('useDetectedAgents(folderTargetAgentDetectionTarget)') - - const submitSection = COMPOSER_SOURCE.folderSubmit - expect(submitSection).toContain('isRemote: folderTargetIsRemote') - expect(submitSection).toContain( - "launchSource: telemetrySource === 'onboarding' ? 'onboarding' : 'new_workspace_composer'" - ) - expect(submitSection).toContain('runtimeEnvironmentId: folderTargetRuntimeEnvironmentId') - }) - - it('detects composer agents against the repo host: SSH, then runtime, then local (#7082)', () => { - // Why: a repo owned by a paired runtime must show the runtime's agents, not - // the local machine's. SSH stays first priority; runtime falls through before - // local so an SSH repo never double-detects. Regression guard for #7082. - const selectorSection = COMPOSER_SOURCE.workspaceIdentity - expect(selectorSection).toContain('if (isRemote) {') - expect(selectorSection).toContain('s.remoteDetectedAgentIds[connectionId]') - expect(selectorSection).toContain('if (runtimeEnvironmentId) {') - expect(selectorSection).toContain('s.runtimeDetectedAgentIds[runtimeEnvironmentId]') - expect(selectorSection).toContain('return s.detectedAgentIds') - // SSH branch is checked before the runtime branch. - expect(selectorSection.indexOf('if (isRemote) {')).toBeLessThan( - selectorSection.indexOf('if (runtimeEnvironmentId) {') - ) - - expect(COMPOSER_SOURCE.workspaceIdentity).toContain( - 'const runtimeEnvironmentId = selectedRepoSettings?.activeRuntimeEnvironmentId?.trim() || null' - ) - - // Detection effect fans out to the same three hosts in the same order and - // re-runs when the runtime environment changes. - const detectSection = sourceBetween( - COMPOSER_SOURCE.hostRuntime, - 'const detect = isRemote', - '// Per-repo: load yaml hooks' - ) - expect(detectSection).toContain('ensureRemoteDetectedAgents(connectionId!)') - expect(detectSection).toContain('ensureRuntimeDetectedAgents(runtimeEnvironmentId)') - expect(detectSection).toContain('ensureDetectedAgents()') - expect(detectSection).toMatch( - /\}, \[\s*connectionId,\s*runtimeEnvironmentId,\s*isRemote,\s*selectedRepoSshStatus,\s*disabledTuiAgents/ - ) - }) - it('seeds initial workspace run target from the task source context', () => { expect( resolveInitialWorkspaceRunSeed({ @@ -316,299 +151,6 @@ describe('useComposerState host-context boundaries', () => { hostId: 'local', projectHostSetupId: 'setup-local' }) - - const section = COMPOSER_SOURCE.initialTarget - - expect(section).toContain('resolveInitialWorkspaceRunSeed') - expect(section).toContain('initialTaskSourceContext') - expect(section).toContain('projectId: initialRunSeed.projectId') - expect(section).toContain('hostId: initialRunSeed.hostId') - expect(section).toContain('projectHostSetupId: initialRunSeed.projectHostSetupId') - }) - - it('resolves typed GitHub issue/PR input through the selected repo source context', () => { - expect(COMPOSER_SOURCE.sourceContext).toContain( - 'const selectedRepoGitHubSourceContext = useMemo' - ) - - const directLookup = COMPOSER_SOURCE.linkedItemLookup - expect(directLookup).toContain('sourceContext: selectedRepoGitHubSourceContext') - expect(directLookup).toContain('lookupGitHubWorkItemByOwnerRepoForSource') - expect(directLookup).toContain('type: normalizedLinkQuery.directLink.type') - - const submitLookup = COMPOSER_SOURCE.githubSubmit - expect(submitLookup).toContain('sourceContext:') - expect(submitLookup).toContain('selectedRepoGitHubSourceContext') - }) - - it('uses submit-time GitHub PR start points for the create payload', () => { - const submitLookup = COMPOSER_SOURCE.githubSubmit - expect(submitLookup).toContain('resolveGitHubPrStartPointForRepo') - expect(submitLookup).toContain("kind: 'pr-start-point'") - expect(submitLookup).toContain("kind: 'metadata-only'") - expect(submitLookup).toContain('baseBranch: prStartPoint.baseBranch') - expect(submitLookup).toContain('branchNameOverride: prStartPoint.branchNameOverride') - const selectedPrSubmitLookup = sourceBetween( - submitLookup, - 'if (linkedWorkItem) {', - 'const intent = getSmartGitHubSubmitIntent(name)' - ) - expect(selectedPrSubmitLookup).toContain('smartGitHubPrStartPointSelectionRef.current') - expect(selectedPrSubmitLookup).toContain("linkedWorkItemIdentity?.type === 'pr'") - expect(selectedPrSubmitLookup).toContain("startPointIdentity?.type === 'pr'") - expect(selectedPrSubmitLookup).toContain( - 'startPointIdentity.number === linkedWorkItemIdentity.number' - ) - expect(selectedPrSubmitLookup).toContain('resolveGitHubPrStartPointForRepo') - expect(selectedPrSubmitLookup.indexOf('resolveGitHubPrStartPointForRepo')).toBeLessThan( - selectedPrSubmitLookup.indexOf("return { kind: 'none' }") - ) - - const fullSubmit = COMPOSER_SOURCE.fullSubmitSourcePreparation + COMPOSER_SOURCE.fullCreation - expect(fullSubmit).toContain("smartGitHubResolution.kind === 'pr-start-point'") - expect(fullSubmit).toContain("smartGitHubResolution.kind === 'metadata-only'") - expect(fullSubmit).toContain('effectiveLinkedPR !== null || linkedGitLabMR !== null') - expect(fullSubmit).toContain('selectedRepoIsGit ? submitBaseBranch : undefined') - expect(fullSubmit).toContain('submitPushTarget') - expect(fullSubmit).toContain('submitCompareBaseRef') - expect(fullSubmit).not.toContain('smartGitHubResolution?.baseBranch ?? baseBranch') - expect(fullSubmit).not.toContain('smartGitHubResolution?.compareBaseRef ?? compareBaseRef') - expect(fullSubmit).not.toContain('smartGitHubResolution?.pushTarget ?? pushTarget') - expect(fullSubmit).not.toContain( - 'smartGitHubResolution?.branchNameOverride ?? branchNameOverride' - ) - - const quickSubmit = - COMPOSER_SOURCE.quickSubmitSourcePreparation + - COMPOSER_SOURCE.quickSubmitPreparation + - COMPOSER_SOURCE.quickCreation - expect(quickSubmit).toContain("smartGitHubResolution.kind === 'pr-start-point'") - expect(quickSubmit).toContain("smartGitHubResolution.kind === 'metadata-only'") - expect(quickSubmit).toContain('effectiveLinkedPR !== null || linkedGitLabMR !== null') - expect(quickSubmit).toContain('explicitBaseBranch: smartSubmitBaseBranch') - expect(quickSubmit).toContain('pushTarget: submitPushTarget') - expect(quickSubmit).toContain('compareBaseRef: submitCompareBaseRef') - expect(quickSubmit).not.toContain('smartGitHubResolution?.baseBranch ?? baseBranch') - expect(quickSubmit).not.toContain('smartGitHubResolution?.compareBaseRef ?? compareBaseRef') - expect(quickSubmit).not.toContain('smartGitHubResolution?.pushTarget ?? pushTarget') - expect(quickSubmit).not.toContain( - 'smartGitHubResolution?.branchNameOverride ?? branchNameOverride' - ) - }) - - it('saves setup startup policy before creating a workspace', () => { - const persistSection = COMPOSER_SOURCE.providerRuntime - expect(persistSection).toContain('setupAgentStartupPolicySaveRef.current') - expect(persistSection).toContain('pendingSave?.repoId === currentRepo.id') - expect(persistSection).toContain('pendingSave.policy === policy') - expect(persistSection).toContain('await pendingSave.promise') - expect(persistSection).toContain('continue') - expect(COMPOSER_SOURCE.providerRuntime).toContain('setupAgentStartupPolicyDraftRef.current') - - const fullSubmit = COMPOSER_SOURCE.fullCreation - const fullPolicySave = fullSubmit.indexOf('persistSetupAgentStartupPolicy()') - const fullCreate = fullSubmit.indexOf('const result = await createWorktree(') - expect(fullPolicySave).toBeGreaterThanOrEqual(0) - expect(fullCreate).toBeGreaterThan(fullPolicySave) - - const quickSubmit = COMPOSER_SOURCE.quickCreation - const quickPolicySave = quickSubmit.indexOf('persistSetupAgentStartupPolicy()') - const quickCreate = quickSubmit.indexOf('const request = buildQuickCreationRequest(') - expect(quickPolicySave).toBeGreaterThanOrEqual(0) - expect(quickCreate).toBeGreaterThan(quickPolicySave) - }) - - it('resolves submit-time GitHub smart input when folder child repos exist', () => { - expect( - canResolveFolderSmartGitHubSubmit({ - hasFolderSourceRepos: true - }) - ).toBe(true) - expect( - canResolveFolderSmartGitHubSubmit({ - hasFolderSourceRepos: false - }) - ).toBe(false) - - const lookupSection = COMPOSER_SOURCE.githubSubmit - expect(lookupSection).toContain('isProjectGroupTarget') - expect(lookupSection).toContain('folderSourceRepos.filter(isGitRepoKind)') - expect(lookupSection).toContain('Promise.all') - expect(lookupSection).toContain('buildTaskSourceContextFromRepo') - - const section = COMPOSER_SOURCE.folderSubmit - expect(section).toContain('canResolveFolderSmartGitHubSubmit') - expect(section).toContain('hasFolderSourceRepos: folderSourceRepos.length > 0') - expect(section).toContain('? resolvePendingSmartGitHubSubmit()') - expect(section).toContain("Promise.resolve({ kind: 'none' } as const)") - expect(section).toContain("smartGitHubSettlement.status === 'cancelled'") - expect(section).not.toContain('folderSourceRequiresConnection') - }) - - it('clears branch reuse state when manually editing the branch name', () => { - const section = COMPOSER_SOURCE.sourceIdentity - - expect(section).toContain('resolveComposerManualBranchNameChange') - expect(section).toContain('setReuseEligibleBranch(null)') - expect(section).toContain('setReuseSelectedBranch(false)') - expect(section).toContain("branchAutoNameRef.current = ''") - }) - - it('forces repo-scoped source reset when returning from folder target to a repo with the same id', () => { - const handleRepoChange = COMPOSER_SOURCE.targetChange - expect(handleRepoChange).toContain('forceResetStartFrom?: boolean') - expect(handleRepoChange).toContain('value === repoId && !options.forceResetStartFrom') - - const handleProjectChange = COMPOSER_SOURCE.projectTarget - expect(handleProjectChange).toContain( - 'handleRepoChange(nextRepoId, { forceResetStartFrom: isProjectGroupTarget })' - ) - }) - - it('keeps a Linear branch override when its workspace-scoped issue survives a repo change', () => { - const section = COMPOSER_SOURCE.targetChange - - expect(section).toContain('const preservedLinearBranchName = preserveLinearLinkedWorkItem') - expect(section).toContain('getLinearLinkedWorkItemBranchName(linkedWorkItem)') - expect(section).toContain('setBranchNameOverride(preservedLinearBranchName)') - expect(section).toContain( - 'setBranchNameOverridePreservesNameEdits(Boolean(preservedLinearBranchName))' - ) - expect(section).toContain("branchAutoNameRef.current = preservedLinearBranchName ?? ''") - }) - - it('clears a Linear branch override when its linked issue is removed', () => { - const section = COMPOSER_SOURCE.sourceIdentity - - expect(section).toContain('const removedLinearItem = isLinearLinkedWorkItem(linkedWorkItem)') - expect(section).toContain('if (removedLinearItem)') - expect(section).toContain('setBranchNameOverride(undefined)') - expect(section).toContain('setBranchNameOverridePreservesNameEdits(false)') - expect(section).toContain("branchAutoNameRef.current = ''") - }) - - it('keeps Jira-mode URL edits synchronously blocked before lookup settles', () => { - // Why: derived on every render from the same name the submit path uses, so an in-flight - // URL cannot slip through between the keystroke and the create. - expect(COMPOSER_SOURCE.workspaceIdentity).toContain( - 'isBlockingJiraUrlIntent(smartNameMode, name)' - ) - const section = COMPOSER_SOURCE.sourceIdentity - - expect(section).not.toContain("smartNameMode === 'smart'") - expect(section).not.toContain('setSourceIntentBlocksCreate') - }) - - it('selects a project by its own host instead of pinning the current host', () => { - // Regression: passing the current host as a hard `hostId` made picking a - // project set up only on a different host a silent no-op. The current host - // must be a preference (focusedHostScope), with a fallback to any ready host. - const handleProjectChange = COMPOSER_SOURCE.projectTarget - expect(handleProjectChange).toContain('focusedHostScope: preferredHostId ?? workspaceHostScope') - expect(handleProjectChange).not.toContain('hostId: preferredHostId') - }) - - it('clears GitLab-specific linked state when clearing smart-name selection', () => { - const section = COMPOSER_SOURCE.issueSource - expect(section).toContain("setLinkedIssue('')") - expect(section).toContain('setLinkedPR(null)') - expect(section).toContain('setLinkedGitLabIssue(null)') - expect(section).toContain('setLinkedGitLabMR(null)') - expect(section).toContain('setLinkedWorkItem(null)') - }) - - it('clears stale opposite-provider review fields when selecting linked work items', () => { - const githubApply = COMPOSER_SOURCE.githubSourceApplication - expect(githubApply).toContain('setLinkedGitLabIssue(null)') - expect(githubApply).toContain('setLinkedGitLabMR(null)') - expect(githubApply).toContain('setBranchNameOverridePreservesNameEdits(false)') - expect(githubApply).toContain("branchAutoNameRef.current = ''") - - const gitlabApply = COMPOSER_SOURCE.gitlabProvider - expect(gitlabApply).toContain("setLinkedIssue('')") - expect(gitlabApply).toContain('setLinkedPR(null)') - expect(gitlabApply).toContain('setBranchNameOverridePreservesNameEdits(false)') - expect(gitlabApply).toContain("branchAutoNameRef.current = ''") - - const githubProjectGroupHandler = COMPOSER_SOURCE.githubProvider - const gitlabProjectGroupHandler = COMPOSER_SOURCE.githubProvider - expect(githubProjectGroupHandler).toContain('setLinkedGitLabIssue(null)') - expect(githubProjectGroupHandler).toContain('setLinkedGitLabMR(null)') - expect(gitlabProjectGroupHandler).toContain( - "setLinkedIssue(identity.type === 'issue' ? String(identity.number) : '')" - ) - expect(gitlabProjectGroupHandler).toContain( - "setLinkedPR(identity.type === 'pr' ? identity.number : null)" - ) - }) - - it('disables repo-backed folder smart lookup when a folder target has no source repos', () => { - const cardProps = COMPOSER_SOURCE.cardProps - expect(cardProps).toContain( - 'repoBackedSourcesDisabled: isProjectGroupTarget ? folderSourceRepos.length === 0 : false' - ) - expect(cardProps).toContain( - 'repoBackedSearchRepos: isProjectGroupTarget ? folderSourceRepos : undefined' - ) - }) - - it('surfaces folder submit smart-resolution failures through create error UI', () => { - const section = COMPOSER_SOURCE.folderSubmit - expect(section).toContain('catch (error)') - expect(section).toContain('const formattedError = formatWorkspaceCreateError(error)') - expect(section).toContain('setCreateError(formattedError)') - expect(section).toContain('toast.error(getWorkspaceCreateErrorToastMessage(formattedError))') - expect(section).toContain('if (!folderWorkspaceCreated)') - expect(section).toContain('setCreateError({') - }) - - it('uses submit-time smart metadata for both folder launch mode and startup content', () => { - const section = COMPOSER_SOURCE.folderSubmit - expect(section).toContain( - 'const submitLinkedWorkItem = smartGitHubMetadata?.linkedWorkItem ?? linkedWorkItem' - ) - expect(section).toContain('resolveFolderWorkspaceLaunchDraft(submitLinkedWorkItem, note)') - expect(section).toContain('linkedWorkItem: submitLinkedWorkItem') - }) - - it('gates every submit path on the derived source intent', () => { - // Why: derived from name+mode, so the submitted name and the gate can never disagree. - expect(COMPOSER_SOURCE.workspaceIdentity).toContain( - 'const sourceIntentBlocksCreate = !linkedWorkItem && isBlockingJiraUrlIntent(smartNameMode, name)' - ) - const submitSections = [ - COMPOSER_SOURCE.navigation, - COMPOSER_SOURCE.fullSubmitOrchestration, - COMPOSER_SOURCE.quickSubmitAction - ] - - for (const section of submitSections) { - expect(section).toContain('sourceIntentBlocksCreate') - } - }) - - it('passes folder child repos to smart lookup instead of building task source options', () => { - const cardProps = COMPOSER_SOURCE.cardProps - expect(cardProps).toContain( - 'repoBackedSearchRepos: isProjectGroupTarget ? folderSourceRepos : undefined' - ) - expect(cardProps).not.toContain('folderSourceProjectOptions') - expect(cardProps).not.toContain('handleFolderTaskSourceProjectChange') - expect(cardProps).not.toContain('getRepoIdFromNewWorkspaceFolderSourceOptionId') - }) - - it('keeps folder run repo changes inside the selected folder source set', () => { - const section = COMPOSER_SOURCE.targetChange - expect(section).toContain('folderSourceRepos.some((repo) => repo.id === value)') - expect(section).toContain('return') - - const cardProps = COMPOSER_SOURCE.cardProps - expect(cardProps).toContain('allowSmartNameAddProject: !isProjectGroupTarget') - }) - - it('preserves Jira linked items when switching from repo target to folder target', () => { - const section = COMPOSER_SOURCE.projectTarget - expect(section).toContain('!shouldPreserveWorkspaceSourceOnRepoChange(linkedWorkItem)') }) it('restores Jira draft context only when its site and issue identity agree', () => { @@ -644,139 +186,4 @@ describe('useComposerState host-context boundaries', () => { getMatchingLinkedTaskSourceContext({ ...item, jiraIdentifier: 'ORCA-999' }, context) ).toBeNull() }) - - it('resolves quick-create base refs through the worktree-create precedence helper', () => { - const section = COMPOSER_SOURCE.quickSubmitPreparation - expect(section).not.toContain('repoWorktreeBaseRef: selectedRepo.worktreeBaseRef') - expect(section).not.toContain('getRuntimeRepoBaseRefDefault') - }) - - it('plans new workspace agent startup from the selected repo runtime', () => { - expect(COMPOSER_SOURCE.runtimeTarget).toContain( - 'const selectedRepoAgentLaunchPlatform = useMemo' - ) - expect(COMPOSER_SOURCE.runtimeTarget).toContain('getLocalRepoProjectExecutionRuntimeContext') - expect(COMPOSER_SOURCE.runtimeTarget).toContain( - 'getAgentLaunchPlatformForRepo(selectedRepo, projectRuntime)' - ) - - const fullStartupPlan = sourceBetween( - COMPOSER_SOURCE.fullSubmitPreparation, - 'const startupPlan = buildAgentStartupPlan({', - 'const shouldSeedInitialAgentStatus =' - ) - expect(fullStartupPlan).toContain('platform: selectedRepoAgentLaunchPlatform') - expect(fullStartupPlan).not.toContain('platform: CLIENT_PLATFORM') - expect(COMPOSER_SOURCE.fullCreation).toContain('startupDraft: startupPlan.draftPrompt') - - const quickStartupPlan = sourceBetween( - COMPOSER_SOURCE.quickCreation, - 'buildQuickComposerStartup({', - 'const startupPolicySettlement =' - ) - expect(quickStartupPlan).toContain('platform: selectedRepoAgentLaunchPlatform') - expect(quickStartupPlan).not.toContain('platform: CLIENT_PLATFORM') - }) - - // Why: activation no longer rebuilds a startup from `createdWithAgent`, so this - // caller's own `startup` is the only thing that launches the agent it planned. - it('passes its own startup to activation when submit planned an agent', () => { - const activation = COMPOSER_SOURCE.fullCreation + COMPOSER_SOURCE.fullCreationStartup - - expect(activation).toContain('...(!structuredLaunch && startup ? { startup } : {})') - expect(activation).toContain('backendStartupTerminalSpawned: true') - expect(activation).toContain('command: args.startupPlan.launchCommand') - expect(activation).toContain('launchAgent: args.agent') - // The removed activation-time fallback must not come back through this caller. - expect(COMPOSER_SOURCE.fullCreation).not.toContain('buildCreatedAgentReopenStartup') - }) - - it('prepares linked quick-create drafts for the selected default agent', () => { - const quickSubmit = COMPOSER_SOURCE.quickCreation + COMPOSER_SOURCE.quickStartup - - expect(quickSubmit).toContain( - 'const promptLinkedWorkItem = agent === null ? null : submitLinkedWorkItem' - ) - expect(quickSubmit).toContain('resolveQuickCreateLinkedWorkItemPrompt(promptLinkedWorkItem') - expect(quickSubmit).not.toContain('explicitAgentChoice') - expect(quickSubmit).not.toContain('shouldPrepareQuickLinkedWorkItemAgentPrompt') - expect(COMPOSER_SOURCE.quickCreation).not.toContain('resolveQuickWorkspaceSubmitAgent') - }) - - it('keeps sentinel-based Jira and Linear starts out of issue-command templates', () => { - const submitSources = - COMPOSER_SOURCE.derived + - COMPOSER_SOURCE.fullSubmitSourcePreparation + - COMPOSER_SOURCE.fullSubmitPreparation + - COMPOSER_SOURCE.fullCreation + - COMPOSER_SOURCE.quickSubmitPreparation + - COMPOSER_SOURCE.quickCreation - expect(submitSources).not.toContain('isOrcaCliAvailableForLaunch') - expect(submitSources).not.toContain('hasGeneratedLinearSourceContext') - expect(submitSources).not.toContain('shouldDraftGeneratedLinearContext') - expect(COMPOSER_SOURCE.derived).toMatch( - /willApplyIssueCommandAsPrompt[\s\S]*canUseIssueCommandForLinkedItemProvider\(linkedWorkItemProvider\)/ - ) - - const previewSection = COMPOSER_SOURCE.derived - expect(previewSection).toContain( - 'canUseIssueCommandForLinkedItemProvider(linkedWorkItemProvider)' - ) - - const fullSubmit = - COMPOSER_SOURCE.fullSubmitSourcePreparation + - COMPOSER_SOURCE.fullSubmitPreparation + - COMPOSER_SOURCE.fullCreation + - COMPOSER_SOURCE.fullCreationStartup - expect(fullSubmit).toContain( - 'canUseIssueCommandForLinkedItemProvider(submitLinkedWorkItemProvider)' - ) - expect(fullSubmit).toMatch( - /submitShouldRunIssueAutomation[\s\S]*canUseIssueCommandForLinkedItemProvider\(submitLinkedWorkItemProvider\)/ - ) - expect(fullSubmit).toContain('prompt: submitStartupPrompt') - expect(fullSubmit).toContain('const shouldSeedInitialAgentStatus =') - expect(fullSubmit).toContain('...(args.shouldSeedInitialAgentStatus') - - const quickSubmit = - COMPOSER_SOURCE.quickSubmitPreparation + - COMPOSER_SOURCE.quickCreation + - COMPOSER_SOURCE.quickStartup - expect(quickSubmit).toContain('startupPlan.draftPrompt = draftPrompt') - }) - - it('selects the failed Jira source host before opening integration settings', () => { - const section = COMPOSER_SOURCE.navigation - - expect(section).toContain('getTaskSourceRuntimeSettings(') - expect(section).toContain('smartNameJiraSourceContext') - expect(section).toContain('setActiveRuntimeEnvironmentPreference(targetRuntimeEnvironmentId)') - expect(section.indexOf('setActiveRuntimeEnvironmentPreference')).toBeLessThan( - section.indexOf("openSettingsTarget({ pane: 'integrations'") - ) - expect(section).toContain('if (!selected)') - }) - - it('gates per-workspace environment recipe discovery behind the experimental setting', () => { - const recipeLoadSection = COMPOSER_SOURCE.runtimeTarget - expect(recipeLoadSection).toContain('settings?.experimentalEphemeralVms === true') - expect(recipeLoadSection).toContain('useEphemeralVmRecipeOptions') - expect(recipeLoadSection).toContain('enabled: ephemeralVmsEnabled') - expect(RECIPE_OPTIONS_SOURCE).toContain('args.enabled &&') - expect(RECIPE_OPTIONS_SOURCE).toContain('window.api.ephemeralVm') - expect(RECIPE_OPTIONS_SOURCE).toContain('window.api.plugins.onChanged') - expect(RECIPE_OPTIONS_SOURCE).toContain('requestGeneration') - - const submitSection = COMPOSER_SOURCE.quickCreation - expect(submitSection).toContain( - 'const activeEphemeralVmRecipeId = ephemeralVmsEnabled ? selectedEphemeralVmRecipeId : null' - ) - expect(submitSection).toContain('recipeId: activeEphemeralVmRecipeId') - - const cardPropsSection = COMPOSER_SOURCE.cardProps - expect(cardPropsSection).toContain('ephemeralVmRecipes:') - expect(cardPropsSection).toContain('!ephemeralVmsEnabled') - expect(cardPropsSection).toContain('selectedEphemeralVmRecipeId:') - expect(cardPropsSection).toContain('ephemeralVmRecipeError:') - }) }) diff --git a/src/renderer/src/hooks/useSettingsNavigationMetadata.test.ts b/src/renderer/src/hooks/useSettingsNavigationMetadata.test.ts index 12ca698f192e..e0e4761aad00 100644 --- a/src/renderer/src/hooks/useSettingsNavigationMetadata.test.ts +++ b/src/renderer/src/hooks/useSettingsNavigationMetadata.test.ts @@ -1,5 +1,3 @@ -import { readdirSync, readFileSync } from 'node:fs' -import { basename, resolve } from 'node:path' import { describe, expect, it } from 'vitest' import { buildSettingsNavigationMetadata } from './useSettingsNavigationMetadata' import type { Repo } from '../../../shared/repo-types' @@ -405,42 +403,4 @@ describe('settings navigation metadata', () => { expect(ids({ isMac: false })).not.toContain('developer-permissions') expect(ids({ isMac: true })).toContain('developer-permissions') }) - - it('does not import Settings page or pane UI modules from the metadata hook', () => { - const testDir = import.meta.dirname - // Why: the section tables live in sibling settings-navigation-* modules, so reading only the - // hook would scan a file that no longer holds the imports this guard exists to police. - // Walk recursively so a later split that nests the modules cannot shrink this guard. - const sourceFiles = [ - 'useSettingsNavigationMetadata.ts', - ...readdirSync(testDir, { recursive: true, encoding: 'utf8' }).filter( - (name) => basename(name).startsWith('settings-navigation-') && name.endsWith('.ts') - ) - ] - expect(sourceFiles.length).toBeGreaterThan(1) - const importLines = sourceFiles - .flatMap((name) => readFileSync(resolve(testDir, name), 'utf8').split('\n')) - .filter((line) => line.trim().startsWith('import ')) - .join('\n') - - expect(importLines).not.toMatch(/components\/settings\/Settings(?:'|")/) - expect(importLines).not.toMatch(/components\/settings\/[A-Z][A-Za-z]+Pane(?:'|")/) - expect(importLines).not.toMatch(/components\/stats\/StatsPane(?:'|")/) - }) - - it('does not import Settings page or pane UI modules from the quick action registry', () => { - const testDir = import.meta.dirname - const registrySource = readFileSync( - resolve(testDir, '../components/cmd-j/quick-actions.ts'), - 'utf8' - ) - const importLines = registrySource - .split('\n') - .filter((line) => line.trim().startsWith('import ')) - .join('\n') - - expect(importLines).not.toMatch(/components\/settings\/Settings(?:'|")/) - expect(importLines).not.toMatch(/components\/settings\/[A-Z][A-Za-z]+Pane(?:'|")/) - expect(importLines).not.toMatch(/components\/stats\/StatsPane(?:'|")/) - }) }) diff --git a/src/renderer/src/lib/agent-launch-caller-profile-census.test.ts b/src/renderer/src/lib/agent-launch-caller-profile-census.test.ts deleted file mode 100644 index 0b168e66ef4b..000000000000 --- a/src/renderer/src/lib/agent-launch-caller-profile-census.test.ts +++ /dev/null @@ -1,91 +0,0 @@ -// Ties every caller profile back to the call site it characterizes. The behaviour files feed the -// profiles through the real funnel; without this census a call site could change what it passes and -// the behaviour files would keep happily pinning a shape nobody sends any more. - -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' -import { glob } from 'tinyglobby' -import { AGENT_LAUNCH_CALLER_PROFILES } from './agent-launch-caller-profiles-test-harness' - -const REPO_ROOT = join(import.meta.dirname, '../../../..') -const FUNNEL = 'src/renderer/src/lib/launch-agent-in-new-tab.ts' - -async function productionCallers(): Promise { - const files = await glob(['src/**/*.ts', 'src/**/*.tsx'], { - cwd: REPO_ROOT, - ignore: ['**/*.test.ts', '**/*.test.tsx'] - }) - return files - .filter((file) => file !== FUNNEL) - .filter((file) => readFileSync(join(REPO_ROOT, file), 'utf8').includes('launchAgentInNewTab(')) - .sort() -} - -describe('agent launch caller profiles', () => { - it('covers every production call site of the funnel and no phantom one', async () => { - const profiled = AGENT_LAUNCH_CALLER_PROFILES.map((profile) => profile.caller).sort() - - expect(profiled).toEqual(await productionCallers()) - }) - - it('names each profile exactly once', () => { - const ids = AGENT_LAUNCH_CALLER_PROFILES.map((profile) => profile.id) - - expect(new Set(ids).size).toBe(ids.length) - expect(ids.length).toBe(13) - }) - - it.each(AGENT_LAUNCH_CALLER_PROFILES.map((profile) => [profile.id, profile] as const))( - 'keeps %s anchored to the arguments its call site still builds', - (_id, profile) => { - const source = readFileSync(join(REPO_ROOT, profile.caller), 'utf8') - - // Why: a positive control on the instrument — an unreadable or renamed file would otherwise - // make every marker below vacuously "not found" and the assertion would just be noise. - expect(source).toContain('launchAgentInNewTab(') - expect(profile.sourceMarkers.length).toBeGreaterThan(0) - for (const marker of profile.sourceMarkers) { - expect(source).toContain(marker) - } - } - ) - - it.each(AGENT_LAUNCH_CALLER_PROFILES.map((profile) => [profile.id, profile] as const))( - 'records whether %s installs launch callbacks, matching its source', - (_id, profile) => { - const source = readFileSync(join(REPO_ROOT, profile.caller), 'utf8') - - expect(source.includes('beforeSurfaceOpen:')).toBe(profile.passesBeforeSurfaceOpen) - expect(source.includes('agentSessionLaunchPlan,')).toBe(profile.passesLaunchPlan) - expect(source.includes('onPromptDelivered')).toBe(profile.passesOnPromptDelivered) - } - ) - - it('pins which call sites read a tab id straight off the synchronous result', () => { - const readers = AGENT_LAUNCH_CALLER_PROFILES.filter((profile) => - profile.readsBack.includes('surface-tab-id') - ).map((profile) => profile.id) - - // Why: this is the coupling a move to an async launch RPC threatens most directly — these - // call sites cannot tolerate a tab id that only exists after the launch settles. - expect(readers.sort()).toEqual([ - 'empty-workspace-default-chat', - 'fix-checks', - 'floating-default-agent', - 'quick-command', - 'source-control-action', - 'source-control-recovery', - 'tab-bar-create-menu', - 'tab-bar-quick-launch-button' - ]) - }) - - it('pins which call sites await the prompt-delivery promise', () => { - const awaiters = AGENT_LAUNCH_CALLER_PROFILES.filter((profile) => - profile.readsBack.includes('prompt-delivery-result') - ).map((profile) => profile.id) - - expect(awaiters.sort()).toEqual(['session-continuation', 'source-control-action']) - }) -}) diff --git a/src/renderer/src/lib/agent-launch-caller-profiles-test-harness.ts b/src/renderer/src/lib/agent-launch-caller-profiles-test-harness.ts index 5aaa913044fa..a988e1673f5f 100644 --- a/src/renderer/src/lib/agent-launch-caller-profiles-test-harness.ts +++ b/src/renderer/src/lib/agent-launch-caller-profiles-test-harness.ts @@ -7,42 +7,23 @@ import type { LaunchAgentInNewTabArgs } from '@/lib/launch-agent-in-new-tab' * The suite feeds these argument shapes through the real funnel instead of driving twelve caller * module graphs: a migration rewrites the funnel's internals, not what a caller hands it, so the * observable outcome of each caller's argument shape is the thing that must survive. - * - * `sourceMarkers` re-anchors each profile to its call site. A caller that stops passing what the - * profile encodes fails the census rather than silently drifting out of coverage. */ export type CallerLaunchArgs = Omit< LaunchAgentInNewTabArgs, 'beforeSurfaceOpen' | 'agentSessionLaunchPlan' | 'onPromptDelivered' > -export type CallerResultRead = - | 'surface-tab-id' - | 'prompt-delivery-result' - | 'null-only' - | 'discarded' - export type AgentLaunchCallerProfile = { /** Production module that owns this call site. */ caller: string /** Stable id used in test titles so a dropped profile is visible in the report. */ id: string - /** Literal fragments the call site must still contain for this profile to be current. */ - sourceMarkers: readonly string[] /** * The argument object this call site builds. Values the call site derives at runtime (agent, * workspace, prompt text, group) use a representative stand-in; values it fixes as a literal are * reproduced exactly. */ args: CallerLaunchArgs - /** The call site installs a `beforeSurfaceOpen` hook. */ - passesBeforeSurfaceOpen: boolean - /** The call site hands in a route plan preflighted before the workspace existed. */ - passesLaunchPlan: boolean - /** The call site installs an `onPromptDelivered` callback. */ - passesOnPromptDelivered: boolean - /** What the call site reads off the synchronous result. */ - readsBack: readonly CallerResultRead[] } const PROMPT = 'Explain the failing check and propose a fix.' @@ -51,51 +32,30 @@ export const AGENT_LAUNCH_CALLER_PROFILES: readonly AgentLaunchCallerProfile[] = { id: 'dashboard-spawn', caller: 'src/renderer/src/components/dashboard/launch-dashboard-agent.ts', - sourceMarkers: ["launchSource: 'unknown'"], - args: { agent: 'codex', worktreeId: 'wt-1', launchSource: 'unknown' }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: false, - readsBack: ['null-only'] + args: { agent: 'codex', worktreeId: 'wt-1', launchSource: 'unknown' } }, { id: 'empty-workspace-default-chat', caller: 'src/renderer/src/lib/empty-workspace-default-agent-chat.ts', - sourceMarkers: ["launchSource: 'unknown'", 'pendingActivationSpawn: true'], args: { agent: 'codex', worktreeId: 'wt-1', launchSource: 'unknown', pendingActivationSpawn: true - }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: true, - passesOnPromptDelivered: false, - readsBack: ['surface-tab-id'] + } }, { id: 'floating-default-agent', caller: 'src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx', - sourceMarkers: ['worktreeId: FLOATING_TERMINAL_WORKTREE_ID', "launchSource: 'shortcut'"], args: { agent: 'codex', worktreeId: FLOATING_TERMINAL_WORKTREE_ID, launchSource: 'shortcut' - }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: false, - readsBack: ['surface-tab-id'] + } }, { id: 'source-control-action', caller: 'src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.ts', - sourceMarkers: [ - 'groupId: groupId ?? worktreeId', - 'agentArgs: launchAgentArgs', - 'promptDelivery,', - 'launchPlatform,' - ], args: { agent: 'codex', worktreeId: 'wt-1', @@ -106,21 +66,11 @@ export const AGENT_LAUNCH_CALLER_PROFILES: readonly AgentLaunchCallerProfile[] = launchPlatform: 'darwin', // Caller-supplied, not fixed at the call site: one representative value stands in. launchSource: 'sidebar' - }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: false, - readsBack: ['surface-tab-id', 'prompt-delivery-result'] + } }, { id: 'source-control-recovery', caller: 'src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts', - sourceMarkers: [ - 'groupId: activeGroupId ?? activeWorktreeId', - 'agentArgs: savedRecipe.agentArgs', - "promptDelivery: 'submit-after-ready'", - "launchSource: 'source_control_recovery'" - ], args: { agent: 'codex', worktreeId: 'wt-1', @@ -130,36 +80,22 @@ export const AGENT_LAUNCH_CALLER_PROFILES: readonly AgentLaunchCallerProfile[] = promptDelivery: 'submit-after-ready', launchPlatform: 'darwin', launchSource: 'source_control_recovery' - }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: false, - readsBack: ['surface-tab-id'] + } }, { id: 'git-history-explain-commit', caller: 'src/renderer/src/components/right-sidebar/source-control/sync/use-git-history-commit-actions.ts', - sourceMarkers: ['prompt: explainPrompt', "promptDelivery: 'submit-after-ready'"], args: { agent: 'codex', worktreeId: 'wt-1', prompt: PROMPT, promptDelivery: 'submit-after-ready' - }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: false, - readsBack: ['discarded'] + } }, { id: 'tab-bar-quick-launch-button', caller: 'src/renderer/src/components/tab-bar/QuickLaunchButton.tsx', - sourceMarkers: [ - '...(prompt !== undefined ? { prompt } : {})', - '...(promptDelivery !== undefined ? { promptDelivery } : {})', - '...(onPromptDelivered !== undefined ? { onPromptDelivered } : {})' - ], args: { agent: 'codex', worktreeId: 'wt-1', @@ -167,36 +103,21 @@ export const AGENT_LAUNCH_CALLER_PROFILES: readonly AgentLaunchCallerProfile[] = prompt: PROMPT, promptDelivery: 'submit-after-ready', launchSource: 'tab_bar_quick_launch' - }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: true, - readsBack: ['surface-tab-id'] + } }, { id: 'tab-bar-create-menu', caller: 'src/renderer/src/components/tab-bar/use-tab-bar-create-menu-controller.ts', - sourceMarkers: ['groupId: resolvedGroupId', "launchSource: 'tab_bar_quick_launch'"], args: { agent: 'codex', worktreeId: 'wt-1', groupId: 'group-1', launchSource: 'tab_bar_quick_launch' - }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: false, - readsBack: ['surface-tab-id'] + } }, { id: 'terminal-session-fork', caller: 'src/renderer/src/components/terminal-pane/terminal-agent-session-fork.ts', - sourceMarkers: [ - "promptDelivery: 'draft'", - "launchSource: 'terminal_context_menu'", - 'agentSessionLaunchPlan,', - 'beforeSurfaceOpen: (surface) =>' - ], args: { agent: 'codex', worktreeId: 'wt-1', @@ -204,30 +125,16 @@ export const AGENT_LAUNCH_CALLER_PROFILES: readonly AgentLaunchCallerProfile[] = promptDelivery: 'draft', launchSource: 'terminal_context_menu', launchPlatform: 'darwin' - }, - passesBeforeSurfaceOpen: true, - passesLaunchPlan: true, - passesOnPromptDelivered: false, - readsBack: ['null-only'] + } }, { id: 'terminal-create-shortcut', caller: 'src/renderer/src/components/use-terminal-create-actions.ts', - sourceMarkers: ['groupId: targetGroupId', "launchSource: 'shortcut'"], - args: { agent: 'codex', worktreeId: 'wt-1', groupId: 'group-1', launchSource: 'shortcut' }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: false, - readsBack: ['null-only'] + args: { agent: 'codex', worktreeId: 'wt-1', groupId: 'group-1', launchSource: 'shortcut' } }, { id: 'fix-checks', caller: 'src/renderer/src/lib/fix-checks-agent-launch.ts', - sourceMarkers: [ - 'agentArgs: recipe.agentArgs', - "promptDelivery: 'submit-after-ready'", - 'beforeSurfaceOpen: () => {' - ], args: { agent: 'codex', worktreeId: 'wt-1', @@ -238,19 +145,11 @@ export const AGENT_LAUNCH_CALLER_PROFILES: readonly AgentLaunchCallerProfile[] = launchPlatform: 'darwin', // Caller-supplied, not fixed at the call site: one representative value stands in. launchSource: 'task_page' - }, - passesBeforeSurfaceOpen: true, - passesLaunchPlan: false, - passesOnPromptDelivered: false, - readsBack: ['surface-tab-id'] + } }, { id: 'session-continuation', caller: 'src/renderer/src/lib/launch-agent-session-continuation.ts', - sourceMarkers: [ - "promptDelivery: agent === 'claude' ? 'draft' : 'submit-after-ready'", - 'onPromptDelivered: () =>' - ], args: { agent: 'codex', worktreeId: 'wt-1', @@ -260,20 +159,11 @@ export const AGENT_LAUNCH_CALLER_PROFILES: readonly AgentLaunchCallerProfile[] = initialCwd: '/repo/worktree/packages/app', // Caller-supplied, not fixed at the call site: one representative value stands in. launchSource: 'command_palette' - }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: true, - readsBack: ['prompt-delivery-result'] + } }, { id: 'quick-command', caller: 'src/renderer/src/lib/run-quick-command-in-new-tab.ts', - sourceMarkers: [ - "launchSource: 'quick_command'", - 'quickCommandLabel: command.label', - "{ promptDelivery: 'submit-after-ready' as const }" - ], args: { agent: 'codex', worktreeId: 'wt-1', @@ -281,11 +171,7 @@ export const AGENT_LAUNCH_CALLER_PROFILES: readonly AgentLaunchCallerProfile[] = prompt: PROMPT, launchSource: 'quick_command', quickCommandLabel: 'Review' - }, - passesBeforeSurfaceOpen: false, - passesLaunchPlan: false, - passesOnPromptDelivered: false, - readsBack: ['surface-tab-id'] + } } ] diff --git a/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts b/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts deleted file mode 100644 index 2c9524c99957..000000000000 --- a/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' -import { glob } from 'tinyglobby' - -const REPO_ROOT = join(import.meta.dirname, '../../../..') -const CENSUS_FILE = 'src/renderer/src/lib/agent-launch-routing-caller-census.test.ts' - -const LAUNCH_AGENT_IN_NEW_TAB_CALLERS = [ - 'src/renderer/src/components/dashboard/launch-dashboard-agent.ts', - // Joined the funnel rather than appearing beside it: this button used to hand-roll the helper's - // terminal arm against `queueTabStartupCommand`. A line going up here is a converged bypass. - 'src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx', - 'src/renderer/src/components/right-sidebar/runSourceControlAgentActionStart.ts', - 'src/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.ts', - 'src/renderer/src/components/right-sidebar/source-control/sync/use-git-history-commit-actions.ts', - 'src/renderer/src/components/tab-bar/QuickLaunchButton.tsx', - 'src/renderer/src/components/tab-bar/use-tab-bar-create-menu-controller.ts', - 'src/renderer/src/components/terminal-pane/terminal-agent-session-fork.ts', - 'src/renderer/src/components/use-terminal-create-actions.ts', - 'src/renderer/src/lib/empty-workspace-default-agent-chat.ts', - 'src/renderer/src/lib/fix-checks-agent-launch.ts', - 'src/renderer/src/lib/launch-agent-session-continuation.ts', - 'src/renderer/src/lib/run-quick-command-in-new-tab.ts' -] - -// Why: the planner is the one production module that decides a route. A second resolver call -// site is how the seven launch sites drifted apart before it existed. -const ROUTE_RESOLVER_DEFINITION = 'src/renderer/src/lib/agent-launch-routing.ts' -const ROUTE_PLANNER = 'src/renderer/src/lib/agent-session-launch-plan.ts' -const DIRECT_ROUTE_RESOLVER_CALL = /\b(?:resolveAgentLaunchRoute|structuredAgentLaunchSupported)\(/ -// Why: adopting a verdict bypasses the resolver by design (a persisted quick-create request, a -// resume whose gate already planned), so each adopter is pinned rather than trusted by convention. -const VERDICT_ADOPTERS = [ - 'src/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.ts', - 'src/renderer/src/lib/worktree-creation-structured-session.ts' -] - -async function productionFiles(): Promise { - return glob(['src/**/*.ts', 'src/**/*.tsx'], { - cwd: REPO_ROOT, - ignore: ['**/*.test.ts', '**/*.test.tsx', CENSUS_FILE] - }) -} - -describe('agent launch routing caller census', () => { - it('pins every production launchAgentInNewTab caller behind the shared funnel', async () => { - const callers = (await productionFiles()) - .filter((file) => file !== 'src/renderer/src/lib/launch-agent-in-new-tab.ts') - .filter((file) => - readFileSync(join(REPO_ROOT, file), 'utf8').includes('launchAgentInNewTab(') - ) - .sort() - expect(callers).toEqual([...LAUNCH_AGENT_IN_NEW_TAB_CALLERS].sort()) - }) - - it('lets only the planner decide a launch route', async () => { - const directCallers = (await productionFiles()) - .filter((file) => file !== ROUTE_RESOLVER_DEFINITION) - .filter((file) => - DIRECT_ROUTE_RESOLVER_CALL.test(readFileSync(join(REPO_ROOT, file), 'utf8')) - ) - .sort() - expect(directCallers).toEqual([ROUTE_PLANNER]) - }) - - it('pins every production adopter of a planned verdict', async () => { - const adopters = (await productionFiles()) - .filter((file) => file !== ROUTE_PLANNER) - .filter((file) => - readFileSync(join(REPO_ROOT, file), 'utf8').includes('adoptAgentSessionLaunchVerdict(') - ) - .sort() - expect(adopters).toEqual([...VERDICT_ADOPTERS].sort()) - }) - - it('keeps non-visible, resume, and floating launchers intentionally outside the route', () => { - for (const file of [ - 'src/renderer/src/lib/launch-agent-background-session.ts', - 'src/renderer/src/lib/launch-ai-vault-session.ts', - 'src/renderer/src/components/floating-terminal/FloatingTerminalWindowControls.tsx' - ]) { - expect(readFileSync(join(REPO_ROOT, file), 'utf8')).not.toContain('resolveAgentLaunchRoute') - } - }) -}) diff --git a/src/renderer/src/lib/non-secure-context-crypto.repro.test.ts b/src/renderer/src/lib/non-secure-context-crypto.repro.test.ts index ce16d669f16a..87da1737c795 100644 --- a/src/renderer/src/lib/non-secure-context-crypto.repro.test.ts +++ b/src/renderer/src/lib/non-secure-context-crypto.repro.test.ts @@ -20,19 +20,6 @@ afterEach(() => { }) describe('non-secure context (plain HTTP LAN web client)', () => { - it('crypto.randomUUID is undefined, like the browser reports', () => { - // oxlint-disable-next-line no-restricted-properties -- asserting the absence this suite exists for - expect((globalThis.crypto as Crypto).randomUUID).toBeUndefined() - // oxlint-disable-next-line no-restricted-properties -- asserting the absence this suite exists for - expect(() => (globalThis.crypto as Crypto).randomUUID()).toThrow() - }) - - it('hashOrcaHookScript does not throw when crypto.subtle is missing', async () => { - const { hashOrcaHookScript } = await import('./orca-hook-trust') - const hash = await hashOrcaHookScript('echo hi') - expect(hash).toMatch(/^[0-9a-f]+$/) - }) - // The fallback must match the secure-context hash, or the shared trust store // mismatches and the user is re-prompted to approve a hook they already // trusted on the desktop app. @@ -54,9 +41,7 @@ describe('non-secure context (plain HTTP LAN web client)', () => { it('loads the renderer agent-status authority and its store slice', async () => { vi.resetModules() const { rendererAgentStatusObservations } = await import('./renderer-agent-status-observations') - const { createAgentStatusAuthorityActions } = - await import('../store/slices/agent-status-authority-actions') - expect(typeof createAgentStatusAuthorityActions).toBe('function') + await import('../store/slices/agent-status-authority-actions') expect(rendererAgentStatusObservations.getAuthorityId()).toMatch( /^renderer:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/ ) diff --git a/src/renderer/src/lib/react-commit-cascade-telemetry.test.ts b/src/renderer/src/lib/react-commit-cascade-telemetry.test.ts index 89e0456c2ce4..d09337c8d0cd 100644 --- a/src/renderer/src/lib/react-commit-cascade-telemetry.test.ts +++ b/src/renderer/src/lib/react-commit-cascade-telemetry.test.ts @@ -2,7 +2,6 @@ import { beforeEach, describe, expect, it, vi } from 'vitest' import { sanitizeCrashReportDetails } from '../../../shared/crash-report-redaction' import { REACT_NESTED_UPDATE_LIMIT } from '../../../shared/react-update-depth-attribution' import { - REACT_CASCADING_LANES, setReactCommitCascadeRendererSurface, REACT_COMMIT_CASCADE_ARM_COMMITS, REACT_COMMIT_CASCADE_BREADCRUMB, @@ -67,7 +66,6 @@ describe('cascade thresholds', () => { it('derives arm and notice limits from React commit budget', () => { expect(REACT_COMMIT_CASCADE_NOTICE_LIMIT).toBeLessThan(REACT_NESTED_UPDATE_LIMIT) expect(REACT_COMMIT_CASCADE_ARM_COMMITS).toBeLessThan(REACT_COMMIT_CASCADE_NOTICE_LIMIT) - expect(REACT_CASCADING_LANES).toBe(42) }) }) diff --git a/src/renderer/src/lib/structured-agent-startup-label-census.test.ts b/src/renderer/src/lib/structured-agent-startup-label-census.test.ts deleted file mode 100644 index 888e17c46c1e..000000000000 --- a/src/renderer/src/lib/structured-agent-startup-label-census.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' -import { glob } from 'tinyglobby' - -const REPO_ROOT = join(import.meta.dirname, '../../../..') - -describe('structured launch copy', () => { - it('never exposes the removed starting-chat phase or label', async () => { - const files = await glob( - ['src/renderer/src/**/*.ts', 'src/renderer/src/**/*.tsx', 'src/renderer/src/i18n/**/*.json'], - { - cwd: REPO_ROOT, - ignore: ['**/*.test.ts', '**/*.test.tsx'] - } - ) - const offenders = files.filter((file) => { - const source = readFileSync(join(REPO_ROOT, file), 'utf8') - return ( - source.includes('starting-chat') || - source.includes('Starting chat…') || - /Starting (?:\{\{value0\}\}|Claude|Codex) chat…/.test(source) - ) - }) - - expect(offenders).toEqual([]) - }) -}) diff --git a/src/renderer/src/lib/workspace-emoji-shortcodes.lazy.test.ts b/src/renderer/src/lib/workspace-emoji-shortcodes.lazy.test.ts index eafc3e3b2b8c..2e4dfac4a4a8 100644 --- a/src/renderer/src/lib/workspace-emoji-shortcodes.lazy.test.ts +++ b/src/renderer/src/lib/workspace-emoji-shortcodes.lazy.test.ts @@ -1,5 +1,3 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' describe('workspace emoji shortcode index laziness', () => { @@ -20,11 +18,4 @@ describe('workspace emoji shortcode index laziness', () => { expect(shortcodeIndex.searchWorkspaceEmojiShortcodes('tada')[0]?.emoji).toBe('🎉') expect(catalog.isEmojiShortcodeCatalogBuiltForTest()).toBe(true) }) - - it('keeps the exact-shortcode index out of module scope', () => { - const indexSource = readFileSync(join(__dirname, 'workspace-emoji-shortcodes.ts'), 'utf8') - - expect(indexSource).not.toMatch(/^const \w+ = new Map\(/m) - expect(indexSource).not.toContain('STANDARD_EMOJI_SHORTCODE_ENTRIES') - }) }) diff --git a/src/renderer/src/lib/worktree-creation-flow-agent-trust-preflight.test.ts b/src/renderer/src/lib/worktree-creation-flow-agent-trust-preflight.test.ts deleted file mode 100644 index 2a960761900e..000000000000 --- a/src/renderer/src/lib/worktree-creation-flow-agent-trust-preflight.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' - -const FLOW_SOURCE = readFileSync(join(__dirname, 'worktree-creation-flow-execute.ts'), 'utf8') -const PREFLIGHT_SOURCE = readFileSync(join(__dirname, 'agent-trust-preflight.ts'), 'utf8') - -function sourceBetween(source: string, startPattern: string, endPattern: string): string { - const start = source.indexOf(startPattern) - expect(start).toBeGreaterThanOrEqual(0) - const end = source.indexOf(endPattern, start + startPattern.length) - expect(end).toBeGreaterThan(start) - return source.slice(start, end) -} - -describe('worktree creation flow agent trust preflight', () => { - it('forwards the repo SSH connection id when pre-marking terminal agent trust', () => { - const preflight = PREFLIGHT_SOURCE - const createFlow = sourceBetween( - FLOW_SOURCE, - 'const backendSpawned = result.startupTerminal?.spawned === true', - '// `createWorktree` already inserted the real worktree row' - ) - - expect(preflight).toContain('connectionId?: string | null') - expect(preflight).toContain('...(args.connectionId ? { connectionId: args.connectionId } : {})') - expect(createFlow).toContain('repoConnectionId') - expect(createFlow).toContain('repo.id === worktree.repoId') - expect(createFlow).toContain('await preflightAgentTrust({') - expect(createFlow).toContain('connectionId: repoConnectionId') - }) -}) diff --git a/src/renderer/src/lib/worktree-status-spinner-launch-agent.test.ts b/src/renderer/src/lib/worktree-status-spinner-launch-agent.test.ts index 78b71ef25da7..e964a9f28f11 100644 --- a/src/renderer/src/lib/worktree-status-spinner-launch-agent.test.ts +++ b/src/renderer/src/lib/worktree-status-spinner-launch-agent.test.ts @@ -55,18 +55,6 @@ describe('#9040 worktree dot attributes spinner titles to the launched agent', ( expect(status).toBe('working') }) - // Why: pins the #9647 gate — spinner attribution needs a launch identity, so a - // spinner in a tab no agent was launched in cannot spin the dot. - it('stays active for a spinner title with no launch identity', () => { - const status = getWorktreeStatus( - [{ id: 'tab-1', title: '⠐ Review branch for regressions' }], - [], - livePtyMap('tab-1') - ) - - expect(status).toBe('active') - }) - it('does not manufacture activity from a non-spinner title with a launch identity', () => { const status = getWorktreeStatus( [{ id: 'tab-1', title: 'bash', launchAgent: 'claude' }], diff --git a/src/renderer/src/runtime/browser-workspace-tab-close-census.test.ts b/src/renderer/src/runtime/browser-workspace-tab-close-census.test.ts deleted file mode 100644 index 212e9d7afe7e..000000000000 --- a/src/renderer/src/runtime/browser-workspace-tab-close-census.test.ts +++ /dev/null @@ -1,197 +0,0 @@ -import { readdirSync, readFileSync } from 'node:fs' -import { join, relative, sep } from 'node:path' -import { describe, expect, it } from 'vitest' - -// Why: who tears a browser workspace down is a policy, and every close site that decides it alone -// gets it wrong in a different way — the ambiguous multi-owner close fell through silently, the -// pageless host mirror was un-closable, and the menu's Close Tab fired at a host that had never -// heard of a staged tab. Testing planBrowserWorkspaceTabClose in isolation cannot catch the next -// site that skips it, so this census pins every renderer file that closes a browser workspace: -// how often it reaches for the store action, and whether it asks the shared plan first. Adding a -// close anywhere fails this test until it is classified here. -const BROWSER_WORKSPACE_CLOSE_SITES: { - path: string - /** - * Every mention of the identifier, not just call expressions: a renamed destructure or a - * `store['closeBrowserTab']` lookup is still a close site, and matching `closeBrowserTab(` - * walks straight past both. - */ - closeBrowserTabMentions: number - /** How many local teardowns forward the plan's cleanup reason; 0 for sites that skip the plan. */ - planReasonForwardings: number - /** How many closeBrowserTab calls actually pass that reason on; 0 for sites that skip the plan. */ - reasonCarryingCloseCalls: number - routesThroughPlan: boolean - why: string -}[] = [ - { - path: 'src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-lifecycle.ts', - closeBrowserTabMentions: 4, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: false, - why: 'Mirrors a page the host already retired; a plan-driven close would echo it back.' - }, - { - path: 'src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.ts', - closeBrowserTabMentions: 6, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: false, - why: 'Floating workspace tabs are local-only and have no remote owner to reconcile.' - }, - { - path: 'src/renderer/src/components/floating-terminal/use-floating-terminal-panel-store-state.ts', - closeBrowserTabMentions: 3, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: false, - why: 'Passes the local floating-panel close action through its controller.' - }, - { - path: 'src/renderer/src/components/use-terminal-bulk-close-actions.ts', - closeBrowserTabMentions: 3, - reasonCarryingCloseCalls: 1, - planReasonForwardings: 1, - routesThroughPlan: true, - why: 'Bulk terminal-tab teardown plans browser ownership before local cleanup.' - }, - { - path: 'src/renderer/src/components/use-terminal-workspace-store-bindings.ts', - closeBrowserTabMentions: 3, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: false, - why: 'Store binding exposes the close action to terminal controllers.' - }, - { - path: 'src/renderer/src/hooks/ipc-events/browser-request-ipc-bridge.ts', - closeBrowserTabMentions: 3, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: false, - why: 'Host-requested closes are applied locally without echoing a close request.' - }, - { - path: 'src/renderer/src/hooks/ipc-events/session-tab-ipc-bridge.ts', - closeBrowserTabMentions: 2, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: false, - why: 'Host session-tab requests are applied locally without echo.' - }, - { - path: 'src/renderer/src/lib/workspace-browser-tab-close.ts', - closeBrowserTabMentions: 2, - reasonCarryingCloseCalls: 1, - planReasonForwardings: 1, - routesThroughPlan: true, - why: 'All workspace browser teardown funnels through the ownership plan before local cleanup.' - }, - { - path: 'src/renderer/src/runtime/browser-workspace-tab-close.ts', - closeBrowserTabMentions: 1, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: true, - why: 'The funnel disavowal fallback completes teardown when every owning host denies the tab.' - }, - { - path: 'src/renderer/src/runtime/web-runtime-browser-tab-staging.ts', - closeBrowserTabMentions: 1, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: false, - why: 'Rolls back a client-staged row for a create that never reached a host page.' - }, - { - path: 'src/renderer/src/store/slices/browser/browser-close-actions.ts', - closeBrowserTabMentions: 3, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: false, - why: 'Slice-owned shutdown tears down every browser row directly.' - }, - { - path: 'src/renderer/src/store/slices/browser/browser-slice-contract.ts', - closeBrowserTabMentions: 1, - reasonCarryingCloseCalls: 0, - planReasonForwardings: 0, - routesThroughPlan: false, - why: 'The extracted slice contract declares the close action consumed by browser controllers.' - } -] - -function listSourceFiles(dir: string): string[] { - return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => { - const fullPath = join(dir, entry.name) - if (entry.isDirectory()) { - return listSourceFiles(fullPath) - } - // Test harnesses and fixtures stub the store action rather than closing anything. - if ( - !/\.(ts|tsx)$/.test(entry.name) || - /\.test\.(ts|tsx)$/.test(entry.name) || - /-test-(harness|fixtures)\.(ts|tsx)$/.test(entry.name) - ) { - return [] - } - return [fullPath] - }) -} - -// Why: comments are stripped first, so commenting a close call out in place must fail the census -// rather than quietly shrink the count. -function stripComments(source: string): string { - return source.replace(/\/\*[\s\S]*?\*\//g, '').replace(/(^|[^:])\/\/.*$/gm, '$1') -} - -function countCloseBrowserTabMentions(source: string): number { - return stripComments(source).match(/\bcloseBrowserTab\b/g)?.length ?? 0 -} - -describe('browser workspace close census', () => { - it.each(BROWSER_WORKSPACE_CLOSE_SITES)( - '$path mentions closeBrowserTab $closeBrowserTabMentions times, plan-routed: $routesThroughPlan', - ({ path, closeBrowserTabMentions, routesThroughPlan }) => { - const source = stripComments(readFileSync(join(process.cwd(), path), 'utf8')) - expect(countCloseBrowserTabMentions(source)).toBe(closeBrowserTabMentions) - expect(/\bcloseBrowserWorkspaceTabOnHosts\(/.test(source)).toBe(routesThroughPlan) - } - ) - - it('lists every renderer file that closes a browser workspace', () => { - const root = join(process.cwd(), 'src/renderer') - const closers = listSourceFiles(root) - .filter((filePath) => countCloseBrowserTabMentions(readFileSync(filePath, 'utf8')) > 0) - .map((filePath) => relative(process.cwd(), filePath).split(sep).join('/')) - .sort() - expect(closers).toEqual(BROWSER_WORKSPACE_CLOSE_SITES.map((site) => site.path).sort()) - }) - - // Why: the plan is only an authority if its consumers actually run its local teardown. A site - // that reads the plan and then closes on its own terms is the same divergence with extra steps. - // Bound to the forwarding expression itself — merely mentioning localCloseReason is not wiring, - // and Terminal.tsx's two sites have no behavior test to catch it going missing. - it('every plan-routed site forwards the plan cleanup reason into its local teardown', () => { - const forwardsReason = - /plan\.localCloseReason\s*\?\s*\{\s*reason:\s*plan\.localCloseReason\s*\}\s*:\s*undefined/g - // Why: the expression existing somewhere in the file is not the wiring — a call that drops it on - // the floor reads identically. Both halves are pinned: the reason is computed, and the close - // calls carry it. - const carriesReason = - /closeBrowserTab\(\s*[^()]*?(?:[Cc]loseOptions|plan\.localCloseReason)[^()]*?\)/g - for (const site of BROWSER_WORKSPACE_CLOSE_SITES) { - const source = stripComments(readFileSync(join(process.cwd(), site.path), 'utf8')) - expect({ - path: site.path, - forwards: source.match(forwardsReason)?.length ?? 0, - carrying: source.match(carriesReason)?.length ?? 0 - }).toEqual({ - path: site.path, - forwards: site.planReasonForwardings, - carrying: site.reasonCarryingCloseCalls - }) - } - }) -}) diff --git a/src/renderer/src/runtime/host-session-mirror-settle-census.test.ts b/src/renderer/src/runtime/host-session-mirror-settle-census.test.ts deleted file mode 100644 index 7d6a0eadc3e3..000000000000 --- a/src/renderer/src/runtime/host-session-mirror-settle-census.test.ts +++ /dev/null @@ -1,256 +0,0 @@ -/** - * Registry test for the host-session-mirror settle seam. Four review rounds - * each found a NEW call site settling the latch out of order with its store - * patch, so the seam is enforced structurally: a settle exists only as the - * receipt of a landed patch (or as the audited stale-frame exception), and a - * new patch or settle site fails this census until it adopts that contract. - */ - -import { readdirSync, readFileSync, statSync } from 'node:fs' -import { join, relative, sep } from 'node:path' -import { describe, expect, it } from 'vitest' - -const RENDERER_SRC = join(import.meta.dirname, '..') - -const SETTLE_RULE = [ - 'The mirror latch settles EXACTLY when evidence reached the store.', - 'applyWebSessionTabsStorePatch returns the settle receipt for its own patch:', - 'capture it and invoke it after the frame finishes recovery. A frame whose', - 'patch wrote nothing settles through hostSessionMirrorSettleForPatchlessFrame,', - 'and ONLY on a decision carrying settlesHostMirror — a rejection backed by the', - 'equal/newer view already accepted into the store. Never derive that from a', - 'bare boolean: "the mirror never writes this workspace" is also a rejection,', - 'and settling on it drains parked resume work against state nobody wrote.', - 'A captured receipt that is never invoked wedges its pane instead, so every', - 'receipt has to reach a call. Never call markHostSessionMirror*Hydrated from', - 'feature code, and never add a boolean that remembers "the patch landed" —', - 'that ordering bug shipped four times. If you added a legitimate new site,', - 'update this census deliberately.' -].join(' ') - -/** Receipt-minting calls. Every one owes its caller an invocation. */ -const RECEIPT_CALLS = [ - 'applyWebSessionTabsStorePatch(', - 'hostSessionMirrorSettleForPatchlessFrame(' -] as const - -/** - * The binding a receipt was captured into, read backwards from the call. - * TypeScript cannot express a must-call obligation and the invocation is - * deliberately deferred to after `finishRecovery`, so this stays textual: - * an unrecognised capture shape fails rather than passing unaudited. - */ -function receiptBindingName(before: string): string | null { - const lines = before.split('\n') - for (let line = lines.length - 1; line >= 0 && line > lines.length - 8; line -= 1) { - const match = /\b(?:const|let|var)?\s*([A-Za-z_$][\w$]*)\s*(?::[^=]*?)?=(?![=>])/.exec( - lines[line]! - ) - if (match) { - return match[1]! - } - } - return null -} - -function productionSources(): { path: string; source: string }[] { - const sources: { path: string; source: string }[] = [] - const walk = (dir: string): void => { - for (const entry of readdirSync(dir)) { - const path = join(dir, entry) - if (statSync(path).isDirectory()) { - walk(path) - continue - } - if (!/\.(ts|tsx)$/.test(entry) || /\.test\.|\.d\.ts$/.test(entry)) { - continue - } - sources.push({ - path: relative(RENDERER_SRC, path).split(sep).join('/'), - source: readFileSync(path, 'utf8') - }) - } - } - walk(RENDERER_SRC) - return sources -} - -function countOccurrences(source: string, needle: string): number { - let count = 0 - for ( - let index = source.indexOf(needle); - index !== -1; - index = source.indexOf(needle, index + 1) - ) { - count += 1 - } - return count -} - -describe('host-session-mirror settle census', () => { - const sources = productionSources() - - it('mirror marks are reachable only through the settle receipts', () => { - const markCounts: Record = {} - for (const { path, source } of sources) { - const hydrated = countOccurrences(source, 'markHostSessionMirrorHydrated(') - const worktreeHydrated = countOccurrences(source, 'markHostSessionMirrorWorktreeHydrated(') - if (hydrated + worktreeHydrated > 0) { - markCounts[path] = { hydrated, worktreeHydrated } - } - } - expect(markCounts, SETTLE_RULE).toEqual({ - // The definitions themselves. - 'runtime/host-session-mirror-hydration.ts': { hydrated: 1, worktreeHydrated: 1 }, - // Exactly the receipt constructors: the patch receipt (environment-wide - // and per-worktree) and the stale-frame receipt. The environment-wide - // mark has three audited arms, all inside the receipt: an authoritative - // empty inventory, a non-empty inventory, and an empty inventory that - // settles only after `terminal.list` says the host has no live PTY — - // `0 === 0` is not host evidence (STA-5377). - 'runtime/web-session-tabs-sync/mirror-settle.ts': { hydrated: 3, worktreeHydrated: 2 } - }) - }) - - it('every store patch call site captures its settle receipt', () => { - const needle = 'applyWebSessionTabsStorePatch(' - const callSites: Record = {} - for (const { path, source } of sources) { - let calls = 0 - for ( - let index = source.indexOf(needle); - index !== -1; - index = source.indexOf(needle, index + 1) - ) { - const before = source.slice(0, index).trimEnd() - if (before.endsWith('function')) { - continue // The definition. - } - calls += 1 - // A receipt is captured when the call is an expression consumed by an - // assignment, return, ternary, or argument — never a bare statement. - const capturedBy = before.slice(-1) - expect( - ['=', '(', ',', '?', ':', '{'].includes(capturedBy) || before.endsWith('return'), - `${path} discards the settle receipt of applyWebSessionTabsStorePatch. ${SETTLE_RULE}` - ).toBe(true) - } - if (calls > 0) { - callSites[path] = calls - } - } - expect(callSites, SETTLE_RULE).toEqual({ - // Initial listAll, visibility-resume repair, full inventory, global - // singular frame, and scoped active frame are owned by these extracted - // recovery/event modules. - 'runtime/web-session-tabs-sync/active-session-subscription.ts': 1, - 'runtime/web-session-tabs-sync/global-session-events.ts': 1, - 'runtime/web-session-tabs-sync/global-session-inventory-event.ts': 1, - 'runtime/web-session-tabs-sync/load-initial.ts': 1, - 'runtime/web-session-tabs-sync/visibility-resume-repair.ts': 1, - // The eager post-create session.tabs.list refresh. - 'runtime/web-runtime-session-snapshot.ts': 1, - // The local structured-session mirror owns two: the inventory/subscription - // frame, and the toggle-off teardown that retracts the tabs it published. - 'runtime/local-structured-session-tabs-sync/snapshot-apply.ts': 2 - }) - }) - - it('every captured settle receipt reaches an invocation', () => { - const receiptBindings: Record> = {} - for (const { path, source } of sources) { - for (const needle of RECEIPT_CALLS) { - for ( - let index = source.indexOf(needle); - index !== -1; - index = source.indexOf(needle, index + 1) - ) { - const before = source.slice(0, index).trimEnd() - if (before.endsWith('function')) { - continue // The definition. - } - const name = receiptBindingName(before) - expect( - name, - `${path} captures a settle receipt in a shape this census cannot follow. ${SETTLE_RULE}` - ).not.toBeNull() - // The obligation is discharged by the next call of the same binding — - // a fresh declaration of that name in between means the call belongs - // to another receipt, so this one was dropped. - const rest = source.slice(index + needle.length) - const invocation = new RegExp(`\\b${name}\\s*(?:\\?\\.)?\\(`).exec(rest) - const redeclared = - invocation !== null && - new RegExp(`\\b(?:let|const|var)\\s+${name}\\b`).test(rest.slice(0, invocation.index)) - expect( - invocation !== null && !redeclared, - `${path} never invokes the settle receipt it captured into \`${name}\`. ${SETTLE_RULE}` - ).toBe(true) - const bindings = (receiptBindings[path] ??= {}) - bindings[name!] = (bindings[name!] ?? 0) + 1 - } - } - } - // Pinning the resolved names keeps the rule from going vacuous: a binding - // this census misreads settles on some other identifier's invocation. - expect(receiptBindings, SETTLE_RULE).toEqual({ - // Hydration and mirror receipts remain pinned by their extracted owners: - // the global singular frame owns two hydration completions and the global - // inventory frame one, initial loading owns one, active subscription owns - // two mirror settles, and visibility resume repair owns one. The local - // structured-session apply module owns one settle per direction: the - // snapshot it mirrors in, and the teardown that retracts it. - 'runtime/web-session-tabs-sync/active-session-subscription.ts': { settle: 2 }, - 'runtime/web-session-tabs-sync/global-session-events.ts': { settleHydration: 2 }, - 'runtime/web-session-tabs-sync/global-session-inventory-event.ts': { settleHydration: 1 }, - 'runtime/web-session-tabs-sync/load-initial.ts': { settleHydration: 1 }, - 'runtime/web-session-tabs-sync/visibility-resume-repair.ts': { settle: 1 }, - 'runtime/web-runtime-session-snapshot.ts': { settleMirror: 1 }, - 'runtime/local-structured-session-tabs-sync/snapshot-apply.ts': { - settleStructuredSessionClear: 1, - settleStructuredSessionMirror: 1 - } - }) - }) - - it('the patchless settle appears only at its audited sites', () => { - const patchlessCounts: Record = {} - for (const { path, source } of sources) { - const count = countOccurrences(source, 'hostSessionMirrorSettleForPatchlessFrame(') - if (count > 0) { - patchlessCounts[path] = count - } - } - expect(patchlessCounts, SETTLE_RULE).toEqual({ - // The definition, the global singular frame, and the scoped active frame. - 'runtime/web-session-tabs-sync/active-session-subscription.ts': 1, - 'runtime/web-session-tabs-sync/global-session-events.ts': 1, - 'runtime/web-session-tabs-sync/mirror-settle.ts': 1 - }) - }) - - it('only the audited decisions grant a rejected frame a settle', () => { - const settlingCounts: Record = {} - const silentCounts: Record = {} - for (const { path, source } of sources) { - const settling = countOccurrences(source, 'settlesHostMirror: true') - const silent = countOccurrences(source, 'settlesHostMirror: false') - if (settling > 0) { - settlingCounts[path] = settling - } - if (silent > 0) { - silentCounts[path] = silent - } - } - // A new decision has to be minted here, and minting one forces its author - // to say whether the frame is host evidence — the whole point of the pair. - expect(settlingCounts, SETTLE_RULE).toEqual({ - // The applied frame (its own patch) and the outranked one (the accepted view). - 'runtime/web-session-tabs-sync/tracking-decisions.ts': 2 - }) - expect(silentCounts, SETTLE_RULE).toEqual({ - // The unmirrored frame: no accepted view of it ever reached the store. - 'runtime/web-session-tabs-sync/tracking-decisions.ts': 1 - }) - }) -}) diff --git a/src/renderer/src/runtime/remote-server-parity.test.ts b/src/renderer/src/runtime/remote-server-parity.test.ts index 7c1bcf9bb687..c9779332f666 100644 --- a/src/renderer/src/runtime/remote-server-parity.test.ts +++ b/src/renderer/src/runtime/remote-server-parity.test.ts @@ -210,29 +210,6 @@ describe('parity §3: remote terminal create appends rightmost (matches local)', toWebTerminalSurfaceTabId('host-tab-3') ]) }) - - it('preserves existing relative order when adding (no reshuffle)', () => { - const prior = stateWithLocalTerminals([ - localTerminal('host-tab-1', 0, false), - localTerminal('host-tab-2', 1, true) - ]) - recordWebSessionFocusIntent({ environmentId: ENV }, WT, `host-tab-3::${LEAF_C}`) - const patch = applyWebSessionTabsSnapshot( - prior, - makeSnapshot([ - { parentTab: 'host-tab-1', leaf: LEAF_A, active: false }, - { parentTab: 'host-tab-2', leaf: LEAF_B, active: false }, - { parentTab: 'host-tab-3', leaf: LEAF_C, active: true } - ]), - ENV, - NOW + 10 - ) as Partial - expect(groupOrder(patch)).toEqual([ - toWebTerminalSurfaceTabId('host-tab-1'), - toWebTerminalSurfaceTabId('host-tab-2'), - toWebTerminalSurfaceTabId('host-tab-3') - ]) - }) }) // ────────────────────────────────────────────────────────────────────────── @@ -422,24 +399,3 @@ describe('parity §11: remote browser create focuses the new browser tab', () => expect(nextType).toBe('terminal') }) }) - -// ────────────────────────────────────────────────────────────────────────── -// Plan §1 — Lifecycle: an emptied host snapshot does not bootstrap phantom tabs -// when local terminals already exist (sleep/disconnect must not invent state). -// ────────────────────────────────────────────────────────────────────────── -describe('parity §1: empty host snapshot does not fabricate tabs', () => { - it('an empty snapshot with existing local terminals does not add a phantom tab', () => { - const prior = stateWithLocalTerminals([localTerminal('host-tab-1', 0, true)]) - const patch = applyWebSessionTabsSnapshot( - prior, - makeSnapshot([], { activeTabId: null, activeTabType: null }), - ENV, - NOW + 10 - ) as Partial - // No new fabricated terminal ids beyond what existed. - const order = groupOrder(patch) - for (const id of order) { - expect(id).toBe(toWebTerminalSurfaceTabId('host-tab-1')) - } - }) -}) diff --git a/src/renderer/src/runtime/runtime-host-contact-parity.test.ts b/src/renderer/src/runtime/runtime-host-contact-parity.test.ts index a24e963a1d97..83e152cd8996 100644 --- a/src/renderer/src/runtime/runtime-host-contact-parity.test.ts +++ b/src/renderer/src/runtime/runtime-host-contact-parity.test.ts @@ -10,16 +10,6 @@ import { runtimeHostContactFromSnapshot } from '../../../shared/runtime-host-contact' import type { RuntimeStatus } from '../../../shared/runtime-types' -import { - runtimeHostConnectionState, - runtimeHostConnectionStateForEntry, - type RuntimeHostConnectionState -} from './runtime-host-connection-state' - -// This file exists to prove the contact introduced here changes nothing. It carries a frozen copy -// of the derivation as it stood before, and asserts the shipping one agrees with it on every -// combination of the inputs it reads. A behaviour change would have to survive the whole -// cross-product to go unnoticed, which is a much harder thing to do by accident than to argue. type Entry = { status: RuntimeStatus | null @@ -27,33 +17,6 @@ type Entry = { snapshot?: RuntimeHostStatusSnapshot } -/** The derivation exactly as it read before `RuntimeHostContact` existed. Do not refactor. */ -function legacyRuntimeHostConnectionStateForEntry( - entry: Entry | null | undefined -): RuntimeHostConnectionState { - const snapshot = entry?.snapshot - if (snapshot) { - if (snapshot.retired || snapshot.verification === 'blocked') { - return 'disconnected' - } - if (snapshot.transport === 'disconnected') { - return 'reconnecting' - } - if (snapshot.verification === 'checking' && !entry?.status) { - return 'checking' - } - if (snapshot.transport === 'ready' && snapshot.verification !== 'verified') { - return 'runtime-unavailable' - } - } - return runtimeHostConnectionState({ - hasStatusEntry: Boolean(entry), - status: entry?.status ?? null, - ...(snapshot?.transport === 'connecting' ? { transportStatus: 'checking' as const } : {}), - remoteControl: entry?.remoteControl ?? entry?.status?.remoteControl ?? null - }) -} - const VERIFICATIONS = ['checking', 'verified', 'unavailable', 'blocked'] as const const TRANSPORTS = ['unknown', 'connecting', 'ready', 'disconnected'] as const const RETIRED = [false, true] as const @@ -138,38 +101,7 @@ function* everySnapshotEntry(): Generator<{ label: string; entry: Entry }> { } } -describe('the host contact changes no verdict', () => { - it('agrees with the frozen derivation on every snapshot combination', () => { - const cases = [...everySnapshotEntry()] - // Guard against the enumeration silently collapsing: 4 x 4 x 2 x 2 x 6. - expect(cases).toHaveLength(384) - const disagreements = cases - .map(({ label, entry }) => ({ - label, - now: runtimeHostConnectionStateForEntry(entry), - before: legacyRuntimeHostConnectionStateForEntry(entry) - })) - .filter(({ now, before }) => now !== before) - expect(disagreements).toEqual([]) - }) - - it('agrees for entries that carry no snapshot at all', () => { - const entries: (Entry | null | undefined)[] = [ - null, - undefined, - { status: null }, - { status: makeStatus() }, - { status: null, remoteControl: makeRemoteControl('closed') }, - { status: null, remoteControl: makeRemoteControl('ready') }, - { status: makeStatus({ remoteControl: makeRemoteControl('reconnecting') }) } - ] - for (const entry of entries) { - expect(runtimeHostConnectionStateForEntry(entry)).toBe( - legacyRuntimeHostConnectionStateForEntry(entry) - ) - } - }) - +describe('the revoked predicate and the contact verdict stay in step', () => { it('keeps the revoked predicate and the contact verdict in step', () => { for (const { label, entry } of everySnapshotEntry()) { expect( diff --git a/src/renderer/src/store/slices/github-pr-comments.test.ts b/src/renderer/src/store/slices/github-pr-comments.test.ts index 8432f944fd41..b78fe1589f6a 100644 --- a/src/renderer/src/store/slices/github-pr-comments.test.ts +++ b/src/renderer/src/store/slices/github-pr-comments.test.ts @@ -234,62 +234,6 @@ describe('createGitHubSlice.fetchPRComments', () => { vi.useRealTimers() } }) - - it('preserves cached checks when the checks IPC fails', async () => { - const store = createTestStore() - const repoPath = '/repo' - const branch = 'feature/test' - const checksCacheKey = `${repoPath}::pr-checks::12` - const cachedChecks = [ - { name: 'build', status: 'completed', conclusion: 'failure', url: null } as const - ] - - store.setState({ - checksCache: { - [checksCacheKey]: { - data: cachedChecks, - fetchedAt: 1, - headSha: 'abc123head' - } - } - } as unknown as Partial) - mockApi.gh.prChecks.mockRejectedValueOnce(new Error('rate limited')) - - await expect( - store.getState().fetchPRChecks(repoPath, 12, branch, 'abc123head', null, { force: true }) - ).resolves.toEqual(cachedChecks) - - expect(store.getState().checksCache[checksCacheKey]?.data).toEqual(cachedChecks) - expect(store.getState().checksCache[checksCacheKey]?.fetchedAt).toBe(1) - }) - - it('does not return cached checks for a different requested head SHA after IPC failure', async () => { - const store = createTestStore() - const repoPath = '/repo' - const branch = 'feature/test' - const checksCacheKey = `${repoPath}::pr-checks::12` - const oldHeadChecks = [ - { name: 'build', status: 'completed', conclusion: 'success', url: null } as const - ] - - store.setState({ - checksCache: { - [checksCacheKey]: { - data: oldHeadChecks, - fetchedAt: 1, - headSha: 'old-head' - } - } - } as unknown as Partial) - mockApi.gh.prChecks.mockRejectedValueOnce(new Error('rate limited')) - - await expect( - store.getState().fetchPRChecks(repoPath, 12, branch, 'new-head', null, { force: true }) - ).resolves.toEqual([]) - - expect(store.getState().checksCache[checksCacheKey]?.data).toEqual(oldHeadChecks) - expect(store.getState().checksCache[checksCacheKey]?.headSha).toBe('old-head') - }) }) describe('createGitHubSlice PR comment mutations', () => { diff --git a/src/renderer/src/store/slices/github-work-items-query-bounds.test.ts b/src/renderer/src/store/slices/github-work-items-query-bounds.test.ts deleted file mode 100644 index 40b89fdd4d5b..000000000000 --- a/src/renderer/src/store/slices/github-work-items-query-bounds.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { describe, expect, it } from 'vitest' - -import { - GITHUB_WORK_ITEMS_QUERY_MAX_BYTES, - isGitHubWorkItemsQueryTooLarge -} from './github-work-items-query-bounds' - -describe('GitHub work item query bounds', () => { - it('allows normal GitHub search syntax', () => { - expect(isGitHubWorkItemsQueryTooLarge('is:pr is:open label:bug')).toBe(false) - }) - - it('rejects oversized pasted work item queries', () => { - expect(isGitHubWorkItemsQueryTooLarge('x'.repeat(GITHUB_WORK_ITEMS_QUERY_MAX_BYTES))).toBe( - false - ) - expect(isGitHubWorkItemsQueryTooLarge('x'.repeat(GITHUB_WORK_ITEMS_QUERY_MAX_BYTES + 1))).toBe( - true - ) - }) - - it('measures UTF-8 bytes for non-ASCII query text', () => { - expect(isGitHubWorkItemsQueryTooLarge(String.fromCodePoint(0x1f600).repeat(3_000))).toBe(true) - }) -}) diff --git a/src/renderer/src/store/slices/linear-invalidation.test.ts b/src/renderer/src/store/slices/linear-invalidation.test.ts index febf6bc222fa..59c0bd666c64 100644 --- a/src/renderer/src/store/slices/linear-invalidation.test.ts +++ b/src/renderer/src/store/slices/linear-invalidation.test.ts @@ -136,35 +136,6 @@ describe('createLinearSlice invalidation', () => { ).toMatchObject({ items: [{ id: 'LIST' }] }) }) - it('caches teams by workspace and dedupes fresh reads', async () => { - const store = createTestStore() - linearListTeams.mockResolvedValueOnce([team('team-1')]) - - await expect(store.getState().listLinearTeams('workspace-1')).resolves.toMatchObject([ - { id: 'team-1' } - ]) - await expect(store.getState().listLinearTeams('workspace-1')).resolves.toMatchObject([ - { id: 'team-1' } - ]) - - expect(linearListTeams).toHaveBeenCalledTimes(1) - expect(store.getState().getCachedLinearTeams('workspace-1')).toMatchObject([{ id: 'team-1' }]) - }) - - it('patches issue-cache entries keyed by workspace-qualified ids', () => { - const store = createTestStore() - store.setState({ - linearIssueCache: { - 'workspace-1::issue-id': { data: issue('issue-id'), fetchedAt: Date.now() } - } - }) - - store.getState().patchLinearIssue('issue-id', { title: 'Updated' }) - - expect(store.getState().linearIssueCache['workspace-1::issue-id'].data?.title).toBe('Updated') - expect(store.getState().linearIssueCache['workspace-1::issue-id'].fetchedAt).toBe(0) - }) - it('refreshing a linked Linear issue invalidates stale issue collection caches', async () => { const store = createTestStore() linearGetIssue.mockResolvedValueOnce(issue('issue-id')) diff --git a/src/renderer/src/store/slices/repo-identity-reconcile.test.ts b/src/renderer/src/store/slices/repo-identity-reconcile.test.ts index 43afafe717fc..703ff4833060 100644 --- a/src/renderer/src/store/slices/repo-identity-reconcile.test.ts +++ b/src/renderer/src/store/slices/repo-identity-reconcile.test.ts @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest' -import fs from 'node:fs' import type { Repo } from '../../../../shared/repo-types' import { reconcileFetchedRepos, reuseEqualRecordMap } from './repo-identity-reconcile' @@ -119,8 +118,6 @@ describe('reconcileFetchedRepos', () => { expect(result).toBe(previous) expect(result.every((repo, index) => repo === previous[index])).toBe(true) - const source = fs.readFileSync(new URL('./repo-identity-reconcile.ts', import.meta.url), 'utf8') - expect(source).not.toMatch(/previous\.find|next\.find|findIndex/) }) }) diff --git a/src/renderer/src/store/slices/runtime-host-status-entry-parity.test.ts b/src/renderer/src/store/slices/runtime-host-status-entry-parity.test.ts deleted file mode 100644 index 63c3de2e7087..000000000000 --- a/src/renderer/src/store/slices/runtime-host-status-entry-parity.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -// The store's host-status entry is one shape, and every reader of the map has to accept exactly -// it. A narrower local copy still typechecks against the store — the fields it is missing are all -// optional — so it freezes at the vintage it was written at and never fails. #17710 added -// `remoteControl` and #20003 added `snapshot`; the copies these assertions cover were not updated -// either time. Like the other typed-contract tests, they fail at typecheck, not at runtime. -import { describe, expectTypeOf, it } from 'vitest' -import type { buildExecutionHostRegistry } from '../../../../shared/execution-host-registry' -import type { buildSidebarHostOptions } from '@/components/sidebar/sidebar-host-options' -import type { getRuntimeAutomationAvailability } from '@/components/automations/automation-target-availability' -import type { getRuntimeSourceHostAvailability } from '@/components/automations/automation-source-context' -import type { AutomationListLocalRowProps } from '@/components/automations/AutomationListLocalRow' -import type { AutomationsListPanelProps } from '@/components/automations/AutomationsListPanel' -import type { RuntimeEnvironmentStatus } from './runtime-status-types' - -// Compare the entry each reader accepts rather than the surrounding map, so a mismatch names the -// field that drifted instead of every ReadonlyMap method signature. -type AcceptedEntry = NonNullable extends ReadonlyMap ? TEntry : never - -type RegistryEntry = AcceptedEntry< - Parameters[0]['runtimeStatusByEnvironmentId'] -> -type SidebarEntry = AcceptedEntry< - Parameters[0]['runtimeStatusByEnvironmentId'] -> -type AutomationEntry = AcceptedEntry[1]> -type SourceContextEntry = AcceptedEntry[1]> -type LocalRowEntry = AcceptedEntry -type ListPanelEntry = AcceptedEntry - -describe('every reader of the runtime host status map accepts the store entry', () => { - it('holds for the execution-host registry', () => { - expectTypeOf().toEqualTypeOf() - }) - - it('holds for the sidebar host options', () => { - expectTypeOf().toEqualTypeOf() - }) - - it('holds for runtime automation availability', () => { - expectTypeOf().toEqualTypeOf() - }) - - // These three only forward the map, which is exactly how a stale copy survives: nothing they - // do with it can fail, so the drift surfaces in whatever they hand it to. - it('holds for the automation source-context reader', () => { - expectTypeOf().toEqualTypeOf() - }) - - it('holds for the automation list row', () => { - expectTypeOf().toEqualTypeOf() - }) - - it('holds for the automations list panel', () => { - expectTypeOf().toEqualTypeOf() - }) -}) diff --git a/src/renderer/src/web/web-runtime-client-export-parity.test.ts b/src/renderer/src/web/web-runtime-client-export-parity.test.ts deleted file mode 100644 index 6ba87eaad36d..000000000000 --- a/src/renderer/src/web/web-runtime-client-export-parity.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { expect, expectTypeOf, it } from 'vitest' -import type { WebPairingOffer } from './web-pairing' -import * as WebClient from './web-runtime-client' - -it('keeps the paired-web client public export surface exact', () => { - expectTypeOf().toEqualTypeOf() - expectTypeOf().toEqualTypeOf() - expectTypeOf>().toEqualTypeOf< - [ - pairing: WebPairingOffer, - options?: ConstructorParameters[1] - ] - >() - expectTypeOf().toEqualTypeOf< - 'call' | 'close' | 'subscribe' | 'statusOwner' - >() - expect(Object.keys(WebClient)).toEqual(['WebRuntimeClient']) -}) diff --git a/src/shared/child-process/child-process-import-boundary.test.ts b/src/shared/child-process/child-process-import-boundary.test.ts index e5c1d3621126..f7d78c9f84b5 100644 --- a/src/shared/child-process/child-process-import-boundary.test.ts +++ b/src/shared/child-process/child-process-import-boundary.test.ts @@ -23,14 +23,6 @@ const CHILD_PROCESS_IMPORT_ALLOWLIST: readonly string[] = readFileSync( .map((line) => line.trim()) .filter((line) => line.length > 0 && !line.startsWith('#')) -/** - * The true count of files importing child_process directly. - * - * May only ever be DECREASED, and only by migrating a file off - * `node:child_process`. Raising it is never the fix. - */ -const DIRECT_IMPORTER_PIN = 149 - const IMPORT_PATTERN = /(?:from\s+['"]node:child_process['"]|from\s+['"]child_process['"]|require\(\s*['"]node:child_process['"]|require\(\s*['"]child_process['"])/ @@ -118,23 +110,4 @@ describe('child_process import boundary', () => { const stale = CHILD_PROCESS_IMPORT_ALLOWLIST.filter((path) => !offenders.includes(path)) expect(stale, 'Allowlist entry no longer imports child_process — delete the line.').toEqual([]) }) - - it('holds the offender count at the pin', () => { - // Bounding by the allowlist's own length proves nothing: the two move - // together, so a swap (one file migrated off, one new file added with its - // entry) kept the bound satisfied. The pin is a literal for that reason. - expect( - offenders.length, - `${offenders.length} files import child_process directly; the pin is ${DIRECT_IMPORTER_PIN}. ` + - 'Never raise the pin -- migrate the file to runProcess/spawnProcess from ' + - 'src/shared/child-process instead.' - ).toBeLessThanOrEqual(DIRECT_IMPORTER_PIN) - // A pin left above reality is how a ratchet rots: it re-opens room for the - // next direct import to land for free. - expect( - offenders.length, - `Only ${offenders.length} files import child_process directly. Lower DIRECT_IMPORTER_PIN to ` + - `${offenders.length} to keep the ground you just took.` - ).toBeGreaterThanOrEqual(DIRECT_IMPORTER_PIN) - }) }) diff --git a/src/shared/emoji-shortcode-catalog.lazy.test.ts b/src/shared/emoji-shortcode-catalog.lazy.test.ts index dc05160696b1..f46e0e742aa0 100644 --- a/src/shared/emoji-shortcode-catalog.lazy.test.ts +++ b/src/shared/emoji-shortcode-catalog.lazy.test.ts @@ -1,5 +1,3 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' import { beforeEach, describe, expect, it, vi } from 'vitest' import emojiShortcodes from 'emojibase-data/en/shortcodes/emojibase.json' @@ -29,37 +27,4 @@ describe('emoji shortcode catalog laziness', () => { expect(catalog.replaceKnownEmojiWithShortcodes('ship \u{1F389}')).toBe('ship party ') expect(catalog.isEmojiShortcodeCatalogBuiltForTest()).toBe(true) }) - - it('leaves the main-process worktree namer importing only the deferred entry points', () => { - // A cross-project import would drag src/main into the shared tsconfig, so assert on source. - const worktreeLogic = readFileSync(join(__dirname, '../main/ipc/worktree-logic.ts'), 'utf8') - const catalogImport = worktreeLogic.match( - /import \{([^}]*)\} from '[^']*emoji-shortcode-catalog'/ - ) - - expect(catalogImport?.[1].split(',').map((name) => name.trim())).toEqual([ - 'replaceKnownEmojiWithShortcodes', - 'setEmojiShortcodeDatasetLoader' - ]) - }) - - it('keeps the catalog build out of module scope', () => { - const sharedSource = readFileSync(join(__dirname, 'emoji-shortcode-catalog.ts'), 'utf8') - - // A module-scope `const X = ` is the regression this guards. - expect(sharedSource).not.toMatch(/^const \w+ = Object\.entries\(/m) - expect(sharedSource).not.toMatch(/^const \w+ = new (?:Map|Intl\.Segmenter)\(/m) - expect(sharedSource).toContain('function loadCatalog()') - }) - - it('keeps the 166 KB dataset off every module main statically imports', () => { - const sharedSource = readFileSync(join(__dirname, 'emoji-shortcode-catalog.ts'), 'utf8') - const worktreeLogic = readFileSync(join(__dirname, '../main/ipc/worktree-logic.ts'), 'utf8') - - // A static `emojibase-data` import anywhere main reaches inlines the dataset into - // out/main/index.js and JSON.parses it on every launch. - const staticDatasetImport = /\bfrom '[^']*emojibase-data[^']*'/ - expect(sharedSource).not.toMatch(staticDatasetImport) - expect(worktreeLogic).not.toMatch(staticDatasetImport) - }) }) diff --git a/src/shared/network/manual-address.test.ts b/src/shared/network/manual-address.test.ts index 6ef595361298..0260eeb7d726 100644 --- a/src/shared/network/manual-address.test.ts +++ b/src/shared/network/manual-address.test.ts @@ -1,16 +1,8 @@ import { describe, it, expect } from 'vitest' -import { readFileSync } from 'node:fs' -import { resolve } from 'node:path' import { parseManualNetworkAddress } from './manual-address' import { PAIRING_ENDPOINT_MAX_CHARACTERS } from '../mobile-pairing-protocol-limits' describe('parseManualNetworkAddress', () => { - it('keeps renderer validation off the Zod schema import path', () => { - const source = readFileSync(resolve('src/shared/network/manual-address.ts'), 'utf8') - expect(source).not.toContain('mobile-relay-pairing-offer') - expect(source).not.toContain("from 'zod'") - }) - describe('IPv4', () => { it('accepts canonical IPv4', () => { expect(parseManualNetworkAddress('192.168.1.24')).toEqual({ diff --git a/src/shared/pane-agent-identity-inventory.test.ts b/src/shared/pane-agent-identity-inventory.test.ts deleted file mode 100644 index 028207cdfb9a..000000000000 --- a/src/shared/pane-agent-identity-inventory.test.ts +++ /dev/null @@ -1,488 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' -import { glob } from 'tinyglobby' -import { - blankStringContents, - blankStringContentsDesynced, - isTestFile, - stripComments -} from './source-scan/source-tree-scan' - -const HELPERS = [ - 'getAgentLabel', - 'isClaudeAgent', - 'titleHasAgentName', - 'buildAgentNameRe', - 'resolveTerminalTitleAgentType', - 'resolveExplicitTerminalTitleAgentType', - 'resolveCommittedTitleAgentType', - 'resolvePaneAgentOwner', - 'resolveCompatibleAgentTypeForOwner', - 'classifyTitleActivity', - 'detectAgentStatusFromTitle', - 'resolveAgentTypeFromTerminalTitle', - 'resolvePaneAgentIdentity', - 'resolveCanonicalPaneAgentIdentity', - 'resolvePublishedPaneAgentIdentity' -] as const - -const TEST_SUPPORT_PATHS = new Set([ - 'src/renderer/src/components/terminal-pane/pty-connection-test-environment.ts' -]) - -type Helper = (typeof HELPERS)[number] -type InventoryPath = string | readonly [path: string, occurrences: number] -type Classification = - | 'parser-implementation' - | 'activity-only' - | 'enum-formatter' - | 'evidence-producer' - | 'identity-consumer' - | 'action-consumer' - -type InventoryGroup = { - helper: Helper - classification: Classification - paths: readonly InventoryPath[] -} - -const INVENTORY: readonly InventoryGroup[] = [ - { - helper: 'getAgentLabel', - classification: 'enum-formatter', - paths: [ - [ - 'src/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.tsx', - 2 - ], - ['src/renderer/src/components/automations/AutomationListLocalRow.tsx', 2], - 'src/renderer/src/components/automations/automation-draft-model.ts', - ['src/renderer/src/components/automations/automation-list-search-rows.ts', 2], - ['src/renderer/src/components/settings/NativeChatSupportedAgents.tsx', 2], - ['src/renderer/src/components/settings/QuickCommandsList.tsx', 2], - ['src/renderer/src/components/tab-bar/TabBarQuickCommandItem.tsx', 2], - ['src/renderer/src/components/tab-bar/TabBarQuickCommandsMenu.tsx', 2], - 'src/renderer/src/lib/agent-catalog.tsx', - ['src/renderer/src/lib/launch-agent-session-continuation.ts', 3], - ['src/renderer/src/lib/orchestration-skill-coverage.ts', 2] - ] - }, - { - helper: 'getAgentLabel', - classification: 'activity-only', - paths: [['src/renderer/src/lib/pane-agent-evidence.ts', 2]] - }, - { - helper: 'getAgentLabel', - classification: 'parser-implementation', - paths: [ - 'src/renderer/src/lib/agent-status.ts', - 'src/shared/agent-detection.ts', - 'src/shared/agent-title-identity.ts', - ['src/shared/agent-title-owner.ts', 2], - ['src/shared/terminal-title-agent-type.ts', 2] - ] - }, - { - helper: 'isClaudeAgent', - classification: 'action-consumer', - paths: [ - ['src/renderer/src/components/terminal-pane/cache-timer-seeding.ts', 2], - ['src/renderer/src/components/terminal-pane/parked-terminal-byte-watcher.ts', 2], - ['src/renderer/src/components/terminal-pane/pty-connection/agent-task-complete-notify.ts', 2], - ['src/renderer/src/store/terminals/terminal-ephemeral-state.ts', 2] - ] - }, - { - helper: 'isClaudeAgent', - classification: 'action-consumer', - paths: [ - ['src/renderer/src/components/terminal-pane/pty-connection/command-inferred-pane-agent.ts', 2] - ] - }, - { - helper: 'isClaudeAgent', - classification: 'parser-implementation', - paths: [ - 'src/renderer/src/lib/agent-status.ts', - 'src/shared/agent-detection.ts', - ['src/shared/agent-title-identity.ts', 2], - ['src/shared/terminal-title-agent-type.ts', 2] - ] - }, - { - helper: 'titleHasAgentName', - classification: 'parser-implementation', - paths: [ - 'src/shared/agent-detection.ts', - 'src/shared/agent-name-token-match.ts', - ['src/shared/agent-title-core.ts', 4], - ['src/shared/agent-title-evidence.ts', 2], - ['src/shared/agent-title-identity.ts', 11], - ['src/shared/terminal-title-agent-type.ts', 15] - ] - }, - { - helper: 'titleHasAgentName', - classification: 'evidence-producer', - paths: [['src/renderer/src/hooks/ipc-events/agent-status-routing.ts', 2]] - }, - { - helper: 'buildAgentNameRe', - classification: 'parser-implementation', - paths: [['src/shared/agent-name-token-match.ts', 2]] - }, - { - helper: 'resolveTerminalTitleAgentType', - classification: 'identity-consumer', - paths: [['src/renderer/src/lib/notes-send-agent-targets.ts', 2]] - }, - { - helper: 'resolveTerminalTitleAgentType', - classification: 'parser-implementation', - paths: [['src/shared/terminal-title-agent-type.ts', 2]] - }, - { - helper: 'resolveExplicitTerminalTitleAgentType', - classification: 'identity-consumer', - paths: [ - ['mobile/src/session/mobile-terminal-tab-agent.ts', 2], - ['src/main/runtime/tui-idle-evidence.ts', 2], - ['src/renderer/src/lib/open-tab-occupant-agent.ts', 2], - ['src/renderer/src/lib/use-tab-agent.ts', 3] - ] - }, - { - helper: 'resolveExplicitTerminalTitleAgentType', - classification: 'parser-implementation', - paths: [ - ['src/renderer/src/lib/pane-agent-evidence.ts', 2], - ['src/renderer/src/lib/tab-agent-from-signals.ts', 2], - 'src/shared/terminal-title-agent-type.ts' - ] - }, - { - helper: 'resolveCommittedTitleAgentType', - classification: 'action-consumer', - paths: [ - ['src/renderer/src/components/tab-bar/native-chat-tab-agent-evidence.ts', 3], - ['src/renderer/src/components/terminal-pane/pty-connection/connect-pane-pty.ts', 2], - ['src/renderer/src/components/terminal-pane/terminal-ctrl-enter.ts', 2], - ['src/renderer/src/components/terminal-pane/terminal-windows-shift-enter.ts', 2], - ['src/renderer/src/components/terminal-pane/use-notification-dispatch.ts', 2] - ] - }, - { - helper: 'resolveCommittedTitleAgentType', - classification: 'identity-consumer', - paths: [ - ['src/renderer/src/components/terminal-pane/native-chat-leaf-title-agent.ts', 4], - ['src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts', 2] - ] - }, - { - helper: 'resolveCommittedTitleAgentType', - classification: 'parser-implementation', - paths: ['src/renderer/src/lib/pane-agent-evidence.ts'] - }, - { - helper: 'resolveCommittedTitleAgentType', - classification: 'action-consumer', - paths: [ - ['src/renderer/src/components/terminal-pane/pty-connection/command-inferred-pane-agent.ts', 2] - ] - }, - { - helper: 'resolvePaneAgentOwner', - classification: 'parser-implementation', - paths: ['src/shared/pane-agent-owner.ts'] - }, - { - helper: 'resolvePaneAgentOwner', - classification: 'evidence-producer', - paths: [['src/renderer/src/components/terminal-pane/parked-terminal-command-status.ts', 2]] - }, - { - helper: 'resolvePaneAgentOwner', - classification: 'identity-consumer', - paths: [ - ['src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts', 2], - ['src/renderer/src/components/terminal-pane/pty-connection/shell-command-inference.ts', 2], - ['src/renderer/src/lib/use-tab-agent.ts', 2] - ] - }, - { - helper: 'resolveCompatibleAgentTypeForOwner', - classification: 'parser-implementation', - paths: [['src/shared/agent-title-owner.ts', 2]] - }, - { - helper: 'resolveCompatibleAgentTypeForOwner', - classification: 'identity-consumer', - paths: [ - ['src/renderer/src/components/sidebar/worktree-agent-row-type.ts', 2], - ['src/main/runtime/runtime-mobile-session-projection.ts', 3], - ['src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts', 2], - ['src/renderer/src/lib/tab-agent-from-signals.ts', 2], - ['src/renderer/src/lib/use-tab-agent.ts', 2] - ] - }, - { - helper: 'resolveCompatibleAgentTypeForOwner', - classification: 'action-consumer', - paths: [ - ['src/renderer/src/components/terminal-pane/pty-connection/agent-task-complete-notify.ts', 2], - [ - 'src/renderer/src/components/terminal-pane/pty-connection/command-inferred-pane-agent.ts', - 3 - ], - ['src/renderer/src/components/terminal-pane/pty-connection/terminal-keydown-fit.ts', 3] - ] - }, - { - helper: 'resolveCompatibleAgentTypeForOwner', - classification: 'evidence-producer', - paths: [ - ['src/renderer/src/components/terminal-pane/pty-connection/direct-ssh-retry-status.ts', 2], - ['src/renderer/src/components/terminal-pane/pty-connection/title-spawn-bell.ts', 2] - ] - }, - { - helper: 'classifyTitleActivity', - classification: 'identity-consumer', - paths: [ - ['src/renderer/src/components/sidebar/smart-attention.ts', 3], - ['src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts', 2], - ['src/renderer/src/components/status-bar/workspace-space-presentation.ts', 3], - ['src/renderer/src/lib/active-agent-note-target.ts', 2], - ['src/renderer/src/lib/worktree-status.ts', 3], - ['src/renderer/src/store/slices/terminal-helpers.ts', 2] - ] - }, - { - helper: 'classifyTitleActivity', - classification: 'action-consumer', - paths: [ - ['src/renderer/src/components/terminal-pane/cache-timer-seeding.ts', 2], - ['src/renderer/src/lib/agent-ready-wait.ts', 2], - ['src/renderer/src/store/terminals/terminal-ephemeral-state.ts', 2] - ] - }, - { - helper: 'classifyTitleActivity', - classification: 'activity-only', - paths: [ - ['src/renderer/src/store/slices/workspace-cleanup-local-evidence.ts', 3], - ['src/renderer/src/store/terminals/terminal-tab-presentation.ts', 4] - ] - }, - { - helper: 'classifyTitleActivity', - classification: 'evidence-producer', - paths: [ - ['src/renderer/src/lib/agent-send-title-status.ts', 2], - ['src/renderer/src/lib/agent-status-terminal-title.ts', 2] - ] - }, - { - helper: 'classifyTitleActivity', - classification: 'parser-implementation', - paths: [ - ['src/renderer/src/lib/agent-status.ts', 5], - 'src/renderer/src/lib/pane-agent-evidence.ts' - ] - }, - { - helper: 'detectAgentStatusFromTitle', - classification: 'evidence-producer', - paths: [ - ['src/main/runtime/orca-runtime-apply-tracked-pty-title.ts', 2], - ['src/main/runtime/orca-runtime-get-pty-record-for-pane-key.ts', 2], - ['src/main/runtime/orca-runtime-get-unpersisted-tracked-title-for-pty.ts', 2], - ['src/main/runtime/orca-runtime-maybe-hydrate-headless-from-renderer.ts', 2], - ['src/main/runtime/orca-runtime-record-agent-prompt-lifecycle-state.ts', 2], - ['src/main/runtime/runtime-terminal-agent-status-query.ts', 3], - ['src/main/runtime/runtime-worktree-status-projection.ts', 4], - ['src/main/runtime/terminal-wait-detection.ts', 2], - ['src/renderer/src/components/terminal-pane/agent-completion-title-observer.ts', 2], - ['src/renderer/src/components/terminal-pane/pty-connection/shell-command-inference.ts', 4], - ['src/renderer/src/components/terminal-pane/pty-output-title-observer.ts', 2], - ['src/shared/terminal-output-side-effects.ts', 3], - ['src/shared/tui-agent-rest-signal.ts', 2] - ] - }, - { - helper: 'detectAgentStatusFromTitle', - classification: 'action-consumer', - paths: [ - ['src/renderer/src/components/terminal-pane/pty-connection/agent-task-complete-notify.ts', 2], - [ - 'src/renderer/src/components/terminal-pane/pty-connection/command-inferred-pane-agent.ts', - 3 - ], - ['src/renderer/src/components/terminal-pane/pty-connection/interrupt-input-intent.ts', 3] - ] - }, - { - helper: 'detectAgentStatusFromTitle', - classification: 'parser-implementation', - paths: [ - ['src/renderer/src/components/terminal-pane/title-agent-identity.ts', 2], - 'src/renderer/src/lib/agent-status.ts', - ['src/renderer/src/lib/pane-agent-evidence.ts', 3], - ['src/shared/agent-decorative-title-signature.ts', 2], - 'src/shared/agent-detection.ts', - ['src/shared/agent-title-owner.ts', 2], - ['src/shared/agent-title-status.ts', 6] - ] - }, - { - helper: 'resolveAgentTypeFromTerminalTitle', - classification: 'identity-consumer', - paths: [ - ['src/renderer/src/components/sidebar/worktree-agent-row-type.ts', 2], - 'src/renderer/src/components/sidebar/worktree-title-derived-agent-rows.ts', - ['src/renderer/src/lib/worktree-status.ts', 2] - ] - }, - { - helper: 'resolvePaneAgentIdentity', - classification: 'parser-implementation', - paths: ['src/shared/pane-agent-identity-resolver.ts'] - }, - { - helper: 'resolvePaneAgentIdentity', - classification: 'identity-consumer', - paths: [['src/shared/published-pane-agent-identity.ts', 2]] - }, - { - helper: 'resolveCanonicalPaneAgentIdentity', - classification: 'parser-implementation', - paths: ['src/shared/pane-agent-identity-adapter.ts'] - }, - { - helper: 'resolveCanonicalPaneAgentIdentity', - classification: 'identity-consumer', - paths: [['src/shared/agent-status-identity.ts', 2]] - }, - { - helper: 'resolveCanonicalPaneAgentIdentity', - classification: 'identity-consumer', - paths: [['src/shared/terminal-title-agent-type.ts', 2]] - }, - { - helper: 'resolvePublishedPaneAgentIdentity', - classification: 'parser-implementation', - paths: [ - 'src/shared/published-pane-agent-identity.ts', - ['src/main/runtime/orca-runtime-write-orchestration-pointer-pty.ts', 2] - ] - } -] - -const DIRECT_SINGLE_SOURCE_SURFACES: readonly { - path: string - classification: Classification - marker: string -}[] = [ - { - path: 'src/renderer/src/components/terminal-pane/terminal-renderer-policy.ts', - classification: 'identity-consumer', - marker: 'resolveGeminiCompatFallback' - }, - { - path: 'src/renderer/src/components/terminal-pane/terminal-title-evidence.ts', - classification: 'identity-consumer', - marker: 'resolvePaneTitleDecision' - }, - { - path: 'src/renderer/src/components/terminal/terminal-close-copy-kind.ts', - classification: 'identity-consumer', - marker: 'resolveLeafCloseCopyKind' - }, - { - path: 'src/main/runtime/orchestration/mailbox-pointer-stage.ts', - classification: 'action-consumer', - marker: 'isCursorAgentTitle' - }, - { - path: 'src/main/providers/local-pty-session-activation.ts', - classification: 'action-consumer', - marker: 'launchAgent' - }, - { - path: 'src/renderer/src/components/terminal-pane/pty-connection/pane-serializer-settle.ts', - classification: 'action-consumer', - marker: 'sendStartupDraftPaste' - }, - { - path: 'src/renderer/src/lib/active-agent-note-send.ts', - classification: 'action-consumer', - marker: 'sendNotesToActiveAgentSession' - }, - { - path: 'src/renderer/src/components/native-chat/native-chat-runtime-send.ts', - classification: 'action-consumer', - marker: 'sendNativeChatMessage' - }, - { - path: 'mobile/src/session/mobile-native-chat-send.ts', - classification: 'action-consumer', - marker: 'sendMobileNativeChatMessageWithOutcome' - }, - { - path: 'mobile/src/session/mobile-native-chat-image-send.ts', - classification: 'action-consumer', - marker: 'pasteMobileNativeChatImagePaths' - } -] - -describe('pane agent identity inventory ratchet', () => { - it('classifies every legacy helper definition, import, and callsite in src and mobile/src', async () => { - const files = await glob(['src/**/*.{ts,tsx}', 'mobile/src/**/*.{ts,tsx}'], { - ignore: ['**/*.test.*', '**/*.spec.*'] - }) - const actual: { helper: Helper; path: string; occurrences: number }[] = [] - for (const path of files) { - if (isTestFile(path) || TEST_SUPPORT_PATHS.has(path)) { - continue - } - const rawSource = readFileSync(join(process.cwd(), path), 'utf8') - if (!HELPERS.some((helper) => rawSource.includes(helper))) { - continue - } - const decommentedSource = stripComments(rawSource) - if (blankStringContentsDesynced(decommentedSource)) { - throw new Error(`String scanner desynchronized while inventorying ${path}`) - } - const source = blankStringContents(decommentedSource) - for (const helper of HELPERS) { - const occurrences = source.match(new RegExp(`\\b${helper}\\b`, 'g'))?.length ?? 0 - if (occurrences > 0) { - actual.push({ helper, path, occurrences }) - } - } - } - const expected = INVENTORY.flatMap(({ helper, paths }) => - paths.map((site) => { - const [path, occurrences] = typeof site === 'string' ? [site, 1] : site - return { helper, path, occurrences } - }) - ) - const byHelperAndPath = (left: (typeof actual)[number], right: (typeof actual)[number]) => - left.helper.localeCompare(right.helper) || left.path.localeCompare(right.path) - expect(actual.sort(byHelperAndPath)).toEqual(expected.sort(byHelperAndPath)) - }, 30_000) - - it('pins direct single-source identity and action branches outside named helpers', () => { - for (const site of DIRECT_SINGLE_SOURCE_SURFACES) { - const source = stripComments(readFileSync(join(process.cwd(), site.path), 'utf8')) - expect({ - path: site.path, - classification: site.classification, - hasMarker: source.includes(site.marker) - }).toEqual({ path: site.path, classification: site.classification, hasMarker: true }) - } - }) -}) diff --git a/src/shared/pane-agent-identity-surface-inventory.test.ts b/src/shared/pane-agent-identity-surface-inventory.test.ts deleted file mode 100644 index 77d9edb3b84c..000000000000 --- a/src/shared/pane-agent-identity-surface-inventory.test.ts +++ /dev/null @@ -1,284 +0,0 @@ -import { readFileSync } from 'node:fs' -import { join } from 'node:path' -import { describe, expect, it } from 'vitest' -import { glob } from 'tinyglobby' -import { isTestFile, stripComments } from './source-scan/source-tree-scan' - -/** - * Surface half of the identity inventory ratchet: every consumer decision point from the closed - * 65-row inventory (rows 32–65 — the direct title/native-chat selectors, tab projections, mobile - * sync graph, lifecycle selectors, status/OSC ingress, worktree status, attention, and - * title-reset paths) is pinned to a marker symbol in its file. The helper-name census - * (`pane-agent-identity-inventory.test.ts`) is necessary but not sufficient — these files reach - * identity through direct reads a name census cannot see. Moving or renaming a marker means the - * inventory row must be re-classified, deliberately, before review. - */ - -type SurfaceRow = { - /** Row number in the closed consumer inventory. */ - row: number - path: string - marker: string -} - -const SURFACE_ROWS: readonly SurfaceRow[] = [ - { - row: 32, - path: 'src/renderer/src/components/terminal-pane/native-chat-leaf-title-agent.ts', - marker: 'resolveNativeChatLeafTitleAgent' - }, - { - row: 32, - path: 'src/renderer/src/components/terminal-pane/use-terminal-pane-chat-state.ts', - marker: 'resolveNativeChatLeafTitleAgent' - }, - { - row: 33, - path: 'src/renderer/src/components/terminal-pane/pty-connection/pane-agent-identity.ts', - marker: 'installPaneAgentIdentity' - }, - { row: 34, path: 'src/main/runtime/orchestration/groups.ts', marker: 'terminalIsAgent' }, - { - row: 35, - path: 'src/renderer/src/lib/active-agent-note-target.ts', - marker: 'getActiveTerminalNoteTarget' - }, - { - row: 36, - path: 'src/renderer/src/components/terminal-pane/terminal-agent-paste-bracketing.ts', - marker: 'resolveProtectedMultilinePasteOptionsForPane' - }, - { - row: 37, - path: 'src/renderer/src/components/terminal-pane/command-code-output-ownership.ts', - marker: 'canCommandCodeOutputOwnPane' - }, - { row: 38, path: 'src/renderer/src/lib/agent-ready-wait.ts', marker: 'waitForAgentReady' }, - { - row: 39, - path: 'src/renderer/src/lib/agent-paste-draft.ts', - marker: 'getSettingsForAgentTabRuntimeOwner' - }, - { - row: 40, - path: 'src/renderer/src/lib/agent-followup-delivery.ts', - marker: 'sendFollowupPromptWhenAgentReady' - }, - { - row: 41, - path: 'src/renderer/src/lib/codex-session-restart.ts', - marker: 'markLiveCodexSessionsForRestart' - }, - { - row: 41, - path: 'src/renderer/src/lib/codex-pane-restart-eligibility.ts', - marker: 'isCodexForegroundProcess' - }, - { - row: 42, - path: 'src/renderer/src/components/native-chat/native-chat-availability.ts', - marker: 'canToggleNativeChat' - }, - { - row: 43, - path: 'src/renderer/src/components/native-chat/native-chat-pane-resolution.ts', - marker: 'resolveNativeChatSession' - }, - { - row: 44, - path: 'src/renderer/src/components/terminal-pane/terminal-agent-session-continuation.ts', - marker: 'canContinueAgentSessionInNewSession' - }, - { - row: 45, - path: 'src/renderer/src/components/terminal-pane/terminal-agent-session-fork.ts', - marker: 'prepareAgentSessionForkFromPane' - }, - { - row: 46, - path: 'src/renderer/src/components/terminal-pane/agent-interrupt-inference.ts', - marker: 'isPlainEscapeKeyEvent' - }, - { - row: 46, - path: 'src/renderer/src/components/terminal-pane/agent-question-answered-inference.ts', - marker: 'inferQuestionAnsweredFromCurrentStatus' - }, - { - row: 47, - path: 'src/renderer/src/components/terminal-pane/terminal-keyboard-protocol-pane-agent.ts', - marker: 'resolvePaneKeyboardProtocolAgent' - }, - { - row: 47, - path: 'src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts', - marker: 'resolvePaneKeyboardProtocolAgent' - }, - { - row: 48, - path: 'src/renderer/src/components/tab-bar/tab-agent-types-by-tab-id.ts', - marker: 'selectTabAgentTypesByTabId' - }, - { - row: 49, - path: 'src/renderer/src/components/terminal-pane/terminal-tab-agent-type-index.ts', - marker: 'createTerminalTabAgentTypeSelector' - }, - { - row: 50, - path: 'src/renderer/src/lib/tab-agent-status-index.ts', - marker: 'selectLiveTabAgentPanes' - }, - { - row: 51, - path: 'src/renderer/src/components/tab-bar/terminal-tab-activity-status.ts', - marker: 'resolveTerminalTabActivityStatus' - }, - { - row: 52, - path: 'src/renderer/src/lib/workspace-tab-agent-metadata.ts', - marker: 'maxAgentActivityAt' - }, - { - row: 52, - path: 'src/renderer/src/lib/workspace-tab-palette-entry-builder.ts', - marker: 'buildSearchableWorkspaceTabEntries' - }, - { - row: 53, - path: 'src/renderer/src/lib/running-agent-targets.ts', - marker: 'deriveRunningAgentSendTargets' - }, - { - row: 54, - path: 'src/renderer/src/runtime/sync-runtime-graph.ts', - marker: 'buildMobileSessionTabSnapshots' - }, - { - row: 55, - path: 'src/renderer/src/lib/agent-hibernation-pane-eligibility.ts', - marker: 'toRuntimePtyId' - }, - { - row: 56, - path: 'src/renderer/src/lib/resume-sleeping-agent-session.ts', - marker: 'resumeSleepingAgentSessionsForWorktree' - }, - { - row: 57, - path: 'src/renderer/src/lib/automation-session-reuse.ts', - marker: 'findReusableAutomationSession' - }, - { - row: 58, - path: 'src/renderer/src/components/terminal-pane/pty-connection/cold-restore-resume-startup.ts', - marker: 'bindBuildColdRestoreAgentResumeStartup' - }, - { - row: 59, - path: 'src/main/agent-hooks/server/server-authority-evidence.ts', - marker: 'recordCurrentAuthorityObservation' - }, - { - row: 59, - path: 'src/main/runtime/orca-runtime-write-orchestration-pointer-pty.ts', - marker: 'resolvePaneAgentIdentityField' - }, - { - row: 59, - path: 'src/renderer/src/hooks/ipc-events/agent-status-event-applicator.ts', - marker: 'createAgentStatusEventApplicator' - }, - { - row: 59, - path: 'src/renderer/src/store/slices/agent-status-authority-actions.ts', - marker: 'transferAgentPaneAuthority' - }, - { - row: 59, - path: 'src/renderer/src/store/slices/pane-foreground-agent.ts', - marker: 'createPaneForegroundAgentSlice' - }, - { - row: 59, - path: 'src/renderer/src/hooks/ipc-events/agent-status-routing.ts', - marker: 'isAgentStatusForRecentlyClosedTab' - }, - { - row: 60, - path: 'src/renderer/src/components/terminal-pane/pty-connection/title-spawn-bell.ts', - marker: 'installTitleSpawnBell' - }, - { row: 61, path: 'src/renderer/src/lib/worktree-status.ts', marker: 'getWorktreeStatus' }, - { - row: 62, - path: 'src/main/runtime/runtime-worktree-status-projection.ts', - marker: 'getLeafWorktreeStatus' - }, - { - row: 63, - path: 'src/renderer/src/components/sidebar/smart-attention.ts', - marker: 'buildAttentionByWorktree' - }, - { - row: 64, - path: 'src/renderer/src/components/status-bar/workspace-space-presentation.ts', - marker: 'countWorkspaceSpaceActiveAgents' - }, - { row: 65, path: 'src/renderer/src/store/slices/terminal-helpers.ts', marker: 'getResetTitle' }, - { - row: 6, - path: 'src/renderer/src/runtime/web-session-tabs-sync.ts', - marker: 'applyWebSessionTabs' - } -] - -describe('pane agent identity surface inventory (rows 6, 32–65)', () => { - it('every pinned surface still carries its marker symbol', () => { - for (const row of SURFACE_ROWS) { - const source = stripComments(readFileSync(join(process.cwd(), row.path), 'utf8')) - expect({ row: row.row, path: row.path, hasMarker: source.includes(row.marker) }).toEqual({ - row: row.row, - path: row.path, - hasMarker: true - }) - } - }) -}) - -/** - * Identity-observation rebind audit. Advancing a pane incarnation without a positive replacement - * proof is how a legitimate reclaim and a stale-hook bug get conflated (see - * `PaneReplacementProof` in pane-agent-identity-adapter.ts). Every existing sequencer `rebind` - * call is pinned here by file and count: today they are the retired-pane `restart` disposition - * (three ingress paths) and the renderer pane-key transfer. Adding a rebind call, or changing - * these, requires updating this audit — and per the migration plan, a `replacementProof`. - */ -const IDENTITY_SEQUENCER_REBIND_RE = /\b(?:observations|rendererAgentStatusObservations)\.rebind\(/g - -const EXPECTED_REBIND_SITES: readonly (readonly [path: string, occurrences: number])[] = [ - ['src/main/agent-hooks/server/server-ingest-normalization.ts', 1], - ['src/main/agent-hooks/server/server-ingest-remote.ts', 1], - ['src/main/agent-hooks/server/server-lifecycle.ts', 1], - ['src/renderer/src/store/slices/agent-status-authority-actions.ts', 1] -] - -describe('identity observation rebind audit', () => { - it('pins every identity-sequencer rebind call site by file and count', async () => { - const files = await glob(['src/**/*.{ts,tsx}', 'mobile/src/**/*.{ts,tsx}'], { - ignore: ['**/*.test.*', '**/*.spec.*'] - }) - const actual: [string, number][] = [] - for (const path of files.sort()) { - if (isTestFile(path)) { - continue - } - const source = stripComments(readFileSync(join(process.cwd(), path), 'utf8')) - const occurrences = source.match(IDENTITY_SEQUENCER_REBIND_RE)?.length ?? 0 - if (occurrences > 0) { - actual.push([path, occurrences]) - } - } - expect(actual).toEqual(EXPECTED_REBIND_SITES.map((site) => [...site])) - }, 30_000) -}) diff --git a/src/shared/priority-semaphore.test.ts b/src/shared/priority-semaphore.test.ts index aeeacda94ef0..5cfbe898bdc8 100644 --- a/src/shared/priority-semaphore.test.ts +++ b/src/shared/priority-semaphore.test.ts @@ -2,19 +2,6 @@ import { describe, expect, it } from 'vitest' import { PrioritySemaphore } from './priority-semaphore' describe('PrioritySemaphore', () => { - it('allows up to N concurrent acquires', async () => { - const sem = new PrioritySemaphore(2) - const r1 = await sem.acquire(0) - const r2 = await sem.acquire(0) - - // Both acquired immediately - expect(typeof r1).toBe('function') - expect(typeof r2).toBe('function') - - r1() - r2() - }) - it('blocks when concurrency limit is reached', async () => { const sem = new PrioritySemaphore(1) const r1 = await sem.acquire(0) @@ -129,23 +116,6 @@ describe('PrioritySemaphore', () => { expect(order[0]).toBe('B-high') }) - it('works with zero waiters', async () => { - const sem = new PrioritySemaphore(3) - const r1 = await sem.acquire(0) - r1() - // No crash, no hanging - }) - - it('release is idempotent', async () => { - const sem = new PrioritySemaphore(1) - const r1 = await sem.acquire(0) - r1() - r1() // double release should not throw or corrupt state - - const r2 = await sem.acquire(0) - r2() - }) - it('removes an aborted waiter without consuming the next permit', async () => { const sem = new PrioritySemaphore(1) const release = await sem.acquire(0) diff --git a/src/shared/runtime-client-export-parity.test.ts b/src/shared/runtime-client-export-parity.test.ts deleted file mode 100644 index 2b86d2e6e998..000000000000 --- a/src/shared/runtime-client-export-parity.test.ts +++ /dev/null @@ -1,242 +0,0 @@ -import { describe, expect, expectTypeOf, it } from 'vitest' -import type { PairingOffer } from './pairing' -import type { RuntimeCapability } from './protocol-version' -import * as RemoteClient from './remote-runtime-client' -import type { RuntimeOrchestrationEnvelope, RuntimeRpcResponse } from './runtime-rpc-envelope' -import * as Runtime from './runtime-types' - -type RuntimeTypeInventory = [ - Runtime.BrowserBackResult, - Runtime.BrowserCaptureStartResult, - Runtime.BrowserCaptureStopResult, - Runtime.BrowserCheckResult, - Runtime.BrowserClearResult, - Runtime.BrowserClickResult, - Runtime.BrowserConsoleEntry, - Runtime.BrowserConsoleResult, - Runtime.BrowserCookie, - Runtime.BrowserCookieDeleteResult, - Runtime.BrowserCookieGetResult, - Runtime.BrowserCookieSetResult, - Runtime.BrowserDetectedInfo, - Runtime.BrowserDetectedProfileInfo, - Runtime.BrowserDetectProfilesResult, - Runtime.BrowserDragResult, - Runtime.BrowserErrorCode, - Runtime.BrowserEvalResult, - Runtime.BrowserFillResult, - Runtime.BrowserFocusResult, - Runtime.BrowserGeolocationResult, - Runtime.BrowserGotoResult, - Runtime.BrowserHoverResult, - Runtime.BrowserInterceptDisableResult, - Runtime.BrowserInterceptedRequest, - Runtime.BrowserInterceptEnableResult, - Runtime.BrowserKeypressResult, - Runtime.BrowserNetworkEntry, - Runtime.BrowserNetworkLogResult, - Runtime.BrowserPdfResult, - Runtime.BrowserProfileClearDefaultCookiesResult, - Runtime.BrowserProfileCreateResult, - Runtime.BrowserProfileDeleteResult, - Runtime.BrowserProfileImportFromBrowserResult, - Runtime.BrowserProfileListResult, - Runtime.BrowserReloadResult, - Runtime.BrowserScreencastDialogClosedResult, - Runtime.BrowserScreencastDialogResult, - Runtime.BrowserScreencastEndResult, - Runtime.BrowserScreencastErrorResult, - Runtime.BrowserScreencastReadyResult, - Runtime.BrowserScreencastResult, - Runtime.BrowserScreenshotResult, - Runtime.BrowserScrollResult, - Runtime.BrowserSelectAllResult, - Runtime.BrowserSelectResult, - Runtime.BrowserSnapshotRef, - Runtime.BrowserSnapshotResult, - Runtime.BrowserTabCreateResult, - Runtime.BrowserTabCurrentResult, - Runtime.BrowserTabInfo, - Runtime.BrowserTabListResult, - Runtime.BrowserTabProfileCloneResult, - Runtime.BrowserTabProfileShowResult, - Runtime.BrowserTabSetProfileResult, - Runtime.BrowserTabShowResult, - Runtime.BrowserTabSwitchResult, - Runtime.BrowserTypeResult, - Runtime.BrowserUploadResult, - Runtime.BrowserViewportResult, - Runtime.BrowserWaitResult, - Runtime.CliRuntimeState, - Runtime.CliStatusResult, - Runtime.ComputerActionMetadata, - Runtime.ComputerActionResult, - Runtime.ComputerActionVerification, - Runtime.ComputerAppInfo, - Runtime.ComputerAppQuery, - Runtime.ComputerErrorCode, - Runtime.ComputerListAppsResult, - Runtime.ComputerListWindowsResult, - Runtime.ComputerProviderCapabilities, - Runtime.ComputerScreenshotData, - Runtime.ComputerScreenshotMetadata, - Runtime.ComputerScreenshotStatus, - Runtime.ComputerSnapshotData, - Runtime.ComputerSnapshotResult, - Runtime.ComputerWindowInfo, - Runtime.ComputerWindowListWindow, - Runtime.DeviceScope, - Runtime.RuntimeBrowserDriverState, - Runtime.RuntimeBrowserUnavailableReason, - Runtime.RuntimeDegradation, - Runtime.RuntimeDesktopWindowStatus, - Runtime.RuntimeFileListEntry, - Runtime.RuntimeFileListResult, - Runtime.RuntimeFileOpenResult, - Runtime.RuntimeFilePreviewResult, - Runtime.RuntimeFileReadChunkResult, - Runtime.RuntimeFileReadResult, - Runtime.RuntimeGitCheckoutResult, - Runtime.RuntimeGitLocalBranches, - Runtime.RuntimeGraphStatus, - Runtime.RuntimeMarkdownReadTabResult, - Runtime.RuntimeMarkdownSaveTabResult, - Runtime.RuntimeMobileSessionBrowserTab, - Runtime.RuntimeMobileSessionClientTab, - Runtime.RuntimeMobileSessionCreateTerminalResult, - Runtime.RuntimeMobileSessionFileTab, - Runtime.RuntimeMobileSessionMarkdownTab, - Runtime.RuntimeMobileSessionSnapshotTab, - Runtime.RuntimeMobileSessionTabCloseResult, - Runtime.RuntimeMobileSessionTabGroup, - Runtime.RuntimeMobileSessionTabMove, - Runtime.RuntimeMobileSessionTabMoveResult, - Runtime.RuntimeMobileSessionTabsRemovedResult, - Runtime.RuntimeMobileSessionTabsResult, - Runtime.RuntimeMobileSessionTabsSnapshot, - Runtime.RuntimeMobileSessionTerminalClientTab, - Runtime.RuntimeMobileSessionTerminalTab, - Runtime.RuntimeMobileTerminalTheme, - Runtime.RuntimeNativeChatFileContext, - Runtime.RuntimeNativeChatLaunchDraftResolution, - Runtime.RuntimeRendererSyncWindowGraph, - Runtime.RuntimeRepoList, - Runtime.RuntimeRepoSearchRefs, - Runtime.RuntimeSessionTabCloseReason, - Runtime.RuntimeSpeechModelSummary, - Runtime.RuntimeSpeechSetupState, - Runtime.RuntimeStatus, - Runtime.RuntimeSyncedLeaf, - Runtime.RuntimeSyncedTab, - Runtime.RuntimeSyncWindowGraph, - Runtime.RuntimeSyncWindowGraphResult, - Runtime.RuntimeTerminalAgentStatus, - Runtime.RuntimeTerminalAgentStatusState, - Runtime.RuntimeTerminalClose, - Runtime.RuntimeTerminalCreate, - Runtime.RuntimeTerminalCreateRequestPayload, - Runtime.RuntimeTerminalDriverState, - Runtime.RuntimeTerminalFocus, - Runtime.RuntimeTerminalInteractiveWait, - Runtime.RuntimeTerminalInteractiveWaitSource, - Runtime.RuntimeTerminalListHostScope, - Runtime.RuntimeTerminalListResult, - Runtime.RuntimeTerminalOrphanAdoptionClaim, - Runtime.RuntimeTerminalOrphanAdoptionRequest, - Runtime.RuntimeTerminalOrphanAdoptionResult, - Runtime.RuntimeTerminalOrphanTopology, - Runtime.RuntimeTerminalOrphanTopologyGroup, - Runtime.RuntimeTerminalOrphanTopologyTab, - Runtime.RuntimeTerminalPathOpenTarget, - Runtime.RuntimeTerminalPathResolution, - Runtime.RuntimeTerminalPresentation, - Runtime.RuntimeTerminalRead, - Runtime.RuntimeTerminalRename, - Runtime.RuntimeTerminalResolvePane, - Runtime.RuntimeTerminalSend, - Runtime.RuntimeTerminalShow, - Runtime.RuntimeTerminalSplit, - Runtime.RuntimeTerminalState, - Runtime.RuntimeTerminalSummary, - Runtime.RuntimeTerminalUnavailableReason, - Runtime.RuntimeTerminalVisualGroupNode, - Runtime.RuntimeTerminalVisualLayout, - Runtime.RuntimeTerminalVisualLayoutNode, - Runtime.RuntimeTerminalVisualPaneNode, - Runtime.RuntimeTerminalVisualTab, - Runtime.RuntimeTerminalVisualTerminalNode, - Runtime.RuntimeTerminalWait, - Runtime.RuntimeTerminalWaitBlockedReason, - Runtime.RuntimeTerminalWaitCondition, - Runtime.RuntimeWorktreeAgentRow, - Runtime.RuntimeWorktreeCreateResult, - Runtime.RuntimeWorktreeListResult, - Runtime.RuntimeWorktreePsConditionalResult, - Runtime.RuntimeWorktreePsResult, - Runtime.RuntimeWorktreePsSnapshotResult, - Runtime.RuntimeWorktreePsSummary, - Runtime.RuntimeWorktreePsUnchangedResult, - Runtime.RuntimeWorktreeRecord, - Runtime.RuntimeWorktreeRemoveResult, - Runtime.RuntimeWorktreeStatus, - Runtime.RuntimeWorktreeTerminalSleepResult -] - -describe('runtime client public export parity', () => { - it('keeps the runtime type inventory compile-visible', () => { - expectTypeOf().toEqualTypeOf() - expectTypeOf().toEqualTypeOf() - expectTypeOf().toEqualTypeOf() - expectTypeOf(RemoteClient.sendRemoteRuntimeRequest).toEqualTypeOf< - ( - pairing: PairingOffer, - method: string, - params: unknown, - timeoutMs: number, - envelope?: RuntimeOrchestrationEnvelope, - signal?: AbortSignal, - clientCapabilities?: readonly RuntimeCapability[] - ) => Promise> - >() - expectTypeOf(RemoteClient.sendRemoteRuntimeRequestWithStatusPreflight).toEqualTypeOf< - ( - pairing: PairingOffer, - method: string, - params: unknown, - timeoutMs: number, - validateStatus: (response: RuntimeRpcResponse) => void, - envelope?: RuntimeOrchestrationEnvelope, - clientCapabilities?: readonly RuntimeCapability[] - ) => Promise> - >() - expectTypeOf(RemoteClient.subscribeRemoteRuntimeRequest).toEqualTypeOf< - ( - pairing: PairingOffer, - method: string, - params: unknown, - timeoutMs: number, - callbacks: RemoteClient.RemoteRuntimeSubscriptionCallbacks, - options?: RemoteClient.RemoteRuntimeSubscriptionOptions - ) => Promise - >() - }) - - it('keeps the runtime and transport value exports exact', () => { - expect(Object.keys(Runtime).sort()).toEqual([ - 'BROWSER_UNAVAILABLE_ERROR_CODE', - 'COMPUTER_ERROR_CODES', - 'HEADLESS_RUNTIME_WINDOW_ID', - 'TERMINAL_PTY_DEGRADATION_CAPABILITY', - 'TERMINAL_UNAVAILABLE_ERROR_CODE', - 'UNPUBLISHED_WORKTREE_PUBLICATION_EPOCH', - 'browserUnavailableMessage', - 'terminalUnavailableMessage' - ]) - expect(Object.keys(RemoteClient).sort()).toEqual([ - 'RemoteRuntimeClientError', - 'sendRemoteRuntimeRequest', - 'sendRemoteRuntimeRequestWithStatusPreflight', - 'subscribeRemoteRuntimeRequest' - ]) - }) -}) diff --git a/tests/tools/windows-pty-native-capability-smoke/run.test.mjs b/tests/tools/windows-pty-native-capability-smoke/run.test.mjs index bb8ab525da6b..27439cb498e5 100644 --- a/tests/tools/windows-pty-native-capability-smoke/run.test.mjs +++ b/tests/tools/windows-pty-native-capability-smoke/run.test.mjs @@ -1,10 +1,7 @@ -import { readFileSync } from 'node:fs' import path from 'node:path' import { describe, expect, it } from 'vitest' import { checkoutRunProcessPath, formatProbeFailure, packagedProbeInvocation } from './run.mjs' -const runnerSource = readFileSync(new URL('./run.mjs', import.meta.url), 'utf8') - describe('packaged Windows native smoke runner boundary', () => { it('uses one checkout-owned runner for current and affected package paths', () => { const current = packagedProbeInvocation('/ci/current/dist/win-unpacked/Orca.exe') @@ -36,12 +33,4 @@ describe('packaged Windows native smoke runner boundary', () => { expect(failure).toContain('stdout-tail') expect(failure).toContain('stage=target-spawn:start') }) - - it('does not import child_process or resolve the runner from the artifact', () => { - expect(runnerSource).not.toContain('node:child_process') - expect(runnerSource).not.toMatch( - /path\.join\(resourcesDir[\s\S]*?app\.asar\.unpacked[\s\S]*?run-process\.js/ - ) - expect(runnerSource).toContain("'../../../out/shared/child-process/run-process.js'") - }) }) From 4da485cac1c308243fc22f5ee9c9c15058eee7ea Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 29 Sep 2026 01:30:54 -0700 Subject: [PATCH 88/90] fix(native-chat): render the terminal-backed chat through the structured chat's turn status (#22090) * fix(native-chat): render the terminal-backed chat through the structured chat's turn status A terminal-backed chat (grok and omp always; Claude and Codex whenever the structured lane is refused) could not say what its agent was doing. A working agent drew three bouncing dots with no elapsed time, and an agent stopped on a prompt that only its terminal showed drew nothing, so it looked idle. A pending AskUserQuestion row read "Asked:" while the agent was still waiting, because the pane treated the wait as the end of the turn. The pane already held the facts: the host-stamped working epoch and the hook's waiting/blocked state. It now feeds them to the same message list props and components the structured lane uses, instead of opting out with showTurnStatus={false}: - The turn runs on while the agent waits on the reader, as a structured turn does behind its prompt card, so the "Working for" bar keeps counting and the live line yields to the wait. - A wait the pane can draw as a card (approval or question) is shown by the card; a wait only the terminal shows is reported by the tail row the structured lane already uses for a pending question (NativeChatAwaitingInputRow). - The hook wait is reconciled against the transcript's terminal marker, like hook 'working' is, because an interrupt at the prompt fires no hook. showTurnStatus meant nothing once both lanes passed it, so it is gone, along with showLiveTurnActivity (replaced by the awaitingInput fact), the structuredActivityUi flag it fed to tool rows, and the transcript-guessing typing indicator (native-chat-typing-indicator.ts, NativeChatTypingIndicatorRow.tsx), which had no other consumer. The interactive card's derivation moved into useNativeChatInteractivePromptCard so the view can tell a wait the card answers from one it cannot. * test(native-chat): seed the hook wait through the store instead of a cast * fix(native-chat): say "Awaiting user input" as a whole phrase when no question is named A wait the pane cannot draw as a card, and a question whose text could not be parsed, both drew "Awaiting user input:" with nothing after the colon. The row now reads "Awaiting user input" when it has no question to name, in both chat lanes. The pending-question view test now counts awaiting rows by attribute so a second, unnamed row cannot slip past it. * perf(native-chat): read the prompt's tool name only while a prompt is pending Deriving the prompt card moved from the card into the pane's view, and with it a store read of the status row's tool name, which changes on every tool call. Every tool call therefore re-rendered the whole terminal-backed pane and its transcript list, where before only the card re-rendered. The tool name only matters beside a prompt, so read it only then. * fix(native-chat): keep the terminal lane's turn clock and folds across a remount Answering a prompt only the terminal shows means switching the pane to its terminal, which unmounts the chat. On return the "Working for" clock restarted from the agent's current state (seconds after the answer), and every turn the pane had folded behind "Worked for N" came back unfolded with no bar. - The running turn now counts from the start of the hook's unbroken run of mid-turn states under the current prompt (read from the status row's state history), not the current state's own start. - Finished turns take their duration from the transcript's own timestamps (prompt to the agent's last row or its interruption), so history turns fold like a structured chat's. The latest turn still relies on what the pane saw. * fix(native-chat): date the terminal lane's turns by the main agent and skip harness notices Two ways the terminal-backed chat showed a wrong turn status: - A background task or subagent keeps the status row 'working' after the main agent finishes, so the row's own start time carries into the next turn. A prompt sent while a background dev server ran showed "Working for" counted from the earlier turn. The clock now reads the main agent's own state and start time where the row carries them. - Harness notices (task notifications, reminders) are user-role rows in the transcript that the chat does not draw. The finished-turn derivation treated them as new prompts, so a running turn was reported settled and folded its steps while it still ran, and a finished turn's "Worked for" stopped at the notice. They no longer start or end a turn. * feat(agent-status): stamp each turn's start on the host The hook server now records turnStartedAt on a status row when the main agent's own turn-opening event arrives (the per-provider new-turn classifier the observation boundary already uses; not a replay, a child event or an identity-only row). Other events carry it; a session boundary clears it, and a settled main agent running again with no opening event drops it rather than count from the finished turn. It rides the snapshot and the live push as an optional field, persists with the row, lands on the renderer entry (kept within one state for writers with no turn clock), and is part of the paired-client projection key and equality. Old hosts send nothing; readers fall back to stateStartedAt. * fix(native-chat): time the terminal lane's turns from the host's turn stamp The running clock reads the host's turnStartedAt, so a remount, a reload (which starts with no state history) and child work holding the row open no longer move it, and the same prompt sent again is a new turn. The stateHistory walk and its prompt-equality rule are gone; an old host falls back to the current state's start. The latest turn is settled from host facts: once the main agent is done (outside a session boundary) its duration is the done stamp minus the turn start, so it folds after a remount. When the host went quiet mid-turn (the store's staleness dropped the row) the pane passes null, so a still-waiting turn no longer reads "Worked for 30m" and folds. Older turns keep their transcript durations. * test(agent-status): pin the host's turn start on the live status push * fix(native-chat): keep omp's turn working while its latest row is a tool call The terminal-backed chat settles a hook 'working' turn when the transcript's last row is an assistant row written after the turn began, a recovery for a Stop hook the host can miss. omp writes a timestamp on every row and has no transcript turn markers, so every tool call mid-turn tripped it: the pane dropped its "Working for" bar and showed Send instead of Stop while the command ran. omp's own runtime delivers its turn end (agent_end, retried until the host takes it and held back while the run continues), so its hook 'working' is never a dropped Stop. The prose recovery now skips it. * test(native-chat): read the clock once in the host-ended remount test The test stamped the row's done time and the turn start from two separate Date.now() reads, so whenever a millisecond passed between them the expected "Worked for 1m 30s" came out as 1m 29s. It failed that way once under load. * test(sync-runtime-graph): carry the turn stamp in the hot-path projection reference The hot-path suite compares the agent-status projection against its own copy of the serializer; that copy lacked the new turnStartedAt key. --- .../server-turn-started-at.test.ts | 185 ++++++++ .../server/server-persistence-validation.ts | 6 +- .../server/server-status-application.ts | 41 +- .../server/server-status-identity.ts | 1 + src/main/agent-hooks/server/server-types.ts | 3 + src/main/startup/main-window-agent-status.ts | 2 + ...in-window-structured-status-filter.test.ts | 8 + .../NativeChatAwaitingInputRow.tsx | 12 +- .../NativeChatInteractiveCard.test.tsx | 32 +- .../native-chat/NativeChatInteractiveCard.tsx | 50 +-- ...eChatMessageList.task-list-frames.test.tsx | 1 - ...eChatMessageList.tool-stream-cost.test.tsx | 10 +- .../native-chat/NativeChatMessageList.tsx | 51 +-- ...iveChatMessageList.turn-indicator.test.tsx | 72 ++-- .../native-chat/NativeChatMessageRow.tsx | 3 - .../native-chat/NativeChatResolvedView.tsx | 30 +- ...ativeChatResolvedView.turn-status.test.tsx | 401 ++++++++++++++++++ ...tiveChatStructuredSession.test-harness.tsx | 3 +- .../NativeChatStructuredSession.test.tsx | 15 +- .../NativeChatStructuredSession.tsx | 3 +- ...tiveChatStructuredSessionDelivery.test.tsx | 1 - .../NativeChatToolRun.ask-row.test.tsx | 2 +- .../native-chat/NativeChatToolRun.tsx | 12 +- .../native-chat/NativeChatTranscriptRow.tsx | 2 - .../NativeChatTypingIndicatorRow.tsx | 21 - .../native-chat-live-session-contract.ts | 3 + .../native-chat-live-status.test.ts | 79 +++- .../native-chat/native-chat-live-status.ts | 32 +- .../native-chat-message-rail-items.test.ts | 1 - .../native-chat-rail-outline-parity.test.ts | 1 - .../native-chat-terminal-turn.test.ts | 243 +++++++++++ .../native-chat/native-chat-terminal-turn.ts | 132 ++++++ .../native-chat-transcript-slots.test.ts | 1 - .../native-chat-transcript-slots.ts | 12 +- .../native-chat-typing-indicator.test.ts | 154 ------- .../native-chat-typing-indicator.ts | 34 -- ...ative-chat-interactive-prompt-card.test.ts | 68 +++ ...use-native-chat-interactive-prompt-card.ts | 48 +++ .../use-native-chat-live-session.test.ts | 36 ++ .../use-native-chat-live-session.ts | 7 +- .../use-native-chat-message-rail.test.ts | 1 - .../use-native-chat-terminal-turn-timing.ts | 45 ++ ...use-native-chat-transcript-scroll.test.tsx | 2 +- .../use-native-chat-transcript-scroll.ts | 7 +- .../use-native-chat-turn-status.ts | 2 +- ...events-agent-status-store-test-fixtures.ts | 1 + .../agent-status-event-applicator.ts | 3 +- ...vents-agent-status-snapshot-replay.test.ts | 10 +- .../src/i18n/en-runtime-required.json | 1 + src/renderer/src/i18n/locales/en.json | 1 + src/renderer/src/i18n/locales/fr.json | 1 + src/renderer/src/i18n/locales/ja.json | 1 + src/renderer/src/i18n/locales/ko.json | 1 + src/renderer/src/i18n/locales/zh.json | 1 + ...time-graph-agent-status-projection.test.ts | 3 + ...-runtime-graph-projection-hot-path.test.ts | 1 + .../agent-status-projection.ts | 1 + .../state-equality-core.test.ts | 24 +- .../state-equality-core.ts | 1 + .../src/store/slices/agent-status-contract.ts | 2 + .../slices/agent-status-live-entry-builder.ts | 6 + .../agent-status-turn-started-at.test.ts | 50 +++ src/shared/agent-status-ipc-payload.ts | 4 + src/shared/agent-status-types.ts | 3 + src/shared/native-chat-ask-row.ts | 1 + 65 files changed, 1593 insertions(+), 398 deletions(-) create mode 100644 src/main/agent-hooks/server-turn-started-at.test.ts create mode 100644 src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx delete mode 100644 src/renderer/src/components/native-chat/NativeChatTypingIndicatorRow.tsx create mode 100644 src/renderer/src/components/native-chat/native-chat-terminal-turn.test.ts create mode 100644 src/renderer/src/components/native-chat/native-chat-terminal-turn.ts delete mode 100644 src/renderer/src/components/native-chat/native-chat-typing-indicator.test.ts delete mode 100644 src/renderer/src/components/native-chat/native-chat-typing-indicator.ts create mode 100644 src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.test.ts create mode 100644 src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.ts create mode 100644 src/renderer/src/components/native-chat/use-native-chat-terminal-turn-timing.ts create mode 100644 src/renderer/src/store/slices/agent-status-turn-started-at.test.ts diff --git a/src/main/agent-hooks/server-turn-started-at.test.ts b/src/main/agent-hooks/server-turn-started-at.test.ts new file mode 100644 index 000000000000..63ebd136be60 --- /dev/null +++ b/src/main/agent-hooks/server-turn-started-at.test.ts @@ -0,0 +1,185 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { mkdtempSync, readFileSync, rmSync } from 'node:fs' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { AgentHookServer, _internals } from './server' +import { buildBody, postHookEvent, PANE } from './server.test-fixtures' + +const { getCohortAtEmitMock, trackMock } = vi.hoisted(() => ({ + getCohortAtEmitMock: vi.fn(), + trackMock: vi.fn() +})) + +vi.mock('../telemetry/client', () => ({ track: trackMock })) +vi.mock('../telemetry/cohort-classifier', () => ({ getCohortAtEmit: getCohortAtEmitMock })) + +beforeEach(() => { + _internals.resetCachesForTests() + getCohortAtEmitMock.mockReturnValue({}) +}) + +afterEach(() => { + vi.restoreAllMocks() +}) + +// Distinct host stamps: each event lands on a later millisecond than the one before it. +async function nextMillisecond(): Promise { + await new Promise((resolve) => setTimeout(resolve, 5)) +} + +// The execution host stamps when the main agent's turn began, so every reader (and a reload, which +// starts the renderer with no state history) gets the turn start rather than rebuilding it. +describe('the host-stamped turn start', () => { + const servers: AgentHookServer[] = [] + let userDataPath: string + + beforeEach(() => { + userDataPath = mkdtempSync(join(tmpdir(), 'orca-turn-started-at-')) + }) + + afterEach(() => { + for (const server of servers) { + server.stop() + } + servers.length = 0 + rmSync(userDataPath, { recursive: true, force: true }) + }) + + async function startServer(): Promise { + const server = new AgentHookServer() + servers.push(server) + await server.start({ env: 'production', userDataPath }) + return server + } + + async function post(server: AgentHookServer, payload: Record): Promise { + const response = await postHookEvent(server, buildBody(payload)) + expect(response.status).toBe(204) + await nextMillisecond() + } + + function turnStartedAt(server: AgentHookServer): number | undefined { + return server.getStatusSnapshot()[0]?.turnStartedAt + } + + it('stamps a new main-agent turn and carries it across tools, a wait and its answer', async () => { + const server = await startServer() + await post(server, { hook_event_name: 'UserPromptSubmit', prompt: 'Rename the module' }) + const started = turnStartedAt(server) + expect(started).toBe(server.getStatusSnapshot()[0]?.stateStartedAt) + + const bash = { tool_name: 'Bash', tool_input: { command: 'pnpm build' }, tool_use_id: 'tu-1' } + await post(server, { hook_event_name: 'PreToolUse', ...bash }) + await post(server, { hook_event_name: 'PermissionRequest', ...bash }) + expect(server.getStatusSnapshot()[0]).toMatchObject({ state: 'waiting' }) + await post(server, { hook_event_name: 'PostToolUse', ...bash }) + // The answer restarted the state clock, not the turn's. + expect(server.getStatusSnapshot()[0]).toMatchObject({ state: 'working' }) + expect(server.getStatusSnapshot()[0]?.stateStartedAt).toBeGreaterThan(started!) + expect(turnStartedAt(server)).toBe(started) + + await post(server, { hook_event_name: 'Stop' }) + // Kept on the finished turn, so a reader can time it from the host's own facts. + expect(server.getStatusSnapshot()[0]).toMatchObject({ state: 'done', turnStartedAt: started }) + }) + + it('is not stamped by a child agent, and the same prompt sent again is a new turn', async () => { + const server = await startServer() + await post(server, { hook_event_name: 'UserPromptSubmit', prompt: 'Rename the module' }) + const started = turnStartedAt(server) + + await post(server, { + hook_event_name: 'UserPromptSubmit', + prompt: 'child task', + agent_id: 'child-1' + }) + expect(turnStartedAt(server)).toBe(started) + + // Esc at a permission prompt fires no hook, so the resend follows the stale wait directly. + await post(server, { hook_event_name: 'PermissionRequest', tool_name: 'Bash', tool_input: {} }) + await post(server, { hook_event_name: 'UserPromptSubmit', prompt: 'Rename the module' }) + expect(turnStartedAt(server)).toBeGreaterThan(started!) + }) + + it('is not stamped by a relayed replay', async () => { + const server = await startServer() + const envelope = { + paneKey: PANE, + tabId: 'tab-1', + source: 'claude' as const, + hookEventName: 'UserPromptSubmit', + payload: { state: 'working' as const, prompt: 'relayed', agentType: 'claude' as const } + } + server.ingestRemote(envelope, 'ssh-turn') + const started = turnStartedAt(server) + expect(started).toEqual(expect.any(Number)) + await nextMillisecond() + + server.ingestRemote({ ...envelope, isReplay: true }, 'ssh-turn') + expect(turnStartedAt(server)).toBe(started) + }) + + // A session start lands an idle boundary row: no turn is open until the next prompt. + it('clears on a session boundary', async () => { + const server = await startServer() + await post(server, { hook_event_name: 'UserPromptSubmit', prompt: 'Rename the module' }) + expect(turnStartedAt(server)).toEqual(expect.any(Number)) + + await post(server, { hook_event_name: 'SessionStart', source: 'clear' }) + expect(server.getStatusSnapshot()[0]).toMatchObject({ state: 'done', sessionBoundary: true }) + expect(server.getStatusSnapshot()[0]).not.toHaveProperty('turnStartedAt') + }) + + // An OSC repaint can land before the prompt hook; it must not count from the finished turn. + it('drops the stamp when a finished main agent runs again with no turn-opening event', async () => { + const server = await startServer() + await post(server, { hook_event_name: 'UserPromptSubmit', prompt: 'Rename the module' }) + await post(server, { hook_event_name: 'Stop' }) + expect(turnStartedAt(server)).toEqual(expect.any(Number)) + + server.ingestTerminalStatus({ + paneKey: PANE, + tabId: 'tab-1', + worktreeId: 'wt-1', + payload: { state: 'working', prompt: 'Rename the module', agentType: 'claude' } + }) + expect(server.getStatusSnapshot()[0]).toMatchObject({ state: 'working' }) + expect(server.getStatusSnapshot()[0]).not.toHaveProperty('turnStartedAt') + }) + + it('cannot be declared by a producer', async () => { + const server = await startServer() + await post(server, { + hook_event_name: 'UserPromptSubmit', + prompt: 'Rename the module', + turnStartedAt: 1 + }) + await post(server, { hook_event_name: 'PreToolUse', tool_name: 'Bash', turnStartedAt: 1 }) + expect(turnStartedAt(server)).toBeGreaterThan(1) + }) + + it('reaches the live push and survives a restart through the status file', async () => { + const server = await startServer() + const pushed: (number | undefined)[] = [] + server.setListener((status) => pushed.push(status.turnStartedAt)) + await post(server, { hook_event_name: 'UserPromptSubmit', prompt: 'Rename the module' }) + await post(server, { hook_event_name: 'PreToolUse', tool_name: 'Bash', tool_input: {} }) + const started = turnStartedAt(server) + expect(pushed.at(-1)).toBe(started) + server.flushStatusPersistSync() + server.stop() + const file = JSON.parse( + readFileSync(join(userDataPath, 'agent-hooks', 'last-status.json'), 'utf8') + ) + expect(file.entries[PANE].turnStartedAt).toBe(started) + + const restarted = await startServer() + expect(restarted.getStatusSnapshot()[0]).toMatchObject({ + restoredUnconfirmed: true, + turnStartedAt: started + }) + // The turn goes on after the restart: the next event carries the restored stamp. + await post(restarted, { hook_event_name: 'PostToolUse', tool_name: 'Bash', tool_input: {} }) + expect(turnStartedAt(restarted)).toBe(started) + }) +}) diff --git a/src/main/agent-hooks/server/server-persistence-validation.ts b/src/main/agent-hooks/server/server-persistence-validation.ts index f88766217c11..7203f174a0ee 100644 --- a/src/main/agent-hooks/server/server-persistence-validation.ts +++ b/src/main/agent-hooks/server/server-persistence-validation.ts @@ -149,6 +149,7 @@ export function sanitizeHydratedEntry( source === 'claude' && (record.compactTrigger === 'manual' || record.compactTrigger === 'auto') ? record.compactTrigger : undefined + const turnStartedAt = record.turnStartedAt return { paneKey, source, @@ -170,7 +171,10 @@ export function sanitizeHydratedEntry( retainedForLiveness: retainedForLiveness ? true : undefined, payload, receivedAt, - stateStartedAt + stateStartedAt, + ...(typeof turnStartedAt === 'number' && Number.isFinite(turnStartedAt) && turnStartedAt > 0 + ? { turnStartedAt } + : {}) } } diff --git a/src/main/agent-hooks/server/server-status-application.ts b/src/main/agent-hooks/server/server-status-application.ts index 8863dc178b96..674fa8a0760a 100644 --- a/src/main/agent-hooks/server/server-status-application.ts +++ b/src/main/agent-hooks/server/server-status-application.ts @@ -10,6 +10,7 @@ import type { AgentStatusObservationOrigin } from '../../../shared/agent-status-observation' import { AGENT_STATUS_2A_CURRENT_PRODUCER_MODE } from '../../../shared/agent-status-legacy-adapter' +import type { AgentStatusState, ParsedAgentStatusPayload } from '../../../shared/agent-status-types' import { admitLegacyAgentStatus } from '../../../shared/agent-hook-listener/listener-state' import type { EnrichedAgentHookEventPayload } from './server-types' import { agentTypeToPromptSentAgentKind } from './server-status-identity' @@ -18,6 +19,41 @@ import { AgentHookServerStatusDisposition } from './server-status-disposition' /** Bounds the retained observation clock; eviction only degrades a replay to `now`. */ const MAX_REMEMBERED_EVIDENCE_OBSERVATIONS = 1024 +function mainAgentState(payload: ParsedAgentStatusPayload): AgentStatusState { + return payload.mainAgent?.state ?? payload.state +} + +/** + * When the main agent's current turn began. Its own turn-opening event stamps it (the same + * classifier the observation boundary uses), except a session boundary, which lands idle with no + * turn open. Replays, child events and identity-only rows restate a turn rather than open one. + */ +function resolveTurnStartedAt( + previous: EnrichedAgentHookEventPayload | undefined, + payload: AgentHookEventPayload, + at: number +): number | undefined { + if ( + payload.source !== undefined && + payload.toolAgentId === undefined && + payload.isReplay !== true && + payload.providerSessionOnly !== true && + isNewTurnEvent(payload.source, payload.hookEventName) + ) { + return payload.payload.sessionBoundary === true ? undefined : at + } + // Why: a settled main agent running again with no opening event (an OSC repaint racing the + // prompt hook) is a turn edge nothing dated; carrying the old stamp would count from that turn. + if ( + previous && + mainAgentState(previous.payload) === 'done' && + mainAgentState(payload.payload) !== 'done' + ) { + return undefined + } + return previous?.turnStartedAt +} + export abstract class AgentHookServerStatusApplication extends AgentHookServerStatusDisposition { protected refreshTerminalStatusEvidence( previous: EnrichedAgentHookEventPayload, @@ -113,12 +149,15 @@ export abstract class AgentHookServerStatusApplication extends AgentHookServerSt previous && previous.payload.state === payload.payload.state && !commandCodeNewTurn ? previous.stateStartedAt : (observedAt ?? now) + const turnStartedAt = resolveTurnStartedAt(previous, payload, observedAt ?? now) // Why: `stateStartedAt` tracks the current state, while `receivedAt` tracks every arrival. return { ...payload, receivedAt: now, evidenceObservedAt: observedAt ?? this.resolveEvidenceObservedAt(payload, previous, now), - stateStartedAt + stateStartedAt, + // Always written here, so a producer can never declare it. + turnStartedAt } } diff --git a/src/main/agent-hooks/server/server-status-identity.ts b/src/main/agent-hooks/server/server-status-identity.ts index 1694c4b1b676..4400b43efeeb 100644 --- a/src/main/agent-hooks/server/server-status-identity.ts +++ b/src/main/agent-hooks/server/server-status-identity.ts @@ -63,6 +63,7 @@ export function toAgentStatusIpcPayload( ? { evidenceObservedAt: entry.evidenceObservedAt } : {}), stateStartedAt: entry.stateStartedAt, + ...(entry.turnStartedAt !== undefined ? { turnStartedAt: entry.turnStartedAt } : {}), ...(entry.providerSession ? { providerSession: entry.providerSession } : {}), ...(entry.providerSessionOnly ? { providerSessionOnly: true } : {}), ...(entry.promptInteractionKey ? { promptInteractionKey: entry.promptInteractionKey } : {}), diff --git a/src/main/agent-hooks/server/server-types.ts b/src/main/agent-hooks/server/server-types.ts index d14667977986..79b4e569cdd6 100644 --- a/src/main/agent-hooks/server/server-types.ts +++ b/src/main/agent-hooks/server/server-types.ts @@ -19,6 +19,9 @@ export type EnrichedAgentHookEventPayload = AgentHookEventPayload & { * main restart; absent means "never separately observed" and consumers use `receivedAt`. */ evidenceObservedAt?: number stateStartedAt: number + /** When the main agent's current turn began, on this server's clock. Stamped only here, from the + * main agent's own turn-opening event; absent when no such event was seen. */ + turnStartedAt?: number /** Provenance/ordering stamped by this server as the pane authority (STA-4293). Read by nothing yet. */ observation?: AgentStatusObservation /** Stamped at hydrate for nonterminal states; never persisted (hydrate re-stamps) and cleared by any accepted live event replacing the entry. */ diff --git a/src/main/startup/main-window-agent-status.ts b/src/main/startup/main-window-agent-status.ts index 5899b2fe6bdd..38bb380d7247 100644 --- a/src/main/startup/main-window-agent-status.ts +++ b/src/main/startup/main-window-agent-status.ts @@ -35,6 +35,7 @@ export function installMainWindowAgentStatusListeners(options: MainWindowAgentSt receivedAt, evidenceObservedAt, stateStartedAt, + turnStartedAt, launchToken, providerSession, providerSessionOnly, @@ -89,6 +90,7 @@ export function installMainWindowAgentStatusListeners(options: MainWindowAgentSt receivedAt, ...(evidenceObservedAt !== undefined ? { evidenceObservedAt } : {}), stateStartedAt, + ...(turnStartedAt !== undefined ? { turnStartedAt } : {}), ...(providerSession ? { providerSession } : {}), ...(promptInteractionKey ? { promptInteractionKey } : {}), ...(restoredUnconfirmed ? { restoredUnconfirmed: true } : {}), diff --git a/src/main/startup/main-window-structured-status-filter.test.ts b/src/main/startup/main-window-structured-status-filter.test.ts index c7fe55da626d..da26a593d00f 100644 --- a/src/main/startup/main-window-structured-status-filter.test.ts +++ b/src/main/startup/main-window-structured-status-filter.test.ts @@ -94,3 +94,11 @@ it('forwards retirement acknowledgement only on live status delivery', () => { expect(sent[0].event).toHaveProperty('authorityRestartId', 'retirement-id') expect(sent[1].event).not.toHaveProperty('authorityRestartId') }) + +// The live push picks fields one by one; the host's turn start must be one of them. +it("forwards the host's turn start, and nothing when the host stamped none", () => { + hooks.listener!(statusPayload({ turnStartedAt: 1 })) + hooks.listener!(statusPayload({})) + expect(sent[0].event).toHaveProperty('turnStartedAt', 1) + expect(sent[1].event).not.toHaveProperty('turnStartedAt') +}) diff --git a/src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx b/src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx index 8e621a8a441b..9549fc933e73 100644 --- a/src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatAwaitingInputRow.tsx @@ -72,9 +72,15 @@ export function NativeChatAwaitingInputRow({ const questions = subject?.kind === 'questions' && listsQuestions ? subject.questions : null // A count always hides its questions, so the list needs no clipping measurement. const toggles = questions !== null || (question !== null && (open || clipped)) - const label = pending - ? translate('components.native-chat.ask.awaiting', NATIVE_CHAT_ASK_ROW_COPY.awaiting) - : translate('components.native-chat.ask.asked', NATIVE_CHAT_ASK_ROW_COPY.asked) + // With nothing to name, the label must read as a whole phrase, not end on a colon. + const label = !pending + ? translate('components.native-chat.ask.asked', NATIVE_CHAT_ASK_ROW_COPY.asked) + : subject === null + ? translate( + 'components.native-chat.ask.awaitingUnnamed', + NATIVE_CHAT_ASK_ROW_COPY.awaitingUnnamed + ) + : translate('components.native-chat.ask.awaiting', NATIVE_CHAT_ASK_ROW_COPY.awaiting) const text = subject === null ? null diff --git a/src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx b/src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx index cd08f779e712..303ab2472c79 100644 --- a/src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx @@ -33,6 +33,7 @@ vi.mock('../../store', () => ({ })) import { NativeChatInteractiveCard } from './NativeChatInteractiveCard' +import { useNativeChatInteractivePromptCard } from './use-native-chat-interactive-prompt-card' const mocks = { sendAnswer: vi.fn(), @@ -45,6 +46,8 @@ function renderCard(canSend = true): ReturnType { return render(cardElement(canSend)) } +const NO_MESSAGES: readonly NativeChatMessage[] = [] + function cardElement( canSend = true, messages?: readonly NativeChatMessage[], @@ -52,11 +55,36 @@ function cardElement( transcriptSettled = true ): React.JSX.Element { return ( - + ) +} + +// The view derives the card and hands it over; this stands in for that view. +function CardHarness({ + canSend, + messages, + onShowingQuestionChange, + transcriptSettled +}: { + canSend: boolean + messages?: readonly NativeChatMessage[] + onShowingQuestionChange?: (showing: boolean) => void + transcriptSettled: boolean +}): React.JSX.Element | null { + const card = useNativeChatInteractivePromptCard({ + paneKey: 'tab-1:leaf-1', + messages: messages ?? NO_MESSAGES, + transcriptSettled: transcriptSettled && messages !== undefined + }) + return ( + void @@ -51,26 +36,7 @@ export function NativeChatInteractiveCard({ * a target while the composer is unmounted. */ answerInputRef?: React.RefObject }): React.JSX.Element | null { - const interactivePrompt = useAppStore( - (s) => s.agentStatusByPaneKey[paneKey]?.interactivePrompt ?? null - ) - // Thread the sibling `toolName` from the same status entry so the question - // parser can dispatch through the tool's registered parser (mobile parity). - const interactiveToolName = useAppStore((s) => s.agentStatusByPaneKey[paneKey]?.toolName ?? null) const { sendAnswer, sendRaw, cancelPending, cancel } = send - - const card = useMemo(() => { - const statusCard = parseInteractivePrompt(interactivePrompt, interactiveToolName ?? undefined) - if (statusCard?.kind === 'approval') { - return statusCard - } - const prompt = resolveNativeChatAsk({ - liveAsk: statusCard?.prompt ?? null, - messages: messages ?? [], - transcriptSettled: transcriptSettled && messages != null - }) - return prompt ? { kind: 'question' as const, prompt } : null - }, [interactivePrompt, interactiveToolName, messages, transcriptSettled]) const cardKey = useMemo(() => nativeChatCardDismissKey(card), [card]) const [dismissedKey, setDismissedKey] = useState(null) // A question answer is a paced multi-step write (body→Enter per question); keep diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.task-list-frames.test.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.task-list-frames.test.tsx index 4be1ea7cdb38..82b2c43d4681 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.task-list-frames.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.task-list-frames.test.tsx @@ -70,7 +70,6 @@ function transcript(messages: NativeChatMessage[], sessionId = 'live-codex') { isWorking={false} expandSignal fontScale={1} - showTurnStatus={false} /> ) } diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.tool-stream-cost.test.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.tool-stream-cost.test.tsx index 2a2401bea52d..a77d2907b6a2 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.tool-stream-cost.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.tool-stream-cost.test.tsx @@ -44,15 +44,7 @@ function Transcript({ items }: { items: AgentJournalRenderItem[] }) { loadEarlier, readPhase: 'ready' } - return ( - - ) + return } function row(index: number, body: AgentJournalRenderItem['body']): AgentJournalRenderItem { diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx index ee697732671f..6e0c29d9d71b 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.tsx @@ -10,9 +10,8 @@ import { nativeChatTaskListPredecessors } from './native-chat-task-list-history' import { NativeChatTaskList } from './NativeChatTaskList' import { projectNativeChatTaskListFrames } from './native-chat-task-list-frames' import { omitNativeChatThreadGoalRows } from './native-chat-thread-goal-rows' -import { shouldShowNativeChatTypingIndicator } from './native-chat-typing-indicator' import { useNativeChatTurnStatus } from './use-native-chat-turn-status' -import { NativeChatTypingIndicatorRow } from './NativeChatTypingIndicatorRow' +import { NativeChatAwaitingInputRow } from './NativeChatAwaitingInputRow' import type { RuntimeFileOperationArgs } from '@/runtime/runtime-file-client' import type { NativeChatTurnActivity } from '../../../../shared/native-chat-turn-activity' import { NativeChatTurnActivityLine } from './NativeChatTurnActivityLine' @@ -59,6 +58,10 @@ export { ProviderFrameRow } from './NativeChatTranscriptChrome' const MAX_EXPANDED_TURNS = 128 +/** The turn is blocked on the reader. `shown`: the pane draws the prompt itself, as a card; + * `unshown`: it cannot (the prompt is only in the agent's terminal). */ +export type NativeChatAwaitingInput = 'shown' | 'unshown' + type NativeChatNavigationRequest = | { kind: 'diff'; target: NativeChatDiffReveal } | { kind: 'rail'; messageId: string; requestId: number } @@ -78,8 +81,7 @@ export function NativeChatMessageList({ activeTurnOpenedBy, turnKeysByItemId = null, deliveryNotices, - showTurnStatus = true, - showLiveTurnActivity = true, + awaitingInput = null, turnActivity, runtimeContext }: { @@ -94,7 +96,8 @@ export function NativeChatMessageList({ /** Chat-only text multiplier (1 = default), driven by the zoom shortcuts. */ fontScale: number workingStartedAt?: number | null - /** Host-recorded turn durations keyed by user message id (structured lane). */ + /** Recorded turn durations keyed by user message id (the host's, or the transcript's). + * A turn missing here shows the duration this list observed, if it saw the turn run. */ settledTurns?: NativeChatSettledTurns /** The key the host says anchors the running turn's bar (structured lane). */ activeTurnOpenedBy?: string | null @@ -104,10 +107,8 @@ export function NativeChatMessageList({ onLinkClick?: CommentMarkdownLinkClickHandler allowFileUriLinks?: boolean deliveryNotices?: ReadonlyMap - /** Turn timing and disclosure are available on structured agent sessions. */ - showTurnStatus?: boolean - /** Whether the active turn's foreground activity row should be visible. */ - showLiveTurnActivity?: boolean + /** Set while the turn waits on the reader; the live activity line yields to it. */ + awaitingInput?: NativeChatAwaitingInput | null turnActivity?: NativeChatTurnActivity | null runtimeContext?: RuntimeFileOperationArgs | null }): React.JSX.Element { @@ -162,14 +163,11 @@ export function NativeChatMessageList({ const subagentLabels = useMemo(() => nativeChatSubagentLabels(messages), [messages]) const taskListPredecessors = useMemo(() => nativeChatTaskListPredecessors(messages), [messages]) const taskListState = useMemo(() => nativeChatTaskListState(messages), [messages]) - const showTypingIndicator = showTurnStatus - ? isWorking - : shouldShowNativeChatTypingIndicator({ messages, isWorking }) // Resolve each row's owning turn once. Prefix slice/findLast in the render // loop becomes quadratic for long transcripts. const turnKeys = useMemo( - () => nativeChatRowTurnKeys(messages, showTurnStatus ? turnKeysByItemId : null), - [messages, showTurnStatus, turnKeysByItemId] + () => nativeChatRowTurnKeys(messages, turnKeysByItemId), + [messages, turnKeysByItemId] ) const turnDiffs = useMemo( () => @@ -188,11 +186,19 @@ export function NativeChatMessageList({ const turnStatuses = useNativeChatTurnStatus({ messages, activeTurnKey, - isWorking: showTurnStatus && isWorking, - workingStartedAt: showTurnStatus ? workingStartedAt : null, - settledTurns: showTurnStatus ? settledTurns : null, + isWorking, + workingStartedAt, + settledTurns, thinking }) + // The transcript tail: what the running turn is doing, or that it waits on a + // prompt nothing else on screen shows. A prompt card says so itself. + const tailRow = + awaitingInput === 'unshown' + ? 'awaiting-input' + : isWorking && awaitingInput === null + ? 'activity' + : null const lifecycleWorking = session.transcriptLifecycle?.state === 'working' const slots = useMemo( () => @@ -203,7 +209,6 @@ export function NativeChatMessageList({ receipts, turnStatuses, turnDiffs, - showTurnStatus, expandedTurnKeys: expandedTurnIds, isWorking, lifecycleWorking, @@ -216,7 +221,6 @@ export function NativeChatMessageList({ lifecycleWorking, messages, receipts, - showTurnStatus, subagentLabels, turnDiffs, turnKeys, @@ -236,7 +240,7 @@ export function NativeChatMessageList({ contentRef, itemCount: slots.length, isWorking, - showTypingIndicator, + showsTailRow: tailRow !== null, isVisible, alignToViewportTop: transcriptWindow.alignToViewportTop, scrollToEnd: transcriptWindow.scrollToEnd, @@ -331,7 +335,6 @@ export function NativeChatMessageList({ const rowContext = useMemo( () => ({ expandSignal, - showTurnStatus, revealedDiff, taskListPredecessors, expandedTurnIds, @@ -353,7 +356,6 @@ export function NativeChatMessageList({ revealedDiff, runtimeContext, scrollMessageToTop, - showTurnStatus, taskListPredecessors, toggleExpandedTurn ] @@ -398,13 +400,14 @@ export function NativeChatMessageList({ context={rowContext} window={transcriptWindow} /> - {showTurnStatus && showLiveTurnActivity && isWorking ? ( + {tailRow === 'activity' ? ( + ) : tailRow === 'awaiting-input' ? ( + ) : null} - {!showTurnStatus && showTypingIndicator ? : null}
    diff --git a/src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx b/src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx index 8400b592e7d5..e8d714fad1aa 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageList.turn-indicator.test.tsx @@ -166,7 +166,7 @@ describe('NativeChatMessageList turn indicator', () => { }} journalItems={[journalItem(1, turnItem), journalItem(2, reasoningRow)]} isWorking - showLiveTurnActivity={false} + awaitingInput="shown" expandSignal={false} fontScale={1} /> @@ -178,6 +178,38 @@ describe('NativeChatMessageList turn indicator', () => { expect(screen.getByText('Running 1 command')).toHaveClass('animate-pulse') }) + // A terminal-backed pane can learn its agent is waiting without being handed + // the prompt; the tail then says so, in the row a question uses. + it('says the turn waits on the reader when no card shows the prompt', () => { + const { container } = render( + + ) + + expect(container.querySelector('[data-native-chat-ask-row="awaiting"]')).toHaveTextContent( + /^Awaiting user input$/ + ) + expect(container.querySelector('[data-native-chat-turn-activity]')).toBeNull() + expect(screen.getByText('Working for 5s')).toBeInTheDocument() + }) + it('keeps the live row up after a tool settles', () => { render( { expect(liveRun?.querySelector('.lucide-check')).toBeInTheDocument() }) - it('keeps bridge chats on the legacy activity chrome', () => { - render( - - ) - - expect(screen.queryByText('Thinking')).toBeNull() - expect(screen.queryByRole('button', { name: 'Toggle turn details' })).toBeNull() - expect(screen.queryByText('Running sleep 5')).toBeNull() - expect(document.querySelectorAll('.animate-bounce')).toHaveLength(3) - }) - it('replaces a bridge ask row and settles it from the FIFO tool result', () => { const user = { id: 'bridge-user', @@ -355,7 +351,6 @@ describe('NativeChatMessageList turn indicator', () => { isWorking={false} expandSignal={false} fontScale={1} - showTurnStatus={false} /> ) @@ -382,7 +377,6 @@ describe('NativeChatMessageList turn indicator', () => { isWorking={false} expandSignal={false} fontScale={1} - showTurnStatus={false} /> ) diff --git a/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx b/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx index 59e70cfc7e1a..e43a758051b8 100644 --- a/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatMessageRow.tsx @@ -47,7 +47,6 @@ export const MessageRow = memo(function MessageRow({ onLinkClick, allowFileUriLinks = false, deliveryNotice, - structuredActivityUi = true, folded = false, subagentLabel, runtimeContext @@ -65,7 +64,6 @@ export const MessageRow = memo(function MessageRow({ onLinkClick?: CommentMarkdownLinkClickHandler allowFileUriLinks?: boolean deliveryNotice?: NativeChatDeliveryNotice - structuredActivityUi?: boolean /** Behind a folded turn: the row keeps only what outlives the turn. */ folded?: boolean /** The roster's name for the subagent that wrote this row, when one names it. */ @@ -269,7 +267,6 @@ export const MessageRow = memo(function MessageRow({ expandSignal={expandSignal} activeTurnIsWorking={activeTurnIsWorking} trailing={trailingRun} - structuredActivityUi={structuredActivityUi} disclosureId={message.id} /> ) : null} diff --git a/src/renderer/src/components/native-chat/NativeChatResolvedView.tsx b/src/renderer/src/components/native-chat/NativeChatResolvedView.tsx index fb432e1e5b4c..786ade25ebcd 100644 --- a/src/renderer/src/components/native-chat/NativeChatResolvedView.tsx +++ b/src/renderer/src/components/native-chat/NativeChatResolvedView.tsx @@ -11,12 +11,12 @@ import { NativeChatComposer, type NativeChatComposerHandle } from './NativeChatC import { useNativeChatFontScale } from './use-native-chat-font-scale' import { useNativeChatCanSend } from './use-native-chat-can-send' import { NativeChatInteractiveCard } from './NativeChatInteractiveCard' +import { useNativeChatInteractivePromptCard } from './use-native-chat-interactive-prompt-card' import { NativeChatEmptyState } from './NativeChatEmptyState' import { useNativeChatInteractiveSend } from './use-native-chat-interactive-send' -import { - shouldClearNativeChatWorkingSuppression, - shouldShowNativeChatWorking -} from './native-chat-working-suppression' +import { shouldClearNativeChatWorkingSuppression } from './native-chat-working-suppression' +import { resolveNativeChatTerminalTurn } from './native-chat-terminal-turn' +import { useNativeChatTerminalTurnTiming } from './use-native-chat-terminal-turn-timing' import { appendPendingSendCache, launchPromptAsMessage, @@ -251,6 +251,11 @@ export function NativeChatResolvedView({ paneLaunchPrompt?.failed ? launchPromptMessage?.id : null, sessionAfterCommandBoundaries.messages ) + const promptCard = useNativeChatInteractivePromptCard({ + paneKey, + messages: sessionAfterCommandBoundaries.messages, + transcriptSettled: session.readPhase === 'ready' + }) // The streaming preview bubble (if any) sits after the transcript but before // the optimistic user echoes — same order mobile uses. @@ -313,11 +318,14 @@ export function NativeChatResolvedView({ previousWorkingEpochRef.current = null } }, [liveWorking, workingInterrupted, hookWorkingEpoch]) - const isWorking = shouldShowNativeChatWorking({ + const { isWorking, turnActive, awaitingInput } = resolveNativeChatTerminalTurn({ isConversation, working: liveWorking, - interrupted: workingInterrupted + hookAwaitingInput: session.hookAwaitingInput === true, + interrupted: workingInterrupted, + hasPromptCard: promptCard !== null }) + const turnTiming = useNativeChatTerminalTurnTiming(paneKey, session.messages, turnActive) const stopAgent = useCallback(() => { setWorkingInterrupted(true) @@ -399,11 +407,11 @@ export function NativeChatResolvedView({ diff --git a/src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx b/src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx new file mode 100644 index 000000000000..ba2a7c00de20 --- /dev/null +++ b/src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx @@ -0,0 +1,401 @@ +// @vitest-environment happy-dom + +import '@testing-library/jest-dom/vitest' + +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import { act, cleanup, render, screen } from '@testing-library/react' +import type { AgentStatusEntry, AgentStatusPayload } from '../../../../shared/agent-status-types' +import type { NativeChatMessage } from '../../../../shared/native-chat-types' +import type { NativeChatLiveSession } from './use-native-chat-live-session' + +// The transcript source and the composer are stubbed; the wire under test is +// store status -> resolved view -> the shared message list and prompt card. +const retained = vi.hoisted((): { session: NativeChatLiveSession | null } => ({ session: null })) +vi.mock('./use-native-chat-retained-session', () => ({ + useNativeChatRetainedSession: () => retained.session +})) +vi.mock('./NativeChatComposer', () => ({ NativeChatComposer: () => null })) + +const { NativeChatResolvedView } = await import('./NativeChatResolvedView') +const { useAppStore } = await import('../../store') +const { installNativeChatMessageListTestViewport } = + await import('./native-chat-message-list-test-viewport') + +const paneKey = 'tab-state:leaf-state' +let restoreViewport = (): void => {} + +const userTurn: NativeChatMessage = { + id: 'user-1', + role: 'user', + blocks: [{ type: 'text', text: 'Rename the module' }], + timestamp: 1, + source: 'transcript' +} + +const askCall: NativeChatMessage = { + id: 'ask-1', + role: 'assistant', + blocks: [ + { + type: 'tool-call', + name: 'AskUserQuestion', + input: { + questions: [ + { + question: 'Which name?', + multiSelect: false, + options: [{ label: 'core' }, { label: 'base' }] + } + ] + } + } + ], + timestamp: 2, + source: 'transcript' +} + +const stepCall: NativeChatMessage = { + id: 'step-1', + role: 'assistant', + blocks: [{ type: 'tool-call', name: 'Bash', input: { command: 'pnpm build' } }], + timestamp: 3, + source: 'transcript' +} + +// `status` and `hookAwaitingInput` are what the live session reconciles from the +// same hook row; the test states both so the view is fed a consistent session. +function transcript( + status: NativeChatLiveSession['status'], + hookAwaitingInput: boolean, + messages: NativeChatMessage[] = [userTurn] +): NativeChatLiveSession { + return { + messages, + status, + sessionId: 'session-state', + agent: 'claude', + hookAwaitingInput, + hasMore: false, + loadingEarlier: false, + olderHistoryGeneration: 0, + loadEarlier: vi.fn(), + readPhase: 'ready' + } +} + +function setStatus(payload: Omit, age = 0): void { + useAppStore + .getState() + .setAgentStatus(paneKey, { prompt: 'Rename the module', agentType: 'claude', ...payload }) + const live = useAppStore.getState().agentStatusByPaneKey[paneKey] + if (!live) { + throw new Error('the store dropped the status row this test depends on') + } + useAppStore.setState((store) => ({ + agentStatusByPaneKey: { + ...store.agentStatusByPaneKey, + [paneKey]: { ...live, stateStartedAt: Date.now() - age } + } + })) +} + +function patchStatus(fields: Partial): void { + useAppStore.setState((store) => ({ + agentStatusByPaneKey: { + ...store.agentStatusByPaneKey, + [paneKey]: { ...store.agentStatusByPaneKey[paneKey]!, ...fields } + } + })) +} + +function renderPane(): void { + render( + + ) +} + +function liveActivityLine(): Element | null { + return document.querySelector('[data-native-chat-turn-activity]') +} + +beforeEach(() => { + restoreViewport = installNativeChatMessageListTestViewport() + useAppStore.setState({ agentStatusByPaneKey: {}, nativeChatLaunchPromptByTabId: {} }) +}) + +afterEach(() => { + cleanup() + restoreViewport() + useAppStore.setState({ agentStatusByPaneKey: {}, nativeChatLaunchPromptByTabId: {} }) +}) + +// A terminal-backed pane renders through the structured chat's own turn-status +// UI: the clock bar under the prompt, the live line at the tail, and the row a +// question uses when the agent waits on the reader. +describe('NativeChatResolvedView turn status', () => { + it('counts the working turn from the host-stamped epoch, with the live line at the tail', () => { + retained.session = transcript('working', false) + setStatus({ state: 'working' }, 75_000) + + renderPane() + + expect(screen.getByText('Working for 1m 15s')).toBeInTheDocument() + expect(liveActivityLine()).toHaveTextContent('Working…') + expect(document.querySelectorAll('.animate-bounce')).toHaveLength(0) + }) + + it.each(['waiting', 'blocked'] as const)( + 'says a %s agent waits on the reader when only its terminal shows the prompt', + (state) => { + retained.session = transcript('ready', true) + setStatus({ state }, 20_000) + + renderPane() + + // A whole phrase: there is no question to name after a colon. + expect(screen.getByText('Awaiting user input')).toBeInTheDocument() + expect(liveActivityLine()).toBeNull() + // The turn runs on behind the wait, as a structured turn does behind its card. + expect(screen.getByText('Working for 20s')).toBeInTheDocument() + } + ) + + it('lets the approval card speak for the wait', () => { + retained.session = transcript('ready', true) + setStatus({ + state: 'waiting', + interactivePrompt: JSON.stringify({ approval: { tool: 'Bash', summary: 'rm -rf dist' } }) + }) + + renderPane() + + expect(screen.getByText('Allow Bash?')).toBeInTheDocument() + expect(screen.queryByText(/Awaiting user input/)).toBeNull() + expect(liveActivityLine()).toBeNull() + expect(screen.getByText('Working for 0s')).toBeInTheDocument() + }) + + it("keeps a pending question's transcript row awaiting while the agent waits", () => { + retained.session = transcript('ready', true, [userTurn, askCall]) + setStatus({ state: 'waiting' }) + + renderPane() + + // One row says it: the question's own, not a second one at the tail. + expect(document.querySelectorAll('[data-native-chat-ask-row="awaiting"]')).toHaveLength(1) + expect(screen.getByText('Awaiting user input:')).toBeInTheDocument() + expect(screen.getAllByText('Which name?').length).toBeGreaterThan(0) + expect(screen.queryByText('Asked:')).toBeNull() + }) + + // Answering a terminal-only prompt means leaving the chat, which remounts it on return; a reload + // also starts the store with no state history. The host's stamp covers both. + it("counts a turn it first sees after a wait from the host's turn start, not the last state", () => { + retained.session = transcript('working', false) + setStatus({ state: 'working' }, 5_000) + patchStatus({ turnStartedAt: Date.now() - 90_000, stateHistory: [] }) + + renderPane() + + expect(screen.getByText('Working for 1m 30s')).toBeInTheDocument() + }) + + // A background task holds the row 'working' past the last turn's end, so the row's own epoch is + // that turn's; the host stamps the new turn from the main agent's own prompt. + it('counts a new turn from its stamp, not a row held open by background work', () => { + retained.session = transcript('working', false) + setStatus({ state: 'working' }) + const now = Date.now() + patchStatus({ + stateStartedAt: now - 45 * 60_000, + turnStartedAt: now - 5_000, + mainAgent: { state: 'working', stateStartedAt: now - 5_000 }, + stateHistory: [] + }) + + renderPane() + + expect(screen.getByText('Working for 5s')).toBeInTheDocument() + }) + + it("falls back to the main agent's own clock on a host that stamps no turn", () => { + retained.session = transcript('working', false) + setStatus({ state: 'working' }) + const now = Date.now() + patchStatus({ + stateStartedAt: now - 45 * 60_000, + mainAgent: { state: 'working', stateStartedAt: now - 5_000 }, + stateHistory: [] + }) + + renderPane() + + expect(screen.getByText('Working for 5s')).toBeInTheDocument() + }) + + // An Esc at a permission prompt fires no hook, then the same text is sent again: a new turn. + it('counts the same prompt sent again as a new turn', () => { + retained.session = transcript('working', false) + setStatus({ state: 'working' }, 5_000) + const now = Date.now() + patchStatus({ + turnStartedAt: now - 5_000, + stateHistory: [ + { state: 'working', prompt: 'Rename the module', startedAt: now - 600_000 }, + { state: 'waiting', prompt: 'Rename the module', startedAt: now - 500_000 } + ] + }) + + renderPane() + + expect(screen.getByText('Working for 5s')).toBeInTheDocument() + }) + + // The reader no longer rebuilds a turn from the history, so an old host reads the state's start. + it('falls back to the current state start on a host that stamps no turn', () => { + retained.session = transcript('working', false) + setStatus({ state: 'working' }, 20_000) + const now = Date.now() + patchStatus({ + stateHistory: [ + { state: 'working', prompt: 'Rename the module', startedAt: now - 90_000 }, + { state: 'waiting', prompt: 'Rename the module', startedAt: now - 40_000 } + ] + }) + + renderPane() + + expect(screen.getByText('Working for 20s')).toBeInTheDocument() + }) + + // The host recorded the turn's end, so a pane mounted after it (a switch to the terminal and + // back) folds it behind its duration instead of drawing it unfinished. + it('shows the host-ended latest turn with its host duration after a remount', () => { + retained.session = transcript('ready', false, [userTurn, stepCall]) + setStatus({ state: 'done' }) + // One clock read: the duration is the difference of these two stamps. + const now = Date.now() + patchStatus({ stateStartedAt: now - 10_000, turnStartedAt: now - 100_000 }) + + renderPane() + + expect(screen.getByText('Worked for 1m 30s')).toBeInTheDocument() + expect(screen.getByRole('button', { name: 'Toggle turn details' })).toBeInTheDocument() + }) + + // The store's staleness drops a silent row after 30 minutes. A wait left unanswered that long + // must not read as a finished turn: nothing says it ended. + it('does not settle a turn the host went quiet on', () => { + retained.session = transcript('ready', true, [userTurn, stepCall]) + setStatus({ state: 'waiting' }, 60_000) + patchStatus({ turnStartedAt: Date.now() - 60_000 }) + + renderPane() + expect(screen.getByText('Working for 1m 0s')).toBeInTheDocument() + + // The live session reads no hook state once the row is stale, so the wait no longer holds the turn. + retained.session = transcript('ready', false, [userTurn, stepCall]) + act(() => { + patchStatus({ updatedAt: Date.now() - 31 * 60_000 }) + }) + + expect(screen.queryByText(/Work(ing|ed) for/)).toBeNull() + expect(screen.queryByRole('button', { name: 'Toggle turn details' })).toBeNull() + expect(screen.getByText('pnpm build')).toBeInTheDocument() + }) + + it('folds finished turns from history behind their transcript duration', () => { + const at = Date.parse('2026-09-28T10:00:00.000Z') + retained.session = transcript('ready', false, [ + { ...userTurn, timestamp: at }, + { + id: 'answer-1', + role: 'assistant', + blocks: [{ type: 'text', text: 'Renamed.' }], + timestamp: at + 45_000, + source: 'transcript' + }, + { + id: 'user-2', + role: 'user', + blocks: [{ type: 'text', text: 'Now add tests' }], + timestamp: at + 100_000, + source: 'transcript' + } + ]) + setStatus({ state: 'done' }, 60_000) + + renderPane() + + expect(screen.getByText('Worked for 45s')).toBeInTheDocument() + // The latest turn has no recorded end, and this pane never watched it. + expect(screen.getAllByText(/Work(ing|ed) for/)).toHaveLength(1) + }) + + // The transcript draws no row for harness notices, so they cannot end a turn either. + it('keeps a running turn open across a harness notice injected mid-turn', () => { + const at = Date.parse('2026-09-28T10:00:00.000Z') + retained.session = transcript('working', false, [ + { ...userTurn, timestamp: at }, + { + id: 'progress-1', + role: 'assistant', + blocks: [{ type: 'text', text: 'Starting the build.' }], + timestamp: at + 10_000, + source: 'transcript' + }, + { + id: 'notice-1', + role: 'user', + blocks: [{ type: 'text', text: '\nb1' }], + timestamp: at + 20_000, + source: 'transcript' + }, + { + id: 'progress-2', + role: 'assistant', + blocks: [{ type: 'text', text: 'Build finished, checking output.' }], + timestamp: at + 25_000, + source: 'transcript' + } + ]) + setStatus({ state: 'working' }, 30_000) + + renderPane() + + expect(screen.getByText('Working for 30s')).toBeInTheDocument() + expect(screen.getByText('Starting the build.')).toBeInTheDocument() + expect(screen.queryByRole('button', { name: 'Toggle turn details' })).toBeNull() + }) + + it('stays quiet on a settled turn it never watched', () => { + retained.session = transcript('ready', false) + setStatus({ state: 'done' }, 60_000) + + renderPane() + + expect(screen.queryByText(/Awaiting user input/)).toBeNull() + expect(screen.queryByText(/Work(ing|ed) for/)).toBeNull() + expect(liveActivityLine()).toBeNull() + }) + + it('stays quiet when the pane has no status at all', () => { + retained.session = transcript('ready', false) + + renderPane() + + expect(screen.queryByText(/Awaiting user input/)).toBeNull() + expect(screen.queryByText(/Work(ing|ed) for/)).toBeNull() + expect(liveActivityLine()).toBeNull() + }) +}) diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx index 5689cf9689f8..1f97046363ce 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx @@ -52,8 +52,7 @@ type StructuredSessionMessageListProps = { allowFileUriLinks?: boolean isVisible?: boolean onLinkClick?: (...args: unknown[]) => void - showTurnStatus?: boolean - showLiveTurnActivity?: boolean + awaitingInput?: 'shown' | 'unshown' | null isWorking?: boolean runtimeContext?: unknown session?: { hasMore: boolean; loadingEarlier: boolean; loadEarlier: () => Promise } diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx index e766955b83ec..9a40f63530d6 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx @@ -177,8 +177,8 @@ describe('NativeChatStructuredSession', () => { expect(mocks.loadOlder).toHaveBeenCalledOnce() }) - // Turn status and transcript image previews shipped Codex-first. Every - // structured session renders through the same list, so neither is agent-gated. + // Transcript image previews shipped Codex-first. Every structured session + // renders through the same list, so they are not agent-gated. it.each(['codex', 'claude'] as const)( 'renders the same structured transcript chrome for %s', (agent) => { @@ -193,7 +193,6 @@ describe('NativeChatStructuredSession', () => { /> ) - expect(mocks.messageListProps?.showTurnStatus).toBe(true) expect(mocks.messageListProps?.runtimeContext).not.toBeUndefined() } ) @@ -216,7 +215,7 @@ describe('NativeChatStructuredSession', () => { expect(mocks.messageListProps).toMatchObject({ isWorking: true, - showLiveTurnActivity: false + awaitingInput: 'shown' }) expect( document @@ -231,13 +230,13 @@ describe('NativeChatStructuredSession', () => { itemId: 'legacy-question-item', expectedRevision: 1 }) - expect(mocks.messageListProps?.showLiveTurnActivity).toBe(false) + expect(mocks.messageListProps?.awaitingInput).toBe('shown') mocks.promptItems = [] rerender(view()) expect(mocks.messageListProps).toMatchObject({ isWorking: true, - showLiveTurnActivity: true + awaitingInput: null }) expect(screen.getByTestId('structured-composer')).toBeTruthy() expect(mocks.composerProps?.isWorking).toBe(true) @@ -285,7 +284,7 @@ describe('NativeChatStructuredSession', () => { expect(mocks.messageListProps).toMatchObject({ isWorking: true, - showLiveTurnActivity: false + awaitingInput: 'shown' }) expect(mocks.approvalCardProps?.approval.title).toBe('Allow command?') expect(screen.queryByTestId('structured-composer')).toBeNull() @@ -296,7 +295,7 @@ describe('NativeChatStructuredSession', () => { kind: 'option', optionId: 'allow' }) - expect(mocks.messageListProps?.showLiveTurnActivity).toBe(false) + expect(mocks.messageListProps?.awaitingInput).toBe('shown') act(() => mocks.approvalCardProps?.onCancel?.()) expect(mocks.cancel).toHaveBeenCalledWith('turn-approval', { diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx index 26f04ae2e3ce..a6bb8ad8d285 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx @@ -281,8 +281,7 @@ export function NativeChatStructuredSession( settledTurns={controller.settledTurns} activeTurnOpenedBy={controller.activeTurnOpenedBy} turnKeysByItemId={controller.turnKeysByItemId} - showTurnStatus - showLiveTurnActivity={prompt === null} + awaitingInput={prompt === null ? null : 'shown'} turnActivity={controller.turnActivity} onLinkClick={onLinkClick} allowFileUriLinks={onLinkClick !== undefined} diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSessionDelivery.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSessionDelivery.test.tsx index 0e6994a7b8bb..81a8f53300f1 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSessionDelivery.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSessionDelivery.test.tsx @@ -18,7 +18,6 @@ const mocks = vi.hoisted(() => ({ messageListProps: null as null | { allowFileUriLinks?: boolean onLinkClick?: (...args: unknown[]) => void - showTurnStatus?: boolean runtimeContext?: unknown }, composerProps: null as null | { diff --git a/src/renderer/src/components/native-chat/NativeChatToolRun.ask-row.test.tsx b/src/renderer/src/components/native-chat/NativeChatToolRun.ask-row.test.tsx index 870bf39a4095..b4257648efaf 100644 --- a/src/renderer/src/components/native-chat/NativeChatToolRun.ask-row.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatToolRun.ask-row.test.tsx @@ -231,7 +231,7 @@ describe('NativeChatToolRun awaiting-input row', () => { /> ) - expect(screen.getByText('Awaiting user input:')).toBeInTheDocument() + expect(screen.getByText('Awaiting user input')).toBeInTheDocument() expect(screen.queryByText(/request_user_input/)).toBeNull() }) }) diff --git a/src/renderer/src/components/native-chat/NativeChatToolRun.tsx b/src/renderer/src/components/native-chat/NativeChatToolRun.tsx index 141ae7398862..a6cb100ff584 100644 --- a/src/renderer/src/components/native-chat/NativeChatToolRun.tsx +++ b/src/renderer/src/components/native-chat/NativeChatToolRun.tsx @@ -58,7 +58,6 @@ export function NativeChatToolRun({ activeTurnIsWorking, trailing, expandOverride, - structuredActivityUi = true, disclosureId, onLinkClick }: { @@ -81,7 +80,6 @@ export function NativeChatToolRun({ * the agent has already moved past reads as settled even mid-call. Left * unset, a working turn's run is taken to be its last. */ trailing?: boolean - structuredActivityUi?: boolean /** Message this run belongs to. Windowing unmounts rows, so a run the reader * opened has to be remembered somewhere that outlives the row. */ disclosureId?: string @@ -130,10 +128,9 @@ export function NativeChatToolRun({ // caller with no turn state, or a turn blocked on the reader's answer, falls // back to the calls themselves. const live = - structuredActivityUi && - (activeTurnIsWorking === true && !askIsActive + activeTurnIsWorking === true && !askIsActive ? trailing !== false - : selectActiveToolCall(headerBlocks, { activeTurnIsWorking }) !== null) + : selectActiveToolCall(headerBlocks, { activeTurnIsWorking }) !== null // One sentence for the whole run, or the command itself when the run is one // call — the reader recognizes `git push` faster than "Ran 1 command". const runSentence = nativeChatToolRunSentence(headerBlocks, { live }) @@ -199,7 +196,6 @@ export function NativeChatToolRun({ // the grouped row visible here made a failed child command look like the // whole response was still running (or had failed) even while collapsed. if ( - structuredActivityUi && expandOverride === false && !(revealedDiff && open) && !live && @@ -237,7 +233,7 @@ export function NativeChatToolRun({ aria-live="polite" data-native-chat-tool-run-state={live ? 'live' : 'settled'} > - {structuredActivityUi && settledHeaderIcon ? ( + {settledHeaderIcon ? ( ) : null} {/* The run in words, in the transcript's own type. Present tense while @@ -278,7 +274,7 @@ export function NativeChatToolRun({ {/* Only a stated success is marked done — see nativeChatToolRunOutcome — and never while live: between two calls nothing is running, and a mark that appeared then would flash on every call. */} - {structuredActivityUi && !live && runSucceeded ? ( + {!live && runSucceeded ? ( ) : null} {latestCallLabel ? ( diff --git a/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx b/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx index 54499e3dc31b..91e71df2140e 100644 --- a/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx +++ b/src/renderer/src/components/native-chat/NativeChatTranscriptRow.tsx @@ -13,7 +13,6 @@ import type { NativeChatDiffReveal, NativeChatDiffTarget } from './native-chat-t * object so a row's props change only when that row's own slot does. */ export type NativeChatTranscriptRowContext = { expandSignal: boolean - showTurnStatus: boolean revealedDiff: NativeChatDiffReveal | null taskListPredecessors: ReadonlyMap expandedTurnIds: ReadonlySet @@ -74,7 +73,6 @@ export const NativeChatTranscriptRow = memo(function NativeChatTranscriptRow({ onLinkClick={context.onLinkClick} allowFileUriLinks={context.allowFileUriLinks} deliveryNotice={context.deliveryNotices?.get(message.id)} - structuredActivityUi={context.showTurnStatus} folded={slot.folded} subagentLabel={slot.subagentLabel} runtimeContext={context.runtimeContext} diff --git a/src/renderer/src/components/native-chat/NativeChatTypingIndicatorRow.tsx b/src/renderer/src/components/native-chat/NativeChatTypingIndicatorRow.tsx deleted file mode 100644 index 59969c1dece6..000000000000 --- a/src/renderer/src/components/native-chat/NativeChatTypingIndicatorRow.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { translate } from '@/i18n/i18n' - -export function NativeChatTypingIndicatorRow(): React.JSX.Element { - return ( -
    -
    - {[0, 1, 2].map((i) => ( - - ))} -
    -
    - ) -} diff --git a/src/renderer/src/components/native-chat/native-chat-live-session-contract.ts b/src/renderer/src/components/native-chat/native-chat-live-session-contract.ts index e3097ca085f2..d61d11b9ac1b 100644 --- a/src/renderer/src/components/native-chat/native-chat-live-session-contract.ts +++ b/src/renderer/src/components/native-chat/native-chat-live-session-contract.ts @@ -27,6 +27,9 @@ export function isNativeChatTranscriptUnsettled(phase: ReadState['phase']): bool export type NativeChatLiveSession = NativeChatSession & { /** Latest provider turn boundary, used to settle orphaned running tool rows. */ transcriptLifecycle?: NativeChatTurnLifecycle + /** The pane's hook says the agent stopped mid-turn for the reader, and the transcript + * has not since ended that turn. Absent on lanes with no hook status. */ + hookAwaitingInput?: boolean /** True when an older page may still exist (the last read filled the window). */ hasMore: boolean /** Whether an older-history page is currently loading. */ diff --git a/src/renderer/src/components/native-chat/native-chat-live-status.test.ts b/src/renderer/src/components/native-chat/native-chat-live-status.test.ts index ce8a2875df0c..9dcd683dcd90 100644 --- a/src/renderer/src/components/native-chat/native-chat-live-status.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-live-status.test.ts @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest' import type { NativeChatMessage } from '../../../../shared/native-chat-types' -import { mergeNativeChatLiveSession } from './native-chat-live-status' +import { mergeNativeChatLiveSession, nativeChatHookAwaitsInput } from './native-chat-live-status' import { selectNativeChatViewState } from './native-chat-view-state' import { shouldShowNativeChatWorking } from './native-chat-working-suppression' @@ -154,6 +154,36 @@ describe('mergeNativeChatLiveSession', () => { expect(session.status).toBe('ready') }) + it("keeps omp working while its latest row is a tool call written after the turn's start", () => { + // Shaped as decodeOmpTranscriptLine emits them: every omp row carries its timestamp. + const turnStartedAt = Date.parse('2026-09-28T10:00:00.000Z') + const toolCall: NativeChatMessage = { + id: 'rec-2', + role: 'assistant', + blocks: [ + { type: 'text', text: 'Running the suite.' }, + { type: 'tool-call', name: 'bash', input: { command: 'pnpm test' } } + ], + timestamp: turnStartedAt + 4_000, + source: 'transcript' + } + const session = mergeNativeChatLiveSession({ + messages: [{ ...user('rec-1', 'run the tests'), timestamp: turnStartedAt }, toolCall], + sessionId: 'sess', + agent: 'omp', + hookState: 'working', + stateStartedAt: turnStartedAt + }) + expect(session.status).toBe('working') + expect( + shouldShowNativeChatWorking({ + isConversation: true, + working: session.status === 'working', + interrupted: false + }) + ).toBe(true) + }) + it('keeps working while the hook reports a live background child', () => { const session = mergeNativeChatLiveSession({ messages: [assistant('a-1', 'lead done')], @@ -201,7 +231,7 @@ describe('mergeNativeChatLiveSession', () => { }).status ).toBe('working') // Regression: a non-null sessionId used to force 'loading' over live work, - // so the pane rendered idle mid-turn — Send instead of Stop, no typing + // so the pane rendered idle mid-turn — Send instead of Stop, no working // indicator, no streaming preview. The empty-transcript loading SURFACE is // selectNativeChatViewState's job; the status must stay 'working'. expect( @@ -249,7 +279,7 @@ describe('mergeNativeChatLiveSession', () => { // The whole chain the defect broke: a fresh Claude session reports its id // before the transcript flushes, so the pane rendered Send (not Stop) with no - // typing indicator while the agent was working. + // working indicator while the agent was working. it('keeps the Stop affordance for a working known session mid-flush', () => { const session = mergeNativeChatLiveSession({ messages: [user('u-1', 'run it')], @@ -271,3 +301,46 @@ describe('mergeNativeChatLiveSession', () => { ).toBe(true) }) }) + +describe('nativeChatHookAwaitsInput', () => { + it.each(['waiting', 'blocked'] as const)('reads a %s hook as a wait on the reader', (state) => { + expect(nativeChatHookAwaitsInput(state, 5, undefined)).toBe(true) + expect( + nativeChatHookAwaitsInput(state, 5, { state: 'working', turnId: 'turn-1', timestamp: 1 }) + ).toBe(true) + }) + + it('reads no other hook state as a wait', () => { + expect(nativeChatHookAwaitsInput('working', 5, undefined)).toBe(false) + expect(nativeChatHookAwaitsInput('done', 5, undefined)).toBe(false) + expect(nativeChatHookAwaitsInput(null, 5, undefined)).toBe(false) + }) + + // An interrupt at the prompt fires no hook; the transcript's marker is the only end. + it('ends a wait the transcript closed after it began', () => { + expect( + nativeChatHookAwaitsInput('waiting', 5, { + state: 'interrupted', + turnId: 'turn-1', + timestamp: 6 + }) + ).toBe(false) + expect( + nativeChatHookAwaitsInput('waiting', 5, { + state: 'completed', + turnId: 'turn-1', + timestamp: 6 + }) + ).toBe(false) + }) + + it('keeps a wait that began after the last closed turn', () => { + expect( + nativeChatHookAwaitsInput('waiting', 5, { + state: 'interrupted', + turnId: 'turn-1', + timestamp: 2 + }) + ).toBe(true) + }) +}) diff --git a/src/renderer/src/components/native-chat/native-chat-live-status.ts b/src/renderer/src/components/native-chat/native-chat-live-status.ts index eefd7fcbeca1..f3d2bb58be94 100644 --- a/src/renderer/src/components/native-chat/native-chat-live-status.ts +++ b/src/renderer/src/components/native-chat/native-chat-live-status.ts @@ -63,14 +63,15 @@ export function mergeNativeChatLiveSession(input: NativeChatLiveMergeInput): Nat } const status = liveStatusOverride( + agent, hookState, statusTailMessage ?? messages.at(-1), stateStartedAt, transcriptLifecycle, hookHasWorkingSubagents ?? false ) - // Why live work still wins: 'working' is what drives Stop-vs-Send, the typing - // indicator and the streaming preview, so forcing 'loading' over it renders an + // Why live work still wins: 'working' is what drives Stop-vs-Send, the turn + // status and the streaming preview, so forcing 'loading' over it renders an // idle pane while the agent works. A known session with nothing to show yet is // held on the loading surface by selectNativeChatViewState instead. if (loading && status !== 'working') { @@ -84,10 +85,36 @@ export function mergeNativeChatLiveSession(input: NativeChatLiveMergeInput): Nat } } +/** + * Whether the agent stopped mid-turn for the reader (`blocked` and `waiting` both mean a human + * must decide). Reconciled like 'working': an interrupt at the prompt fires no hook, so only the + * transcript's terminal marker can end a wait the hook never cleared. + */ +export function nativeChatHookAwaitsInput( + hookState: AgentStatusState | null, + stateStartedAt: number | null | undefined, + transcriptLifecycle: NativeChatTurnLifecycle | undefined +): boolean { + return ( + (hookState === 'blocked' || hookState === 'waiting') && + !lifecycleTerminatesCurrentTurn(transcriptLifecycle, stateStartedAt) + ) +} + /** Slack for comparing transcript timestamps to hook receipt times across hosts. */ export const LIFECYCLE_CLOCK_SKEW_SLACK_MS = 2_000 +/** + * Agents whose own runtime reports the turn end: omp posts `agent_end` from inside the agent, + * retried until the host takes it and held back while the run continues. Their hook 'working' + * is never a dropped Stop, so a trailing assistant row (a tool call mid-run) cannot end it. + */ +function hookDeliversTurnEnd(agent: AgentType): boolean { + return agent === 'omp' +} + function liveStatusOverride( + agent: AgentType, hookState: AgentStatusState | null, statusTailMessage: NativeChatMessage | undefined, stateStartedAt: number | null | undefined, @@ -121,6 +148,7 @@ function liveStatusOverride( // do not settle early on capable providers. if ( transcriptLifecycle?.state !== 'working' && + !hookDeliversTurnEnd(agent) && trailingAssistantPostDates(statusTailMessage, stateStartedAt) ) { return undefined diff --git a/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts b/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts index fa4995b4755f..3a08c6a503e9 100644 --- a/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-message-rail-items.test.ts @@ -47,7 +47,6 @@ function slotsOf(messages: NativeChatMessage[]) { receipts: new Map(), turnStatuses: { active: null, completedByTurn: {} }, turnDiffs: new Map(), - showTurnStatus: false, expandedTurnKeys: new Set(), isWorking: false, lifecycleWorking: false diff --git a/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts b/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts index ba8e6fa8f21f..b1efe034acdc 100644 --- a/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-rail-outline-parity.test.ts @@ -86,7 +86,6 @@ function loadedRailItems(items: AgentJournalRenderItem[], submissions: AgentJour receipts: new Map(), turnStatuses: { active: null, completedByTurn: {} }, turnDiffs: new Map(), - showTurnStatus: true, expandedTurnKeys: new Set(), isWorking: false, lifecycleWorking: false diff --git a/src/renderer/src/components/native-chat/native-chat-terminal-turn.test.ts b/src/renderer/src/components/native-chat/native-chat-terminal-turn.test.ts new file mode 100644 index 000000000000..4e77c18ace64 --- /dev/null +++ b/src/renderer/src/components/native-chat/native-chat-terminal-turn.test.ts @@ -0,0 +1,243 @@ +import { describe, expect, it } from 'vitest' +import { + NATIVE_CHAT_INTERRUPTED_STATUS_TEXT, + type NativeChatMessage +} from '../../../../shared/native-chat-types' +import { + nativeChatHookLatestTurnWorkedSeconds, + nativeChatHookTurnStartedAt, + nativeChatLatestTurnId, + nativeChatTranscriptSettledTurns, + resolveNativeChatTerminalTurn +} from './native-chat-terminal-turn' + +const idle = { + isConversation: true, + working: false, + hookAwaitingInput: false, + interrupted: false, + hasPromptCard: false +} + +describe('resolveNativeChatTerminalTurn', () => { + it('keeps the turn running while the agent waits, without calling it generating', () => { + expect(resolveNativeChatTerminalTurn({ ...idle, hookAwaitingInput: true })).toEqual({ + isWorking: false, + turnActive: true, + awaitingInput: 'unshown' + }) + }) + + it('lets a prompt card speak for the wait', () => { + expect( + resolveNativeChatTerminalTurn({ ...idle, hookAwaitingInput: true, hasPromptCard: true }) + ).toEqual({ isWorking: false, turnActive: true, awaitingInput: 'shown' }) + }) + + it('reports a generating turn with nothing awaited', () => { + expect(resolveNativeChatTerminalTurn({ ...idle, working: true })).toEqual({ + isWorking: true, + turnActive: true, + awaitingInput: null + }) + }) + + // Stop is the reader's word that the turn is over, whatever the hook still says. + it('ends the turn on local Stop, wait included', () => { + expect( + resolveNativeChatTerminalTurn({ + ...idle, + working: true, + hookAwaitingInput: true, + interrupted: true + }) + ).toEqual({ isWorking: false, turnActive: false, awaitingInput: null }) + }) + + it('stays quiet with no turn at all', () => { + expect(resolveNativeChatTerminalTurn(idle)).toEqual({ + isWorking: false, + turnActive: false, + awaitingInput: null + }) + }) +}) + +describe('nativeChatHookTurnStartedAt', () => { + const entry = { state: 'working' as const, stateStartedAt: 3_000 } + + // Answered in the terminal: the current state began at 3s, the turn at 1s. + it("dates the turn by the host's stamp, not the state it came back from", () => { + expect(nativeChatHookTurnStartedAt({ ...entry, turnStartedAt: 1_000 })).toBe(1_000) + }) + + // A background task held the row 'working' since 500; the main agent's turn began at 8s. + it('keeps the stamp when child work holds the row open', () => { + expect( + nativeChatHookTurnStartedAt({ + ...entry, + stateStartedAt: 500, + turnStartedAt: 8_000, + mainAgent: { state: 'working', stateStartedAt: 8_000 } + }) + ).toBe(8_000) + }) + + it("falls back to the main agent's own state start on a host that stamps no turn", () => { + expect( + nativeChatHookTurnStartedAt({ + ...entry, + stateStartedAt: 500, + mainAgent: { state: 'working', stateStartedAt: 8_000 } + }) + ).toBe(8_000) + }) + + it('falls back to the row once the main agent is done, or where it has none', () => { + expect( + nativeChatHookTurnStartedAt({ ...entry, mainAgent: { state: 'done', stateStartedAt: 2_500 } }) + ).toBe(3_000) + expect(nativeChatHookTurnStartedAt(entry)).toBe(3_000) + }) + + it('knows nothing without a status row', () => { + expect(nativeChatHookTurnStartedAt(undefined)).toBeNull() + }) +}) + +describe('nativeChatHookLatestTurnWorkedSeconds', () => { + const done = { state: 'done' as const, stateStartedAt: 91_000, turnStartedAt: 1_000 } + + it("times a turn the host ended from its turn start to the main agent's done", () => { + expect(nativeChatHookLatestTurnWorkedSeconds(done, false)).toBe(90) + // Child work still holds the row; the main agent's own end closes the turn. + expect( + nativeChatHookLatestTurnWorkedSeconds( + { ...done, state: 'working', mainAgent: { state: 'done', stateStartedAt: 31_000 } }, + false + ) + ).toBe(30) + }) + + // Staleness ages the row out of the pane, not the host's record that the turn finished. + it('keeps a host-ended duration once the row is stale', () => { + expect(nativeChatHookLatestTurnWorkedSeconds(done, true)).toBe(90) + }) + + it('hides a local end while the host went quiet mid-turn', () => { + expect( + nativeChatHookLatestTurnWorkedSeconds( + { ...done, state: 'waiting', stateStartedAt: 2_000 }, + true + ) + ).toBeNull() + }) + + // A pane-side end (Stop, the transcript's end marker) is the pane's own word; keep what it saw. + it('keeps the local reading while the host is fresh and the turn not host-ended', () => { + expect( + nativeChatHookLatestTurnWorkedSeconds( + { ...done, state: 'waiting', stateStartedAt: 2_000 }, + false + ) + ).toBeUndefined() + }) + + it('invents no duration without the host turn stamp, or across a session boundary', () => { + expect( + nativeChatHookLatestTurnWorkedSeconds({ state: 'done', stateStartedAt: 91_000 }, false) + ).toBeUndefined() + expect( + nativeChatHookLatestTurnWorkedSeconds({ ...done, sessionBoundary: true }, false) + ).toBeUndefined() + expect(nativeChatHookLatestTurnWorkedSeconds(undefined, true)).toBeUndefined() + }) +}) + +function row( + id: string, + role: NativeChatMessage['role'], + timestamp: number | null +): NativeChatMessage { + return { id, role, blocks: [{ type: 'text', text: id }], timestamp, source: 'transcript' } +} + +describe('nativeChatTranscriptSettledTurns', () => { + it('times each finished turn from its prompt to its last row, leaving the latest out', () => { + const settled = nativeChatTranscriptSettledTurns([ + row('u1', 'user', 10_000), + row('a1', 'assistant', 20_000), + row('a2', 'assistant', 55_900), + row('u2', 'user', 70_000), + row('a3', 'assistant', 80_000) + ]) + expect([...settled]).toEqual([['u1', { startedAt: 10_000, workedSeconds: 45 }]]) + }) + + it('ends an interrupted turn at its interruption', () => { + const settled = nativeChatTranscriptSettledTurns([ + row('u1', 'user', 0), + row('a1', 'assistant', 5_000), + { + ...row('stop', 'system', 12_000), + blocks: [{ type: 'text', text: NATIVE_CHAT_INTERRUPTED_STATUS_TEXT }] + }, + row('u2', 'user', 60_000) + ]) + expect(settled.get('u1')).toEqual({ startedAt: 0, workedSeconds: 12 }) + }) + + // An attachment row sits beside the next prompt; it does not stretch the turn before it. + it('does not end a turn at a system row the agent did not write', () => { + const settled = nativeChatTranscriptSettledTurns([ + row('u1', 'user', 0), + row('a1', 'assistant', 5_000), + row('@src/index.ts', 'system', 3_600_000), + row('u2', 'user', 3_601_000) + ]) + expect(settled.get('u1')).toEqual({ startedAt: 0, workedSeconds: 5 }) + }) + + // A harness notice (task notification, reminder) is user-role in the transcript but not a prompt. + it('times a turn across a harness notice injected mid-turn', () => { + const settled = nativeChatTranscriptSettledTurns([ + row('u1', 'user', 0), + row('a1', 'assistant', 5_000), + { + ...row('notice', 'user', 10_000), + blocks: [{ type: 'text', text: '\nb1' }] + }, + row('a2', 'assistant', 30_000), + row('u2', 'user', 60_000) + ]) + expect([...settled]).toEqual([['u1', { startedAt: 0, workedSeconds: 30 }]]) + }) + + // Absent, not null: null would also hide the duration the pane measured itself. + it('leaves out a turn missing either end', () => { + const settled = nativeChatTranscriptSettledTurns([ + row('u1', 'user', null), + row('a1', 'assistant', 5_000), + row('u2', 'user', 10_000), + row('a2', 'assistant', null), + row('u3', 'user', 20_000) + ]) + expect(settled.size).toBe(0) + }) +}) + +describe('nativeChatLatestTurnId', () => { + it('names the last prompt, not a harness notice after it', () => { + expect( + nativeChatLatestTurnId([ + row('u1', 'user', 0), + row('a1', 'assistant', 5_000), + { + ...row('notice', 'user', 10_000), + blocks: [{ type: 'text', text: '\nb1' }] + } + ]) + ).toBe('u1') + expect(nativeChatLatestTurnId([row('a1', 'assistant', 0)])).toBeNull() + }) +}) diff --git a/src/renderer/src/components/native-chat/native-chat-terminal-turn.ts b/src/renderer/src/components/native-chat/native-chat-terminal-turn.ts new file mode 100644 index 000000000000..2926c5d75f2c --- /dev/null +++ b/src/renderer/src/components/native-chat/native-chat-terminal-turn.ts @@ -0,0 +1,132 @@ +import type { AgentStatusEntry } from '../../../../shared/agent-status-types' +import { + isInterruptedStatusMessage, + type NativeChatMessage +} from '../../../../shared/native-chat-types' +import type { + NativeChatSettledTurn, + NativeChatSettledTurns +} from '../../../../shared/native-chat-turn-status' +import { isNoiseMessage } from '../../../../shared/native-chat-noise' +import type { NativeChatAwaitingInput } from './NativeChatMessageList' +import { shouldShowNativeChatWorking } from './native-chat-working-suppression' + +export type NativeChatTerminalTurn = { + /** The agent is generating: drives Stop-vs-Send and the streaming preview. */ + isWorking: boolean + /** The turn is running, including while its agent waits on the reader, as a + * structured turn runs on behind its prompt card: its clock keeps counting. */ + turnActive: boolean + awaitingInput: NativeChatAwaitingInput | null +} + +/** The turn facts a terminal-backed pane feeds the shared turn-status UI. */ +export function resolveNativeChatTerminalTurn(args: { + isConversation: boolean + /** Hook 'working', reconciled with the transcript's turn boundaries. */ + working: boolean + /** Hook 'waiting'/'blocked', reconciled the same way. */ + hookAwaitingInput: boolean + /** Local Stop suppression. */ + interrupted: boolean + /** The pane draws the agent's prompt as a card. */ + hasPromptCard: boolean +}): NativeChatTerminalTurn { + const { isConversation, working, hookAwaitingInput, interrupted, hasPromptCard } = args + const turnActive = shouldShowNativeChatWorking({ + isConversation, + working: working || hookAwaitingInput, + interrupted + }) + return { + isWorking: shouldShowNativeChatWorking({ isConversation, working, interrupted }), + turnActive, + // A prompt only the terminal shows is the one wait the transcript has to report. + awaitingInput: hasPromptCard ? 'shown' : turnActive && hookAwaitingInput ? 'unshown' : null + } +} + +type NativeChatHookTurnEntry = Pick< + AgentStatusEntry, + 'state' | 'stateStartedAt' | 'turnStartedAt' | 'mainAgent' | 'sessionBoundary' +> + +/** + * When the pane's current turn began: the host's stamp from the main agent's own turn-opening + * event, which survives a remount, a reload and child work holding the row open. A host too old to + * stamp it leaves the current state's start, the main agent's while it is mid-turn. + */ +export function nativeChatHookTurnStartedAt( + entry: NativeChatHookTurnEntry | undefined +): number | null { + if (!entry) { + return null + } + if (entry.turnStartedAt !== undefined) { + return entry.turnStartedAt + } + return entry.mainAgent && entry.mainAgent.state !== 'done' + ? entry.mainAgent.stateStartedAt + : entry.stateStartedAt +} + +/** + * The latest turn's duration by the host, for a turn the pane is not running: a number once the + * main agent is done (its done stamp minus the host's turn start), null when the host went quiet + * mid-turn (nothing says the turn ended, so a locally measured end would be a false claim), and + * undefined to keep what the pane observed (an old host, a session boundary, a pane-side end). + */ +export function nativeChatHookLatestTurnWorkedSeconds( + entry: NativeChatHookTurnEntry | undefined, + hookSilent: boolean +): number | null | undefined { + if (!entry) { + return undefined + } + const mainAgent = entry.mainAgent ?? entry + if (mainAgent.state === 'done') { + return entry.sessionBoundary === true || entry.turnStartedAt === undefined + ? undefined + : Math.max(0, Math.floor((mainAgent.stateStartedAt - entry.turnStartedAt) / 1000)) + } + return hookSilent ? null : undefined +} + +/** The transcript's latest turn: its last prompt, harness notices aside. */ +export function nativeChatLatestTurnId(messages: readonly NativeChatMessage[]): string | null { + const latest = messages.findLast((message) => message.role === 'user' && !isNoiseMessage(message)) + return latest?.id ?? null +} + +/** + * Durations of the transcript's finished turns, from its own timestamps (one clock): a turn runs + * from its prompt to the agent's last timestamped row or its interruption. Other system rows (file + * mentions, extension notes) can land long after, next to the following prompt. The latest turn is + * left out, since nothing here says it has ended, and so is a turn missing either end, which keeps + * what the pane observed. + */ +export function nativeChatTranscriptSettledTurns( + messages: readonly NativeChatMessage[] +): NativeChatSettledTurns { + const settled = new Map() + let turn: { id: string; startedAt: number | null; endedAt: number | null } | null = null + for (const message of messages) { + // A harness notice is user-role but draws no row, so it neither starts nor extends a turn. + if (message.role !== 'user' || isNoiseMessage(message)) { + const agentRow = + message.role === 'system' ? isInterruptedStatusMessage(message) : message.role !== 'user' + if (turn && agentRow && message.timestamp != null) { + turn.endedAt = Math.max(turn.endedAt ?? message.timestamp, message.timestamp) + } + continue + } + if (turn?.startedAt != null && turn.endedAt != null) { + settled.set(turn.id, { + startedAt: turn.startedAt, + workedSeconds: Math.max(0, Math.floor((turn.endedAt - turn.startedAt) / 1000)) + }) + } + turn = { id: message.id, startedAt: message.timestamp, endedAt: null } + } + return settled +} diff --git a/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts b/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts index 21e48166e9c8..4c9083755762 100644 --- a/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts +++ b/src/renderer/src/components/native-chat/native-chat-transcript-slots.test.ts @@ -43,7 +43,6 @@ function build( receipts: new Map(), turnStatuses: NO_STATUSES, turnDiffs: new Map(), - showTurnStatus: true, expandedTurnKeys: new Set(), isWorking: false, lifecycleWorking: false, diff --git a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts index 1b20671ce245..b3631fb80125 100644 --- a/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts +++ b/src/renderer/src/components/native-chat/native-chat-transcript-slots.ts @@ -75,7 +75,6 @@ export type NativeChatTranscriptSlotsInput = { completedByTurn: Readonly> } turnDiffs: ReadonlyMap - showTurnStatus: boolean /** Turns the reader opened. Everything else with a duration stays folded. */ expandedTurnKeys: ReadonlySet isWorking: boolean @@ -95,7 +94,6 @@ export function buildNativeChatTranscriptSlots( receipts, turnStatuses, turnDiffs, - showTurnStatus, expandedTurnKeys, isWorking, lifecycleWorking, @@ -141,11 +139,9 @@ export function buildNativeChatTranscriptSlots( } } const settledTurnKeys = new Set( - showTurnStatus - ? Object.entries(turnStatuses.completedByTurn) - .filter(([, status]) => status.workedSeconds != null) - .map(([turnKey]) => turnKey) - : [] + Object.entries(turnStatuses.completedByTurn) + .filter(([, status]) => status.workedSeconds != null) + .map(([turnKey]) => turnKey) ) const { foldedRows, foldableTurnKeys } = nativeChatTurnFold({ rows: foldRows, @@ -180,7 +176,7 @@ export function buildNativeChatTranscriptSlots( : turnStatuses.completedByTurn[turnKey] : undefined // The live turn's bar carries its running clock; it settles in place. - const status = showTurnStatus ? (candidateStatus ?? undefined) : undefined + const status = candidateStatus ?? undefined const turnDiff = turnKey && lastRowByTurn.get(turnKey) === index ? turnDiffs.get(turnKey) : undefined const folded = foldedRows.has(index) diff --git a/src/renderer/src/components/native-chat/native-chat-typing-indicator.test.ts b/src/renderer/src/components/native-chat/native-chat-typing-indicator.test.ts deleted file mode 100644 index b53b217eb152..000000000000 --- a/src/renderer/src/components/native-chat/native-chat-typing-indicator.test.ts +++ /dev/null @@ -1,154 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { NATIVE_CHAT_STREAMING_ID } from '../../../../shared/native-chat-streaming' -import type { NativeChatMessage } from '../../../../shared/native-chat-types' -import type { AgentJournalRenderItem } from '../../../../shared/agent-session-journal-types' -import { projectStructuredItemsToNativeChat } from '../../../../shared/structured-agent-session-projection' -import { shouldShowNativeChatTypingIndicator } from './native-chat-typing-indicator' - -function message(id: string, role: NativeChatMessage['role'], text = id): NativeChatMessage { - return { id, role, blocks: [{ type: 'text', text }], timestamp: null, source: 'transcript' } -} - -describe('shouldShowNativeChatTypingIndicator', () => { - it('stays hidden when the session is idle', () => { - expect( - shouldShowNativeChatTypingIndicator({ - messages: [message('u1', 'user')], - isWorking: false - }) - ).toBe(false) - }) - - it('shows once a send lands and no assistant row exists yet', () => { - expect( - shouldShowNativeChatTypingIndicator({ - messages: [message('a0', 'assistant'), message('u1', 'user')], - isWorking: true - }) - ).toBe(true) - }) - - it('hides as soon as the structured reply row arrives, before working clears', () => { - expect( - shouldShowNativeChatTypingIndicator({ - messages: [message('u1', 'user'), message('orca-item', 'assistant')], - isWorking: true - }) - ).toBe(false) - }) - - it('hides behind the PTY streaming bubble', () => { - expect( - shouldShowNativeChatTypingIndicator({ - messages: [message('u1', 'user'), message(NATIVE_CHAT_STREAMING_ID, 'assistant')], - isWorking: true - }) - ).toBe(false) - }) - - it('does not flicker back on when a system row interleaves mid-turn', () => { - expect( - shouldShowNativeChatTypingIndicator({ - messages: [ - message('u1', 'user'), - message('a1', 'assistant'), - message('s1', 'system', 'Ran /status') - ], - isWorking: true - }) - ).toBe(false) - }) - - it('shows again for the next send even though an earlier turn replied', () => { - expect( - shouldShowNativeChatTypingIndicator({ - messages: [message('u1', 'user'), message('a1', 'assistant'), message('u2', 'user')], - isWorking: true - }) - ).toBe(true) - }) - - it('does not let an unresolved tool from an earlier turn hide the next send indicator', () => { - const earlierRunningTool: NativeChatMessage = { - id: 'tool-old', - role: 'assistant', - blocks: [ - { type: 'tool-call', name: 'shell', input: { command: 'sleep 1' }, state: 'running' } - ], - timestamp: null, - source: 'transcript' - } - expect( - shouldShowNativeChatTypingIndicator({ - messages: [earlierRunningTool, message('a1', 'assistant'), message('u2', 'user')], - isWorking: true - }) - ).toBe(true) - }) - - it('shows after a slash-command marker even though an earlier turn replied', () => { - expect( - shouldShowNativeChatTypingIndicator({ - messages: [ - message('a1', 'assistant'), - message('command:compact', 'system', 'Ran /compact') - ], - isWorking: true - }) - ).toBe(true) - }) - - it('shows on a session whose transcript is still empty', () => { - expect(shouldShowNativeChatTypingIndicator({ messages: [], isWorking: true })).toBe(true) - }) -}) - -// These build rows through the REAL structured projection instead of hand-made -// `command:` marker ids. The hand-made ids only exist on the PTY transport, so -// tests using them were blind to how the shipping transport actually looks. -describe('with rows projected from the structured journal', () => { - function toolCallItem(sequence: number): AgentJournalRenderItem { - return { - itemId: `codex:thread-1:turn-1:${sequence}`, - revision: 1, - sequence, - observedAt: 1_800_000_000_000, - body: { - kind: 'tool-call', - name: 'shell', - state: 'running', - input: { command: 'sed -n 1,240p README.md' } - } - } as AgentJournalRenderItem - } - - function assistantTextItem(sequence: number): AgentJournalRenderItem { - return { - itemId: `codex:thread-1:turn-1:${sequence}`, - revision: 1, - sequence, - observedAt: 1_800_000_000_000, - body: { - kind: 'message', - role: 'assistant', - blocks: [{ type: 'text', text: "I'm checking PR 14696's metadata." }] - } - } as AgentJournalRenderItem - } - - it('stays visible beside the structured live tool row while a command runs', () => { - const messages = projectStructuredItemsToNativeChat([assistantTextItem(1), toolCallItem(2)]) - expect(messages.at(-1)?.role).toBe('assistant') - expect(shouldShowNativeChatTypingIndicator({ messages, isWorking: true })).toBe(true) - }) - - it('hides once prose is the newest row', () => { - const messages = projectStructuredItemsToNativeChat([toolCallItem(1), assistantTextItem(2)]) - expect(shouldShowNativeChatTypingIndicator({ messages, isWorking: true })).toBe(false) - }) - - it('stays hidden when the turn is not working, command row or not', () => { - const messages = projectStructuredItemsToNativeChat([toolCallItem(1)]) - expect(shouldShowNativeChatTypingIndicator({ messages, isWorking: false })).toBe(false) - }) -}) diff --git a/src/renderer/src/components/native-chat/native-chat-typing-indicator.ts b/src/renderer/src/components/native-chat/native-chat-typing-indicator.ts deleted file mode 100644 index 144560278a24..000000000000 --- a/src/renderer/src/components/native-chat/native-chat-typing-indicator.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { NativeChatMessage } from '../../../../shared/native-chat-types' -import { NATIVE_CHAT_STREAMING_ID } from '../../../../shared/native-chat-streaming' -import { isCommandMarkerId } from './native-chat-command-marker' - -function isToolActivityOnlyRow(message: NativeChatMessage): boolean { - const blocks = message.blocks - if (!blocks || blocks.length === 0) { - return false - } - return blocks.every((block) => block.type === 'tool-call' || block.type === 'tool-result') -} - -export function shouldShowNativeChatTypingIndicator(args: { - messages: readonly NativeChatMessage[] - isWorking: boolean -}): boolean { - if (!args.isWorking) { - return false - } - const { messages } = args - for (let index = messages.length - 1; index >= 0; index -= 1) { - const message = messages[index] - if (!message || message.role === 'user' || isCommandMarkerId(message.id)) { - return true - } - if (isToolActivityOnlyRow(message)) { - return true - } - if (message.role === 'assistant' || message.id === NATIVE_CHAT_STREAMING_ID) { - return false - } - } - return true -} diff --git a/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.test.ts b/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.test.ts new file mode 100644 index 000000000000..a13df87c3e8a --- /dev/null +++ b/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.test.ts @@ -0,0 +1,68 @@ +// @vitest-environment happy-dom + +import { afterEach, describe, expect, it } from 'vitest' +import { act, cleanup, renderHook } from '@testing-library/react' +import type { AgentStatusPayload } from '../../../../shared/agent-status-types' +import type { NativeChatMessage } from '../../../../shared/native-chat-types' + +const { useAppStore } = await import('../../store') +const { useNativeChatInteractivePromptCard } = + await import('./use-native-chat-interactive-prompt-card') + +const paneKey = 'tab-card:leaf-card' +const NO_MESSAGES: readonly NativeChatMessage[] = [] + +function setStatus(payload: Omit): void { + useAppStore + .getState() + .setAgentStatus(paneKey, { prompt: 'Rename', agentType: 'claude', ...payload }) +} + +afterEach(() => { + cleanup() + useAppStore.setState({ agentStatusByPaneKey: {} }) +}) + +describe('useNativeChatInteractivePromptCard', () => { + // The hook runs in the pane's view, so each render here re-renders the whole transcript. + it('does not re-render for a tool call that carries no prompt', () => { + setStatus({ state: 'working', toolName: 'Read' }) + let renders = 0 + renderHook(() => { + renders += 1 + return useNativeChatInteractivePromptCard({ + paneKey, + messages: NO_MESSAGES, + transcriptSettled: true + }) + }) + const settled = renders + + act(() => setStatus({ state: 'working', toolName: 'Bash' })) + act(() => setStatus({ state: 'working', toolName: 'Edit' })) + + expect(renders).toBe(settled) + }) + + it('still reads the prompt that arrives with a tool call', () => { + setStatus({ state: 'working', toolName: 'Read' }) + const { result } = renderHook(() => + useNativeChatInteractivePromptCard({ + paneKey, + messages: NO_MESSAGES, + transcriptSettled: true + }) + ) + expect(result.current).toBeNull() + + act(() => + setStatus({ + state: 'waiting', + toolName: 'Bash', + interactivePrompt: JSON.stringify({ approval: { tool: 'Bash', summary: 'rm -rf dist' } }) + }) + ) + + expect(result.current).toMatchObject({ kind: 'approval' }) + }) +}) diff --git a/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.ts b/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.ts new file mode 100644 index 000000000000..243fea0ac577 --- /dev/null +++ b/src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.ts @@ -0,0 +1,48 @@ +import { useMemo } from 'react' +import { useAppStore } from '../../store' +import { resolveNativeChatAsk } from '../../../../shared/native-chat-ask' +import type { NativeChatMessage } from '../../../../shared/native-chat-types' +import { + parseInteractivePrompt, + type InteractivePromptCard +} from './native-chat-interactive-prompt' + +/** + * The prompt a terminal-backed pane can draw as a card: a tool approval from the + * live status, else a question from the live status or, failing that, from the + * transcript's unresolved ask (headless host, relay gap, replay, reconnect — a + * pane parked on a selector must not take the next message as its answer, #11761). + */ +export function useNativeChatInteractivePromptCard({ + paneKey, + messages, + transcriptSettled +}: { + paneKey: string + /** Pass the command-boundary-trimmed messages so an ask abandoned via `/clear` stays gone. */ + messages: readonly NativeChatMessage[] + transcriptSettled: boolean +}): InteractivePromptCard { + const interactivePrompt = useAppStore( + (s) => s.agentStatusByPaneKey[paneKey]?.interactivePrompt ?? null + ) + // The sibling `toolName` lets the question parser dispatch through the tool's + // registered parser (mobile parity). Read only beside a prompt: it changes on + // every tool call, and this hook re-renders the whole pane. + const interactiveToolName = useAppStore((s) => { + const entry = s.agentStatusByPaneKey[paneKey] + return entry?.interactivePrompt ? (entry.toolName ?? null) : null + }) + return useMemo(() => { + const statusCard = parseInteractivePrompt(interactivePrompt, interactiveToolName ?? undefined) + if (statusCard?.kind === 'approval') { + return statusCard + } + const prompt = resolveNativeChatAsk({ + liveAsk: statusCard?.prompt ?? null, + messages, + transcriptSettled + }) + return prompt ? { kind: 'question' as const, prompt } : null + }, [interactivePrompt, interactiveToolName, messages, transcriptSettled]) +} diff --git a/src/renderer/src/components/native-chat/use-native-chat-live-session.test.ts b/src/renderer/src/components/native-chat/use-native-chat-live-session.test.ts index cd4b701e2709..4c7f784eb318 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-live-session.test.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-live-session.test.ts @@ -547,6 +547,42 @@ describe('useNativeChatLiveSession — transport routing', () => { expect(latest?.status).toBe('ready') }) + // Declining a prompt with an interrupt fires no hook, so the row keeps saying + // `waiting`; the transcript's marker is what ends the wait. + it('ends a hook wait once the transcript records the turn interrupted', async () => { + const waitStartedAt = Date.now() - 1_000 + useAppStore.getState().setAgentStatus(PANE, { state: 'waiting', prompt: '', agentType: AGENT }) + const row = useAppStore.getState().agentStatusByPaneKey[PANE] + if (!row) { + throw new Error('the store dropped the status row this test depends on') + } + useAppStore.setState({ + agentStatusByPaneKey: { [PANE]: { ...row, stateStartedAt: waitStartedAt } } + }) + const transport = getMockTransport('env-1') + await render({ paneKey: PANE, agent: AGENT, sessionId: SESSION, runtimeEnvironmentId: 'env-1' }) + await act(async () => + transport.emit({ + type: 'snapshot', + messages: [user('u-1', 'go')], + hasMore: false, + lifecycle: { state: 'working', turnId: 'turn-1', timestamp: waitStartedAt - 500 } + }) + ) + expect(latest?.hookAwaitingInput).toBe(true) + expect(latest?.status).toBe('ready') + + await act(async () => + transport.emit({ + type: 'appended', + messages: [], + lifecycle: { state: 'interrupted', turnId: 'turn-1', timestamp: Date.now() } + }) + ) + + expect(latest?.hookAwaitingInput).toBe(false) + }) + it('does not let an older pagination read rewind a live completion', async () => { useAppStore.setState({ agentStatusByPaneKey: { diff --git a/src/renderer/src/components/native-chat/use-native-chat-live-session.ts b/src/renderer/src/components/native-chat/use-native-chat-live-session.ts index a62237f1b354..0f4a4058155d 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-live-session.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-live-session.ts @@ -9,7 +9,7 @@ import { createNativeChatMerger, replaceList } from '../../../../shared/native-chat-merge' -import { mergeNativeChatLiveSession } from './native-chat-live-status' +import { mergeNativeChatLiveSession, nativeChatHookAwaitsInput } from './native-chat-live-status' import { hasMoreNativeChatHistory, NATIVE_CHAT_INITIAL_LIMIT, @@ -342,6 +342,11 @@ export function useNativeChatLiveSession( }) return { ...session, + hookAwaitingInput: nativeChatHookAwaitsInput( + hookState, + hookStateStartedAt, + transcriptLifecycle + ), hasMore, loadingEarlier, olderHistoryGeneration, diff --git a/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts b/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts index cbbd819ce223..6772eec7a471 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-message-rail.test.ts @@ -36,7 +36,6 @@ function slotsOf(messages: NativeChatMessage[]) { receipts: new Map(), turnStatuses: { active: null, completedByTurn: {} }, turnDiffs: new Map(), - showTurnStatus: false, expandedTurnKeys: new Set(), isWorking: false, lifecycleWorking: false diff --git a/src/renderer/src/components/native-chat/use-native-chat-terminal-turn-timing.ts b/src/renderer/src/components/native-chat/use-native-chat-terminal-turn-timing.ts new file mode 100644 index 000000000000..13aa5a939771 --- /dev/null +++ b/src/renderer/src/components/native-chat/use-native-chat-terminal-turn-timing.ts @@ -0,0 +1,45 @@ +import { useMemo } from 'react' +import { useAppStore } from '../../store' +import type { NativeChatMessage } from '../../../../shared/native-chat-types' +import type { NativeChatSettledTurns } from '../../../../shared/native-chat-turn-status' +import { + nativeChatHookLatestTurnWorkedSeconds, + nativeChatHookTurnStartedAt, + nativeChatLatestTurnId, + nativeChatTranscriptSettledTurns +} from './native-chat-terminal-turn' +import { resolveNativeChatHookState } from './use-native-chat-hook-status' + +/** The terminal-backed pane's turn timing for the message list: when its running turn began, by + * the host, and each finished turn's duration (the host's for the latest, the transcript's for + * history). All of it survives a remount of the pane. */ +export function useNativeChatTerminalTurnTiming( + paneKey: string, + messages: readonly NativeChatMessage[], + turnActive: boolean +): { workingStartedAt: number | null; settledTurns: NativeChatSettledTurns } { + // Freshness is time-based: re-read when the scheduler says a silent row aged out. + const agentStatusEpoch = useAppStore((s) => s.agentStatusEpoch) + void agentStatusEpoch + const turnStartedAt = useAppStore((s) => + nativeChatHookTurnStartedAt(s.agentStatusByPaneKey[paneKey]) + ) + const latestWorkedSeconds = useAppStore((s) => { + const entry = s.agentStatusByPaneKey[paneKey] + return nativeChatHookLatestTurnWorkedSeconds(entry, resolveNativeChatHookState(entry) === null) + }) + const transcriptSettled = useMemo(() => nativeChatTranscriptSettledTurns(messages), [messages]) + const latestTurnId = useMemo(() => nativeChatLatestTurnId(messages), [messages]) + const settledTurns = useMemo(() => { + if (turnActive || latestWorkedSeconds === undefined || latestTurnId === null) { + return transcriptSettled + } + return new Map(transcriptSettled).set( + latestTurnId, + latestWorkedSeconds === null || turnStartedAt === null + ? null + : { startedAt: turnStartedAt, workedSeconds: latestWorkedSeconds } + ) + }, [latestTurnId, latestWorkedSeconds, transcriptSettled, turnActive, turnStartedAt]) + return { workingStartedAt: turnActive ? turnStartedAt : null, settledTurns } +} diff --git a/src/renderer/src/components/native-chat/use-native-chat-transcript-scroll.test.tsx b/src/renderer/src/components/native-chat/use-native-chat-transcript-scroll.test.tsx index 1f08a51299a8..948b83c5dbb8 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-transcript-scroll.test.tsx +++ b/src/renderer/src/components/native-chat/use-native-chat-transcript-scroll.test.tsx @@ -23,7 +23,7 @@ function TranscriptHarness({ contentRef, itemCount, isWorking: false, - showTypingIndicator: false, + showsTailRow: false, isVisible, alignToViewportTop: vi.fn(), scrollToEnd, diff --git a/src/renderer/src/components/native-chat/use-native-chat-transcript-scroll.ts b/src/renderer/src/components/native-chat/use-native-chat-transcript-scroll.ts index 23bebf0f1e8d..6df6d3eb562e 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-transcript-scroll.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-transcript-scroll.ts @@ -52,7 +52,7 @@ export function useNativeChatTranscriptScroll({ contentRef, itemCount, isWorking, - showTypingIndicator, + showsTailRow, isVisible, alignToViewportTop, scrollToEnd, @@ -64,7 +64,8 @@ export function useNativeChatTranscriptScroll({ contentRef: React.RefObject itemCount: number isWorking: boolean - showTypingIndicator: boolean + /** Whether the list draws a row after the transcript (live activity or a wait). */ + showsTailRow: boolean isVisible: boolean alignToViewportTop: (element: HTMLElement) => void scrollToEnd: () => void @@ -156,7 +157,7 @@ export function useNativeChatTranscriptScroll({ itemCount, isWorking, restoreScrollOffset, - showTypingIndicator, + showsTailRow, scrollToEndWhenMeasurable ]) diff --git a/src/renderer/src/components/native-chat/use-native-chat-turn-status.ts b/src/renderer/src/components/native-chat/use-native-chat-turn-status.ts index 95db05141d2b..33a795b8b9d6 100644 --- a/src/renderer/src/components/native-chat/use-native-chat-turn-status.ts +++ b/src/renderer/src/components/native-chat/use-native-chat-turn-status.ts @@ -23,7 +23,7 @@ export function useNativeChatTurnStatus({ activeTurnKey: string isWorking: boolean workingStartedAt?: number | null - /** Host-recorded durations; they outrank whatever this client observed. */ + /** Recorded durations (the host's journal or the transcript); they outrank what this client observed. */ settledTurns?: NativeChatSettledTurns | null /** Whether the turn is reasoning right now, derived from its journal content. */ thinking?: boolean diff --git a/src/renderer/src/hooks/ipc-events-agent-status-store-test-fixtures.ts b/src/renderer/src/hooks/ipc-events-agent-status-store-test-fixtures.ts index 7cabf081db90..8f676cada26f 100644 --- a/src/renderer/src/hooks/ipc-events-agent-status-store-test-fixtures.ts +++ b/src/renderer/src/hooks/ipc-events-agent-status-store-test-fixtures.ts @@ -47,6 +47,7 @@ export type AgentStatusSetData = { connectionId?: string | null receivedAt: number stateStartedAt: number + turnStartedAt?: number } export type StoreLike = Record export type StoreSubscribeListener = (state: StoreLike, previousState: StoreLike) => void diff --git a/src/renderer/src/hooks/ipc-events/agent-status-event-applicator.ts b/src/renderer/src/hooks/ipc-events/agent-status-event-applicator.ts index 47aa5521a26b..41957078f41a 100644 --- a/src/renderer/src/hooks/ipc-events/agent-status-event-applicator.ts +++ b/src/renderer/src/hooks/ipc-events/agent-status-event-applicator.ts @@ -227,7 +227,8 @@ export function createAgentStatusEventApplicator(args: { ...(data.evidenceObservedAt !== undefined ? { evidenceObservedAt: data.evidenceObservedAt } : {}), - stateStartedAt: data.stateStartedAt + stateStartedAt: data.stateStartedAt, + ...(Number.isFinite(data.turnStartedAt) ? { turnStartedAt: data.turnStartedAt } : {}) }, routing: { tabId: ownerTabId, diff --git a/src/renderer/src/hooks/useIpcEvents-agent-status-snapshot-replay.test.ts b/src/renderer/src/hooks/useIpcEvents-agent-status-snapshot-replay.test.ts index e26448f0b63c..f8f77eced611 100644 --- a/src/renderer/src/hooks/useIpcEvents-agent-status-snapshot-replay.test.ts +++ b/src/renderer/src/hooks/useIpcEvents-agent-status-snapshot-replay.test.ts @@ -79,7 +79,9 @@ describe('useIpcEvents agent status snapshot integration', () => { toolInput: 'pnpm test', terminalHandle: 'term-future', receivedAt: 1_700_000_000_000, - stateStartedAt: 1_699_999_999_000 + stateStartedAt: 1_699_999_999_000, + // A reload starts with no state history; the host's turn start must arrive with the row. + turnStartedAt: 1_699_999_990_000 } ]) await Promise.resolve() @@ -113,7 +115,11 @@ describe('useIpcEvents agent status snapshot integration', () => { toolInput: 'pnpm test' }), 'SSH Tab', - { updatedAt: 1_700_000_000_000, stateStartedAt: 1_699_999_999_000 }, + { + updatedAt: 1_700_000_000_000, + stateStartedAt: 1_699_999_999_000, + turnStartedAt: 1_699_999_990_000 + }, expectWorktreeRouting('wt-1'), undefined ) diff --git a/src/renderer/src/i18n/en-runtime-required.json b/src/renderer/src/i18n/en-runtime-required.json index 90fc6192a119..4f72d98bb172 100644 --- a/src/renderer/src/i18n/en-runtime-required.json +++ b/src/renderer/src/i18n/en-runtime-required.json @@ -2674,6 +2674,7 @@ "ask": { "asked": "Asked:", "awaiting": "Awaiting user input:", + "awaitingUnnamed": "Awaiting user input", "questionCount": "{{value0}} questions" }, "composer": { diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 5db365466e6a..30ac3af4db99 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -17800,6 +17800,7 @@ }, "ask": { "awaiting": "Awaiting user input:", + "awaitingUnnamed": "Awaiting user input", "asked": "Asked:", "questionCount": "{{value0}} questions" }, diff --git a/src/renderer/src/i18n/locales/fr.json b/src/renderer/src/i18n/locales/fr.json index 04e9bb284ab6..f378465a9436 100644 --- a/src/renderer/src/i18n/locales/fr.json +++ b/src/renderer/src/i18n/locales/fr.json @@ -17745,6 +17745,7 @@ "railEmptyMessage": "Message", "ask": { "awaiting": "En attente de la saisie de l'utilisateur :", + "awaitingUnnamed": "En attente de la saisie de l'utilisateur", "asked": "Demandé:", "questionCount": "{{value0}} questions" }, diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index 90f55805342d..bcb68593d904 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -17681,6 +17681,7 @@ "railEmptyMessage": "メッセージ", "ask": { "awaiting": "ユーザー入力を待っています:", + "awaitingUnnamed": "ユーザー入力を待っています", "asked": "質問:", "questionCount": "{{value0}} の質問" }, diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index dd0dbdfa8a76..8aa0335d8917 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -17681,6 +17681,7 @@ "railEmptyMessage": "메시지", "ask": { "awaiting": "사용자 입력을 기다리는 중:", + "awaitingUnnamed": "사용자 입력을 기다리는 중", "asked": "질문:", "questionCount": "{{value0}} 질문" }, diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 1514dd25697c..70cbc25bdc54 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -17646,6 +17646,7 @@ "railEmptyMessage": "信息", "ask": { "awaiting": "等待用户输入:", + "awaitingUnnamed": "等待用户输入", "asked": "问:", "questionCount": "{{value0}} 问题" }, diff --git a/src/renderer/src/runtime/sync-runtime-graph-agent-status-projection.test.ts b/src/renderer/src/runtime/sync-runtime-graph-agent-status-projection.test.ts index 5bd9460041ad..b78bb3175851 100644 --- a/src/renderer/src/runtime/sync-runtime-graph-agent-status-projection.test.ts +++ b/src/renderer/src/runtime/sync-runtime-graph-agent-status-projection.test.ts @@ -29,6 +29,8 @@ function referenceProjection(map: AppState['agentStatusByPaneKey']): string { prompt: entry.prompt, updatedAtBucket: Math.floor(entry.updatedAt / BUCKET_MS), stateStartedAt: entry.stateStartedAt, + // A new turn can keep the state (child work held it open); its stamp alone must republish. + turnStartedAt: entry.turnStartedAt ?? null, agentType: entry.agentType ?? null, terminalTitle: entry.terminalTitle ?? null, stateHistory: entry.stateHistory.map((history) => ({ @@ -77,6 +79,7 @@ describe('mobile agent-status projection equivalence', () => { statusMaps.push({}) statusMaps.push({ 'tab-0:leaf-0': makeEntry(0) }) statusMaps.push({ 'tab-0:leaf-0': makeEntry(0, { workingMode: 'monitoring' }) }) + statusMaps.push({ 'tab-0:leaf-0': makeEntry(0, { turnStartedAt: 1740000000500 }) }) const many: AppState['agentStatusByPaneKey'] = {} for (let index = 0; index < 12; index += 1) { many[`tab-${index}:leaf-0`] = makeEntry(index) diff --git a/src/renderer/src/runtime/sync-runtime-graph-projection-hot-path.test.ts b/src/renderer/src/runtime/sync-runtime-graph-projection-hot-path.test.ts index 0adbd768fe5a..587e30a769e4 100644 --- a/src/renderer/src/runtime/sync-runtime-graph-projection-hot-path.test.ts +++ b/src/renderer/src/runtime/sync-runtime-graph-projection-hot-path.test.ts @@ -111,6 +111,7 @@ function referenceAgentStatusProjection(map: AppState['agentStatusByPaneKey']): prompt: entry.prompt, updatedAtBucket: Math.floor(entry.updatedAt / AGENT_STATUS_SYNC_UPDATED_AT_BUCKET_MS), stateStartedAt: entry.stateStartedAt, + turnStartedAt: entry.turnStartedAt ?? null, agentType: entry.agentType ?? null, terminalTitle: entry.terminalTitle ?? null, stateHistory: entry.stateHistory.map((history) => ({ diff --git a/src/renderer/src/runtime/sync-runtime-graph/agent-status-projection.ts b/src/renderer/src/runtime/sync-runtime-graph/agent-status-projection.ts index ba41d169e8c8..25b655738396 100644 --- a/src/renderer/src/runtime/sync-runtime-graph/agent-status-projection.ts +++ b/src/renderer/src/runtime/sync-runtime-graph/agent-status-projection.ts @@ -19,6 +19,7 @@ function serializeAgentStatusEntry( prompt: entry.prompt, updatedAtBucket: Math.floor(entry.updatedAt / AGENT_STATUS_SYNC_UPDATED_AT_BUCKET_MS), stateStartedAt: entry.stateStartedAt, + turnStartedAt: entry.turnStartedAt ?? null, agentType: entry.agentType ?? null, terminalTitle: entry.terminalTitle ?? null, stateHistory: entry.stateHistory.map((history) => ({ diff --git a/src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.test.ts b/src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.test.ts index ae51553ea7bb..aa466c0f9b57 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.test.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.test.ts @@ -1,6 +1,9 @@ import { describe, expect, it } from 'vitest' -import type { AgentStateHistoryEntry } from '../../../../shared/agent-status-types' -import { sameAgentStateHistory } from './state-equality-core' +import type { + AgentStateHistoryEntry, + AgentStatusEntry +} from '../../../../shared/agent-status-types' +import { agentStatusEntryEqual, sameAgentStateHistory } from './state-equality-core' function doneEntry(mainAgent?: AgentStateHistoryEntry['mainAgent']): AgentStateHistoryEntry { return { state: 'done', prompt: 'ship it', startedAt: 1_000, ...(mainAgent ? { mainAgent } : {}) } @@ -25,3 +28,20 @@ describe('sameAgentStateHistory', () => { ).toBe(false) }) }) + +describe('agentStatusEntryEqual', () => { + // A paired client must take a host row whose only change is a new turn under the same state. + it('sees a new host turn start under an unchanged state', () => { + const entry: AgentStatusEntry = { + state: 'working', + prompt: 'ship it', + updatedAt: 2_000, + stateStartedAt: 1_000, + turnStartedAt: 1_000, + paneKey: 'tab-1:leaf-1', + stateHistory: [] + } + expect(agentStatusEntryEqual(entry, { ...entry })).toBe(true) + expect(agentStatusEntryEqual(entry, { ...entry, turnStartedAt: 1_500 })).toBe(false) + }) +}) diff --git a/src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.ts b/src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.ts index 197fb6981375..407b7f6c2f3f 100644 --- a/src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.ts +++ b/src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.ts @@ -48,6 +48,7 @@ export function agentStatusEntryEqual( a.prompt === b.prompt && a.updatedAt === b.updatedAt && a.stateStartedAt === b.stateStartedAt && + a.turnStartedAt === b.turnStartedAt && a.agentType === b.agentType && a.paneKey === b.paneKey && a.worktreeId === b.worktreeId && diff --git a/src/renderer/src/store/slices/agent-status-contract.ts b/src/renderer/src/store/slices/agent-status-contract.ts index afff64d33037..64ff3e10dcfe 100644 --- a/src/renderer/src/store/slices/agent-status-contract.ts +++ b/src/renderer/src/store/slices/agent-status-contract.ts @@ -88,6 +88,8 @@ export type AgentStatusTiming = { /** Observation clock for staleness; see `AgentStatusEntry.evidenceObservedAt`. */ evidenceObservedAt?: number stateStartedAt?: number + /** The host's turn start; see `AgentStatusEntry.turnStartedAt`. */ + turnStartedAt?: number } export type AgentStatusRouting = { diff --git a/src/renderer/src/store/slices/agent-status-live-entry-builder.ts b/src/renderer/src/store/slices/agent-status-live-entry-builder.ts index 28bf952460c3..ec80692f95e8 100644 --- a/src/renderer/src/store/slices/agent-status-live-entry-builder.ts +++ b/src/renderer/src/store/slices/agent-status-live-entry-builder.ts @@ -113,6 +113,11 @@ export function buildAgentStatusLiveEntry( : existing && existing.state === payload.state ? existing.stateStartedAt : updatedAt) + // Why: a writer with no turn clock (an OSC repaint) keeps the host's stamp only within one state; + // a state change it cannot date must not inherit another turn's start. + const turnStartedAt = + timing?.turnStartedAt ?? + (existing && existing.state === payload.state ? existing.turnStartedAt : undefined) if ( existing && shouldSuppressInheritedTerminalStatus({ @@ -205,6 +210,7 @@ export function buildAgentStatusLiveEntry( ...(metadata?.structuredHostOwned === true ? { structuredHostOwned: true as const } : {}), stateStartedAt, stateObservedAt, + ...(turnStartedAt !== undefined ? { turnStartedAt } : {}), agentType: identity.agentType, model: payload.model ?? (existing?.agentType === identity.agentType ? existing.model : undefined), diff --git a/src/renderer/src/store/slices/agent-status-turn-started-at.test.ts b/src/renderer/src/store/slices/agent-status-turn-started-at.test.ts new file mode 100644 index 000000000000..324b70e075f1 --- /dev/null +++ b/src/renderer/src/store/slices/agent-status-turn-started-at.test.ts @@ -0,0 +1,50 @@ +import { describe, expect, it } from 'vitest' +import { createTestStore } from './store-test-helpers' + +const PANE = 'tab-1:11111111-1111-4111-8111-111111111111' + +describe("the host's turn start on a renderer status entry", () => { + it('lands on the entry from the host timing and follows each host write', () => { + const store = createTestStore() + store + .getState() + .setAgentStatus(PANE, { state: 'working', prompt: 'go', agentType: 'claude' }, undefined, { + updatedAt: 1_000, + stateStartedAt: 1_000, + turnStartedAt: 900 + }) + expect(store.getState().agentStatusByPaneKey[PANE]?.turnStartedAt).toBe(900) + + // The same prompt sent again: the state never left working, the host stamped a new turn. + store + .getState() + .setAgentStatus(PANE, { state: 'working', prompt: 'go', agentType: 'claude' }, undefined, { + updatedAt: 2_000, + stateStartedAt: 1_000, + turnStartedAt: 1_900 + }) + expect(store.getState().agentStatusByPaneKey[PANE]?.turnStartedAt).toBe(1_900) + }) + + it('keeps the stamp behind an unchanged state when a writer carries none, and drops it on a state edge', () => { + const store = createTestStore() + store + .getState() + .setAgentStatus(PANE, { state: 'working', prompt: 'go', agentType: 'claude' }, undefined, { + updatedAt: 1_000, + stateStartedAt: 1_000, + turnStartedAt: 900 + }) + // A renderer-side OSC repaint has no turn clock of its own. + store.getState().setAgentStatus(PANE, { + state: 'working', + prompt: 'go', + agentType: 'claude', + toolName: 'Bash' + }) + expect(store.getState().agentStatusByPaneKey[PANE]?.turnStartedAt).toBe(900) + + store.getState().setAgentStatus(PANE, { state: 'done', prompt: 'go', agentType: 'claude' }) + expect(store.getState().agentStatusByPaneKey[PANE]?.turnStartedAt).toBeUndefined() + }) +}) diff --git a/src/shared/agent-status-ipc-payload.ts b/src/shared/agent-status-ipc-payload.ts index a15282b00181..68398a6d0def 100644 --- a/src/shared/agent-status-ipc-payload.ts +++ b/src/shared/agent-status-ipc-payload.ts @@ -55,6 +55,10 @@ export type AgentStatusIpcPayload = ParsedAgentStatusPayload & { evidenceObservedAt?: number /** Timestamp (ms) when the current state first appeared for this pane. */ stateStartedAt: number + /** When the main agent's current turn began, stamped by the hook server from the main agent's + * own turn-opening event. Optional: old hosts and turns opened unseen omit it, and readers fall + * back to `stateStartedAt`. */ + turnStartedAt?: number orchestration?: AgentStatusOrchestrationContext providerSession?: AgentProviderSessionMetadata /** Resume identity update only; the status-shaped fields are transport placeholders. */ diff --git a/src/shared/agent-status-types.ts b/src/shared/agent-status-types.ts index acc7e4f42554..5a9d34ae7d38 100644 --- a/src/shared/agent-status-types.ts +++ b/src/shared/agent-status-types.ts @@ -95,6 +95,9 @@ export type AgentStatusEntry = { stateStartedAt: number /** `updatedAt` of the write that switched into `state`; see AgentStateHistoryEntry.observedAt. */ stateObservedAt?: number + /** When the main agent's current turn began, as the hook server stamped it. Absent from old hosts + * and writers without a turn clock; readers fall back to `stateStartedAt`. */ + turnStartedAt?: number agentType?: AgentType /** Provider model currently used by this session. */ model?: string diff --git a/src/shared/native-chat-ask-row.ts b/src/shared/native-chat-ask-row.ts index 11900c5c4ea3..6d92f244f8ef 100644 --- a/src/shared/native-chat-ask-row.ts +++ b/src/shared/native-chat-ask-row.ts @@ -9,6 +9,7 @@ import { pairToolBlocks } from './native-chat-tool-fold' export const NATIVE_CHAT_ASK_ROW_COPY = { awaiting: 'Awaiting user input:', + awaitingUnnamed: 'Awaiting user input', asked: 'Asked:', questionCount: '{{value0}} questions' } as const From c49388cd33917a828b63997537c9710b4f1aec3a Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Tue, 29 Sep 2026 01:39:49 -0700 Subject: [PATCH 89/90] fix(native-chat): Stop is there from the moment a message is sent (#23026) * refactor(native-chat): remove the unused terminal handoff No client ever called agentSession.requestHandoff or mounted the handoff chrome. Delete the handoff coordinator, the terminal-owner runtime, the proof write path and the unmounted UI. Keep agentSession.handoffStatus, which released desktop clients read for worktree activation, and let records an older build left mid handoff reconcile through the ordinary restart and recovery paths. * fix(native-chat): never let the pre-stop snapshot hold a chat's stop Eviction now drains delivered events before quit's resume-offer snapshot. An unbounded wait there sits ahead of the provider stop, so a sink whose journal write stalls kept the child running until the step deadline aborted the eviction. The offer is advisory: bound the drain and stop the child regardless. Co-Authored-By: Claude * refactor(native-chat): drop helpers only the terminal handoff called `claudeAuthEnvCarriedForward`, `isPathWithinDirectory` and `queryWindowsProcessRowsFresh` lost their last caller with the handoff. The fresh-scan tests now go through `queryWindowsProcessDescendants({ fresh: true })`, the teardown path that still depends on that contract. Co-Authored-By: Claude * docs(native-chat): stop citing the removed handoff in lifecycle comments Six comments still named the handoff coordinator, a handoff suspend, or a terminal-owned session as live participants in the flows they describe. Co-Authored-By: Claude * test(native-chat): type the stalled snapshot drain without a cast Co-Authored-By: Claude * test(native-chat): pin that a start dead before proving owes no settlement The removed restart handoff test pinned this branch; nothing else did. Co-Authored-By: Claude * fix(native-chat): keep the owner-status read behind an in-flight attach The handoff removal dropped the per-session queue from `handoffStatus`, so a read landing mid-start reported the reservation (no owner) instead of the settled chat owner, and shipped desktop clients blocked worktree activation on it. The read is queued again, as it was before the removal. Co-Authored-By: Claude * refactor(terminal): remove the agent-session PTY write gate The gate only refused a write when a PTY had been bound to a chat session, and the only code that ever bound one was the terminal handoff this branch removes. With it gone, every admit/readmit returned "admitted" unconditionally, so the checks on the renderer write path, the runtime controller backstop, terminal.send, agent prompts, preview input and orchestration pointers, the refusal fields on terminal.send and worker-start receipts, the plugin and CLI refusal copy, and the adopted-pane orchestration routing could no longer run. Ordinary writes take the same path in the same order as before. Co-Authored-By: Claude * refactor(native-chat): drop the transcript helpers only the handoff called appendLegacyTranscriptMessages fed the terminal transcript catch-up and proveClaudeTranscriptBranch backed the terminal owner's exit proof. Both lost their last caller with the handoff. Their tests now go through the live entry points instead: the roster bounds through the legacy import, the pinned-read and growth tests through the ancestry replay the history window uses, and the marker rules through the string proof in their own file rather than the session-file resolver's. Co-Authored-By: Claude * fix(native-chat): stop calling a starting chat "mid-handoff" A send refused because the chat's owner is not settled showed "The session is mid-handoff ()." in the composer. With the handoff gone, the stages that reach it are a chat that is still starting, or one whose previous agent process has not yet been confirmed stopped. The message now says which of the two it is. The refusal code is unchanged. Co-Authored-By: Claude * test(native-chat): type the stand-in roster decoder without a cast Co-Authored-By: Claude * refactor(codex): name the pinned rollout lookup for what it does With the terminal handoff gone, the module named codex-tui-rollout-proof holds only the pinned rollout lookup that structured Codex launches use to resume a thread, so the name described code that no longer exists. Rename the module and its options type. Also drop a mobile allowlist assertion that pinned the removed agentSession.requestHandoff method, which no longer exists to allow. * refactor(native-chat): type the owner-status reply as the host sends it The handoffStatus reply type still listed the terminal handoff's fields and states (terminal placement, host label, proof retry, queued and waiting phases, the to-terminal direction). No host writes them any more and the only client reader parses the reply as unknown, so they described nothing. The reply on the wire is unchanged. * refactor(native-chat): normalize terminal-handoff lease values once at decode Nothing in this build writes a terminal owner (`runtimeKind: 'tui'`) or the handoff's `preparing` / `old-owner-stopped` stages, but the in-memory types still admitted them, so readers across the host kept branches for values no path produces and the compiler could not point at them. The store now validates the on-disk shape, which still accepts those values so an older record is not quarantined, and maps them once while parsing: - `preparing` and `old-owner-stopped` become `recovering` - a `tui` lease becomes `native`; when it records a process it also becomes `conflicted`, the claim every build probes but never stops. A plain native owner would be stopped by restart recovery, here and in older builds. Revisions are taken over the normalized state on both sides of every compare, and the mapped record reaches disk with the store's first transaction, the same way the tab-id backfill does. The in-memory types narrow to what this build writes, and the branches that existed only for the removed values go. Structured-worker identity keeps its verdict for a former terminal owner by refusing a conflicted claim rather than a non-native kind. * refactor(native-chat): stop threading the owner kind through a reservation A reservation only ever names a native owner now, so the request no longer carries a kind and the reserved lease records `native` directly. The attach params keep `runtimeKind`: agentSession.ensure and create accept it, and the operation fingerprint stored in the ledger covers it. * test(native-chat): pin the legacy-lease rewrite with a transaction that changes nothing else Hiding a tab also committed the visibility index, so the no-op transaction wrote the file even when its open-time revision was wrong. Committing the index first leaves the pending rewrite as the only reason to write. * fix(native-chat): name a chat write by its target, not the owner generation A write carried the fence of the last frame the pane read, and the host refused it unless that fence was still current. An idle release and the restart after it each move the fence, and the release publishes nothing, so a send after a release was refused "Expected runtime fence 1; the session is at 3", and a Stop queued behind a cold start was refused as stale. Every write already names what it acts on: a send its conversation, a cancel its turn, a prompt answer its item revision, a rewind its epoch; an option is last-writer-wins. So admission stops comparing the client's fence, and the rebase that papered over one restart (admitAtResumedFence, resumedFromFence) goes with it. The writer-lease check stays, and so does the attach's compare-and-swap. Frames now stamp the fence read when each frame is sent instead of a copy each subscriber kept, which went stale on the same release. * fix(native-chat): every journal append reaches the chats that are open A journal write and its delivery to open readers were two calls, and some writers made only the first. A failed start whose lease could not be handed back, a provider revision with no frame behind it, and eviction's settlement were all journaled without reaching an open chat. A journal handle now reports every durable change, and the host's session map binds that report to the session's readers when the handle is set. Writers no longer publish what they append; the per-writer publish calls are deleted. * test(native-chat): an epoch replacement reaches the open chat * test(native-chat): each row reaches an open chat once, and a live handle enters only through the map * test(native-chat): give the legacy-lease store test a tab id so the backfill cannot supply its rewrite The seeded record had no surface tab id, so the next open backfilled one and that rewrite alone made the no-op transaction write. The test passed with the legacy-lease rewrite signal removed. * test(worktree-activation): restore the OMP surfaced-agent resume test The handoff removal deleted it alongside the terminal-owner tests, but it covers the surfaced-PTY block that still guards resume, including an agent whose ownership is unknown. * perf(native-chat): a publish behind a delivered commit reads nothing Each commit now delivers itself, so the publish a provider frame still sends afterwards found every reader caught up but still read rows and rebuilt the timeline for each one. A caught-up reader now skips the read. * test(native-chat): state why the teardown test's fake journal is safe to cast * docs(native-chat): say mutation admission checks only the writer lease * docs(native-chat): drop the send rebase from comments that still described it * fix(native-chat): a message is accepted, then delivered A send to a chat with no running agent restarted the agent inside the send call, before the message was recorded, so the client waited for the whole start and a failed restart refused the message. Claude held prompts sent during startup, and those could settle as "unconfirmed". A send is now accepted inside the session's serialized queue: one ledger row and one submission row marked handoverRecorded, published, answered pending. A per-session delivery loop exists while a message is queued. It starts the agent through the same serialized attach a hold uses, waits outside the queue for a Claude child to prove its start, and hands the oldest queued message over as its own serialized step, writing dispatch{pending} before the adapter call. A start it needed and did not get writes one error-tone row and rejects every queued message with the same words; a start Stop cancelled writes none. Settlement follows from the rows. A queued message is provably unwritten, so a close, an eviction or an exit rejects it. A handed-over message stays in doubt. A queued row at or below the sequence a handle found when it opened was left by an earlier process and is rejected at open, with no latch. Stop withdraws queued messages with no writer lease and no fence. An attach failure keeps the conversation open, and the attach adopts its journal. Owed work counts the loop and queued rows. A compaction or rewind found prepared when a conversation opens was started under a child this process no longer has, so the open settles it rather than leaving it to refuse every send until a view attaches. The open cursor is scoped to its epoch, because sequences restart when an epoch is replaced. Deleted: restart-before-admission, recordFailedRestart, the fence rebase, Claude's startup gate, the attach's forget on failure and its own crash boundary. Clients without agent-session.accepted-send.v1 get their reply held until the handover; the desktop and paired desktop lists advertise it. * fix(native-chat): settle queued messages only for the child that ended A child that proved its start and then exited before its message was handed over left the message queued: the exit settlement returned early when nothing else was in flight. Delivery then started another child for it, and a child that died the same way started another, without end and without a row. A retried settlement for an earlier generation, run by the attach that delivery started, did the opposite: with that generation's turn unfinished it rejected the message queued for the child being attached. The settlement now takes the rejection for queued messages from its caller. The unexpected exit and the eviction pass one, and it applies even with no other work in flight; the retry for an earlier generation passes none. * fix(native-chat): an adoption that fails to import keeps the conversation open The attach now writes into the conversation's own open journal, but a failed transcript import still closed it as if it were the attach's provisional one. The conversation stayed indexed with a closed journal, so every later send answered "could not be recorded" and every attach failed again until the app restarted. The import now closes only a journal the attach opened for itself. * perf(native-chat): the recovering open reads the journal once Every conversation open now goes through the recovering open, including the read restore of every chat at startup, which used to replay its journal once. The recovering open replayed it twice: once to probe it and again inside the open. The probe is now handed to the open as its load. * fix(native-chat): an attach that fails after indexing its child leaves no child behind A failed attach now keeps the conversation open, but a failure after `onAttached` indexed the child (the rewind or compaction recovery, or the attach's own success record) left that entry claiming a child the failure path had already released. The next send found the phantom, skipped the start, and wrote at a fence the journal had moved past, so the message stayed queued for good. The entry now drops the released child and its event sink, and follows the record's fence, as a failure before indexing already did. * fix(native-chat): a withdrawn message shows no error, and a rejection outlasts the send's answer The error strip for a message the host accepted and then did not deliver matched the entry before the outbox reconciled, so a Stop's withdrawal, which the reconcile drops, showed "Orca could not send your message" with nothing to retry. It now reads the reconciled entry. A rejection the journal records before the send's own pending answer lands is final as well: that answer no longer puts the entry back to dispatching with no Retry. * fix(orchestration): a structured worker whose agent outlasts the preamble wait is left unknown, not torn down The preamble waits for its submission to be delivered while the worker's agent starts. When that wait ran out it threw operation_unknown, and the failed-start teardown then closed the session, which rejected the very preamble the host was about to deliver. It now reports a turn start nobody observed yet: the worker is start-unknown with its session kept, the host delivers the preamble when the agent starts, and the worker's report settles the dispatch as for any unobserved start. The receipt no longer suggests reading a screen a structured worker lacks. * fix(native-chat): a message rejected while its chat was closed reads as not sent A remount reads an entry it left dispatching as unconfirmed. When the journal had rejected it meanwhile, as a failed start or a quit now does, the reconcile left it unconfirmed: it blocked every later message behind a Retry and no reason, and the delivery probe, seeing the journal already answered, never ran. The reconcile now settles it as rejected like a dispatching one. * test(orchestration): name why the readiness settlement fakes are cast * fix(native-chat): keep each pane's own fence on frames so a failed restart is not resent * docs(native-chat): drop the fence from the admission the send effects run behind * docs(native-chat): give the fence move on release the reason that still holds * docs(native-chat): stop citing a write fence check in launch and mailbox comments Three places still gave the removed fence check as a reason: the launch replay said admission puts the ledger ahead of the fence, the launch surface said a send must name the lease it was admitted against, and the direct-mailbox path said the lease fence decides whether delivery is safe. Admission now checks only the writer lease. * refactor(native-chat): the provider child is its own record A conversation now outlives any number of provider children, so the child is one record on the conversation's entry instead of five loose fields beside its journal. It is written in one place: indexed only once an attach has fully succeeded, and ended through one function that an exit, a failed re-attach, a Stop and an eviction all share, matched on the child's generation and fence. - A failed attach writes no child, so there is nothing to unwind: the field unwind and the fence patch after it are gone. - Conversation writes read the record's fence, the way mutation admission already does; a child's own writes use its fence. The four stored-fence patches, and the settlement retry's overwrite of the conversation's fence, are gone. - The owed wind-down is its own tombstone, carrying the child it is owed for, and is no longer dropped when an attach replaced the whole entry. - Stop on a child still proving its start stops only the child: its lease goes back and the chat is told it is idle, but the journal, the holders and the readers stay. Close is that stop plus the conversation's close. - The settlement retry uses the conversation's own journal, opened through the host's one open. * fix(native-chat): the delivery loop alone settles a message its start or child failed A queued message was settled by whichever path happened to end the child first: the loop, the unexpected exit, eviction's work settlement, the open's leftover rule, and the startup branch that rejected every pending row. That gave two failure rows with different tones for one start, a loop that could hand over to a different child than the one it waited on, and a Claude start that died while starting reading unlike every other failed start. - The loop remembers the child it waited on. At handover, if that child is gone or replaced, it reads how it ended: a Stop continues; anything else writes one failure row and rejects every queued message with the same words, then stops. A child still starting whose start the adapter says did not land fails the same way. The exit, eviction and the settlement retry only settle the handed-over and legacy rows of the child that ended. - One failure row, always an error, keyed by the start. A start a view began that dies with nothing queued writes the same row through the same builder, so a second report revises it. - The open no longer rejects leftovers; the loop's first step does, and the open wakes it. - `awaitStarted` answers why a start did not land, so the row says it even when the loop sees the failure before the exit is processed. - Quit closes every conversation the way closing a chat does: what is still queued is rejected as closed, with or without a child, and a start the loop already has in flight is waited for so the child it produces is stopped rather than left behind. * refactor(native-chat): a stopped child ends on the one reading of its stop The eviction step reads a stop's result through `stopAgentSessionProviderRoot` and hands that verdict to the child's ending, so the host never forms a second view of whether the root is gone. Every ending carries it: a stop's comes from that reading, an exit's root is gone by definition, and a failed re-attach passes what its release saw. The end-of-child record can therefore also carry a stop whose root was not seen to go, which nothing ends on yet. * feat(native-chat): the host says it accepts a send before any agent has it The host now lists agent-session.accepted-send.v1 among its own runtime capabilities, the same string capable clients already send. A client can then tell a host that answers a send at acceptance, and admits a Stop with no writer before a turn starts, from an older one that still restarts the agent inside the send. Additive: an older client ignores a capability it does not know. * refactor(native-chat): an attach never opens a journal of its own The attach adopts the conversation's open journal, which outlives it, so it no longer opens one for a direct caller either. That leaves nothing for a failed adopted import to close, and the flag that told the two cases apart is gone. Tests that attach without a host open the conversation the way a host does. * fix(native-chat): a moved fence resends nothing on a host that accepts first The outbox treated any fence change as a new owner: it dropped the answer of a send in flight, queued that send to go out again under the same id, and unblocked a refused head. On an older host that is how a send the restart refused, unrecorded, gets another try. On a host that records every send before it starts an agent, a fence moves because that start ran, so the same rule resent into every failed start. With a fence stamped on every frame, that became a loop. The outbox now reacts to a fence change only when the host has not advertised that it accepts a send before any agent has it. On such a host, only a Retry or a new send goes out, and a failed start reaches the client as a rejected message it keeps with its Retry. Against an older host, or before one has answered, the outbox behaves as it did. Desktop and paired web share this hook. * refactor(native-chat): a child's end says whether the user or the host stopped it The end-of-child record's cause now tells a user's Stop from the host stopping the child for a cause of its own: `user-stop` and `host-stop` replace `stop`. The delivery loop goes on after a user's Stop, as before, and fails the start it was waiting on after a host stop, with the one error row and every queued message rejected, in the stop's reason when it gave one. The reason stays description only. Stop passes `user-stop`; nothing passes `host-stop` yet. * fix(native-chat): a chat whose only work is a queued message is not offered for resume A message accepted while the agent was starting counts as working in the chat, and quit rejects it as never sent. The teardown snapshot read the same working rule, so a relaunch offered to resume a chat whose agent never had the message. The snapshot now reads only what was handed over. * test(native-chat): type the queued-message fixtures in the resume-offer tests * fix(native-chat): a start that dies while a message waits on it is that message's failed start Opening a chat's tab starts an agent for the view, and a send accepted meanwhile waits on it. When that start died, its exit wrote the start's error row and left the message queued, so the delivery loop started a second agent into the same failure and wrote a second row. A child's end now records where the conversation's journal stood, and the loop settles a message accepted before a failed start ended with that start: one row, under its key, and no second start. A message sent after the failure still gets a fresh start. * docs(native-chat): say what an attach's open conversation and unconfirmed ids are now * test(native-chat): pin what a failed start settles, and what a resume offer names A view's child that dies while a sent message waits settles that message only when it died starting and no child has taken its place: a proven child's crash, or a second start since, gets the message delivered. The resume offer names the handed-over message, never a newer one still queued. * test(native-chat): the failed-start pins fail on what the message became, not on a timeout * test(orchestration): the preamble's host stub is typed, not cast The preamble send now takes only what it reads of the host, the send, the settlement wait and the record's fence, so its test builds that host with real types instead of `as never`. * fix(native-chat): a Stop that names no turn stops what the conversation has in flight Between handing a message to the agent and the agent opening its turn, there is no turn id a client could name, so a Stop in that gap was refused as "already finished" while the agent went on to answer. A cancel's turn id is now an optional precondition instead of its target: with none, the host withdraws what is queued and, when the journal still reads working, asks the adapter to stop whatever the child has in flight. Claude's interrupt is session-scoped, so it is guarded by fence and acquisition generation rather than a turn identity. Codex interrupts the turn its latest turn/start answered with until the journal shows one. A cancel that names its turn behaves exactly as before. * fix(native-chat): Stop is there from the moment a message is sent The composer showed Stop only once the agent had opened a turn, so for the second or two after a send the chat read "thinking" with no way to stop it. Against a host that takes a Stop naming no turn, Stop now shows whenever the chat reads working (a turn, a queued message, or a handed-over one still unanswered) or this client still has a message on its way. Pressing it, or Escape, first drops every outbox entry the journal does not hold yet, so nothing goes out after the Stop, then sends the conversation-wide cancel. A send already on its way reaches the host ahead of the cancel, which withdraws it there. Against an older host Stop still needs a running turn. The unconfirmed-send probe moves into its own hook so the outbox hook stays in budget. * fix(native-chat): Stop before a turn is gated on its own host capability A host that accepts sends first (agent-session.accepted-send.v1) can still predate the cancel that names no turn and would refuse it as invalid, since clients and hosts ship independently. Hosts that take that cancel now advertise agent-session.conversation-stop.v1, and the renderer shows Stop before a turn opens, and sends the no-turn cancel, only to a host advertising it. Every other host keeps a Stop that needs, and names, a running turn. The host capability probe the accepted-send hook used is generalized so both read one path. * test(native-chat): a build advertises conversation stop exactly where its cancel may name no turn * fix(native-chat): a view never restarts a chat whose last start failed A Claude chat whose CLI exits during startup left one red row per start, and every time a view bound to it (the chat opening right after its create died, or the user switching back to it) the hold started the CLI again, so the same launch-failure row repeated. Only a send retries a failed start now, the same rule provider-exit recovery already applied; the rule lives in one predicate the hold, exit recovery and the delivery loop share. * test(native-chat): start the child the loop waits on with an attach, not a second view A view no longer starts a child whose last start failed, so the R2 case that waits on a child started since the failure now gets that child from a client attach, the one non-send starter left. * fix(native-chat): settle a gone generation's turn wherever a conversation opens A send that opens a chat this process had not read yet (after a crash, from a phone or the CLI) went through the delivery open, which never settled what the dead generation left running; only the read restore and a successful acquire did. When the send's start then failed, the turn stayed running for every reader. The settlement now runs in the one journal open, at the crash boundary, for every opener except an acquisition, which settles from the evidence it read before its reserve; the read restore's separate step is gone. * test(native-chat): prove the next child's start settles the turn an earlier child left The R1 case lost its only settlement assertion when the latch it checked was deleted. It now seeds the running turn the earlier child left and asserts it ends at the exit's receipt, with the exit's row, before the message is handed to the new child. * test(native-chat): count a failed start's rows by row, not by text Comparing the set of texts passed when two different rows carried the same words, which is the duplicate the test exists to catch. * test(native-chat): give the failed-start and stale-turn waits a loaded runner's budget * test(native-chat): pin the open's and the send's start and row counts, however the view binds Opening a fresh chat whose starts fail makes one start and one row, with two views bound before or after the create's child died; one send makes one more of each. * fix(native-chat): settle a gone generation's turn at every open but an acquisition's The journal open skipped the settlement whenever the lease read reserved or live, to leave an acquisition's own open to the acquisition. But a lease a crashed process left in recovery also reads live, until the next acquire resolves it. A send that opened such a chat, from a phone or the CLI after a crash on a host that could not prove the old owner gone, skipped the settlement; when its start then failed, the dead turn stayed running for every reader. The acquisition now says it is the opener, and every other open settles, whatever the lease still claims. * test(native-chat): hold the create's start open until the views bind The "view binds while the create is still starting" case gave the create a 300 ms head start and asserted the views bound before it died. On a loaded runner the holds took longer, the create's exit landed first, and the case failed its own precondition. The create's initialize now waits on a gate the test releases once the views are bound. * fix(native-chat): Stop reads the one working rule every session list reads While Claude retries a rate-limited request it never echoes the message, so no turn opens: the sidebar read Working from the unanswered send while the composer showed Send. The chat's working state, the host's session-list status and the host's no-turn Stop check now call one shared rule instead of three copies. * test(native-chat): a rate-limit retry pins only that no turn opens, not how its rows are kept * fix(native-chat): Stop leaves a message waiting on its Retry, and does not show for one A send that failed holds the queue until the user retries it, and one the host restarted under is parked the same way. Stop counted both as still on their way, so it showed in an idle chat and could never go away, and pressing it dropped the failed message along with its Retry. * test(native-chat): the chat's Stop and a session list read the main agent alike over their own copies The chat reduces its stream and a list reads the status feed. Driven through the real host for a rate-limit retry with no turn, a subagent still running after the main turn, and the handed-over child exiting. * refactor(mobile): the chat reads the main agent's working state through the shared rule Behaviour is unchanged: the same two terms, now from the one function the host projection and the desktop chat read. * fix(codex): a Stop naming no turn never interrupts an earlier turn It fell back to the id an earlier turn/start answered with when the latest start went unanswered, or when the journal showed a compaction Codex had not started, and reported that as stopped. * fix(native-chat): a Stop naming no turn never says a turn had already finished When the provider found nothing left to stop, for instance a turn that ended between the host's check and the interrupt, the chat got "The provider had already finished this turn." for a turn the Stop never named. It now ends quietly, as a Stop with nothing in flight does. * fix(native-chat): one Stop the host could not settle no longer refuses every later one A Stop naming no turn has one operation key per session. When the host could not settle one, it answered every later Stop under the same id as unknown until the id expired. Once the host says so, the next press is a new Stop; transport doubt still replays the same id. * refactor(native-chat): drop the composer's second error formatter After the merge with main, every chat write in the composer path reports its failure as a typed outcome worded by the refusal-notice table, so the send's catch sees only a local throw. The {code, message} formatter this branch added for it has no payload left to format, and its claim to be the one way a chat words a failure is no longer true. The composer send is main's again. * test(native-chat): pin the reason on a message rejected while its chat was closed The reopen test checked only that the message reads as not sent; it now also checks the Retry row carries the host's reason. * test(native-chat): read Stop operation ids without a cast * fix(native-chat): a Stop whose answer was lost no longer swallows the next one A Stop that names no turn has one operation key per chat. When its answer was lost in transit, the chat kept the id, so every later Stop replayed it; the host answers a replay as already handled, so for up to a day Stop stopped nothing. The id is now dropped once the call settles, however it settles. A second press while the first is still on its way still shares its id. * refactor(native-chat): a Stop naming no target keeps its operation id only for its own call The chat kept each write's operation id per payload across calls, and dropped it only on some settle paths. That is right for a write naming what it acts on, but a Stop naming no turn, and a stop of every background task, share one payload with every later one, so any path that kept the id made the next Stop replay as already handled and stop nothing. One path was still open: an answer that arrived after the chat moved to a new fence. Whether a write names its target is now decided once, before its id is picked. One that names none keeps its id only while its call is in flight, so a press made meanwhile joins it, and releases it when the call settles, however it settles. The release runs only while the key still holds that call's id, so a joined call settling late cannot drop a newer one's. This replaces the per-path exceptions for a thrown call. * test(native-chat): read the Stop fences without a cast * test(native-chat): pin the new id for a named cancel the host could not settle After the Stop naming no turn moved to a per-call id, the only test of the unknown-refusal release was gone, and the half that stays, for a cancel naming its turn, could be removed with every test green. * fix(native-chat): a Stop pressed after a new message stops it, even while the last Stop is unanswered A Stop naming no turn shared its operation id with any press made while it was still in flight. The host runs a chat's writes in order, so a message sent between two presses was accepted after the first Stop ran, and the second press replayed that Stop as already handled and left the message running, although the chat had already withdrawn it from the outbox. A write naming no target now gets a new id on every press and is never kept, so each Stop acts on whatever is running when the host reaches it. A write naming its target keeps its id exactly as before. A double press can ask the provider to stop the same turn twice, which it tolerates. * fix(native-chat): Stop no longer blinks off as Claude opens the turn for a message Claude's echo of a sent message both answers the send and opens its turn. The echo settled the send first, so the host published the message as answered one frame before the turn it opened, and for that frame the chat read nothing running: Stop turned back into Send, and Working blinked off in every session list, for tens of milliseconds on each turn. The echo now settles the send after the turn it opens has been emitted, so the running turn is published first. * fix(native-chat): a message a Stop withdrew comes back to its sender's composer A Stop withdraws every message the host holds but has not run, and S also drops the ones this client had not handed over yet. Either way the message left the chat and its text survived only in a hidden journal row and the in-memory ArrowUp history. The sending client now puts the withdrawn text and images back in that pane's composer, after whatever is typed there. Withdrawn is read from the rejection reason through one shared check, which the outbox reconcile now uses too. The composer is written before the entry leaves storage, so a failure between the two repeats the text instead of losing it, and an entry storage no longer holds is never given back again, so a replay, a second view or a remount restores it once. Only this client's outbox holds the entry, so other viewers still see the message disappear. A failed Stop withdraws nothing on the host and gives nothing back. * fix(native-chat): withdrawn text put back during an IME composition is not lost While the IME owns the field, the composer ignores a programmatic draft, and the next composed keystroke wrote the draft without the restored text, after its outbox entry had already been dropped. The composer now holds text appended mid-composition, keeps it in the cache after each composed write, and shows it once the composition settles, the way attachments that land mid-composition already wait for it. * test(native-chat): pin that only a withdrawn message comes back to the composer * test(native-chat): set up the composer's window API for every describe in the composition-race file * docs(native-chat): note that the withdrawn check reads the legacy reason until a typed category lands * test(native-chat): pin that text put back mid-composition shows once, even beside a mid-composition clear * fix(native-chat): land a late settlement from a streamed turn's end after that turn's rows A settlement that says a streamed turn ended waits for the session's event sink to drain before writing its dispatch row. The journal reducer still refuses to overwrite an accepted or rejected send. * fix(codex): settle a send from the end of the turn Codex answered it into The turn/start answer names the turn that holds a send. The send's echo entry now keeps that binding, in memory only. If the bound turn is interrupted without echoing the send, the send is withdrawn: Codex clears a turn's pending input on interrupt, so the model never saw it. If the turn fails first, the send is rejected in Codex's words. A completed turn settles nothing, since Codex records pending input when it finishes and the echo is still due. An answer read after its turn already ended is settled by that end. The echo is still the acceptance and carries the item key. * test(codex): a send settles from the end of the turn Codex answered it into The fake Codex keeps 0.157's turn bookkeeping, and can deliver the turn/start answer after turn/started or after turn/completed. The tests cover: - a Stop before any echo withdraws the send, and the working rule reads idle; - a steered follow-up is withdrawn when the turn is interrupted; - a failed turn rejects the send in Codex's words; - a completed turn leaves the send to its echo; - a normal echo and a late echo; - two steered sends in one turn; - an answer read after the turn ended; - a timed-out answer; - child-thread turns; - how a binding dies. * refactor(native-chat): drop the stream flush before a late turn-end settlement Nothing reads the order of a dispatch row against the turn's terminal row: the reducer keeps a settled send terminal and the working state is derived from both. The echo acceptance on the same path never waited either, and the wait could drop the settlement on a failed sink barrier. * fix(codex): settle a failed turn's sends at its end, not at its error Codex keeps a failed turn's pending input and records it after the error frame, before turn/completed. Settling at the error rejected a steered follow-up the model had in fact received, so a Retry would send it twice. * docs(codex): say a completed turn echoes what it took before it ends Codex records a completed turn's pending input before `turn/completed`, so a bound send that turn never echoed is left for recovery, not awaiting an echo. The comments and one test title said the echo was still due. * test(codex): settle a send whose answer is read after its turn failed or completed A failed turn that ended before the answer rejects the send in Codex's words, once; a completed one leaves it admitted and still armed for its echo. * refactor(codex): read a failed turn's reason with the typed thread-fact reader * fix(native-chat): a Stop that names no turn and ends nothing says why The host sends a Stop naming no turn to the agent only while the chat reads working. When the agent ended nothing, the Stop wrote no row, so it looked ignored. It now writes one: Stop could not reach the agent, in the agent's own words when it refused the interrupt. * fix(codex): hold a cold send until Codex opens its turn, and stop the turn it opened Codex answers turn/start before it opens the turn, and refuses an interrupt until then. A Stop queued behind a cold send ran in that gap, named the answered turn, and was refused. The send's handover now lasts until Codex opens that turn, or provably will not: the turn ended, the primary thread stopped running, or the child ended, bounded by the turn/start deadline. A steered send, whose turn is already open, does not wait. A Stop naming no turn now interrupts the turn the journal shows, else the primary-thread turn Codex reported started and not yet ended. The per-start answered id is gone: it was never cleared at a turn's end. * fix(native-chat): give back a send already on its way only when the host withdraws it Stop took the in-flight send out of the outbox and put its text back in the composer at once. The send still landed ahead of the Stop, so the chat read working for a moment before the host withdrew it, and a send the agent had already taken came back as well. The in-flight send now stays until the host answers it, and the withdrawn-message restore gives it back from that answer. * refactor(native-chat): read a Stop's withdrawal through the rejection classifier dispatchWasWithdrawn matched the legacy reason string. It now asks the classifier, which reads the typed fact first and keeps that string only as its own fallback, so a withdrawal written as a fact with a sentence is still given back to the composer. * fix(native-chat): a Stop Codex took but Orca could not confirm is not reported as reaching nothing When Codex acknowledged the interrupt but Orca could not verify the turn's processes ended, a Stop naming no turn wrote "it had no turn running to stop", though the turn then ended as interrupted. The adapter now says the Stop was taken but unconfirmed, and the row says Cancellation was not confirmed. * fix(codex): a held cold send never delays closing the chat or quitting A cold send's handover waits for Codex to open its turn, and that wait sat in the session queue ahead of the close and quit eviction, so either could wait out the 30 s request deadline. The host now releases those waits before it queues a close or starts quit teardown, and the adapter releases them when it is asked to close the child and on every exit, including one whose end publication is backpressured. * fix(native-chat): a refused Stop says the agent declined, and names it "Stop could not reach the agent" was wrong: the agent was reached and declined. The row now reads "Codex had no turn running to stop." or "Codex didn't stop: .", naming the chat's agent. * fix(codex): a Stop waits for the turn Codex answered to open; the send no longer does Codex answers turn/start before it opens the turn and refuses turn/interrupt until then, so a Stop naming no turn in that window was lost. The send's handover used to wait for the turn to open, and a close or quit needed its own release to get past that wait. Now only the Stop waits. A Stop naming no turn, finding no journal turn and no open one, reads the turn Codex answered the latest pending send into and has neither opened nor ended, and waits for it: bounded at 5 s, under the quit eviction budget, and ended by that turn opening or ending, the thread going idle or failing, or the child exiting. If the turn opened it is stopped; otherwise the Stop reports that Codex had no turn running. The send returns at Codex's answer, so a close or quit with no Stop pending is never delayed, and the release plumbing through the adapter, router, close and quit is gone. * fix(codex): the Stop's wait reads a stopped thread from the thread-facts reader main kept --------- Co-authored-by: Claude --- .../use-mobile-structured-agent-session.ts | 6 +- ...laude-structured-conversation-stop.test.ts | 101 ++++ .../claude-structured-prompt-ownership.ts | 37 +- ...claude-structured-rate-limit-retry.test.ts | 50 ++ .../claude/claude-structured-real-cli.test.ts | 74 +++ .../claude-structured-session-acquisition.ts | 8 +- .../codex-requested-close-turn-timing.test.ts | 2 + ...codex-structured-conversation-stop.test.ts | 94 +++ ...odex-structured-dispatch-admission.test.ts | 18 +- .../codex-structured-dispatch-echo.test.ts | 41 ++ .../codex/codex-structured-dispatch-echo.ts | 27 +- .../codex-structured-dispatch-test-support.ts | 51 +- .../codex/codex-structured-fast-mode.test.ts | 14 +- .../codex-structured-prompt-ownership.test.ts | 2 +- .../codex-structured-prompt-ownership.ts | 62 +- .../codex/codex-structured-provider-events.ts | 1 + ...odex-structured-session-adapter-fixture.ts | 13 + .../codex-structured-session-adapter.test.ts | 8 +- .../codex-structured-session-cancel.test.ts | 16 +- .../codex-structured-session-close.test.ts | 37 +- .../codex/codex-structured-session-close.ts | 2 + ...structured-session-options-catalog.test.ts | 2 + .../codex-structured-session-options.test.ts | 2 + .../codex/codex-structured-session-state.ts | 21 +- .../codex-structured-turn-cancellation.ts | 13 +- ...dex-structured-turn-end-settlement.test.ts | 33 +- .../codex-structured-turn-open-wait.test.ts | 147 +++++ .../codex/codex-structured-turn-open-wait.ts | 54 ++ .../structured-agent-session-adapter.ts | 20 +- ...-agent-session-claude-echo-working.test.ts | 146 +++++ ...ed-agent-session-conversation-stop.test.ts | 277 +++++++++ ...structured-agent-session-host-mutations.ts | 26 +- ...ssion-main-agent-working-agreement.test.ts | 229 ++++++++ ...structured-agent-session-mutation-plans.ts | 11 +- .../structured-agent-session-turns.ts | 76 ++- .../methods/structured-agent-session.test.ts | 3 + ...-session-codex-turn-end-settlement.test.ts | 117 +++- .../native-chat/NativeChatComposer.test.tsx | 2 +- .../native-chat/NativeChatComposer.tsx | 8 +- ...tiveChatStructuredSession.test-harness.tsx | 12 +- .../NativeChatStructuredSession.test.tsx | 27 + .../NativeChatStructuredSession.tsx | 19 +- .../native-chat/NativeChatView.test.tsx | 4 +- .../native-chat/native-chat-draft-cache.ts | 34 ++ ...structured-send-composition-clear.test.tsx | 86 ++- ...session-withdrawn-message-restore.test.tsx | 475 +++++++++++++++ ...agent-session-withdrawn-message-restore.ts | 76 +++ .../use-native-chat-composer-attachments.ts | 46 +- .../native-chat/use-native-chat-draft.ts | 53 +- .../use-structured-agent-session-mutate.ts | 23 +- ...-agent-session-outbox-unconfirmed-probe.ts | 77 +++ ...d-agent-session-outbox-withdrawal.test.tsx | 168 ++++++ .../use-structured-agent-session-outbox.ts | 93 ++- ...use-structured-agent-session-stop.test.tsx | 541 ++++++++++++++++++ ...tructured-agent-session-transport-state.ts | 10 +- .../use-structured-agent-session.ts | 31 +- ...-agent-session-accepted-send-capability.ts | 56 +- ...red-agent-session-host-capability.test.tsx | 53 ++ ...tructured-agent-session-host-capability.ts | 63 ++ .../agent-session-failure-words.test.ts | 17 + src/shared/agent-session-failure-words.ts | 5 + src/shared/agent-session-failure.ts | 3 + src/shared/agent-session-wire.ts | 4 +- src/shared/protocol-version.ts | 6 + .../structured-agent-session-params.ts | 6 +- ...ctured-agent-session-dispatch-rejection.ts | 10 + ...ctured-agent-session-main-agent-working.ts | 14 + ...d-agent-session-operation-identity.test.ts | 39 ++ ...ctured-agent-session-operation-identity.ts | 17 + ...ed-agent-session-outbox-stop-withdrawal.ts | 52 ++ .../structured-agent-session-owed-work.ts | 11 +- ...tured-agent-session-unanswered-dispatch.ts | 7 +- ...ss-version-agent-session-wire.unit.test.ts | 35 ++ 73 files changed, 3758 insertions(+), 266 deletions(-) create mode 100644 src/main/claude/claude-structured-conversation-stop.test.ts create mode 100644 src/main/claude/claude-structured-rate-limit-retry.test.ts create mode 100644 src/main/codex/codex-structured-conversation-stop.test.ts create mode 100644 src/main/codex/codex-structured-turn-open-wait.test.ts create mode 100644 src/main/codex/codex-structured-turn-open-wait.ts create mode 100644 src/main/native-chat/agent-session-wire/structured-agent-session-claude-echo-working.test.ts create mode 100644 src/main/native-chat/agent-session-wire/structured-agent-session-conversation-stop.test.ts create mode 100644 src/main/native-chat/agent-session-wire/structured-agent-session-main-agent-working-agreement.test.ts create mode 100644 src/renderer/src/components/native-chat/structured-agent-session-withdrawn-message-restore.test.tsx create mode 100644 src/renderer/src/components/native-chat/structured-agent-session-withdrawn-message-restore.ts create mode 100644 src/renderer/src/components/native-chat/use-structured-agent-session-outbox-unconfirmed-probe.ts create mode 100644 src/renderer/src/components/native-chat/use-structured-agent-session-outbox-withdrawal.test.tsx create mode 100644 src/renderer/src/components/native-chat/use-structured-agent-session-stop.test.tsx create mode 100644 src/renderer/src/runtime/structured-agent-session-host-capability.test.tsx create mode 100644 src/renderer/src/runtime/structured-agent-session-host-capability.ts create mode 100644 src/shared/structured-agent-session-main-agent-working.ts create mode 100644 src/shared/structured-agent-session-operation-identity.test.ts create mode 100644 src/shared/structured-agent-session-operation-identity.ts create mode 100644 src/shared/structured-agent-session-outbox-stop-withdrawal.ts diff --git a/mobile/src/session/use-mobile-structured-agent-session.ts b/mobile/src/session/use-mobile-structured-agent-session.ts index f04d78cc9a76..2fa5c2b2a96b 100644 --- a/mobile/src/session/use-mobile-structured-agent-session.ts +++ b/mobile/src/session/use-mobile-structured-agent-session.ts @@ -7,7 +7,7 @@ import { import { encodeNativeChatTranscriptIdentity } from '../../../src/shared/native-chat-transcript-retention' import type { MobileNativeChatSendOutcome } from './mobile-native-chat-send' import { projectStructuredAgentSessionMessages } from '../../../src/shared/structured-agent-session-message-projection' -import { hasUnansweredStructuredAgentSessionDispatch } from '../../../src/shared/structured-agent-session-projection' +import { isStructuredAgentSessionMainAgentWorking } from '../../../src/shared/structured-agent-session-main-agent-working' import { activeStructuredAgentSessionTurnId, isStructuredAgentSessionThinking @@ -292,9 +292,7 @@ export function useMobileStructuredAgentSession(args: { loadingEarlier: loadingOlder, loadEarlier }, - isWorking: - turnId !== null || - hasUnansweredStructuredAgentSessionDispatch(state.submissions, state.fence), + isWorking: isStructuredAgentSessionMainAgentWorking(turnId, state.submissions, state.fence), turnId, turnIndicator, ...turnTiming, diff --git a/src/main/claude/claude-structured-conversation-stop.test.ts b/src/main/claude/claude-structured-conversation-stop.test.ts new file mode 100644 index 000000000000..840125853ba1 --- /dev/null +++ b/src/main/claude/claude-structured-conversation-stop.test.ts @@ -0,0 +1,101 @@ +// A Stop that names no turn, against the Claude adapter: the gap between writing a message and +// Claude echoing it back is exactly where no turn id exists yet, and the interrupt must still land. + +import { describe, expect, it } from 'vitest' +import { acquired, fakeClaude, USER_MESSAGE } from './claude-structured-session-test-support' + +function interrupts(claude: ReturnType): number { + return claude.connections[0]!.calls.filter((call) => call.subtype === 'interrupt').length +} + +async function written(claude: ReturnType) { + const adapter = await acquired(claude) + // No replay: the message is written and Claude has not opened its turn. + await expect( + adapter.dispatch({ + sessionId: 'session-1', + clientMessageId: 'client-1', + body: USER_MESSAGE, + fence: 7 + }) + ).resolves.toEqual({ state: 'admitted' }) + return adapter +} + +describe('Claude Stop that names no turn', () => { + it('interrupts a written message before its turn opens', async () => { + const claude = fakeClaude({ replayUuid: null }) + const adapter = await written(claude) + + await expect(adapter.cancelTurn({ sessionId: 'session-1', fence: 7 })).resolves.toEqual({ + cancelled: true + }) + expect(interrupts(claude)).toBe(1) + }) + + it('still refuses the placeholder a client used to name for that gap', async () => { + const claude = fakeClaude({ replayUuid: null }) + const adapter = await written(claude) + + await expect( + adapter.cancelTurn({ sessionId: 'session-1', turnId: 'turn-none', fence: 7 }) + ).resolves.toEqual({ cancelled: false }) + expect(interrupts(claude)).toBe(0) + }) + + it('interrupts a turn Claude opened on its own echo', async () => { + const claude = fakeClaude({ replayUuid: 'turn-T' }) + const adapter = await written(claude) + + await expect(adapter.cancelTurn({ sessionId: 'session-1', fence: 7 })).resolves.toEqual({ + cancelled: true + }) + expect(interrupts(claude)).toBe(1) + }) + + it('does nothing for another fence, or with nothing in flight', async () => { + const claude = fakeClaude({ replayUuid: null }) + const adapter = await acquired(claude) + + await expect(adapter.cancelTurn({ sessionId: 'session-1', fence: 7 })).resolves.toEqual({ + cancelled: false + }) + await adapter.dispatch({ + sessionId: 'session-1', + clientMessageId: 'client-1', + body: USER_MESSAGE, + fence: 7 + }) + await expect(adapter.cancelTurn({ sessionId: 'session-1', fence: 6 })).resolves.toEqual({ + cancelled: false + }) + expect(interrupts(claude)).toBe(0) + }) + + it('ends a turn that opens while the interrupt is on its way once, and the next send lands', async () => { + const claude = fakeClaude({ replayUuid: null }) + const adapter = await written(claude) + const connection = claude.connections[0]! + // The echo that opens the turn arrives after Orca wrote the interrupt, before Claude answers it. + claude.routes.interrupt = () => { + connection.handlers.onMessage?.({ ...connection.sent[0]!, uuid: 'turn-late' }) + return undefined + } + + await expect(adapter.cancelTurn({ sessionId: 'session-1', fence: 7 })).resolves.toEqual({ + cancelled: true + }) + expect(interrupts(claude)).toBe(1) + + delete claude.routes.interrupt + await expect( + adapter.dispatch({ + sessionId: 'session-1', + clientMessageId: 'client-2', + body: USER_MESSAGE, + fence: 7 + }) + ).resolves.toEqual({ state: 'admitted' }) + expect(connection.sent).toHaveLength(2) + }) +}) diff --git a/src/main/claude/claude-structured-prompt-ownership.ts b/src/main/claude/claude-structured-prompt-ownership.ts index e1c1aa371bf8..01af8ec9fc0b 100644 --- a/src/main/claude/claude-structured-prompt-ownership.ts +++ b/src/main/claude/claude-structured-prompt-ownership.ts @@ -90,6 +90,29 @@ function waitForClaudeDispatchAdmission( }) } +/** + * A Stop that names no turn: the conversation asked to stop whatever this child has in flight. + * Claude's interrupt is session-scoped, so there is no turn identity to check — only that this is + * still the child the host judged, and that it has a turn open or a written message whose turn has + * not opened yet (the gap before its echo, which no client can name). + */ +function cancelClaudeConversation( + session: ClaudeSession, + sessions: Map, + request: CancelInput, + timeoutMs: number | undefined, + onDispatchSettledLate: ClaudeLateDispatchSettlement | undefined +): Promise<{ cancelled: boolean }> { + const acquisitionGeneration = session.acquisitionGeneration + const isCurrent = (): boolean => + sessions.get(request.sessionId) === session && + session.fence === request.fence && + session.acquisitionGeneration === acquisitionGeneration && + ((request.resolveLiveTurnId?.() ?? session.translator?.currentTurnId ?? null) !== null || + session.dispatchWaiters.length > 0) + return cancelClaudeTurn(session, timeoutMs, isCurrent, onDispatchSettledLate) +} + export async function cancelClaudeStructuredTurn(input: { request: CancelInput sessions: Map @@ -106,10 +129,16 @@ export async function cancelClaudeStructuredTurn(input: { if (!prompt && session.startup.state === 'pending') { return { cancelled: false } } + const requestedTurnId = request.turnId + if (requestedTurnId === undefined) { + return prompt + ? { cancelled: false } + : cancelClaudeConversation(session, sessions, request, timeoutMs, input.onDispatchSettledLate) + } if (prompt && session.fence !== request.fence) { return { cancelled: false } } - const claim = prompt ? session.prompts.claimBound(prompt.itemId, request.turnId) : null + const claim = prompt ? session.prompts.claimBound(prompt.itemId, requestedTurnId) : null if (prompt && !claim) { return { cancelled: false } } @@ -125,7 +154,7 @@ export async function cancelClaudeStructuredTurn(input: { // means nothing has published an identity this request can contradict. const ownsRequestedTurn = (): boolean => { const liveTurnId = request.resolveLiveTurnId?.() ?? session.translator?.currentTurnId ?? null - return liveTurnId === null ? session.dispatchSequence === 0 : liveTurnId === request.turnId + return liveTurnId === null ? session.dispatchSequence === 0 : liveTurnId === requestedTurnId } // The host supplies the durable latest submission; direct adapter callers fall back to // the current in-memory waiter so an unknown dispatch remains fenced without a latch. @@ -143,7 +172,7 @@ export async function cancelClaudeStructuredTurn(input: { const dispatchAdmissionAllowsCancellation = (): boolean => dispatchAdmissionIsCurrent() || (Boolean(prompt) && supportsClaudeQueuedInterruptCancellation(session)) - const compactionOwnsTurn = (): boolean => compactions.ownsTurn(request.sessionId, request.turnId) + const compactionOwnsTurn = (): boolean => compactions.ownsTurn(request.sessionId, requestedTurnId) const currentDispatchHasRetiredWaiter = (): boolean => session.retiredDispatchWaiters.some( (waiter) => waiter.dispatchSequence === session.dispatchSequence @@ -165,7 +194,7 @@ export async function cancelClaudeStructuredTurn(input: { session.acquisitionGeneration === acquisitionGeneration && (claim && prompt ? ownsRequestedTurn() && - session.prompts.ownsBoundClaim(claim, prompt.itemId, request.turnId) && + session.prompts.ownsBoundClaim(claim, prompt.itemId, requestedTurnId) && (dispatchAdmissionAllowsCancellation() || dispatchAdmissionExpired) : compactionOwnsTurn() || (ownsRequestedTurn() && diff --git a/src/main/claude/claude-structured-rate-limit-retry.test.ts b/src/main/claude/claude-structured-rate-limit-retry.test.ts new file mode 100644 index 000000000000..d7b0d5277fcd --- /dev/null +++ b/src/main/claude/claude-structured-rate-limit-retry.test.ts @@ -0,0 +1,50 @@ +// Claude retrying a rate-limited request: the frames below follow Claude Code 2.1.280 against an +// HTTP 429 stub, captured with `--replay-user-messages --include-partial-messages`. The CLI writes +// only `api_retry` frames, and echoes the message only once a request gets through or is +// interrupted, so no turn opens: the send itself is all that says the session is working. + +import { describe, expect, it, vi } from 'vitest' +import type { + AgentJournalItemBody, + AgentJournalItemIdentity +} from '../../shared/agent-session-journal-types' +import { readAgentJournalTurn } from '../../shared/agent-session-turn-record' +import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' +import { createClaudeJournalTranslator } from './claude-structured-journal-translation' + +function apiRetry(attempt: number, observedAt: number) { + return { + type: 'message' as const, + sessionId: 'orca-session', + observedAt, + message: { + type: 'system', + subtype: 'api_retry', + attempt, + max_retries: 10, + retry_delay_ms: 1_000 * 2 ** (attempt - 1), + error_status: 429, + error: 'rate_limit', + uuid: `retry-${attempt}`, + session_id: 'claude-session' + } + } +} + +describe('Claude retrying a rate-limited request', () => { + it('opens no turn while it retries', () => { + const appended: { identity: AgentJournalItemIdentity; body: AgentJournalItemBody }[] = [] + const sink: StructuredAgentSessionEventSink = { + appendItem: (identity, body) => appended.push({ identity, body }), + appendTombstone: vi.fn(), + publish: vi.fn() + } + const translator = createClaudeJournalTranslator({ sink }) + + for (let attempt = 1; attempt <= 6; attempt += 1) { + translator.handle(apiRetry(attempt, 1_000 * attempt)) + } + + expect(appended.filter(({ body }) => readAgentJournalTurn(body) !== null)).toEqual([]) + }) +}) diff --git a/src/main/claude/claude-structured-real-cli.test.ts b/src/main/claude/claude-structured-real-cli.test.ts index 20670147ca0d..73bec7986c84 100644 --- a/src/main/claude/claude-structured-real-cli.test.ts +++ b/src/main/claude/claude-structured-real-cli.test.ts @@ -279,6 +279,80 @@ describe.skipIf(!realClaudeAvailable)('Claude structured real CLI handshake', () 90_000 ) + // The window a Stop naming no turn exists for: Orca has written the message, and Claude has not + // started its reply, so no turn id exists. Only the live binary can say the interrupt lands there. + it.skipIf(!realClaudeAuthenticated)( + 'stops a message interrupted before its reply starts, and takes the next one', + async () => { + const providerSessionId = randomUUID() + const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR?.trim() || join(homedir(), '.claude') + const events: ClaudeStructuredSessionEvent[] = [] + const adapter = realAdapter(providerSessionId, claudeConfigDir, events) + const frames = (from: number) => + events.slice(from).flatMap((event) => (event.type === 'message' ? [event.message] : [])) + const replyStarted = (from: number) => + frames(from).some( + (frame) => + frame.type === 'stream_event' && + typeof frame.event === 'object' && + frame.event !== null && + 'type' in frame.event && + frame.event.type === 'message_start' + ) + const result = async (from: number) => { + const deadline = Date.now() + 60_000 + for (;;) { + const found = frames(from).find((frame) => frame.type === 'result') + if (found || Date.now() >= deadline) { + return found + } + await new Promise((resolve) => setTimeout(resolve, 100)) + } + } + const send = (clientMessageId: string, text: string) => + adapter.dispatch({ + sessionId: 'real-cli-handshake', + clientMessageId, + body: { kind: 'message', role: 'user', blocks: [{ type: 'text', text }] }, + fence: 1 + }) + + try { + await adapter.acquire({ + identity: identity(providerSessionId), + fence: 1, + spawnToken: 'real-cli-stop' + }) + const first = events.length + await expect( + send('real-cli-stop-1', 'Count from 1 to 300, one number per line, and nothing else.') + ).resolves.toEqual({ state: 'admitted' }) + const startedBeforeStop = replyStarted(first) + + await expect( + adapter.cancelTurn({ sessionId: 'real-cli-handshake', fence: 1 }) + ).resolves.toEqual({ + cancelled: true + }) + const stopped = await result(first) + + expect(startedBeforeStop).toBe(false) + // Claude 2.1.280 echoes the message, then ends that turn as interrupted without replying. + expect(stopped).toMatchObject({ subtype: 'error_during_execution' }) + expect(replyStarted(first)).toBe(false) + + const second = events.length + await expect(send('real-cli-stop-2', 'Reply with the single word ok.')).resolves.toEqual({ + state: 'admitted' + }) + await expect(result(second)).resolves.toMatchObject({ subtype: 'success' }) + } finally { + await adapter.closeAll() + } + }, + 150_000 + ) + // Orca installs a SessionStart hook, so its frame proves most real starts before the turn's // system/init, the only frame that says this CLI can cancel what it queued. it.skipIf(!realClaudeAuthenticated)( diff --git a/src/main/claude/claude-structured-session-acquisition.ts b/src/main/claude/claude-structured-session-acquisition.ts index b5a7a5d30616..cd8836e4b826 100644 --- a/src/main/claude/claude-structured-session-acquisition.ts +++ b/src/main/claude/claude-structured-session-acquisition.ts @@ -118,9 +118,12 @@ export async function acquireClaudeSession({ persistClaudeTurnResumePoint(sessionId, liveSession, deps) } } + // Settled after the turn this echo opens is emitted: a send read as answered before its turn + // lands reads as nothing running, and Stop and Working blink off in between. + const settlements: (() => void)[] = [] const turnOrigin = liveSession ? resolveClaudeReplayTurn(liveSession, message, (settlement) => - deps.onDispatchSettledLate?.({ sessionId, ...settlement }) + settlements.push(() => deps.onDispatchSettledLate?.({ sessionId, ...settlement })) ) : null const startsTurn = turnOrigin !== null @@ -138,6 +141,9 @@ export async function acquireClaudeSession({ ...observedAt }) ) + for (const settle of settlements) { + settle() + } } const { canUseTool, onUserDialog } = buildClaudePermissionCallbacks({ sessionId, diff --git a/src/main/codex/codex-requested-close-turn-timing.test.ts b/src/main/codex/codex-requested-close-turn-timing.test.ts index fbf50badaef4..a7baf6a14b59 100644 --- a/src/main/codex/codex-requested-close-turn-timing.test.ts +++ b/src/main/codex/codex-requested-close-turn-timing.test.ts @@ -1,4 +1,5 @@ import { createCodexDispatchEchoes } from './codex-structured-dispatch-echo' +import { createCodexTurnOpenWaits } from './codex-structured-turn-open-wait' import { afterEach, describe, expect, it, vi } from 'vitest' import type { AgentJournalItemBody } from '../../shared/agent-session-journal-types' import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' @@ -72,6 +73,7 @@ describe('requested-close durable turn timing', () => { reportedOptions: {}, fastModeTierByModel: new Map(), dispatchEchoes: createCodexDispatchEchoes(), + turnOpenWaits: createCodexTurnOpenWaits(), translator } const sessions = new Map([['session-1', session]]) diff --git a/src/main/codex/codex-structured-conversation-stop.test.ts b/src/main/codex/codex-structured-conversation-stop.test.ts new file mode 100644 index 000000000000..1842afada724 --- /dev/null +++ b/src/main/codex/codex-structured-conversation-stop.test.ts @@ -0,0 +1,94 @@ +// A Codex Stop that names no turn. The fake keeps Codex 0.157's turn bookkeeping: it answers +// `turn/start` before it opens the turn, and refuses an interrupt until then. + +import { describe, expect, it, vi } from 'vitest' +import { + CODEX_TEST_THREAD_ID, + codexTurnLifecycleRig +} from './codex-structured-dispatch-test-support' + +type Rig = Awaited> + +async function openedTurn(rig: Rig): Promise { + const sending = rig.send('client-1') + await vi.waitFor(() => expect(rig.turns.turnId).toBe('turn-1')) + rig.turns.start() + await sending +} + +const stop = (rig: Rig, resolveLiveTurnId?: () => string | null) => + rig.adapter.cancelTurn({ + sessionId: 'session-1', + fence: 7, + ...(resolveLiveTurnId ? { resolveLiveTurnId } : {}) + }) + +describe('a Codex Stop that names no turn', () => { + it('interrupts the turn Codex opened when the journal shows none yet', async () => { + const rig = await codexTurnLifecycleRig() + await openedTurn(rig) + + await expect(stop(rig, () => null)).resolves.toEqual({ cancelled: true }) + expect(rig.interrupts().map((call) => call.params?.turnId)).toEqual(['turn-1']) + }) + + it('interrupts no turn that already ended', async () => { + const rig = await codexTurnLifecycleRig() + await openedTurn(rig) + rig.turns.end('completed') + + await expect(stop(rig)).resolves.toEqual({ cancelled: false }) + expect(rig.interrupts()).toEqual([]) + }) + + it("names the journal's turn over the one it saw open, and carries Codex's refusal", async () => { + const rig = await codexTurnLifecycleRig() + await openedTurn(rig) + + await expect(stop(rig, () => 'turn-journal')).resolves.toEqual({ + cancelled: false, + refusal: { + detail: { + text: 'expected active turn id turn-journal but found turn-1', + audience: 'person' + } + } + }) + expect(rig.interrupts().map((call) => call.params?.turnId)).toEqual(['turn-journal']) + }) + + it('interrupts nothing for another fence', async () => { + const rig = await codexTurnLifecycleRig() + await openedTurn(rig) + + await expect(rig.adapter.cancelTurn({ sessionId: 'session-1', fence: 6 })).resolves.toEqual({ + cancelled: false + }) + expect(rig.interrupts()).toEqual([]) + }) + + it('interrupts no earlier turn while a compaction the journal shows has not started', async () => { + const rig = await codexTurnLifecycleRig() + await openedTurn(rig) + rig.turns.end('completed') + const compaction = rig.adapter.compact({ + turnId: 'compact:operation-1', + sessionId: 'session-1', + fence: 7 + }) + await vi.waitFor(() => + expect(rig.codex.connections[0]!.calls.at(-1)?.method).toBe('thread/compact/start') + ) + + await expect(stop(rig, () => 'compact:operation-1')).resolves.toEqual({ cancelled: false }) + expect(rig.interrupts()).toEqual([]) + + rig.notify('turn/started', { threadId: CODEX_TEST_THREAD_ID, turn: { id: 'turn-compact' } }) + rig.notify('thread/compacted', { threadId: CODEX_TEST_THREAD_ID }) + rig.notify('turn/completed', { + threadId: CODEX_TEST_THREAD_ID, + turn: { id: 'turn-compact', status: 'completed' } + }) + await expect(compaction).resolves.toEqual({ outcome: 'compacted' }) + }) +}) diff --git a/src/main/codex/codex-structured-dispatch-admission.test.ts b/src/main/codex/codex-structured-dispatch-admission.test.ts index b8ea81d592c7..b3c8a3fefeb7 100644 --- a/src/main/codex/codex-structured-dispatch-admission.test.ts +++ b/src/main/codex/codex-structured-dispatch-admission.test.ts @@ -7,6 +7,7 @@ import { acquiredCodexAdapter, echoUserMessage, fakeCodexAppServer, + openAfterTurnStarts, startTurn, CODEX_TEST_THREAD_ID, CODEX_TEST_USER_MESSAGE, @@ -215,8 +216,9 @@ describe('codex dispatch admission', () => { await expect(send(adapter, 'client-unknown', 1_700_000_000_100)).rejects.toThrow( 'request timed out after write' ) - await send(adapter, 'client-later', 1_700_000_000_400) - startTurn(connection, 'turn-later') + const later = send(adapter, 'client-later', 1_700_000_000_400) + await openAfterTurnStarts(connection, 2, () => startTurn(connection, 'turn-later')) + await later echoUserMessage(connection, { turnId: 'turn-later', itemId: 'item-later', @@ -279,9 +281,10 @@ describe('codex dispatch admission', () => { const adapter = await acquiredCodexAdapter({ codex, settlements, sink: recorded.sink }) const connection = codex.connections[0]! - await send(adapter, 'client-opening', 1_700_000_000_600) - await send(adapter, 'client-queued', 1_700_000_000_200) - startTurn(connection, 'turn-1') + const opening = send(adapter, 'client-opening', 1_700_000_000_600) + const queued = send(adapter, 'client-queued', 1_700_000_000_200) + await openAfterTurnStarts(connection, 2, () => startTurn(connection, 'turn-1')) + await Promise.all([opening, queued]) await send(adapter, 'client-mid-turn', 1_700_000_000_100) echoUserMessage(connection, { @@ -325,8 +328,9 @@ describe('codex dispatch admission', () => { const adapter = await acquiredCodexAdapter({ codex, settlements, sink: recorded.sink }) const connection = codex.connections[0]! - await send(adapter, 'client-late-echo', 1_700_000_000_100) - startTurn(connection, 'turn-1') + const sending = send(adapter, 'client-late-echo', 1_700_000_000_100) + await openAfterTurnStarts(connection, 1, () => startTurn(connection, 'turn-1')) + await sending connection.handlers.onNotification?.('turn/completed', { threadId: CODEX_TEST_THREAD_ID, turn: { id: 'turn-1' } diff --git a/src/main/codex/codex-structured-dispatch-echo.test.ts b/src/main/codex/codex-structured-dispatch-echo.test.ts index 94826c1df12f..a6791e5e788d 100644 --- a/src/main/codex/codex-structured-dispatch-echo.test.ts +++ b/src/main/codex/codex-structured-dispatch-echo.test.ts @@ -126,3 +126,44 @@ describe('readCodexDispatchEcho', () => { ).toBeNull() }) }) + +describe('the turn Codex answered a send into but has not opened', () => { + const NONE_OPEN = new Set() + + it('is the turn the latest armed send was answered into', () => { + const echoes = createCodexDispatchEchoes() + echoes.arm('client-1') + echoes.bindTurn('client-1', 'thread-1', 'turn-1') + echoes.arm('client-2') + echoes.bindTurn('client-2', 'thread-1', 'turn-2') + + expect(echoes.answeredUnopenedTurn('thread-1', NONE_OPEN)).toBe('turn-2') + }) + + it('is none once Codex opened that turn', () => { + const echoes = createCodexDispatchEchoes() + echoes.arm('client-1') + echoes.bindTurn('client-1', 'thread-1', 'turn-1') + + expect(echoes.answeredUnopenedTurn('thread-1', new Set(['turn-1']))).toBeNull() + }) + + it('is none once that turn ended, even with its send still armed for an echo', () => { + const echoes = createCodexDispatchEchoes() + echoes.arm('client-1') + echoes.bindTurn('client-1', 'thread-1', 'turn-1') + // A completed end leaves its unechoed send armed. + expect(echoes.endTurn('thread-1', 'turn-1', { status: 'completed' })).toEqual([]) + + expect(echoes.answeredUnopenedTurn('thread-1', NONE_OPEN)).toBeNull() + }) + + it('is none for a send not yet answered, or answered on another thread', () => { + const echoes = createCodexDispatchEchoes() + echoes.arm('client-1') + echoes.arm('client-2') + echoes.bindTurn('client-2', 'thread-2', 'turn-2') + + expect(echoes.answeredUnopenedTurn('thread-1', NONE_OPEN)).toBeNull() + }) +}) diff --git a/src/main/codex/codex-structured-dispatch-echo.ts b/src/main/codex/codex-structured-dispatch-echo.ts index c1a020b2c1f8..0d3794b5136b 100644 --- a/src/main/codex/codex-structured-dispatch-echo.ts +++ b/src/main/codex/codex-structured-dispatch-echo.ts @@ -38,6 +38,9 @@ export type CodexDispatchEchoes = { * read after it; a send that end settles is no longer armed. */ bindTurn: (clientMessageId: string, threadId: string, turnId: string) => CodexTurnEnd | null + /** The turn the latest armed send was answered into that is neither in `openTurnIds` nor ended: + * one Codex has picked for the send but not opened. */ + answeredUnopenedTurn: (threadId: string, openTurnIds: ReadonlySet) => string | null /** * Records a turn's end and returns the sends bound to it that it settles: all of them unless it * completed, which echoes its pending input first, so one it never echoed waits for recovery. @@ -52,7 +55,10 @@ export type CodexDispatchEchoes = { } export function createCodexDispatchEchoes(): CodexDispatchEchoes { - const armed = new Map() + const armed = new Map< + string, + { requestedAt: number | null; sequence: number; turn?: { threadId: string; turnId: string } } + >() const endedTurns = new Map() let nextSequence = 0 const turnKey = (threadId: string, turnId: string): string => JSON.stringify([threadId, turnId]) @@ -79,14 +85,23 @@ export function createCodexDispatchEchoes(): CodexDispatchEchoes { if (!entry) { return null } - const turn = turnKey(threadId, turnId) - entry.turn = turn - const end = endedTurns.get(turn) ?? null + entry.turn = { threadId, turnId } + const end = endedTurns.get(turnKey(threadId, turnId)) ?? null if (end && settles(end)) { armed.delete(clientMessageId) } return end }, + answeredUnopenedTurn: (threadId, openTurnIds) => { + const answered = [...armed.values()].flatMap(({ turn }) => + turn?.threadId === threadId && + !openTurnIds.has(turn.turnId) && + !endedTurns.has(turnKey(threadId, turn.turnId)) + ? [turn.turnId] + : [] + ) + return answered.at(-1) ?? null + }, endTurn: (threadId, turnId, end) => { const turn = turnKey(threadId, turnId) endedTurns.delete(turn) @@ -101,7 +116,9 @@ export function createCodexDispatchEchoes(): CodexDispatchEchoes { return [] } const settled = [...armed].flatMap(([clientMessageId, entry]) => - entry.turn === turn ? [clientMessageId] : [] + entry.turn && turnKey(entry.turn.threadId, entry.turn.turnId) === turn + ? [clientMessageId] + : [] ) for (const clientMessageId of settled) { armed.delete(clientMessageId) diff --git a/src/main/codex/codex-structured-dispatch-test-support.ts b/src/main/codex/codex-structured-dispatch-test-support.ts index 566922d74221..86f19349ee25 100644 --- a/src/main/codex/codex-structured-dispatch-test-support.ts +++ b/src/main/codex/codex-structured-dispatch-test-support.ts @@ -1,3 +1,4 @@ +import { expect, vi } from 'vitest' import type { AgentJournalMessageItem, AgentSessionJournalIdentity @@ -10,6 +11,7 @@ import type { } from './codex-app-server-connection' import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' import { CodexStructuredSessionAdapter } from './codex-structured-session-adapter' +import { codexTurnLifecycleFake } from './codex-turn-lifecycle-fake' import type { CodexStructuredSessionAdapterDeps } from './codex-structured-session-state' export const CODEX_TEST_THREAD_ID = 'thread-abc' @@ -83,6 +85,7 @@ export async function acquiredCodexAdapter(input: { settlements: LateSettlement[] sink?: StructuredAgentSessionEventSink captureTurnProcesses?: CodexStructuredSessionAdapterDeps['captureTurnProcesses'] + requestTimeoutMs?: number }): Promise { const adapter = new CodexStructuredSessionAdapter({ resolveLaunch: async () => ({ @@ -95,8 +98,11 @@ export async function acquiredCodexAdapter(input: { openConnection: input.codex.openConnection, readProcessStartTime: async () => 1_700_000_000_000, captureTurnProcesses: input.captureTurnProcesses ?? (async () => null), + // A Stop must never reach for real processes on this machine under the fake pid. + terminateTurnProcesses: async () => true, now: () => 1_700_000_000_500, - onDispatchSettledLate: (settlement) => input.settlements.push(settlement) + onDispatchSettledLate: (settlement) => input.settlements.push(settlement), + ...(input.requestTimeoutMs === undefined ? {} : { requestTimeoutMs: input.requestTimeoutMs }) }) const identity: AgentSessionJournalIdentity = { sessionId: 'session-1', @@ -130,9 +136,50 @@ export function echoUserMessage( }) } -export function startTurn(connection: FakeConnection, turnId: string): void { +export function startTurn(connection: Pick, turnId: string): void { connection.handlers.onNotification?.('turn/started', { threadId: CODEX_TEST_THREAD_ID, turn: { id: turnId } }) } + +/** Runs `open` once `count` sends reached Codex, which opens a turn only after it answers. */ +export async function openAfterTurnStarts( + connection: Pick, + count: number, + open: () => void +): Promise { + await vi.waitFor(() => + expect(connection.calls.filter((call) => call.method === 'turn/start')).toHaveLength(count) + ) + open() +} + +/** An acquired adapter over a fake Codex that keeps Codex's own turn bookkeeping. */ +export async function codexTurnLifecycleRig(options: { requestTimeoutMs?: number } = {}) { + const codex = fakeCodexAppServer() + const notify = (method: string, params: unknown): void => + codex.connections.at(-1)?.handlers.onNotification?.(method, params) + const turns = codexTurnLifecycleFake(CODEX_TEST_THREAD_ID, () => notify) + Object.assign(codex.routes, turns.routes) + const settlements: LateSettlement[] = [] + const adapter = await acquiredCodexAdapter({ codex, settlements, ...options }) + const send = (clientMessageId: string) => + adapter.dispatch({ + sessionId: 'session-1', + clientMessageId, + body: CODEX_TEST_USER_MESSAGE, + fence: 7 + }) + const interrupts = () => + codex.connections[0]!.calls.filter((call) => call.method === 'turn/interrupt') + return { codex, turns, adapter, send, settlements, notify, interrupts } +} + +/** The promise's value, or `held` when it has not settled `withinMs` after every earlier task. */ +export function settledWithin(promise: Promise, withinMs = 50): Promise { + return Promise.race([ + promise, + new Promise<'held'>((resolve) => setTimeout(() => resolve('held'), withinMs)) + ]) +} diff --git a/src/main/codex/codex-structured-fast-mode.test.ts b/src/main/codex/codex-structured-fast-mode.test.ts index 3029bff280b4..73f279bd2c0f 100644 --- a/src/main/codex/codex-structured-fast-mode.test.ts +++ b/src/main/codex/codex-structured-fast-mode.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it, vi } from 'vitest' import { USER_MESSAGE, adapterFor, + answerWithOpenedTurn, fakeCodex, identityFor, type Route @@ -19,9 +20,9 @@ describe('Codex structured Fast mode dispatch', () => { } ], nextCursor: null - }), - 'turn/start': () => ({ turn: { id: 'turn-fast' } }) + }) }) + codex.routes['turn/start'] = answerWithOpenedTurn(codex, 'turn-fast') const adapter = adapterFor(codex) await adapter.acquire({ identity: identityFor('session-1'), @@ -43,7 +44,8 @@ describe('Codex structured Fast mode dispatch', () => { }) it('uses Standard on the first turn after acquisition with Fast explicitly off', async () => { - const codex = fakeCodex({ 'turn/start': () => ({ turn: { id: 'turn-standard' } }) }) + const codex = fakeCodex() + codex.routes['turn/start'] = answerWithOpenedTurn(codex, 'turn-standard') const adapter = adapterFor(codex) await adapter.acquire({ identity: identityFor('session-1'), @@ -91,10 +93,8 @@ describe('Codex structured Fast mode dispatch', () => { ], nextCursor: null })) - const codex = fakeCodex({ - 'model/list': listModels, - 'turn/start': () => ({ turn: { id: 'turn-recovered' } }) - }) + const codex = fakeCodex({ 'model/list': listModels }) + codex.routes['turn/start'] = answerWithOpenedTurn(codex, 'turn-recovered') const adapter = adapterFor(codex) await expect( adapter.acquire({ diff --git a/src/main/codex/codex-structured-prompt-ownership.test.ts b/src/main/codex/codex-structured-prompt-ownership.test.ts index ecdc4c9a4be0..7dd048dd08af 100644 --- a/src/main/codex/codex-structured-prompt-ownership.test.ts +++ b/src/main/codex/codex-structured-prompt-ownership.test.ts @@ -261,7 +261,7 @@ describe('Codex live prompt ownership', () => { fence: 7, prompt: { itemId: 'journal-prompt' } }) - ).resolves.toEqual({ cancelled: false }) + ).resolves.toEqual({ cancelled: false, refusal: {} }) await adapter.answerPrompt({ sessionId: 'session-1', itemId: 'journal-prompt', diff --git a/src/main/codex/codex-structured-prompt-ownership.ts b/src/main/codex/codex-structured-prompt-ownership.ts index d58f08e731d2..1742d5ced697 100644 --- a/src/main/codex/codex-structured-prompt-ownership.ts +++ b/src/main/codex/codex-structured-prompt-ownership.ts @@ -1,6 +1,7 @@ import { AgentSessionPromptAnswerRejectedError, AgentSessionPromptUnavailableError, + type AgentSessionCancelOutcome, type StructuredAgentSessionAdapter } from '../native-chat/agent-session-wire/structured-agent-session-adapter' import type { StructuredSessionCompaction } from '../native-chat/agent-session-wire/structured-session-compaction' @@ -16,19 +17,72 @@ import type { CodexStructuredTurnCancellation } from './codex-structured-turn-ca type CancelInput = Parameters[0] type AnswerInput = Parameters[0] +/** How long a Stop waits for Codex to open the turn it answered a send into. Under the quit + * path's eviction budget, which a close or quit queued behind the Stop spends. */ +export const CODEX_STOP_TURN_OPEN_WAIT_MS = 5_000 + +/** + * A Stop that names no turn: interrupt the turn the journal shows, or else the one Codex reported + * started and not yet ended, which the journal can trail by a publish, or else the one Codex + * answered a send into, once it opens. + */ +async function cancelCodexConversation( + input: Parameters[0], + session: CodexSession +): Promise { + const { request, sessions, compactions, cancellation } = input + const liveTurnId = request.resolveLiveTurnId?.() ?? null + // A turn the journal shows that Codex has not started yet (a compaction's) has nothing to stop. + const turnId = + liveTurnId === null + ? ([...(session.activeTurnIds ?? [])].at(-1) ?? (await openedAnsweredTurn(session))) + : compactions.providerTurnId(request.sessionId, liveTurnId) + if (!turnId) { + return { cancelled: false } + } + const acquisitionGeneration = session.acquisitionGeneration + return cancellation.cancel( + session, + session.threadId, + turnId, + () => + sessions.get(request.sessionId) === session && + !session.ended && + session.fence === request.fence && + session.acquisitionGeneration === acquisitionGeneration + ) +} + +/** The turn Codex answered a send into and has not opened yet, once it opens; null when it ends, + * the thread stops running or the child exits first, or the wait runs out. */ +async function openedAnsweredTurn(session: CodexSession): Promise { + const openTurnIds = session.activeTurnIds ?? new Set() + const answered = session.dispatchEchoes.answeredUnopenedTurn(session.threadId, openTurnIds) + if (!answered) { + return null + } + // Codex refuses an interrupt before it opens the turn. + await session.turnOpenWaits.wait(answered, CODEX_STOP_TURN_OPEN_WAIT_MS) + return session.activeTurnIds?.has(answered) ? answered : null +} + export async function cancelCodexStructuredTurn(input: { request: CancelInput sessions: Map compactions: StructuredSessionCompaction cancellation: CodexStructuredTurnCancellation -}): Promise<{ cancelled: boolean }> { +}): Promise { const { request, sessions, compactions, cancellation } = input const session = requireLiveCodexSession(sessions, request.sessionId) - const turnId = compactions.providerTurnId(request.sessionId, request.turnId) + const prompt = request.prompt + const requestedTurnId = request.turnId + if (requestedTurnId === undefined) { + return prompt ? { cancelled: false } : cancelCodexConversation(input, session) + } + const turnId = compactions.providerTurnId(request.sessionId, requestedTurnId) if (!turnId) { return { cancelled: false } } - const prompt = request.prompt if (!prompt) { return cancellation.cancel(session, session.threadId, turnId) } @@ -49,7 +103,7 @@ export async function cancelCodexStructuredTurn(input: { !session.ended && session.fence === request.fence && session.acquisitionGeneration === acquisitionGeneration && - compactions.providerTurnId(request.sessionId, request.turnId) === turnId && + compactions.providerTurnId(request.sessionId, requestedTurnId) === turnId && session.prompts.ownsBoundClaim(claim, prompt.itemId, claim.prompt.threadId, promptTurnId) let interruptConfirmed = false try { diff --git a/src/main/codex/codex-structured-provider-events.ts b/src/main/codex/codex-structured-provider-events.ts index 06563cad748d..5dc608fbb59b 100644 --- a/src/main/codex/codex-structured-provider-events.ts +++ b/src/main/codex/codex-structured-provider-events.ts @@ -24,6 +24,7 @@ export function translateCodexNotification(input: { }): CodexJournalTranslationAdmission { const { sessionId, session, method, params, observedAt, dispatchSequenceAtReceipt } = input codexRewind.observeCodexRewindActivity(session, method, params) + session.turnOpenWaits.observe(session.threadId, method, params) if (input.turnCancellation.handleNotification(sessionId, session, method, params, observedAt)) { return { accepted: true } } diff --git a/src/main/codex/codex-structured-session-adapter-fixture.ts b/src/main/codex/codex-structured-session-adapter-fixture.ts index 3f2d32ee2eba..27e6eadb6c57 100644 --- a/src/main/codex/codex-structured-session-adapter-fixture.ts +++ b/src/main/codex/codex-structured-session-adapter-fixture.ts @@ -89,6 +89,19 @@ export function fakeCodex(routes: Record = {}): { return { connections, openConnection, routes } } +/** A `turn/start` route for a Codex that opened the turn before its answer was read. */ +export function answerWithOpenedTurn( + codex: Pick, 'connections'>, + turnId: string +): Route { + return () => { + codex.connections + .at(-1) + ?.handlers.onNotification?.('turn/started', { threadId: THREAD_ID, turn: { id: turnId } }) + return { turn: { id: turnId } } + } +} + export function adapterFor( codex: ReturnType, launch: Partial = {}, diff --git a/src/main/codex/codex-structured-session-adapter.test.ts b/src/main/codex/codex-structured-session-adapter.test.ts index 2fa337b60011..70b2ecd7147a 100644 --- a/src/main/codex/codex-structured-session-adapter.test.ts +++ b/src/main/codex/codex-structured-session-adapter.test.ts @@ -16,6 +16,7 @@ import { USER_MESSAGE, acquired, adapterFor, + answerWithOpenedTurn, fakeCodex, identityFor } from './codex-structured-session-adapter-fixture' @@ -371,7 +372,8 @@ describe('CodexStructuredSessionAdapter.acquire', () => { describe('CodexStructuredSessionAdapter.dispatch', () => { it('admits a send as soon as Codex owns it', async () => { - const codex = fakeCodex({ 'turn/start': () => ({ turn: { id: 'turn-1' } }) }) + const codex = fakeCodex() + codex.routes['turn/start'] = answerWithOpenedTurn(codex, 'turn-1') const adapter = await acquired(codex) const outcome = await adapter.dispatch({ @@ -512,9 +514,9 @@ describe('CodexStructuredSessionAdapter.dispatch', () => { } ], nextCursor: null - }), - 'turn/start': () => ({ turn: { id: 'turn-1' } }) + }) }) + codex.routes['turn/start'] = answerWithOpenedTurn(codex, 'turn-1') const adapter = await acquired(codex) await adapter.setOption({ sessionId: 'session-1', key: 'model', value: 'gpt-5', fence: 7 }) diff --git a/src/main/codex/codex-structured-session-cancel.test.ts b/src/main/codex/codex-structured-session-cancel.test.ts index 1ac807a5ccd9..2d6c50adae46 100644 --- a/src/main/codex/codex-structured-session-cancel.test.ts +++ b/src/main/codex/codex-structured-session-cancel.test.ts @@ -142,14 +142,14 @@ describe('CodexStructuredSessionAdapter.cancelTurn', () => { turnId: 'turn-1', fence: 7 }) - ).resolves.toEqual({ cancelled: false }) + ).resolves.toEqual({ cancelled: false, refusal: {} }) await expect( (await acquired(absent)).cancelTurn({ sessionId: 'session-1', turnId: 'turn-1', fence: 7 }) - ).resolves.toEqual({ cancelled: false }) + ).resolves.toEqual({ cancelled: false, refusal: {} }) }) it('rethrows an unsettled interrupt so the turn is not shown as cancelled', async () => { @@ -228,14 +228,22 @@ describe('CodexStructuredSessionAdapter.cancelTurn', () => { await expect( adapter.cancelTurn({ sessionId: 'session-1', turnId: 'turn-1', fence: 7 }) - ).resolves.toEqual({ cancelled: false }) + ).resolves.toEqual({ cancelled: false, unconfirmed: true }) expect(events).toContainEqual(expect.objectContaining({ method: 'turn/completed' })) }) it('accepts an immediate resend after verified interruption', async () => { let nextTurn = 0 const codex = fakeCodex() - codex.routes['turn/start'] = () => ({ turn: { id: `turn-${++nextTurn}` } }) + codex.routes['turn/start'] = () => { + // Codex opens each turn it answers; a send's dispatch waits for that. + const turnId = `turn-${++nextTurn}` + codex.connections[0].handlers.onNotification?.('turn/started', { + threadId: THREAD_ID, + turn: { id: turnId } + }) + return { turn: { id: turnId } } + } codex.routes['turn/interrupt'] = () => { completeTurn(codex) return {} diff --git a/src/main/codex/codex-structured-session-close.test.ts b/src/main/codex/codex-structured-session-close.test.ts index dffa7157dd61..9d80a0fa9829 100644 --- a/src/main/codex/codex-structured-session-close.test.ts +++ b/src/main/codex/codex-structured-session-close.test.ts @@ -1,4 +1,5 @@ import { createCodexDispatchEchoes } from './codex-structured-dispatch-echo' +import { createCodexTurnOpenWaits } from './codex-structured-turn-open-wait' import { describe, expect, it, vi } from 'vitest' import type { AgentSessionJournalIdentity } from '../../shared/agent-session-journal-types' import type { @@ -76,7 +77,7 @@ function claudeAdapterStub(): StructuredAgentSessionAdapter { } describe('Codex structured session close lifecycle', () => { - it('forwards a one-shot exit when lifecycle admission is rejected', () => { + function backpressuredSession(requestedClose: boolean) { const connection: CodexAppServerConnection = { pid: 4321, closed: true, @@ -87,7 +88,6 @@ describe('Codex structured session close lifecycle', () => { close: async () => true } const prompts = new CodexPromptRegistry() - const clearPrompts = vi.spyOn(prompts, 'clear') const translator = { handle: vi.fn().mockReturnValueOnce({ accepted: false, reason: 'backpressure' as const }), dispose: vi.fn() @@ -96,7 +96,7 @@ describe('Codex structured session close lifecycle', () => { connection, backgroundTasks: new CodexBackgroundTaskTracker('thread-1'), ended: false, - requestedClose: false, + requestedClose, fence: 7, acquisitionGeneration: 'generation-1', threadId: THREAD, @@ -106,9 +106,15 @@ describe('Codex structured session close lifecycle', () => { reportedOptions: {}, fastModeTierByModel: new Map(), dispatchEchoes: createCodexDispatchEchoes(), + turnOpenWaits: createCodexTurnOpenWaits(), translator } - const sessions = new Map([['session-1', session]]) + return { connection, prompts, translator, session, sessions: new Map([['session-1', session]]) } + } + + it('forwards a one-shot exit when lifecycle admission is rejected', () => { + const { connection, prompts, translator, session, sessions } = backpressuredSession(false) + const clearPrompts = vi.spyOn(prompts, 'clear') const onEvent = vi.fn() expect( @@ -129,6 +135,29 @@ describe('Codex structured session close lifecycle', () => { expect(translator.handle).toHaveBeenCalledOnce() }) + it("ends a Stop's wait for its turn to open when a requested close cannot publish its end yet", async () => { + const { connection, prompts, session, sessions } = backpressuredSession(true) + let released = false + void session.turnOpenWaits.wait('turn-1', 60_000).then(() => { + released = true + }) + + expect( + handleCodexSessionExit({ + sessions, + sessionId: 'session-1', + connection, + error: new Error('codex session closed'), + closedByOrca: true, + prompts + }) + ).toBe(false) + await Promise.resolve() + // Left for the retry, but the child is gone: nothing waits on a turn it would open. + expect(session.ended).toBe(false) + expect(released).toBe(true) + }) + it('mints a distinct child generation even when acquisitions share one fence', async () => { const { adapter } = adapterFixture() const input = { identity: identity('session-1'), fence: 7, spawnToken: 'spawn-1' } diff --git a/src/main/codex/codex-structured-session-close.ts b/src/main/codex/codex-structured-session-close.ts index 91d6c8ff04d2..5bf973308b10 100644 --- a/src/main/codex/codex-structured-session-close.ts +++ b/src/main/codex/codex-structured-session-close.ts @@ -29,6 +29,8 @@ export function handleCodexSessionExit(input: { return false } session.exitObservedAt ??= Date.now() + // Before the admission check: the child is gone whether or not its end was admitted. + session.turnOpenWaits.releaseAll() const event: StructuredAgentSessionEndedEvent = { type: 'ended', sessionId: input.sessionId, diff --git a/src/main/codex/codex-structured-session-options-catalog.test.ts b/src/main/codex/codex-structured-session-options-catalog.test.ts index a9fd420eb0ab..aac9e2946cf7 100644 --- a/src/main/codex/codex-structured-session-options-catalog.test.ts +++ b/src/main/codex/codex-structured-session-options-catalog.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it, vi } from 'vitest' import { createCodexDispatchEchoes } from './codex-structured-dispatch-echo' +import { createCodexTurnOpenWaits } from './codex-structured-turn-open-wait' import type { CodexAppServerConnection } from './codex-app-server-connection' import { CodexAcquisitionWindow } from './codex-structured-acquisition-window' import { @@ -62,6 +63,7 @@ function storeSession( reportedOptions: { model: 'gpt-live', effort: 'high' }, fastModeTierByModel: new Map(), dispatchEchoes: createCodexDispatchEchoes(), + turnOpenWaits: createCodexTurnOpenWaits(), translator: null, catalogAccess: { store, fingerprint: FINGERPRINT, accountHomePath: '/homes/a' } } diff --git a/src/main/codex/codex-structured-session-options.test.ts b/src/main/codex/codex-structured-session-options.test.ts index 47ed8b50e3aa..d99ecc0305e1 100644 --- a/src/main/codex/codex-structured-session-options.test.ts +++ b/src/main/codex/codex-structured-session-options.test.ts @@ -1,4 +1,5 @@ import { createCodexDispatchEchoes } from './codex-structured-dispatch-echo' +import { createCodexTurnOpenWaits } from './codex-structured-turn-open-wait' import { describe, expect, it, vi } from 'vitest' import type { CodexAppServerConnection } from './codex-app-server-connection' import { CodexAcquisitionWindow } from './codex-structured-acquisition-window' @@ -36,6 +37,7 @@ function optionSession(request: CodexAppServerConnection['request']): CodexSessi reportedOptions: { model: 'gpt-live', effort: 'high' }, fastModeTierByModel: new Map(), dispatchEchoes: createCodexDispatchEchoes(), + turnOpenWaits: createCodexTurnOpenWaits(), translator: null } } diff --git a/src/main/codex/codex-structured-session-state.ts b/src/main/codex/codex-structured-session-state.ts index 7f40407e3ffd..02c56b419bdf 100644 --- a/src/main/codex/codex-structured-session-state.ts +++ b/src/main/codex/codex-structured-session-state.ts @@ -10,6 +10,10 @@ import type { openCodexAppServerConnection } from './codex-app-server-connection' import { CodexAcquisitionWindow } from './codex-structured-acquisition-window' +import { + createCodexTurnOpenWaits, + type CodexTurnOpenWaits +} from './codex-structured-turn-open-wait' import type { CodexDispatchEchoes } from './codex-structured-dispatch-echo' import type { AgentSessionBackgroundTaskState } from '../../shared/agent-session-wire' import type { AgentChildWorkEvidence } from '../../shared/agent-status-child-work-evidence' @@ -118,7 +122,11 @@ export type CodexSession = { threadId: string historyPath: string | null historyMode?: 'legacy' | 'paginated' + /** Primary-thread turns Codex reported started and not yet ended, as read off the wire: what + * rewind waits out and what a Stop naming no turn interrupts when the journal shows none. */ activeTurnIds?: Set + /** Stops waiting for the turn Codex answered a send into to open. */ + turnOpenWaits: CodexTurnOpenWaits dispatchPending?: boolean prompts: CodexAcquisitionWindow['prompts'] options: Map @@ -149,8 +157,17 @@ export function mintCodexAcquisitionGeneration(deps: CodexStructuredSessionAdapt export function codexSessionLifecycle( fence: number, acquisitionGeneration: string -): Pick { - return { ended: false, requestedClose: false, fence, acquisitionGeneration } +): Pick< + CodexSession, + 'ended' | 'requestedClose' | 'fence' | 'acquisitionGeneration' | 'turnOpenWaits' +> { + return { + ended: false, + requestedClose: false, + fence, + acquisitionGeneration, + turnOpenWaits: createCodexTurnOpenWaits() + } } export function requireLiveCodexSession( diff --git a/src/main/codex/codex-structured-turn-cancellation.ts b/src/main/codex/codex-structured-turn-cancellation.ts index 4418da810571..524ab252e4f8 100644 --- a/src/main/codex/codex-structured-turn-cancellation.ts +++ b/src/main/codex/codex-structured-turn-cancellation.ts @@ -3,6 +3,8 @@ import { type CodexAppServerConnection } from './codex-app-server-connection' import { isCodexAppServerUnsupportedError } from './codex-app-server-session' +import { providerDiagnosticOf } from '../../shared/agent-session-failure' +import type { AgentSessionCancelOutcome } from '../native-chat/agent-session-wire/structured-agent-session-adapter' import type { CodexSession, CodexStructuredSessionAdapterDeps, @@ -91,7 +93,7 @@ export class CodexStructuredTurnCancellation { turnId: string, isCurrent: () => boolean = () => true, onConfirmed?: () => CodexJournalTranslationAdmission - ): Promise<{ cancelled: boolean }> { + ): Promise { const state = this.state(session) const key = turnKey(threadId, turnId) state.blockedCompletions.add(key) @@ -151,7 +153,14 @@ export class CodexStructuredTurnCancellation { // A failed cancellation must not permanently divert the provider's later // completion for this turn. Let the normal completion path settle it. this.releaseCompletion(session, key) - return { cancelled: false } + if (acknowledged) { + return { cancelled: false, unconfirmed: true } + } + if (!requestError) { + return { cancelled: false } + } + const detail = providerDiagnosticOf(requestError) + return { cancelled: false, refusal: detail ? { detail } : {} } } private capture(pid: number | undefined): Promise { diff --git a/src/main/codex/codex-structured-turn-end-settlement.test.ts b/src/main/codex/codex-structured-turn-end-settlement.test.ts index 60f5a3c5f38e..38cc648f79d9 100644 --- a/src/main/codex/codex-structured-turn-end-settlement.test.ts +++ b/src/main/codex/codex-structured-turn-end-settlement.test.ts @@ -36,17 +36,23 @@ async function turnEndRig() { body: CODEX_TEST_USER_MESSAGE, fence: 7 }) + // Codex answers a cold send before it opens the turn. + const sendAndOpen = async (clientMessageId: string) => { + const sending = send(clientMessageId) + await vi.waitFor(() => expect(turns.turnId).not.toBeNull()) + turns.start() + return sending + } const settledIds = () => settlements.map(({ clientMessageId }) => clientMessageId) const categoryOf = (settlement: LateSettlement | undefined) => settlement && 'state' in settlement ? classifyDispatchRejection(settlement).category : null - return { codex, turns, adapter, send, settlements, settledIds, categoryOf, bodies } + return { codex, turns, adapter, send, sendAndOpen, settlements, settledIds, categoryOf, bodies } } describe('a Codex send its turn ended without echoing', () => { it('is withdrawn when the turn is interrupted, once', async () => { const rig = await turnEndRig() - await expect(rig.send('client-1')).resolves.toEqual({ state: 'admitted' }) - rig.turns.start() + await expect(rig.sendAndOpen('client-1')).resolves.toEqual({ state: 'admitted' }) rig.turns.end('interrupted') @@ -62,8 +68,7 @@ describe('a Codex send its turn ended without echoing', () => { it('is rejected in Codex words when its failed turn ends without echoing it', async () => { const rig = await turnEndRig() - await rig.send('client-1') - rig.turns.start() + await rig.sendAndOpen('client-1') rig.codex.connections[0]!.handlers.onNotification?.('error', { threadId: CODEX_TEST_THREAD_ID, @@ -87,8 +92,7 @@ describe('a Codex send its turn ended without echoing', () => { it('is accepted when Codex records it after the error that fails its turn', async () => { const rig = await turnEndRig() - await rig.send('client-1') - rig.turns.start() + await rig.sendAndOpen('client-1') rig.turns.echo('client-1') await rig.send('client-2') @@ -113,8 +117,7 @@ describe('a Codex send its turn ended without echoing', () => { it('stays pending, still armed, when its turn completes without echoing it', async () => { const rig = await turnEndRig() - await rig.send('client-1') - rig.turns.start() + await rig.sendAndOpen('client-1') rig.turns.end('completed') expect(rig.settlements).toEqual([]) @@ -131,8 +134,7 @@ describe('a Codex send its turn ended without echoing', () => { it('accepts a send its turn echoed, with its key, exactly once', async () => { const rig = await turnEndRig() - await rig.send('client-1') - rig.turns.start() + await rig.sendAndOpen('client-1') rig.turns.echo('client-1') rig.turns.end('interrupted') @@ -153,8 +155,7 @@ describe('a Codex send its turn ended without echoing', () => { it('ignores an echo that arrives after the withdrawal', async () => { const rig = await turnEndRig() - await rig.send('client-1') - rig.turns.start() + await rig.sendAndOpen('client-1') rig.turns.end('interrupted') rig.turns.echo('client-1') @@ -165,8 +166,7 @@ describe('a Codex send its turn ended without echoing', () => { it('settles each of two sends steered into one interrupted turn once', async () => { const rig = await turnEndRig() - await rig.send('client-1') - rig.turns.start() + await rig.sendAndOpen('client-1') await rig.send('client-2') expect(rig.turns.turnId).toBe('turn-1') @@ -275,8 +275,7 @@ describe('a Codex send its turn ended without echoing', () => { it('ignores a turn end on a child thread', async () => { const rig = await turnEndRig() - await rig.send('client-1') - rig.turns.start() + await rig.sendAndOpen('client-1') rig.codex.connections[0]!.handlers.onNotification?.('turn/completed', { threadId: 'thread-child', diff --git a/src/main/codex/codex-structured-turn-open-wait.test.ts b/src/main/codex/codex-structured-turn-open-wait.test.ts new file mode 100644 index 000000000000..125be2bba0b0 --- /dev/null +++ b/src/main/codex/codex-structured-turn-open-wait.test.ts @@ -0,0 +1,147 @@ +// A Codex Stop that names no turn, sent after Codex answered a cold send and before it opened that +// turn, waits for the turn to open, or provably not to, and never the send itself. The fake keeps +// Codex 0.157's turn bookkeeping: it answers before it opens the turn, and refuses an interrupt +// until then. + +import { afterEach, describe, expect, it, vi } from 'vitest' +import { + CODEX_TEST_THREAD_ID, + codexTurnLifecycleRig, + settledWithin +} from './codex-structured-dispatch-test-support' +import { CODEX_STOP_TURN_OPEN_WAIT_MS } from './codex-structured-prompt-ownership' + +type Rig = Awaited> + +const ADMITTED = { state: 'admitted' } +const REFUSED = { cancelled: false } + +const stop = (rig: Rig) => rig.adapter.cancelTurn({ sessionId: 'session-1', fence: 7 }) + +/** A cold send Codex answered into `turn-1` and has not opened. */ +async function answeredColdSend(rig: Rig): Promise { + const sending = rig.send('client-1') + await vi.waitFor(() => expect(rig.turns.turnId).toBe('turn-1')) + // The send is not held for the turn to open: its handover ends at the answer. + expect(await settledWithin(sending)).toEqual(ADMITTED) +} + +/** A Stop sent in the window, which Codex would refuse if it reached Codex now. */ +async function waitingStop(rig: Rig) { + await answeredColdSend(rig) + const stopping = stop(rig) + expect(await settledWithin(stopping)).toBe('held') + expect(rig.interrupts()).toEqual([]) + // Wrapped: an async function returning the promise itself would wait for it. + return { stopping } +} + +afterEach(() => { + vi.useRealTimers() +}) + +describe('a Codex send answered before its turn opens', () => { + it('is admitted at the answer when no Stop is pending', async () => { + const rig = await codexTurnLifecycleRig() + + await answeredColdSend(rig) + + expect(rig.turns.turnId).toBe('turn-1') + }) +}) + +describe("a no-turn Stop in the window between Codex's answer and its turn opening", () => { + it('waits for the turn to open, then stops it', async () => { + const rig = await codexTurnLifecycleRig() + const { stopping } = await waitingStop(rig) + + rig.turns.start() + + expect(await settledWithin(stopping)).toEqual({ cancelled: true }) + expect(rig.interrupts().map((call) => call.params?.turnId)).toEqual(['turn-1']) + expect(rig.turns.turnId).toBeNull() + }) + + it('does not wait when Codex opened the turn before its answer was read', async () => { + const rig = await codexTurnLifecycleRig() + const release = rig.turns.holdNextAnswer() + const sending = rig.send('client-1') + await vi.waitFor(() => expect(rig.turns.turnId).toBe('turn-1')) + rig.turns.start() + release() + await sending + + expect(await settledWithin(stop(rig))).toEqual({ cancelled: true }) + }) + + it('does not wait for a send Codex steered into the running turn', async () => { + const rig = await codexTurnLifecycleRig() + await answeredColdSend(rig) + rig.turns.start() + expect(await settledWithin(rig.send('client-2'))).toEqual(ADMITTED) + + expect(await settledWithin(stop(rig))).toEqual({ cancelled: true }) + expect(rig.interrupts().map((call) => call.params?.turnId)).toEqual(['turn-1']) + }) + + it('stops nothing when the turn ends without opening', async () => { + const rig = await codexTurnLifecycleRig() + const { stopping } = await waitingStop(rig) + + rig.turns.end('interrupted') + + expect(await settledWithin(stopping)).toEqual(REFUSED) + expect(rig.interrupts()).toEqual([]) + }) + + it.each(['idle', 'systemError'])( + 'stops nothing when Codex reports the thread %s', + async (type) => { + const rig = await codexTurnLifecycleRig() + const { stopping } = await waitingStop(rig) + + rig.notify('thread/status/changed', { threadId: CODEX_TEST_THREAD_ID, status: { type } }) + + expect(await settledWithin(stopping)).toEqual(REFUSED) + expect(rig.interrupts()).toEqual([]) + } + ) + + it('keeps waiting when a child thread stops running', async () => { + const rig = await codexTurnLifecycleRig() + const { stopping } = await waitingStop(rig) + + rig.notify('thread/status/changed', { threadId: 'thread-child', status: { type: 'idle' } }) + + expect(await settledWithin(stopping)).toBe('held') + rig.turns.start() + expect(await settledWithin(stopping)).toEqual({ cancelled: true }) + }) + + it('stops nothing when the child exits', async () => { + const rig = await codexTurnLifecycleRig() + const { stopping } = await waitingStop(rig) + + rig.codex.connections[0]!.handlers.onExit?.(new Error('codex app-server exited')) + + expect(await settledWithin(stopping)).toEqual(REFUSED) + expect(rig.interrupts()).toEqual([]) + }) + + it('stops nothing once its bound runs out', async () => { + const rig = await codexTurnLifecycleRig() + await answeredColdSend(rig) + vi.useFakeTimers() + let outcome: unknown = 'held' + void stop(rig).then((value) => { + outcome = value + }) + + await vi.advanceTimersByTimeAsync(CODEX_STOP_TURN_OPEN_WAIT_MS - 1) + expect(outcome).toBe('held') + await vi.advanceTimersByTimeAsync(1) + + expect(outcome).toEqual(REFUSED) + expect(rig.interrupts()).toEqual([]) + }) +}) diff --git a/src/main/codex/codex-structured-turn-open-wait.ts b/src/main/codex/codex-structured-turn-open-wait.ts new file mode 100644 index 000000000000..63e372940058 --- /dev/null +++ b/src/main/codex/codex-structured-turn-open-wait.ts @@ -0,0 +1,54 @@ +// A Stop's wait for the turn Codex answered a send into to open, or provably not to: it ended, +// the thread stopped running, or the child is gone. Held in memory only. + +import { + codexThreadStoppedRunning, + readCodexThreadId, + readCodexTurnId +} from './codex-structured-thread-facts' + +export type CodexTurnOpenWaits = { + /** Resolves once `turnId` opens or can no longer, and after `withinMs` at the latest. */ + wait: (turnId: string, withinMs: number) => Promise + /** Ends the waits a notification on the session's own thread answers. */ + observe: (threadId: string, method: string, params: unknown) => void + /** Ends every wait: the child that would open their turns is gone. */ + releaseAll: () => void +} + +export function createCodexTurnOpenWaits(): CodexTurnOpenWaits { + const waits = new Map<() => void, string>() + const release = (turnId?: string): void => { + for (const [endWait, waitedTurnId] of waits) { + if (turnId === undefined || waitedTurnId === turnId) { + endWait() + } + } + } + return { + wait: (turnId, withinMs) => + new Promise((resolve) => { + const endWait = (): void => { + clearTimeout(bound) + waits.delete(endWait) + resolve() + } + const bound = setTimeout(endWait, withinMs) + waits.set(endWait, turnId) + }), + observe: (threadId, method, params) => { + if ((readCodexThreadId(params) ?? threadId) !== threadId) { + return + } + if (method === 'thread/status/changed' && codexThreadStoppedRunning(params)) { + release() + return + } + const turnId = readCodexTurnId(params) + if (turnId && (method === 'turn/started' || method === 'turn/completed')) { + release(turnId) + } + }, + releaseAll: () => release() + } +} diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts index bc3c27ca5b13..e4ef8eb85f88 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-adapter.ts @@ -33,7 +33,10 @@ import { isAgentSessionWireRefusalCode, type AgentSessionRefusalReason } from '../../../shared/agent-session-wire-refusals' -import type { SubmissionRejectionFact } from '../../../shared/agent-session-failure' +import type { + ProviderDiagnostic, + SubmissionRejectionFact +} from '../../../shared/agent-session-failure' import type { AgentJournalDispatchRejection } from '../../../shared/agent-session-failure-words' import type { AgentSessionPromptResponse } from '../../../shared/agent-session-question-answer' import type { ProviderHistoryWindow } from '../agent-session-journal/journal-submission-reconciler' @@ -216,6 +219,14 @@ export type StructuredAgentSessionSetOptionInput = { fence: number } +/** `refusal`: the provider answered the Stop and declined it, in its own words when it gave any. + * `unconfirmed`: the provider took the Stop, but Orca could not confirm the turn's work ended. */ +export type AgentSessionCancelOutcome = { + cancelled: boolean + refusal?: { detail?: ProviderDiagnostic } + unconfirmed?: true +} + export type StructuredAgentSessionAdapter = { /** Provider-aware capability check for hosts that route more than one adapter. */ supportsCreate?(location: AgentSessionExecutionLocation, agent: string): boolean @@ -270,10 +281,11 @@ export type StructuredAgentSessionAdapter = { onLateResult?: (result: StructuredSessionCompactionResult) => Promise }): Promise /** Cancels one turn, not the session: a session-wide interrupt would also kill - * a turn the client never asked to stop. */ + * a turn the client never asked to stop. With no `turnId` the conversation asked to stop + * everything it has in flight — a running turn, or a dispatch whose turn has not opened yet. */ cancelTurn(input: { sessionId: string - turnId: string + turnId?: string fence: number prompt?: { itemId: string } /** Latest journal submission for this fence, when the host has one. */ @@ -282,7 +294,7 @@ export type StructuredAgentSessionAdapter = { * could have named. A function, not a value, because the guard re-checks after the * delivery fence may have waited. Absent for direct callers with no journal. */ resolveLiveTurnId?: () => string | null - }): Promise<{ cancelled: boolean }> + }): Promise /** Changes the provider thread's goal. `rejected` is the provider refusing the * change; a throw leaves its effect unknown. Absent where no goal exists. */ changeThreadGoal?(input: { diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-claude-echo-working.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-claude-echo-working.test.ts new file mode 100644 index 000000000000..0fe206201604 --- /dev/null +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-claude-echo-working.test.ts @@ -0,0 +1,146 @@ +// Claude's echo of a sent message both answers the send and opens its turn. Whatever order the +// host publishes those in, a chat reading its frames one at a time must read working throughout: +// Stop and every session list's Working come from that one rule. + +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, expect, it } from 'vitest' +import type { AgentJournalSubmission } from '../../../shared/agent-session-journal-types' +import { computeAgentSessionPayloadFingerprint } from '../../../shared/agent-session-mutation-envelope' +import { isStructuredAgentSessionMainAgentWorking } from '../../../shared/structured-agent-session-main-agent-working' +import { ClaudeStructuredSessionAdapter } from '../../claude/claude-structured-session-adapter' +import { + fakeClaude, + PROVIDER_SESSION_ID +} from '../../claude/claude-structured-session-test-support' +import { AgentSessionRecordStore } from '../../runtime/agent-session-record-store' +import { structuredClaudeLifecycleEvent } from '../../runtime/structured-claude-runtime-adapter' +import { StructuredAgentSessionHost } from './structured-agent-session-host' +import { + HOST_TEST_NOW as NOW, + HOST_TEST_SESSION as SESSION, + hostTestAttachParams, + hostTestMessage, + hostTestOperationId, + resetHostTestOperationIds +} from './structured-agent-session-host-test-data' + +const CALLER = { callerKey: 'client-1' } + +let root: string +let host: StructuredAgentSessionHost +let adapter: ClaudeStructuredSessionAdapter +let store: AgentSessionRecordStore +const claude = { current: fakeClaude({ replayUuid: null }) } + +beforeEach(async () => { + root = await mkdtemp(join(tmpdir(), 'orca-claude-echo-working-')) + resetHostTestOperationIds() + claude.current = fakeClaude({ replayUuid: null }) + const lifecycle: Promise[] = [] + adapter = new ClaudeStructuredSessionAdapter({ + resolveLaunch: async () => ({ + pathToClaudeCodeExecutable: 'claude', + options: {}, + cwd: root, + claudeConfigDir: join(root, 'claude-home'), + providerSessionId: PROVIDER_SESSION_ID, + resumeLeafUuid: null, + resumesTranscript: false, + continuesChain: false + }), + onEvent: (event) => { + const mapped = structuredClaudeLifecycleEvent(event) + if (mapped) { + lifecycle.push(host.handleAdapterEvent(mapped)) + } + }, + // As the runtime wires it. + onDispatchSettledLate: (settlement) => void host.settleLateDispatch(settlement), + openConnection: claude.current.openConnection, + readProcessStartTime: async () => 1_700_000_000_000, + now: () => NOW + }) + store = await AgentSessionRecordStore.open({ directory: join(root, 'store'), hostId: 'local' }) + host = new StructuredAgentSessionHost({ + store, + adapter: Object.assign(adapter, { supportsCreate: () => true }), + journalRoot: root, + claimKeyId: 'key-1', + mintSpawnToken: () => 'spawn-a', + now: () => NOW + }) + const params = hostTestAttachParams(null, { + provider: 'claude', + agent: 'claude', + accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: join(root, 'claude-home') }, + providerHandle: { kind: 'claude', sessionId: PROVIDER_SESSION_ID, leafUuid: null } + }) + expect(await host.attach(CALLER, params)).toMatchObject({ ok: true }) + await adapter.awaitStarted(SESSION) + await Promise.all(lifecycle) +}) + +afterEach(async () => { + await adapter.closeAll() + await host.flushAllStreamedEvents() + await rm(root, { recursive: true, force: true }) +}) + +function settled(): Promise { + return new Promise((resolve) => setTimeout(resolve, 20)) +} + +it('reads working at every published frame from the send through the echo that opens its turn', async () => { + const submissions = new Map() + const turns = new Map() + const working: boolean[] = [] + const fence = store.getRecord(SESSION)!.lease.runtimeFence + host.subscribe({ + id: 'chat-1', + sessionId: SESSION, + emit: (event) => { + if (event.type !== 'batch') { + return + } + for (const submission of event.batch.submissions) { + submissions.set(submission.clientMessageId, submission) + } + for (const item of event.batch.items) { + if (item.body.kind === 'turn') { + turns.set(item.itemId, item.body.state) + } + } + const running = [...turns].find(([, state]) => state === 'running')?.[0] ?? null + working.push( + isStructuredAgentSessionMainAgentWorking(running, [...submissions.values()], fence) + ) + } + }) + const body = hostTestMessage('hi') + await host.send(CALLER, { + envelope: { + sessionId: SESSION, + clientOperationId: hostTestOperationId(), + expectedRuntimeFence: fence, + payloadFingerprint: computeAgentSessionPayloadFingerprint({ + method: 'agentSession.send', + sessionId: SESSION, + fields: { body } + }) + }, + body + }) + await settled() + const connection = claude.current.connections[0]! + // Claude echoes the written message back, which is what opens its turn. + connection.handlers.onMessage?.({ ...connection.sent.at(-1)!, uuid: 'echo-uuid' }) + await settled() + + expect([...submissions.values()].map((submission) => submission.dispatchState)).toEqual([ + 'accepted' + ]) + expect([...turns.values()]).toEqual(['running']) + expect(working).not.toContain(false) +}) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-stop.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-stop.test.ts new file mode 100644 index 000000000000..ab0368a6b921 --- /dev/null +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-conversation-stop.test.ts @@ -0,0 +1,277 @@ +// A Stop that names no turn stops what the conversation has in flight: it withdraws what is +// queued, and interrupts a handed-over message even before the provider has opened its turn — +// the gap no client can name a turn for. Against the real host, store and journal. + +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from 'vitest' +import { computeAgentSessionPayloadFingerprint } from '../../../shared/agent-session-mutation-envelope' +import type { AgentJournalSubmission } from '../../../shared/agent-session-journal-types' +import { DISPATCH_REJECTED_CANCELLED } from '../../../shared/structured-agent-session-dispatch-rejection' +import { CancelParams } from '../../../shared/rpc-contract/structured-agent-session-params' +import { AgentSessionRecordStore } from '../../runtime/agent-session-record-store' +import type { StructuredAgentSessionAdapter } from './structured-agent-session-adapter' +import { StructuredAgentSessionHost } from './structured-agent-session-host' +import { + HOST_TEST_NOW as NOW, + HOST_TEST_SESSION as SESSION, + HOST_TEST_THREAD as THREAD, + hostTestAttachParams, + hostTestMessage, + hostTestOperationId, + resetHostTestOperationIds +} from './structured-agent-session-host-test-data' + +const CALLER = { callerKey: 'client-1' } +const ALREADY_FINISHED = 'The provider had already finished this turn.' + +let root: string +let store: AgentSessionRecordStore +let host: StructuredAgentSessionHost +let dispatch: Mock +let cancelTurn: Mock +let awaitStarted: Mock> + +function eventually(assertion: () => void | Promise): Promise { + return vi.waitFor(assertion, { timeout: 10_000 }) +} + +beforeEach(async () => { + root = await mkdtemp(join(tmpdir(), 'orca-conversation-stop-')) + resetHostTestOperationIds() + // Admitted, not accepted: the message is written and its turn has not opened. + dispatch = vi.fn(async () => ({ state: 'admitted' as const })) + cancelTurn = vi.fn(async () => ({ cancelled: true })) + awaitStarted = vi.fn(async () => undefined) + store = await AgentSessionRecordStore.open({ directory: join(root, 'store'), hostId: 'local' }) + host = new StructuredAgentSessionHost({ + store, + adapter: { + acquire: async ({ fence, spawnToken }) => ({ + process: { hostId: 'local', pid: 4242, processStartTimeMs: 1_700_000_000_000, spawnToken }, + acquisitionGeneration: 'generation-1', + link: { + linkId: `link-${fence}`, + handle: { provider: 'codex' as const, threadId: THREAD }, + origin: 'created' as const, + mintedAtFence: fence, + observedAt: NOW + } + }), + dispatch, + awaitStarted, + closeSession: vi.fn(async () => true), + releaseAcquisition: vi.fn(async () => true), + cancelTurn, + answerPrompt: vi.fn(async () => undefined), + setOption: vi.fn(async () => undefined) + }, + journalRoot: root, + claimKeyId: 'key-1', + mintSpawnToken: () => 'spawn-1', + now: () => NOW + }) + expect(await host.attach(CALLER, hostTestAttachParams(null))).toMatchObject({ ok: true }) +}) + +afterEach(async () => { + await host.flushAllStreamedEvents() + await rm(root, { recursive: true, force: true }) +}) + +function send(text: string) { + const body = hostTestMessage(text) + const clientOperationId = hostTestOperationId() + const result = host.send(CALLER, { + envelope: { + sessionId: SESSION, + clientOperationId, + expectedRuntimeFence: 1, + payloadFingerprint: computeAgentSessionPayloadFingerprint({ + method: 'agentSession.send', + sessionId: SESSION, + fields: { body } + }) + }, + body + }) + return { id: clientOperationId, result } +} + +function stop(turnId?: string, clientOperationId = hostTestOperationId()) { + const fields = turnId === undefined ? {} : { turnId } + return host.cancel(CALLER, { + envelope: { + sessionId: SESSION, + clientOperationId, + expectedRuntimeFence: null, + payloadFingerprint: computeAgentSessionPayloadFingerprint({ + method: 'agentSession.cancel', + sessionId: SESSION, + fields + }) + }, + ...fields + }) +} + +async function submission(id: string): Promise { + return (await host.journalSnapshot(SESSION)).submissions.find( + (entry) => entry.clientMessageId === id + ) +} + +async function statusRows(): Promise { + return (await host.journalSnapshot(SESSION)).items.flatMap((item) => + item.body.kind === 'status' ? [item.body.text] : [] + ) +} + +describe('a Stop that names no turn', () => { + it('is a valid cancel, and only a plain Stop may omit the turn', () => { + const envelope = { + sessionId: SESSION, + clientOperationId: hostTestOperationId(), + expectedRuntimeFence: 1, + payloadFingerprint: '0'.repeat(64) + } + expect(CancelParams.safeParse({ envelope }).success).toBe(true) + expect( + CancelParams.safeParse({ envelope, prompt: { itemId: 'item-1', expectedRevision: 1 } }) + .success + ).toBe(false) + expect(CancelParams.safeParse({ envelope, scope: 'background-tasks' }).success).toBe(false) + }) + + it('interrupts a handed-over message before its turn opens, as a cancellation', async () => { + const { id, result } = send('hello') + await result + await eventually(async () => expect((await submission(id))?.handedOverAt).toBeDefined()) + expect( + (await host.journalSnapshot(SESSION)).items.some((item) => item.body.kind === 'turn') + ).toBe(false) + + const stopped = await stop() + + expect(stopped).toEqual({ + ok: true, + replayed: false, + fence: 1, + cursor: expect.anything(), + value: { cancelled: true } + }) + expect(cancelTurn).toHaveBeenCalledTimes(1) + expect(cancelTurn.mock.calls[0]![0]).not.toHaveProperty('turnId') + expect(cancelTurn.mock.calls[0]![0]).toMatchObject({ sessionId: SESSION, fence: 1 }) + expect(await statusRows()).toEqual(['Cancellation requested.']) + }) + + it('withdraws what is queued on a ready child and asks the provider for nothing more', async () => { + const started = Promise.withResolvers() + awaitStarted.mockImplementationOnce(() => started.promise) + const { id, result } = send('hello') + await result + await eventually(() => expect(awaitStarted).toHaveBeenCalled()) + + expect(await stop()).toMatchObject({ ok: true, value: { cancelled: true } }) + started.resolve(undefined) + + expect(await submission(id)).toMatchObject({ + dispatchState: 'rejected', + reason: DISPATCH_REJECTED_CANCELLED + }) + expect(cancelTurn).not.toHaveBeenCalled() + await host.flushStreamedEvents(SESSION) + expect(dispatch).not.toHaveBeenCalled() + expect(await statusRows()).toEqual([]) + }) + + it('withdraws a send still on its way in, which the host takes first', async () => { + const { id, result } = send('hello') + const stopped = stop() + + expect(await result).toMatchObject({ ok: true }) + expect(await stopped).toMatchObject({ ok: true, value: { cancelled: true } }) + expect(await submission(id)).toMatchObject({ + dispatchState: 'rejected', + reason: DISPATCH_REJECTED_CANCELLED + }) + await host.flushStreamedEvents(SESSION) + expect(dispatch).not.toHaveBeenCalled() + }) + + it('says the agent did not stop, in its words, when it refused', async () => { + const { id, result } = send('hello') + await result + await eventually(async () => expect((await submission(id))?.handedOverAt).toBeDefined()) + cancelTurn.mockResolvedValueOnce({ + cancelled: false, + refusal: { detail: { text: 'no active turn to interrupt', audience: 'person' } } + }) + + expect(await stop()).toMatchObject({ ok: true, value: { cancelled: false } }) + + expect(cancelTurn).toHaveBeenCalledOnce() + expect(await statusRows()).toEqual(["Codex didn't stop: no active turn to interrupt."]) + }) + + it('says the Stop is unconfirmed, not that nothing ran, when the provider took it', async () => { + const { id, result } = send('hello') + await result + await eventually(async () => expect((await submission(id))?.handedOverAt).toBeDefined()) + cancelTurn.mockResolvedValueOnce({ cancelled: false, unconfirmed: true }) + + expect(await stop()).toMatchObject({ ok: true, value: { cancelled: false } }) + + expect(await statusRows()).toEqual(['Cancellation was not confirmed.']) + }) + + it('says the agent had no turn to stop when it had none', async () => { + const { id, result } = send('hello') + await result + await eventually(async () => expect((await submission(id))?.handedOverAt).toBeDefined()) + cancelTurn.mockResolvedValueOnce({ cancelled: false }) + + expect(await stop()).toMatchObject({ ok: true, value: { cancelled: false } }) + + expect(await statusRows()).toEqual(['Codex had no turn running to stop.']) + }) + + it('stops nothing when it reuses the id of a Stop the host already ran', async () => { + const operationId = hostTestOperationId() + expect(await stop(undefined, operationId)).toMatchObject({ ok: true, replayed: false }) + const { id, result } = send('hello') + await result + await eventually(async () => expect((await submission(id))?.handedOverAt).toBeDefined()) + + // Why the client never reuses a no-turn Stop's id: the same id is the same Stop. + expect(await stop(undefined, operationId)).toMatchObject({ + ok: true, + replayed: true, + value: { cancelled: false } + }) + expect(cancelTurn).not.toHaveBeenCalled() + expect(await stop()).toMatchObject({ ok: true, value: { cancelled: true } }) + expect(cancelTurn).toHaveBeenCalledOnce() + }) + + it('is a quiet no-op with nothing in flight', async () => { + expect(await stop()).toMatchObject({ ok: true, value: { cancelled: false } }) + expect(cancelTurn).not.toHaveBeenCalled() + expect(await statusRows()).toEqual([]) + }) +}) + +describe('a Stop that names its turn, as an older client sends it', () => { + it('reaches the provider with that turn and keeps its not-cancelled note', async () => { + cancelTurn.mockResolvedValueOnce({ cancelled: false }) + + expect(await stop('turn-1')).toMatchObject({ + ok: true, + value: { turnId: 'turn-1', cancelled: false } + }) + expect(cancelTurn).toHaveBeenCalledWith(expect.objectContaining({ turnId: 'turn-1' })) + expect(await statusRows()).toEqual([ALREADY_FINISHED]) + }) +}) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-host-mutations.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-host-mutations.ts index 35782b676c2e..1586bd4a1c16 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-host-mutations.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-host-mutations.ts @@ -21,6 +21,7 @@ import type { AgentSessionThreadGoalChange, AgentSessionThreadGoalResult } from '../../../shared/agent-session-wire' +import { isStructuredAgentSessionMainAgentWorking } from '../../../shared/structured-agent-session-main-agent-working' import { agentSessionFailureWords, type AgentJournalDispatchRejection @@ -38,6 +39,7 @@ import { openForWrite, openWithAgent, sendPreparation, + structuredAgentSessionFailureWordsContext, structuredAgentSessionSendBlock } from './structured-agent-session-send-preparation' import { @@ -138,7 +140,7 @@ export function cancelStructuredAgentSessionTurn( caller: StructuredAgentSessionCaller, params: { envelope: AgentSessionMutationEnvelope - turnId: string + turnId?: string scope?: 'background-tasks' taskId?: string prompt?: { itemId: string; expectedRevision: number } @@ -176,15 +178,29 @@ export function cancelStructuredAgentSessionTurn( ctx.fence, agentSessionFailureWords(agentSessionFailureFact('cancelled'), { surface: 'rejection' }) ) + const named = params.turnId !== undefined ? { turnId: params.turnId } : {} const child = context.sessions.get(ctx.sessionId)?.child if (child?.phase === 'starting') { // A start that may never land is the one thing here Stop has to end; the chat stays. await context.stopAgent(ctx.sessionId) - return { ok: true, value: { turnId: params.turnId, cancelled: true } } + return { ok: true, value: { ...named, cancelled: true } } } - return child - ? plan.run(ctx) - : { ok: true, value: { turnId: params.turnId, cancelled: withdrawn.length > 0 } } + // A Stop naming no turn ends nothing more unless the session reads working, by the rule + // every session list and the chat's own Stop read it. + const inFlight = + params.turnId !== undefined || + isStructuredAgentSessionMainAgentWorking( + ctx.journal.activeTurnId(), + ctx.journal.submissions(), + ctx.fence + ) + const record = context.deps.store.getRecord(ctx.sessionId) + return child && inFlight + ? plan.run({ + ...ctx, + failureTextContext: structuredAgentSessionFailureWordsContext(record) + }) + : { ok: true, value: { ...named, cancelled: withdrawn.length > 0 } } } }, openForWrite(context, params.envelope) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-main-agent-working-agreement.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-main-agent-working-agreement.test.ts new file mode 100644 index 000000000000..35c02972829c --- /dev/null +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-main-agent-working-agreement.test.ts @@ -0,0 +1,229 @@ +// The chat's own Stop and every session list read whether the main agent is working through one +// rule, but over two copies of the host's journal: the chat reduces its stream, and a list reads the +// status feed. Both leave the host from one publication edge, so once each has landed they must say +// the same thing. Against the real host, store, journal, stream and status feed. + +import { mkdtemp, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from 'vitest' +import { computeAgentSessionPayloadFingerprint } from '../../../shared/agent-session-mutation-envelope' +import type { AgentSessionBackgroundTaskState } from '../../../shared/agent-session-background-task-wire' +import type { AgentJournalItemBody } from '../../../shared/agent-session-journal-types' +import type { AgentSessionStatusSummary } from '../../../shared/agent-session-wire' +import { structuredAgentSessionAgentStatus } from '../../../shared/structured-agent-session-agent-status' +import { activeStructuredAgentSessionTurnId } from '../../../shared/structured-agent-session-live-turn' +import { isStructuredAgentSessionMainAgentWorking } from '../../../shared/structured-agent-session-main-agent-working' +import { + EMPTY_STRUCTURED_AGENT_SESSION, + reduceStructuredAgentSession, + type StructuredAgentSessionState +} from '../../../shared/structured-agent-session-reducer' +import { AgentSessionRecordStore } from '../../runtime/agent-session-record-store' +import type { StructuredAgentSessionAdapter } from './structured-agent-session-adapter' +import type { StructuredAgentSessionEventSink } from './structured-agent-session-event-sink' +import { StructuredAgentSessionHost } from './structured-agent-session-host' +import { + HOST_TEST_NOW as NOW, + HOST_TEST_SESSION as SESSION, + HOST_TEST_THREAD as THREAD, + hostTestAttachParams, + hostTestMessage, + hostTestOperationId, + resetHostTestOperationIds +} from './structured-agent-session-host-test-data' + +const CALLER = { callerKey: 'client-1' } +const PROVIDER_ROW = { provider: 'codex' as const, threadId: THREAD, turnId: 'turn-1' } + +let root: string +let store: AgentSessionRecordStore +let host: StructuredAgentSessionHost +let dispatch: Mock +let events: StructuredAgentSessionEventSink | undefined +let backgroundTasks: AgentSessionBackgroundTaskState | null +let chat: StructuredAgentSessionState +let listed: AgentSessionStatusSummary | undefined + +beforeEach(async () => { + root = await mkdtemp(join(tmpdir(), 'orca-main-agent-working-')) + resetHostTestOperationIds() + events = undefined + backgroundTasks = null + chat = EMPTY_STRUCTURED_AGENT_SESSION + listed = undefined + // Written, and the provider has neither opened a turn for it nor answered it. + dispatch = vi.fn(async () => ({ state: 'admitted' as const })) + store = await AgentSessionRecordStore.open({ directory: join(root, 'store'), hostId: 'local' }) + host = new StructuredAgentSessionHost({ + store, + adapter: { + acquire: async (input) => { + events = input.events + return { + process: { + hostId: 'local', + pid: 4242, + processStartTimeMs: 1_700_000_000_000, + spawnToken: input.spawnToken + }, + acquisitionGeneration: 'generation-1', + link: { + linkId: `link-${input.fence}`, + handle: { provider: 'codex' as const, threadId: THREAD }, + origin: 'created' as const, + mintedAtFence: input.fence, + observedAt: NOW + } + } + }, + dispatch, + awaitStarted: vi.fn(async () => undefined), + closeSession: vi.fn(async () => true), + releaseAcquisition: vi.fn(async () => true), + cancelTurn: vi.fn(async () => ({ cancelled: true })), + answerPrompt: vi.fn(async () => undefined), + setOption: vi.fn(async () => undefined), + backgroundTaskState: () => backgroundTasks + }, + journalRoot: root, + claimKeyId: 'key-1', + mintSpawnToken: () => 'spawn-1', + now: () => NOW + }) + expect(await host.attach(CALLER, hostTestAttachParams(null))).toMatchObject({ ok: true }) + host.subscribe({ + id: 'chat-1', + sessionId: SESSION, + emit: (event) => { + chat = reduceStructuredAgentSession(chat, { type: 'event', event: structuredClone(event) }) + } + }) + host.subscribeStatus({ + id: 'list-1', + emit: (event) => { + if (event.type === 'status' && event.session.sessionId === SESSION) { + listed = structuredClone(event.session) + } else if (event.type === 'snapshot') { + listed = event.sessions.find((session) => session.sessionId === SESSION) ?? listed + } + } + }) +}) + +afterEach(async () => { + await host.flushAllStreamedEvents() + await rm(root, { recursive: true, force: true }) +}) + +async function send(text: string): Promise { + const body = hostTestMessage(text) + const clientOperationId = hostTestOperationId() + expect( + await host.send(CALLER, { + envelope: { + sessionId: SESSION, + clientOperationId, + expectedRuntimeFence: 1, + payloadFingerprint: computeAgentSessionPayloadFingerprint({ + method: 'agentSession.send', + sessionId: SESSION, + fields: { body } + }) + }, + body + }) + ).toMatchObject({ ok: true }) + return clientOperationId +} + +async function provider(ordinal: number, body: AgentJournalItemBody): Promise { + events!.appendItem({ ...PROVIDER_ROW, ordinal }, body) + events!.publish() + await host.flushStreamedEvents(SESSION) +} + +/** What the chat's Stop reads: the transport state's rule over the chat's reduced stream. */ +function chatReadsWorking(): boolean { + return isStructuredAgentSessionMainAgentWorking( + activeStructuredAgentSessionTurnId(chat.items), + chat.submissions, + chat.fence + ) +} + +/** What a session list's row reads for the main agent, and the whole row, from the status feed. */ +function listReads(): { mainAgent: string; row: string } { + const summary = listed + if (!summary?.status) { + return { mainAgent: 'none', row: 'none' } + } + const status = structuredAgentSessionAgentStatus({ ...summary, status: summary.status }) + return { mainAgent: status.mainAgent.state, row: status.state } +} + +describe('the main agent read by the chat and by a session list', () => { + it('agrees while a rate-limited request retries with no turn open', async () => { + const id = await send('hello') + await vi.waitFor(async () => + expect((await host.journalSnapshot(SESSION)).submissions[0]?.handedOverAt).toBeDefined() + ) + // What Claude writes for an HTTP 429 retry: a status row, no echo, no turn. + await provider(1, { kind: 'status', text: 'rate_limit', tone: 'error' }) + await provider(2, { kind: 'status', text: 'rate_limit', tone: 'error' }) + + expect(chat.submissions.map((submission) => submission.clientMessageId)).toEqual([id]) + expect(activeStructuredAgentSessionTurnId(chat.items)).toBeNull() + expect(chatReadsWorking()).toBe(true) + expect(listReads().mainAgent).toBe('working') + }) + + it('agrees once the handed-over message is answered and only a subagent still runs', async () => { + dispatch.mockResolvedValueOnce({ + state: 'accepted', + providerIdentity: { provider: 'codex', threadId: THREAD, turnId: 'turn-1', ordinal: 0 } + }) + await send('fan out') + await vi.waitFor(async () => + expect((await host.journalSnapshot(SESSION)).submissions[0]?.dispatchState).toBe('accepted') + ) + await provider(1, { kind: 'turn', turnId: 'turn-1', state: 'running' }) + expect(chatReadsWorking()).toBe(true) + expect(listReads().mainAgent).toBe('working') + + await provider(1, { kind: 'turn', turnId: 'turn-1', state: 'completed', outcome: 'success' }) + backgroundTasks = { + state: 'monitoring', + tasks: [{ id: 'task-1', kind: 'agent', name: 'deep_review', state: 'working' }] + } + host.publishBackgroundTaskState(SESSION) + await host.flushStreamedEvents(SESSION) + + expect(chat.backgroundTasks?.tasks).toHaveLength(1) + // The row reads Working for the subagent; the main agent, and so Stop, does not. + expect(listReads()).toEqual({ mainAgent: 'done', row: 'working' }) + expect(chatReadsWorking()).toBe(false) + }) + + it('agrees when the child that was handed the message exits', async () => { + await send('hello') + await vi.waitFor(async () => + expect((await host.journalSnapshot(SESSION)).submissions[0]?.handedOverAt).toBeDefined() + ) + expect(chatReadsWorking()).toBe(true) + + await host.handleAdapterEvent({ + type: 'ended', + sessionId: SESSION, + fence: store.getRecord(SESSION)!.lease.runtimeFence, + acquisitionGeneration: 'generation-1', + reason: 'codex app-server crashed', + cause: 'unexpected-exit' + }) + await host.flushStreamedEvents(SESSION) + + expect(chat.fence).toBe(store.getRecord(SESSION)!.lease.runtimeFence) + expect(chatReadsWorking()).toBe(false) + expect(listReads().mainAgent).not.toBe('working') + }) +}) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-mutation-plans.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-mutation-plans.ts index fd56944f3bd6..2007f9bc1741 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-mutation-plans.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-mutation-plans.ts @@ -98,7 +98,7 @@ export function sendPlan(params: { export function cancelPlan(params: { envelope: AgentSessionMutationEnvelope - turnId: string + turnId?: string scope?: 'background-tasks' taskId?: string prompt?: { itemId: string; expectedRevision: number } @@ -108,7 +108,7 @@ export function cancelPlan(params: { // Stop is a conversation write; a prompt or background-task cancel needs the live child. ...(params.scope || params.prompt ? {} : { conversationWrite: true as const }), fields: { - turnId: params.turnId, + ...(params.turnId !== undefined ? { turnId: params.turnId } : {}), ...(params.scope ? { scope: params.scope } : {}), ...(params.taskId ? { taskId: params.taskId } : {}), ...(params.prompt ? { prompt: params.prompt } : {}) @@ -116,14 +116,17 @@ export function cancelPlan(params: { run: (ctx) => performCancel(ctx, { clientOperationId: params.envelope.clientOperationId, - turnId: params.turnId, + ...(params.turnId !== undefined ? { turnId: params.turnId } : {}), ...(params.scope ? { scope: params.scope } : {}), ...(params.taskId ? { taskId: params.taskId } : {}), ...(params.prompt ? { prompt: params.prompt } : {}) }), // Interrupting twice would kill a turn the client never asked to stop, so a // replay reports the turn as already handled instead. - replay: () => ({ turnId: params.turnId, cancelled: false }) + replay: () => ({ + ...(params.turnId !== undefined ? { turnId: params.turnId } : {}), + cancelled: false + }) } } diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-turns.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-turns.ts index 49642b9a897e..46c4638dc4ee 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-turns.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-turns.ts @@ -27,6 +27,7 @@ import { DISPATCH_DOUBT_PERSISTENCE_FAILED } from '../agent-session-journal/jour import type { AgentSessionJournal } from '../agent-session-journal/journal-store' import { latestJournalDispatchObservation } from '../agent-session-journal/journal-dispatch-observation' import type { + AgentSessionCancelOutcome, AgentSessionDispatchOutcome, StructuredAgentSessionAdapter, StructuredAgentSessionProviderChildPhase @@ -53,6 +54,8 @@ export type AgentSessionTurnContext = { flushStreamedEvents: () => Promise /** What the host holds about the child this dispatch is for, read at the moment it is needed. */ providerChildPhase?: () => StructuredAgentSessionProviderChildPhase | undefined + /** Who a Stop's refusal row names. */ + failureTextContext?: AgentSessionFailureWordsContext now: () => number } @@ -239,7 +242,8 @@ export async function performCancel( ctx: AgentSessionTurnContext, input: { clientOperationId: string - turnId: string + /** Absent: whatever the conversation has in flight; present: only while that turn is current. */ + turnId?: string scope?: 'background-tasks' taskId?: string prompt?: { itemId: string; expectedRevision: number } @@ -252,30 +256,51 @@ export async function performCancel( } } let cancelled = false - let note: AgentJournalStatusItem = { kind: 'status', text: 'Cancellation requested.' } + let note: AgentJournalStatusItem | null = { kind: 'status', text: 'Cancellation requested.' } try { const dispatchStatus = latestJournalDispatchObservation(ctx.journal, ctx.fence) - cancelled = input.scope - ? ( - await ctx.adapter.stopBackgroundTasks?.({ - sessionId: ctx.sessionId, - fence: ctx.fence, - ...(input.taskId ? { taskId: input.taskId } : {}) - }) - )?.cancelled === true - : ( - await ctx.adapter.cancelTurn({ - sessionId: ctx.sessionId, - turnId: input.turnId, - fence: ctx.fence, - // The journal is what the client read to name a turn, so it is what judges the request. - resolveLiveTurnId: () => ctx.journal.activeTurnId(), - ...(dispatchStatus ? { dispatchStatus } : {}), - ...(input.prompt ? { prompt: { itemId: input.prompt.itemId } } : {}) - }) - ).cancelled - if (!cancelled) { + const outcome: AgentSessionCancelOutcome = input.scope + ? { + cancelled: + ( + await ctx.adapter.stopBackgroundTasks?.({ + sessionId: ctx.sessionId, + fence: ctx.fence, + ...(input.taskId ? { taskId: input.taskId } : {}) + }) + )?.cancelled === true + } + : await ctx.adapter.cancelTurn({ + sessionId: ctx.sessionId, + ...(input.turnId !== undefined ? { turnId: input.turnId } : {}), + fence: ctx.fence, + // The journal is what the client read to name a turn, so it is what judges the request. + resolveLiveTurnId: () => ctx.journal.activeTurnId(), + ...(dispatchStatus ? { dispatchStatus } : {}), + ...(input.prompt ? { prompt: { itemId: input.prompt.itemId } } : {}) + }) + cancelled = outcome.cancelled + if (!cancelled && input.turnId !== undefined) { note = { kind: 'status', text: 'The provider had already finished this turn.' } + } else if (!cancelled && input.prompt) { + note = null + } else if (!cancelled && outcome.unconfirmed) { + note = { + kind: 'status', + ...agentSessionFailureWords(agentSessionFailureFact('cancelUnconfirmed'), { + surface: 'row' + }) + } + } else if (!cancelled) { + // Sent only while the chat reads working, so a Stop that ended nothing must say why. + const detail = outcome.refusal?.detail + note = { + kind: 'status', + ...agentSessionFailureWords( + agentSessionFailureFact('stopRefused', detail ? { detail } : {}), + { ...ctx.failureTextContext, surface: 'row' } + ) + } } } catch (error) { if (input.prompt) { @@ -290,10 +315,11 @@ export async function performCancel( if (cancelled && input.prompt) { await ctx.flushStreamedEvents() } - if (input.scope) { - return { ok: true, value: { turnId: input.turnId, cancelled } } + const value = { ...(input.turnId !== undefined ? { turnId: input.turnId } : {}), cancelled } + if (input.scope || note === null) { + return { ok: true, value } } // Keyed by the operation id so a replayed cancel upserts one item, not two. await appendStatus(ctx, input.clientOperationId, note) - return { ok: true, value: { turnId: input.turnId, cancelled } } + return { ok: true, value } } diff --git a/src/main/runtime/rpc/methods/structured-agent-session.test.ts b/src/main/runtime/rpc/methods/structured-agent-session.test.ts index a8378489c029..f1e27aec3def 100644 --- a/src/main/runtime/rpc/methods/structured-agent-session.test.ts +++ b/src/main/runtime/rpc/methods/structured-agent-session.test.ts @@ -5,6 +5,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { setStructuredAgentSessionHost } from '../../../native-chat/agent-session-wire/structured-agent-session-registry' import { AGENT_SESSION_ACCEPTED_SEND_RUNTIME_CAPABILITY, + AGENT_SESSION_CONVERSATION_STOP_RUNTIME_CAPABILITY, AGENT_SESSION_PENDING_SEND_RESULT_RUNTIME_CAPABILITY, RUNTIME_CAPABILITIES, RUNTIME_PROTOCOL_VERSION, @@ -153,6 +154,8 @@ describe('capability gating', () => { expect(RUNTIME_CAPABILITIES).toContain(AGENT_SESSION_PENDING_SEND_RESULT_RUNTIME_CAPABILITY) // A client tells a host that accepts first, and admits a writer-free Stop before a turn, by it. expect(RUNTIME_CAPABILITIES).toContain(AGENT_SESSION_ACCEPTED_SEND_RUNTIME_CAPABILITY) + // And a cancel naming no turn, which a host that only accepts first still refuses as invalid. + expect(RUNTIME_CAPABILITIES).toContain(AGENT_SESSION_CONVERSATION_STOP_RUNTIME_CAPABILITY) expect(RUNTIME_CAPABILITIES).toContain(STRUCTURED_AGENT_SESSION_HOLD_RUNTIME_CAPABILITY) expect(RUNTIME_CAPABILITIES).toContain(STRUCTURED_AGENT_SESSION_REVEAL_RUNTIME_CAPABILITY) // Separate from the structured capability on purpose: a host can serve the rest of the diff --git a/src/main/runtime/structured-agent-session-codex-turn-end-settlement.test.ts b/src/main/runtime/structured-agent-session-codex-turn-end-settlement.test.ts index fc06a2a782be..c86f7c852420 100644 --- a/src/main/runtime/structured-agent-session-codex-turn-end-settlement.test.ts +++ b/src/main/runtime/structured-agent-session-codex-turn-end-settlement.test.ts @@ -1,5 +1,6 @@ // A Codex send the turn it went into never took: the Stop that interrupts that turn -// withdraws it, and nothing reads as working after. Driven through the shipped host, +// withdraws it, and nothing reads as working after. A Stop sent before Codex opens that +// turn waits for it to open, since Codex refuses an interrupt until then. Driven through the shipped host, // journal and Codex adapter; only the Codex child is fake, keeping Codex 0.157's // turn bookkeeping. @@ -13,6 +14,8 @@ import type { openCodexAppServerConnection } from '../codex/codex-app-server-connection' import { codexTurnLifecycleFake } from '../codex/codex-turn-lifecycle-fake' +import { settledWithin } from '../codex/codex-structured-dispatch-test-support' +import { CODEX_STOP_TURN_OPEN_WAIT_MS } from '../codex/codex-structured-prompt-ownership' import { computeAgentSessionPayloadFingerprint } from '../../shared/agent-session-mutation-envelope' import type { AgentJournalSubmission } from '../../shared/agent-session-journal-types' import { classifyDispatchRejection } from '../../shared/structured-agent-session-dispatch-rejection' @@ -24,6 +27,7 @@ import { hostTestMessage } from '../native-chat/agent-session-wire/structured-agent-session-host-test-data' import type { StructuredAgentSessionHost } from '../native-chat/agent-session-wire/structured-agent-session-host' +import { CHILD_EVICTION_TIMEOUT_MS } from '../native-chat/agent-session-wire/structured-agent-session-host-teardown' import { ensureStructuredAgentSessionHost, stopStructuredAgentSessionRuntime @@ -50,6 +54,8 @@ let host: StructuredAgentSessionHost let fence: number let handlers: CodexAppServerConnectionHandlers | undefined let answers: number +let interrupts: number +let childCloses: number let turns: ReturnType let operations = 0 @@ -78,10 +84,10 @@ async function send(text: string): Promise { return sent.value.clientMessageId } -async function stop(turnId: string): Promise { +async function stop(turnId?: string): Promise { const stopped = await host.cancel(CALLER, { - envelope: envelope('agentSession.cancel', { turnId }), - turnId + envelope: envelope('agentSession.cancel', turnId === undefined ? {} : { turnId }), + ...(turnId === undefined ? {} : { turnId }) }) if (!stopped.ok) { throw new Error(JSON.stringify(stopped.refusal)) @@ -111,6 +117,8 @@ function verdictOf(submissions: readonly AgentJournalSubmission[], clientMessage beforeEach(async () => { root = await mkdtemp(join(tmpdir(), 'orca-codex-turn-end-')) answers = 0 + interrupts = 0 + childCloses = 0 turns = codexTurnLifecycleFake( THREAD, () => (method, params) => handlers?.onNotification?.(method, params) @@ -135,6 +143,7 @@ beforeEach(async () => { return turns.routes['turn/start']() } if (method === 'turn/interrupt') { + interrupts += 1 return turns.routes['turn/interrupt'](params) } return {} @@ -142,7 +151,10 @@ beforeEach(async () => { notify: () => {}, respond: () => {}, respondWithError: () => {}, - close: async () => true + close: async () => { + childCloses += 1 + return true + } } return connection } @@ -215,3 +227,98 @@ describe('a Codex send its turn ended without taking it', () => { expect(after.owesWork).toBe(false) }) }) + +describe('a Stop sent after Codex answered a cold send, before it opened the turn', () => { + it('waits for the turn to open, then stops it and withdraws the send', async () => { + const sent = await send('look around') + await vi.waitFor(() => expect(answers).toBe(1)) + + const stopping = stop() + // Without the wait, it would reach Codex now, which would refuse it, and be done. + expect(await settledWithin(stopping, 1_000)).toBe('held') + expect(interrupts).toBe(0) + turns.start() + await stopping + + expect(interrupts).toBe(1) + expect(turns.turnId).toBeNull() + await vi.waitFor(async () => + expect(verdictOf((await settled()).submissions, sent)).toBe('withdrawn') + ) + expect((await settled()).owesWork).toBe(false) + }) +}) + +describe('a Stop in that window that the turn never opens for', () => { + async function statusRows(): Promise { + return (await host.journalSnapshot(SESSION)).items.flatMap((item) => + item.body.kind === 'status' ? [item.body.text] : [] + ) + } + + async function waitingStop(): Promise<{ stopping: Promise }> { + await send('look around') + await vi.waitFor(() => expect(answers).toBe(1)) + const stopping = stop() + expect(await settledWithin(stopping, 200)).toBe('held') + return { stopping } + } + + it('says Codex had no turn running when that turn ends first', async () => { + const { stopping } = await waitingStop() + + turns.end('interrupted') + await stopping + + expect(interrupts).toBe(0) + expect(await statusRows()).toContain('Codex had no turn running to stop.') + }) + + it('lets a chat closed behind it close within its bound and one eviction', async () => { + const { stopping } = await waitingStop() + + const closing = host.close(SESSION) + + expect( + await settledWithin(closing, CODEX_STOP_TURN_OPEN_WAIT_MS + CHILD_EVICTION_TIMEOUT_MS) + ).not.toBe('held') + expect(await settledWithin(stopping, 0)).not.toBe('held') + expect(childCloses).toBe(1) + expect(interrupts).toBe(0) + expect(await statusRows()).toContain('Codex had no turn running to stop.') + }) + + it('lets the app quit behind it within the eviction budget, and still close the child', async () => { + await waitingStop() + + expect( + await settledWithin(stopStructuredAgentSessionRuntime(), CHILD_EVICTION_TIMEOUT_MS) + ).not.toBe('held') + expect(childCloses).toBe(1) + }) +}) + +describe('a cold send with no Stop behind it', () => { + /** Well inside one eviction step's budget, and far inside the bound a Stop waits. */ + const PROMPTLY_MS = 1_000 + + async function answeredColdSend(): Promise { + await send('look around') + await vi.waitFor(() => expect(answers).toBe(1)) + expect(turns.turnId).toBe('turn-1') + } + + it('never delays closing the chat', async () => { + await answeredColdSend() + + expect(await settledWithin(host.close(SESSION), PROMPTLY_MS)).not.toBe('held') + expect(childCloses).toBe(1) + }) + + it('never delays quitting the app', async () => { + await answeredColdSend() + + expect(await settledWithin(stopStructuredAgentSessionRuntime(), PROMPTLY_MS)).not.toBe('held') + expect(childCloses).toBe(1) + }) +}) diff --git a/src/renderer/src/components/native-chat/NativeChatComposer.test.tsx b/src/renderer/src/components/native-chat/NativeChatComposer.test.tsx index 8eb4c9b74697..bf0cdd4bc6c7 100644 --- a/src/renderer/src/components/native-chat/NativeChatComposer.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatComposer.test.tsx @@ -100,7 +100,7 @@ vi.mock('@/lib/native-chat-telemetry', () => ({ vi.mock('./use-native-chat-draft', () => ({ useNativeChatDraft: (scopeKey: string) => { mocks.draftScopeKeys.push(scopeKey) - return { draft: mocks.draft, setDraft: mocks.setDraft } + return { draft: mocks.draft, setDraft: mocks.setDraft, flushDraftAppends: () => {} } } })) vi.mock('./native-chat-draft-cache', () => ({ diff --git a/src/renderer/src/components/native-chat/NativeChatComposer.tsx b/src/renderer/src/components/native-chat/NativeChatComposer.tsx index 60735d705e27..922ddfd20cdf 100644 --- a/src/renderer/src/components/native-chat/NativeChatComposer.tsx +++ b/src/renderer/src/components/native-chat/NativeChatComposer.tsx @@ -74,7 +74,11 @@ const NativeChatComposerPane = forwardRef(null) const [dictationPressed, setDictationPressed] = useState(false) - const imeEnterGesture = useImeEnterGestureOwnership() const { textareaRef } = useNativeChatComposerAppMenuSelection(imeEnterGesture.isComposing) const { cancelPendingSends, trackPendingSend } = useNativeChatSendLifecycle( terminalTabId, @@ -386,6 +389,7 @@ const NativeChatComposerPane = forwardRef(), messages: null as null | unknown[], messageListProps: initialMessageListProps, - composerProps: null as null | { + composerProps: nullable<{ launchSeed?: NativeChatLaunchSeed structuredTransport?: Record isWorking?: boolean - }, + onStop?: () => void + }>(), approvalCardProps: initialApprovalCardProps, questionCardProps: null as NativeChatQuestionCardProps | null, promptItems: [] as AgentJournalRenderItem[], journalItems: new Array(), respond: vi.fn<(...args: never[]) => unknown>(), cancel: vi.fn<(...args: never[]) => unknown>(), + stop: vi.fn<() => unknown>(), handlePasteEvent: vi.fn<(...args: never[]) => unknown>(), pasteFromClipboard: vi.fn<(...args: never[]) => unknown>(), submissions: [] as unknown[], @@ -99,6 +101,8 @@ export function createStructuredSessionMocks() { showBackgroundTasks: false, isWorking: false, turnId: null as string | null, + // Unset: Stop follows the turn, as against an older host. + canStop: nullable(), supportsBackgroundTaskStop: false, supportsBackgroundTaskStopAll: true, backgroundTasks: [] as AgentSessionBackgroundTask[], @@ -178,6 +182,8 @@ export function createStructuredSessionMocks() { supportsStopAll: mocks.supportsBackgroundTaskStopAll }, turnId: mocks.turnId, + canStop: mocks.canStop ?? mocks.turnId !== null, + stop: mocks.stop, threadGoal: mocks.threadGoal, cancel: mocks.cancel, stopBackgroundTask: (taskId?: string) => @@ -288,6 +294,7 @@ export function createStructuredSessionMocks() { mocks.journalItems = [] mocks.respond.mockReset() mocks.cancel.mockReset() + mocks.stop.mockReset() mocks.handlePasteEvent.mockReset() mocks.pasteFromClipboard.mockReset() mocks.submissions = [] @@ -295,6 +302,7 @@ export function createStructuredSessionMocks() { mocks.showBackgroundTasks = false mocks.isWorking = false mocks.turnId = null + mocks.canStop = null mocks.supportsBackgroundTaskStop = false mocks.supportsBackgroundTaskStopAll = true mocks.stopBackgroundTask.mockReset() diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx index 9a40f63530d6..9279ca63f204 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx @@ -27,6 +27,7 @@ vi.mock('./NativeChatApprovalCard', () => moduleFactories.nativeChatApprovalCard vi.mock('./NativeChatQuestionCard', () => moduleFactories.nativeChatQuestionCard()) import { NativeChatStructuredSession } from './NativeChatStructuredSession' +import { structuredAgentSessionPaneKey } from '../../../../shared/structured-agent-session-projection' describe('NativeChatStructuredSession', () => { afterEach(() => { @@ -34,6 +35,22 @@ describe('NativeChatStructuredSession', () => { resetStructuredSessionMocks() }) + it('gives what a Stop withdrew back to the composer this pane shows', () => { + render( + + ) + const paneKey = structuredAgentSessionPaneKey('structured-tab-1', 'session-1') + expect(mocks.composerProps).toMatchObject({ paneKey }) + expect(mocks.controllerProps).toMatchObject({ composerScopeKey: paneKey }) + }) + it('routes the launch draft and app-menu paste to the structured composer', () => { const draft = { tabId: 'structured-draft-tab', @@ -367,6 +384,16 @@ describe('NativeChatStructuredSession', () => { expect(screen.getByRole('list', { name: 'Agents' })).toBeTruthy() }) + it('offers Stop before any turn opens when the controller can stop, and stops through it', () => { + mocks.canStop = true + render(claudeSessionView('structured-tab-pre-turn', 'session-pre-turn')) + + expect(mocks.composerProps?.isWorking).toBe(true) + act(() => mocks.composerProps?.onStop?.()) + expect(mocks.stop).toHaveBeenCalledOnce() + expect(mocks.cancel).not.toHaveBeenCalled() + }) + it('keeps the strip mounted through a running turn, with the turn owning the voice', () => { // The strip stands for work that OUTLIVES a turn, so `show` is true while // `isMonitoring` is false: mounted, but not speaking as the live indicator. diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx index a6bb8ad8d285..1f416bcc0704 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx @@ -43,8 +43,13 @@ export function NativeChatStructuredSession( const { sendThroughRelaunch } = provisionalLaunch // The host's own word on whether the provider child has answered startup yet. const hostExecution = useStructuredAgentSessionHostExecution(props.sessionId, props.target) + const paneKey = useMemo( + () => structuredAgentSessionPaneKey(props.tabId, props.sessionId), + [props.sessionId, props.tabId] + ) const controller = useStructuredAgentSession({ ...props, + composerScopeKey: paneKey, providerStarting: hostExecution.phase === 'starting', transportEnabled: provisionalLaunch.transportEnabled, ...(provisionalLaunch.launch ? { launch: provisionalLaunch.launch } : {}) @@ -62,10 +67,6 @@ export function NativeChatStructuredSession( id: string sequence: number } | null>(null) - const paneKey = useMemo( - () => structuredAgentSessionPaneKey(props.tabId, props.sessionId), - [props.sessionId, props.tabId] - ) const rootRef = useRef(null) const composerRef = useRef(null) const paneCommands = useStructuredNativeChatPaneCommands({ @@ -376,14 +377,8 @@ export function NativeChatStructuredSession( targetPtyId={null} agent={props.agent} canSend={!prompt} - // Stop, not status: only a provider-minted turn can be interrupted, so the button - // must not flip while a dispatch is still unanswered. - isWorking={controller.turnId !== null} - onStop={() => { - if (controller.turnId) { - void controller.cancel(controller.turnId) - } - }} + isWorking={controller.canStop} + onStop={() => void controller.stop()} structuredTransport={structuredTransport} launchSeed={{ ...launchDraftSignal, ownsTabWideLaunchDraft: true }} /> diff --git a/src/renderer/src/components/native-chat/NativeChatView.test.tsx b/src/renderer/src/components/native-chat/NativeChatView.test.tsx index cc25dabc125d..e7e09d2070ab 100644 --- a/src/renderer/src/components/native-chat/NativeChatView.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatView.test.tsx @@ -35,8 +35,10 @@ function renderResolution( ) } +const notComposing = (): boolean => false + function DraftProbe({ paneKey, sessionId }: { paneKey: string; sessionId: string | null }) { - const { draft, setDraft } = useNativeChatDraft(paneKey) + const { draft, setDraft } = useNativeChatDraft(paneKey, notComposing) return (